@qazuor/claude-code-config 0.1.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 (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1248 -0
  3. package/dist/bin.cjs +11886 -0
  4. package/dist/bin.cjs.map +1 -0
  5. package/dist/bin.d.cts +1 -0
  6. package/dist/bin.d.ts +1 -0
  7. package/dist/bin.js +11869 -0
  8. package/dist/bin.js.map +1 -0
  9. package/dist/index.cjs +3887 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.cts +1325 -0
  12. package/dist/index.d.ts +1325 -0
  13. package/dist/index.js +3835 -0
  14. package/dist/index.js.map +1 -0
  15. package/package.json +86 -0
  16. package/templates/.log/notifications.log +1775 -0
  17. package/templates/agents/README.md +164 -0
  18. package/templates/agents/_registry.json +443 -0
  19. package/templates/agents/design/content-writer.md +353 -0
  20. package/templates/agents/design/ux-ui-designer.md +382 -0
  21. package/templates/agents/engineering/astro-engineer.md +293 -0
  22. package/templates/agents/engineering/db-drizzle-engineer.md +360 -0
  23. package/templates/agents/engineering/express-engineer.md +316 -0
  24. package/templates/agents/engineering/fastify-engineer.md +399 -0
  25. package/templates/agents/engineering/hono-engineer.md +263 -0
  26. package/templates/agents/engineering/mongoose-engineer.md +473 -0
  27. package/templates/agents/engineering/nestjs-engineer.md +429 -0
  28. package/templates/agents/engineering/nextjs-engineer.md +451 -0
  29. package/templates/agents/engineering/node-typescript-engineer.md +347 -0
  30. package/templates/agents/engineering/prisma-engineer.md +432 -0
  31. package/templates/agents/engineering/react-senior-dev.md +394 -0
  32. package/templates/agents/engineering/tanstack-start-engineer.md +447 -0
  33. package/templates/agents/engineering/tech-lead.md +269 -0
  34. package/templates/agents/product/product-functional.md +329 -0
  35. package/templates/agents/product/product-technical.md +578 -0
  36. package/templates/agents/quality/debugger.md +514 -0
  37. package/templates/agents/quality/qa-engineer.md +390 -0
  38. package/templates/agents/specialized/enrichment-agent.md +277 -0
  39. package/templates/agents/specialized/i18n-specialist.md +322 -0
  40. package/templates/agents/specialized/seo-ai-specialist.md +387 -0
  41. package/templates/agents/specialized/tech-writer.md +300 -0
  42. package/templates/code-style/.editorconfig +27 -0
  43. package/templates/code-style/.prettierignore +25 -0
  44. package/templates/code-style/.prettierrc +12 -0
  45. package/templates/code-style/biome.json +78 -0
  46. package/templates/code-style/commitlint.config.js +44 -0
  47. package/templates/commands/README.md +175 -0
  48. package/templates/commands/_registry.json +420 -0
  49. package/templates/commands/add-new-entity.md +211 -0
  50. package/templates/commands/audit/accessibility-audit.md +360 -0
  51. package/templates/commands/audit/performance-audit.md +290 -0
  52. package/templates/commands/audit/security-audit.md +231 -0
  53. package/templates/commands/code-check.md +127 -0
  54. package/templates/commands/five-why.md +225 -0
  55. package/templates/commands/formatting/format-markdown.md +197 -0
  56. package/templates/commands/git/commit.md +247 -0
  57. package/templates/commands/meta/create-agent.md +257 -0
  58. package/templates/commands/meta/create-command.md +312 -0
  59. package/templates/commands/meta/create-skill.md +321 -0
  60. package/templates/commands/meta/help.md +318 -0
  61. package/templates/commands/planning/check-completed-tasks.md +224 -0
  62. package/templates/commands/planning/cleanup-issues.md +248 -0
  63. package/templates/commands/planning/planning-cleanup.md +251 -0
  64. package/templates/commands/planning/sync-planning-github.md +133 -0
  65. package/templates/commands/planning/sync-todos-github.md +203 -0
  66. package/templates/commands/quality-check.md +211 -0
  67. package/templates/commands/run-tests.md +159 -0
  68. package/templates/commands/start-feature-plan.md +232 -0
  69. package/templates/commands/start-refactor-plan.md +244 -0
  70. package/templates/commands/sync-planning.md +176 -0
  71. package/templates/commands/update-docs.md +242 -0
  72. package/templates/docs/CHECKPOINT-SYSTEM.md +504 -0
  73. package/templates/docs/INDEX.md +677 -0
  74. package/templates/docs/RECOMMENDED-HOOKS.md +415 -0
  75. package/templates/docs/_registry.json +329 -0
  76. package/templates/docs/diagrams/README.md +220 -0
  77. package/templates/docs/diagrams/agent-hierarchy.mmd +55 -0
  78. package/templates/docs/diagrams/documentation-map.mmd +61 -0
  79. package/templates/docs/diagrams/tools-relationship.mmd +55 -0
  80. package/templates/docs/diagrams/workflow-decision-tree.mmd +38 -0
  81. package/templates/docs/doc-sync.md +533 -0
  82. package/templates/docs/examples/end-to-end-workflow.md +1505 -0
  83. package/templates/docs/glossary.md +495 -0
  84. package/templates/docs/guides/mockup-prompt-engineering.md +644 -0
  85. package/templates/docs/guides/mockup-setup.md +737 -0
  86. package/templates/docs/learnings/README.md +250 -0
  87. package/templates/docs/learnings/common-architectural-patterns.md +123 -0
  88. package/templates/docs/learnings/common-mistakes-to-avoid.md +149 -0
  89. package/templates/docs/learnings/markdown-formatting-standards.md +104 -0
  90. package/templates/docs/learnings/monorepo-command-execution.md +64 -0
  91. package/templates/docs/learnings/optimization-tips.md +146 -0
  92. package/templates/docs/learnings/planning-linear-sync-workflow.md +70 -0
  93. package/templates/docs/learnings/shell-compatibility-fish.md +46 -0
  94. package/templates/docs/learnings/test-organization-structure.md +68 -0
  95. package/templates/docs/mcp-installation.md +613 -0
  96. package/templates/docs/mcp-servers.md +989 -0
  97. package/templates/docs/notification-installation.md +570 -0
  98. package/templates/docs/quick-start.md +354 -0
  99. package/templates/docs/standards/architecture-patterns.md +1064 -0
  100. package/templates/docs/standards/atomic-commits.md +513 -0
  101. package/templates/docs/standards/code-standards.md +993 -0
  102. package/templates/docs/standards/design-standards.md +656 -0
  103. package/templates/docs/standards/documentation-standards.md +1160 -0
  104. package/templates/docs/standards/testing-standards.md +969 -0
  105. package/templates/docs/system-maintenance.md +604 -0
  106. package/templates/docs/templates/PDR-template.md +561 -0
  107. package/templates/docs/templates/TODOs-template.md +534 -0
  108. package/templates/docs/templates/tech-analysis-template.md +800 -0
  109. package/templates/docs/workflows/README.md +519 -0
  110. package/templates/docs/workflows/atomic-task-protocol.md +955 -0
  111. package/templates/docs/workflows/decision-tree.md +482 -0
  112. package/templates/docs/workflows/edge-cases.md +856 -0
  113. package/templates/docs/workflows/phase-1-planning.md +957 -0
  114. package/templates/docs/workflows/phase-2-implementation.md +896 -0
  115. package/templates/docs/workflows/phase-3-validation.md +792 -0
  116. package/templates/docs/workflows/phase-4-finalization.md +927 -0
  117. package/templates/docs/workflows/quick-fix-protocol.md +505 -0
  118. package/templates/docs/workflows/task-atomization.md +537 -0
  119. package/templates/docs/workflows/task-completion-protocol.md +448 -0
  120. package/templates/hooks/on-notification.sh +28 -0
  121. package/templates/schemas/checkpoint.schema.json +97 -0
  122. package/templates/schemas/code-registry.schema.json +84 -0
  123. package/templates/schemas/pdr.schema.json +314 -0
  124. package/templates/schemas/problems.schema.json +55 -0
  125. package/templates/schemas/tech-analysis.schema.json +404 -0
  126. package/templates/schemas/telemetry.schema.json +298 -0
  127. package/templates/schemas/todos.schema.json +234 -0
  128. package/templates/schemas/workflows.schema.json +69 -0
  129. package/templates/scripts/add-changelogs.sh +105 -0
  130. package/templates/scripts/generate-code-registry.ts +270 -0
  131. package/templates/scripts/health-check.sh +343 -0
  132. package/templates/scripts/sync-registry.sh +40 -0
  133. package/templates/scripts/telemetry-report.ts +36 -0
  134. package/templates/scripts/validate-docs.sh +224 -0
  135. package/templates/scripts/validate-registry.sh +225 -0
  136. package/templates/scripts/validate-schemas.ts +283 -0
  137. package/templates/scripts/validate-structure.sh +165 -0
  138. package/templates/scripts/worktree-cleanup.sh +81 -0
  139. package/templates/scripts/worktree-create.sh +63 -0
  140. package/templates/sessions/planning/.gitkeep +0 -0
  141. package/templates/sessions/planning/archived/.gitkeep +0 -0
  142. package/templates/settings.json +202 -0
  143. package/templates/settings.local.json +138 -0
  144. package/templates/skills/README.md +197 -0
  145. package/templates/skills/_registry.json +473 -0
  146. package/templates/skills/audit/accessibility-audit.md +309 -0
  147. package/templates/skills/audit/performance-audit.md +257 -0
  148. package/templates/skills/audit/security-audit.md +217 -0
  149. package/templates/skills/auth/nextauth-patterns.md +308 -0
  150. package/templates/skills/brand-guidelines.md +240 -0
  151. package/templates/skills/documentation/markdown-formatter.md +302 -0
  152. package/templates/skills/git/git-commit-helper.md +321 -0
  153. package/templates/skills/i18n/i18n-patterns.md +251 -0
  154. package/templates/skills/patterns/error-handling-patterns.md +242 -0
  155. package/templates/skills/patterns/tdd-methodology.md +342 -0
  156. package/templates/skills/qa/qa-criteria-validator.md +383 -0
  157. package/templates/skills/qa/web-app-testing.md +398 -0
  158. package/templates/skills/react/react-hook-form-patterns.md +359 -0
  159. package/templates/skills/state/redux-toolkit-patterns.md +272 -0
  160. package/templates/skills/state/tanstack-query-patterns.md +299 -0
  161. package/templates/skills/state/zustand-patterns.md +301 -0
  162. package/templates/skills/tech/mermaid-diagram-specialist.md +195 -0
  163. package/templates/skills/tech/shadcn-specialist.md +252 -0
  164. package/templates/skills/tech/vercel-specialist.md +297 -0
  165. package/templates/skills/testing/api-app-testing.md +254 -0
  166. package/templates/skills/testing/performance-testing.md +275 -0
  167. package/templates/skills/testing/security-testing.md +348 -0
  168. package/templates/skills/utils/add-memory.md +295 -0
  169. package/templates/skills/utils/json-data-auditor.md +283 -0
  170. package/templates/skills/utils/pdf-creator-editor.md +342 -0
  171. package/templates/tools/format-markdown.sh +185 -0
@@ -0,0 +1,343 @@
1
+ #!/bin/bash
2
+ # Health Check System for Project
3
+ # Validates system integrity and configuration
4
+ #
5
+ # Exit codes:
6
+ # 0 - All checks passed
7
+ # 1 - Warnings detected (non-critical issues)
8
+ # 2 - Errors detected (critical issues)
9
+
10
+ set -e # Exit on error (except for checks)
11
+
12
+ # Colors for output
13
+ RED='\033[0;31m'
14
+ YELLOW='\033[1;33m'
15
+ GREEN='\033[0;32m'
16
+ BLUE='\033[0;34m'
17
+ NC='\033[0m' # No Color
18
+
19
+ # Counters
20
+ ERRORS=0
21
+ WARNINGS=0
22
+ CHECKS=0
23
+
24
+ # Helper functions
25
+ error() {
26
+ echo -e "${RED}❌ ERROR: $1${NC}"
27
+ ERRORS=$((ERRORS + 1))
28
+ }
29
+
30
+ warning() {
31
+ echo -e "${YELLOW}⚠️ WARNING: $1${NC}"
32
+ WARNINGS=$((WARNINGS + 1))
33
+ }
34
+
35
+ success() {
36
+ echo -e "${GREEN}✅ $1${NC}"
37
+ }
38
+
39
+ info() {
40
+ echo -e "${BLUE}ℹ️ $1${NC}"
41
+ }
42
+
43
+ check_start() {
44
+ CHECKS=$((CHECKS + 1))
45
+ echo -e "\n${BLUE}━━━ Check $CHECKS: $1 ━━━${NC}"
46
+ }
47
+
48
+ # Change to project root
49
+ cd "$(dirname "$0")/../.."
50
+
51
+ echo -e "${BLUE}╔══════════════════════════════════════════════════╗${NC}"
52
+ echo -e "${BLUE}║ Project System Health Check v1.0 ║${NC}"
53
+ echo -e "${BLUE}╚══════════════════════════════════════════════════╝${NC}"
54
+ echo ""
55
+ echo "🔍 Running comprehensive system health checks..."
56
+ echo ""
57
+
58
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
59
+ # Check 1: File Counts
60
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61
+ check_start "File Counts"
62
+
63
+ agent_count=$(find .claude/agents -name "*.md" -type f ! -name "README.md" 2>/dev/null | wc -l)
64
+ command_count=$(find .claude/commands -name "*.md" -type f ! -name "README.md" 2>/dev/null | wc -l)
65
+ skill_count=$(find .claude/skills -name "*.md" -type f ! -name "README.md" 2>/dev/null | wc -l)
66
+ learning_count=$(find .claude/docs/learnings -name "*.md" -type f ! -name "README.md" 2>/dev/null | wc -l)
67
+ workflow_count=$(find .claude/docs/workflows -name "*.md" -type f ! -name "README.md" 2>/dev/null | wc -l)
68
+ diagram_count=$(find .claude/docs/diagrams -name "*.mmd" -type f 2>/dev/null | wc -l)
69
+
70
+ echo "📊 System component counts:"
71
+ echo " Agents: $agent_count (expected: 15)"
72
+ echo " Commands: $command_count (expected: 23)"
73
+ echo " Skills: $skill_count (expected: 19)"
74
+ echo " Learnings: $learning_count (expected: 8)"
75
+ echo " Workflows: $workflow_count (expected: 10)"
76
+ echo " Diagrams: $diagram_count (expected: 4)"
77
+
78
+ # Validate counts
79
+ ALL_COUNTS_MATCH=true
80
+
81
+ if [ "$agent_count" -ne 15 ]; then
82
+ error "Agent count mismatch: found $agent_count, expected 15"
83
+ ALL_COUNTS_MATCH=false
84
+ fi
85
+
86
+ if [ "$command_count" -ne 23 ]; then
87
+ error "Command count mismatch: found $command_count, expected 23"
88
+ ALL_COUNTS_MATCH=false
89
+ fi
90
+
91
+ if [ "$skill_count" -ne 19 ]; then
92
+ error "Skill count mismatch: found $skill_count, expected 19"
93
+ ALL_COUNTS_MATCH=false
94
+ fi
95
+
96
+ if [ "$learning_count" -ne 8 ]; then
97
+ error "Learning count mismatch: found $learning_count, expected 8"
98
+ ALL_COUNTS_MATCH=false
99
+ fi
100
+
101
+ if [ "$workflow_count" -ne 10 ]; then
102
+ warning "Workflow count mismatch: found $workflow_count, expected 10"
103
+ ALL_COUNTS_MATCH=false
104
+ fi
105
+
106
+ if [ "$diagram_count" -ne 4 ]; then
107
+ warning "Diagram count mismatch: found $diagram_count, expected 4"
108
+ ALL_COUNTS_MATCH=false
109
+ fi
110
+
111
+ if [ "$ALL_COUNTS_MATCH" = true ]; then
112
+ success "All file counts match expected values"
113
+ fi
114
+
115
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
116
+ # Check 2: Code Registry
117
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
+ check_start "Code Registry"
119
+
120
+ REGISTRY_FILE=".claude/sessions/planning/.code-registry.json"
121
+
122
+ if [ ! -f "$REGISTRY_FILE" ]; then
123
+ warning "Code registry not found at $REGISTRY_FILE"
124
+ info "Run 'pnpm planning:sync <session-path>' to generate it"
125
+ else
126
+ # Validate JSON
127
+ if ! jq empty "$REGISTRY_FILE" 2>/dev/null; then
128
+ error "Code registry is not valid JSON"
129
+ else
130
+ TOTAL_SESSIONS=$(jq '.plannings | length // 0' "$REGISTRY_FILE" 2>/dev/null || echo "0")
131
+ TOTAL_TASKS=$(jq '[.plannings[]] | add // 0' "$REGISTRY_FILE" 2>/dev/null || echo "0")
132
+ GENERATED_AT=$(jq -r '.generatedAt // "unknown"' "$REGISTRY_FILE" 2>/dev/null || echo "unknown")
133
+
134
+ echo " Sessions: $TOTAL_SESSIONS"
135
+ echo " Tasks: $TOTAL_TASKS"
136
+ echo " Last updated: $GENERATED_AT"
137
+
138
+ # Check staleness (7 days)
139
+ if [ "$GENERATED_AT" != "unknown" ]; then
140
+ CURRENT_TIME=$(date +%s)
141
+ REGISTRY_TIME=$(date -d "$GENERATED_AT" +%s 2>/dev/null || echo "0")
142
+ TIME_DIFF=$((CURRENT_TIME - REGISTRY_TIME))
143
+ DAYS_OLD=$((TIME_DIFF / 86400))
144
+
145
+ if [ $DAYS_OLD -gt 7 ]; then
146
+ warning "Code registry is $DAYS_OLD days old (consider updating)"
147
+ else
148
+ success "Code registry is valid and up-to-date"
149
+ fi
150
+ fi
151
+ fi
152
+ fi
153
+
154
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
155
+ # Check 3: Git Hooks Configuration
156
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
157
+ check_start "Git Hooks"
158
+
159
+ HOOKS_CONFIGURED=0
160
+
161
+ if [ -d ".husky" ]; then
162
+ echo "📁 Husky directory found"
163
+
164
+ # Check for required hooks
165
+ if [ -f ".husky/pre-commit" ] && [ -x ".husky/pre-commit" ]; then
166
+ echo " ✓ pre-commit hook configured"
167
+ HOOKS_CONFIGURED=$((HOOKS_CONFIGURED + 1))
168
+ else
169
+ warning "pre-commit hook missing or not executable"
170
+ fi
171
+
172
+ if [ -f ".husky/commit-msg" ] && [ -x ".husky/commit-msg" ]; then
173
+ echo " ✓ commit-msg hook configured"
174
+ HOOKS_CONFIGURED=$((HOOKS_CONFIGURED + 1))
175
+ else
176
+ warning "commit-msg hook missing or not executable"
177
+ fi
178
+
179
+ if [ -f ".husky/post-checkout" ] && [ -x ".husky/post-checkout" ]; then
180
+ echo " ✓ post-checkout hook configured"
181
+ HOOKS_CONFIGURED=$((HOOKS_CONFIGURED + 1))
182
+ else
183
+ warning "post-checkout hook missing or not executable"
184
+ fi
185
+
186
+ if [ -f ".huskyrc" ]; then
187
+ echo " ✓ .huskyrc configuration found"
188
+ else
189
+ warning ".huskyrc configuration file not found"
190
+ fi
191
+
192
+ if [ $HOOKS_CONFIGURED -eq 3 ]; then
193
+ success "All Git hooks properly configured"
194
+ else
195
+ warning "Only $HOOKS_CONFIGURED/3 hooks configured"
196
+ fi
197
+ else
198
+ error "Husky not configured (.husky directory missing)"
199
+ fi
200
+
201
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
202
+ # Check 4: Core Documentation Files
203
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
204
+ check_start "Core Documentation"
205
+
206
+ REQUIRED_FILES=(
207
+ "CLAUDE.md"
208
+ ".claude/docs/INDEX.md"
209
+ ".claude/docs/quick-start.md"
210
+ ".claude/docs/glossary.md"
211
+ ".claude/docs/RECOMMENDED-HOOKS.md"
212
+ ".claude/agents/README.md"
213
+ ".claude/commands/README.md"
214
+ ".claude/skills/README.md"
215
+ ".claude/docs/workflows/README.md"
216
+ ".claude/docs/learnings/README.md"
217
+ ".claude/docs/diagrams/README.md"
218
+ )
219
+
220
+ MISSING_FILES=0
221
+
222
+ for file in "${REQUIRED_FILES[@]}"; do
223
+ if [ ! -f "$file" ]; then
224
+ error "Required file missing: $file"
225
+ MISSING_FILES=$((MISSING_FILES + 1))
226
+ fi
227
+ done
228
+
229
+ if [ $MISSING_FILES -eq 0 ]; then
230
+ success "All ${#REQUIRED_FILES[@]} core documentation files exist"
231
+ else
232
+ error "$MISSING_FILES/${#REQUIRED_FILES[@]} core files missing"
233
+ fi
234
+
235
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
236
+ # Check 5: Recent Learnings Count
237
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
238
+ check_start "Recent Learnings"
239
+
240
+ # Count "Recent Learnings" section in CLAUDE.md
241
+ if [ -f "CLAUDE.md" ]; then
242
+ # Count items under "Recent Learnings" (lines starting with ### after "Recent Learnings" heading)
243
+ RECENT_COUNT=$(awk '/^## .*Recent Learnings/,/^## / {if (/^###/) count++} END {print count+0}' CLAUDE.md)
244
+
245
+ echo " Recent learnings in CLAUDE.md: $RECENT_COUNT"
246
+
247
+ if [ "$RECENT_COUNT" -gt 10 ]; then
248
+ warning "Too many recent learnings ($RECENT_COUNT > 10) - archive older ones"
249
+ else
250
+ success "Recent learnings count within limit ($RECENT_COUNT ≤ 10)"
251
+ fi
252
+ else
253
+ error "CLAUDE.md not found"
254
+ fi
255
+
256
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
257
+ # Check 6: Validation Scripts
258
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
259
+ check_start "Validation Scripts"
260
+
261
+ # Check if package.json has validation scripts
262
+ if [ -f "package.json" ]; then
263
+ if grep -q '"format:md"' package.json; then
264
+ echo " ✓ format:md script found"
265
+ else
266
+ warning "format:md script not found in package.json"
267
+ fi
268
+
269
+ if grep -q '"format:md:claude"' package.json; then
270
+ echo " ✓ format:md:claude script found"
271
+ else
272
+ warning "format:md:claude script not found in package.json"
273
+ fi
274
+
275
+ if grep -q '"lint:md"' package.json; then
276
+ echo " ✓ lint:md script found"
277
+ else
278
+ warning "lint:md script not found in package.json"
279
+ fi
280
+
281
+ success "Validation scripts configured"
282
+ else
283
+ error "package.json not found"
284
+ fi
285
+
286
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
287
+ # Check 7: Active Planning Sessions
288
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
289
+ check_start "Active Planning Sessions"
290
+
291
+ CHECKPOINT_FILES=$(find .claude/sessions/planning -name ".checkpoint.json" 2>/dev/null)
292
+ CHECKPOINT_COUNT=$(echo "$CHECKPOINT_FILES" | grep -c . || echo "0")
293
+
294
+ if [ "$CHECKPOINT_COUNT" -gt 0 ]; then
295
+ echo " Found $CHECKPOINT_COUNT active planning sessions:"
296
+
297
+ for checkpoint in $CHECKPOINT_FILES; do
298
+ SESSION_DIR=$(dirname "$checkpoint")
299
+ SESSION_NAME=$(basename "$SESSION_DIR")
300
+ CURRENT_TASK=$(jq -r '.currentTask // "unknown"' "$checkpoint" 2>/dev/null)
301
+ TASKS_COMPLETED=$(jq -r '.tasksCompleted // 0' "$checkpoint" 2>/dev/null)
302
+ TOTAL_STEPS=$(jq -r '.totalSteps // 0' "$checkpoint" 2>/dev/null)
303
+
304
+ if [ "$TOTAL_STEPS" -gt 0 ]; then
305
+ PROGRESS=$(( (TASKS_COMPLETED * 100) / TOTAL_STEPS ))
306
+ echo " 📋 $SESSION_NAME: $CURRENT_TASK ($TASKS_COMPLETED/$TOTAL_STEPS - ${PROGRESS}%)"
307
+ else
308
+ echo " 📋 $SESSION_NAME: $CURRENT_TASK"
309
+ fi
310
+ done
311
+
312
+ success "Planning session tracking active"
313
+ else
314
+ info "No active planning sessions found"
315
+ fi
316
+
317
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
318
+ # Summary Report
319
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
320
+ echo ""
321
+ echo -e "${BLUE}╔══════════════════════════════════════════════════╗${NC}"
322
+ echo -e "${BLUE}║ Health Check Summary ║${NC}"
323
+ echo -e "${BLUE}╚══════════════════════════════════════════════════╝${NC}"
324
+ echo ""
325
+ echo " Total checks: $CHECKS"
326
+ echo -e " ${RED}Errors: $ERRORS${NC}"
327
+ echo -e " ${YELLOW}Warnings: $WARNINGS${NC}"
328
+ echo ""
329
+
330
+ # Exit with appropriate code
331
+ if [ $ERRORS -gt 0 ]; then
332
+ echo -e "${RED}❌ Health check FAILED - $ERRORS critical issue(s) detected${NC}"
333
+ echo ""
334
+ exit 2
335
+ elif [ $WARNINGS -gt 0 ]; then
336
+ echo -e "${YELLOW}⚠️ Health check PASSED with warnings - $WARNINGS non-critical issue(s)${NC}"
337
+ echo ""
338
+ exit 1
339
+ else
340
+ echo -e "${GREEN}✅ Health check PASSED - System is healthy!${NC}"
341
+ echo ""
342
+ exit 0
343
+ fi
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Code Registry Sync Script
4
+ #
5
+ # Regenerates .code-registry.json from all TODOs.md files in planning sessions.
6
+ # This ensures the registry stays in sync with the source of truth (TODOs.md).
7
+ #
8
+ # Exit codes:
9
+ # 0 - Registry synced successfully
10
+ # 1 - Sync failed
11
+ #
12
+
13
+ set -euo pipefail
14
+
15
+ # Colors for output
16
+ GREEN='\033[0;32m'
17
+ YELLOW='\033[1;33m'
18
+ BLUE='\033[0;34m'
19
+ NC='\033[0m' # No Color
20
+
21
+ echo -e "${BLUE}🔄 Syncing code registry from TODOs.md files...${NC}"
22
+ echo ""
23
+
24
+ # Check if generate-code-registry script exists
25
+ if [ ! -f ".claude/scripts/generate-code-registry.ts" ]; then
26
+ echo "❌ Error: .claude/scripts/generate-code-registry.ts not found"
27
+ exit 1
28
+ fi
29
+
30
+ # Run the registry generator
31
+ if tsx .claude/scripts/generate-code-registry.ts; then
32
+ echo ""
33
+ echo -e "${GREEN}✅ Code registry synced successfully!${NC}"
34
+ echo -e "${YELLOW}💡 Registry file: .claude/sessions/planning/.code-registry.json${NC}"
35
+ exit 0
36
+ else
37
+ echo ""
38
+ echo "❌ Failed to sync code registry"
39
+ exit 1
40
+ fi
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Telemetry Report Generator (Simplified)
4
+ */
5
+
6
+ import { existsSync, readFileSync } from 'node:fs';
7
+ import { resolve } from 'node:path';
8
+
9
+ const TELEMETRY_PATH = resolve(process.cwd(), '.claude/.telemetry.json');
10
+
11
+ process.stdout.write('\n📈 Telemetry Report\n');
12
+ process.stdout.write('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n');
13
+
14
+ if (!existsSync(TELEMETRY_PATH)) {
15
+ console.log('❌ No telemetry data found.');
16
+ console.log('\n💡 Telemetry file: .claude/.telemetry.json');
17
+ console.log(' This file is created automatically as you use the system.\n');
18
+ process.exit(0);
19
+ }
20
+
21
+ try {
22
+ const content = readFileSync(TELEMETRY_PATH, 'utf-8');
23
+ const data = JSON.parse(content);
24
+
25
+ console.log(`Version: ${data.version || 'unknown'}`);
26
+ console.log(`Tracking since: ${data.createdAt || 'unknown'}`);
27
+ console.log(`Last updated: ${data.lastUpdated || 'unknown'}\n`);
28
+
29
+ console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
30
+ console.log('🔒 Privacy Note: All telemetry data is stored locally');
31
+ console.log(' and never transmitted. The .telemetry.json file is');
32
+ console.log(' gitignored and remains on your machine.\n');
33
+ } catch (error) {
34
+ console.error('Error loading telemetry:', error);
35
+ process.exit(1);
36
+ }
@@ -0,0 +1,224 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Documentation Validation Script
4
+ #
5
+ # Validates:
6
+ # - Agent/command/skill counts match documentation
7
+ # - No broken internal links
8
+ # - File structure consistency
9
+ #
10
+ # Exit codes:
11
+ # 0 - All validations passed
12
+ # 1 - Validation failed
13
+ #
14
+
15
+ set -euo pipefail
16
+
17
+ # Colors for output
18
+ RED='\033[0;31m'
19
+ GREEN='\033[0;32m'
20
+ YELLOW='\033[1;33m'
21
+ NC='\033[0m' # No Color
22
+
23
+ # Counters
24
+ ERRORS=0
25
+ WARNINGS=0
26
+
27
+ # Base directories
28
+ CLAUDE_DIR=".claude"
29
+ AGENTS_DIR="${CLAUDE_DIR}/agents"
30
+ COMMANDS_DIR="${CLAUDE_DIR}/commands"
31
+ SKILLS_DIR="${CLAUDE_DIR}/skills"
32
+ DOCS_DIR="${CLAUDE_DIR}/docs"
33
+
34
+ echo "🔍 Validating documentation structure..."
35
+ echo ""
36
+
37
+ # ============================================================================
38
+ # 1. Count agents, commands, and skills
39
+ # ============================================================================
40
+
41
+ echo "📊 Counting components..."
42
+
43
+ # Count agents (excluding README.md and index files)
44
+ AGENT_COUNT=$(find "${AGENTS_DIR}" -type f -name "*.md" ! -name "README.md" ! -name "index.md" | wc -l)
45
+ echo " Agents: ${AGENT_COUNT}"
46
+
47
+ # Count commands (excluding README.md and index files)
48
+ COMMAND_COUNT=$(find "${COMMANDS_DIR}" -type f -name "*.md" ! -name "README.md" ! -name "index.md" | wc -l)
49
+ echo " Commands: ${COMMAND_COUNT}"
50
+
51
+ # Count skills (excluding README.md and index files)
52
+ SKILL_COUNT=$(find "${SKILLS_DIR}" -type f -name "*.md" ! -name "README.md" ! -name "index.md" | wc -l)
53
+ echo " Skills: ${SKILL_COUNT}"
54
+
55
+ echo ""
56
+
57
+ # ============================================================================
58
+ # 2. Validate agent README matches actual count
59
+ # ============================================================================
60
+
61
+ echo "🤖 Validating agents..."
62
+
63
+ if [ -f "${AGENTS_DIR}/README.md" ]; then
64
+ # Extract count from README Statistics section (looking for "**Total Agents**: 13")
65
+ README_AGENT_COUNT=$(grep -oP '\*\*Total Agents\*\*: \K\d+' "${AGENTS_DIR}/README.md" || echo "0")
66
+
67
+ if [ "${AGENT_COUNT}" -ne "${README_AGENT_COUNT}" ]; then
68
+ echo -e " ${RED}✗${NC} Agent count mismatch!"
69
+ echo " README says: ${README_AGENT_COUNT}"
70
+ echo " Actual count: ${AGENT_COUNT}"
71
+ ((ERRORS++))
72
+ else
73
+ echo -e " ${GREEN}✓${NC} Agent count matches (${AGENT_COUNT})"
74
+ fi
75
+ else
76
+ echo -e " ${YELLOW}⚠${NC} agents/README.md not found"
77
+ ((WARNINGS++))
78
+ fi
79
+
80
+ # ============================================================================
81
+ # 3. Validate command README matches actual count
82
+ # ============================================================================
83
+
84
+ echo "⚙️ Validating commands..."
85
+
86
+ if [ -f "${COMMANDS_DIR}/README.md" ]; then
87
+ # Extract count from README (looking for "## Total: 18 Commands")
88
+ README_COMMAND_COUNT=$(grep -oP '## Total: \K\d+(?= Commands)' "${COMMANDS_DIR}/README.md" || echo "0")
89
+
90
+ if [ "${COMMAND_COUNT}" -ne "${README_COMMAND_COUNT}" ]; then
91
+ echo -e " ${RED}✗${NC} Command count mismatch!"
92
+ echo " README says: ${README_COMMAND_COUNT}"
93
+ echo " Actual count: ${COMMAND_COUNT}"
94
+ ((ERRORS++))
95
+ else
96
+ echo -e " ${GREEN}✓${NC} Command count matches (${COMMAND_COUNT})"
97
+ fi
98
+ else
99
+ echo -e " ${YELLOW}⚠${NC} commands/README.md not found"
100
+ ((WARNINGS++))
101
+ fi
102
+
103
+ # ============================================================================
104
+ # 4. Validate skill README matches actual count
105
+ # ============================================================================
106
+
107
+ echo "🎯 Validating skills..."
108
+
109
+ if [ -f "${SKILLS_DIR}/README.md" ]; then
110
+ # Extract count from README (looking for "## Total: 16 Skills")
111
+ README_SKILL_COUNT=$(grep -oP '## Total: \K\d+(?= Skills)' "${SKILLS_DIR}/README.md" || echo "0")
112
+
113
+ if [ "${SKILL_COUNT}" -ne "${README_SKILL_COUNT}" ]; then
114
+ echo -e " ${RED}✗${NC} Skill count mismatch!"
115
+ echo " README says: ${README_SKILL_COUNT}"
116
+ echo " Actual count: ${SKILL_COUNT}"
117
+ ((ERRORS++))
118
+ else
119
+ echo -e " ${GREEN}✓${NC} Skill count matches (${SKILL_COUNT})"
120
+ fi
121
+ else
122
+ echo -e " ${YELLOW}⚠${NC} skills/README.md not found"
123
+ ((WARNINGS++))
124
+ fi
125
+
126
+ # ============================================================================
127
+ # 5. Check for broken internal links
128
+ # ============================================================================
129
+
130
+ echo ""
131
+ echo "🔗 Checking for broken internal links..."
132
+
133
+ # Find all markdown files in .claude
134
+ BROKEN_LINKS=0
135
+
136
+ while IFS= read -r file; do
137
+ # Extract markdown links: [text](path)
138
+ while IFS= read -r link; do
139
+ # Skip external links (http://, https://, mailto:)
140
+ if [[ "$link" =~ ^(http://|https://|mailto:) ]]; then
141
+ continue
142
+ fi
143
+
144
+ # Skip anchors within same file
145
+ if [[ "$link" =~ ^# ]]; then
146
+ continue
147
+ fi
148
+
149
+ # Get directory of current file
150
+ file_dir=$(dirname "$file")
151
+
152
+ # Resolve relative path
153
+ if [[ "$link" =~ ^/ ]]; then
154
+ # Absolute path from repo root
155
+ target_file="${link#/}"
156
+ else
157
+ # Relative path
158
+ target_file="${file_dir}/${link}"
159
+ fi
160
+
161
+ # Remove anchor if present
162
+ target_file="${target_file%%#*}"
163
+
164
+ # Check if file exists
165
+ if [ ! -f "$target_file" ] && [ ! -d "$target_file" ]; then
166
+ echo -e " ${RED}✗${NC} Broken link in ${file}"
167
+ echo " → ${link}"
168
+ ((BROKEN_LINKS++))
169
+ ((ERRORS++))
170
+ fi
171
+ done < <(grep -oP '\]\(\K[^)]+' "$file" 2>/dev/null || true)
172
+ done < <(find "${CLAUDE_DIR}" -type f -name "*.md")
173
+
174
+ if [ "${BROKEN_LINKS}" -eq 0 ]; then
175
+ echo -e " ${GREEN}✓${NC} No broken links found"
176
+ fi
177
+
178
+ # ============================================================================
179
+ # 6. Validate directory structure
180
+ # ============================================================================
181
+
182
+ echo ""
183
+ echo "📁 Validating directory structure..."
184
+
185
+ REQUIRED_DIRS=(
186
+ "${AGENTS_DIR}"
187
+ "${COMMANDS_DIR}"
188
+ "${SKILLS_DIR}"
189
+ "${DOCS_DIR}"
190
+ "${CLAUDE_DIR}/schemas"
191
+ "${CLAUDE_DIR}/scripts"
192
+ "${CLAUDE_DIR}/sessions/planning"
193
+ )
194
+
195
+ for dir in "${REQUIRED_DIRS[@]}"; do
196
+ if [ ! -d "$dir" ]; then
197
+ echo -e " ${RED}✗${NC} Missing directory: ${dir}"
198
+ ((ERRORS++))
199
+ fi
200
+ done
201
+
202
+ echo -e " ${GREEN}✓${NC} All required directories exist"
203
+
204
+ # ============================================================================
205
+ # Summary
206
+ # ============================================================================
207
+
208
+ echo ""
209
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
210
+ echo ""
211
+
212
+ if [ "${ERRORS}" -eq 0 ]; then
213
+ echo -e "${GREEN}✅ All validations passed!${NC}"
214
+ if [ "${WARNINGS}" -gt 0 ]; then
215
+ echo -e "${YELLOW}⚠️ ${WARNINGS} warning(s)${NC}"
216
+ fi
217
+ exit 0
218
+ else
219
+ echo -e "${RED}❌ Validation failed with ${ERRORS} error(s)${NC}"
220
+ if [ "${WARNINGS}" -gt 0 ]; then
221
+ echo -e "${YELLOW}⚠️ ${WARNINGS} warning(s)${NC}"
222
+ fi
223
+ exit 1
224
+ fi