agile-context-engineering 0.2.2 → 0.3.0

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/LICENSE +51 -51
  3. package/README.md +324 -323
  4. package/agents/ace-research-synthesizer.md +228 -228
  5. package/agents/ace-technical-application-architect.md +28 -0
  6. package/agents/ace-wiki-mapper.md +445 -334
  7. package/agile-context-engineering/src/ace-tools.test.js +1089 -1089
  8. package/agile-context-engineering/templates/_command.md +53 -53
  9. package/agile-context-engineering/templates/_workflow.xml +16 -16
  10. package/agile-context-engineering/templates/product/product-backlog.xml +231 -231
  11. package/agile-context-engineering/templates/product/story-integration-solution.xml +1 -0
  12. package/agile-context-engineering/templates/product/story-wiki.xml +4 -0
  13. package/agile-context-engineering/templates/wiki/coding-standards.xml +38 -0
  14. package/agile-context-engineering/templates/wiki/decizions.xml +115 -115
  15. package/agile-context-engineering/templates/wiki/guide.xml +137 -137
  16. package/agile-context-engineering/templates/wiki/module-discovery.xml +174 -174
  17. package/agile-context-engineering/templates/wiki/pattern.xml +159 -159
  18. package/agile-context-engineering/templates/wiki/system-architecture.xml +254 -254
  19. package/agile-context-engineering/templates/wiki/system-cross-cutting.xml +197 -197
  20. package/agile-context-engineering/templates/wiki/system.xml +381 -381
  21. package/agile-context-engineering/templates/wiki/walkthrough.xml +255 -0
  22. package/agile-context-engineering/templates/wiki/wiki-readme.xml +297 -276
  23. package/agile-context-engineering/utils/questioning.xml +110 -110
  24. package/agile-context-engineering/workflows/execute-story.xml +1219 -1145
  25. package/agile-context-engineering/workflows/help.xml +540 -540
  26. package/agile-context-engineering/workflows/init-coding-standards.xml +386 -386
  27. package/agile-context-engineering/workflows/map-story.xml +1046 -797
  28. package/agile-context-engineering/workflows/map-subsystem.xml +2 -1
  29. package/agile-context-engineering/workflows/map-walkthrough.xml +457 -0
  30. package/agile-context-engineering/workflows/plan-feature.xml +1495 -1495
  31. package/agile-context-engineering/workflows/plan-story.xml +36 -1
  32. package/agile-context-engineering/workflows/research-integration-solution.xml +1 -0
  33. package/agile-context-engineering/workflows/research-story-wiki.xml +2 -1
  34. package/agile-context-engineering/workflows/research-technical-solution.xml +1 -0
  35. package/agile-context-engineering/workflows/review-story.xml +281 -281
  36. package/agile-context-engineering/workflows/update.xml +238 -207
  37. package/bin/install.js +8 -0
  38. package/commands/ace/execute-story.md +1 -0
  39. package/commands/ace/help.md +93 -93
  40. package/commands/ace/init-coding-standards.md +83 -83
  41. package/commands/ace/map-story.md +165 -156
  42. package/commands/ace/map-subsystem.md +140 -138
  43. package/commands/ace/map-system.md +92 -92
  44. package/commands/ace/map-walkthrough.md +127 -0
  45. package/commands/ace/plan-feature.md +89 -89
  46. package/commands/ace/plan-story.md +15 -1
  47. package/commands/ace/review-story.md +109 -109
  48. package/commands/ace/update.md +56 -54
  49. package/hooks/ace-check-update.js +62 -62
  50. package/hooks/ace-statusline.js +89 -89
  51. package/package.json +4 -3
@@ -1,386 +1,386 @@
1
- <workflow>
2
-
3
- <purpose>
4
- Orchestrate coding standards generation through environment detection, user interview,
5
- and document writing. Produces `.docs/wiki/system-wide/coding-standards.md` — a prescriptive,
6
- paradigm-aware coding standards document tailored to the project.
7
-
8
- Brownfield projects: detect language/paradigm/frameworks from codebase, then interview.
9
- Greenfield projects: gather tech choices from user interview directly.
10
- </purpose>
11
-
12
- <mandatory-context>
13
- Read all files referenced by the invoking command's execution-context before starting.
14
- Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
15
- </mandatory-context>
16
-
17
- <process>
18
-
19
- <!-- ══════════════════════════════════════════════════════════════════ -->
20
- <!-- STEP 1: SETUP -->
21
- <!-- ══════════════════════════════════════════════════════════════════ -->
22
-
23
- <step name="setup" order="1">
24
- **MANDATORY FIRST STEP — Execute environment detection before any user interaction:**
25
-
26
- ```bash
27
- INIT=$(node ~/.claude/agile-context-engineering/src/ace-tools.js init coding-standards)
28
- ```
29
-
30
- Parse JSON for: `commit_docs`, `is_brownfield`, `is_greenfield`, `has_existing_code`,
31
- `has_package_file`, `has_coding_standards`, `wiki_dir_exists`, `has_system_architecture`,
32
- `has_system_structure`, `has_git`.
33
-
34
- Also resolve the mapper model for spawning the wiki-mapper agent:
35
- ```bash
36
- MAPPER_MODEL=$(node ~/.claude/agile-context-engineering/src/ace-tools.js resolve-model ace-wiki-mapper --raw)
37
- ```
38
-
39
- Display stage banner:
40
-
41
- ```
42
- ╔══════════════════════════════════════════════════╗
43
- ║ ACE > Coding Standards ║
44
- ╚══════════════════════════════════════════════════╝
45
- ```
46
-
47
- **If `has_coding_standards` is true:**
48
-
49
- Use AskUserQuestion:
50
- - header: "Standards exist"
51
- - question: "Coding standards already exist at `.docs/wiki/system-wide/coding-standards.md`. What would you like to do?"
52
- - options:
53
- - "Update" — Refine the existing standards through a new interview
54
- - "Start fresh" — Discard and create new standards from scratch
55
- - "Skip" — Keep the current standards as-is
56
-
57
- If "Update": Read existing file, hold as seed context, continue to step 2
58
- If "Start fresh": Ignore existing file, continue to step 2
59
- If "Skip": Exit workflow
60
-
61
- **If `has_git` is false:** Initialize git:
62
- ```bash
63
- git init
64
- ```
65
- </step>
66
-
67
- <!-- ══════════════════════════════════════════════════════════════════ -->
68
- <!-- STEP 2: DETECT (brownfield) or SKIP (greenfield) -->
69
- <!-- ══════════════════════════════════════════════════════════════════ -->
70
-
71
- <step name="detect" order="2">
72
-
73
- **If `is_greenfield` is true:**
74
-
75
- There is no codebase to analyze. Skip detection entirely — the interview (step 3)
76
- will gather language, paradigm, and framework preferences directly from the user.
77
-
78
- Hold detection results as: `DETECTION = null` (signals greenfield to step 3).
79
-
80
- Continue directly to step 3 (interview).
81
-
82
- **If `is_brownfield` is true:**
83
-
84
- Spawn a detection agent to analyze the existing codebase. Use a Task agent to
85
- avoid filling main context with file scanning:
86
-
87
- ```
88
- Task(
89
- prompt="Analyze this project's technical profile for coding standards generation.
90
-
91
- **Step 1 — Detect languages:**
92
- Check for: package.json, tsconfig.json, *.csproj, *.sln, Cargo.toml, go.mod,
93
- pyproject.toml, setup.py, requirements.txt, build.gradle, pom.xml, Gemfile,
94
- mix.exs, *.cabal, pubspec.yaml, Package.swift, composer.json
95
-
96
- **Step 2 — Detect paradigm:**
97
- Scan 5-10 representative source files. Classify as:
98
- - OOP-heavy: classes, interfaces, DI containers, inheritance
99
- - Functional-heavy: pure functions, pipelines, algebraic types, pattern matching
100
- - Multi-paradigm: mix of both
101
- - Systems: ownership, manual memory, error-by-return
102
-
103
- **Step 3 — Detect frameworks and tooling:**
104
- Check package files and imports for: React, Angular, Vue, Express, ASP.NET,
105
- Spring, Django, Phoenix, Gin, Actix, Jest, xUnit, pytest, etc.
106
- Check for: .eslintrc, .prettierrc, ruff.toml, .editorconfig, biome.json
107
-
108
- **Step 4 — Detect existing standards:**
109
- Check for existing CLAUDE.md, .docs/ standards, lint configs, .editorconfig
110
-
111
- **Step 5 — Detect project structure patterns:**
112
- Find where constants, config, DI registration, and shared code live.
113
-
114
- **Return format — structured summary only:**
115
- LANGUAGES: [list with confidence]
116
- PARADIGM: [OOP / Functional / Multi-paradigm / Systems]
117
- FRAMEWORKS: [list]
118
- TOOLING: [linters, formatters, configs found]
119
- EXISTING_STANDARDS: [any existing standards docs found]
120
- CONSTANTS_LOCATION: [where constants/config values live]
121
- DI_LOCATION: [where dependency injection is configured, if applicable]
122
- PATTERNS_OBSERVED: [3-5 key patterns seen in the code]",
123
- subagent_type="Explore",
124
- model="{MAPPER_MODEL}",
125
- description="Detect project technical profile"
126
- )
127
- ```
128
-
129
- Hold detection results for the interview step.
130
- </step>
131
-
132
- <!-- ══════════════════════════════════════════════════════════════════ -->
133
- <!-- STEP 3: INTERVIEW -->
134
- <!-- ══════════════════════════════════════════════════════════════════ -->
135
-
136
- <step name="interview" order="3">
137
- Follow the questioning guide from `questioning.xml`. You are a thinking partner
138
- helping the user articulate their coding philosophy.
139
-
140
- **Opening — adapt based on greenfield vs brownfield:**
141
-
142
- If BROWNFIELD (detection results available):
143
- ```
144
- I analyzed your project. Here's what I found:
145
-
146
- - Language(s): [detected]
147
- - Paradigm: [detected]
148
- - Frameworks: [detected]
149
- - Existing tooling: [linters/formatters found]
150
- [If existing standards found: "You already have [doc] — I'll build on that."]
151
-
152
- Let me understand your coding standards preferences.
153
- ```
154
-
155
- If GREENFIELD (no detection results):
156
- ```
157
- This is a greenfield project — no existing code to analyze yet.
158
- I'll need to understand your plans to create the right standards.
159
- ```
160
-
161
- Then ask about the tech stack using AskUserQuestion:
162
- - header: "Language"
163
- - question: "What language(s) will this project use?"
164
- - options: (pick the 3-4 most common, based on context if any)
165
- e.g., "TypeScript", "Python", "C#", "Go"
166
-
167
- Follow up with paradigm preference:
168
- - header: "Paradigm"
169
- - question: "What programming paradigm will you primarily use?"
170
- - options adapt to the language chosen:
171
- - For TypeScript: "Class-based OOP", "Functional", "React components + hooks"
172
- - For Python: "OOP with classes", "Functional/procedural", "Mixed"
173
- - For C#/Java: "OOP with SOLID" (only realistic option, confirm don't ask)
174
- - For Go: "Go idioms" (Go has its own paradigm, confirm don't ask)
175
- - For Rust: "Rust idioms" (traits + ownership, confirm don't ask)
176
-
177
- Then ask about frameworks if not already known.
178
-
179
- **Key areas to explore (adapt based on conversation, don't checklist):**
180
-
181
- 1. **Strictness level**
182
- "How strict do you want the coding standards to be?"
183
- - "Enterprise-grade strict" — Zero tolerance for violations, every rule enforced
184
- - "Pragmatic but principled" — Strong guidelines with room for justified exceptions
185
- - "Minimal essentials" — Only rules that prevent real problems
186
-
187
- 2. **Pain points — THE MOST VALUABLE QUESTION**
188
- "What mistakes have you seen Claude or developers make repeatedly?"
189
- Follow up on every pain point. Each one becomes an emphatic rule.
190
- Examples they might mention:
191
- - "Claude puts multiple classes in one file"
192
- - "Claude swallows errors silently"
193
- - "Claude hardcodes values"
194
- - "Claude over-engineers simple things"
195
- - "Claude doesn't check what already exists"
196
-
197
- 3. **Paradigm preference** (if multi-paradigm language)
198
- Already gathered for greenfield; confirm for brownfield if multi-paradigm detected.
199
- - For Python: "OOP with classes" / "Functional/procedural" / "Mix"
200
- - For TypeScript: "Class-based OOP" / "Functional with types" / "React hooks"
201
- - For Kotlin/Scala: "OOP with interfaces" / "Functional with sealed classes" / "Mix"
202
-
203
- 4. **Architecture enforcement**
204
- "Do you want the standards to enforce architecture patterns?"
205
- - SOLID principles, Clean Architecture layers, DI requirements
206
- - Or just code-level rules without architectural mandates
207
-
208
- 5. **File organization rules**
209
- "One class/module per file strictly, or are small related types OK together?"
210
- "Max file length preference?"
211
-
212
- 6. **Error handling philosophy**
213
- "How should errors be handled?"
214
- - Fail fast with exceptions
215
- - Result/Either types for expected failures
216
- - Language-specific patterns
217
-
218
- 7. **Testability requirements**
219
- "Should the standards mandate testability patterns?"
220
- - Always code against interfaces/abstractions
221
- - Pure functions where possible
222
- - DI for all dependencies
223
-
224
- 8. **Custom rules**
225
- "Any specific rules from your experience that you want enforced?"
226
- Capture these verbatim — they are the user's hard-won lessons.
227
-
228
- If the user provided a context document ($ARGUMENTS), absorb it first and use it
229
- to skip questions that are already answered. Probe gaps and ambiguities instead.
230
-
231
- **Decision gate:**
232
-
233
- When you understand their philosophy, pain points, and specific preferences:
234
- - header: "Ready?"
235
- - question: "I understand your coding philosophy. Ready to generate your coding standards?"
236
- - options:
237
- - "Generate standards" — Create the document
238
- - "Keep exploring" — I have more to share
239
-
240
- Loop until "Generate standards" selected.
241
- </step>
242
-
243
- <!-- ══════════════════════════════════════════════════════════════════ -->
244
- <!-- STEP 4: GENERATE -->
245
- <!-- ══════════════════════════════════════════════════════════════════ -->
246
-
247
- <step name="generate" order="4">
248
- **Create directory structure:**
249
- ```bash
250
- mkdir -p .docs/wiki/system-wide
251
- ```
252
-
253
- **Prepare a context brief (300-500 words) that distills:**
254
- - Project type: greenfield or brownfield
255
- - Detection results OR user-stated tech choices (languages, paradigm, frameworks, tooling)
256
- - User's strictness preference
257
- - User's pain points (listed explicitly — these become emphatic rules)
258
- - Paradigm preference and which template modules to include
259
- - Architecture enforcement preferences
260
- - File organization rules (construct per file, max length)
261
- - Error handling philosophy
262
- - Testability requirements
263
- - Custom rules (verbatim from user)
264
- - Constants location, DI config location (from detection or "TBD" for greenfield)
265
- - If updating existing standards: what to preserve vs. change
266
-
267
- **Spawn the ace-wiki-mapper agent to write the document:**
268
-
269
- ```
270
- Task(
271
- prompt="You are writing a prescriptive coding standards document for the project wiki.
272
-
273
- **Context brief from detection + interview:**
274
- {paste the context brief here}
275
-
276
- **Instructions:**
277
- 1. Read the coding standards template:
278
- ~/.claude/agile-context-engineering/templates/wiki/coding-standards.xml
279
- 2. Assemble the document following the template's assembly guidelines:
280
- - ALWAYS include universal-standards (adapt placeholders to the project's language)
281
- - Include paradigm modules based on context brief (OOP, functional, systems, or multiple)
282
- - Generate language-conventions section from detection results or user-stated choices
283
- - Include project-specific-rules from user's pain points and custom rules
284
- - For greenfield: use [TBD] markers for project-specific paths (constants dir, DI config)
285
- that will be filled once the codebase exists
286
- 3. If brownfield: explore the codebase to cross-reference actual file paths for
287
- constants directories, DI configuration, shared utilities, etc.
288
- 4. Tone: DIRECT and EMPHATIC. Bold for emphasis, caps for critical words.
289
- This is a mandate document, not suggestions.
290
- 5. Target length: 150-350 lines. Comprehensive but not bloated.
291
- 6. Write the file to `.docs/wiki/system-wide/coding-standards.md`
292
-
293
- **Return format — ONLY this, nothing else:**
294
- DONE
295
- - Paradigm modules included: [list]
296
- - Total sections: [N]
297
- - Line count: [N]
298
- - Top 3 emphatic rules: [list the most critical rules]",
299
- subagent_type="ace-wiki-mapper",
300
- model="{MAPPER_MODEL}",
301
- description="Write coding standards document"
302
- )
303
- ```
304
- </step>
305
-
306
- <!-- ══════════════════════════════════════════════════════════════════ -->
307
- <!-- STEP 5: REVIEW AND APPROVE -->
308
- <!-- ══════════════════════════════════════════════════════════════════ -->
309
-
310
- <step name="review" order="5">
311
- Show the agent's returned summary to the user. Then:
312
-
313
- - header: "Standards"
314
- - question: "Coding standards written to `.docs/wiki/system-wide/coding-standards.md`. Does this look right? Review the full file in your editor for details."
315
- - options:
316
- - "Approve" — Looks good, commit it
317
- - "Adjust" — I want to change some things
318
- - "Redo interview" — Let's go back and discuss more
319
-
320
- **If "Adjust":**
321
- - Ask what they want to change
322
- - Spawn the ace-wiki-mapper agent to adjust:
323
- ```
324
- Task(
325
- prompt="Read `.docs/wiki/system-wide/coding-standards.md` and make these changes:
326
- {user's requested changes}.
327
- If changes reference codebase paths or patterns, explore the codebase to verify.
328
- Use the Edit tool to modify in place. Return only a confirmation of what changed.",
329
- subagent_type="ace-wiki-mapper",
330
- model="{MAPPER_MODEL}",
331
- description="Adjust coding standards"
332
- )
333
- ```
334
- - Present for review again. Loop until approved.
335
-
336
- **If "Redo interview":**
337
- - Return to step 3 (interview), preserve detection results
338
- - Hold previous answers as context
339
-
340
- **If "Approve":**
341
- Continue to commit step.
342
- </step>
343
-
344
- <!-- ══════════════════════════════════════════════════════════════════ -->
345
- <!-- STEP 6: COMMIT -->
346
- <!-- ══════════════════════════════════════════════════════════════════ -->
347
-
348
- <step name="commit" order="6">
349
- Commit the coding standards:
350
-
351
- ```bash
352
- git add .docs/wiki/system-wide/coding-standards.md
353
- git commit -m "docs: initialize coding standards"
354
- ```
355
-
356
- Display completion:
357
-
358
- ```
359
- ╔══════════════════════════════════════════════════╗
360
- ║ ACE > Coding Standards Created ║
361
- ╚══════════════════════════════════════════════════╝
362
-
363
- + .docs/wiki/system-wide/coding-standards.md committed.
364
-
365
- i These standards will be used as context by ACE commands
366
- when planning and executing stories.
367
-
368
- Next > /ace:map-system
369
- Map your codebase structure and architecture.
370
- ```
371
- </step>
372
-
373
- </process>
374
-
375
- <success_criteria>
376
- - Init function executed (brownfield/greenfield detected, existing standards checked)
377
- - Brownfield: project technical profile detected via Explore agent
378
- - Greenfield: language, paradigm, frameworks gathered from user interview
379
- - User interviewed about coding philosophy and pain points
380
- - coding-standards.md written with appropriate paradigm modules
381
- - Document is prescriptive and emphatic, not descriptive
382
- - User reviewed and approved the document
383
- - Document committed to .docs/wiki/system-wide/
384
- </success_criteria>
385
-
386
- </workflow>
1
+ <workflow>
2
+
3
+ <purpose>
4
+ Orchestrate coding standards generation through environment detection, user interview,
5
+ and document writing. Produces `.docs/wiki/system-wide/coding-standards.md` — a prescriptive,
6
+ paradigm-aware coding standards document tailored to the project.
7
+
8
+ Brownfield projects: detect language/paradigm/frameworks from codebase, then interview.
9
+ Greenfield projects: gather tech choices from user interview directly.
10
+ </purpose>
11
+
12
+ <mandatory-context>
13
+ Read all files referenced by the invoking command's execution-context before starting.
14
+ Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
15
+ </mandatory-context>
16
+
17
+ <process>
18
+
19
+ <!-- ══════════════════════════════════════════════════════════════════ -->
20
+ <!-- STEP 1: SETUP -->
21
+ <!-- ══════════════════════════════════════════════════════════════════ -->
22
+
23
+ <step name="setup" order="1">
24
+ **MANDATORY FIRST STEP — Execute environment detection before any user interaction:**
25
+
26
+ ```bash
27
+ INIT=$(node ~/.claude/agile-context-engineering/src/ace-tools.js init coding-standards)
28
+ ```
29
+
30
+ Parse JSON for: `commit_docs`, `is_brownfield`, `is_greenfield`, `has_existing_code`,
31
+ `has_package_file`, `has_coding_standards`, `wiki_dir_exists`, `has_system_architecture`,
32
+ `has_system_structure`, `has_git`.
33
+
34
+ Also resolve the mapper model for spawning the wiki-mapper agent:
35
+ ```bash
36
+ MAPPER_MODEL=$(node ~/.claude/agile-context-engineering/src/ace-tools.js resolve-model ace-wiki-mapper --raw)
37
+ ```
38
+
39
+ Display stage banner:
40
+
41
+ ```
42
+ ╔══════════════════════════════════════════════════╗
43
+ ║ ACE > Coding Standards ║
44
+ ╚══════════════════════════════════════════════════╝
45
+ ```
46
+
47
+ **If `has_coding_standards` is true:**
48
+
49
+ Use AskUserQuestion:
50
+ - header: "Standards exist"
51
+ - question: "Coding standards already exist at `.docs/wiki/system-wide/coding-standards.md`. What would you like to do?"
52
+ - options:
53
+ - "Update" — Refine the existing standards through a new interview
54
+ - "Start fresh" — Discard and create new standards from scratch
55
+ - "Skip" — Keep the current standards as-is
56
+
57
+ If "Update": Read existing file, hold as seed context, continue to step 2
58
+ If "Start fresh": Ignore existing file, continue to step 2
59
+ If "Skip": Exit workflow
60
+
61
+ **If `has_git` is false:** Initialize git:
62
+ ```bash
63
+ git init
64
+ ```
65
+ </step>
66
+
67
+ <!-- ══════════════════════════════════════════════════════════════════ -->
68
+ <!-- STEP 2: DETECT (brownfield) or SKIP (greenfield) -->
69
+ <!-- ══════════════════════════════════════════════════════════════════ -->
70
+
71
+ <step name="detect" order="2">
72
+
73
+ **If `is_greenfield` is true:**
74
+
75
+ There is no codebase to analyze. Skip detection entirely — the interview (step 3)
76
+ will gather language, paradigm, and framework preferences directly from the user.
77
+
78
+ Hold detection results as: `DETECTION = null` (signals greenfield to step 3).
79
+
80
+ Continue directly to step 3 (interview).
81
+
82
+ **If `is_brownfield` is true:**
83
+
84
+ Spawn a detection agent to analyze the existing codebase. Use a Task agent to
85
+ avoid filling main context with file scanning:
86
+
87
+ ```
88
+ Task(
89
+ prompt="Analyze this project's technical profile for coding standards generation.
90
+
91
+ **Step 1 — Detect languages:**
92
+ Check for: package.json, tsconfig.json, *.csproj, *.sln, Cargo.toml, go.mod,
93
+ pyproject.toml, setup.py, requirements.txt, build.gradle, pom.xml, Gemfile,
94
+ mix.exs, *.cabal, pubspec.yaml, Package.swift, composer.json
95
+
96
+ **Step 2 — Detect paradigm:**
97
+ Scan 5-10 representative source files. Classify as:
98
+ - OOP-heavy: classes, interfaces, DI containers, inheritance
99
+ - Functional-heavy: pure functions, pipelines, algebraic types, pattern matching
100
+ - Multi-paradigm: mix of both
101
+ - Systems: ownership, manual memory, error-by-return
102
+
103
+ **Step 3 — Detect frameworks and tooling:**
104
+ Check package files and imports for: React, Angular, Vue, Express, ASP.NET,
105
+ Spring, Django, Phoenix, Gin, Actix, Jest, xUnit, pytest, etc.
106
+ Check for: .eslintrc, .prettierrc, ruff.toml, .editorconfig, biome.json
107
+
108
+ **Step 4 — Detect existing standards:**
109
+ Check for existing CLAUDE.md, .docs/ standards, lint configs, .editorconfig
110
+
111
+ **Step 5 — Detect project structure patterns:**
112
+ Find where constants, config, DI registration, and shared code live.
113
+
114
+ **Return format — structured summary only:**
115
+ LANGUAGES: [list with confidence]
116
+ PARADIGM: [OOP / Functional / Multi-paradigm / Systems]
117
+ FRAMEWORKS: [list]
118
+ TOOLING: [linters, formatters, configs found]
119
+ EXISTING_STANDARDS: [any existing standards docs found]
120
+ CONSTANTS_LOCATION: [where constants/config values live]
121
+ DI_LOCATION: [where dependency injection is configured, if applicable]
122
+ PATTERNS_OBSERVED: [3-5 key patterns seen in the code]",
123
+ subagent_type="Explore",
124
+ model="{MAPPER_MODEL}",
125
+ description="Detect project technical profile"
126
+ )
127
+ ```
128
+
129
+ Hold detection results for the interview step.
130
+ </step>
131
+
132
+ <!-- ══════════════════════════════════════════════════════════════════ -->
133
+ <!-- STEP 3: INTERVIEW -->
134
+ <!-- ══════════════════════════════════════════════════════════════════ -->
135
+
136
+ <step name="interview" order="3">
137
+ Follow the questioning guide from `questioning.xml`. You are a thinking partner
138
+ helping the user articulate their coding philosophy.
139
+
140
+ **Opening — adapt based on greenfield vs brownfield:**
141
+
142
+ If BROWNFIELD (detection results available):
143
+ ```
144
+ I analyzed your project. Here's what I found:
145
+
146
+ - Language(s): [detected]
147
+ - Paradigm: [detected]
148
+ - Frameworks: [detected]
149
+ - Existing tooling: [linters/formatters found]
150
+ [If existing standards found: "You already have [doc] — I'll build on that."]
151
+
152
+ Let me understand your coding standards preferences.
153
+ ```
154
+
155
+ If GREENFIELD (no detection results):
156
+ ```
157
+ This is a greenfield project — no existing code to analyze yet.
158
+ I'll need to understand your plans to create the right standards.
159
+ ```
160
+
161
+ Then ask about the tech stack using AskUserQuestion:
162
+ - header: "Language"
163
+ - question: "What language(s) will this project use?"
164
+ - options: (pick the 3-4 most common, based on context if any)
165
+ e.g., "TypeScript", "Python", "C#", "Go"
166
+
167
+ Follow up with paradigm preference:
168
+ - header: "Paradigm"
169
+ - question: "What programming paradigm will you primarily use?"
170
+ - options adapt to the language chosen:
171
+ - For TypeScript: "Class-based OOP", "Functional", "React components + hooks"
172
+ - For Python: "OOP with classes", "Functional/procedural", "Mixed"
173
+ - For C#/Java: "OOP with SOLID" (only realistic option, confirm don't ask)
174
+ - For Go: "Go idioms" (Go has its own paradigm, confirm don't ask)
175
+ - For Rust: "Rust idioms" (traits + ownership, confirm don't ask)
176
+
177
+ Then ask about frameworks if not already known.
178
+
179
+ **Key areas to explore (adapt based on conversation, don't checklist):**
180
+
181
+ 1. **Strictness level**
182
+ "How strict do you want the coding standards to be?"
183
+ - "Enterprise-grade strict" — Zero tolerance for violations, every rule enforced
184
+ - "Pragmatic but principled" — Strong guidelines with room for justified exceptions
185
+ - "Minimal essentials" — Only rules that prevent real problems
186
+
187
+ 2. **Pain points — THE MOST VALUABLE QUESTION**
188
+ "What mistakes have you seen Claude or developers make repeatedly?"
189
+ Follow up on every pain point. Each one becomes an emphatic rule.
190
+ Examples they might mention:
191
+ - "Claude puts multiple classes in one file"
192
+ - "Claude swallows errors silently"
193
+ - "Claude hardcodes values"
194
+ - "Claude over-engineers simple things"
195
+ - "Claude doesn't check what already exists"
196
+
197
+ 3. **Paradigm preference** (if multi-paradigm language)
198
+ Already gathered for greenfield; confirm for brownfield if multi-paradigm detected.
199
+ - For Python: "OOP with classes" / "Functional/procedural" / "Mix"
200
+ - For TypeScript: "Class-based OOP" / "Functional with types" / "React hooks"
201
+ - For Kotlin/Scala: "OOP with interfaces" / "Functional with sealed classes" / "Mix"
202
+
203
+ 4. **Architecture enforcement**
204
+ "Do you want the standards to enforce architecture patterns?"
205
+ - SOLID principles, Clean Architecture layers, DI requirements
206
+ - Or just code-level rules without architectural mandates
207
+
208
+ 5. **File organization rules**
209
+ "One class/module per file strictly, or are small related types OK together?"
210
+ "Max file length preference?"
211
+
212
+ 6. **Error handling philosophy**
213
+ "How should errors be handled?"
214
+ - Fail fast with exceptions
215
+ - Result/Either types for expected failures
216
+ - Language-specific patterns
217
+
218
+ 7. **Testability requirements**
219
+ "Should the standards mandate testability patterns?"
220
+ - Always code against interfaces/abstractions
221
+ - Pure functions where possible
222
+ - DI for all dependencies
223
+
224
+ 8. **Custom rules**
225
+ "Any specific rules from your experience that you want enforced?"
226
+ Capture these verbatim — they are the user's hard-won lessons.
227
+
228
+ If the user provided a context document ($ARGUMENTS), absorb it first and use it
229
+ to skip questions that are already answered. Probe gaps and ambiguities instead.
230
+
231
+ **Decision gate:**
232
+
233
+ When you understand their philosophy, pain points, and specific preferences:
234
+ - header: "Ready?"
235
+ - question: "I understand your coding philosophy. Ready to generate your coding standards?"
236
+ - options:
237
+ - "Generate standards" — Create the document
238
+ - "Keep exploring" — I have more to share
239
+
240
+ Loop until "Generate standards" selected.
241
+ </step>
242
+
243
+ <!-- ══════════════════════════════════════════════════════════════════ -->
244
+ <!-- STEP 4: GENERATE -->
245
+ <!-- ══════════════════════════════════════════════════════════════════ -->
246
+
247
+ <step name="generate" order="4">
248
+ **Create directory structure:**
249
+ ```bash
250
+ mkdir -p .docs/wiki/system-wide
251
+ ```
252
+
253
+ **Prepare a context brief (300-500 words) that distills:**
254
+ - Project type: greenfield or brownfield
255
+ - Detection results OR user-stated tech choices (languages, paradigm, frameworks, tooling)
256
+ - User's strictness preference
257
+ - User's pain points (listed explicitly — these become emphatic rules)
258
+ - Paradigm preference and which template modules to include
259
+ - Architecture enforcement preferences
260
+ - File organization rules (construct per file, max length)
261
+ - Error handling philosophy
262
+ - Testability requirements
263
+ - Custom rules (verbatim from user)
264
+ - Constants location, DI config location (from detection or "TBD" for greenfield)
265
+ - If updating existing standards: what to preserve vs. change
266
+
267
+ **Spawn the ace-wiki-mapper agent to write the document:**
268
+
269
+ ```
270
+ Task(
271
+ prompt="You are writing a prescriptive coding standards document for the project wiki.
272
+
273
+ **Context brief from detection + interview:**
274
+ {paste the context brief here}
275
+
276
+ **Instructions:**
277
+ 1. Read the coding standards template:
278
+ ~/.claude/agile-context-engineering/templates/wiki/coding-standards.xml
279
+ 2. Assemble the document following the template's assembly guidelines:
280
+ - ALWAYS include universal-standards (adapt placeholders to the project's language)
281
+ - Include paradigm modules based on context brief (OOP, functional, systems, or multiple)
282
+ - Generate language-conventions section from detection results or user-stated choices
283
+ - Include project-specific-rules from user's pain points and custom rules
284
+ - For greenfield: use [TBD] markers for project-specific paths (constants dir, DI config)
285
+ that will be filled once the codebase exists
286
+ 3. If brownfield: explore the codebase to cross-reference actual file paths for
287
+ constants directories, DI configuration, shared utilities, etc.
288
+ 4. Tone: DIRECT and EMPHATIC. Bold for emphasis, caps for critical words.
289
+ This is a mandate document, not suggestions.
290
+ 5. Target length: 150-350 lines. Comprehensive but not bloated.
291
+ 6. Write the file to `.docs/wiki/system-wide/coding-standards.md`
292
+
293
+ **Return format — ONLY this, nothing else:**
294
+ DONE
295
+ - Paradigm modules included: [list]
296
+ - Total sections: [N]
297
+ - Line count: [N]
298
+ - Top 3 emphatic rules: [list the most critical rules]",
299
+ subagent_type="ace-wiki-mapper",
300
+ model="{MAPPER_MODEL}",
301
+ description="Write coding standards document"
302
+ )
303
+ ```
304
+ </step>
305
+
306
+ <!-- ══════════════════════════════════════════════════════════════════ -->
307
+ <!-- STEP 5: REVIEW AND APPROVE -->
308
+ <!-- ══════════════════════════════════════════════════════════════════ -->
309
+
310
+ <step name="review" order="5">
311
+ Show the agent's returned summary to the user. Then:
312
+
313
+ - header: "Standards"
314
+ - question: "Coding standards written to `.docs/wiki/system-wide/coding-standards.md`. Does this look right? Review the full file in your editor for details."
315
+ - options:
316
+ - "Approve" — Looks good, commit it
317
+ - "Adjust" — I want to change some things
318
+ - "Redo interview" — Let's go back and discuss more
319
+
320
+ **If "Adjust":**
321
+ - Ask what they want to change
322
+ - Spawn the ace-wiki-mapper agent to adjust:
323
+ ```
324
+ Task(
325
+ prompt="Read `.docs/wiki/system-wide/coding-standards.md` and make these changes:
326
+ {user's requested changes}.
327
+ If changes reference codebase paths or patterns, explore the codebase to verify.
328
+ Use the Edit tool to modify in place. Return only a confirmation of what changed.",
329
+ subagent_type="ace-wiki-mapper",
330
+ model="{MAPPER_MODEL}",
331
+ description="Adjust coding standards"
332
+ )
333
+ ```
334
+ - Present for review again. Loop until approved.
335
+
336
+ **If "Redo interview":**
337
+ - Return to step 3 (interview), preserve detection results
338
+ - Hold previous answers as context
339
+
340
+ **If "Approve":**
341
+ Continue to commit step.
342
+ </step>
343
+
344
+ <!-- ══════════════════════════════════════════════════════════════════ -->
345
+ <!-- STEP 6: COMMIT -->
346
+ <!-- ══════════════════════════════════════════════════════════════════ -->
347
+
348
+ <step name="commit" order="6">
349
+ Commit the coding standards:
350
+
351
+ ```bash
352
+ git add .docs/wiki/system-wide/coding-standards.md
353
+ git commit -m "docs: initialize coding standards"
354
+ ```
355
+
356
+ Display completion:
357
+
358
+ ```
359
+ ╔══════════════════════════════════════════════════╗
360
+ ║ ACE > Coding Standards Created ║
361
+ ╚══════════════════════════════════════════════════╝
362
+
363
+ + .docs/wiki/system-wide/coding-standards.md committed.
364
+
365
+ i These standards will be used as context by ACE commands
366
+ when planning and executing stories.
367
+
368
+ Next > /ace:map-system
369
+ Map your codebase structure and architecture.
370
+ ```
371
+ </step>
372
+
373
+ </process>
374
+
375
+ <success_criteria>
376
+ - Init function executed (brownfield/greenfield detected, existing standards checked)
377
+ - Brownfield: project technical profile detected via Explore agent
378
+ - Greenfield: language, paradigm, frameworks gathered from user interview
379
+ - User interviewed about coding philosophy and pain points
380
+ - coding-standards.md written with appropriate paradigm modules
381
+ - Document is prescriptive and emphatic, not descriptive
382
+ - User reviewed and approved the document
383
+ - Document committed to .docs/wiki/system-wide/
384
+ </success_criteria>
385
+
386
+ </workflow>