claude-context-plugin 2.1.3 → 2.2.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/README.md CHANGED
@@ -1,104 +1,128 @@
1
- # claude-context-plugin
2
-
3
- Claude Code plugin for context engineering - RPI workflow and documentation optimization.
4
-
5
- ## Installation
6
-
7
- ### Via Plugin Manager
8
-
9
- ```bash
10
- /plugin install claude-context-engineering
11
- ```
12
-
13
- ### Via CLI
14
-
15
- ```bash
16
- npx claude-plugins install claude-context-engineering
17
- ```
18
-
19
- ## Skills
20
-
21
- ### /context-eng:research
22
-
23
- Systematic codebase exploration for feature/fix analysis.
24
-
25
- ```
26
- /context-eng:research user-authentication
27
- ```
28
-
29
- Creates a research document with:
30
- - Relevant files and line numbers
31
- - Call chain analysis
32
- - Dependency mapping
33
- - Test coverage gaps
34
-
35
- ### /context-eng:plan
36
-
37
- Create implementation blueprint with file:line precision.
38
-
39
- ```
40
- /context-eng:plan user-authentication
41
- ```
42
-
43
- Creates a plan document with:
44
- - Exact file:line modifications
45
- - Risk assessment
46
- - Test strategy
47
- - Rollback plan
48
-
49
- ### /context-eng:implement
50
-
51
- Execute plan with atomic changes and continuous testing.
52
-
53
- ```
54
- /context-eng:implement user-authentication
55
- ```
56
-
57
- Follows the golden rule: ONE CHANGE → ONE TEST → ONE COMMIT
58
-
59
- ### /context-eng:validate
60
-
61
- Run complete validation suite.
62
-
63
- ```
64
- /context-eng:validate
65
- ```
66
-
67
- Checks:
68
- - Directory structure
69
- - JSON schemas
70
- - Markdown links
71
- - Placeholder completion
72
- - Line number accuracy
73
-
74
- ### /context-eng:verify-docs
75
-
76
- Verify documentation line numbers match code.
77
-
78
- ```
79
- /context-eng:verify-docs path/to/file.py
80
- ```
81
-
82
- ## Agents
83
-
84
- ### @context-eng:context-engineer
85
-
86
- Initialize and maintain context engineering documentation.
87
-
88
- ```
89
- @context-eng:context-engineer "Discover workflows for this codebase"
90
- ```
91
-
92
- ## Requirements
93
-
94
- - Claude Code v1.0.33+
95
- - Context engineering setup (use `npx create-universal-ai-context` first)
96
-
97
- ## License
98
-
99
- MIT
100
-
101
- ## Links
102
-
103
- - [GitHub](https://github.com/SireJeff/claude-context-engineering-template)
104
- - [create-universal-ai-context](https://www.npmjs.com/package/create-universal-ai-context)
1
+ # claude-context-plugin
2
+
3
+ > **⚠️ DEPRECATION NOTICE**
4
+ >
5
+ > This plugin is **deprecated** as of v3.0.0. All skills and commands are now included in the unified [`ai-context`](../ai-context/) package.
6
+ >
7
+ > **Migration:** Use `ai-context` skills and commands directly.
8
+ >
9
+ > **Support:** Use unified package instead
10
+ >
11
+ > ---
12
+
13
+ Claude Code plugin for context engineering - RPI workflow and documentation optimization.
14
+
15
+ ## Installation
16
+
17
+ ### Via Plugin Manager
18
+
19
+ ```bash
20
+ /plugin install claude-context-engineering
21
+ ```
22
+
23
+ ### Via CLI
24
+
25
+ ```bash
26
+ npx claude-plugins install claude-context-engineering
27
+ ```
28
+
29
+ ## Skills
30
+
31
+ ### /context-eng:research
32
+
33
+ Systematic codebase exploration for feature/fix analysis.
34
+
35
+ ```
36
+ /context-eng:research user-authentication
37
+ ```
38
+
39
+ Creates a research document with:
40
+ - Relevant files and line numbers
41
+ - Call chain analysis
42
+ - Dependency mapping
43
+ - Test coverage gaps
44
+
45
+ ### /context-eng:plan
46
+
47
+ Create implementation blueprint with file:line precision.
48
+
49
+ ```
50
+ /context-eng:plan user-authentication
51
+ ```
52
+
53
+ Creates a plan document with:
54
+ - Exact file:line modifications
55
+ - Risk assessment
56
+ - Test strategy
57
+ - Rollback plan
58
+
59
+ ### /context-eng:implement
60
+
61
+ Execute plan with atomic changes and continuous testing.
62
+
63
+ ```
64
+ /context-eng:implement user-authentication
65
+ ```
66
+
67
+ Follows the golden rule: ONE CHANGE → ONE TEST → ONE COMMIT
68
+
69
+ ### /context-eng:validate
70
+
71
+ Run complete validation suite.
72
+
73
+ ```
74
+ /context-eng:validate
75
+ ```
76
+
77
+ Checks:
78
+ - Directory structure
79
+ - JSON schemas
80
+ - Markdown links
81
+ - Placeholder completion
82
+ - Line number accuracy
83
+
84
+ ### /context-eng:verify-docs
85
+
86
+ Verify documentation line numbers match code.
87
+
88
+ ```
89
+ /context-eng:verify-docs path/to/file.py
90
+ ```
91
+
92
+ ### /context-eng:context-optimize
93
+
94
+ Orchestrate context optimization with interactive scoping.
95
+
96
+ ```
97
+ /context-eng:context-optimize
98
+ /context-eng:context-optimize --auto
99
+ /context-eng:context-optimize --scope documentation
100
+ ```
101
+
102
+ Generates:
103
+ - Context audit in `.claude/research/active/context-audit_research.md`
104
+ - RPI TODO plan in `.claude/plans/active/context-optimization_plan.md`
105
+
106
+ ## Agents
107
+
108
+ ### @context-eng:context-engineer
109
+
110
+ Initialize and maintain context engineering documentation.
111
+
112
+ ```
113
+ @context-eng:context-engineer "Discover workflows for this codebase"
114
+ ```
115
+
116
+ ## Requirements
117
+
118
+ - Claude Code v1.0.33+
119
+ - Context engineering setup (use `npx create-universal-ai-context` first)
120
+
121
+ ## License
122
+
123
+ MIT
124
+
125
+ ## Links
126
+
127
+ - [GitHub](https://github.com/SireJeff/claude-context-engineering-template)
128
+ - [create-universal-ai-context](https://www.npmjs.com/package/create-universal-ai-context)
@@ -1,67 +1,67 @@
1
- ---
2
- name: context-engineer
3
- description: Initialize and maintain context engineering documentation for any codebase
4
- capabilities:
5
- - Codebase analysis and workflow discovery
6
- - Documentation generation with file:line references
7
- - Index creation and maintenance
8
- - Tech stack detection
9
- ---
10
-
11
- # Context Engineer Agent
12
-
13
- I specialize in setting up and maintaining context engineering systems for codebases.
14
-
15
- ## Primary Functions
16
-
17
- ### 1. Initial Setup
18
- When asked to initialize or set up context engineering:
19
- - Analyze codebase structure
20
- - Detect technology stack
21
- - Discover major workflows (8-15)
22
- - Create workflow documentation with file:line references
23
- - Build index hierarchy
24
-
25
- ### 2. Workflow Discovery
26
- When asked to discover or find workflows:
27
- - Scan for entry points (API routes, CLI commands, event handlers)
28
- - Trace call chains 3 levels deep
29
- - Document in `.claude/context/workflows/`
30
- - Update `WORKFLOW_INDEX.md`
31
-
32
- ### 3. Re-indexing
33
- When asked to re-scan or update indexes:
34
- - Find new or changed files
35
- - Update line numbers in documentation
36
- - Add new workflows if discovered
37
- - Validate existing references
38
-
39
- ### 4. Documentation Maintenance
40
- When documentation drift is detected:
41
- - Update line numbers
42
- - Fix broken references
43
- - Add missing workflows
44
- - Archive outdated docs
45
-
46
- ## Output Format
47
-
48
- All documentation follows these standards:
49
- - File references: `path/to/file.py:123`
50
- - Line ranges: `file.py:100-150`
51
- - Markdown tables for structured data
52
- - Mermaid diagrams for flows
53
-
54
- ## Context Budget
55
-
56
- - Initial setup: 40-50% utilization
57
- - Re-indexing: 20-30% utilization
58
- - Maintenance: 15-20% utilization
59
-
60
- ## Example Invocations
61
-
62
- ```
63
- @context-engineer "Initialize context engineering for this repository"
64
- @context-engineer "Discover workflows for the authentication module"
65
- @context-engineer "Re-scan and update indexes for recent changes"
66
- @context-engineer "Update line numbers in workflow documentation"
67
- ```
1
+ ---
2
+ name: context-engineer
3
+ description: Initialize and maintain context engineering documentation for any codebase
4
+ capabilities:
5
+ - Codebase analysis and workflow discovery
6
+ - Documentation generation with file:line references
7
+ - Index creation and maintenance
8
+ - Tech stack detection
9
+ ---
10
+
11
+ # Context Engineer Agent
12
+
13
+ I specialize in setting up and maintaining context engineering systems for codebases.
14
+
15
+ ## Primary Functions
16
+
17
+ ### 1. Initial Setup
18
+ When asked to initialize or set up context engineering:
19
+ - Analyze codebase structure
20
+ - Detect technology stack
21
+ - Discover major workflows (8-15)
22
+ - Create workflow documentation with file:line references
23
+ - Build index hierarchy
24
+
25
+ ### 2. Workflow Discovery
26
+ When asked to discover or find workflows:
27
+ - Scan for entry points (API routes, CLI commands, event handlers)
28
+ - Trace call chains 3 levels deep
29
+ - Document in `.claude/context/workflows/`
30
+ - Update `WORKFLOW_INDEX.md`
31
+
32
+ ### 3. Re-indexing
33
+ When asked to re-scan or update indexes:
34
+ - Find new or changed files
35
+ - Update line numbers in documentation
36
+ - Add new workflows if discovered
37
+ - Validate existing references
38
+
39
+ ### 4. Documentation Maintenance
40
+ When documentation drift is detected:
41
+ - Update line numbers
42
+ - Fix broken references
43
+ - Add missing workflows
44
+ - Archive outdated docs
45
+
46
+ ## Output Format
47
+
48
+ All documentation follows these standards:
49
+ - File references: `path/to/file.py:123`
50
+ - Line ranges: `file.py:100-150`
51
+ - Markdown tables for structured data
52
+ - Mermaid diagrams for flows
53
+
54
+ ## Context Budget
55
+
56
+ - Initial setup: 40-50% utilization
57
+ - Re-indexing: 20-30% utilization
58
+ - Maintenance: 15-20% utilization
59
+
60
+ ## Example Invocations
61
+
62
+ ```
63
+ @context-engineer "Initialize context engineering for this repository"
64
+ @context-engineer "Discover workflows for the authentication module"
65
+ @context-engineer "Re-scan and update indexes for recent changes"
66
+ @context-engineer "Update line numbers in workflow documentation"
67
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-context-plugin",
3
- "version": "2.1.3",
3
+ "version": "2.2.0-final",
4
4
  "description": "Claude Code plugin for context engineering - RPI workflow and documentation optimization",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -0,0 +1,86 @@
1
+ ---
2
+ description: Context Optimization - Orchestrate RPI workflow TODO generation with interactive scoping
3
+ ---
4
+
5
+ # Context Engineering: Optimization Orchestrator
6
+
7
+ When invoked, orchestrate context engineering optimization with interactive scoping:
8
+
9
+ ## Process
10
+
11
+ 1. **Interactive Scoping (if no --auto flag)**
12
+ - Ask up to 4 multiple choice questions to define scope
13
+ - Questions cover: optimization focus, codebase areas, enhancement types, priority order
14
+ - Skip questions if --scope or --auto flag provided
15
+
16
+ 2. **Context System Audit**
17
+ - Analyze `.claude/` directory structure
18
+ - Check workflow file coverage and accuracy
19
+ - Verify index file completeness
20
+ - Identify orphaned or outdated files
21
+ - Assess agent and command coverage gaps
22
+
23
+ 3. **Generate RPI TODO List**
24
+ - Create actionable TODO with research, plan, implement phases
25
+ - Save to `.claude/plans/active/context-optimization_plan.md`
26
+ - Include specific commands for each task
27
+
28
+ 4. **Redundant File Detection**
29
+ - Find files not referenced by any index
30
+ - Identify duplicate or overlapping content
31
+ - Flag outdated files with stale line references
32
+ - Report empty placeholder files
33
+
34
+ 5. **Enhancement Recommendations**
35
+ - Suggest new specialized agents based on codebase patterns
36
+ - Recommend workflow commands for common tasks
37
+ - Identify undocumented workflows needing documentation
38
+
39
+ ## Scoping Questions (Max 4)
40
+
41
+ **Q1: Optimization Focus**
42
+ - A) Functionalize the entire context engineering system
43
+ - B) Update outdated documentation and line references
44
+ - C) Identify and remove redundant context files
45
+ - D) Discover enhancement opportunities (new agents/commands)
46
+
47
+ **Q2: Codebase Coverage**
48
+ - A) Core business logic
49
+ - B) API/External integrations
50
+ - C) Database/Data layer
51
+ - D) All areas equally
52
+
53
+ **Q3: Enhancement Preferences**
54
+ - A) New specialized agents for specific domains
55
+ - B) New workflow commands for common tasks
56
+ - C) Improved documentation structure
57
+ - D) Better cross-referencing and navigation
58
+
59
+ **Q4: TODO Priority Order**
60
+ - A) Quick wins first (< 30 min each)
61
+ - B) High impact first (regardless of effort)
62
+ - C) By workflow area (grouped logically)
63
+ - D) By dependency order (foundational first)
64
+
65
+ ## Context Budget
66
+ - Target: 20% of 200k tokens (40k)
67
+ - Output: TODO checklist + recommendations
68
+
69
+ ## Output
70
+ - TODO checklist saved to `.claude/plans/active/context-optimization_plan.md`
71
+ - Audit findings in `.claude/research/active/context-audit_research.md`
72
+
73
+ ## Arguments
74
+ - `$ARGUMENTS` can include:
75
+ - `--auto` - Use intelligent defaults, skip questions
76
+ - `--scope documentation` - Focus on docs only
77
+ - `--scope agents` - Focus on agent gaps
78
+ - `--scope workflows` - Focus on workflow coverage
79
+ - `--scope cleanup` - Focus on redundant file removal
80
+
81
+ ## Next Steps
82
+ After completion, execute the generated TODO list:
83
+ 1. `/rpi-research [first-research-task]`
84
+ 2. `/rpi-plan [first-plan-task]`
85
+ 3. `/rpi-implement [first-impl-task]`
86
+ 4. `/validate-all`
@@ -1,71 +1,150 @@
1
- ---
2
- description: RPI Implement Phase - Execute plan with atomic changes and continuous testing
3
- ---
4
-
5
- # Context Engineering: Implement Phase
6
-
7
- When invoked, execute the approved implementation plan:
8
-
9
- ## Prerequisites
10
- - Approved plan at `.claude/plans/active/[feature]_plan.md`
11
- - If not found, run `/context-eng:plan $ARGUMENTS` first
12
-
13
- ## Golden Rule
14
-
15
- ```
16
- ONE CHANGE ONE TEST ONE COMMIT
17
- ```
18
-
19
- ## Process
20
-
21
- 1. **Load Plan Document**
22
- - Read `.claude/plans/active/[feature]_plan.md`
23
- - Verify plan status is APPROVED
24
-
25
- 2. **For Each Step in Plan:**
26
- a. Make the single, atomic change
27
- b. Run the specified test immediately
28
- c. If test passes: commit with descriptive message
29
- d. If test fails: STOP, investigate, fix before proceeding
30
- e. Update documentation if needed
31
-
32
- 3. **Documentation Updates (MANDATORY)**
33
- - Check `CODE_TO_WORKFLOW_MAP.md` for affected workflows
34
- - Update workflow files with new line numbers
35
- - Update function signatures if changed
36
-
37
- 4. **Context Reset (Every 3 Steps)**
38
- - Update progress checklist in plan
39
- - Re-read plan document
40
- - Verify scope alignment
41
- - Compact if >35% utilization
42
-
43
- 5. **Finalize**
44
- - Move plan to `.claude/plans/completed/`
45
- - Move research to `.claude/research/completed/`
46
- - Run `/context-eng:validate` to verify
47
-
48
- ## Error Handling
49
-
50
- | Error Type | Response |
51
- |------------|----------|
52
- | Syntax Error | STOP. Fix immediately. |
53
- | Import Error | Check file paths, verify imports. |
54
- | Test Failure | Do NOT add more code. Investigate first. |
55
- | 3+ Failures | STOP. Start new session. |
56
-
57
- ## Context Budget
58
- - Plan: 15k tokens
59
- - Active code: 30k tokens
60
- - Test results: 15k tokens
61
- - Total: 60k tokens (30%)
62
-
63
- ## Commit Format
64
- ```
65
- feat/fix/refactor(scope): description
66
-
67
- - Detail 1
68
- - Detail 2
69
-
70
- Implements: [feature]
71
- ```
1
+ ---
2
+ description: RPI Implement Phase - Execute chunk-based todolists with atomic changes and continuous testing
3
+ ---
4
+
5
+ # Context Engineering: Implement Phase (Enhanced)
6
+
7
+ When invoked, execute the approved implementation plan chunk by chunk:
8
+
9
+ ## Key Innovation: Inter-Phase Awareness
10
+
11
+ This implement phase **KNOWS**:
12
+ - RPI-Plan structured chunks for atomic implementation
13
+ - Each CHUNK-Pn contains a complete, ordered todolist
14
+ - Chunk dependencies dictate execution order
15
+ - Marking chunks complete updates both plan AND research documents
16
+ - Context reset is needed after every 3 chunks or 35% utilization
17
+
18
+ ## Prerequisites
19
+ - Approved plan at `.claude/plans/active/[feature]_plan.md`
20
+ - Plan contains chunk manifest with chunk-todolists
21
+ - If not found, run `/context-eng:plan $ARGUMENTS` first
22
+
23
+ ## Golden Rules
24
+
25
+ ```
26
+ ONE CHUNK COMPLETE TODOLIST → MARK DONE → NEXT CHUNK
27
+ ONE TODO ONE CHANGE → ONE TEST → ONE COMMIT
28
+ ```
29
+
30
+ ## Chunk-Based Implementation Loop
31
+
32
+ ```
33
+ FOR each CHUNK-Pn in dependency_order:
34
+ IF dependencies_complete:
35
+ 1. Load CHUNK-Pn todolist
36
+
37
+ FOR each TODO in todolist:
38
+ a. Make atomic change
39
+ b. Run todo-specific test
40
+ c. If PASS: commit, mark TODO ✅
41
+ d. If FAIL: STOP, investigate, fix
42
+ END TODO LOOP
43
+
44
+ 2. Update chunk documentation
45
+ 3. Mark CHUNK-Pn as IMPLEMENTED
46
+ 4. Update research CHUNK-Rn to IMPLEMENTED
47
+
48
+ IF chunks_processed % 3 == 0 OR context > 35%:
49
+ Context reset (save progress, reload plan)
50
+ END IF
51
+
52
+ 5. Proceed to next ready chunk
53
+ END IF
54
+ END CHUNK LOOP
55
+ ```
56
+
57
+ ## Process
58
+
59
+ 1. **Load Plan Document**
60
+ - Read `.claude/plans/active/[feature]_plan.md`
61
+ - Extract chunk manifest and dependency graph
62
+ - Verify plan status is APPROVED
63
+
64
+ 2. **Determine Execution Order**
65
+ Based on chunk dependency graph:
66
+ - Independent chunks first (parallel capable)
67
+ - Dependent chunks in order
68
+ - Final chunks (e.g., test additions)
69
+
70
+ 3. **For Each Chunk (in dependency order):**
71
+
72
+ a. **Check dependencies complete**
73
+
74
+ b. **Execute each todo atomically:**
75
+ - Make single change
76
+ - Run specified test
77
+ - If pass: commit with message
78
+ - If fail: STOP, investigate, fix
79
+
80
+ c. **After all todos complete:**
81
+ - Mark CHUNK-Pn as IMPLEMENTED
82
+ - Update CHUNK-Rn in research to IMPLEMENTED
83
+ - Commit chunk documentation updates
84
+
85
+ d. **Context management:**
86
+ - After every 3 chunks: reload plan
87
+ - If >35% utilization: save, compact, continue
88
+
89
+ 4. **Run Full Test Suite**
90
+ After all chunks complete
91
+
92
+ 5. **Documentation Updates (MANDATORY)**
93
+ - Check `CODE_TO_WORKFLOW_MAP.md` for affected workflows
94
+ - Update workflow files with new line numbers
95
+ - Update function signatures if changed
96
+
97
+ 6. **Context Reset (Every 3 Chunks)**
98
+ - Update chunk progress in plan
99
+ - Re-read plan document
100
+ - Verify scope alignment
101
+ - Compact if >35% utilization
102
+
103
+ 7. **Finalize**
104
+ - Move plan to `.claude/plans/completed/`
105
+ - Move research to `.claude/research/completed/`
106
+ - Run `/context-eng:validate` to verify
107
+
108
+ ## Chunk Status Updates
109
+
110
+ ### Update Plan Document
111
+ ```markdown
112
+ | Chunk | Status | Todos Done | Commit | Research Updated |
113
+ |-------|--------|------------|--------|------------------|
114
+ | P1 | ✅ IMPLEMENTED | 4/4 | abc123 | ✅ R1 |
115
+ | P2 | ▶️ IMPLEMENTING | 2/5 | - | - |
116
+ ```
117
+
118
+ ### Update Research Document
119
+ Mark each CHUNK-Rn status:
120
+ - FOUND → COMPLETE → PLANNED → **IMPLEMENTED**
121
+
122
+ ## Error Handling
123
+
124
+ | Error Type | Response |
125
+ |------------|----------|
126
+ | Syntax Error | STOP. Fix immediately in same todo. |
127
+ | Import Error | Check file paths, verify imports. |
128
+ | Test Failure | Do NOT add more code. Investigate first. |
129
+ | 3+ Failures in chunk | Mark chunk BLOCKED, try next independent chunk. |
130
+ | 3+ Chunks blocked | STOP. Start new session. |
131
+
132
+ ## Commit Format
133
+
134
+ Per-todo:
135
+ ```
136
+ feat(chunk-Pn): Todo N - description
137
+ Implements: [feature] chunk N
138
+ ```
139
+
140
+ Per-chunk completion:
141
+ ```
142
+ feat(chunk-Pn): Complete chunk - [domain]
143
+ Completes: CHUNK-Pn, Updates: CHUNK-Rn
144
+ ```
145
+
146
+ ## Context Budget
147
+ - Plan: 15k tokens
148
+ - Active code (per chunk): ~10k tokens
149
+ - Test results (per chunk): ~5k tokens
150
+ - Max active (3 chunks): ~45k tokens (22.5%)
@@ -1,66 +1,143 @@
1
- ---
2
- description: RPI Plan Phase - Create implementation blueprint with file:line precision
3
- ---
4
-
5
- # Context Engineering: Plan Phase
6
-
7
- When invoked, create a detailed implementation plan:
8
-
9
- ## Prerequisites
10
- - Research document exists at `.claude/research/active/[feature]_research.md`
11
- - If not found, run `/context-eng:research $ARGUMENTS` first
12
-
13
- ## Process
14
-
15
- 1. **Load Research Document**
16
- - Read the research document for $ARGUMENTS
17
- - Extract relevant files and line numbers
18
-
19
- 2. **Design Implementation**
20
- - For each change required:
21
- - Specify exact file and line numbers
22
- - Show current code snippet
23
- - Show proposed change
24
- - Assign risk level (LOW/MEDIUM/HIGH)
25
-
26
- 3. **Plan Test Strategy**
27
- - Identify which tests to run after each change
28
- - Note any new tests needed
29
-
30
- 4. **Document Rollback Plan**
31
- - Safe commit to revert to
32
- - Commands to undo changes
33
-
34
- 5. **Create Plan Document**
35
- - Save to `.claude/plans/active/[feature]_plan.md`
36
- - Include verification checklist
37
-
38
- ## Plan Format
39
-
40
- ```markdown
41
- # Implementation Plan: [Feature]
42
-
43
- ## Files to Modify
44
- | File | Lines | Change | Risk |
45
- |------|-------|--------|------|
46
-
47
- ## Step-by-Step
48
- ### Step 1: [Action]
49
- **File:** path/to/file.ext
50
- **Lines:** X-Y
51
- **Current:** [code block]
52
- **Proposed:** [code block]
53
- **Test:** [command]
54
-
55
- ## Rollback
56
- - Safe commit: [hash]
57
- - Command: git revert HEAD
58
- ```
59
-
60
- ## Context Budget
61
- - Research doc: 20k tokens
62
- - Plan creation: 15k tokens
63
- - Total: 35k tokens (17.5%)
64
-
65
- ## Next Step
66
- After approval, run `/context-eng:implement $ARGUMENTS`
1
+ ---
2
+ description: RPI Plan Phase - Create chunk-based todolists from research chunks for rpi-implement consumption
3
+ ---
4
+
5
+ # Context Engineering: Plan Phase (Enhanced)
6
+
7
+ When invoked, create a detailed implementation plan with chunk-based todolists:
8
+
9
+ ## Key Innovation: Inter-Phase Awareness
10
+
11
+ This plan phase **KNOWS**:
12
+ - RPI-Research structured chunks specifically for sequential processing
13
+ - RPI-Implement will read each CHUNK-Pn as an atomic implementation unit
14
+ - Each CHUNK-Pn todolist must be independently executable
15
+ - Chunk dependencies must be explicit for proper execution ordering
16
+
17
+ ## Prerequisites
18
+ - Research document exists at `.claude/research/active/[feature]_research.md`
19
+ - Research document contains chunk manifest
20
+ - If not found, run `/context-eng:research $ARGUMENTS` first
21
+
22
+ ## Chunk Processing Loop
23
+
24
+ ```
25
+ FOR each CHUNK-Rn in research_chunks:
26
+ 1. Read CHUNK-Rn content
27
+ 2. Create CHUNK-Pn todolist:
28
+ - Define atomic action items
29
+ - Specify file:line for each action
30
+ - Assign test for each action
31
+ - Document chunk-specific rollback
32
+ 3. Mark CHUNK-Rn status as PLANNED
33
+ 4. Define CHUNK-Pn dependencies
34
+ 5. Proceed to next CHUNK-R(n+1)
35
+ END LOOP
36
+ ```
37
+
38
+ ## Process
39
+
40
+ 1. **Load Research Document**
41
+ - Read the research document for $ARGUMENTS
42
+ - Extract chunk manifest
43
+ - Extract per-chunk files and line numbers
44
+
45
+ 2. **For Each Research Chunk (CHUNK-Rn):**
46
+
47
+ a. **Analyze chunk content:**
48
+ - Files explored with line numbers
49
+ - Code flow analysis
50
+ - Dependencies identified
51
+
52
+ b. **Create CHUNK-Pn todolist:**
53
+ ```markdown
54
+ | # | Action | File | Lines | Risk | Test | Status |
55
+ |---|--------|------|-------|------|------|--------|
56
+ | 1 | [Action] | file.ext | XXX | LOW | test_x | ⏳ |
57
+ ```
58
+
59
+ c. **Define per-todo details:**
60
+ - Current code snippet
61
+ - Proposed change
62
+ - Test to run after
63
+
64
+ d. **Mark research chunk as PLANNED**
65
+
66
+ e. **Document chunk dependencies**
67
+
68
+ 3. **Create Chunk Dependency Graph**
69
+ ```
70
+ CHUNK-P1 → CHUNK-P2 → CHUNK-P3
71
+
72
+ CHUNK-P4 CHUNK-P5
73
+ ```
74
+
75
+ 4. **Generate Inter-Phase Contract**
76
+ ```
77
+ EXPECTED_CONSUMER: rpi-implement
78
+ CHUNK_PROCESSING_ORDER: dependency-ordered
79
+ MARK_AS_IMPLEMENTED_WHEN: all chunk todos complete
80
+ UPDATE_RESEARCH_STATUS: true
81
+ ```
82
+
83
+ 5. **Create Plan Document**
84
+ - Save to `.claude/plans/active/[feature]_plan.md`
85
+ - Include chunk manifest
86
+ - Include per-chunk todolists
87
+ - Include verification checklist
88
+
89
+ ## Plan Format (Chunk-Based)
90
+
91
+ ```markdown
92
+ # Implementation Plan: [Feature]
93
+
94
+ ## Chunk Manifest
95
+ | Chunk ID | From Research | Status | Todos | Dependencies | Ready |
96
+ |----------|---------------|--------|-------|--------------|-------|
97
+ | CHUNK-P1 | CHUNK-R1 | READY | 4 | None | ✅ |
98
+ | CHUNK-P2 | CHUNK-R2 | READY | 5 | CHUNK-P1 | ⏳ |
99
+
100
+ ## CHUNK-P1: [Domain] (from CHUNK-R1)
101
+
102
+ **Status:** READY
103
+ **Dependencies:** None
104
+ **Update Research When Complete:** Mark CHUNK-R1 as IMPLEMENTED
105
+
106
+ ### Todolist
107
+ | # | Action | File | Lines | Risk | Test | Status |
108
+ |---|--------|------|-------|------|------|--------|
109
+ | 1 | [Action] | file.ext | XXX | LOW | test_x | ⏳ |
110
+
111
+ ### Todo 1: [Action Name]
112
+ **File:** path/to/file.ext
113
+ **Lines:** X-Y
114
+ **Current:** [code block]
115
+ **Proposed:** [code block]
116
+ **Test:** [command]
117
+
118
+ ### Chunk Completion Criteria
119
+ - [ ] All todos complete
120
+ - [ ] Update CHUNK-R1 status
121
+ - [ ] Proceed to dependent chunks
122
+
123
+ ## Inter-Phase Contract
124
+ [contract for rpi-implement]
125
+
126
+ ## Rollback (Per Chunk)
127
+ - CHUNK-P1: git revert [hash]
128
+ ```
129
+
130
+ ## Context Budget
131
+ - Research doc: 20k tokens
132
+ - Plan creation: 15k tokens
133
+ - Total: 35k tokens (17.5%)
134
+
135
+ ## Next Step
136
+ After approval, run `/context-eng:implement $ARGUMENTS`
137
+
138
+ RPI-Implement will:
139
+ 1. Load chunk manifest
140
+ 2. Process chunks in dependency order
141
+ 3. Execute todos atomically per chunk
142
+ 4. Mark chunks as IMPLEMENTED
143
+ 5. Update research document status
@@ -1,43 +1,103 @@
1
- ---
2
- description: RPI Research Phase - Systematic codebase exploration for feature/fix analysis
3
- ---
4
-
5
- # Context Engineering: Research Phase
6
-
7
- When invoked, perform systematic codebase exploration:
8
-
9
- ## Process
10
-
11
- 1. **Initialize Research Document**
12
- - Create `.claude/research/active/[feature]_research.md`
13
- - Use template from `.claude/research/RESEARCH_TEMPLATE.md`
14
-
15
- 2. **Entry Point Discovery**
16
- - Search for API routes, CLI commands, event handlers related to $ARGUMENTS
17
- - Use parallel exploration for efficiency (up to 3 agents)
18
-
19
- 3. **Call Chain Tracing**
20
- - Trace 3 levels deep from entry points
21
- - Record exact file:line references for each function
22
-
23
- 4. **Dependency Mapping**
24
- - Internal: services, models, utilities used
25
- - External: APIs, databases, third-party services
26
-
27
- 5. **Test Coverage Analysis**
28
- - Find existing tests for affected code
29
- - Identify coverage gaps
30
-
31
- 6. **Generate Summary**
32
- - 150-word summary for Plan phase
33
- - List 3-20 relevant files with line numbers
34
-
35
- ## Context Budget
36
- - Target: 25% of 200k tokens (50k)
37
- - Final output: ~20k tokens (research doc only)
38
-
39
- ## Output
40
- Research document saved to `.claude/research/active/`
41
-
42
- ## Next Step
43
- After completion, run `/context-eng:plan $ARGUMENTS`
1
+ ---
2
+ description: RPI Research Phase - Systematic codebase exploration with parallel agents and chunked output
3
+ ---
4
+
5
+ # Context Engineering: Research Phase (Enhanced)
6
+
7
+ When invoked, perform systematic codebase exploration using parallel agents:
8
+
9
+ ## Key Innovation: Inter-Phase Awareness
10
+
11
+ This research phase **KNOWS** how RPI-Plan will consume its output:
12
+ - Output structured into research chunks (CHUNK-R1, CHUNK-R2, etc.)
13
+ - Each chunk is self-contained with files, dependencies, and status
14
+ - RPI-Plan will create a CHUNK-Pn todolist per CHUNK-Rn
15
+ - Chunk manifest enables sequential processing by RPI-Plan
16
+
17
+ ## Process
18
+
19
+ 1. **Initialize Research Document**
20
+ - Create `.claude/research/active/[feature]_research.md`
21
+ - Use template from `.claude/research/RESEARCH_TEMPLATE.md`
22
+
23
+ 2. **Spawn Parallel Agents (3-5 agents)**
24
+
25
+ ```
26
+ Agent 1: API/Route Entry Points → CHUNK-R1
27
+ Agent 2: Business Logic & Models → CHUNK-R2
28
+ Agent 3: Database/Storage Layer → CHUNK-R3
29
+ Agent 4: External Integrations → CHUNK-R4
30
+ Agent 5: Test Coverage Analysis → CHUNK-R5
31
+ ```
32
+
33
+ Each agent receives:
34
+ - Feature name and objective
35
+ - Assigned domain
36
+ - Required output format (chunk structure)
37
+ - Line number requirement for all file references
38
+
39
+ 3. **Per-Agent Chunk Output**
40
+ Each agent produces a self-contained chunk:
41
+ ```markdown
42
+ ## CHUNK-Rn: [Domain]
43
+ **Status:** COMPLETE
44
+ **Parallel Agent:** Agent N
45
+ **Ready for Planning:** Yes
46
+
47
+ ### Files Explored
48
+ | File | Lines | Key Findings |
49
+
50
+ ### Code Flow Analysis
51
+ [call chain with file:line refs]
52
+
53
+ ### Dependencies (This Chunk)
54
+ - External: [APIs]
55
+ - Internal: [services]
56
+ ```
57
+
58
+ 4. **Aggregate Chunk Results**
59
+ - Create chunk manifest table
60
+ - Combine all agent outputs
61
+ - Verify all chunks are COMPLETE
62
+
63
+ 5. **Generate Inter-Phase Contract**
64
+ ```
65
+ EXPECTED_CONSUMER: rpi-plan
66
+ CHUNK_PROCESSING_ORDER: sequential (R1 → R2 → R3 → R4 → R5)
67
+ MARK_AS_PLANNED_WHEN: chunk todolist created
68
+ REQUIRED_OUTPUT: CHUNK-Pn per CHUNK-Rn
69
+ ```
70
+
71
+ 6. **Generate Summary**
72
+ - 150-word summary for Plan phase
73
+ - Reference key files from each chunk
74
+ - Recommend approach
75
+
76
+ ## Chunk Manifest Format (Required)
77
+
78
+ ```markdown
79
+ | Chunk ID | Domain | Status | Files | Ready for Planning |
80
+ |----------|--------|--------|-------|-------------------|
81
+ | CHUNK-R1 | API/Routes | COMPLETE | 3 | ✅ |
82
+ | CHUNK-R2 | Business Logic | COMPLETE | 4 | ✅ |
83
+ | CHUNK-R3 | Database | COMPLETE | 2 | ✅ |
84
+ | CHUNK-R4 | External | COMPLETE | 1 | ✅ |
85
+ | CHUNK-R5 | Tests | COMPLETE | 3 | ✅ |
86
+ ```
87
+
88
+ ## Context Budget
89
+ - Target: 25% of 200k tokens (50k)
90
+ - Per-agent budget: ~10k tokens each
91
+ - Compaction: After each agent returns
92
+ - Final output: ~20k tokens (research doc only)
93
+
94
+ ## Output
95
+ Research document saved to `.claude/research/active/` with:
96
+ - Chunk manifest
97
+ - Per-chunk details
98
+ - Inter-phase contract for RPI-Plan
99
+
100
+ ## Next Step
101
+ After completion, run `/context-eng:plan $ARGUMENTS`
102
+
103
+ RPI-Plan will read chunk manifest and create CHUNK-Pn todolist per CHUNK-Rn
@@ -1,62 +1,62 @@
1
- ---
2
- description: Run complete validation suite on context engineering documentation
3
- ---
4
-
5
- # Context Engineering: Validation
6
-
7
- Run comprehensive validation on the context engineering setup.
8
-
9
- ## Validation Checks
10
-
11
- ### 1. Structure Validation
12
- - All required directories exist in `.claude/`
13
- - Required files are present
14
- - Settings file is valid JSON
15
-
16
- ### 2. Schema Validation
17
- - JSON files validate against their schemas
18
- - Frontmatter in markdown files is valid
19
-
20
- ### 3. Link Validation
21
- - All internal markdown links resolve
22
- - No broken references to files or anchors
23
-
24
- ### 4. Placeholder Detection
25
- - Find remaining `{{PLACEHOLDER}}` values
26
- - Report files that need manual completion
27
-
28
- ### 5. Line Number Accuracy
29
- - Sample referenced line numbers in documentation
30
- - Verify they match actual code
31
- - Target: ≥60% accuracy
32
-
33
- ## Output
34
-
35
- ```
36
- Validation Results
37
- ==================
38
- ✓ Structure: PASS (12/12 directories)
39
- ✓ Schemas: PASS (5/5 files valid)
40
- ✓ Links: PASS (45/45 links resolve)
41
- ⚠ Placeholders: WARN (3 remaining in 2 files)
42
- ✓ Line Accuracy: PASS (78% accurate)
43
-
44
- Overall: PASS with warnings
45
- ```
46
-
47
- ## Usage
48
-
49
- Run validation:
50
- - Full suite: `/context-eng:validate`
51
- - Specific check: `/context-eng:validate --links`
52
- - With fix: `/context-eng:validate --fix`
53
-
54
- ## Thresholds
55
-
56
- | Check | Pass | Warn | Fail |
57
- |-------|------|------|------|
58
- | Structure | 100% | - | <100% |
59
- | Schemas | 100% | - | <100% |
60
- | Links | 100% | <100% | <90% |
61
- | Placeholders | 0 | 1-5 | >5 |
62
- | Line Accuracy | ≥60% | 50-60% | <50% |
1
+ ---
2
+ description: Run complete validation suite on context engineering documentation
3
+ ---
4
+
5
+ # Context Engineering: Validation
6
+
7
+ Run comprehensive validation on the context engineering setup.
8
+
9
+ ## Validation Checks
10
+
11
+ ### 1. Structure Validation
12
+ - All required directories exist in `.claude/`
13
+ - Required files are present
14
+ - Settings file is valid JSON
15
+
16
+ ### 2. Schema Validation
17
+ - JSON files validate against their schemas
18
+ - Frontmatter in markdown files is valid
19
+
20
+ ### 3. Link Validation
21
+ - All internal markdown links resolve
22
+ - No broken references to files or anchors
23
+
24
+ ### 4. Placeholder Detection
25
+ - Find remaining `{{PLACEHOLDER}}` values
26
+ - Report files that need manual completion
27
+
28
+ ### 5. Line Number Accuracy
29
+ - Sample referenced line numbers in documentation
30
+ - Verify they match actual code
31
+ - Target: ≥60% accuracy
32
+
33
+ ## Output
34
+
35
+ ```
36
+ Validation Results
37
+ ==================
38
+ ✓ Structure: PASS (12/12 directories)
39
+ ✓ Schemas: PASS (5/5 files valid)
40
+ ✓ Links: PASS (45/45 links resolve)
41
+ ⚠ Placeholders: WARN (3 remaining in 2 files)
42
+ ✓ Line Accuracy: PASS (78% accurate)
43
+
44
+ Overall: PASS with warnings
45
+ ```
46
+
47
+ ## Usage
48
+
49
+ Run validation:
50
+ - Full suite: `/context-eng:validate`
51
+ - Specific check: `/context-eng:validate --links`
52
+ - With fix: `/context-eng:validate --fix`
53
+
54
+ ## Thresholds
55
+
56
+ | Check | Pass | Warn | Fail |
57
+ |-------|------|------|------|
58
+ | Structure | 100% | - | <100% |
59
+ | Schemas | 100% | - | <100% |
60
+ | Links | 100% | <100% | <90% |
61
+ | Placeholders | 0 | 1-5 | >5 |
62
+ | Line Accuracy | ≥60% | 50-60% | <50% |
@@ -1,77 +1,77 @@
1
- ---
2
- description: Verify documentation line numbers match current code state
3
- ---
4
-
5
- # Context Engineering: Verify Documentation
6
-
7
- Check if documentation line numbers still match the actual code.
8
-
9
- ## Purpose
10
-
11
- After code changes, line numbers in documentation may drift. This skill:
12
- 1. Finds all `file:line` references in `.claude/` documentation
13
- 2. Verifies the referenced lines exist and match described content
14
- 3. Reports accuracy and suggests fixes
15
-
16
- ## Process
17
-
18
- 1. **Scan Documentation**
19
- - Find all patterns like `file.py:123` or `[file.py:123]`
20
- - Extract file path and line number
21
-
22
- 2. **Verify References**
23
- - Check if file exists
24
- - Check if line number is within file bounds
25
- - Sample content to verify it matches description
26
-
27
- 3. **Calculate Accuracy**
28
- - Total references found
29
- - Valid references
30
- - Accuracy percentage
31
-
32
- 4. **Generate Report**
33
- ```
34
- Documentation Accuracy Report
35
- =============================
36
- Total References: 156
37
- Valid: 142
38
- Invalid: 14
39
- Accuracy: 91%
40
-
41
- Invalid References:
42
- - context/workflows/auth.md:45 → src/auth.py:230 (line moved to 245)
43
- - context/workflows/api.md:12 → src/api.py:100 (file renamed)
44
- ```
45
-
46
- ## Usage
47
-
48
- Check specific file:
49
- ```
50
- /context-eng:verify-docs path/to/changed/file.py
51
- ```
52
-
53
- Check all documentation:
54
- ```
55
- /context-eng:verify-docs
56
- ```
57
-
58
- Auto-fix (update line numbers):
59
- ```
60
- /context-eng:verify-docs --fix
61
- ```
62
-
63
- ## Target Accuracy
64
-
65
- | Level | Accuracy | Action |
66
- |-------|----------|--------|
67
- | Excellent | ≥80% | No action needed |
68
- | Good | 60-80% | Update when convenient |
69
- | Warning | 40-60% | Update soon |
70
- | Critical | <40% | Update immediately |
71
-
72
- ## When to Run
73
-
74
- - After refactoring
75
- - After adding/removing significant code
76
- - Before creating a PR
77
- - Weekly maintenance
1
+ ---
2
+ description: Verify documentation line numbers match current code state
3
+ ---
4
+
5
+ # Context Engineering: Verify Documentation
6
+
7
+ Check if documentation line numbers still match the actual code.
8
+
9
+ ## Purpose
10
+
11
+ After code changes, line numbers in documentation may drift. This skill:
12
+ 1. Finds all `file:line` references in `.claude/` documentation
13
+ 2. Verifies the referenced lines exist and match described content
14
+ 3. Reports accuracy and suggests fixes
15
+
16
+ ## Process
17
+
18
+ 1. **Scan Documentation**
19
+ - Find all patterns like `file.py:123` or `[file.py:123]`
20
+ - Extract file path and line number
21
+
22
+ 2. **Verify References**
23
+ - Check if file exists
24
+ - Check if line number is within file bounds
25
+ - Sample content to verify it matches description
26
+
27
+ 3. **Calculate Accuracy**
28
+ - Total references found
29
+ - Valid references
30
+ - Accuracy percentage
31
+
32
+ 4. **Generate Report**
33
+ ```
34
+ Documentation Accuracy Report
35
+ =============================
36
+ Total References: 156
37
+ Valid: 142
38
+ Invalid: 14
39
+ Accuracy: 91%
40
+
41
+ Invalid References:
42
+ - context/workflows/auth.md:45 → src/auth.py:230 (line moved to 245)
43
+ - context/workflows/api.md:12 → src/api.py:100 (file renamed)
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ Check specific file:
49
+ ```
50
+ /context-eng:verify-docs path/to/changed/file.py
51
+ ```
52
+
53
+ Check all documentation:
54
+ ```
55
+ /context-eng:verify-docs
56
+ ```
57
+
58
+ Auto-fix (update line numbers):
59
+ ```
60
+ /context-eng:verify-docs --fix
61
+ ```
62
+
63
+ ## Target Accuracy
64
+
65
+ | Level | Accuracy | Action |
66
+ |-------|----------|--------|
67
+ | Excellent | ≥80% | No action needed |
68
+ | Good | 60-80% | Update when convenient |
69
+ | Warning | 40-60% | Update soon |
70
+ | Critical | <40% | Update immediately |
71
+
72
+ ## When to Run
73
+
74
+ - After refactoring
75
+ - After adding/removing significant code
76
+ - Before creating a PR
77
+ - Weekly maintenance
@@ -1,23 +0,0 @@
1
- {
2
- "name": "claude-context-engineering",
3
- "version": "1.0.0",
4
- "displayName": "Context Engineering",
5
- "description": "RPI workflow and context optimization for Claude Code - Research, Plan, Implement with file:line precision",
6
- "author": {
7
- "name": "SireJeff"
8
- },
9
- "license": "MIT",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/SireJeff/claude-context-engineering-template"
13
- },
14
- "keywords": [
15
- "context-engineering",
16
- "rpi-workflow",
17
- "documentation",
18
- "productivity"
19
- ],
20
- "claudeCode": {
21
- "minVersion": "1.0.33"
22
- }
23
- }