agile-context-engineering 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +18 -0
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +7 -1
- package/README.md +16 -12
- package/agents/ace-code-discovery-analyst.md +245 -245
- package/agents/ace-code-integration-analyst.md +248 -248
- package/agents/ace-code-reviewer.md +375 -375
- package/agents/ace-product-owner.md +365 -361
- package/agents/ace-project-researcher.md +606 -606
- package/agents/ace-technical-application-architect.md +315 -315
- package/bin/install.js +587 -173
- package/hooks/ace-check-update.js +15 -14
- package/hooks/ace-statusline.js +30 -12
- package/hooks/hooks.json +14 -0
- package/package.json +3 -2
- package/shared/lib/ace-core.js +53 -0
- package/shared/lib/ace-core.test.js +308 -308
- package/shared/lib/ace-story.test.js +250 -250
- package/skills/execute-story/SKILL.md +116 -110
- package/skills/execute-story/script.js +13 -27
- package/skills/execute-story/script.test.js +261 -261
- package/skills/execute-story/story-template.xml +451 -451
- package/skills/execute-story/workflow.xml +3 -1
- package/skills/help/SKILL.md +71 -69
- package/skills/help/script.js +32 -35
- package/skills/help/script.test.js +183 -183
- package/skills/help/workflow.xml +14 -3
- package/skills/init-coding-standards/SKILL.md +91 -72
- package/skills/init-coding-standards/coding-standards-template.xml +531 -531
- package/skills/init-coding-standards/script.js +50 -59
- package/skills/init-coding-standards/script.test.js +70 -70
- package/skills/init-coding-standards/workflow.xml +1 -1
- package/skills/map-cross-cutting/SKILL.md +126 -89
- package/skills/map-cross-cutting/workflow.xml +1 -1
- package/skills/map-guide/SKILL.md +126 -89
- package/skills/map-guide/workflow.xml +1 -1
- package/skills/map-pattern/SKILL.md +125 -89
- package/skills/map-pattern/workflow.xml +1 -1
- package/skills/map-story/SKILL.md +180 -127
- package/skills/map-story/templates/tech-debt-index.xml +125 -125
- package/skills/map-story/workflow.xml +2 -2
- package/skills/map-subsystem/SKILL.md +155 -111
- package/skills/map-subsystem/script.js +51 -60
- package/skills/map-subsystem/script.test.js +68 -68
- package/skills/map-subsystem/templates/subsystem-architecture.xml +343 -343
- package/skills/map-subsystem/templates/subsystem-structure.xml +234 -234
- package/skills/map-subsystem/workflow.xml +1173 -1173
- package/skills/map-sys-doc/SKILL.md +125 -90
- package/skills/map-sys-doc/workflow.xml +1 -1
- package/skills/map-system/SKILL.md +103 -85
- package/skills/map-system/script.js +75 -84
- package/skills/map-system/script.test.js +73 -73
- package/skills/map-system/templates/system-structure.xml +177 -177
- package/skills/map-system/templates/testing-framework.xml +283 -283
- package/skills/map-system/workflow.xml +667 -667
- package/skills/map-walkthrough/SKILL.md +140 -92
- package/skills/map-walkthrough/workflow.xml +457 -457
- package/skills/plan-backlog/SKILL.md +93 -75
- package/skills/plan-backlog/script.js +121 -136
- package/skills/plan-backlog/script.test.js +83 -83
- package/skills/plan-backlog/workflow.xml +1348 -1348
- package/skills/plan-feature/SKILL.md +99 -76
- package/skills/plan-feature/feature-template.xml +361 -361
- package/skills/plan-feature/script.js +131 -148
- package/skills/plan-feature/script.test.js +80 -80
- package/skills/plan-feature/workflow.xml +1 -1
- package/skills/plan-product-vision/SKILL.md +91 -75
- package/skills/plan-product-vision/product-vision-template.xml +227 -227
- package/skills/plan-product-vision/script.js +51 -60
- package/skills/plan-product-vision/script.test.js +69 -69
- package/skills/plan-product-vision/workflow.xml +337 -337
- package/skills/plan-story/SKILL.md +125 -102
- package/skills/plan-story/script.js +18 -49
- package/skills/plan-story/story-template.xml +8 -1
- package/skills/plan-story/workflow.xml +17 -1
- package/skills/research-external-solution/SKILL.md +120 -107
- package/skills/research-external-solution/external-solution-template.xml +832 -832
- package/skills/research-external-solution/script.js +229 -238
- package/skills/research-external-solution/script.test.js +134 -134
- package/skills/research-external-solution/workflow.xml +657 -657
- package/skills/research-integration-solution/SKILL.md +121 -98
- package/skills/research-integration-solution/integration-solution-template.xml +1015 -1015
- package/skills/research-integration-solution/script.js +223 -231
- package/skills/research-integration-solution/script.test.js +134 -134
- package/skills/research-integration-solution/workflow.xml +711 -711
- package/skills/research-story-wiki/SKILL.md +101 -92
- package/skills/research-story-wiki/script.js +223 -231
- package/skills/research-story-wiki/script.test.js +138 -138
- package/skills/research-story-wiki/story-wiki-template.xml +194 -194
- package/skills/research-story-wiki/workflow.xml +473 -473
- package/skills/research-technical-solution/SKILL.md +131 -103
- package/skills/research-technical-solution/script.js +223 -231
- package/skills/research-technical-solution/script.test.js +134 -134
- package/skills/research-technical-solution/technical-solution-template.xml +1025 -1025
- package/skills/research-technical-solution/workflow.xml +761 -761
- package/skills/review-story/SKILL.md +99 -100
- package/skills/review-story/script.js +8 -16
- package/skills/review-story/script.test.js +169 -169
- package/skills/review-story/story-template.xml +451 -451
- package/skills/review-story/workflow.xml +1 -1
- package/skills/update/SKILL.md +65 -53
- package/skills/update/workflow.xml +21 -5
|
@@ -1,235 +1,235 @@
|
|
|
1
|
-
<subsystem-structure>
|
|
2
|
-
<purpose>
|
|
3
|
-
Template for `.docs/wiki/subsystems/[subsystem-name]/structure.md` — the physical file
|
|
4
|
-
organization within a single subsystem. Answers "I'm working in this subsystem, where do I put things?"
|
|
5
|
-
|
|
6
|
-
Complements system-structure.md (which shows the system-wide layout and subsystem index).
|
|
7
|
-
One instance per subsystem — each gets its own structure doc.
|
|
8
|
-
|
|
9
|
-
A "subsystem" is any cohesive code unit with a clear responsibility boundary —
|
|
10
|
-
whether deployed as a microservice, a monolith module, or a library package.
|
|
11
|
-
|
|
12
|
-
**Monoliths have subsystems too.** A monolith with bounded contexts, feature modules,
|
|
13
|
-
or domain packages gets one subsystem-structure doc per module — same as microservices.
|
|
14
|
-
The only difference is deployment topology, not documentation structure.
|
|
15
|
-
</purpose>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<subsystem-overview>
|
|
19
|
-
## [Subsystem Name]
|
|
20
|
-
|
|
21
|
-
**Root:** `[path from project root]`
|
|
22
|
-
**Responsibility:** [One-line purpose — what this subsystem owns]
|
|
23
|
-
</subsystem-overview>
|
|
24
|
-
|
|
25
|
-
<directory-layout>
|
|
26
|
-
## Directory Layout
|
|
27
|
-
|
|
28
|
-
[ASCII box-drawing tree of ALL directories and files with purpose - use ├── └── │ characters for tree structure only]
|
|
29
|
-
|
|
30
|
-
Complete file tree of this subsystem. List every file and directory — this is the
|
|
31
|
-
full inventory. An agent reading this should know exactly what exists without running `ls`.
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
[subsystem-root]/
|
|
35
|
-
├── [dir]/ # [Purpose]
|
|
36
|
-
│ ├── [subdir]/ # [Purpose]
|
|
37
|
-
│ │ └── [subdir]/ # [Purpose]
|
|
38
|
-
│ └── [subdir]/ # [Purpose]
|
|
39
|
-
├── [dir]/ # [Purpose]
|
|
40
|
-
│ ├── [subdir]/ # [Purpose]
|
|
41
|
-
│ └── [file] # [Purpose]
|
|
42
|
-
├── [dir]/ # [Purpose]
|
|
43
|
-
└── [file] # [Purpose]
|
|
44
|
-
```
|
|
45
|
-
</directory-layout>
|
|
46
|
-
|
|
47
|
-
<directory-purposes>
|
|
48
|
-
## Directory Purposes
|
|
49
|
-
|
|
50
|
-
**[Directory Name]:**
|
|
51
|
-
- Purpose: [What lives here]
|
|
52
|
-
- Contains: [Types of files: e.g., "*.ts source files", "component directories"]
|
|
53
|
-
- Key files: `[important files in this directory]`
|
|
54
|
-
- Subdirectories: [If nested, describe structure]
|
|
55
|
-
|
|
56
|
-
**[Directory Name]:**
|
|
57
|
-
- Purpose: [What lives here]
|
|
58
|
-
- Contains: [Types of files]
|
|
59
|
-
- Key files: `[important files]`
|
|
60
|
-
- Subdirectories: [Structure]
|
|
61
|
-
</directory-purposes>
|
|
62
|
-
|
|
63
|
-
<key-file-locations>
|
|
64
|
-
## Key File Locations
|
|
65
|
-
|
|
66
|
-
**Entry Points:**
|
|
67
|
-
- `[path]`: [Purpose — e.g., "HTTP server startup", "CLI entry point"]
|
|
68
|
-
|
|
69
|
-
**Configuration:**
|
|
70
|
-
- `[path]`: [Purpose — e.g., "Module config", "DI container setup"]
|
|
71
|
-
|
|
72
|
-
**Core Logic:**
|
|
73
|
-
- `[path]`: [Purpose — e.g., "Domain services", "Business rules"]
|
|
74
|
-
- `[path]`: [Purpose — e.g., "Data access", "Repository implementations"]
|
|
75
|
-
|
|
76
|
-
**API Surface:**
|
|
77
|
-
- `[path]`: [Purpose — e.g., "Route definitions", "Controller handlers"]
|
|
78
|
-
- `[path]`: [Purpose — e.g., "DTOs / request-response types"]
|
|
79
|
-
|
|
80
|
-
**Testing:**
|
|
81
|
-
- `[path]`: [Purpose — e.g., "Unit tests"]
|
|
82
|
-
- `[path]`: [Purpose — e.g., "Test fixtures / factories"]
|
|
83
|
-
</key-file-locations>
|
|
84
|
-
|
|
85
|
-
<naming-conventions>
|
|
86
|
-
## Naming Conventions
|
|
87
|
-
|
|
88
|
-
Subsystem-specific patterns. If this subsystem follows system-wide conventions
|
|
89
|
-
without deviation, state: "Follows system-wide conventions — see system-structure.md"
|
|
90
|
-
|
|
91
|
-
**Files:**
|
|
92
|
-
- [Pattern]: [Example — e.g., "kebab-case.ts for modules"]
|
|
93
|
-
- [Pattern]: [Example — e.g., "PascalCase.tsx for React components"]
|
|
94
|
-
- [Pattern]: [Example — e.g., "PascalCase.cs for C# classes"]
|
|
95
|
-
- [Pattern]: [Example — e.g., "*.test.ts co-located with source"]
|
|
96
|
-
|
|
97
|
-
**Directories:**
|
|
98
|
-
- [Pattern]: [Example — e.g., "kebab-case for feature directories"]
|
|
99
|
-
- [Pattern]: [Example — e.g., "plural names for collections"]
|
|
100
|
-
|
|
101
|
-
**Special Patterns:**
|
|
102
|
-
- [Pattern]: [Example — e.g., "index.ts barrel exports per directory"]
|
|
103
|
-
- [Pattern]: [Example — e.g., "__tests__/ for test directories"]
|
|
104
|
-
</naming-conventions>
|
|
105
|
-
|
|
106
|
-
<where-to-add-new-code>
|
|
107
|
-
## Where to Add New Code
|
|
108
|
-
|
|
109
|
-
**New Feature:**
|
|
110
|
-
- Primary code: `[directory path]`
|
|
111
|
-
- Tests: `[directory path]`
|
|
112
|
-
- Config if needed: `[directory path]`
|
|
113
|
-
|
|
114
|
-
**New Component / Module:**
|
|
115
|
-
- Implementation: `[directory path]`
|
|
116
|
-
- Types: `[directory path]`
|
|
117
|
-
- Tests: `[directory path]`
|
|
118
|
-
|
|
119
|
-
**New Route / Endpoint / Command:**
|
|
120
|
-
- Definition: `[directory path]`
|
|
121
|
-
- Handler: `[directory path]`
|
|
122
|
-
- Tests: `[directory path]`
|
|
123
|
-
|
|
124
|
-
**New Domain Entity / Model:**
|
|
125
|
-
- Entity: `[directory path]`
|
|
126
|
-
- Repository: `[directory path]`
|
|
127
|
-
- Tests: `[directory path]`
|
|
128
|
-
|
|
129
|
-
**New Service / Use Case:**
|
|
130
|
-
- Service: `[directory path]`
|
|
131
|
-
- Use case / application logic: `[directory path]`
|
|
132
|
-
- Interface / contract: `[directory path]`
|
|
133
|
-
- Tests: `[directory path]`
|
|
134
|
-
|
|
135
|
-
**New DTO / Request-Response Object:**
|
|
136
|
-
- DTOs: `[directory path]`
|
|
137
|
-
- Validators: `[directory path]`
|
|
138
|
-
|
|
139
|
-
**New Mapper / Transformer:**
|
|
140
|
-
- Mappers: `[directory path]`
|
|
141
|
-
|
|
142
|
-
**New Constants / Enums:**
|
|
143
|
-
- Constants: `[directory path]`
|
|
144
|
-
- Enums: `[directory path]`
|
|
145
|
-
- Magic values / lookup tables: `[directory path]`
|
|
146
|
-
|
|
147
|
-
**New Database Script / Migration:**
|
|
148
|
-
- Migrations: `[directory path]`
|
|
149
|
-
- Seeds / fixtures: `[directory path]`
|
|
150
|
-
- Stored procedures: `[directory path]`
|
|
151
|
-
|
|
152
|
-
**Shared Kernel / Cross-Cutting:**
|
|
153
|
-
- Shared kernel: `[directory path]`
|
|
154
|
-
- Base classes / interfaces: `[directory path]`
|
|
155
|
-
- Common exceptions: `[directory path]`
|
|
156
|
-
- Extension methods / helpers: `[directory path]`
|
|
157
|
-
|
|
158
|
-
**Utilities:**
|
|
159
|
-
- Shared helpers: `[directory path]`
|
|
160
|
-
- Type definitions: `[directory path]`
|
|
161
|
-
</where-to-add-new-code>
|
|
162
|
-
|
|
163
|
-
<special-directories>
|
|
164
|
-
## Special Directories
|
|
165
|
-
|
|
166
|
-
Directories with special meaning within this subsystem.
|
|
167
|
-
|
|
168
|
-
**[Directory]:**
|
|
169
|
-
- Purpose: [e.g., "Generated code", "Build output", "Migrations"]
|
|
170
|
-
- Source: [e.g., "Auto-generated by X", "Manually maintained"]
|
|
171
|
-
- Committed: [Yes/No]
|
|
172
|
-
</special-directories>
|
|
173
|
-
</template>
|
|
174
|
-
|
|
175
|
-
<guidelines>
|
|
176
|
-
|
|
177
|
-
**Subsystem Overview:**
|
|
178
|
-
- Root path must be relative to project root — agents use this to navigate
|
|
179
|
-
- Responsibility is one line. If you need more, it goes in the subsystem architecture doc
|
|
180
|
-
|
|
181
|
-
**Directory Layout:**
|
|
182
|
-
- List EVERY file and directory. This is the complete inventory of the subsystem
|
|
183
|
-
- Every directory gets a `# Purpose` comment
|
|
184
|
-
- Every file gets a `# Purpose` comment
|
|
185
|
-
- Use ASCII box-drawing characters: `├── └── │`
|
|
186
|
-
- Skip node_modules, build output, and other generated dirs (mention in Special Directories)
|
|
187
|
-
|
|
188
|
-
**Directory Purposes:**
|
|
189
|
-
- One entry per directory that has meaningful content
|
|
190
|
-
- "Key files" should list the 2-3 most important files a developer would look at first
|
|
191
|
-
- Skip directories that are obvious from the tree (e.g., don't describe `tests/` if it just has tests)
|
|
192
|
-
|
|
193
|
-
**Key File Locations:**
|
|
194
|
-
- Paths must be relative to subsystem root
|
|
195
|
-
- Group by role, not by directory
|
|
196
|
-
- Every entry needs a purpose — `user.service.ts` tells you nothing; "Core user CRUD operations" does
|
|
197
|
-
- Focus on files a developer touches when working on this subsystem
|
|
198
|
-
|
|
199
|
-
**Where to Add New Code:**
|
|
200
|
-
- This is the most actionable section. An agent reads this when creating new files
|
|
201
|
-
- Be specific — `src/features/[feature-name]/` not "the features directory"
|
|
202
|
-
- Cover the common cases for this subsystem's domain
|
|
203
|
-
|
|
204
|
-
**Naming Conventions:**
|
|
205
|
-
- Only document if this subsystem has patterns different from system-wide conventions
|
|
206
|
-
- If it follows system-wide conventions exactly, say so and link to system-structure.md
|
|
207
|
-
- Show actual examples from the codebase, not theoretical patterns
|
|
208
|
-
|
|
209
|
-
**What does NOT belong here:**
|
|
210
|
-
- Conceptual architecture (that's the subsystem architecture doc)
|
|
211
|
-
- Technology stack (that's system-architecture.md)
|
|
212
|
-
- Code conventions like formatting rules (that's a conventions doc)
|
|
213
|
-
- Other subsystems' structure (each has its own doc)
|
|
214
|
-
|
|
215
|
-
</guidelines>
|
|
216
|
-
|
|
217
|
-
<evolution>
|
|
218
|
-
|
|
219
|
-
Update when the physical layout of this subsystem changes.
|
|
220
|
-
|
|
221
|
-
**Update triggers:**
|
|
222
|
-
- New top-level directory added within subsystem
|
|
223
|
-
- Directory renamed, moved, or removed
|
|
224
|
-
- New entry point or configuration file added
|
|
225
|
-
- Naming convention changed
|
|
226
|
-
- "Where to add new code" guidance no longer accurate
|
|
227
|
-
|
|
228
|
-
**NOT an update trigger:**
|
|
229
|
-
- New files added within existing directories
|
|
230
|
-
- New features that follow existing structure
|
|
231
|
-
- Bug fixes or internal refactoring
|
|
232
|
-
|
|
233
|
-
</evolution>
|
|
234
|
-
|
|
1
|
+
<subsystem-structure>
|
|
2
|
+
<purpose>
|
|
3
|
+
Template for `.docs/wiki/subsystems/[subsystem-name]/structure.md` — the physical file
|
|
4
|
+
organization within a single subsystem. Answers "I'm working in this subsystem, where do I put things?"
|
|
5
|
+
|
|
6
|
+
Complements system-structure.md (which shows the system-wide layout and subsystem index).
|
|
7
|
+
One instance per subsystem — each gets its own structure doc.
|
|
8
|
+
|
|
9
|
+
A "subsystem" is any cohesive code unit with a clear responsibility boundary —
|
|
10
|
+
whether deployed as a microservice, a monolith module, or a library package.
|
|
11
|
+
|
|
12
|
+
**Monoliths have subsystems too.** A monolith with bounded contexts, feature modules,
|
|
13
|
+
or domain packages gets one subsystem-structure doc per module — same as microservices.
|
|
14
|
+
The only difference is deployment topology, not documentation structure.
|
|
15
|
+
</purpose>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<subsystem-overview>
|
|
19
|
+
## [Subsystem Name]
|
|
20
|
+
|
|
21
|
+
**Root:** `[path from project root]`
|
|
22
|
+
**Responsibility:** [One-line purpose — what this subsystem owns]
|
|
23
|
+
</subsystem-overview>
|
|
24
|
+
|
|
25
|
+
<directory-layout>
|
|
26
|
+
## Directory Layout
|
|
27
|
+
|
|
28
|
+
[ASCII box-drawing tree of ALL directories and files with purpose - use ├── └── │ characters for tree structure only]
|
|
29
|
+
|
|
30
|
+
Complete file tree of this subsystem. List every file and directory — this is the
|
|
31
|
+
full inventory. An agent reading this should know exactly what exists without running `ls`.
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
[subsystem-root]/
|
|
35
|
+
├── [dir]/ # [Purpose]
|
|
36
|
+
│ ├── [subdir]/ # [Purpose]
|
|
37
|
+
│ │ └── [subdir]/ # [Purpose]
|
|
38
|
+
│ └── [subdir]/ # [Purpose]
|
|
39
|
+
├── [dir]/ # [Purpose]
|
|
40
|
+
│ ├── [subdir]/ # [Purpose]
|
|
41
|
+
│ └── [file] # [Purpose]
|
|
42
|
+
├── [dir]/ # [Purpose]
|
|
43
|
+
└── [file] # [Purpose]
|
|
44
|
+
```
|
|
45
|
+
</directory-layout>
|
|
46
|
+
|
|
47
|
+
<directory-purposes>
|
|
48
|
+
## Directory Purposes
|
|
49
|
+
|
|
50
|
+
**[Directory Name]:**
|
|
51
|
+
- Purpose: [What lives here]
|
|
52
|
+
- Contains: [Types of files: e.g., "*.ts source files", "component directories"]
|
|
53
|
+
- Key files: `[important files in this directory]`
|
|
54
|
+
- Subdirectories: [If nested, describe structure]
|
|
55
|
+
|
|
56
|
+
**[Directory Name]:**
|
|
57
|
+
- Purpose: [What lives here]
|
|
58
|
+
- Contains: [Types of files]
|
|
59
|
+
- Key files: `[important files]`
|
|
60
|
+
- Subdirectories: [Structure]
|
|
61
|
+
</directory-purposes>
|
|
62
|
+
|
|
63
|
+
<key-file-locations>
|
|
64
|
+
## Key File Locations
|
|
65
|
+
|
|
66
|
+
**Entry Points:**
|
|
67
|
+
- `[path]`: [Purpose — e.g., "HTTP server startup", "CLI entry point"]
|
|
68
|
+
|
|
69
|
+
**Configuration:**
|
|
70
|
+
- `[path]`: [Purpose — e.g., "Module config", "DI container setup"]
|
|
71
|
+
|
|
72
|
+
**Core Logic:**
|
|
73
|
+
- `[path]`: [Purpose — e.g., "Domain services", "Business rules"]
|
|
74
|
+
- `[path]`: [Purpose — e.g., "Data access", "Repository implementations"]
|
|
75
|
+
|
|
76
|
+
**API Surface:**
|
|
77
|
+
- `[path]`: [Purpose — e.g., "Route definitions", "Controller handlers"]
|
|
78
|
+
- `[path]`: [Purpose — e.g., "DTOs / request-response types"]
|
|
79
|
+
|
|
80
|
+
**Testing:**
|
|
81
|
+
- `[path]`: [Purpose — e.g., "Unit tests"]
|
|
82
|
+
- `[path]`: [Purpose — e.g., "Test fixtures / factories"]
|
|
83
|
+
</key-file-locations>
|
|
84
|
+
|
|
85
|
+
<naming-conventions>
|
|
86
|
+
## Naming Conventions
|
|
87
|
+
|
|
88
|
+
Subsystem-specific patterns. If this subsystem follows system-wide conventions
|
|
89
|
+
without deviation, state: "Follows system-wide conventions — see system-structure.md"
|
|
90
|
+
|
|
91
|
+
**Files:**
|
|
92
|
+
- [Pattern]: [Example — e.g., "kebab-case.ts for modules"]
|
|
93
|
+
- [Pattern]: [Example — e.g., "PascalCase.tsx for React components"]
|
|
94
|
+
- [Pattern]: [Example — e.g., "PascalCase.cs for C# classes"]
|
|
95
|
+
- [Pattern]: [Example — e.g., "*.test.ts co-located with source"]
|
|
96
|
+
|
|
97
|
+
**Directories:**
|
|
98
|
+
- [Pattern]: [Example — e.g., "kebab-case for feature directories"]
|
|
99
|
+
- [Pattern]: [Example — e.g., "plural names for collections"]
|
|
100
|
+
|
|
101
|
+
**Special Patterns:**
|
|
102
|
+
- [Pattern]: [Example — e.g., "index.ts barrel exports per directory"]
|
|
103
|
+
- [Pattern]: [Example — e.g., "__tests__/ for test directories"]
|
|
104
|
+
</naming-conventions>
|
|
105
|
+
|
|
106
|
+
<where-to-add-new-code>
|
|
107
|
+
## Where to Add New Code
|
|
108
|
+
|
|
109
|
+
**New Feature:**
|
|
110
|
+
- Primary code: `[directory path]`
|
|
111
|
+
- Tests: `[directory path]`
|
|
112
|
+
- Config if needed: `[directory path]`
|
|
113
|
+
|
|
114
|
+
**New Component / Module:**
|
|
115
|
+
- Implementation: `[directory path]`
|
|
116
|
+
- Types: `[directory path]`
|
|
117
|
+
- Tests: `[directory path]`
|
|
118
|
+
|
|
119
|
+
**New Route / Endpoint / Command:**
|
|
120
|
+
- Definition: `[directory path]`
|
|
121
|
+
- Handler: `[directory path]`
|
|
122
|
+
- Tests: `[directory path]`
|
|
123
|
+
|
|
124
|
+
**New Domain Entity / Model:**
|
|
125
|
+
- Entity: `[directory path]`
|
|
126
|
+
- Repository: `[directory path]`
|
|
127
|
+
- Tests: `[directory path]`
|
|
128
|
+
|
|
129
|
+
**New Service / Use Case:**
|
|
130
|
+
- Service: `[directory path]`
|
|
131
|
+
- Use case / application logic: `[directory path]`
|
|
132
|
+
- Interface / contract: `[directory path]`
|
|
133
|
+
- Tests: `[directory path]`
|
|
134
|
+
|
|
135
|
+
**New DTO / Request-Response Object:**
|
|
136
|
+
- DTOs: `[directory path]`
|
|
137
|
+
- Validators: `[directory path]`
|
|
138
|
+
|
|
139
|
+
**New Mapper / Transformer:**
|
|
140
|
+
- Mappers: `[directory path]`
|
|
141
|
+
|
|
142
|
+
**New Constants / Enums:**
|
|
143
|
+
- Constants: `[directory path]`
|
|
144
|
+
- Enums: `[directory path]`
|
|
145
|
+
- Magic values / lookup tables: `[directory path]`
|
|
146
|
+
|
|
147
|
+
**New Database Script / Migration:**
|
|
148
|
+
- Migrations: `[directory path]`
|
|
149
|
+
- Seeds / fixtures: `[directory path]`
|
|
150
|
+
- Stored procedures: `[directory path]`
|
|
151
|
+
|
|
152
|
+
**Shared Kernel / Cross-Cutting:**
|
|
153
|
+
- Shared kernel: `[directory path]`
|
|
154
|
+
- Base classes / interfaces: `[directory path]`
|
|
155
|
+
- Common exceptions: `[directory path]`
|
|
156
|
+
- Extension methods / helpers: `[directory path]`
|
|
157
|
+
|
|
158
|
+
**Utilities:**
|
|
159
|
+
- Shared helpers: `[directory path]`
|
|
160
|
+
- Type definitions: `[directory path]`
|
|
161
|
+
</where-to-add-new-code>
|
|
162
|
+
|
|
163
|
+
<special-directories>
|
|
164
|
+
## Special Directories
|
|
165
|
+
|
|
166
|
+
Directories with special meaning within this subsystem.
|
|
167
|
+
|
|
168
|
+
**[Directory]:**
|
|
169
|
+
- Purpose: [e.g., "Generated code", "Build output", "Migrations"]
|
|
170
|
+
- Source: [e.g., "Auto-generated by X", "Manually maintained"]
|
|
171
|
+
- Committed: [Yes/No]
|
|
172
|
+
</special-directories>
|
|
173
|
+
</template>
|
|
174
|
+
|
|
175
|
+
<guidelines>
|
|
176
|
+
|
|
177
|
+
**Subsystem Overview:**
|
|
178
|
+
- Root path must be relative to project root — agents use this to navigate
|
|
179
|
+
- Responsibility is one line. If you need more, it goes in the subsystem architecture doc
|
|
180
|
+
|
|
181
|
+
**Directory Layout:**
|
|
182
|
+
- List EVERY file and directory. This is the complete inventory of the subsystem
|
|
183
|
+
- Every directory gets a `# Purpose` comment
|
|
184
|
+
- Every file gets a `# Purpose` comment
|
|
185
|
+
- Use ASCII box-drawing characters: `├── └── │`
|
|
186
|
+
- Skip node_modules, build output, and other generated dirs (mention in Special Directories)
|
|
187
|
+
|
|
188
|
+
**Directory Purposes:**
|
|
189
|
+
- One entry per directory that has meaningful content
|
|
190
|
+
- "Key files" should list the 2-3 most important files a developer would look at first
|
|
191
|
+
- Skip directories that are obvious from the tree (e.g., don't describe `tests/` if it just has tests)
|
|
192
|
+
|
|
193
|
+
**Key File Locations:**
|
|
194
|
+
- Paths must be relative to subsystem root
|
|
195
|
+
- Group by role, not by directory
|
|
196
|
+
- Every entry needs a purpose — `user.service.ts` tells you nothing; "Core user CRUD operations" does
|
|
197
|
+
- Focus on files a developer touches when working on this subsystem
|
|
198
|
+
|
|
199
|
+
**Where to Add New Code:**
|
|
200
|
+
- This is the most actionable section. An agent reads this when creating new files
|
|
201
|
+
- Be specific — `src/features/[feature-name]/` not "the features directory"
|
|
202
|
+
- Cover the common cases for this subsystem's domain
|
|
203
|
+
|
|
204
|
+
**Naming Conventions:**
|
|
205
|
+
- Only document if this subsystem has patterns different from system-wide conventions
|
|
206
|
+
- If it follows system-wide conventions exactly, say so and link to system-structure.md
|
|
207
|
+
- Show actual examples from the codebase, not theoretical patterns
|
|
208
|
+
|
|
209
|
+
**What does NOT belong here:**
|
|
210
|
+
- Conceptual architecture (that's the subsystem architecture doc)
|
|
211
|
+
- Technology stack (that's system-architecture.md)
|
|
212
|
+
- Code conventions like formatting rules (that's a conventions doc)
|
|
213
|
+
- Other subsystems' structure (each has its own doc)
|
|
214
|
+
|
|
215
|
+
</guidelines>
|
|
216
|
+
|
|
217
|
+
<evolution>
|
|
218
|
+
|
|
219
|
+
Update when the physical layout of this subsystem changes.
|
|
220
|
+
|
|
221
|
+
**Update triggers:**
|
|
222
|
+
- New top-level directory added within subsystem
|
|
223
|
+
- Directory renamed, moved, or removed
|
|
224
|
+
- New entry point or configuration file added
|
|
225
|
+
- Naming convention changed
|
|
226
|
+
- "Where to add new code" guidance no longer accurate
|
|
227
|
+
|
|
228
|
+
**NOT an update trigger:**
|
|
229
|
+
- New files added within existing directories
|
|
230
|
+
- New features that follow existing structure
|
|
231
|
+
- Bug fixes or internal refactoring
|
|
232
|
+
|
|
233
|
+
</evolution>
|
|
234
|
+
|
|
235
235
|
</subsystem-structure>
|