Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
.clang_complete
.gcc-flags.json
Thumbs.db
docs/
.serena/
test/
.github/
.pio/
.vscode/
ino/
build/
*.ps1
36 changes: 36 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Repository Guidelines

## Project Structure & Module Organization
- `src/` contains firmware modules (`main.cpp`, `network.cpp`, `i2s_audio.cpp`, helpers like `config_validator.h`); keep new code modular and header-guarded.
- `tests/` stores Unity specs; mirror module names and prefer small, deterministic cases.
- `docs/` houses canonical references (DEVELOPER_GUIDE, OTA docs); revise alongside code so behaviour stays documented.
- `scripts/report_build_size.py` surfaces flash/RAM trends; `.pio/` is generated output and should remain untracked.
- Environments live in `platformio.ini`; derive new boards from `esp32dev` unless a unique profile is required.

## Build, Test, and Development Commands
- `pio run -e esp32dev` compiles the default firmware; append `--target upload --upload-port COM8` for USB flashing.
- `pio run -e esp32dev-ota --target upload` deploys via OTA using the configured host.
- `pio device monitor --port COM8 --baud 115200` captures runtime logging; include relevant excerpts in reviews.
- `python scripts/report_build_size.py .pio/build/esp32dev/firmware.elf` reports size deltas after each build.

## Coding Style & Naming Conventions
- Adopt 4-space indentation with K&R braces to match existing files.
- Classes stay PascalCase, functions camelCase, file-scope constants `kCamelCase`, and compile-time macros ALL_CAPS.
- Guard globals with `static`, favor stack buffers, and route diagnostics through the logging helpers.
- Validate configuration changes via `ConfigValidator` before use.
Comment on lines +16 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Sabitlerin isimlendirme kuralında tutarsızlık var

Satır 18'de "file-scope constants kCamelCase" yazıyor, ama projenin genel kodlama kılavuzunda sabitler için UPPER_SNAKE_CASE (büyük harflerle ve alt çizgiyle) kullanılması gerektiği belirtiliyor. Mesela WIFI_SSID, I2S_SAMPLE_RATE gibi.

Bunu düşünelim: Eğer bir takım arkadaşınız bu belgeyi okuyup kMyConstant şeklinde sabit tanımlarsa, ama başka bir takım arkadaşınız kodlama kılavuzuna bakıp MY_CONSTANT şeklinde tanımlarsa, projede tutarsızlık oluşur. Bu da kodun okunmasını zorlaştırır.

Düzeltme önerisi:

-Classes stay PascalCase, functions camelCase, file-scope constants `kCamelCase`, and compile-time macros ALL_CAPS.
+Classes stay PascalCase, functions camelCase, variables snake_case, and constants/macros UPPER_SNAKE_CASE.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Coding Style & Naming Conventions
- Adopt 4-space indentation with K&R braces to match existing files.
- Classes stay PascalCase, functions camelCase, file-scope constants `kCamelCase`, and compile-time macros ALL_CAPS.
- Guard globals with `static`, favor stack buffers, and route diagnostics through the logging helpers.
- Validate configuration changes via `ConfigValidator` before use.
## Coding Style & Naming Conventions
- Adopt 4-space indentation with K&R braces to match existing files.
- Classes stay PascalCase, functions camelCase, and constants/macros UPPER_SNAKE_CASE.
- Guard globals with `static`, favor stack buffers, and route diagnostics through the logging helpers.
- Validate configuration changes via `ConfigValidator` before use.
🤖 Prompt for AI Agents
AGENTS.md around lines 16-20: sabit isimlendirme kuralı tutarsız — belge satır
18'de "file-scope constants `kCamelCase`" diyor ama proje kılavuzunda sabitler
UPPER_SNAKE_CASE olmalı; düzeltme için bu satırı ve örnekleri UPPER_SNAKE_CASE
olarak değiştirin (ör. WIFI_SSID, I2S_SAMPLE_RATE), ilgili açıklamayı tek bir
standart olarak belirtin ve belge içinde sabit tanımlama örneklerinin hepsini bu
standarda uyacak şekilde güncelleyin.


## Testing Guidelines
- Run `pio test -e esp32dev` before pushing; mention the command in commit or PR notes.
- Place hardware-dependent checks under subfolders (e.g. `tests/hw/`) and document manual steps in the PR.
- Capture serial or OTA evidence when exercising new runtime paths.

## Commit & Pull Request Guidelines
- Follow `type: imperative summary` (`feat: add adaptive buffer telemetry`, `fix: harden wifi reconnect`); keep commits small and focused.
- Reference issue IDs or doc updates in the body and list the build/test commands you executed.
- PRs should note target board, behavioural impact, and relevant logs or size reports.
- Sync code and docs in one reviewable change and confirm CI or local checks before requesting review.

## Security & Configuration Tips
- Never commit credentials; keep `src/config.h` sanitized and describe overrides instead of storing secrets.
- Update `platformio.ini` comments and docs when OTA hosts or ports change.
- Audit new network paths with `ConfigValidator` to ensure bounds and defaults stay safe.
Loading