Skip to content

Commit 444fbe9

Browse files
Copilotjosecelano
andcommitted
docs: [#79] add comprehensive DDD layer placement guide
Co-authored-by: josecelano <[email protected]>
1 parent 018fad5 commit 444fbe9

File tree

3 files changed

+800
-15
lines changed

3 files changed

+800
-15
lines changed

.github/copilot-instructions.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,16 @@ These principles should guide all development decisions, code reviews, and featu
6464

6565
## 🔧 Essential Rules
6666

67-
1. **Before creating branches**: Read [`docs/contributing/branching.md`](../docs/contributing/branching.md) for naming conventions (`{issue-number}-{short-description}`)
67+
1. **Before placing code in DDD layers**: Read [`docs/contributing/ddd-layer-placement.md`](../docs/contributing/ddd-layer-placement.md) for comprehensive guidance on which code belongs in which layer (Domain, Application, Infrastructure, Presentation). This guide includes rules, red flags, examples, and a decision flowchart to help you make the right architectural decisions.
6868

69-
2. **Before committing**: Read [`docs/contributing/commit-process.md`](../docs/contributing/commit-process.md) for conventional commits
69+
2. **Before creating branches**: Read [`docs/contributing/branching.md`](../docs/contributing/branching.md) for naming conventions (`{issue-number}-{short-description}`)
70+
71+
3. **Before committing**: Read [`docs/contributing/commit-process.md`](../docs/contributing/commit-process.md) for conventional commits
7072

7173
- **With issue branch**: `{type}: [#{issue}] {description}` (when branch name starts with `{issue-number}-`)
7274
- **Without issue branch**: `{type}: {description}` (when working on main or branch without issue number prefix)
7375

74-
3. **Before committing**: Always run the pre-commit verification script - all checks must pass before staging files or creating commits, regardless of the tool or method used:
76+
4. **Before committing**: Always run the pre-commit verification script - all checks must pass before staging files or creating commits, regardless of the tool or method used:
7577

7678
```bash
7779
./scripts/pre-commit.sh
@@ -85,17 +87,17 @@ These principles should guide all development decisions, code reviews, and featu
8587
- Git clients: GitHub Desktop, GitKraken, etc.
8688
- CI/CD: Any automated commits or merges
8789

88-
4. **Before working with Tera templates**: Read [`docs/contributing/templates.md`](../docs/contributing/templates.md) for correct variable syntax - use `{{ variable }}` not `{ { variable } }`. Tera template files have the `.tera` extension.
90+
5. **Before working with Tera templates**: Read [`docs/contributing/templates.md`](../docs/contributing/templates.md) for correct variable syntax - use `{{ variable }}` not `{ { variable } }`. Tera template files have the `.tera` extension.
8991

90-
5. **When adding new Ansible playbooks**: Read [`docs/contributing/templates.md`](../docs/contributing/templates.md) for the complete guide. **CRITICAL**: Static playbooks (without `.tera` extension) must be registered in `src/infrastructure/external_tools/ansible/template/renderer/mod.rs` in the `copy_static_templates` method, otherwise they won't be copied to the build directory and Ansible will fail with "playbook not found" error.
92+
6. **When adding new Ansible playbooks**: Read [`docs/contributing/templates.md`](../docs/contributing/templates.md) for the complete guide. **CRITICAL**: Static playbooks (without `.tera` extension) must be registered in `src/infrastructure/external_tools/ansible/template/renderer/mod.rs` in the `copy_static_templates` method, otherwise they won't be copied to the build directory and Ansible will fail with "playbook not found" error.
9193

92-
6. **When handling errors in code**: Read [`docs/contributing/error-handling.md`](../docs/contributing/error-handling.md) for error handling principles. Prefer explicit enum errors over anyhow for better pattern matching and user experience. Make errors clear, include sufficient context for traceability, and ensure they are actionable with specific fix instructions.
94+
7. **When handling errors in code**: Read [`docs/contributing/error-handling.md`](../docs/contributing/error-handling.md) for error handling principles. Prefer explicit enum errors over anyhow for better pattern matching and user experience. Make errors clear, include sufficient context for traceability, and ensure they are actionable with specific fix instructions.
9395

94-
7. **Understanding expected errors**: Read [`docs/contributing/known-issues.md`](../docs/contributing/known-issues.md) for known issues and expected behaviors. Some errors that appear red in E2E test output (like SSH host key warnings) are normal and expected - not actual failures.
96+
8. **Understanding expected errors**: Read [`docs/contributing/known-issues.md`](../docs/contributing/known-issues.md) for known issues and expected behaviors. Some errors that appear red in E2E test output (like SSH host key warnings) are normal and expected - not actual failures.
9597

96-
8. **Before making engineering decisions**: Document significant architectural or design decisions as Architectural Decision Records (ADRs) in `docs/decisions/`. Read [`docs/decisions/README.md`](../docs/decisions/README.md) for the ADR template and guidelines. This ensures decisions are properly documented with context, rationale, and consequences for future reference.
98+
9. **Before making engineering decisions**: Document significant architectural or design decisions as Architectural Decision Records (ADRs) in `docs/decisions/`. Read [`docs/decisions/README.md`](../docs/decisions/README.md) for the ADR template and guidelines. This ensures decisions are properly documented with context, rationale, and consequences for future reference.
9799

98-
9. **When organizing code within modules**: Follow the module organization conventions in [`docs/contributing/module-organization.md`](../docs/contributing/module-organization.md). Use top-down organization with public items first, high-level abstractions before low-level details, and important responsibilities before secondary concerns like error types.
100+
10. **When organizing code within modules**: Follow the module organization conventions in [`docs/contributing/module-organization.md`](../docs/contributing/module-organization.md). Use top-down organization with public items first, high-level abstractions before low-level details, and important responsibilities before secondary concerns like error types.
99101

100102
## 🧪 Build & Test
101103

docs/contributing/README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@ This guide will help you understand our development practices and contribution w
44

55
## 📋 Quick Reference
66

7-
| Topic | File |
8-
| ------------------------------------ | ---------------------------------------- |
9-
| Creating roadmap issues | [roadmap-issues.md](./roadmap-issues.md) |
10-
| Branching conventions | [branching.md](./branching.md) |
11-
| Commit process and pre-commit checks | [commit-process.md](./commit-process.md) |
12-
| Code quality and linting | [linting.md](./linting.md) |
7+
| Topic | File |
8+
| ------------------------------------ | ---------------------------------------------------- |
9+
| DDD layer placement (architecture) | [ddd-layer-placement.md](./ddd-layer-placement.md) |
10+
| Creating roadmap issues | [roadmap-issues.md](./roadmap-issues.md) |
11+
| Branching conventions | [branching.md](./branching.md) |
12+
| Commit process and pre-commit checks | [commit-process.md](./commit-process.md) |
13+
| Code quality and linting | [linting.md](./linting.md) |
14+
| Module organization within files | [module-organization.md](./module-organization.md) |
15+
| Error handling principles | [error-handling.md](./error-handling.md) |
16+
| Working with Tera templates | [templates.md](./templates.md) |
17+
| Debugging techniques | [debugging.md](./debugging.md) |
18+
| Spell checking and dictionaries | [spelling.md](./spelling.md) |
19+
| Known issues and expected behaviors | [known-issues.md](./known-issues.md) |
20+
| Logging best practices | [logging-guide.md](./logging-guide.md) |
1321

1422
## 🚀 Getting Started
1523

0 commit comments

Comments
 (0)