@atlashub/smartstack-cli 1.33.0 → 1.35.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.
- package/.documentation/installation.html +60 -38
- package/dist/index.js +1098 -582
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/docs-context-reader.md +125 -0
- package/templates/agents/docs-sync-checker.md +122 -0
- package/templates/hooks/docs-drift-check.md +97 -0
- package/templates/skills/_resources/context-digest-template.md +53 -0
- package/templates/skills/_resources/doc-context-cache.md +62 -0
- package/templates/skills/_resources/docs-manifest-schema.md +157 -0
- package/templates/skills/_resources/mcp-validate-documentation-spec.md +183 -0
- package/templates/skills/_shared.md +8 -0
- package/templates/skills/apex/SKILL.md +6 -0
- package/templates/skills/apex/steps/step-00-init.md +9 -0
- package/templates/skills/apex/steps/step-01-analyze.md +36 -0
- package/templates/skills/apex/steps/step-02-plan.md +38 -0
- package/templates/skills/apex/steps/step-03-execute.md +39 -0
- package/templates/skills/apex/steps/step-04-validate.md +31 -1
- package/templates/skills/apex/steps/step-04b-doc-sync.md +162 -0
- package/templates/skills/apex/steps/step-05-examine.md +7 -0
- package/templates/skills/apex/templates/04b-doc-sync.md +31 -0
- package/templates/skills/apex/templates/context-digest.md +35 -0
- package/templates/skills/business-analyse/SKILL.md +18 -5
- package/templates/skills/business-analyse/_shared.md +306 -4
- package/templates/skills/business-analyse/questionnaire/01-context.md +21 -6
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +34 -0
- package/templates/skills/business-analyse/questionnaire/03-scope.md +23 -0
- package/templates/skills/business-analyse/questionnaire/04-data.md +44 -0
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +29 -7
- package/templates/skills/business-analyse/questionnaire/06-security.md +28 -0
- package/templates/skills/business-analyse/questionnaire/07-ui.md +32 -7
- package/templates/skills/business-analyse/questionnaire/08-performance.md +21 -0
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +29 -6
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +27 -6
- package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +59 -0
- package/templates/skills/business-analyse/questionnaire/12-migration.md +58 -0
- package/templates/skills/business-analyse/questionnaire/13-cross-module.md +69 -0
- package/templates/skills/business-analyse/steps/step-00-init.md +110 -16
- package/templates/skills/business-analyse/steps/step-01-discover.md +530 -85
- package/templates/skills/business-analyse/steps/step-02-analyse.md +81 -25
- package/templates/skills/business-analyse/steps/step-03-specify.md +116 -24
- package/templates/skills/business-analyse/steps/step-04-validate.md +107 -33
- package/templates/skills/business-analyse/steps/step-05-handoff.md +256 -33
- package/templates/skills/business-analyse/steps/step-06-doc-html.md +84 -25
- package/templates/skills/business-analyse/templates/{frd-handoff.md → tpl-handoff.md} +18 -4
- package/templates/skills/business-analyse/templates-frd.md +19 -5
- package/templates/skills/business-analyse/tracking/change-template.md +30 -0
- package/templates/skills/documentation/SKILL.md +68 -31
- package/templates/skills/documentation/data-schema.md +198 -0
- package/templates/skills/documentation/templates.md +30 -1
- package/templates/skills/gitflow/steps/step-init.md +268 -20
- package/templates/skills/gitflow/templates/config.json +7 -0
- package/templates/skills/ralph-loop/SKILL.md +3 -0
- /package/templates/skills/business-analyse/templates/{frd-brd.md → tpl-brd.md} +0 -0
- /package/templates/skills/business-analyse/templates/{frd-discovery.md → tpl-discovery.md} +0 -0
- /package/templates/skills/business-analyse/templates/{frd-spec.md → tpl-frd.md} +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-context-reader
|
|
3
|
+
description: Reads project documentation (.business-analyse/, web docs, docs-manifest.json) and produces a structured summary for context injection into skills and agents
|
|
4
|
+
color: green
|
|
5
|
+
tools: Read, Glob, Grep
|
|
6
|
+
model: haiku
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a documentation context specialist. Your mission is to read existing project documentation and produce a compact, structured summary that other agents and skills can consume for context injection.
|
|
10
|
+
|
|
11
|
+
## Search Strategy
|
|
12
|
+
|
|
13
|
+
### 1. Read Documentation Manifest
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Read: docs-manifest.json (project root)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If the manifest exists, use it as the primary source of truth for module discovery and status.
|
|
20
|
+
|
|
21
|
+
If absent, fall back to directory scanning.
|
|
22
|
+
|
|
23
|
+
### 2. Scan Documentation Sources
|
|
24
|
+
|
|
25
|
+
**Business Analysis outputs:**
|
|
26
|
+
```
|
|
27
|
+
Glob: .business-analyse/business/**/features/FEAT-*
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For each feature found, read:
|
|
31
|
+
- `00-context.md` (state variables, progress)
|
|
32
|
+
- `3-functional-specification.md` (use cases, requirements, permissions)
|
|
33
|
+
- `validation.json` (approval status)
|
|
34
|
+
|
|
35
|
+
**Web documentation pages:**
|
|
36
|
+
```
|
|
37
|
+
Glob: web/smartstack-web/src/pages/docs/business/**/*frd-data.ts
|
|
38
|
+
Glob: web/smartstack-web/src/pages/docs/**/*DocPage.tsx
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**i18n documentation:**
|
|
42
|
+
```
|
|
43
|
+
Glob: web/smartstack-web/src/i18n/locales/fr/docs-*.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Extract Structured Data
|
|
47
|
+
|
|
48
|
+
For each module found, extract:
|
|
49
|
+
- Module path (e.g., `business/support/sla`)
|
|
50
|
+
- Feature ID (FEAT-NNN)
|
|
51
|
+
- Use Case IDs (UC-001, UC-002...)
|
|
52
|
+
- Business Rule IDs (BR-001, BR-002...)
|
|
53
|
+
- Permission paths (business.app.module.action)
|
|
54
|
+
- Last update dates
|
|
55
|
+
- Validation status (APPROVED/REJECTED/PENDING)
|
|
56
|
+
- Documentation completeness (which of the 8 sections exist)
|
|
57
|
+
|
|
58
|
+
## Output Format
|
|
59
|
+
|
|
60
|
+
**CRITICAL**: Output all findings directly in your response. NEVER create markdown files.
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
# Documentation Context Summary
|
|
64
|
+
|
|
65
|
+
**Manifest:** {found|missing}
|
|
66
|
+
**Modules found:** {count}
|
|
67
|
+
**Last scan:** {timestamp}
|
|
68
|
+
|
|
69
|
+
## Module: {business/app/module}
|
|
70
|
+
|
|
71
|
+
| Attribute | Value |
|
|
72
|
+
|-----------|-------|
|
|
73
|
+
| Feature ID | FEAT-NNN |
|
|
74
|
+
| Status | synced / drift / missing |
|
|
75
|
+
| Last code change | {date} |
|
|
76
|
+
| Last doc update | {date} |
|
|
77
|
+
| Validation | APPROVED / PENDING |
|
|
78
|
+
|
|
79
|
+
### Use Cases
|
|
80
|
+
- UC-001: {name} ({actor}, {permission})
|
|
81
|
+
- UC-002: {name} ({actor}, {permission})
|
|
82
|
+
|
|
83
|
+
### Business Rules
|
|
84
|
+
- BR-001: {name} ({category})
|
|
85
|
+
- BR-002: {name} ({category})
|
|
86
|
+
|
|
87
|
+
### Permissions
|
|
88
|
+
- business.{app}.{module}.read → [roles]
|
|
89
|
+
- business.{app}.{module}.create → [roles]
|
|
90
|
+
|
|
91
|
+
### Documentation Sections (8 business-first)
|
|
92
|
+
- [x] Valeur Métier
|
|
93
|
+
- [x] Cas d'usage
|
|
94
|
+
- [x] Bénéfices concrets
|
|
95
|
+
- [ ] Avant/Après (missing)
|
|
96
|
+
- [x] Fonctionnalités
|
|
97
|
+
- [x] Comment ça marche
|
|
98
|
+
- [ ] FAQ Métier (missing)
|
|
99
|
+
- [x] Référence technique
|
|
100
|
+
|
|
101
|
+
### Screenshots
|
|
102
|
+
- step1: /assets/docs/{module}/step-1.png (exists|missing)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Execution Rules
|
|
106
|
+
|
|
107
|
+
- **NEVER create files** - output everything directly
|
|
108
|
+
- **Compact over verbose** - max 200 lines total output
|
|
109
|
+
- **Structured data** - every section must be parseable
|
|
110
|
+
- **Skip empty modules** - only report modules with actual documentation
|
|
111
|
+
- **Report drift** - explicitly flag modules where code > doc timestamp
|
|
112
|
+
- **Parallel reads** when scanning multiple modules
|
|
113
|
+
- **Handle missing manifest gracefully** - fall back to directory scan
|
|
114
|
+
|
|
115
|
+
## Module Filter
|
|
116
|
+
|
|
117
|
+
If invoked with a specific module name (e.g., "SLA", "Tickets"):
|
|
118
|
+
- Only report on that module
|
|
119
|
+
- Include full detail (all UC, BR, permissions, sections)
|
|
120
|
+
- Include file paths for each artifact
|
|
121
|
+
|
|
122
|
+
If invoked without filter:
|
|
123
|
+
- Report all modules in summary format
|
|
124
|
+
- Max 20 lines per module
|
|
125
|
+
- Focus on status and completeness
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-sync-checker
|
|
3
|
+
description: Detects documentation drift by comparing code changes (git diff) against docs-manifest.json. Reports modules with stale documentation.
|
|
4
|
+
color: orange
|
|
5
|
+
tools: Read, Bash, Glob, Grep
|
|
6
|
+
model: haiku
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a documentation drift detection specialist. Your mission is to compare code changes against the documentation manifest and report which modules have stale or missing documentation.
|
|
10
|
+
|
|
11
|
+
## Execution Sequence
|
|
12
|
+
|
|
13
|
+
### 1. Read Documentation Manifest
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Read: docs-manifest.json (project root)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If absent:
|
|
20
|
+
- Report "No docs-manifest.json found. Cannot detect drift."
|
|
21
|
+
- Suggest: "Run /business-analyse or /documentation to create the manifest."
|
|
22
|
+
- EXIT
|
|
23
|
+
|
|
24
|
+
### 2. Detect Code Changes
|
|
25
|
+
|
|
26
|
+
**Option A: Compare against manifest timestamps**
|
|
27
|
+
|
|
28
|
+
For each module in manifest, check if code files have been modified:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Get last commit date for each code file
|
|
32
|
+
git log -1 --format="%aI" -- "{codeFile}"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Compare with `module.lastDocUpdate`. If code is newer → drift.
|
|
36
|
+
|
|
37
|
+
**Option B: Compare specific range (if provided)**
|
|
38
|
+
|
|
39
|
+
If a commit range or branch is specified:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Get all changed files since last doc update
|
|
43
|
+
git diff --name-only {gitCommitDoc}..HEAD
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Match changed files against `module.codeFiles`.
|
|
47
|
+
|
|
48
|
+
### 3. Classify Changes
|
|
49
|
+
|
|
50
|
+
For each drifted module, identify the type of changes:
|
|
51
|
+
|
|
52
|
+
| Change Pattern | Impact |
|
|
53
|
+
|----------------|--------|
|
|
54
|
+
| `**/Entities/**` modified | Business Rules, Features sections |
|
|
55
|
+
| `**/Controllers/**` modified | API Endpoints, Technical Ref sections |
|
|
56
|
+
| `**/Permissions*` modified | Permissions section |
|
|
57
|
+
| `**/Validators/**` modified | Business Rules section |
|
|
58
|
+
| `**/i18n/**` modified | Use Cases (labels), FAQ sections |
|
|
59
|
+
| `**/Migrations/**` created | Technical Ref (schema) section |
|
|
60
|
+
|
|
61
|
+
### 4. Generate Drift Report
|
|
62
|
+
|
|
63
|
+
## Output Format
|
|
64
|
+
|
|
65
|
+
**CRITICAL**: Output all findings directly in your response. NEVER create markdown files.
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
# Documentation Drift Report
|
|
69
|
+
|
|
70
|
+
**Scan date:** {timestamp}
|
|
71
|
+
**Manifest version:** {version}
|
|
72
|
+
**Modules scanned:** {count}
|
|
73
|
+
**Modules in drift:** {count}
|
|
74
|
+
**Modules missing docs:** {count}
|
|
75
|
+
|
|
76
|
+
## Drift Summary
|
|
77
|
+
|
|
78
|
+
| Module | Status | Days Since Doc Update | Changed Files | Impacted Sections |
|
|
79
|
+
|--------|--------|----------------------|---------------|-------------------|
|
|
80
|
+
| business/support/sla | DRIFT | 15 days | 3 files | API, Permissions |
|
|
81
|
+
| business/support/tickets | MISSING | - | - | All |
|
|
82
|
+
| business/hr/employees | SYNCED | 0 days | 0 files | - |
|
|
83
|
+
|
|
84
|
+
## Detailed Drift: business/support/sla
|
|
85
|
+
|
|
86
|
+
**Last code change:** 2026-01-28 (commit: a1b2c3d)
|
|
87
|
+
**Last doc update:** 2026-01-13 (commit: e4f5g6h)
|
|
88
|
+
**Drift days:** 15
|
|
89
|
+
|
|
90
|
+
### Changed Files
|
|
91
|
+
- `src/.../SlaController.cs` → API Endpoints section
|
|
92
|
+
- `src/.../Sla.cs` → Business Rules, Features sections
|
|
93
|
+
- `src/.../CreateSlaCommand.cs` → Use Cases section
|
|
94
|
+
|
|
95
|
+
### Recommended Action
|
|
96
|
+
Run `/apex -d` to sync documentation, or `/documentation:update business/support/sla`
|
|
97
|
+
|
|
98
|
+
## Actions Required
|
|
99
|
+
|
|
100
|
+
1. **DRIFT modules ({count}):** Run `/apex -d` or `/documentation` to update
|
|
101
|
+
2. **MISSING modules ({count}):** Run `/business-analyse` to create documentation
|
|
102
|
+
3. **SYNCED modules ({count}):** No action needed
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Execution Rules
|
|
106
|
+
|
|
107
|
+
- **NEVER create files** - output everything directly
|
|
108
|
+
- **Non-blocking** - always report, never fail
|
|
109
|
+
- **Handle missing manifest** - report clearly and suggest creation
|
|
110
|
+
- **Handle git errors** - if git commands fail, report the error and continue
|
|
111
|
+
- **Compact format** - max 100 lines total output
|
|
112
|
+
- **Actionable** - every drift must have a recommended action
|
|
113
|
+
- **Skip synced details** - only expand drift/missing modules
|
|
114
|
+
|
|
115
|
+
## Severity Classification
|
|
116
|
+
|
|
117
|
+
| Drift Days | Severity | Icon |
|
|
118
|
+
|------------|----------|------|
|
|
119
|
+
| 0-7 | Low | Minor drift, not urgent |
|
|
120
|
+
| 8-30 | Medium | Should update soon |
|
|
121
|
+
| 31+ | High | Critical drift, update immediately |
|
|
122
|
+
| Missing | Critical | No documentation exists |
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Documentation drift warning on commit (non-blocking)
|
|
3
|
+
trigger: tool-use
|
|
4
|
+
match: git commit*
|
|
5
|
+
blocking: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Documentation Drift Check (Low Token)
|
|
9
|
+
|
|
10
|
+
Lightweight pre-commit check that warns about documentation drift. Reads manifest only, non-blocking.
|
|
11
|
+
|
|
12
|
+
## Script
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
#!/bin/bash
|
|
16
|
+
MANIFEST="docs-manifest.json"
|
|
17
|
+
|
|
18
|
+
# Skip if no manifest exists
|
|
19
|
+
if [ ! -f "$MANIFEST" ]; then
|
|
20
|
+
exit 0
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Check if jq is available
|
|
24
|
+
if ! command -v jq &> /dev/null; then
|
|
25
|
+
exit 0
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# Get staged files
|
|
29
|
+
STAGED_FILES=$(git diff --cached --name-only 2>/dev/null)
|
|
30
|
+
if [ -z "$STAGED_FILES" ]; then
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Check each module in manifest for drift
|
|
35
|
+
DRIFT_FOUND=false
|
|
36
|
+
DRIFT_MODULES=""
|
|
37
|
+
|
|
38
|
+
for MODULE_PATH in $(jq -r '.modules | keys[]' "$MANIFEST" 2>/dev/null); do
|
|
39
|
+
# Get code files for this module
|
|
40
|
+
CODE_FILES=$(jq -r ".modules[\"$MODULE_PATH\"].codeFiles[]?" "$MANIFEST" 2>/dev/null)
|
|
41
|
+
|
|
42
|
+
for CODE_FILE in $CODE_FILES; do
|
|
43
|
+
# Check if any staged file matches a module's code files
|
|
44
|
+
if echo "$STAGED_FILES" | grep -q "$CODE_FILE"; then
|
|
45
|
+
STATUS=$(jq -r ".modules[\"$MODULE_PATH\"].status" "$MANIFEST" 2>/dev/null)
|
|
46
|
+
LAST_DOC=$(jq -r ".modules[\"$MODULE_PATH\"].lastDocUpdate" "$MANIFEST" 2>/dev/null)
|
|
47
|
+
FEATURE_ID=$(jq -r ".modules[\"$MODULE_PATH\"].featureId" "$MANIFEST" 2>/dev/null)
|
|
48
|
+
|
|
49
|
+
if [ "$STATUS" != "synced" ] || [ "$LAST_DOC" = "null" ]; then
|
|
50
|
+
DRIFT_FOUND=true
|
|
51
|
+
DRIFT_MODULES="$DRIFT_MODULES\n - $MODULE_PATH ($FEATURE_ID) — last doc update: ${LAST_DOC:-never}"
|
|
52
|
+
fi
|
|
53
|
+
break
|
|
54
|
+
fi
|
|
55
|
+
done
|
|
56
|
+
done
|
|
57
|
+
|
|
58
|
+
if [ "$DRIFT_FOUND" = true ]; then
|
|
59
|
+
echo ""
|
|
60
|
+
echo "Documentation drift detected:"
|
|
61
|
+
echo -e "$DRIFT_MODULES"
|
|
62
|
+
echo ""
|
|
63
|
+
echo "Consider running /apex -d or /documentation to update."
|
|
64
|
+
echo ""
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
exit 0
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Behavior
|
|
71
|
+
|
|
72
|
+
| Condition | Output | Blocks? |
|
|
73
|
+
|-----------|--------|---------|
|
|
74
|
+
| No manifest file | Silent | No |
|
|
75
|
+
| No jq available | Silent | No |
|
|
76
|
+
| No staged files | Silent | No |
|
|
77
|
+
| Staged files match synced modules | Silent | No |
|
|
78
|
+
| Staged files match drifted modules | Warning with module list | No |
|
|
79
|
+
|
|
80
|
+
## Token Cost
|
|
81
|
+
|
|
82
|
+
- **Normal case (no drift):** 0 tokens (pure bash, no LLM)
|
|
83
|
+
- **Drift detected:** ~10 tokens (displays warning message)
|
|
84
|
+
|
|
85
|
+
## Integration
|
|
86
|
+
|
|
87
|
+
This hook integrates with:
|
|
88
|
+
- `docs-manifest.json` (created by BA step-06 and APEX step-04b)
|
|
89
|
+
- `/apex -d` flag for automatic documentation sync
|
|
90
|
+
- `/documentation` skill for manual documentation updates
|
|
91
|
+
|
|
92
|
+
## Notes
|
|
93
|
+
|
|
94
|
+
- **Non-blocking by design:** Documentation drift should never prevent commits
|
|
95
|
+
- The warning suggests running `/apex -d` (documentation sync) or `/documentation` (manual update)
|
|
96
|
+
- If `jq` is not installed, the hook silently exits (graceful degradation)
|
|
97
|
+
- Cross-platform: Works on Linux, macOS, and Windows (Git Bash/WSL)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Context Digest Pattern
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Reduces token usage between multi-step skill executions (APEX, BA) by compressing step outputs into compact summaries.
|
|
6
|
+
|
|
7
|
+
## How It Works
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Step N completes
|
|
11
|
+
↓
|
|
12
|
+
Generate digest (max 50 lines)
|
|
13
|
+
↓
|
|
14
|
+
Pass digest to Step N+1 (in-context)
|
|
15
|
+
↓
|
|
16
|
+
Step N+1 reads:
|
|
17
|
+
- Digest from previous step (compact)
|
|
18
|
+
- 00-context.md for state variables
|
|
19
|
+
- Full output files ONLY if digest indicates need
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Digest Sections
|
|
23
|
+
|
|
24
|
+
| Section | Max Lines | Content |
|
|
25
|
+
|---------|-----------|---------|
|
|
26
|
+
| Changes | 10 | Files modified with brief description |
|
|
27
|
+
| Decisions | 10 | Key architectural decisions |
|
|
28
|
+
| Findings | 10 | Issues found, patterns identified |
|
|
29
|
+
| State | 5 | Updated state variables |
|
|
30
|
+
| Blockers | 5 | Open issues, unresolved questions |
|
|
31
|
+
| Next | 5 | What the next step needs to know |
|
|
32
|
+
|
|
33
|
+
## Token Savings Estimate
|
|
34
|
+
|
|
35
|
+
| Scenario | Without Digest | With Digest | Savings |
|
|
36
|
+
|----------|---------------|-------------|---------|
|
|
37
|
+
| step-01 → step-02 | ~2000 tokens | ~500 tokens | 75% |
|
|
38
|
+
| step-02 → step-03 | ~1500 tokens | ~400 tokens | 73% |
|
|
39
|
+
| step-03 → step-04 | ~1800 tokens | ~450 tokens | 75% |
|
|
40
|
+
| **Total workflow** | ~5300 tokens | ~1350 tokens | **~75%** |
|
|
41
|
+
|
|
42
|
+
## Applies To
|
|
43
|
+
|
|
44
|
+
- APEX skill (all step transitions)
|
|
45
|
+
- BA skill (between phases)
|
|
46
|
+
- Any future multi-step skill
|
|
47
|
+
|
|
48
|
+
## Resume Exception
|
|
49
|
+
|
|
50
|
+
When a skill resumes via `-r` flag:
|
|
51
|
+
- Digest is ephemeral (not saved to disk)
|
|
52
|
+
- Resume reads full output files from `.claude/output/` or `.business-analyse/`
|
|
53
|
+
- This ensures complete state restoration after session break
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Documentation Context Cache
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Caches the output of `docs-context-reader` agent to avoid redundant documentation scans.
|
|
6
|
+
|
|
7
|
+
## Location
|
|
8
|
+
|
|
9
|
+
`.claude/cache/docs-context.json`
|
|
10
|
+
|
|
11
|
+
## Schema
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"generatedAt": "ISO-date",
|
|
16
|
+
"commitHash": "git-sha",
|
|
17
|
+
"ttl": 86400,
|
|
18
|
+
"summary": {
|
|
19
|
+
"totalModules": 5,
|
|
20
|
+
"documented": 3,
|
|
21
|
+
"synced": 2,
|
|
22
|
+
"drift": 1,
|
|
23
|
+
"missing": 2
|
|
24
|
+
},
|
|
25
|
+
"modules": {
|
|
26
|
+
"business/support/sla": {
|
|
27
|
+
"featureId": "FEAT-003",
|
|
28
|
+
"status": "synced",
|
|
29
|
+
"useCaseCount": 4,
|
|
30
|
+
"ruleCount": 6,
|
|
31
|
+
"permissionCount": 5,
|
|
32
|
+
"sections": ["overview", "useCases", "benefits", "features", "steps", "technicalRef"],
|
|
33
|
+
"missingSections": ["beforeAfter", "faq"]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## TTL (Time To Live)
|
|
40
|
+
|
|
41
|
+
| Condition | Cache Valid |
|
|
42
|
+
|-----------|------------|
|
|
43
|
+
| Same git commit hash | Yes |
|
|
44
|
+
| Different git commit hash | No (invalidate) |
|
|
45
|
+
| > 24 hours old | No (invalidate) |
|
|
46
|
+
| docs-manifest.json modified | No (invalidate) |
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
1. **Before launching docs-context-reader agent**: Check cache
|
|
51
|
+
2. **If cache valid**: Use cached summary (0 tokens)
|
|
52
|
+
3. **If cache invalid**: Launch agent, save result to cache
|
|
53
|
+
4. **On commit**: Invalidate cache (commit changes may affect docs)
|
|
54
|
+
|
|
55
|
+
## Integration Points
|
|
56
|
+
|
|
57
|
+
| Consumer | Check Cache? |
|
|
58
|
+
|----------|-------------|
|
|
59
|
+
| APEX step-01 (analyze) | Yes |
|
|
60
|
+
| APEX step-04b (doc-sync) | Yes |
|
|
61
|
+
| BA step-01 (discover) | Yes |
|
|
62
|
+
| docs-sync-checker agent | No (always fresh) |
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Documentation Manifest Schema
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
The `docs-manifest.json` file maps code modules to their documentation artifacts. It is the single source of truth for documentation drift detection.
|
|
6
|
+
|
|
7
|
+
**Location:** Project root (next to `package.json` or `.sln`)
|
|
8
|
+
|
|
9
|
+
## Schema
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"version": "1.0",
|
|
14
|
+
"lastUpdated": "2026-01-30T10:00:00Z",
|
|
15
|
+
"modules": {
|
|
16
|
+
"business/{app}/{module}": {
|
|
17
|
+
"featureId": "FEAT-NNN",
|
|
18
|
+
"displayName": "Module Display Name",
|
|
19
|
+
"codeFiles": [
|
|
20
|
+
"src/SmartStack.Domain/Entities/Business/{Entity}.cs",
|
|
21
|
+
"src/SmartStack.Application/Features/{Module}/Commands/*.cs",
|
|
22
|
+
"src/SmartStack.Application/Features/{Module}/Queries/*.cs",
|
|
23
|
+
"src/SmartStack.Api/Controllers/Business/{Module}Controller.cs"
|
|
24
|
+
],
|
|
25
|
+
"docFiles": [
|
|
26
|
+
"web/smartstack-web/src/pages/docs/business/{app}/{module}/frd-data.ts",
|
|
27
|
+
"web/smartstack-web/src/i18n/locales/fr/docs-{app}-{module}.json"
|
|
28
|
+
],
|
|
29
|
+
"baOutputs": [
|
|
30
|
+
".business-analyse/business/{app}/modules/{module}/features/FEAT-NNN/"
|
|
31
|
+
],
|
|
32
|
+
"screenshots": {
|
|
33
|
+
"step1": "/assets/docs/{module}/step-1.png",
|
|
34
|
+
"step2": "/assets/docs/{module}/step-2.png"
|
|
35
|
+
},
|
|
36
|
+
"lastCodeChange": "2026-01-30T10:00:00Z",
|
|
37
|
+
"lastDocUpdate": "2026-01-30T10:00:00Z",
|
|
38
|
+
"gitCommitCode": "abc123",
|
|
39
|
+
"gitCommitDoc": "def456",
|
|
40
|
+
"status": "synced"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Fields
|
|
47
|
+
|
|
48
|
+
| Field | Type | Required | Description |
|
|
49
|
+
|-------|------|----------|-------------|
|
|
50
|
+
| `version` | string | Yes | Schema version (always "1.0") |
|
|
51
|
+
| `lastUpdated` | ISO date | Yes | Last time manifest was modified |
|
|
52
|
+
| `modules` | object | Yes | Map of module path → module entry |
|
|
53
|
+
|
|
54
|
+
### Module Entry
|
|
55
|
+
|
|
56
|
+
| Field | Type | Required | Description |
|
|
57
|
+
|-------|------|----------|-------------|
|
|
58
|
+
| `featureId` | string | Yes | BA feature ID (FEAT-NNN) |
|
|
59
|
+
| `displayName` | string | Yes | Human-readable module name |
|
|
60
|
+
| `codeFiles` | string[] | Yes | Source code files for this module |
|
|
61
|
+
| `docFiles` | string[] | Yes | Documentation files (frd-data.ts, i18n) |
|
|
62
|
+
| `baOutputs` | string[] | No | Business Analysis output directory |
|
|
63
|
+
| `screenshots` | object | No | Map of stepKey → image path |
|
|
64
|
+
| `lastCodeChange` | ISO date | Yes | Last code modification timestamp |
|
|
65
|
+
| `lastDocUpdate` | ISO date | Yes | Last documentation update timestamp |
|
|
66
|
+
| `gitCommitCode` | string | Yes | Git SHA of last code commit |
|
|
67
|
+
| `gitCommitDoc` | string | Yes | Git SHA of last doc commit |
|
|
68
|
+
| `status` | enum | Yes | `synced`, `drift`, or `missing` |
|
|
69
|
+
|
|
70
|
+
## Status Values
|
|
71
|
+
|
|
72
|
+
| Status | Meaning | Action |
|
|
73
|
+
|--------|---------|--------|
|
|
74
|
+
| `synced` | Documentation matches code | No action needed |
|
|
75
|
+
| `drift` | Code changed after last doc update | Run `/apex -d` or `/documentation` to update |
|
|
76
|
+
| `missing` | Module exists in code but has no documentation | Run `/business-analyse` or `/documentation` to create |
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
### Created by
|
|
81
|
+
- BA skill step-06 (doc-html) after generating documentation
|
|
82
|
+
- Documentation skill after creating/updating a module page
|
|
83
|
+
|
|
84
|
+
### Read by
|
|
85
|
+
- `docs-context-reader` agent (for context injection)
|
|
86
|
+
- `docs-sync-checker` agent (for drift detection)
|
|
87
|
+
- APEX step-04b (doc-sync) to identify affected modules
|
|
88
|
+
- BA step-04 (validate) for freshness check
|
|
89
|
+
- Drift hook (pre-commit) for commit warnings
|
|
90
|
+
|
|
91
|
+
### Updated by
|
|
92
|
+
- BA step-06 (on doc generation)
|
|
93
|
+
- APEX step-04b (on doc sync)
|
|
94
|
+
- Documentation skill (on doc update)
|
|
95
|
+
|
|
96
|
+
## Drift Detection Logic
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
IF module.lastCodeChange > module.lastDocUpdate:
|
|
100
|
+
module.status = "drift"
|
|
101
|
+
ELSE:
|
|
102
|
+
module.status = "synced"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Example
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"version": "1.0",
|
|
110
|
+
"lastUpdated": "2026-01-30T14:30:00Z",
|
|
111
|
+
"modules": {
|
|
112
|
+
"business/support/sla": {
|
|
113
|
+
"featureId": "FEAT-003",
|
|
114
|
+
"displayName": "SLA Management",
|
|
115
|
+
"codeFiles": [
|
|
116
|
+
"src/SmartStack.Domain/Entities/Business/Sla.cs",
|
|
117
|
+
"src/SmartStack.Application/Features/Sla/Commands/CreateSlaCommand.cs",
|
|
118
|
+
"src/SmartStack.Application/Features/Sla/Queries/GetSlaListQuery.cs",
|
|
119
|
+
"src/SmartStack.Api/Controllers/Business/SlaController.cs"
|
|
120
|
+
],
|
|
121
|
+
"docFiles": [
|
|
122
|
+
"web/smartstack-web/src/pages/docs/business/support/sla/frd-data.ts",
|
|
123
|
+
"web/smartstack-web/src/i18n/locales/fr/docs-support-sla.json"
|
|
124
|
+
],
|
|
125
|
+
"baOutputs": [
|
|
126
|
+
".business-analyse/business/Support/modules/Sla/features/FEAT-003/"
|
|
127
|
+
],
|
|
128
|
+
"screenshots": {
|
|
129
|
+
"step1": "/assets/docs/sla/step-1.png",
|
|
130
|
+
"step2": "/assets/docs/sla/step-2.png",
|
|
131
|
+
"step3": "/assets/docs/sla/step-3.png"
|
|
132
|
+
},
|
|
133
|
+
"lastCodeChange": "2026-01-28T16:00:00Z",
|
|
134
|
+
"lastDocUpdate": "2026-01-30T14:30:00Z",
|
|
135
|
+
"gitCommitCode": "a1b2c3d",
|
|
136
|
+
"gitCommitDoc": "e4f5g6h",
|
|
137
|
+
"status": "synced"
|
|
138
|
+
},
|
|
139
|
+
"business/support/tickets": {
|
|
140
|
+
"featureId": "FEAT-005",
|
|
141
|
+
"displayName": "Ticket Management",
|
|
142
|
+
"codeFiles": [
|
|
143
|
+
"src/SmartStack.Domain/Entities/Business/Ticket.cs",
|
|
144
|
+
"src/SmartStack.Api/Controllers/Business/TicketsController.cs"
|
|
145
|
+
],
|
|
146
|
+
"docFiles": [],
|
|
147
|
+
"baOutputs": [],
|
|
148
|
+
"screenshots": {},
|
|
149
|
+
"lastCodeChange": "2026-01-29T10:00:00Z",
|
|
150
|
+
"lastDocUpdate": "1970-01-01T00:00:00Z",
|
|
151
|
+
"gitCommitCode": "x7y8z9a",
|
|
152
|
+
"gitCommitDoc": "",
|
|
153
|
+
"status": "missing"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|