@vpxa/aikit 0.1.307 → 0.1.308
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/package.json +1 -1
- package/packages/cli/dist/index.js +1 -1
- package/packages/server/dist/bin.js +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/{server-B_KbLM43.js → server-BSvqfFcK.js} +170 -161
- package/packages/server/dist/{server-utMi-Qu3.js → server-D6sJEw0I.js} +170 -161
- package/packages/server/dist/{server-http-B-TDT3t-.js → server-http-B1ixOw2x.js} +1 -1
- package/packages/server/dist/{server-http-BbuuthEP.js → server-http-BurquBLf.js} +1 -1
- package/packages/server/dist/server-stdio-CBmXDMpq.js +1 -0
- package/packages/server/dist/server-stdio-z3_zG1HF.js +2 -0
- package/packages/server/dist/{version-check-DSWaugPC.js → version-check-CdBHTxtt.js} +1 -1
- package/packages/server/dist/{version-check-6qDKknz4.js → version-check-CggUKvv8.js} +1 -1
- package/scaffold/dist/adapters/hooks.mjs +1 -1
- package/scaffold/dist/definitions/agents.mjs +1 -1
- package/scaffold/dist/definitions/bodies.mjs +6 -6
- package/scaffold/dist/definitions/flows.mjs +6 -6
- package/scaffold/dist/definitions/prompts.mjs +12 -12
- package/scaffold/dist/definitions/protocols.mjs +11 -11
- package/scaffold/dist/definitions/skills/docs.mjs +174 -174
- package/packages/server/dist/server-stdio-BUb39kqq.js +0 -2
- package/packages/server/dist/server-stdio-Ch7yAxNk.js +0 -1
|
@@ -158,8 +158,8 @@ Detailed workflow for acquiring and documenting project knowledge into \`docs/ar
|
|
|
158
158
|
\`\`\`
|
|
159
159
|
onboard({ path: "." }) # Full codebase scan
|
|
160
160
|
produce_knowledge({ scope: "." }) # Comprehensive analysis
|
|
161
|
-
analyze({ aspect: "structure", path: "." }) # Project layout, packages, layers
|
|
162
|
-
analyze({ aspect: "dependencies", path: "." }) # All dependencies + import graph
|
|
161
|
+
analyze({ items: [{aspect: "structure", path: "."}] }) # Project layout, packages, layers
|
|
162
|
+
analyze({ items: [{aspect: "dependencies", path: "."}] }) # All dependencies + import graph
|
|
163
163
|
\`\`\`
|
|
164
164
|
|
|
165
165
|
Then read \`README\`, \`PRD\`, \`TRD\`, \`ROADMAP\`, \`SPEC\`, \`DESIGN\` files if they exist.
|
|
@@ -171,13 +171,13 @@ Use Phase 1 tool outputs to answer questions for each of the seven documents. Ru
|
|
|
171
171
|
|
|
172
172
|
| Document | Investigation Tools |
|
|
173
173
|
|----------|-------------------|
|
|
174
|
-
| stack.md | \`analyze({ aspect: "dependencies", ... })\`
|
|
175
|
-
| structure.md | \`analyze({ aspect: "structure", ... })\`
|
|
176
|
-
| design.md | \`analyze({ aspect: "structure", ... })\`
|
|
177
|
-
| conventions.md | \`analyze({ aspect: "patterns", ... })\`
|
|
178
|
-
| integrations.md | \`analyze({ aspect: "dependencies", ... })\`
|
|
179
|
-
| testing.md | \`analyze({ aspect: "patterns", ... })\`
|
|
180
|
-
| concerns.md | \`audit({ path: "." })\`
|
|
174
|
+
| stack.md | \`analyze({ items: [{aspect: "dependencies", ...}] })\` → manifests, frameworks; \`analyze({ items: [{aspect: "structure", ...}] })\` → runtime signals |
|
|
175
|
+
| structure.md | \`analyze({ items: [{aspect: "structure", ...}] })\` → file tree, packages; \`analyze({ items: [{aspect: "entry_points", ...}] })\` → entry points, key files |
|
|
176
|
+
| design.md | \`analyze({ items: [{aspect: "structure", ...}] })\` → layers; \`analyze({ items: [{aspect: "patterns", ...}] })\` → design patterns; \`analyze({ items: [{aspect: "diagram", ...}] })\` → component diagrams |
|
|
177
|
+
| conventions.md | \`analyze({ items: [{aspect: "patterns", ...}] })\` → naming, formatting; \`search("conventions")\` → detected conventions |
|
|
178
|
+
| integrations.md | \`analyze({ items: [{aspect: "dependencies", ...}] })\` → external deps; \`search("API\\|database\\|auth\\|webhook")\` → integration points |
|
|
179
|
+
| testing.md | \`analyze({ items: [{aspect: "patterns", ...}] })\` → test patterns; \`search("test framework")\` → test setup; \`test_run({})\` → test health |
|
|
180
|
+
| concerns.md | \`audit({ path: "." })\` → health issues; \`dead_symbols({})\` → dead code; \`git_context({})\` → high-churn files |
|
|
181
181
|
|
|
182
182
|
### Phase 3: Populate Documents
|
|
183
183
|
|
|
@@ -201,7 +201,7 @@ Rules:
|
|
|
201
201
|
Run this mandatory validation loop before finalizing:
|
|
202
202
|
|
|
203
203
|
1. For each non-trivial claim, confirm at least one evidence reference exists
|
|
204
|
-
2. If any required section is missing or unsupported
|
|
204
|
+
2. If any required section is missing or unsupported → fix and re-validate
|
|
205
205
|
3. Repeat until all seven docs pass
|
|
206
206
|
|
|
207
207
|
Validation pass criteria:
|
|
@@ -271,9 +271,9 @@ Templates for the seven project knowledge documents in \`docs/architecture/\`. U
|
|
|
271
271
|
|
|
272
272
|
\`\`\`
|
|
273
273
|
{root}/
|
|
274
|
-
|
|
275
|
-
Γöé
|
|
276
|
-
|
|
274
|
+
├── {dir}/ ← {purpose}
|
|
275
|
+
Γöé └── ...
|
|
276
|
+
└── {dir}/ ← {purpose}
|
|
277
277
|
\`\`\`
|
|
278
278
|
|
|
279
279
|
## Entry Points
|
|
@@ -296,8 +296,8 @@ Templates for the seven project knowledge documents in \`docs/architecture/\`. U
|
|
|
296
296
|
|
|
297
297
|
## Evidence
|
|
298
298
|
|
|
299
|
-
- \`analyze({ aspect: "structure", ... })\` output ΓÇö directory tree
|
|
300
|
-
- \`analyze({ aspect: "entry_points", ... })\` output ΓÇö entry points
|
|
299
|
+
- \`analyze({ items: [{aspect: "structure", ...}] })\` output ΓÇö directory tree
|
|
300
|
+
- \`analyze({ items: [{aspect: "entry_points", ...}] })\` output ΓÇö entry points
|
|
301
301
|
\`\`\`
|
|
302
302
|
|
|
303
303
|
## design.md
|
|
@@ -318,7 +318,7 @@ Templates for the seven project knowledge documents in \`docs/architecture/\`. U
|
|
|
318
318
|
## Data Flow
|
|
319
319
|
|
|
320
320
|
\`\`\`
|
|
321
|
-
{source}
|
|
321
|
+
{source} → {transform} → {destination}
|
|
322
322
|
\`\`\`
|
|
323
323
|
|
|
324
324
|
{Brief description of primary data paths.}
|
|
@@ -337,9 +337,9 @@ Templates for the seven project knowledge documents in \`docs/architecture/\`. U
|
|
|
337
337
|
|
|
338
338
|
## Evidence
|
|
339
339
|
|
|
340
|
-
- \`analyze({ aspect: "structure", ... })\` output ΓÇö layers
|
|
341
|
-
- \`analyze({ aspect: "patterns", ... })\` output ΓÇö design patterns
|
|
342
|
-
- \`analyze({ aspect: "diagram", ... })\` output ΓÇö component diagrams
|
|
340
|
+
- \`analyze({ items: [{aspect: "structure", ...}] })\` output ΓÇö layers
|
|
341
|
+
- \`analyze({ items: [{aspect: "patterns", ...}] })\` output ΓÇö design patterns
|
|
342
|
+
- \`analyze({ items: [{aspect: "diagram", ...}] })\` output ΓÇö component diagrams
|
|
343
343
|
\`\`\`
|
|
344
344
|
|
|
345
345
|
## conventions.md
|
|
@@ -377,7 +377,7 @@ Templates for the seven project knowledge documents in \`docs/architecture/\`. U
|
|
|
377
377
|
|
|
378
378
|
## Evidence
|
|
379
379
|
|
|
380
|
-
- \`analyze({ aspect: "patterns", ... })\` output ΓÇö detected conventions
|
|
380
|
+
- \`analyze({ items: [{aspect: "patterns", ...}] })\` output ΓÇö detected conventions
|
|
381
381
|
- Linter/formatter config files ΓÇö enforced rules
|
|
382
382
|
\`\`\`
|
|
383
383
|
|
|
@@ -416,7 +416,7 @@ Templates for the seven project knowledge documents in \`docs/architecture/\`. U
|
|
|
416
416
|
|
|
417
417
|
## Evidence
|
|
418
418
|
|
|
419
|
-
- \`analyze({ aspect: "dependencies", ... })\` output ΓÇö external packages
|
|
419
|
+
- \`analyze({ items: [{aspect: "dependencies", ...}] })\` output ΓÇö external packages
|
|
420
420
|
- \`.env.example\` ΓÇö required environment variables
|
|
421
421
|
- CI config files ΓÇö pipeline definitions
|
|
422
422
|
\`\`\`
|
|
@@ -458,7 +458,7 @@ Templates for the seven project knowledge documents in \`docs/architecture/\`. U
|
|
|
458
458
|
|
|
459
459
|
## Evidence
|
|
460
460
|
|
|
461
|
-
- \`analyze({ aspect: "patterns", ... })\` output ΓÇö test patterns
|
|
461
|
+
- \`analyze({ items: [{aspect: "patterns", ...}] })\` output ΓÇö test patterns
|
|
462
462
|
- \`test_run({})\` output ΓÇö test health
|
|
463
463
|
- Test config files ΓÇö framework configuration
|
|
464
464
|
\`\`\`
|
|
@@ -531,13 +531,13 @@ Common pitfalls when documenting project knowledge. Reference this during Phase
|
|
|
531
531
|
|
|
532
532
|
## Anti-Pattern Table
|
|
533
533
|
|
|
534
|
-
|
|
|
534
|
+
| ✗ Don't | ✓ Do instead |
|
|
535
535
|
|---------|--------------|
|
|
536
536
|
| "Uses Clean Architecture with Domain/Data layers" (when no such directories exist) | State only what directory structure actually shows |
|
|
537
537
|
| "This is a Next.js project" (without checking \`package.json\`) | Check \`dependencies\` first. State what's actually there |
|
|
538
538
|
| Guess the database from a variable name like \`dbUrl\` | Check manifest for \`pg\`, \`mysql2\`, \`mongoose\`, \`prisma\`, etc. |
|
|
539
539
|
| Document \`dist/\` or \`build/\` naming patterns as conventions | Source files only |
|
|
540
|
-
| Assume README describes current architecture | Cross-reference with actual file structure via \`analyze({ aspect: "structure", ... })\` |
|
|
540
|
+
| Assume README describes current architecture | Cross-reference with actual file structure via \`analyze({ items: [{aspect: "structure", ...}] })\` |
|
|
541
541
|
| Treat test TODOs as production tech debt | Separate coverage gaps from production concerns in \`concerns.md\` |
|
|
542
542
|
|
|
543
543
|
## Acquisition Workflow
|
|
@@ -560,19 +560,19 @@ All of the following must be true before finishing:
|
|
|
560
560
|
|
|
561
561
|
| Document | Covers | Primary Tools |
|
|
562
562
|
|----------|--------|---------------|
|
|
563
|
-
| \`stack.md\` | Language, runtime, frameworks, dependencies, dev tooling | \`analyze({ aspect: "dependencies", ... })\`, \`analyze({ aspect: "structure", ... })\` |
|
|
564
|
-
| \`structure.md\` | Directory layout, entry points, key files, packages | \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "entry_points", ... })\` |
|
|
565
|
-
| \`design.md\` | Layers, patterns, data flow, component boundaries | \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "patterns", ... })\`, \`analyze({ aspect: "diagram", ... })\` |
|
|
566
|
-
| \`conventions.md\` | Naming, formatting, error handling, import conventions | \`analyze({ aspect: "patterns", ... })\`, \`search("conventions")\` |
|
|
567
|
-
| \`integrations.md\` | External APIs, databases, auth, monitoring, CI/CD | \`analyze({ aspect: "dependencies", ... })\`, \`search("API\\|database\\|auth")\` |
|
|
568
|
-
| \`testing.md\` | Test frameworks, file organization, mocking, coverage | \`analyze({ aspect: "patterns", ... })\`, \`test_run({})\`, \`search("test")\` |
|
|
563
|
+
| \`stack.md\` | Language, runtime, frameworks, dependencies, dev tooling | \`analyze({ items: [{aspect: "dependencies", ...}] })\`, \`analyze({ items: [{aspect: "structure", ...}] })\` |
|
|
564
|
+
| \`structure.md\` | Directory layout, entry points, key files, packages | \`analyze({ items: [{aspect: "structure", ...}] })\`, \`analyze({ items: [{aspect: "entry_points", ...}] })\` |
|
|
565
|
+
| \`design.md\` | Layers, patterns, data flow, component boundaries | \`analyze({ items: [{aspect: "structure", ...}] })\`, \`analyze({ items: [{aspect: "patterns", ...}] })\`, \`analyze({ items: [{aspect: "diagram", ...}] })\` |
|
|
566
|
+
| \`conventions.md\` | Naming, formatting, error handling, import conventions | \`analyze({ items: [{aspect: "patterns", ...}] })\`, \`search("conventions")\` |
|
|
567
|
+
| \`integrations.md\` | External APIs, databases, auth, monitoring, CI/CD | \`analyze({ items: [{aspect: "dependencies", ...}] })\`, \`search("API\\|database\\|auth")\` |
|
|
568
|
+
| \`testing.md\` | Test frameworks, file organization, mocking, coverage | \`analyze({ items: [{aspect: "patterns", ...}] })\`, \`test_run({})\`, \`search("test")\` |
|
|
569
569
|
| \`concerns.md\` | Tech debt, bugs, security risks, perf, high-churn files | \`audit()\`, \`dead_symbols()\`, \`git_context()\` |
|
|
570
570
|
|
|
571
571
|
Use [references/project-knowledge-reference.md](references/project-knowledge-reference.md) for the standard template of each document.
|
|
572
572
|
|
|
573
573
|
### Workflow & References
|
|
574
574
|
|
|
575
|
-
Follow the four-phase workflow: **Scan
|
|
575
|
+
Follow the four-phase workflow: **Scan → Investigate → Populate → Validate**.
|
|
576
576
|
|
|
577
577
|
- [references/project-knowledge-reference.md](references/project-knowledge-reference.md) ΓÇö Full 4-phase workflow, investigation tools per document, population rules, focus area mode
|
|
578
578
|
- [references/project-knowledge-reference.md](references/project-knowledge-reference.md) ΓÇö Environment gotchas and anti-pattern table`},{file:`references/doc-templates.md`,content:`# Document Templates Reference
|
|
@@ -596,8 +596,8 @@ One-paragraph description of what this component does and why it exists.
|
|
|
596
596
|
Brief description of the component's public interface.
|
|
597
597
|
|
|
598
598
|
## Integration Contracts
|
|
599
|
-
- **Incoming**: {caller/component}
|
|
600
|
-
- **Outgoing**: {dependency/component}
|
|
599
|
+
- **Incoming**: {caller/component} → {contract or payload}
|
|
600
|
+
- **Outgoing**: {dependency/component} ← {contract or payload}
|
|
601
601
|
|
|
602
602
|
## Design Decisions
|
|
603
603
|
- Link to relevant ADRs: [ADR-NNN](../../decisions/NNN-{title}.md)
|
|
@@ -618,7 +618,7 @@ sequenceDiagram
|
|
|
618
618
|
\`\`\`
|
|
619
619
|
|
|
620
620
|
## Error Paths & Failure Modes
|
|
621
|
-
- {failure mode}
|
|
621
|
+
- {failure mode} → {observable symptom} → {recovery or fallback}
|
|
622
622
|
\`\`\`
|
|
623
623
|
|
|
624
624
|
### Tutorial Template (\`docs/guides/tutorials/{topic}.md\`)
|
|
@@ -740,8 +740,8 @@ Use this template for any generated section that includes factual claims:
|
|
|
740
740
|
|
|
741
741
|
| Claim | Evidence | Class |
|
|
742
742
|
|-------|----------|-------|
|
|
743
|
-
| API supports pagination | \`src/routes/users.ts:42\` ΓÇö \`limit\` and \`offset\` params |
|
|
744
|
-
| Rate limiting at 100 req/min | \`src/middleware/rate-limit.ts:15\` ΓÇö \`rateLimit({ max: 100 })\` |
|
|
743
|
+
| API supports pagination | \`src/routes/users.ts:42\` ΓÇö \`limit\` and \`offset\` params | ✓ Verified |
|
|
744
|
+
| Rate limiting at 100 req/min | \`src/middleware/rate-limit.ts:15\` ΓÇö \`rateLimit({ max: 100 })\` | ✓ Verified |
|
|
745
745
|
| Supports multi-tenant isolation | Inferred from \`orgId\` discriminator in queries | 🔍 Inferred |
|
|
746
746
|
| Designed for horizontal scaling | No direct code evidence | ⚠️ Assumed |
|
|
747
747
|
\`\`\`
|
|
@@ -782,7 +782,7 @@ Generate dependency-ordered codebase walkthroughs that teach the system through
|
|
|
782
782
|
|
|
783
783
|
### Algorithm
|
|
784
784
|
|
|
785
|
-
1. \`analyze({ aspect: "entry_points", path: "." })\` ΓÇö find likely tour starting points
|
|
785
|
+
1. \`analyze({ items: [{aspect: "entry_points", path: "."}] })\` ΓÇö find likely tour starting points
|
|
786
786
|
2. \`graph({ action: "find_nodes", name_pattern: "src" })\` ΓÇö get relevant module nodes
|
|
787
787
|
3. \`graph({ action: "neighbors", node_id: "<entry>", direction: "outgoing" })\` ΓÇö build the local dependency view
|
|
788
788
|
4. Topological sort on import edges ΓÇö determine reading order
|
|
@@ -811,7 +811,7 @@ Each prose step in a markdown tour should name the focus, explain what the reade
|
|
|
811
811
|
### Tour Generation Workflow
|
|
812
812
|
|
|
813
813
|
1. Run the algorithm above to produce an ordered step list
|
|
814
|
-
2. For each step, use \`compact({ path, query: "purpose and public API" })\` to extract key info
|
|
814
|
+
2. For each step, use \`compact({ items: [{path, query: "purpose and public API"}] })\` to extract key info
|
|
815
815
|
3. Write the tour as \`docs/tours/{topic}.md\`
|
|
816
816
|
4. Generate \`docs/tours/index.md\` linking all tours with descriptions
|
|
817
817
|
|
|
@@ -833,14 +833,14 @@ Guided walkthroughs ordered for understanding.
|
|
|
833
833
|
|
|
834
834
|
\`\`\`
|
|
835
835
|
docs/
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
836
|
+
└── tours/
|
|
837
|
+
├── index.md # Tour listing with descriptions
|
|
838
|
+
├── architecture.md # System structure tour
|
|
839
|
+
├── data-flow.md # Data pipeline tour
|
|
840
|
+
├── feature-{name}.md # Feature-specific tours
|
|
841
|
+
└── interactive/
|
|
842
|
+
├── {name}.json # Tour data injected into viewer
|
|
843
|
+
└── {name}.html # Interactive viewer output
|
|
844
844
|
\`\`\`
|
|
845
845
|
|
|
846
846
|
## Interactive JSON Tour (Recommended)
|
|
@@ -954,9 +954,9 @@ After generating tour JSON, validate EVERY step's line numbers against the actua
|
|
|
954
954
|
**Validation snippet:**
|
|
955
955
|
\`\`\`
|
|
956
956
|
For each step:
|
|
957
|
-
compact({ path: step.file, query: step.title })
|
|
958
|
-
read_file(step.file, step.line, step.line + 10)
|
|
959
|
-
If mismatch
|
|
957
|
+
compact({ items: [{path: step.file, query: step.title}] }) → find actual location
|
|
958
|
+
read_file(step.file, step.line, step.line + 10) → verify code matches description
|
|
959
|
+
If mismatch → search({ query: step.explanation }) → find correct file:line
|
|
960
960
|
\`\`\`
|
|
961
961
|
|
|
962
962
|
Tour JSON with stale line numbers is a **quality gate failure**. Fix before saving.
|
|
@@ -1118,7 +1118,7 @@ present({
|
|
|
1118
1118
|
|
|
1119
1119
|
## Business Domain Documentation
|
|
1120
1120
|
|
|
1121
|
-
Document the business domain as a three-level hierarchy: **Domain
|
|
1121
|
+
Document the business domain as a three-level hierarchy: **Domain → Flow → Step**. This captures what the system does in business terms, separate from its technical architecture.
|
|
1122
1122
|
|
|
1123
1123
|
### Hierarchy
|
|
1124
1124
|
|
|
@@ -1128,9 +1128,9 @@ Document the business domain as a three-level hierarchy: **Domain ΓåÆ Flow Γ
|
|
|
1128
1128
|
|
|
1129
1129
|
### Domain Discovery Workflow
|
|
1130
1130
|
|
|
1131
|
-
1. \`analyze({ aspect: "structure", path: "." })\` ΓÇö identify top-level domain boundaries
|
|
1132
|
-
2. \`analyze({ aspect: "entry_points", path: "." })\` ΓÇö detect flow entry types
|
|
1133
|
-
3. \`trace({ start: "<entry-point>", direction: "forward" })\` ΓÇö map each flow's step sequence
|
|
1131
|
+
1. \`analyze({ items: [{aspect: "structure", path: "."}] })\` ΓÇö identify top-level domain boundaries
|
|
1132
|
+
2. \`analyze({ items: [{aspect: "entry_points", path: "."}] })\` ΓÇö detect flow entry types
|
|
1133
|
+
3. \`trace({ items: [{start: "<entry-point>", direction: "forward"}] })\` ΓÇö map each flow's step sequence
|
|
1134
1134
|
4. \`graph({ action: "neighbors", node_id: "<domain-module>", direction: "both" })\` ΓÇö find cross-domain interactions
|
|
1135
1135
|
|
|
1136
1136
|
### Domain Template (\`docs/architecture/domains/{domain-name}.md\`)
|
|
@@ -1168,19 +1168,19 @@ Document the business domain as a three-level hierarchy: **Domain ΓåÆ Flow Γ
|
|
|
1168
1168
|
|
|
1169
1169
|
| This Domain | Direction | Other Domain | Mechanism |
|
|
1170
1170
|
|-------------|-----------|--------------|-----------|
|
|
1171
|
-
| {current} |
|
|
1172
|
-
| {other} |
|
|
1171
|
+
| {current} | → calls | {other} | {API/event/import} |
|
|
1172
|
+
| {other} | → notifies | {current} | {event/callback} |
|
|
1173
1173
|
\`\`\`
|
|
1174
1174
|
|
|
1175
1175
|
### Directory Convention
|
|
1176
1176
|
|
|
1177
1177
|
\`\`\`
|
|
1178
1178
|
docs/
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1179
|
+
└── architecture/
|
|
1180
|
+
└── domains/
|
|
1181
|
+
├── authentication.md
|
|
1182
|
+
├── billing.md
|
|
1183
|
+
└── inventory.md
|
|
1184
1184
|
\`\`\``},{file:`references/tour.schema.json`,content:`{
|
|
1185
1185
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1186
1186
|
"title": "AIKIT Interactive Code Tour",
|
|
@@ -1323,10 +1323,10 @@ Structured LLM prompt templates for generating high-quality documentation. Each
|
|
|
1323
1323
|
**Phase 1** is deterministic (no LLM needed):
|
|
1324
1324
|
\`\`\`
|
|
1325
1325
|
# Deterministic Tour Ranking (run BEFORE LLM)
|
|
1326
|
-
1. graph({ action: "find_nodes" })
|
|
1326
|
+
1. graph({ action: "find_nodes" }) → get all module nodes
|
|
1327
1327
|
2. Compute for each node:
|
|
1328
|
-
- in_degree (how many import it)
|
|
1329
|
-
- out_degree (how many it imports)
|
|
1328
|
+
- in_degree (how many import it) → "importance"
|
|
1329
|
+
- out_degree (how many it imports) → "complexity"
|
|
1330
1330
|
- centrality = in_degree / (in_degree + out_degree)
|
|
1331
1331
|
3. Rank by: entry_points FIRST, then by centrality DESC
|
|
1332
1332
|
4. Group by layer (from layer detection)
|
|
@@ -1469,7 +1469,7 @@ You are a domain and architecture analyst. Given files belonging to a business d
|
|
|
1469
1469
|
"Rule 2 description"
|
|
1470
1470
|
],
|
|
1471
1471
|
"flows": [
|
|
1472
|
-
{ "name": "Flow name", "steps": ["Step 1
|
|
1472
|
+
{ "name": "Flow name", "steps": ["Step 1 → file:fn", "Step 2 → file:fn"], "trigger": "What initiates this" }
|
|
1473
1473
|
],
|
|
1474
1474
|
"sequenceDiagramMermaid": "sequenceDiagram\\n participant Client\\n participant Domain\\n participant Dependency\\n Client->>Domain: Trigger flow\\n Domain->>Dependency: Call contract\\n Dependency-->>Domain: Response",
|
|
1475
1475
|
"integrationContracts": [
|
|
@@ -1506,9 +1506,9 @@ const priorState = JSON.parse(readFile("docs/.docs-state.json"))
|
|
|
1506
1506
|
1. Compute SHA-256 hash of current content
|
|
1507
1507
|
2. Extract function/class signatures (name + params + return type)
|
|
1508
1508
|
3. Compare against priorState:
|
|
1509
|
-
- Hash identical
|
|
1510
|
-
- Hash different but signatures identical
|
|
1511
|
-
- Signatures changed
|
|
1509
|
+
- Hash identical → NONE (skip entirely)
|
|
1510
|
+
- Hash different but signatures identical → COSMETIC (update timestamps only)
|
|
1511
|
+
- Signatures changed → STRUCTURAL (full regeneration needed)
|
|
1512
1512
|
4. Output: changeManifest = { none: [...], cosmetic: [...], structural: [...], new: [...] }
|
|
1513
1513
|
\`\`\`
|
|
1514
1514
|
|
|
@@ -1539,8 +1539,8 @@ Later phases consume this IR instead of re-reading raw files.
|
|
|
1539
1539
|
### Phase 2 ΓÇö Analyze (deterministic + LLM)
|
|
1540
1540
|
\`\`\`
|
|
1541
1541
|
# Identify documentation gaps
|
|
1542
|
-
analyze({ aspect: "structure" }) # All modules
|
|
1543
|
-
analyze({ aspect: "entry_points" }) # Tour starting points
|
|
1542
|
+
analyze({ items: [{aspect: "structure"}] }) # All modules
|
|
1543
|
+
analyze({ items: [{aspect: "entry_points"}] }) # Tour starting points
|
|
1544
1544
|
graph({ action: "find_nodes" }) # Full module graph
|
|
1545
1545
|
# For each undocumented module: apply File Documentation Prompt
|
|
1546
1546
|
# For each domain cluster: apply Domain Documentation Prompt
|
|
@@ -1550,12 +1550,12 @@ graph({ action: "find_nodes" }) # Full module graph
|
|
|
1550
1550
|
|
|
1551
1551
|
**Phase 2a ΓÇö Deterministic (no LLM tokens):**
|
|
1552
1552
|
\`\`\`
|
|
1553
|
-
analyze({ aspect: "structure" }) # File tree, exports, imports
|
|
1554
|
-
analyze({ aspect: "symbols" }) # All exported symbols
|
|
1555
|
-
analyze({ aspect: "entry_points" }) # Entry points
|
|
1553
|
+
analyze({ items: [{aspect: "structure"}] }) # File tree, exports, imports
|
|
1554
|
+
analyze({ items: [{aspect: "symbols"}] }) # All exported symbols
|
|
1555
|
+
analyze({ items: [{aspect: "entry_points"}] }) # Entry points
|
|
1556
1556
|
graph({ action: "find_nodes" }) # Module graph
|
|
1557
1557
|
# For each module:
|
|
1558
|
-
file_summary({ path }) # Structure without reading full file
|
|
1558
|
+
file_summary({ items: [{path}] }) # Structure without reading full file
|
|
1559
1559
|
# Output: structured JSON with all deterministic facts
|
|
1560
1560
|
\`\`\`
|
|
1561
1561
|
|
|
@@ -1574,12 +1574,12 @@ Do NOT re-analyze file structure ΓÇö it is already correct in the input."
|
|
|
1574
1574
|
For large codebases, run specialized analyzers in parallel:
|
|
1575
1575
|
\`\`\`
|
|
1576
1576
|
# Parallel analyzers (each can be a separate subagent dispatch):
|
|
1577
|
-
1. Structure Analyzer
|
|
1578
|
-
2. Dependency Analyzer
|
|
1579
|
-
3. Flow Analyzer
|
|
1580
|
-
4. Test Analyzer
|
|
1581
|
-
5. Config Analyzer
|
|
1582
|
-
6. Existing-Docs Analyzer
|
|
1577
|
+
1. Structure Analyzer → file tree, layers, boundaries
|
|
1578
|
+
2. Dependency Analyzer → import graph, cross-package edges
|
|
1579
|
+
3. Flow Analyzer → request paths, data transformations
|
|
1580
|
+
4. Test Analyzer → test descriptions, coverage signals
|
|
1581
|
+
5. Config Analyzer → env vars, feature flags, build config
|
|
1582
|
+
6. Existing-Docs Analyzer → scan docs/, README, comments, JSDoc
|
|
1583
1583
|
|
|
1584
1584
|
# Layer detection consumes ALL analyzer outputs
|
|
1585
1585
|
\`\`\`
|
|
@@ -1591,16 +1591,16 @@ search({ query: "describe\\(|it\\(|test\\(" })
|
|
|
1591
1591
|
# OR
|
|
1592
1592
|
find({ pattern: "(describe|it|test)\\s*\\(" })
|
|
1593
1593
|
|
|
1594
|
-
# Group by feature area (file path
|
|
1594
|
+
# Group by feature area (file path → domain)
|
|
1595
1595
|
# Only harvest from:
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1596
|
+
✓ BDD: describe("User Authentication", () => { it("should login with valid credentials") })
|
|
1597
|
+
✓ E2E: test("checkout flow completes successfully")
|
|
1598
|
+
✓ Business: it("calculates tax correctly for international orders")
|
|
1599
1599
|
|
|
1600
1600
|
# Skip:
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1601
|
+
✗ Snapshots: it("renders correctly")
|
|
1602
|
+
✗ Performance: it("completes within 100ms")
|
|
1603
|
+
✗ Internal: it("calls private helper")
|
|
1604
1604
|
|
|
1605
1605
|
# Output: test-requirement map
|
|
1606
1606
|
{
|
|
@@ -1631,7 +1631,7 @@ graph({ action: "find_nodes" })
|
|
|
1631
1631
|
|
|
1632
1632
|
# Step 3: Name clusters by:
|
|
1633
1633
|
# - Directory name (e.g., "authentication" from src/auth/)
|
|
1634
|
-
# - Shared export prefix (e.g., "User*"
|
|
1634
|
+
# - Shared export prefix (e.g., "User*" → "User Management")
|
|
1635
1635
|
# - Domain keyword extraction from file names
|
|
1636
1636
|
|
|
1637
1637
|
# Step 4: Validate clusters
|
|
@@ -1653,10 +1653,10 @@ graph({ action: "find_nodes" })
|
|
|
1653
1653
|
\`\`\`
|
|
1654
1654
|
|
|
1655
1655
|
**Anti-pattern prevention:**
|
|
1656
|
-
-
|
|
1657
|
-
-
|
|
1658
|
-
-
|
|
1659
|
-
-
|
|
1656
|
+
- ✗ NEVER generate one doc per file → generates useless entries like "dateFormatter utility docs"
|
|
1657
|
+
- ✓ ALWAYS cluster files into features → generates meaningful domain documentation
|
|
1658
|
+
- ✗ NEVER map file paths directly to PRD sections
|
|
1659
|
+
- ✓ ALWAYS map feature clusters to PRD capabilities
|
|
1660
1660
|
|
|
1661
1661
|
### Phase 4 ΓÇö Generate Tours (3-phase)
|
|
1662
1662
|
\`\`\`
|
|
@@ -1691,7 +1691,7 @@ graph({ action: "find_nodes" })
|
|
|
1691
1691
|
|
|
1692
1692
|
#### Multi-Layer PRD Extraction Detail
|
|
1693
1693
|
|
|
1694
|
-
**L1 ΓÇö Direct Harvest (HIGH confidence,
|
|
1694
|
+
**L1 ΓÇö Direct Harvest (HIGH confidence, ✓ Verified):**
|
|
1695
1695
|
\`\`\`
|
|
1696
1696
|
# Auto-detect and harvest structured specs:
|
|
1697
1697
|
find({ glob: "**/*.{yaml,yml,json}" }) # OpenAPI/Swagger specs
|
|
@@ -1699,27 +1699,27 @@ find({ glob: "**/*.feature" }) # Gherkin/BDD scenarios
|
|
|
1699
1699
|
find({ glob: "**/*.graphql" }) # GraphQL schemas
|
|
1700
1700
|
find({ glob: "**/migrations/**" }) # Database migration files
|
|
1701
1701
|
|
|
1702
|
-
# Each found spec
|
|
1703
|
-
# OpenAPI
|
|
1704
|
-
# Gherkin
|
|
1705
|
-
# GraphQL
|
|
1706
|
-
# Migrations
|
|
1702
|
+
# Each found spec → direct extraction:
|
|
1703
|
+
# OpenAPI → API endpoints, request/response schemas, auth requirements
|
|
1704
|
+
# Gherkin → user stories with acceptance criteria
|
|
1705
|
+
# GraphQL → data model, query capabilities
|
|
1706
|
+
# Migrations → data model evolution
|
|
1707
1707
|
\`\`\`
|
|
1708
1708
|
|
|
1709
1709
|
**L2 — Pattern Inference (MEDIUM confidence, 🔍 Inferred):**
|
|
1710
1710
|
\`\`\`
|
|
1711
1711
|
# Extract from code patterns:
|
|
1712
|
-
# API routes
|
|
1712
|
+
# API routes → user story inference
|
|
1713
1713
|
find({ pattern: "router\\.(get|post|put|delete|patch)" })
|
|
1714
|
-
#
|
|
1714
|
+
# → "As a [role], I can [HTTP method] [resource] to [inferred purpose]"
|
|
1715
1715
|
|
|
1716
|
-
# TypeScript interfaces
|
|
1717
|
-
symbol({ name: "interface" })
|
|
1718
|
-
#
|
|
1716
|
+
# TypeScript interfaces → data model
|
|
1717
|
+
symbol({ items: [{name: "interface"}] })
|
|
1718
|
+
# → Data entities with field types and relationships
|
|
1719
1719
|
|
|
1720
|
-
# JSDoc/docstrings
|
|
1720
|
+
# JSDoc/docstrings → functional requirements
|
|
1721
1721
|
find({ pattern: "@description|@summary|@purpose" })
|
|
1722
|
-
#
|
|
1722
|
+
# → Requirements text from developer documentation
|
|
1723
1723
|
\`\`\`
|
|
1724
1724
|
|
|
1725
1725
|
**L3 — Reverse Generation (LOW confidence, ⚠️ Assumed):**
|
|
@@ -1729,13 +1729,13 @@ find({ pattern: "@description|@summary|@purpose" })
|
|
|
1729
1729
|
"What user-facing requirement does this code fulfill?
|
|
1730
1730
|
Respond with a user story format. Mark confidence as LOW."
|
|
1731
1731
|
|
|
1732
|
-
# Git history
|
|
1732
|
+
# Git history → feature timeline
|
|
1733
1733
|
git_context({ commit_count: 50 })
|
|
1734
|
-
# Group commits by feature area
|
|
1734
|
+
# Group commits by feature area → evolution narrative
|
|
1735
1735
|
|
|
1736
|
-
# Code comments
|
|
1736
|
+
# Code comments → developer intent
|
|
1737
1737
|
find({ pattern: "// TODO|// FIXME|// HACK|// NOTE" })
|
|
1738
|
-
#
|
|
1738
|
+
# → Technical debt items and design intent
|
|
1739
1739
|
\`\`\`
|
|
1740
1740
|
|
|
1741
1741
|
#### NFR Extraction Detail
|
|
@@ -1766,7 +1766,7 @@ find({ pattern: "audit|auditLog|audit.?trail" })
|
|
|
1766
1766
|
find({ pattern: "retention|ttl|expiry|purge" })
|
|
1767
1767
|
find({ pattern: "consent|gdpr|GDPR|pii|PII|redact" })
|
|
1768
1768
|
|
|
1769
|
-
# Each match
|
|
1769
|
+
# Each match → NFR row:
|
|
1770
1770
|
{ category: "Security", pattern: "rateLimit", file: "src/middleware/rate-limit.ts", evidence: "Rate limiter at 100 req/min per IP", nfr: "API must enforce rate limiting at 100 requests per minute per client IP" }
|
|
1771
1771
|
\`\`\`
|
|
1772
1772
|
|
|
@@ -1803,8 +1803,8 @@ find({ pattern: "orgId|tenantId|teamId|workspaceId" })
|
|
|
1803
1803
|
- Use the c4-architecture skill to produce interactive HTML with ELK auto-layout
|
|
1804
1804
|
- Save to docs/architecture/interactive/{view-name}.html
|
|
1805
1805
|
3. Add navigation links:
|
|
1806
|
-
- From docs/architecture/overview.md
|
|
1807
|
-
- From tour steps that reference architecture
|
|
1806
|
+
- From docs/architecture/overview.md → link to interactive viewers
|
|
1807
|
+
- From tour steps that reference architecture → link to relevant C4 view
|
|
1808
1808
|
4. Generate documentation hub:
|
|
1809
1809
|
- Use the present tool's docs-browser block type to create a navigable index
|
|
1810
1810
|
- Include all markdown docs with status indicators and links to interactive companions
|
|
@@ -1827,7 +1827,7 @@ find({ pattern: "orgId|tenantId|teamId|workspaceId" })
|
|
|
1827
1827
|
- Each sentence with a specific assertion = one claim
|
|
1828
1828
|
|
|
1829
1829
|
2. For each claim, find its code anchor:
|
|
1830
|
-
-
|
|
1830
|
+
- ✓ Verified: claim references specific file:line, function, or test
|
|
1831
1831
|
- 🔍 Inferred: claim derived from pattern or docstring
|
|
1832
1832
|
- ⚠️ Assumed: no direct code anchor found
|
|
1833
1833
|
|
|
@@ -1842,9 +1842,9 @@ find({ pattern: "orgId|tenantId|teamId|workspaceId" })
|
|
|
1842
1842
|
Target: ≥80% for PRDs, ≥70% for architecture docs, ≥90% for API reference
|
|
1843
1843
|
|
|
1844
1844
|
5. Gap report:
|
|
1845
|
-
- Claims with no anchor
|
|
1846
|
-
- Code with no corresponding doc
|
|
1847
|
-
- Sections >50% assumed
|
|
1845
|
+
- Claims with no anchor → "ΓÜá∩╕Å Needs human review"
|
|
1846
|
+
- Code with no corresponding doc → "≡ƒô¥ Undocumented"
|
|
1847
|
+
- Sections >50% assumed → add review banner
|
|
1848
1848
|
\`\`\`
|
|
1849
1849
|
|
|
1850
1850
|
#### Evidence Verification
|
|
@@ -1863,25 +1863,25 @@ find({ pattern: "orgId|tenantId|teamId|workspaceId" })
|
|
|
1863
1863
|
### Output Structure
|
|
1864
1864
|
\`\`\`
|
|
1865
1865
|
docs/
|
|
1866
|
-
|
|
1867
|
-
Γöé
|
|
1868
|
-
Γöé
|
|
1869
|
-
Γöé
|
|
1870
|
-
Γöé
|
|
1871
|
-
Γöé
|
|
1872
|
-
|
|
1873
|
-
Γöé
|
|
1874
|
-
Γöé
|
|
1875
|
-
Γöé
|
|
1876
|
-
Γöé Γöé
|
|
1877
|
-
Γöé Γöé
|
|
1878
|
-
Γöé
|
|
1879
|
-
Γöé
|
|
1880
|
-
Γöé
|
|
1881
|
-
|
|
1882
|
-
Γöé
|
|
1883
|
-
|
|
1884
|
-
|
|
1866
|
+
├── tours/
|
|
1867
|
+
Γöé ├── getting-started.md # Primary tour (Mermaid diagrams)
|
|
1868
|
+
Γöé ├── advanced-internals.md # Deep-dive tour
|
|
1869
|
+
Γöé └── interactive/
|
|
1870
|
+
Γöé ├── getting-started.html # Shipped tour-viewer.html + JSON data
|
|
1871
|
+
Γöé └── advanced-internals.html
|
|
1872
|
+
├── architecture/
|
|
1873
|
+
Γöé ├── c4-context.md
|
|
1874
|
+
Γöé ├── c4-containers.md
|
|
1875
|
+
Γöé ├── interactive/
|
|
1876
|
+
Γöé Γöé ├── overview.html # React Flow architecture
|
|
1877
|
+
Γöé Γöé └── per-service.html
|
|
1878
|
+
Γöé └── domains/
|
|
1879
|
+
Γöé ├── authentication.md
|
|
1880
|
+
Γöé └── billing.md
|
|
1881
|
+
├── reference/
|
|
1882
|
+
Γöé └── modules/ # Per-module API docs
|
|
1883
|
+
└── guides/
|
|
1884
|
+
└── contributing.md
|
|
1885
1885
|
\`\`\`
|
|
1886
1886
|
|
|
1887
1887
|
## Framework Context Injection
|
|
@@ -1891,10 +1891,10 @@ When generating documentation for a specific framework, inject framework-specifi
|
|
|
1891
1891
|
### Detection
|
|
1892
1892
|
\`\`\`
|
|
1893
1893
|
# Auto-detect framework from project files:
|
|
1894
|
-
- package.json
|
|
1895
|
-
- requirements.txt
|
|
1896
|
-
- go.mod
|
|
1897
|
-
- Cargo.toml
|
|
1894
|
+
- package.json → "next", "react", "express", "nestjs", "@angular/core"
|
|
1895
|
+
- requirements.txt → "django", "flask", "fastapi"
|
|
1896
|
+
- go.mod → "gin", "fiber", "echo"
|
|
1897
|
+
- Cargo.toml → "actix-web", "axum", "rocket"
|
|
1898
1898
|
\`\`\`
|
|
1899
1899
|
|
|
1900
1900
|
### Addendum Format
|
|
@@ -1934,8 +1934,8 @@ When generating documentation for a specific framework, inject framework-specifi
|
|
|
1934
1934
|
| components/** | Component docs | Props, usage examples, variants |
|
|
1935
1935
|
|
|
1936
1936
|
### Tour Conventions
|
|
1937
|
-
- Tour starts at: app/layout.tsx (root)
|
|
1938
|
-
- Key progression: Layout
|
|
1937
|
+
- Tour starts at: app/layout.tsx (root) → app/page.tsx (home)
|
|
1938
|
+
- Key progression: Layout → Pages → API Routes → Lib → Components
|
|
1939
1939
|
- Framework concepts: App Router, Server Components, Server Actions, Middleware
|
|
1940
1940
|
|
|
1941
1941
|
### Domain Conventions
|
|
@@ -1966,7 +1966,7 @@ What problem does this solve? Who has this problem? What's the impact of not sol
|
|
|
1966
1966
|
|
|
1967
1967
|
### 4. Capabilities
|
|
1968
1968
|
|
|
1969
|
-
Each capability has a unique ID for tracing requirements
|
|
1969
|
+
Each capability has a unique ID for tracing requirements → code → tests → docs.
|
|
1970
1970
|
|
|
1971
1971
|
| capability_id | Name | Description | Status |
|
|
1972
1972
|
|---------------|------|-------------|--------|
|
|
@@ -2020,10 +2020,10 @@ Extracted automatically from code patterns. Each NFR includes code evidence.
|
|
|
2020
2020
|
|
|
2021
2021
|
| Category | Requirement | Evidence | Confidence |
|
|
2022
2022
|
|----------|-------------|----------|------------|
|
|
2023
|
-
| Performance | [requirement statement] | [file:line pattern found] |
|
|
2024
|
-
| Security | [requirement statement] | [file:line pattern found] |
|
|
2025
|
-
| Reliability | [requirement statement] | [file:line pattern found] |
|
|
2026
|
-
| Compliance | [requirement statement] | [file:line pattern found] |
|
|
2023
|
+
| Performance | [requirement statement] | [file:line pattern found] | ✓/≡ƒöì/ΓÜá∩╕Å |
|
|
2024
|
+
| Security | [requirement statement] | [file:line pattern found] | ✓/≡ƒöì/ΓÜá∩╕Å |
|
|
2025
|
+
| Reliability | [requirement statement] | [file:line pattern found] | ✓/≡ƒöì/ΓÜá∩╕Å |
|
|
2026
|
+
| Compliance | [requirement statement] | [file:line pattern found] | ✓/≡ƒöì/ΓÜá∩╕Å |
|
|
2027
2027
|
|
|
2028
2028
|
**Extraction patterns (run these searches):**
|
|
2029
2029
|
- Performance: \`setTimeout\`, \`debounce\`, \`cache\`, \`TTL\`, \`pagination\`, \`pool\`, \`maxConnections\`
|
|
@@ -2067,11 +2067,11 @@ Each PRD section carries a confidence rating based on its extraction source:
|
|
|
2067
2067
|
|
|
2068
2068
|
| Evidence Class | Symbol | Source | Trust Level |
|
|
2069
2069
|
|----------------|--------|--------|-------------|
|
|
2070
|
-
| Verified |
|
|
2070
|
+
| Verified | ✓ | OpenAPI specs, test assertions, type signatures | High ΓÇö directly from code |
|
|
2071
2071
|
| Inferred | 🔍 | Route patterns, docstrings, naming conventions | Medium — pattern-based |
|
|
2072
2072
|
| Assumed | ⚠️ | LLM interpretation of implementation code | Low — needs human review |
|
|
2073
2073
|
|
|
2074
|
-
**Completeness target:** ≥80% of capability claims should be
|
|
2074
|
+
**Completeness target:** ΓëÑ80% of capability claims should be ✓ Verified or ≡ƒöì Inferred.
|
|
2075
2075
|
Sections with >50% ⚠️ Assumed claims must include a review banner.
|
|
2076
2076
|
|
|
2077
2077
|
---
|
|
@@ -2109,8 +2109,8 @@ The PRD index tracks all PRDs and their capabilities for automated cross-referen
|
|
|
2109
2109
|
|---------|--------|
|
|
2110
2110
|
| New feature request | Create new PRD with capability_ids |
|
|
2111
2111
|
| Flow design step | Reference PRD, add capabilities |
|
|
2112
|
-
| Implementation complete | Update capability status
|
|
2113
|
-
| Tests passing | Update capability status
|
|
2112
|
+
| Implementation complete | Update capability status → implemented |
|
|
2113
|
+
| Tests passing | Update capability status → verified |
|
|
2114
2114
|
| Architecture decision | Link ADR to affected capabilities |
|
|
2115
2115
|
`},{file:`references/architecture-blueprint.md`,content:`# Architecture Blueprint Reference
|
|
2116
2116
|
|
|
@@ -2122,21 +2122,21 @@ When bootstrapping \`docs/\` for the first time or refreshing architecture docum
|
|
|
2122
2122
|
|
|
2123
2123
|
\`\`\`
|
|
2124
2124
|
Step 1: Detect & Analyze
|
|
2125
|
-
analyze({ aspect: "structure", path: "." })
|
|
2126
|
-
analyze({ aspect: "patterns", path: "." })
|
|
2127
|
-
analyze({ aspect: "entry_points", path: "." })
|
|
2125
|
+
analyze({ items: [{aspect: "structure", path: "."}] }) → project layout, packages, layers
|
|
2126
|
+
analyze({ items: [{aspect: "patterns", path: "."}] }) → conventions, design patterns
|
|
2127
|
+
analyze({ items: [{aspect: "entry_points", path: "."}] }) → API surface, CLI entry points
|
|
2128
2128
|
|
|
2129
2129
|
Step 2: Map Dependencies
|
|
2130
|
-
analyze({ aspect: "dependencies", path: "." })
|
|
2131
|
-
graph({ action: 'find_nodes', name_pattern: '*' })
|
|
2132
|
-
graph({ action: 'neighbors', node_id: '...' })
|
|
2130
|
+
analyze({ items: [{aspect: "dependencies", path: "."}] }) → import graph, cross-package edges
|
|
2131
|
+
graph({ action: 'find_nodes', name_pattern: '*' }) → module graph nodes
|
|
2132
|
+
graph({ action: 'neighbors', node_id: '...' }) → dependency directions
|
|
2133
2133
|
|
|
2134
2134
|
Step 3: Visualize
|
|
2135
|
-
analyze({ aspect: "diagram", path: "." })
|
|
2136
|
-
Delegate to c4-architecture skill
|
|
2135
|
+
analyze({ items: [{aspect: "diagram", path: "."}] }) → Mermaid architecture diagrams
|
|
2136
|
+
Delegate to c4-architecture skill → C4 context/container/component views
|
|
2137
2137
|
|
|
2138
2138
|
Step 4: Synthesize
|
|
2139
|
-
produce_knowledge({ scope: "." })
|
|
2139
|
+
produce_knowledge({ scope: "." }) → comprehensive analysis
|
|
2140
2140
|
Combine outputs into docs/ structure
|
|
2141
2141
|
\`\`\`
|
|
2142
2142
|
|
|
@@ -2146,21 +2146,21 @@ The architecture blueprint should cover these areas (adapted from the Architectu
|
|
|
2146
2146
|
|
|
2147
2147
|
#### 1. Architecture Detection & Analysis
|
|
2148
2148
|
- **Auto-detect**: Project type, framework, architectural pattern (Clean Architecture, Microservices, Layered, etc.)
|
|
2149
|
-
- **Tools**: \`analyze({ aspect: "structure", ... })\`
|
|
2149
|
+
- **Tools**: \`analyze({ items: [{aspect: "structure", ...}] })\` → folder organization, \`analyze({ items: [{aspect: "patterns", ...}] })\` → framework detection, \`analyze({ items: [{aspect: "dependencies", ...}] })\` → dependency flow
|
|
2150
2150
|
- **Output**: \`docs/architecture/overview.md\` header section
|
|
2151
2151
|
|
|
2152
2152
|
#### 2. Architectural Overview
|
|
2153
2153
|
- Guiding principles from code structure
|
|
2154
2154
|
- Architectural boundaries and enforcement mechanisms
|
|
2155
2155
|
- Hybrid patterns or adaptations
|
|
2156
|
-
- **Tools**: \`produce_knowledge\` + \`analyze({ aspect: "structure", ... })\`
|
|
2156
|
+
- **Tools**: \`produce_knowledge\` + \`analyze({ items: [{aspect: "structure", ...}] })\`
|
|
2157
2157
|
- **Output**: \`docs/architecture/overview.md\` main body
|
|
2158
2158
|
|
|
2159
2159
|
#### 3. Architecture Visualization
|
|
2160
2160
|
- High-level subsystem diagram
|
|
2161
2161
|
- Component interaction diagrams
|
|
2162
2162
|
- Data flow diagrams
|
|
2163
|
-
- **Tools**: \`analyze({ aspect: "diagram", ... })\` + \`c4-architecture\` skill
|
|
2163
|
+
- **Tools**: \`analyze({ items: [{aspect: "diagram", ...}] })\` + \`c4-architecture\` skill
|
|
2164
2164
|
- **Output**: \`docs/architecture/overview.md\` diagrams + \`docs/architecture/diagrams/\`
|
|
2165
2165
|
|
|
2166
2166
|
#### 4. Core Architectural Components
|
|
@@ -2169,7 +2169,7 @@ For each major component:
|
|
|
2169
2169
|
- Internal structure
|
|
2170
2170
|
- Key abstractions
|
|
2171
2171
|
- Interaction patterns
|
|
2172
|
-
- **Tools**: \`analyze({ aspect: "symbols", path: "component/" })\` + \`compact({ path, query: "exports" })\`
|
|
2172
|
+
- **Tools**: \`analyze({ items: [{aspect: "symbols", path: "component/"}] })\` + \`compact({ items: [{path, query: "exports"}] })\`
|
|
2173
2173
|
- **Output**: \`docs/architecture/components/{name}.md\`
|
|
2174
2174
|
|
|
2175
2175
|
#### 5. Layers & Dependencies
|
|
@@ -2177,7 +2177,7 @@ For each major component:
|
|
|
2177
2177
|
- Dependency rules between layers
|
|
2178
2178
|
- Abstraction mechanisms for separation
|
|
2179
2179
|
- Circular dependencies or violations
|
|
2180
|
-
- **Tools**: \`analyze({ aspect: "dependencies", ... })\` + \`graph({ action: 'neighbors' })\`
|
|
2180
|
+
- **Tools**: \`analyze({ items: [{aspect: "dependencies", ...}] })\` + \`graph({ action: 'neighbors' })\`
|
|
2181
2181
|
- **Output**: \`docs/architecture/overview.md\` layers section
|
|
2182
2182
|
|
|
2183
2183
|
#### 6. Cross-Cutting Concerns
|
|
@@ -2186,21 +2186,21 @@ Document implementation patterns for:
|
|
|
2186
2186
|
- Logging & observability
|
|
2187
2187
|
- Validation patterns
|
|
2188
2188
|
- Configuration management
|
|
2189
|
-
- **Tools**: \`analyze({ aspect: "patterns", ... })\` + \`search({ query: "error handling" })\`
|
|
2189
|
+
- **Tools**: \`analyze({ items: [{aspect: "patterns", ...}] })\` + \`search({ query: "error handling" })\`
|
|
2190
2190
|
- **Output**: \`docs/architecture/overview.md\` cross-cutting section
|
|
2191
2191
|
|
|
2192
2192
|
#### 7. Testing Architecture
|
|
2193
2193
|
- Test framework and strategy
|
|
2194
2194
|
- Test boundary patterns (unit, integration, e2e)
|
|
2195
2195
|
- Test file conventions
|
|
2196
|
-
- **Tools**: \`analyze({ aspect: "patterns", ... })\` + \`search({ query: "test" })\`
|
|
2196
|
+
- **Tools**: \`analyze({ items: [{aspect: "patterns", ...}] })\` + \`search({ query: "test" })\`
|
|
2197
2197
|
- **Output**: \`docs/guides/testing.md\`
|
|
2198
2198
|
|
|
2199
2199
|
#### 8. Extension & Evolution
|
|
2200
2200
|
- How to add features while preserving architecture
|
|
2201
2201
|
- Component creation patterns
|
|
2202
2202
|
- Integration patterns for external systems
|
|
2203
|
-
- **Tools**: \`analyze({ aspect: "entry_points", ... })\` + \`analyze({ aspect: "patterns", ... })\`
|
|
2203
|
+
- **Tools**: \`analyze({ items: [{aspect: "entry_points", ...}] })\` + \`analyze({ items: [{aspect: "patterns", ...}] })\`
|
|
2204
2204
|
- **Output**: \`docs/guides/contributing.md\` or \`docs/architecture/overview.md\` extension section
|
|
2205
2205
|
|
|
2206
2206
|
## Skill Integration
|
|
@@ -2337,10 +2337,10 @@ For source-only work, start from analysis output:
|
|
|
2337
2337
|
|
|
2338
2338
|
\`\`\`
|
|
2339
2339
|
produce_knowledge({ scope: "." })
|
|
2340
|
-
analyze({ aspect: "structure", path: "." })
|
|
2341
|
-
analyze({ aspect: "dependencies", path: "." })
|
|
2342
|
-
analyze({ aspect: "entry_points", path: "." })
|
|
2343
|
-
analyze({ aspect: "patterns", path: "." })
|
|
2340
|
+
analyze({ items: [{aspect: "structure", path: "."}] })
|
|
2341
|
+
analyze({ items: [{aspect: "dependencies", path: "."}] })
|
|
2342
|
+
analyze({ items: [{aspect: "entry_points", path: "."}] })
|
|
2343
|
+
analyze({ items: [{aspect: "patterns", path: "."}] })
|
|
2344
2344
|
\`\`\`
|
|
2345
2345
|
|
|
2346
2346
|
### 2. Classify the Doc Before Writing
|
|
@@ -2400,10 +2400,10 @@ If nothing durable changed, say so explicitly: "No documentation updates needed.
|
|
|
2400
2400
|
| Need | Start with |
|
|
2401
2401
|
|---|---|
|
|
2402
2402
|
| Project overview | \`produce_knowledge({ scope: "." })\` |
|
|
2403
|
-
| Structure or layers | \`analyze({ aspect: "structure", path: "." })\` |
|
|
2404
|
-
| Dependency or boundary map | \`analyze({ aspect: "dependencies", path: "." })\` or \`graph(...)\` |
|
|
2405
|
-
| Public surface | \`analyze({ aspect: "entry_points", path: "." })\` and \`analyze({ aspect: "symbols", path: ... })\` |
|
|
2406
|
-
| Conventions and test patterns | \`analyze({ aspect: "patterns", path: "." })\` |
|
|
2403
|
+
| Structure or layers | \`analyze({ items: [{aspect: "structure", path: "."}] })\` |
|
|
2404
|
+
| Dependency or boundary map | \`analyze({ items: [{aspect: "dependencies", path: "."}] })\` or \`graph(...)\` |
|
|
2405
|
+
| Public surface | \`analyze({ items: [{aspect: "entry_points", path: "."}] })\` and \`analyze({ items: [{aspect: "symbols", path: ...}] })\` |
|
|
2406
|
+
| Conventions and test patterns | \`analyze({ items: [{aspect: "patterns", path: "."}] })\` |
|
|
2407
2407
|
| Update scope | \`git_context({})\` + \`blast_radius({ changed_files: [...] })\` |
|
|
2408
2408
|
|
|
2409
2409
|
Never start by free-writing a big markdown page from memory.
|