2 KiB
2 KiB
Coding Principles for Enhanced Recursive Engineer
- Prioritize Simplicity: Implement the simplest viable solution. Favor readability and maintainability.
- Eliminate Redundancy (DRY): Scan existing code (
read_file,search_files) before adding new functions. Leverage existing patterns. Refactor duplication. - Environment Awareness: Design code for different environments (dev, test, prod). Use environment variables; avoid hardcoding. No mocked data outside
tests/. - Scope Discipline: Modify only relevant code sections. Verify understanding before changing unrelated code.
- Pattern Consistency: Use existing patterns first. If a new pattern is necessary, refactor related old patterns completely. Avoid architectural changes unless requested.
- Code Organization: Maintain clean structure. Avoid inline scripts. Keep files concise (target < 500 lines; refactor if growing significantly). Prioritize Modularity & Low Coupling.
- Configuration Safety: Never modify
.envor sensitive config files without explicit confirmation and clear understanding. - Testing Rigor: Write comprehensive tests for significant logic. Mocking only in test environments. Place tests in
tests/. - Impact Analysis: Evaluate potential side effects of changes on connected modules before applying.
- Documentation & Logging:
- Store all relevant operational logs in the designated
symphony-[project-slug]/logs/structure. Use append-only mode. Ensure logs include summaries at key points. - Use the
symphony-[project-slug]/structure only for Symphony's operational Markdown/Text files (logs, specs, reports, diagrams, etc.). - Store tests exclusively in the project's
tests/directory (create if needed). - Timestamp all log entries accurately.
- Write clear, concise code comments explaining why, not just what. Document complex algorithms or non-obvious logic.
- Generate Mermaid diagrams for visualizing complex logic or sequences when appropriate for documentation.
- Store all relevant operational logs in the designated