create-universal-ai-context 2.5.0 → 2.6.0-final
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/LICENSE +21 -21
- package/README.md +331 -294
- package/bin/create-ai-context.js +1507 -775
- package/lib/adapters/aider.js +131 -131
- package/lib/adapters/antigravity.js +205 -205
- package/lib/adapters/claude.js +397 -397
- package/lib/adapters/cline.js +125 -125
- package/lib/adapters/continue.js +138 -138
- package/lib/adapters/copilot.js +131 -131
- package/lib/adapters/index.js +78 -78
- package/lib/adapters/windsurf.js +138 -138
- package/lib/ai-context-generator.js +234 -234
- package/lib/ai-orchestrator.js +432 -432
- package/lib/call-tracer.js +444 -444
- package/lib/content-preservation.js +243 -243
- package/lib/cross-tool-sync/file-watcher.js +274 -274
- package/lib/cross-tool-sync/index.js +41 -40
- package/lib/cross-tool-sync/sync-manager.js +540 -512
- package/lib/cross-tool-sync/sync-service.js +297 -297
- package/lib/detector.js +726 -726
- package/lib/doc-discovery.js +741 -741
- package/lib/drift-checker.js +920 -920
- package/lib/environment-detector.js +239 -239
- package/lib/index.js +399 -399
- package/lib/install-hooks.js +82 -82
- package/lib/installer.js +419 -419
- package/lib/migrate.js +328 -328
- package/lib/placeholder.js +632 -632
- package/lib/prompts.js +341 -341
- package/lib/smart-merge.js +540 -540
- package/lib/spinner.js +60 -60
- package/lib/static-analyzer.js +729 -729
- package/lib/template-coordination.js +148 -148
- package/lib/template-populator.js +843 -843
- package/lib/template-renderer.js +392 -392
- package/lib/utils/fs-wrapper.js +79 -79
- package/lib/utils/path-utils.js +60 -60
- package/lib/validate.js +155 -155
- package/package.json +1 -1
- package/templates/AI_CONTEXT.md.template +245 -245
- package/templates/base/README.md +260 -257
- package/templates/base/RPI_WORKFLOW_PLAN.md +325 -320
- package/templates/base/agents/api-developer.md +76 -76
- package/templates/base/agents/context-engineer.md +525 -525
- package/templates/base/agents/core-architect.md +76 -76
- package/templates/base/agents/database-ops.md +76 -76
- package/templates/base/agents/deployment-ops.md +76 -76
- package/templates/base/agents/integration-hub.md +76 -76
- package/templates/base/analytics/README.md +114 -114
- package/templates/base/automation/config.json +58 -58
- package/templates/base/automation/generators/code-mapper.js +308 -308
- package/templates/base/automation/generators/index-builder.js +321 -321
- package/templates/base/automation/hooks/post-commit.sh +83 -83
- package/templates/base/automation/hooks/pre-commit.sh +103 -103
- package/templates/base/ci-templates/README.md +108 -108
- package/templates/base/ci-templates/github-actions/context-check.yml +144 -144
- package/templates/base/ci-templates/github-actions/validate-docs.yml +105 -105
- package/templates/base/commands/analytics.md +238 -238
- package/templates/base/commands/auto-sync.md +172 -172
- package/templates/base/commands/collab.md +194 -194
- package/templates/base/commands/context-optimize.md +226 -0
- package/templates/base/commands/help.md +485 -450
- package/templates/base/commands/rpi-implement.md +164 -115
- package/templates/base/commands/rpi-plan.md +147 -93
- package/templates/base/commands/rpi-research.md +145 -88
- package/templates/base/commands/session-resume.md +144 -144
- package/templates/base/commands/session-save.md +112 -112
- package/templates/base/commands/validate-all.md +77 -77
- package/templates/base/commands/verify-docs-current.md +86 -86
- package/templates/base/config/base.json +57 -57
- package/templates/base/config/environments/development.json +13 -13
- package/templates/base/config/environments/production.json +17 -17
- package/templates/base/config/environments/staging.json +13 -13
- package/templates/base/config/local.json.example +21 -21
- package/templates/base/context/.meta/generated-at.json +18 -18
- package/templates/base/context/ARCHITECTURE_SNAPSHOT.md +156 -156
- package/templates/base/context/CODE_TO_WORKFLOW_MAP.md +94 -94
- package/templates/base/context/FILE_OWNERSHIP.md +57 -57
- package/templates/base/context/INTEGRATION_POINTS.md +92 -92
- package/templates/base/context/KNOWN_GOTCHAS.md +195 -195
- package/templates/base/context/TESTING_MAP.md +95 -95
- package/templates/base/context/WORKFLOW_INDEX.md +129 -129
- package/templates/base/context/workflows/WORKFLOW_TEMPLATE.md +294 -294
- package/templates/base/indexes/agents/CAPABILITY_MATRIX.md +255 -255
- package/templates/base/indexes/agents/CATEGORY_INDEX.md +44 -44
- package/templates/base/indexes/code/CATEGORY_INDEX.md +38 -38
- package/templates/base/indexes/routing/CATEGORY_INDEX.md +39 -39
- package/templates/base/indexes/search/CATEGORY_INDEX.md +39 -39
- package/templates/base/indexes/workflows/CATEGORY_INDEX.md +38 -38
- package/templates/base/knowledge/README.md +98 -98
- package/templates/base/knowledge/sessions/README.md +88 -88
- package/templates/base/knowledge/sessions/TEMPLATE.md +150 -150
- package/templates/base/knowledge/shared/decisions/0001-adopt-context-engineering.md +144 -144
- package/templates/base/knowledge/shared/decisions/README.md +49 -49
- package/templates/base/knowledge/shared/decisions/TEMPLATE.md +123 -123
- package/templates/base/knowledge/shared/patterns/README.md +62 -62
- package/templates/base/knowledge/shared/patterns/TEMPLATE.md +120 -120
- package/templates/base/plans/PLAN_TEMPLATE.md +316 -250
- package/templates/base/research/RESEARCH_TEMPLATE.md +245 -153
- package/templates/base/schemas/agent.schema.json +141 -141
- package/templates/base/schemas/anchors.schema.json +54 -54
- package/templates/base/schemas/automation.schema.json +93 -93
- package/templates/base/schemas/command.schema.json +134 -134
- package/templates/base/schemas/hashes.schema.json +40 -40
- package/templates/base/schemas/manifest.schema.json +117 -117
- package/templates/base/schemas/plan.schema.json +136 -136
- package/templates/base/schemas/research.schema.json +115 -115
- package/templates/base/schemas/roles.schema.json +34 -34
- package/templates/base/schemas/session.schema.json +77 -77
- package/templates/base/schemas/settings.schema.json +244 -244
- package/templates/base/schemas/staleness.schema.json +53 -53
- package/templates/base/schemas/team-config.schema.json +42 -42
- package/templates/base/schemas/workflow.schema.json +126 -126
- package/templates/base/session/checkpoints/.gitkeep +2 -2
- package/templates/base/session/current/state.json +20 -20
- package/templates/base/session/history/.gitkeep +2 -2
- package/templates/base/settings.json +3 -3
- package/templates/base/standards/COMPATIBILITY.md +219 -219
- package/templates/base/standards/EXTENSION_GUIDELINES.md +280 -280
- package/templates/base/standards/QUALITY_CHECKLIST.md +211 -211
- package/templates/base/standards/README.md +66 -66
- package/templates/base/sync/anchors.json +6 -6
- package/templates/base/sync/hashes.json +6 -6
- package/templates/base/sync/staleness.json +10 -10
- package/templates/base/team/README.md +168 -168
- package/templates/base/team/config.json +79 -79
- package/templates/base/team/roles.json +145 -145
- package/templates/base/tools/bin/claude-context.js +151 -151
- package/templates/base/tools/lib/anchor-resolver.js +276 -276
- package/templates/base/tools/lib/config-loader.js +363 -363
- package/templates/base/tools/lib/detector.js +350 -350
- package/templates/base/tools/lib/diagnose.js +206 -206
- package/templates/base/tools/lib/drift-detector.js +373 -373
- package/templates/base/tools/lib/errors.js +199 -199
- package/templates/base/tools/lib/index.js +36 -36
- package/templates/base/tools/lib/init.js +192 -192
- package/templates/base/tools/lib/logger.js +230 -230
- package/templates/base/tools/lib/placeholder.js +201 -201
- package/templates/base/tools/lib/session-manager.js +354 -354
- package/templates/base/tools/lib/validate.js +521 -521
- package/templates/base/tools/package.json +49 -49
- package/templates/handlebars/aider-config.hbs +146 -80
- package/templates/handlebars/antigravity.hbs +377 -377
- package/templates/handlebars/claude.hbs +183 -183
- package/templates/handlebars/cline.hbs +62 -62
- package/templates/handlebars/continue-config.hbs +116 -116
- package/templates/handlebars/copilot.hbs +130 -130
- package/templates/handlebars/partials/gotcha-list.hbs +11 -11
- package/templates/handlebars/partials/header.hbs +3 -3
- package/templates/handlebars/partials/workflow-summary.hbs +16 -16
- package/templates/handlebars/windsurf-rules.hbs +69 -69
- package/templates/hooks/post-commit.hbs +28 -29
- package/templates/hooks/pre-commit.hbs +46 -46
|
@@ -1,115 +1,164 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: rpi-implement
|
|
3
|
-
version: "
|
|
4
|
-
description: "RPI Implement Phase: Execute
|
|
5
|
-
category: "rpi-orchestration"
|
|
6
|
-
rpi_phase: "implement"
|
|
7
|
-
context_budget_estimate: "60K tokens"
|
|
8
|
-
typical_context_usage: "30%"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- "
|
|
14
|
-
|
|
15
|
-
- "
|
|
16
|
-
- "
|
|
17
|
-
- "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- "
|
|
30
|
-
|
|
31
|
-
- "
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
1
|
+
---
|
|
2
|
+
name: rpi-implement
|
|
3
|
+
version: "2.0.0"
|
|
4
|
+
description: "RPI Implement Phase: Execute chunk-based todolists with atomic changes and continuous testing"
|
|
5
|
+
category: "rpi-orchestration"
|
|
6
|
+
rpi_phase: "implement"
|
|
7
|
+
context_budget_estimate: "60K tokens"
|
|
8
|
+
typical_context_usage: "30%"
|
|
9
|
+
chunk_input: true
|
|
10
|
+
loop_based: true
|
|
11
|
+
inter_phase_aware: true
|
|
12
|
+
prerequisites:
|
|
13
|
+
- "Plan document exists in .ai-context/plans/active/"
|
|
14
|
+
- "Plan has been approved by human"
|
|
15
|
+
- "Plan contains chunk manifest with chunk-todolists"
|
|
16
|
+
- "Git branch is clean"
|
|
17
|
+
- "All tests currently passing"
|
|
18
|
+
outputs:
|
|
19
|
+
- "Implemented feature/fix (chunk by chunk)"
|
|
20
|
+
- "Updated documentation with new line numbers"
|
|
21
|
+
- "Commits with descriptive messages per todo"
|
|
22
|
+
- "All plan chunks marked as IMPLEMENTED"
|
|
23
|
+
- "All research chunks marked as IMPLEMENTED"
|
|
24
|
+
- "Archived plan in .ai-context/plans/completed/"
|
|
25
|
+
- "Archived research in .ai-context/research/completed/"
|
|
26
|
+
next_commands: ["/verify-docs-current", "/validate-all"]
|
|
27
|
+
related_agents: ["core-architect", "database-ops", "api-developer", "deployment-ops"]
|
|
28
|
+
examples:
|
|
29
|
+
- command: "/rpi-implement user-authentication"
|
|
30
|
+
description: "Execute approved authentication plan chunk by chunk"
|
|
31
|
+
- command: "/rpi-implement payment-bug-fix"
|
|
32
|
+
description: "Implement approved bug fix processing each chunk's todolist"
|
|
33
|
+
exit_criteria:
|
|
34
|
+
- "All chunk-todolists completed"
|
|
35
|
+
- "All plan chunks marked as IMPLEMENTED"
|
|
36
|
+
- "All research chunks marked as IMPLEMENTED"
|
|
37
|
+
- "All tests passing"
|
|
38
|
+
- "Documentation updated per chunk"
|
|
39
|
+
- "Changes committed per todo"
|
|
40
|
+
- "Plan archived to completed/"
|
|
41
|
+
- "Research archived to completed/"
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
# RPI Implement Phase (Enhanced with Chunk-Based Execution)
|
|
45
|
+
|
|
46
|
+
**Purpose:** Execute implementation plan chunk by chunk, processing each chunk's todolist atomically
|
|
47
|
+
|
|
48
|
+
**Syntax:** `/rpi-implement [feature-name]`
|
|
49
|
+
|
|
50
|
+
**Prerequisites:** Plan must be approved in `.ai-context/plans/active/` with chunk manifest
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Key Innovation: Inter-Phase Awareness
|
|
55
|
+
|
|
56
|
+
RPI-Implement **KNOWS**:
|
|
57
|
+
- RPI-Plan structured chunks for atomic implementation
|
|
58
|
+
- Each CHUNK-Pn contains a complete, ordered todolist
|
|
59
|
+
- Chunk dependencies dictate execution order
|
|
60
|
+
- Marking chunks complete updates both plan AND research documents
|
|
61
|
+
- Context reset is needed after every 3 chunks or 35% utilization
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Golden Rules
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
ONE CHUNK → COMPLETE TODOLIST → MARK DONE → NEXT CHUNK
|
|
69
|
+
ONE TODO → ONE CHANGE → ONE TEST → ONE COMMIT
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Chunk-Based Implementation Loop
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
┌─────────────────────────────────────────────────────────┐
|
|
78
|
+
│ RPI-IMPLEMENT CHUNK PROCESSING LOOP │
|
|
79
|
+
├─────────────────────────────────────────────────────────┤
|
|
80
|
+
│ FOR each CHUNK-Pn in dependency_order: │
|
|
81
|
+
│ 1. Load CHUNK-Pn todolist │
|
|
82
|
+
│ 2. FOR each TODO in CHUNK-Pn: │
|
|
83
|
+
│ a. Make atomic change │
|
|
84
|
+
│ b. Run specified test │
|
|
85
|
+
│ c. If PASS: commit, mark TODO ✅ │
|
|
86
|
+
│ d. If FAIL: STOP, investigate, fix │
|
|
87
|
+
│ 3. Mark CHUNK-Pn as IMPLEMENTED │
|
|
88
|
+
│ 4. Update research CHUNK-Rn to IMPLEMENTED │
|
|
89
|
+
│ 5. Context reset if needed │
|
|
90
|
+
│ 6. Proceed to next chunk │
|
|
91
|
+
│ END LOOP │
|
|
92
|
+
└─────────────────────────────────────────────────────────┘
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Execution Steps
|
|
98
|
+
|
|
99
|
+
### Step 1: Load Plan
|
|
100
|
+
Read `.ai-context/plans/active/[feature]_plan.md` with chunk manifest
|
|
101
|
+
|
|
102
|
+
### Step 2: Verify Preconditions
|
|
103
|
+
- [ ] Plan is approved
|
|
104
|
+
- [ ] Branch is clean
|
|
105
|
+
- [ ] Tests pass before changes
|
|
106
|
+
- [ ] Chunk manifest is present
|
|
107
|
+
|
|
108
|
+
### Step 3: Execute Each Chunk (in dependency order)
|
|
109
|
+
|
|
110
|
+
For each CHUNK-Pn:
|
|
111
|
+
1. Execute each todo atomically (one change → one test → one commit)
|
|
112
|
+
2. Mark CHUNK-Pn as IMPLEMENTED when all todos complete
|
|
113
|
+
3. Update CHUNK-Rn status in research to IMPLEMENTED
|
|
114
|
+
|
|
115
|
+
### Step 4: Context Reset (Every 3 Chunks or 35% Utilization)
|
|
116
|
+
1. Update progress in plan
|
|
117
|
+
2. Re-read plan document
|
|
118
|
+
3. Verify scope alignment
|
|
119
|
+
4. Compact if >35% context usage
|
|
120
|
+
|
|
121
|
+
### Step 5: Run Full Test Suite
|
|
122
|
+
After all chunks complete
|
|
123
|
+
|
|
124
|
+
### Step 6: Update Documentation (MANDATORY)
|
|
125
|
+
1. Check CODE_TO_WORKFLOW_MAP.md
|
|
126
|
+
2. Update affected workflow files
|
|
127
|
+
3. Update line numbers
|
|
128
|
+
4. Run /verify-docs-current
|
|
129
|
+
|
|
130
|
+
### Step 7: Final Commit
|
|
131
|
+
Documentation updates
|
|
132
|
+
|
|
133
|
+
### Step 8: Archive Documents
|
|
134
|
+
- Move plan to `.ai-context/plans/completed/`
|
|
135
|
+
- Move research to `.ai-context/research/completed/`
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Error Recovery
|
|
140
|
+
|
|
141
|
+
| Error Type | Action |
|
|
142
|
+
|------------|--------|
|
|
143
|
+
| Syntax Error | Fix immediately in same todo |
|
|
144
|
+
| Test Failure | Stop, investigate, fix before proceeding |
|
|
145
|
+
| 3+ Failures in chunk | Mark chunk BLOCKED, try next independent chunk |
|
|
146
|
+
| 3+ Chunks blocked | STOP. Compact context. Start new session. |
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Context Budget
|
|
151
|
+
|
|
152
|
+
- Plan: 15k tokens
|
|
153
|
+
- Active code (per chunk): ~10k tokens
|
|
154
|
+
- Test results (per chunk): ~5k tokens
|
|
155
|
+
- Max active (3 chunks): ~45k tokens (22.5%)
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Output
|
|
160
|
+
|
|
161
|
+
- Completed feature/fix (implemented chunk by chunk)
|
|
162
|
+
- All chunks marked IMPLEMENTED (plan + research)
|
|
163
|
+
- Updated documentation per chunk
|
|
164
|
+
- Documents archived to completed/
|
|
@@ -1,93 +1,147 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: rpi-plan
|
|
3
|
-
version: "
|
|
4
|
-
description: "RPI Plan Phase: Create implementation blueprint with
|
|
5
|
-
category: "rpi-orchestration"
|
|
6
|
-
rpi_phase: "plan"
|
|
7
|
-
context_budget_estimate: "35K tokens"
|
|
8
|
-
typical_context_usage: "17%"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- "
|
|
14
|
-
- "
|
|
15
|
-
|
|
16
|
-
- "
|
|
17
|
-
- "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- "
|
|
27
|
-
|
|
28
|
-
- "
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
##
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
---
|
|
2
|
+
name: rpi-plan
|
|
3
|
+
version: "2.0.0"
|
|
4
|
+
description: "RPI Plan Phase: Create chunk-based implementation blueprint with todolists for rpi-implement consumption"
|
|
5
|
+
category: "rpi-orchestration"
|
|
6
|
+
rpi_phase: "plan"
|
|
7
|
+
context_budget_estimate: "35K tokens"
|
|
8
|
+
typical_context_usage: "17%"
|
|
9
|
+
chunk_input: true
|
|
10
|
+
chunk_output: true
|
|
11
|
+
inter_phase_aware: true
|
|
12
|
+
prerequisites:
|
|
13
|
+
- "Research document exists in .ai-context/research/active/"
|
|
14
|
+
- "/rpi-research phase completed with chunk manifest"
|
|
15
|
+
outputs:
|
|
16
|
+
- "Plan document in .ai-context/plans/active/[name]_plan.md"
|
|
17
|
+
- "Chunk-based todolists (CHUNK-Pn per CHUNK-Rn)"
|
|
18
|
+
- "Modification table with file:line references per chunk"
|
|
19
|
+
- "Step-by-step implementation guide per chunk"
|
|
20
|
+
- "Test strategy per chunk"
|
|
21
|
+
- "Rollback plan per chunk"
|
|
22
|
+
- "Inter-phase contract for rpi-implement"
|
|
23
|
+
next_commands: ["/rpi-implement"]
|
|
24
|
+
related_agents: ["core-architect", "database-ops", "api-developer"]
|
|
25
|
+
examples:
|
|
26
|
+
- command: "/rpi-plan user-authentication"
|
|
27
|
+
description: "Create chunk-based implementation plan for auth feature"
|
|
28
|
+
- command: "/rpi-plan payment-bug-fix"
|
|
29
|
+
description: "Plan the fix with chunk-todolists for payment issue"
|
|
30
|
+
exit_criteria:
|
|
31
|
+
- "Plan document created in .ai-context/plans/active/"
|
|
32
|
+
- "Chunk manifest created with CHUNK-Pn per CHUNK-Rn"
|
|
33
|
+
- "All research chunks marked as PLANNED"
|
|
34
|
+
- "All file modifications listed with line numbers per chunk"
|
|
35
|
+
- "Chunk-todolists defined with atomic actions"
|
|
36
|
+
- "Test strategy documented per chunk"
|
|
37
|
+
- "Human approval obtained"
|
|
38
|
+
- "Inter-phase contract documented for rpi-implement"
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
# RPI Plan Phase (Enhanced with Chunk-Based Todolists)
|
|
42
|
+
|
|
43
|
+
**Purpose:** Create detailed implementation blueprint using chunk-based todolists that RPI-Implement will process
|
|
44
|
+
|
|
45
|
+
**Syntax:** `/rpi-plan [feature-name]`
|
|
46
|
+
|
|
47
|
+
**Prerequisites:** Research document must exist in `.ai-context/research/active/` with chunk manifest
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Key Innovation: Inter-Phase Awareness
|
|
52
|
+
|
|
53
|
+
RPI-Plan **KNOWS**:
|
|
54
|
+
- RPI-Research structured chunks specifically for sequential processing
|
|
55
|
+
- RPI-Implement will read each CHUNK-Pn as an atomic implementation unit
|
|
56
|
+
- Each CHUNK-Pn todolist must be independently executable
|
|
57
|
+
- Chunk dependencies must be explicit for proper execution ordering
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Chunk Processing Loop
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
┌─────────────────────────────────────────────────────────┐
|
|
65
|
+
│ RPI-PLAN CHUNK PROCESSING LOOP │
|
|
66
|
+
├─────────────────────────────────────────────────────────┤
|
|
67
|
+
│ FOR each research_chunk (CHUNK-R1 to CHUNK-RN): │
|
|
68
|
+
│ 1. Read research_chunk content │
|
|
69
|
+
│ 2. Create corresponding CHUNK-Pn todolist: │
|
|
70
|
+
│ - Define atomic action items │
|
|
71
|
+
│ - Specify file:line for each action │
|
|
72
|
+
│ - Assign test for each action │
|
|
73
|
+
│ - Document chunk-specific rollback │
|
|
74
|
+
│ 3. Mark research_chunk status as PLANNED │
|
|
75
|
+
│ 4. Define CHUNK-Pn dependencies │
|
|
76
|
+
│ 5. Proceed to next research chunk │
|
|
77
|
+
│ END LOOP │
|
|
78
|
+
└─────────────────────────────────────────────────────────┘
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Execution Steps
|
|
84
|
+
|
|
85
|
+
### Step 1: Load Research Document
|
|
86
|
+
Read `.ai-context/research/active/[feature]_research.md` and extract chunk manifest
|
|
87
|
+
|
|
88
|
+
### Step 2: Process Each Research Chunk
|
|
89
|
+
|
|
90
|
+
For each CHUNK-Rn:
|
|
91
|
+
1. Analyze chunk content (files, deps, call chains)
|
|
92
|
+
2. Create CHUNK-Pn todolist with atomic actions
|
|
93
|
+
3. Mark CHUNK-Rn status as PLANNED
|
|
94
|
+
4. Document chunk dependencies
|
|
95
|
+
|
|
96
|
+
### Step 3: Define Scope
|
|
97
|
+
- In scope (explicit list per chunk)
|
|
98
|
+
- Out of scope (what we're NOT touching)
|
|
99
|
+
|
|
100
|
+
### Step 4: Create Chunk Dependency Graph
|
|
101
|
+
```
|
|
102
|
+
CHUNK-P1 ───→ CHUNK-P2 ───→ CHUNK-P3
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Step 5: Plan Testing Strategy (Per Chunk)
|
|
106
|
+
- Tests to run after each todo
|
|
107
|
+
- Tests to run after chunk completion
|
|
108
|
+
|
|
109
|
+
### Step 6: Document Rollback Plan (Per Chunk)
|
|
110
|
+
- Per-chunk rollback commands
|
|
111
|
+
- Safe commits per chunk
|
|
112
|
+
|
|
113
|
+
### Step 7: Finalize Inter-Phase Contract
|
|
114
|
+
```
|
|
115
|
+
EXPECTED_CONSUMER: rpi-implement
|
|
116
|
+
CHUNK_PROCESSING_ORDER: dependency-ordered
|
|
117
|
+
MARK_AS_IMPLEMENTED_WHEN: all chunk todos complete
|
|
118
|
+
UPDATE_RESEARCH_STATUS: true
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Step 8: Request Human Approval
|
|
122
|
+
Plan requires human review before implementation
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Output
|
|
127
|
+
|
|
128
|
+
Plan document in `.ai-context/plans/active/[feature]_plan.md` with:
|
|
129
|
+
- Chunk manifest
|
|
130
|
+
- Per-chunk todolists
|
|
131
|
+
- Inter-phase contract for RPI-Implement
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Context Budget
|
|
136
|
+
|
|
137
|
+
- Research doc: 20k tokens
|
|
138
|
+
- Plan creation: 15k tokens
|
|
139
|
+
- Total: 35k tokens (17%)
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Next Step
|
|
144
|
+
|
|
145
|
+
After human approval: `/rpi-implement [feature-name]`
|
|
146
|
+
|
|
147
|
+
RPI-Implement will process chunks in dependency order, executing todos atomically
|