create-claude-context 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +146 -0
  3. package/bin/create-claude-context.js +61 -0
  4. package/lib/detector.js +373 -0
  5. package/lib/index.js +170 -0
  6. package/lib/installer.js +362 -0
  7. package/lib/placeholder.js +208 -0
  8. package/lib/prompts.js +287 -0
  9. package/lib/spinner.js +60 -0
  10. package/lib/validate.js +147 -0
  11. package/package.json +59 -0
  12. package/templates/CLAUDE.md.template +235 -0
  13. package/templates/base/README.md +257 -0
  14. package/templates/base/RPI_WORKFLOW_PLAN.md +320 -0
  15. package/templates/base/agents/api-developer.md +76 -0
  16. package/templates/base/agents/context-engineer.md +525 -0
  17. package/templates/base/agents/core-architect.md +76 -0
  18. package/templates/base/agents/database-ops.md +76 -0
  19. package/templates/base/agents/deployment-ops.md +76 -0
  20. package/templates/base/agents/integration-hub.md +76 -0
  21. package/templates/base/analytics/README.md +114 -0
  22. package/templates/base/ci-templates/README.md +108 -0
  23. package/templates/base/ci-templates/github-actions/context-check.yml +144 -0
  24. package/templates/base/ci-templates/github-actions/validate-docs.yml +105 -0
  25. package/templates/base/commands/analytics.md +238 -0
  26. package/templates/base/commands/collab.md +194 -0
  27. package/templates/base/commands/help.md +450 -0
  28. package/templates/base/commands/rpi-implement.md +115 -0
  29. package/templates/base/commands/rpi-plan.md +93 -0
  30. package/templates/base/commands/rpi-research.md +88 -0
  31. package/templates/base/commands/validate-all.md +77 -0
  32. package/templates/base/commands/verify-docs-current.md +86 -0
  33. package/templates/base/config/base.json +57 -0
  34. package/templates/base/config/environments/development.json +13 -0
  35. package/templates/base/config/environments/production.json +17 -0
  36. package/templates/base/config/environments/staging.json +13 -0
  37. package/templates/base/config/local.json.example +21 -0
  38. package/templates/base/context/ARCHITECTURE_SNAPSHOT.md +156 -0
  39. package/templates/base/context/CODE_TO_WORKFLOW_MAP.md +94 -0
  40. package/templates/base/context/KNOWN_GOTCHAS.md +195 -0
  41. package/templates/base/context/WORKFLOW_INDEX.md +129 -0
  42. package/templates/base/context/workflows/WORKFLOW_TEMPLATE.md +294 -0
  43. package/templates/base/indexes/agents/CAPABILITY_MATRIX.md +255 -0
  44. package/templates/base/indexes/agents/CATEGORY_INDEX.md +44 -0
  45. package/templates/base/indexes/code/CATEGORY_INDEX.md +38 -0
  46. package/templates/base/indexes/routing/CATEGORY_INDEX.md +39 -0
  47. package/templates/base/indexes/search/CATEGORY_INDEX.md +39 -0
  48. package/templates/base/indexes/workflows/CATEGORY_INDEX.md +38 -0
  49. package/templates/base/knowledge/README.md +98 -0
  50. package/templates/base/knowledge/sessions/README.md +88 -0
  51. package/templates/base/knowledge/sessions/TEMPLATE.md +150 -0
  52. package/templates/base/knowledge/shared/decisions/0001-adopt-context-engineering.md +144 -0
  53. package/templates/base/knowledge/shared/decisions/README.md +49 -0
  54. package/templates/base/knowledge/shared/decisions/TEMPLATE.md +123 -0
  55. package/templates/base/knowledge/shared/patterns/README.md +62 -0
  56. package/templates/base/knowledge/shared/patterns/TEMPLATE.md +120 -0
  57. package/templates/base/plans/PLAN_TEMPLATE.md +250 -0
  58. package/templates/base/plans/active/.gitkeep +0 -0
  59. package/templates/base/plans/completed/.gitkeep +0 -0
  60. package/templates/base/research/RESEARCH_TEMPLATE.md +153 -0
  61. package/templates/base/research/active/.gitkeep +0 -0
  62. package/templates/base/research/completed/.gitkeep +0 -0
  63. package/templates/base/schemas/agent.schema.json +141 -0
  64. package/templates/base/schemas/command.schema.json +134 -0
  65. package/templates/base/schemas/manifest.schema.json +117 -0
  66. package/templates/base/schemas/plan.schema.json +136 -0
  67. package/templates/base/schemas/research.schema.json +115 -0
  68. package/templates/base/schemas/settings.schema.json +244 -0
  69. package/templates/base/schemas/workflow.schema.json +126 -0
  70. package/templates/base/settings.json +57 -0
  71. package/templates/base/standards/COMPATIBILITY.md +219 -0
  72. package/templates/base/standards/EXTENSION_GUIDELINES.md +280 -0
  73. package/templates/base/standards/QUALITY_CHECKLIST.md +211 -0
  74. package/templates/base/standards/README.md +66 -0
  75. package/templates/base/team/README.md +168 -0
  76. package/templates/base/team/config.json +79 -0
  77. package/templates/base/team/roles.json +145 -0
  78. package/templates/base/tools/bin/claude-context.js +151 -0
  79. package/templates/base/tools/lib/config-loader.js +363 -0
  80. package/templates/base/tools/lib/detector.js +350 -0
  81. package/templates/base/tools/lib/diagnose.js +206 -0
  82. package/templates/base/tools/lib/errors.js +199 -0
  83. package/templates/base/tools/lib/index.js +24 -0
  84. package/templates/base/tools/lib/init.js +192 -0
  85. package/templates/base/tools/lib/logger.js +230 -0
  86. package/templates/base/tools/lib/placeholder.js +201 -0
  87. package/templates/base/tools/lib/validate.js +521 -0
  88. package/templates/base/tools/package.json +49 -0
@@ -0,0 +1,238 @@
1
+ ---
2
+ name: analytics
3
+ version: "1.0.0"
4
+ displayName: "Usage Analytics"
5
+ description: "View local usage statistics and context metrics"
6
+ category: "system"
7
+ complexity: "low"
8
+ context_budget: "~5K tokens"
9
+ typical_context_usage: "2%"
10
+ prerequisites:
11
+ - "Analytics enabled in settings (optional)"
12
+ outputs:
13
+ - "Usage statistics report"
14
+ - "Context metrics summary"
15
+ - "Exported metrics file (with --export)"
16
+ related_agents: []
17
+ examples:
18
+ - command: "/analytics"
19
+ description: "View local usage statistics"
20
+ - command: "/analytics context"
21
+ description: "Show context budget metrics"
22
+ - command: "/analytics export"
23
+ description: "Export metrics to JSON file"
24
+ ---
25
+
26
+ # /analytics - Usage Analytics Command
27
+
28
+ View local usage statistics, context metrics, and export data for analysis.
29
+
30
+ ## Privacy First
31
+
32
+ **All analytics are local by default.** No data is sent externally unless explicitly configured in `.claude/settings.json`:
33
+
34
+ ```json
35
+ {
36
+ "telemetry": {
37
+ "enabled": false
38
+ }
39
+ }
40
+ ```
41
+
42
+ ## Subcommands
43
+
44
+ ### `/analytics` (default)
45
+
46
+ Display summary of local usage statistics.
47
+
48
+ **Metrics Shown:**
49
+ - Session count (last 7/30 days)
50
+ - Command usage frequency
51
+ - Agent invocation counts
52
+ - Average session duration
53
+ - Files modified per session
54
+
55
+ ### `/analytics context`
56
+
57
+ Show context budget metrics and trends.
58
+
59
+ **Metrics Shown:**
60
+ - Current documentation size (tokens)
61
+ - Budget utilization percentage
62
+ - Largest context consumers
63
+ - Token trend over time
64
+ - Recommendations for optimization
65
+
66
+ ### `/analytics commands`
67
+
68
+ Show command usage breakdown.
69
+
70
+ **Metrics Shown:**
71
+ - Most used commands
72
+ - Command success/failure rates
73
+ - Average command duration
74
+ - Command usage by day/week
75
+
76
+ ### `/analytics agents`
77
+
78
+ Show agent utilization breakdown.
79
+
80
+ **Metrics Shown:**
81
+ - Most invoked agents
82
+ - Agent task completion rates
83
+ - Average context per agent
84
+ - Agent usage patterns
85
+
86
+ ### `/analytics export`
87
+
88
+ Export metrics to JSON file.
89
+
90
+ **Output:** `.claude/analytics/export-YYYY-MM-DD.json`
91
+
92
+ ### `/analytics clear`
93
+
94
+ Clear local analytics data.
95
+
96
+ **Confirmation required** before clearing.
97
+
98
+ ## Usage Examples
99
+
100
+ ### View Summary Statistics
101
+
102
+ ```
103
+ User: /analytics
104
+
105
+ Claude: ## Usage Analytics (Local)
106
+
107
+ ### Session Summary (Last 30 Days)
108
+ | Metric | Value |
109
+ |--------|-------|
110
+ | Total Sessions | 42 |
111
+ | Avg Duration | 45 min |
112
+ | Files Modified | 312 |
113
+ | Commits Made | 87 |
114
+
115
+ ### Top Commands
116
+ 1. /rpi-research (23 uses)
117
+ 2. /rpi-implement (19 uses)
118
+ 3. /verify-docs-current (15 uses)
119
+ 4. /rpi-plan (12 uses)
120
+ 5. /help (8 uses)
121
+
122
+ ### Top Agents
123
+ 1. @core-architect (18 invocations)
124
+ 2. @api-developer (14 invocations)
125
+ 3. @database-ops (9 invocations)
126
+
127
+ ### Context Health
128
+ - Documentation: 45K tokens (23% of budget)
129
+ - Status: Healthy ✓
130
+
131
+ Data stored locally in .claude/analytics/
132
+ ```
133
+
134
+ ### View Context Metrics
135
+
136
+ ```
137
+ User: /analytics context
138
+
139
+ Claude: ## Context Budget Analysis
140
+
141
+ ### Current State
142
+ | Category | Tokens | % Budget |
143
+ |----------|--------|----------|
144
+ | Indexes | 12,400 | 6.2% |
145
+ | Workflows | 18,200 | 9.1% |
146
+ | Agents | 8,600 | 4.3% |
147
+ | Commands | 5,800 | 2.9% |
148
+ | **Total** | **45,000** | **22.5%** |
149
+
150
+ ### Budget Status
151
+ ✓ Under 40% target (healthy)
152
+
153
+ ### Largest Files
154
+ 1. context/workflows/authentication.md (4,200 tokens)
155
+ 2. context/ARCHITECTURE_SNAPSHOT.md (3,800 tokens)
156
+ 3. agents/core-architect.md (2,100 tokens)
157
+
158
+ ### Trend (Last 4 Weeks)
159
+ Week 1: 42K tokens
160
+ Week 2: 43K tokens
161
+ Week 3: 44K tokens
162
+ Week 4: 45K tokens (+7% growth)
163
+
164
+ ### Recommendations
165
+ - Growth rate sustainable
166
+ - No immediate action needed
167
+ - Review if exceeds 50K tokens
168
+ ```
169
+
170
+ ### Export Metrics
171
+
172
+ ```
173
+ User: /analytics export
174
+
175
+ Claude: Exporting analytics data...
176
+
177
+ Exported to: .claude/analytics/export-2024-01-15.json
178
+
179
+ Contents:
180
+ - Session history (42 sessions)
181
+ - Command usage (156 invocations)
182
+ - Agent usage (41 invocations)
183
+ - Context metrics (4 weekly snapshots)
184
+
185
+ File size: 24 KB
186
+ ```
187
+
188
+ ## Data Storage
189
+
190
+ Analytics data is stored locally in `.claude/analytics/`:
191
+
192
+ ```
193
+ .claude/analytics/
194
+ ├── sessions.json # Session history
195
+ ├── commands.json # Command usage
196
+ ├── agents.json # Agent invocations
197
+ ├── context.json # Context metrics
198
+ └── exports/ # Exported files
199
+ ```
200
+
201
+ ## Configuration
202
+
203
+ Configure analytics behavior in `.claude/settings.json`:
204
+
205
+ ```json
206
+ {
207
+ "telemetry": {
208
+ "enabled": false,
209
+ "events": {
210
+ "command_usage": true,
211
+ "context_metrics": true,
212
+ "error_reports": false
213
+ },
214
+ "retention_days": 90
215
+ }
216
+ }
217
+ ```
218
+
219
+ | Setting | Default | Description |
220
+ |---------|---------|-------------|
221
+ | `enabled` | false | Enable/disable all tracking |
222
+ | `command_usage` | true | Track command invocations |
223
+ | `context_metrics` | true | Track context budget |
224
+ | `error_reports` | false | Track errors (local only) |
225
+ | `retention_days` | 90 | Days to retain data |
226
+
227
+ ## Privacy Notes
228
+
229
+ 1. **Local Only**: All data stays on your machine
230
+ 2. **No External Calls**: Nothing sent to external services
231
+ 3. **User Control**: Clear data anytime with `/analytics clear`
232
+ 4. **Opt-in**: Tracking disabled by default
233
+ 5. **Transparent**: All data in readable JSON files
234
+
235
+ ## Related
236
+
237
+ - [Settings Configuration](./../settings.json)
238
+ - [Context Budget Guidelines](./../README.md#context-budget)
@@ -0,0 +1,194 @@
1
+ ---
2
+ name: collab
3
+ version: "1.0.0"
4
+ displayName: "Team Collaboration"
5
+ description: "Team collaboration tools for handoffs, knowledge sync, and status"
6
+ category: "team"
7
+ complexity: "low"
8
+ context_budget: "~10K tokens"
9
+ typical_context_usage: "5%"
10
+ prerequisites:
11
+ - ".claude/team/config.json exists"
12
+ - "Team configuration completed"
13
+ outputs:
14
+ - "Session handoff document (handoff)"
15
+ - "Sync status report (sync)"
16
+ - "Team status overview (status)"
17
+ related_agents: []
18
+ examples:
19
+ - command: "/collab handoff"
20
+ description: "Create session handoff for next team member"
21
+ - command: "/collab sync"
22
+ description: "Synchronize shared knowledge base"
23
+ - command: "/collab status"
24
+ description: "View team configuration and status"
25
+ ---
26
+
27
+ # /collab - Team Collaboration Command
28
+
29
+ Manage team collaboration features including session handoffs, knowledge synchronization, and team status.
30
+
31
+ ## Subcommands
32
+
33
+ ### `/collab handoff`
34
+
35
+ Create a session handoff document for the next team member.
36
+
37
+ **Workflow:**
38
+ 1. Collect session information:
39
+ - Files modified in session
40
+ - Git status and recent commits
41
+ - Open tasks and blockers
42
+ 2. Prompt for additional context:
43
+ - Work in progress description
44
+ - Blockers encountered
45
+ - Recommended next steps
46
+ 3. Generate handoff document from template
47
+ 4. Save to `.claude/knowledge/sessions/`
48
+ 5. Display handoff summary
49
+
50
+ **Output:** `.claude/knowledge/sessions/YYYY-MM-DD-HH-MM-{member-id}.md`
51
+
52
+ ### `/collab sync`
53
+
54
+ Synchronize and validate the shared knowledge base.
55
+
56
+ **Workflow:**
57
+ 1. Scan knowledge directories:
58
+ - `shared/decisions/` - ADRs
59
+ - `shared/patterns/` - Patterns
60
+ - `sessions/` - Recent handoffs
61
+ 2. Validate document structure
62
+ 3. Check for stale content (>30 days unchanged)
63
+ 4. Report sync status:
64
+ - Documents found
65
+ - Validation issues
66
+ - Stale content warnings
67
+ 5. Optionally notify team of updates
68
+
69
+ **Output:** Sync status report to console
70
+
71
+ ### `/collab status`
72
+
73
+ Display team configuration and current status.
74
+
75
+ **Workflow:**
76
+ 1. Load team configuration from `.claude/team/config.json`
77
+ 2. Display:
78
+ - Team name and organization
79
+ - Active members and roles
80
+ - Current policies
81
+ - Integration status
82
+ 3. Check for configuration issues
83
+ 4. Show recent activity summary
84
+
85
+ **Output:** Team status report to console
86
+
87
+ ## Usage Examples
88
+
89
+ ### End of Session Handoff
90
+
91
+ ```
92
+ User: /collab handoff
93
+
94
+ Claude: Creating session handoff...
95
+
96
+ ## Session Summary
97
+ Please describe what you worked on this session:
98
+
99
+ User: Implemented user authentication flow, added login/logout endpoints
100
+
101
+ Claude: ## Work In Progress
102
+ Any incomplete work to note?
103
+
104
+ User: JWT refresh token logic needs testing
105
+
106
+ Claude: ## Blockers
107
+ Any blockers for the next person?
108
+
109
+ User: None
110
+
111
+ Claude: ## Next Steps
112
+ Recommended priorities for next session?
113
+
114
+ User: 1. Test refresh tokens 2. Add password reset
115
+
116
+ Claude: Session handoff created: .claude/knowledge/sessions/2024-01-15-16-30-dev-1.md
117
+
118
+ ### Handoff Summary
119
+ - Session: 2024-01-15 16:30
120
+ - Files Modified: 8
121
+ - Commits: 3
122
+ - Status: Ready for handoff
123
+
124
+ The next team member can review this handoff to continue your work.
125
+ ```
126
+
127
+ ### Sync Knowledge Base
128
+
129
+ ```
130
+ User: /collab sync
131
+
132
+ Claude: Synchronizing knowledge base...
133
+
134
+ ### Scan Results
135
+ - ADRs: 3 documents
136
+ - Patterns: 5 documents
137
+ - Sessions: 12 handoffs
138
+
139
+ ### Validation
140
+ ✓ All ADRs have required sections
141
+ ✓ All patterns follow template
142
+ ⚠ 2 session handoffs > 30 days old
143
+
144
+ ### Recommendations
145
+ - Archive or delete old handoffs:
146
+ - sessions/2023-12-01-14-00-dev-2.md
147
+ - sessions/2023-12-05-09-15-dev-1.md
148
+
149
+ Knowledge base sync complete.
150
+ ```
151
+
152
+ ### Check Team Status
153
+
154
+ ```
155
+ User: /collab status
156
+
157
+ Claude: ## Team Status
158
+
159
+ ### Configuration
160
+ - Team: Engineering Team
161
+ - Organization: Acme Corp
162
+ - Version: 1.0.0
163
+
164
+ ### Members (3 active)
165
+ | Name | Role | Status |
166
+ |------|------|--------|
167
+ | Alice | team-lead | active |
168
+ | Bob | developer | active |
169
+ | Carol | developer | active |
170
+
171
+ ### Policies
172
+ - Code review required: Yes
173
+ - Documentation updates required: Yes
174
+ - Test coverage minimum: 80%
175
+
176
+ ### Integrations
177
+ - Slack: Configured ✓
178
+ - Jira: Not configured
179
+ - Confluence: Not configured
180
+
181
+ ### Recent Activity
182
+ - Last handoff: 2024-01-15 by Bob
183
+ - Knowledge updates: 2 this week
184
+ ```
185
+
186
+ ## Configuration
187
+
188
+ Requires `.claude/team/config.json` to be configured. See `.claude/team/README.md` for setup instructions.
189
+
190
+ ## Related
191
+
192
+ - [Team Configuration](./../team/README.md)
193
+ - [Knowledge Base](./../knowledge/README.md)
194
+ - [Session Handoff Template](./../knowledge/sessions/TEMPLATE.md)