@champpaba/claude-agent-kit 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.claude/CLAUDE.md CHANGED
@@ -1,8 +1,46 @@
1
1
  # CLAUDE.md
2
2
 
3
3
  > **Navigation Hub for AI Agents**
4
- > **Template Version:** 1.7.0 - Universal Multi-Agent Template (Opus 4.5)
5
- > **Latest:** Incremental Testing - Milestone-based validation for high-risk tasks with round-based retry
4
+ > **Template Version:** 1.8.0 - Universal Multi-Agent Template (Opus 4.5)
5
+ > **Latest:** Token Optimization - Removed documentation/report phases, verbose terminal output instead
6
+
7
+ ---
8
+
9
+ ## šŸ“ File Naming Conventions (OpenSpec + Template)
10
+
11
+ > **IMPORTANT:** Avoid confusion between OpenSpec files and Template files
12
+
13
+ ### OpenSpec Files (from [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec))
14
+
15
+ | File | Purpose | When to Read |
16
+ |------|---------|--------------|
17
+ | `proposal.md` | WHY - Goals, scope, rationale | Phase planning |
18
+ | `tasks.md` | WHAT - Implementation checklist | Task tracking |
19
+ | `design.md` | **Technical/Architecture decisions** (optional) | Backend/Database phases |
20
+ | `specs/` | Delta specs (ADDED/MODIFIED/REMOVED) | Requirement validation |
21
+
22
+ ### Template Files (from claude-multi-agent-template)
23
+
24
+ | File | Purpose | When to Read |
25
+ |------|---------|--------------|
26
+ | `STYLE_GUIDE.md` | **Visual design** (colors, typography, spacing) | UI/Frontend phases |
27
+ | `STYLE_TOKENS.json` | Lightweight design tokens (~500 tokens) | Quick UI reference |
28
+ | `page-plan.md` | UI component layout + content strategy | uxui-frontend agent |
29
+ | `phases.md` | Execution plan with agent assignments | All phases |
30
+ | `flags.json` | Progress tracking | All phases |
31
+
32
+ ### Key Distinction
33
+
34
+ ```
35
+ OpenSpec design.md = Technical Architecture (data flow, API structure, system design)
36
+ Template STYLE_GUIDE = Visual Design (colors, fonts, spacing, component styles)
37
+ ```
38
+
39
+ **Agents should read BOTH when relevant:**
40
+ - `uxui-frontend` → STYLE_GUIDE.md (visual) + design.md (if has UI architecture)
41
+ - `backend` → design.md (API/data architecture)
42
+ - `database` → design.md (data models, relationships)
43
+ - `frontend` → STYLE_GUIDE.md (visual) + design.md (API contracts)
6
44
 
7
45
  ---
8
46
 
@@ -19,8 +57,8 @@ Universal, framework-agnostic template for AI-assisted development.
19
57
  - āœ… Domain-Specific Support (add your business logic)
20
58
 
21
59
  **What's NOT Included:**
22
- - āŒ Framework patterns → Generated dynamically via `/agentsetup`
23
- - āŒ Package managers → Detected by `/agentsetup`
60
+ - āŒ Framework patterns → Generated dynamically via `/csetup`
61
+ - āŒ Package managers → Auto-detected by `/csetup`
24
62
  - āŒ Spec frameworks → Optional (OpenSpec, BMAD, SpecKit)
25
63
 
26
64
  ---
@@ -46,9 +84,8 @@ Universal, framework-agnostic template for AI-assisted development.
46
84
  - `@/.claude/contexts/patterns/frontend-component-strategy.md`
47
85
 
48
86
  **Project Setup:**
49
- - `/designsetup` - **NEW!** Auto-generate style guide (reference → codebase → AI)
50
- - `/psetup` - One-time project setup (detect tech stack, generate best practices)
51
- - `/agentsetup` - Auto-detect tech stack and generate best practices
87
+ - `/designsetup` - Auto-generate style guide (reference → codebase → AI)
88
+ - `/csetup` - **v1.8.0:** Now auto-detects tech stack + generates best practices (replaces /psetup, /agentsetup)
52
89
 
53
90
  **Page Planning (UI Tasks):**
54
91
  - `/pageplan @prd.md @brief.md` - **ENHANCED v1.4.0!** Generate page structure & conversion-optimized content
@@ -64,7 +101,7 @@ Universal, framework-agnostic template for AI-assisted development.
64
101
  - `/cstatus {change-id}` - Quick progress status for a change
65
102
 
66
103
  **Best Practices (Dynamic):**
67
- - `.claude/contexts/domain/{project}/best-practices/` (generated by `/agentsetup`)
104
+ - `.claude/contexts/domain/project/best-practices/` (auto-generated by `/csetup`)
68
105
  - Framework-specific guidelines from Context7 MCP
69
106
 
70
107
  **Indexing (3 Levels):**
@@ -83,15 +120,20 @@ Universal, framework-agnostic template for AI-assisted development.
83
120
 
84
121
  ---
85
122
 
86
- ## šŸ“š Best Practices System
87
-
88
- **→ See:** `@/.claude/lib/detailed-guides/best-practices-system.md` for complete guide
123
+ ## šŸ“š Best Practices System (v1.8.0)
89
124
 
90
125
  **Quick Summary:**
91
- - Run `/agentsetup` → Auto-detects tech stack → Queries Context7 → Generates framework-specific best practices
92
- - Files created in `.claude/contexts/domain/{project}/best-practices/` (React, Next.js, Prisma, etc.)
93
- - Agents auto-discover via 3-level indexing (domain → project → best-practices)
94
- - Enforces code quality with framework-specific patterns
126
+ - `/csetup` **auto-detects tech stack** from: package.json → design.md → proposal/tasks (3 sources)
127
+ - **Auto-generates best practices** from Context7 MCP (React, Next.js, Prisma, etc.)
128
+ - Files created in `.claude/contexts/domain/project/best-practices/`
129
+ - **Agents MUST read** best practices before coding (validated by agent-executor)
130
+ - `/cdev` **injects** relevant best-practices paths into agent prompts
131
+
132
+ **Flow:**
133
+ ```
134
+ /csetup → detect stack → query Context7 → generate best-practices
135
+ /cdev → inject paths into prompt → agent reads → validation checks
136
+ ```
95
137
 
96
138
  ---
97
139
 
@@ -526,7 +526,7 @@ Frontend expects `email` but backend doesn't return it.
526
526
  - āœ… ALWAYS read `tech-stack.md` before ANY install/run commands
527
527
  - āœ… Use exact package manager from tech-stack.md (pnpm, npm, bun, uv, poetry, pip)
528
528
  - āŒ NEVER assume or hardcode package manager
529
- - āŒ If tech-stack.md missing → warn user to run `/agentsetup`
529
+ - āŒ If tech-stack.md missing → warn user to run `/csetup`
530
530
 
531
531
  ### Validation Standards
532
532
  - āœ… Read ACTUAL code files (don't guess or assume)
@@ -638,14 +638,18 @@ Found: 3 endpoints
638
638
 
639
639
  ---
640
640
 
641
- ## Documentation Policy
641
+ ## Documentation Policy (v1.8.0)
642
642
 
643
- **→ See:** `.claude/contexts/patterns/code-standards.md` for complete policy
643
+ **→ See:** `.claude/contexts/patterns/code-standards.md` → "Forbidden Files" section
644
+
645
+ **Simple Rule:** Only create **actual code/config files**. No reports, summaries, or temp files.
644
646
 
645
647
  **Quick Reference:**
646
- - āŒ NEVER create documentation files unless explicitly requested
647
- - āŒ NO INTEGRATION_REPORT.md, CONTRACT_ANALYSIS.md, API_CONTRACTS.md, etc.
648
- - āœ… Return comprehensive text reports in your final message instead
649
- - āœ… Exception: Only when user explicitly says "create documentation"
648
+ - āŒ NEVER create files for: reports, summaries, logs, guides, analysis results
649
+ - āŒ NEVER create ALL_CAPS filenames or files with PHASE_/STEP_ prefixes
650
+ - āœ… Return all results in your **final response text**
651
+ - āœ… Update `flags.json` with validation results
652
+
653
+ **Rule of thumb:** If it wouldn't be committed to git as part of the feature, don't create it.
650
654
 
651
655
  ---
@@ -922,14 +922,19 @@ Return to Orchestrator:
922
922
 
923
923
  ---
924
924
 
925
- ## Documentation Policy
925
+ ## Documentation Policy (v1.8.0)
926
926
 
927
- **→ See:** `.claude/contexts/patterns/code-standards.md` for complete policy
927
+ **→ See:** `.claude/contexts/patterns/code-standards.md` → "Forbidden Files" section
928
928
 
929
- **Quick Rule:**
930
- - āŒ **NEVER** create .md documentation files (README, DOCS, GUIDE, etc.)
931
- - āœ… **ALWAYS** report results as verbose text output in final message
932
- - Exception: ONLY when user explicitly requests documentation
929
+ **Simple Rule:** Only create **actual component/style files**. No reports, summaries, or temp files.
930
+
931
+ **Quick Reference:**
932
+ - āŒ NEVER create files for: reports, summaries, logs, guides, analysis results
933
+ - āŒ NEVER create ALL_CAPS filenames or files with PHASE_/STEP_ prefixes
934
+ - āœ… Return all results in your **final response text**
935
+ - āœ… Update `flags.json` with component list and files created
936
+
937
+ **Rule of thumb:** If it wouldn't be committed to git as part of the feature, don't create it.
933
938
 
934
939
  ## Rules
935
940
 
@@ -431,15 +431,19 @@ Recommendation:
431
431
 
432
432
  ---
433
433
 
434
- ## Documentation Policy
434
+ ## Documentation Policy (v1.8.0)
435
435
 
436
- **→ See:** `.claude/contexts/patterns/code-standards.md` for complete policy
436
+ **→ See:** `.claude/contexts/patterns/code-standards.md` → "Forbidden Files" section
437
+
438
+ **Simple Rule:** Only create **actual code/test files**. No reports, summaries, or temp files.
437
439
 
438
440
  **Quick Reference:**
439
- - āŒ NEVER create documentation files unless explicitly requested
440
- - āŒ NO TEST_REPORT.md, DEBUG_LOG.md, TEST_RESULTS.md, etc.
441
- - āœ… Return comprehensive text reports in your final message instead
442
- - āœ… Exception: Only when user explicitly says "create documentation"
441
+ - āŒ NEVER create files for: reports, summaries, logs, guides, analysis results
442
+ - āŒ NEVER create ALL_CAPS filenames or files with PHASE_/STEP_ prefixes
443
+ - āœ… Return all results in your **final response text**
444
+ - āœ… Update `flags.json` with test results (passed/failed/coverage)
445
+
446
+ **Rule of thumb:** If it wouldn't be committed to git as part of the feature, don't create it.
443
447
 
444
448
  ## Rules
445
449
 
@@ -451,7 +455,7 @@ Recommendation:
451
455
  - āœ… ALWAYS read `tech-stack.md` before ANY install/run commands
452
456
  - āœ… Use exact package manager from tech-stack.md (pnpm, npm, bun, uv, poetry, pip)
453
457
  - āŒ NEVER assume or hardcode package manager
454
- - āŒ If tech-stack.md missing → warn user to run `/agentsetup`
458
+ - āŒ If tech-stack.md missing → warn user to run `/csetup`
455
459
 
456
460
  ### Testing Standards
457
461
  - āœ… Run tests automatically (no manual testing)
@@ -561,15 +561,19 @@ test('failed login shows error message', async () => {
561
561
 
562
562
  ---
563
563
 
564
- ## Documentation Policy
564
+ ## Documentation Policy (v1.8.0)
565
565
 
566
- **→ See:** `.claude/contexts/patterns/code-standards.md` for complete policy
566
+ **→ See:** `.claude/contexts/patterns/code-standards.md` → "Forbidden Files" section
567
+
568
+ **Simple Rule:** Only create **actual code files**. No reports, summaries, or temp files.
567
569
 
568
570
  **Quick Reference:**
569
- - āŒ NEVER create documentation files unless explicitly requested
570
- - āŒ NO README.md, IMPLEMENTATION_GUIDE.md, API_DOCS.md, etc.
571
- - āœ… Return comprehensive text reports in your final message instead
572
- - āœ… Exception: Only when user explicitly says "create documentation"
571
+ - āŒ NEVER create files for: reports, summaries, logs, guides, analysis results
572
+ - āŒ NEVER create ALL_CAPS filenames or files with PHASE_/STEP_ prefixes
573
+ - āœ… Return all results in your **final response text**
574
+ - āœ… Update `flags.json` with integration results
575
+
576
+ **Rule of thumb:** If it wouldn't be committed to git as part of the feature, don't create it.
573
577
 
574
578
  ## Rules
575
579
 
@@ -581,7 +585,7 @@ test('failed login shows error message', async () => {
581
585
  - āœ… ALWAYS read `tech-stack.md` before ANY install/run commands
582
586
  - āœ… Use exact package manager from tech-stack.md (pnpm, npm, bun, uv, poetry, pip)
583
587
  - āŒ NEVER assume or hardcode package manager
584
- - āŒ If tech-stack.md missing → warn user to run `/agentsetup`
588
+ - āŒ If tech-stack.md missing → warn user to run `/csetup`
585
589
 
586
590
  ### TDD Compliance
587
591
  - āœ… Check `tdd_required` flag from Orchestrator
@@ -579,14 +579,19 @@ Response: { token: string, user: { id, email, name } }
579
579
 
580
580
  ---
581
581
 
582
- ## Documentation Policy
582
+ ## Documentation Policy (v1.8.0)
583
583
 
584
- **→ See:** `.claude/contexts/patterns/code-standards.md` for complete policy
584
+ **→ See:** `.claude/contexts/patterns/code-standards.md` → "Forbidden Files" section
585
585
 
586
- **Quick Rule:**
587
- - āŒ **NEVER** create .md documentation files (README, API_DOCS, etc.)
588
- - āœ… **ALWAYS** report results as verbose text output in final message
589
- - Exception: ONLY when user explicitly requests documentation
586
+ **Simple Rule:** Only create **actual code files**. No reports, summaries, or temp files.
587
+
588
+ **Quick Reference:**
589
+ - āŒ NEVER create files for: reports, summaries, logs, guides, analysis results
590
+ - āŒ NEVER create ALL_CAPS filenames or files with PHASE_/STEP_ prefixes
591
+ - āœ… Return all results in your **final response text**
592
+ - āœ… Update `flags.json` with endpoints created
593
+
594
+ **Rule of thumb:** If it wouldn't be committed to git as part of the feature, don't create it.
590
595
 
591
596
  ## Rules
592
597
 
@@ -620,15 +620,19 @@ users = await db.execute(
620
620
 
621
621
  ---
622
622
 
623
- ## Documentation Policy
623
+ ## Documentation Policy (v1.8.0)
624
624
 
625
- **→ See:** `.claude/contexts/patterns/code-standards.md` for complete policy
625
+ **→ See:** `.claude/contexts/patterns/code-standards.md` → "Forbidden Files" section
626
+
627
+ **Simple Rule:** Only create **actual schema/migration files**. No reports, summaries, or temp files.
626
628
 
627
629
  **Quick Reference:**
628
- - āŒ NEVER create documentation files unless explicitly requested
629
- - āŒ NO SCHEMA_DOCUMENTATION.md, DATABASE_GUIDE.md, MIGRATION_GUIDE.md, etc.
630
- - āœ… Return comprehensive text reports in your final message instead
631
- - āœ… Exception: Only when user explicitly says "create documentation"
630
+ - āŒ NEVER create files for: reports, summaries, logs, guides, analysis results
631
+ - āŒ NEVER create ALL_CAPS filenames or files with PHASE_/STEP_ prefixes
632
+ - āœ… Return all results in your **final response text**
633
+ - āœ… Update `flags.json` with schema changes and migrations
634
+
635
+ **Rule of thumb:** If it wouldn't be committed to git as part of the feature, don't create it.
632
636
 
633
637
  ## Rules
634
638
 
@@ -640,7 +644,7 @@ users = await db.execute(
640
644
  - āœ… ALWAYS read `tech-stack.md` before ANY install/run commands
641
645
  - āœ… Use exact package manager from tech-stack.md (pnpm, npm, bun, uv, poetry, pip)
642
646
  - āŒ NEVER assume or hardcode package manager
643
- - āŒ If tech-stack.md missing → warn user to run `/agentsetup`
647
+ - āŒ If tech-stack.md missing → warn user to run `/csetup`
644
648
 
645
649
  ### TDD Compliance
646
650
  - āœ… Check `tdd_required` flag from Orchestrator
@@ -94,7 +94,7 @@ See: `.claude/lib/agent-executor.md` for full implementation
94
94
  ```typescript
95
95
  // Step 4: Invoke Agent with Retry & Validation
96
96
 
97
- // 4.1: Build agent prompt (with design reference - Context Optimization v1.2.0)
97
+ // 4.1: Build agent prompt (with design reference + best practices - v1.8.0)
98
98
  function buildAgentPrompt(phase, changeContext) {
99
99
  let prompt = `
100
100
  # Phase ${phase.phase_number}: ${phase.name}
@@ -108,7 +108,56 @@ ${changeContext.tasks}
108
108
  ${phase.instructions}
109
109
  `
110
110
 
111
- // šŸ†• Add design reference for uxui-frontend agent (not full content!)
111
+ // šŸ†• v1.8.0: Add best-practices reference for ALL agents
112
+ const bpDir = '.claude/contexts/domain/project/best-practices/'
113
+ if (fileExists(bpDir)) {
114
+ const bpFiles = listFiles(bpDir).filter(f => f.endsWith('.md') && f !== 'index.md')
115
+
116
+ // Map agent type to relevant best-practices
117
+ const agentBpMapping = {
118
+ 'uxui-frontend': ['react', 'nextjs', 'vue', 'tailwind'],
119
+ 'frontend': ['react', 'nextjs', 'vue', 'typescript'],
120
+ 'backend': ['express', 'fastapi', 'django', 'prisma', 'drizzle'],
121
+ 'database': ['prisma', 'drizzle', 'postgres', 'mongodb'],
122
+ 'test-debug': ['vitest', 'jest', 'playwright'],
123
+ 'integration': ['typescript'] // minimal
124
+ }
125
+
126
+ const relevantTechs = agentBpMapping[phase.agent] || []
127
+ const relevantFiles = bpFiles.filter(f =>
128
+ relevantTechs.some(tech => f.toLowerCase().includes(tech))
129
+ )
130
+
131
+ if (relevantFiles.length > 0) {
132
+ prompt += `
133
+
134
+ ---
135
+
136
+ ## šŸ“š Best Practices (MANDATORY - STEP 0)
137
+
138
+ **YOU MUST READ these files before writing ANY code:**
139
+
140
+ ${relevantFiles.map(f => `
141
+ ### ${f.replace('.md', '')}
142
+ \`\`\`
143
+ Read: ${bpDir}${f}
144
+ \`\`\`
145
+ `).join('')}
146
+
147
+ **After reading, REPORT:**
148
+ \`\`\`
149
+ āœ… Best Practices Loaded
150
+ ${relevantFiles.map(f => `- ${f.replace('.md', '')} āœ“`).join('\n ')}
151
+ \`\`\`
152
+
153
+ **If you skip this, your work will be REJECTED!**
154
+
155
+ ---
156
+ `
157
+ }
158
+ }
159
+
160
+ // Add design reference for uxui-frontend agent (not full content!)
112
161
  if (phase.agent === 'uxui-frontend') {
113
162
  const tokensPath = 'design-system/STYLE_TOKENS.json'
114
163
  const styleGuidePath = 'design-system/STYLE_GUIDE.md'
@@ -392,11 +441,65 @@ output(` ā±ļø ${formatDuration(flags.meta.time_remaining_estimate)} remaini
392
441
 
393
442
  // 4. Check next phase
394
443
  if (flags.ready_to_archive) {
395
- output('\nāœ… All phases complete! Ready to archive.')
396
- output(`\nNext steps:`)
397
- output(`1. Review: /cview ${changeId}`)
398
- output(`2. Update tasks.md (mark all [x])`)
399
- output(`3. Archive: openspec archive ${changeId}`)
444
+ // šŸ†• v1.2.0: Verbose Summary Output (replaces documentation/report phases)
445
+ output(`\n`)
446
+ output(`╔════════════════════════════════════════════════════════════╗`)
447
+ output(`ā•‘ āœ… CHANGE COMPLETED SUCCESSFULLY ā•‘`)
448
+ output(`ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•`)
449
+ output(``)
450
+ output(`šŸ“¦ Change: ${changeId}`)
451
+ output(`šŸ“‹ Template: ${flags.template} (${flags.meta.total_phases} phases)`)
452
+ output(``)
453
+ output(`═══════════════════════════════════════════════════════════════`)
454
+ output(`šŸ“Š EXECUTION SUMMARY`)
455
+ output(`═══════════════════════════════════════════════════════════════`)
456
+ output(``)
457
+ output(`ā±ļø Time:`)
458
+ output(` • Estimated: ${formatDuration(flags.meta.total_estimated_minutes)}`)
459
+ output(` • Actual: ${formatDuration(flags.meta.total_actual_minutes)}`)
460
+ output(` • Variance: ${calculateVariance(flags.meta)}`)
461
+ output(``)
462
+ output(`šŸ“ˆ Phases Completed: ${flags.meta.completed_phases}/${flags.meta.total_phases}`)
463
+
464
+ // List all phases with status
465
+ Object.entries(flags.phases).forEach(([phaseId, phase]) => {
466
+ const status = phase.status === 'completed' ? 'āœ…' :
467
+ phase.status === 'skipped' ? 'ā­ļø' : 'āŒ'
468
+ const time = phase.actual_minutes ? `(${phase.actual_minutes}m)` : ''
469
+ output(` ${status} ${phase.phase_number}. ${phaseId} ${time}`)
470
+ })
471
+
472
+ output(``)
473
+ output(`═══════════════════════════════════════════════════════════════`)
474
+ output(`šŸ“ FILES CREATED/MODIFIED`)
475
+ output(`═══════════════════════════════════════════════════════════════`)
476
+
477
+ // Collect all files from phase outputs
478
+ const allFiles = collectFilesFromPhases(flags.phases)
479
+ if (allFiles.created.length > 0) {
480
+ output(``)
481
+ output(`✨ Created (${allFiles.created.length}):`)
482
+ allFiles.created.forEach(f => output(` • ${f}`))
483
+ }
484
+ if (allFiles.modified.length > 0) {
485
+ output(``)
486
+ output(`šŸ“ Modified (${allFiles.modified.length}):`)
487
+ allFiles.modified.forEach(f => output(` • ${f}`))
488
+ }
489
+
490
+ output(``)
491
+ output(`═══════════════════════════════════════════════════════════════`)
492
+ output(`šŸš€ NEXT STEPS`)
493
+ output(`═══════════════════════════════════════════════════════════════`)
494
+ output(``)
495
+ output(`1. Review changes: /cview ${changeId}`)
496
+ output(`2. Test manually: Verify the implementation works`)
497
+ output(`3. Mark complete: Update tasks.md (mark all [x])`)
498
+ output(`4. Archive: openspec archive ${changeId}`)
499
+ output(``)
500
+ output(`šŸ’” Note: flags.json contains full execution history`)
501
+ output(` Path: openspec/changes/${changeId}/.claude/flags.json`)
502
+ output(``)
400
503
  } else {
401
504
  const nextPhase = flags.phases[flags.current_phase]
402
505