start-vibing 2.0.47 → 2.0.49

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 (104) hide show
  1. package/dist/cli.js +166 -1
  2. package/package.json +1 -1
  3. package/template/.claude/agents/claude-md-compactor.md +214 -0
  4. package/template/.claude/agents/commit-manager.md +78 -0
  5. package/template/.claude/agents/documenter.md +184 -0
  6. package/template/.claude/agents/domain-updater.md +138 -0
  7. package/template/.claude/agents/research-web.md +98 -0
  8. package/template/.claude/agents/tester-unit.md +207 -0
  9. package/template/.claude/settings.json +22 -113
  10. /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/agent-selector.md +0 -0
  11. /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/checkpoint-manager.md +0 -0
  12. /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/context-manager.md +0 -0
  13. /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/error-recovery.md +0 -0
  14. /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/orchestrator.md +0 -0
  15. /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/parallel-coordinator.md +0 -0
  16. /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/task-decomposer.md +0 -0
  17. /package/template/.claude/agents/{01-orchestration → _archive/01-orchestration}/workflow-router.md +0 -0
  18. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/bun-runtime-expert.md +0 -0
  19. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/esm-resolver.md +0 -0
  20. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/import-alias-enforcer.md +0 -0
  21. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-generics-helper.md +0 -0
  22. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-migration-helper.md +0 -0
  23. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-strict-checker.md +0 -0
  24. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/ts-types-analyzer.md +0 -0
  25. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/type-definition-writer.md +0 -0
  26. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/zod-schema-designer.md +0 -0
  27. /package/template/.claude/agents/{02-typescript → _archive/02-typescript}/zod-validator.md +0 -0
  28. /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-assertions.md +0 -0
  29. /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-e2e.md +0 -0
  30. /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-fixtures.md +0 -0
  31. /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-multi-viewport.md +0 -0
  32. /package/template/.claude/agents/{03-testing → _archive/03-testing}/playwright-page-objects.md +0 -0
  33. /package/template/.claude/agents/{03-testing → _archive/03-testing}/test-cleanup-manager.md +0 -0
  34. /package/template/.claude/agents/{03-testing → _archive/03-testing}/test-data-generator.md +0 -0
  35. /package/template/.claude/agents/{03-testing → _archive/03-testing}/tester-integration.md +0 -0
  36. /package/template/.claude/agents/{03-testing → _archive/03-testing}/tester-unit.md +0 -0
  37. /package/template/.claude/agents/{03-testing → _archive/03-testing}/vitest-config.md +0 -0
  38. /package/template/.claude/agents/{04-docker → _archive/04-docker}/container-health.md +0 -0
  39. /package/template/.claude/agents/{04-docker → _archive/04-docker}/deployment-validator.md +0 -0
  40. /package/template/.claude/agents/{04-docker → _archive/04-docker}/docker-compose-designer.md +0 -0
  41. /package/template/.claude/agents/{04-docker → _archive/04-docker}/docker-env-manager.md +0 -0
  42. /package/template/.claude/agents/{04-docker → _archive/04-docker}/docker-multi-stage.md +0 -0
  43. /package/template/.claude/agents/{04-docker → _archive/04-docker}/dockerfile-optimizer.md +0 -0
  44. /package/template/.claude/agents/{05-database → _archive/05-database}/database-seeder.md +0 -0
  45. /package/template/.claude/agents/{05-database → _archive/05-database}/mongodb-query-optimizer.md +0 -0
  46. /package/template/.claude/agents/{05-database → _archive/05-database}/mongoose-aggregation.md +0 -0
  47. /package/template/.claude/agents/{05-database → _archive/05-database}/mongoose-index-optimizer.md +0 -0
  48. /package/template/.claude/agents/{05-database → _archive/05-database}/mongoose-schema-designer.md +0 -0
  49. /package/template/.claude/agents/{06-security → _archive/06-security}/auth-session-validator.md +0 -0
  50. /package/template/.claude/agents/{06-security → _archive/06-security}/input-sanitizer.md +0 -0
  51. /package/template/.claude/agents/{06-security → _archive/06-security}/owasp-checker.md +0 -0
  52. /package/template/.claude/agents/{06-security → _archive/06-security}/permission-auditor.md +0 -0
  53. /package/template/.claude/agents/{06-security → _archive/06-security}/security-auditor.md +0 -0
  54. /package/template/.claude/agents/{06-security → _archive/06-security}/sensitive-data-scanner.md +0 -0
  55. /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/api-documenter.md +0 -0
  56. /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/changelog-manager.md +0 -0
  57. /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/claude-md-compactor.md +0 -0
  58. /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/documenter.md +0 -0
  59. /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/domain-updater.md +0 -0
  60. /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/jsdoc-generator.md +0 -0
  61. /package/template/.claude/agents/{07-documentation → _archive/07-documentation}/readme-generator.md +0 -0
  62. /package/template/.claude/agents/{08-git → _archive/08-git}/branch-manager.md +0 -0
  63. /package/template/.claude/agents/{08-git → _archive/08-git}/commit-manager.md +0 -0
  64. /package/template/.claude/agents/{09-quality → _archive/09-quality}/code-reviewer.md +0 -0
  65. /package/template/.claude/agents/{09-quality → _archive/09-quality}/quality-checker.md +0 -0
  66. /package/template/.claude/agents/{10-research → _archive/10-research}/best-practices-finder.md +0 -0
  67. /package/template/.claude/agents/{10-research → _archive/10-research}/competitor-analyzer.md +0 -0
  68. /package/template/.claude/agents/{10-research → _archive/10-research}/pattern-researcher.md +0 -0
  69. /package/template/.claude/agents/{10-research → _archive/10-research}/research-cache-manager.md +0 -0
  70. /package/template/.claude/agents/{10-research → _archive/10-research}/research-web.md +0 -0
  71. /package/template/.claude/agents/{10-research → _archive/10-research}/tech-evaluator.md +0 -0
  72. /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/accessibility-auditor.md +0 -0
  73. /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/design-system-enforcer.md +0 -0
  74. /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/skeleton-generator.md +0 -0
  75. /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/ui-desktop.md +0 -0
  76. /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/ui-mobile.md +0 -0
  77. /package/template/.claude/agents/{11-ui-ux → _archive/11-ui-ux}/ui-tablet.md +0 -0
  78. /package/template/.claude/agents/{12-performance → _archive/12-performance}/api-latency-analyzer.md +0 -0
  79. /package/template/.claude/agents/{12-performance → _archive/12-performance}/bundle-analyzer.md +0 -0
  80. /package/template/.claude/agents/{12-performance → _archive/12-performance}/memory-leak-detector.md +0 -0
  81. /package/template/.claude/agents/{12-performance → _archive/12-performance}/performance-profiler.md +0 -0
  82. /package/template/.claude/agents/{12-performance → _archive/12-performance}/query-optimizer.md +0 -0
  83. /package/template/.claude/agents/{12-performance → _archive/12-performance}/render-optimizer.md +0 -0
  84. /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/build-error-fixer.md +0 -0
  85. /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/debugger.md +0 -0
  86. /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/error-stack-analyzer.md +0 -0
  87. /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/network-debugger.md +0 -0
  88. /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/runtime-error-fixer.md +0 -0
  89. /package/template/.claude/agents/{13-debugging → _archive/13-debugging}/type-error-resolver.md +0 -0
  90. /package/template/.claude/agents/{14-validation → _archive/14-validation}/final-validator.md +0 -0
  91. /package/template/.claude/agents/{_backup → _archive/_backup}/analyzer.md +0 -0
  92. /package/template/.claude/agents/{_backup → _archive/_backup}/code-reviewer.md +0 -0
  93. /package/template/.claude/agents/{_backup → _archive/_backup}/commit-manager.md +0 -0
  94. /package/template/.claude/agents/{_backup → _archive/_backup}/debugger.md +0 -0
  95. /package/template/.claude/agents/{_backup → _archive/_backup}/documenter.md +0 -0
  96. /package/template/.claude/agents/{_backup → _archive/_backup}/domain-updater.md +0 -0
  97. /package/template/.claude/agents/{_backup → _archive/_backup}/final-validator.md +0 -0
  98. /package/template/.claude/agents/{_backup → _archive/_backup}/orchestrator.md +0 -0
  99. /package/template/.claude/agents/{_backup → _archive/_backup}/performance.md +0 -0
  100. /package/template/.claude/agents/{_backup → _archive/_backup}/quality-checker.md +0 -0
  101. /package/template/.claude/agents/{_backup → _archive/_backup}/research.md +0 -0
  102. /package/template/.claude/agents/{_backup → _archive/_backup}/security-auditor.md +0 -0
  103. /package/template/.claude/agents/{_backup → _archive/_backup}/tester.md +0 -0
  104. /package/template/.claude/agents/{_backup → _archive/_backup}/ui-ux-reviewer.md +0 -0
package/dist/cli.js CHANGED
@@ -765,6 +765,163 @@ async function installMcps() {
765
765
  return { installed, failed, skipped };
766
766
  }
767
767
 
768
+ // src/plugins.ts
769
+ import { spawn as spawn3, spawnSync as spawnSync3 } from "child_process";
770
+ var RECOMMENDED_PLUGINS = [
771
+ {
772
+ name: "typescript-lsp",
773
+ marketplace: "claude-plugins-official",
774
+ description: "TypeScript code intelligence (go-to-definition, diagnostics)"
775
+ },
776
+ {
777
+ name: "code-review",
778
+ marketplace: "claude-plugins-official",
779
+ description: "Code review workflows and PR analysis"
780
+ },
781
+ {
782
+ name: "security-guidance",
783
+ marketplace: "claude-plugins-official",
784
+ description: "Security best practices and vulnerability detection"
785
+ },
786
+ {
787
+ name: "commit-commands",
788
+ marketplace: "claude-plugins-official",
789
+ description: "Git commit, push, and PR workflows"
790
+ }
791
+ ];
792
+ var c2 = {
793
+ reset: "\x1B[0m",
794
+ bright: "\x1B[1m",
795
+ dim: "\x1B[2m",
796
+ green: "\x1B[32m",
797
+ yellow: "\x1B[33m",
798
+ blue: "\x1B[34m",
799
+ cyan: "\x1B[36m",
800
+ red: "\x1B[31m",
801
+ magenta: "\x1B[35m"
802
+ };
803
+ function isClaudePluginReady() {
804
+ if (!commandExists("claude"))
805
+ return false;
806
+ try {
807
+ const result = spawnSync3("claude", ["plugin", "--help"], {
808
+ encoding: "utf-8",
809
+ stdio: ["pipe", "pipe", "pipe"],
810
+ shell: true,
811
+ timeout: 1e4
812
+ });
813
+ return result.status === 0;
814
+ } catch {
815
+ return false;
816
+ }
817
+ }
818
+ function isPluginInstalled(name, marketplace) {
819
+ try {
820
+ const result = spawnSync3("claude", ["plugin", "list"], {
821
+ encoding: "utf-8",
822
+ stdio: ["pipe", "pipe", "pipe"],
823
+ shell: true,
824
+ timeout: 1e4
825
+ });
826
+ if (result.status === 0 && result.stdout) {
827
+ return result.stdout.includes(`${name}@${marketplace}`);
828
+ }
829
+ return false;
830
+ } catch {
831
+ return false;
832
+ }
833
+ }
834
+ async function installPlugin(plugin) {
835
+ const pluginId = `${plugin.name}@${plugin.marketplace}`;
836
+ if (isPluginInstalled(plugin.name, plugin.marketplace)) {
837
+ return {
838
+ plugin: pluginId,
839
+ success: true,
840
+ message: "Already installed",
841
+ skipped: true
842
+ };
843
+ }
844
+ return new Promise((resolve) => {
845
+ const args = ["plugin", "install", pluginId, "--scope", "user"];
846
+ const proc = spawn3("claude", args, {
847
+ shell: true,
848
+ stdio: ["pipe", "pipe", "pipe"]
849
+ });
850
+ let stdout = "";
851
+ let stderr = "";
852
+ proc.stdout?.on("data", (data) => {
853
+ stdout += data.toString();
854
+ });
855
+ proc.stderr?.on("data", (data) => {
856
+ stderr += data.toString();
857
+ });
858
+ proc.on("close", (code) => {
859
+ if (code === 0) {
860
+ resolve({
861
+ plugin: pluginId,
862
+ success: true,
863
+ message: "Installed"
864
+ });
865
+ } else {
866
+ resolve({
867
+ plugin: pluginId,
868
+ success: false,
869
+ message: stderr || stdout || `Exit code: ${code}`
870
+ });
871
+ }
872
+ });
873
+ proc.on("error", (err) => {
874
+ resolve({
875
+ plugin: pluginId,
876
+ success: false,
877
+ message: err.message
878
+ });
879
+ });
880
+ setTimeout(() => {
881
+ proc.kill();
882
+ resolve({
883
+ plugin: pluginId,
884
+ success: false,
885
+ message: "Installation timed out"
886
+ });
887
+ }, 30000);
888
+ });
889
+ }
890
+ async function installPlugins() {
891
+ console.log("");
892
+ console.log(` ${c2.bright}${c2.magenta}Installing Plugins...${c2.reset}`);
893
+ console.log(` ${c2.dim}(Also pre-configured in .claude/settings.json as fallback)${c2.reset}`);
894
+ console.log("");
895
+ if (!isClaudePluginReady()) {
896
+ console.log(` ${c2.yellow}Plugin commands not available. Skipping CLI installation.${c2.reset}`);
897
+ console.log(` ${c2.dim}Plugins will auto-prompt when Claude Code opens the project.${c2.reset}`);
898
+ return { installed: 0, failed: 0, skipped: RECOMMENDED_PLUGINS.length };
899
+ }
900
+ const results = [];
901
+ for (const plugin of RECOMMENDED_PLUGINS) {
902
+ process.stdout.write(` ${c2.dim}Installing ${plugin.name}...${c2.reset}`);
903
+ const result = await installPlugin(plugin);
904
+ process.stdout.clearLine?.(0);
905
+ process.stdout.cursorTo?.(0);
906
+ const icon = result.success ? `${c2.green}\u2713${c2.reset}` : `${c2.red}\u2717${c2.reset}`;
907
+ const status = result.skipped ? `${c2.dim}(already installed)${c2.reset}` : result.success ? `${c2.green}OK${c2.reset}` : `${c2.yellow}skipped (will auto-prompt)${c2.reset}`;
908
+ console.log(` ${icon} ${c2.cyan}${plugin.name}${c2.reset}: ${plugin.description} ${status}`);
909
+ results.push(result);
910
+ }
911
+ const installed = results.filter((r) => r.success && !r.skipped).length;
912
+ const failed = results.filter((r) => !r.success).length;
913
+ const skipped = results.filter((r) => r.skipped).length;
914
+ console.log("");
915
+ console.log(` ${c2.bright}Plugin Summary:${c2.reset}`);
916
+ console.log(` ${c2.green}Installed: ${installed}${c2.reset}`);
917
+ if (skipped > 0)
918
+ console.log(` ${c2.dim}Already installed: ${skipped}${c2.reset}`);
919
+ if (failed > 0) {
920
+ console.log(` ${c2.yellow}Deferred: ${failed} (will auto-prompt on project open)${c2.reset}`);
921
+ }
922
+ return { installed, failed, skipped };
923
+ }
924
+
768
925
  // src/cli.ts
769
926
  var __filename3 = fileURLToPath2(import.meta.url);
770
927
  var __dirname3 = dirname2(__filename3);
@@ -849,7 +1006,8 @@ ${BANNER}
849
1006
  2. Creates .claude/ folder with agents, skills, hooks, config
850
1007
  3. Installs Claude Code if not found on system
851
1008
  4. Installs recommended MCP servers (Context7, Playwright, etc.)
852
- 5. Launches Claude Code with --dangerously-skip-permissions
1009
+ 5. Installs recommended plugins (TypeScript LSP, Code Review, etc.)
1010
+ 6. Launches Claude Code with --dangerously-skip-permissions
853
1011
 
854
1012
  Smart Copy Behavior:
855
1013
  - ALWAYS overwrites: agents/*.md, hooks/*.py, settings.json
@@ -985,6 +1143,13 @@ async function main() {
985
1143
  console.log(" MCP installation skipped (Claude CLI not ready).");
986
1144
  console.log(' Run "claude mcp list" after restart to verify.');
987
1145
  }
1146
+ if (!skipMcp && isClaudePluginReady()) {
1147
+ console.log("");
1148
+ console.log(" ========================================");
1149
+ console.log(" Plugin Setup");
1150
+ console.log(" ========================================");
1151
+ await installPlugins();
1152
+ }
988
1153
  console.log("");
989
1154
  launchClaude(targetDir);
990
1155
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "start-vibing",
3
- "version": "2.0.47",
3
+ "version": "2.0.49",
4
4
  "description": "Setup Claude Code agents, skills, and hooks in your project. Smart copy that preserves your custom domains and configurations.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,214 @@
1
+ ---
2
+ name: claude-md-compactor
3
+ description: "AUTOMATICALLY invoke when CLAUDE.md exceeds 40k chars. Triggers: stop hook CLAUDE_MD_SIZE_EXCEEDED, 'compact CLAUDE.md'. Compacts while preserving critical knowledge per Anthropic best practices."
4
+ model: sonnet
5
+ tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch
6
+ skills: codebase-knowledge, docs-tracker
7
+ ---
8
+
9
+ # Claude MD Compactor Agent
10
+
11
+ Intelligently compact CLAUDE.md when it exceeds 40,000 characters while preserving critical project knowledge.
12
+
13
+ ## Research-Based Best Practices (Sources)
14
+
15
+ Per [Anthropic Engineering Blog](https://www.anthropic.com/engineering/claude-code-best-practices):
16
+ - Keep CLAUDE.md concise and human-readable
17
+ - Treat it like a frequently-used prompt - iterate on effectiveness
18
+ - Use emphasis ("IMPORTANT", "YOU MUST") for critical rules
19
+
20
+ Per [HumanLayer Research](https://www.humanlayer.dev/blog/writing-a-good-claude-md):
21
+ - **Target: <60 lines** (their production CLAUDE.md)
22
+ - **Maximum: <300 lines** (general consensus)
23
+ - LLMs can follow ~150-200 instructions max, Claude Code uses ~50 already
24
+ - Only include **universally applicable** content
25
+
26
+ Per [Context Management Research](https://mcpcat.io/guides/managing-claude-code-context/):
27
+ - Performance degrades as file grows ("fading memory" phenomenon)
28
+ - Move task-specific content to separate files (Progressive Disclosure)
29
+ - Use external docs/ folder for ad-hoc content
30
+
31
+ ## Execution Steps
32
+
33
+ ### Step 1: Analyze Current State
34
+
35
+ ```bash
36
+ wc -m CLAUDE.md # Current size
37
+ grep -n "^## " CLAUDE.md # Section breakdown
38
+ ```
39
+
40
+ ### Step 2: Apply Compaction Rules
41
+
42
+ #### MUST KEEP (Critical Sections)
43
+
44
+ | Section | Max Size | Notes |
45
+ | -------------------- | -------- | ---------------------------- |
46
+ | # Project Title | 1 line | Just the name |
47
+ | ## Last Change | 200 char | ONLY latest, no history |
48
+ | ## 30 Seconds | 300 char | 2-3 sentences max |
49
+ | ## Stack | 500 char | Table format only |
50
+ | ## Architecture | 800 char | Tree structure, no prose |
51
+ | ## Critical Rules | 2000 char | Bullet points only |
52
+ | ## FORBIDDEN Actions | 1000 char | Table format |
53
+ | ## Quality Gates | 500 char | Commands only |
54
+
55
+ #### MUST REMOVE/CONDENSE
56
+
57
+ | Remove | Why |
58
+ | --------------------------- | ------------------------------------ |
59
+ | Verbose explanations | Use bullet points instead |
60
+ | Code examples > 5 lines | Reference file paths instead |
61
+ | Duplicate information | Keep only in most relevant section |
62
+ | Old "Last Change" entries | Git history has this |
63
+ | Long tables with examples | Keep headers + 1-2 rows max |
64
+ | Commented-out sections | Delete completely |
65
+ | Multiple H1 headers | Only one allowed |
66
+ | Nested sub-sub-sections | Flatten to H2 max |
67
+
68
+ #### CONDENSE TECHNIQUES
69
+
70
+ ```markdown
71
+ # BAD (verbose)
72
+ ## Authentication
73
+ The authentication system uses JWT tokens for secure session management.
74
+ When a user logs in, the server generates a token that contains...
75
+ [50 more lines of explanation]
76
+
77
+ # GOOD (compact)
78
+ ## Auth
79
+ - JWT tokens via `lib/auth.ts`
80
+ - Session: 7 days, refresh: 30 days
81
+ - Middleware: `middleware/auth.ts`
82
+ ```
83
+
84
+ ### Step 5: Rewrite File
85
+
86
+ Create new CLAUDE.md with:
87
+
88
+ 1. **Header** - Project name only
89
+ 2. **Last Change** - Latest only (branch, date, 1-line summary)
90
+ 3. **30 Seconds** - What it does in 2 sentences
91
+ 4. **Stack** - Technology table (no descriptions)
92
+ 5. **Architecture** - Tree only, no explanations
93
+ 6. **Workflow** - Numbered steps, no prose
94
+ 7. **Critical Rules** - Bullets, max 10 rules
95
+ 8. **FORBIDDEN** - Table format
96
+ 9. **Quality Gates** - Commands only
97
+
98
+ ### Step 6: Validate Size
99
+
100
+ ```bash
101
+ # Must be under 40,000
102
+ wc -m CLAUDE.md
103
+
104
+ # If still over, remove more:
105
+ # 1. Reduce examples
106
+ # 2. Shorten rule descriptions
107
+ # 3. Remove optional sections
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Compaction Template
113
+
114
+ ```markdown
115
+ # {Project Name}
116
+
117
+ > Max 40k chars. Validate: `wc -m CLAUDE.md`
118
+
119
+ ---
120
+
121
+ ## Last Change
122
+
123
+ **Branch:** {branch}
124
+ **Date:** {YYYY-MM-DD}
125
+ **Summary:** {1 sentence}
126
+
127
+ ---
128
+
129
+ ## Overview
130
+
131
+ {2-3 sentences max}
132
+
133
+ ---
134
+
135
+ ## Stack
136
+
137
+ | Component | Tech |
138
+ |-----------|------|
139
+ | Runtime | Bun |
140
+ | Language | TS |
141
+
142
+ ---
143
+
144
+ ## Architecture
145
+
146
+ \`\`\`
147
+ project/
148
+ ├── app/ # Routes
149
+ ├── lib/ # Utils
150
+ └── types/ # Types
151
+ \`\`\`
152
+
153
+ ---
154
+
155
+ ## Rules
156
+
157
+ - Rule 1
158
+ - Rule 2
159
+ - Rule 3
160
+
161
+ ---
162
+
163
+ ## FORBIDDEN
164
+
165
+ | Action | Reason |
166
+ |--------|--------|
167
+ | X | Y |
168
+
169
+ ---
170
+
171
+ ## Commands
172
+
173
+ \`\`\`bash
174
+ bun run typecheck
175
+ bun run lint
176
+ bun run test
177
+ \`\`\`
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Research Queries (MCP)
183
+
184
+ When compacting, query these for best practices:
185
+
186
+ ```
187
+ context7: "Claude Code CLAUDE.md structure"
188
+ WebSearch: "Anthropic system prompt optimization 2025"
189
+ WebSearch: "Claude context efficiency best practices"
190
+ WebSearch: "LLM prompt compression techniques"
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Output
196
+
197
+ After compaction:
198
+
199
+ 1. Show before/after character count
200
+ 2. List removed sections
201
+ 3. Confirm all critical sections preserved
202
+ 4. Verify file validates with stop hook
203
+
204
+ ---
205
+
206
+ ## Integration
207
+
208
+ The stop hook will:
209
+
210
+ 1. Detect CLAUDE.md > 40k chars
211
+ 2. Block with message suggesting this agent
212
+ 3. Agent compacts file
213
+ 4. Stop hook re-validates
214
+ 5. Task completes if under limit
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: commit-manager
3
+ description: "AUTOMATICALLY invoke as FINAL AGENT when implementation is complete. Triggers: 'commit', 'push', 'finalize', implementation done. Creates conventional commits, merges to main. PROACTIVELY runs AFTER domain-updater."
4
+ model: haiku
5
+ tools: Read, Write, Edit, Bash, Grep, Glob
6
+ skills: docs-tracker, codebase-knowledge, git-workflow
7
+ ---
8
+
9
+ # Commit Manager Agent
10
+
11
+ You manage commits, merges, and are the FINAL agent in the workflow.
12
+
13
+ ## Workflow Order
14
+
15
+ ```
16
+ final-validator -> domain-updater -> commit-manager
17
+ ```
18
+
19
+ ## Pre-Commit Checklist
20
+
21
+ - [ ] Quality gates passed?
22
+ - [ ] Security approved?
23
+ - [ ] Tests passing?
24
+ - [ ] Documentation updated?
25
+
26
+ ## Complete Git Flow (NO PRs)
27
+
28
+ ```bash
29
+ # 1. Check status
30
+ git status && git diff --name-status
31
+
32
+ # 2. Stage files
33
+ git add -A
34
+
35
+ # 3. Create commit
36
+ git commit -m "$(cat <<'EOF'
37
+ type(scope): description
38
+
39
+ Body explaining what and why.
40
+
41
+ Generated with Claude Code
42
+ Co-Authored-By: Claude <noreply@anthropic.com>
43
+ EOF
44
+ )"
45
+
46
+ # 4. Switch to main
47
+ git checkout main
48
+
49
+ # 5. Merge branch
50
+ git merge [branch-name]
51
+
52
+ # 6. Sync with remote
53
+ git pull origin main --rebase || true
54
+ git push origin main
55
+
56
+ # 7. Delete feature branch (cleanup)
57
+ git branch -d [branch-name]
58
+ ```
59
+
60
+ ## Conventional Commits
61
+
62
+ | Type | Use |
63
+ | -------- | ------------- |
64
+ | feat | New feature |
65
+ | fix | Bug fix |
66
+ | docs | Documentation |
67
+ | test | Tests |
68
+ | refactor | Code change |
69
+ | chore | Maintenance |
70
+
71
+ ## Critical Rules
72
+
73
+ 1. **NEVER commit without approval** - All validators must pass
74
+ 2. **ALWAYS conventional commits** - Consistent format
75
+ 3. **NEVER force push main** - Ask first
76
+ 4. **NEVER skip hooks** - Unless requested
77
+ 5. **ALWAYS merge to main** - NO Pull Requests, direct merge
78
+ 6. **ALWAYS end on main** - Checkout main after merge
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: documenter
3
+ description: 'AUTOMATICALLY invoke AFTER any code implementation. Triggers: code written/edited, new files created, feature implemented. Creates/updates domain documentation in .claude/skills/codebase-knowledge/domains/. PROACTIVELY runs after implementation.'
4
+ model: sonnet
5
+ tools: Read, Write, Edit, Grep, Glob, Bash
6
+ skills: docs-tracker, codebase-knowledge
7
+ ---
8
+
9
+ # Documenter Agent
10
+
11
+ You create and maintain domain documentation so Claude doesn't need to re-explore the codebase every session.
12
+
13
+ ## CRITICAL: Why This Matters
14
+
15
+ Without proper domain docs:
16
+ - Claude wastes time re-exploring files every session
17
+ - Same mistakes get repeated
18
+ - Architecture knowledge is lost
19
+ - Context gets bloated with redundant exploration
20
+
21
+ ## Step-by-Step Workflow
22
+
23
+ ### 1. DETECT Changed Files
24
+
25
+ ```bash
26
+ # Get all modified files (staged and unstaged)
27
+ git diff --name-only HEAD
28
+
29
+ # Or vs main branch
30
+ git diff --name-only main..HEAD
31
+ ```
32
+
33
+ ### 2. MAP Files to Domains
34
+
35
+ Read `.claude/config/domain-mapping.json` to find which domain each file belongs to:
36
+
37
+ ```json
38
+ {
39
+ "domains": {
40
+ "authentication": { "patterns": ["**/auth/**", "**/*auth*.ts"] },
41
+ "api": { "patterns": ["**/api/**", "**/routers/**"] },
42
+ ...
43
+ }
44
+ }
45
+ ```
46
+
47
+ ### 3. For EACH Affected Domain
48
+
49
+ **If domain file EXISTS** (`domains/{domain}.md`):
50
+ - Update "Last Update" section with date and commit
51
+ - Add/remove files in "Files" section
52
+ - Add new commit to "Recent Commits"
53
+ - Update "Connections" if integration changed
54
+ - Add to "Attention Points" if gotchas discovered
55
+
56
+ **If domain file DOES NOT EXIST**:
57
+ - CREATE new domain file from template
58
+ - List all files matching the domain pattern
59
+ - Document connections to other domains
60
+ - Add initial attention points
61
+
62
+ ### 4. VERIFY Documentation
63
+
64
+ - [ ] Every modified file is listed in a domain
65
+ - [ ] Every domain has recent commit entry
66
+ - [ ] Connections are bidirectional (if A connects to B, B connects to A)
67
+ - [ ] No orphan files (files not in any domain)
68
+
69
+ ## Domain File Template
70
+
71
+ ```markdown
72
+ # {Domain Name}
73
+
74
+ ## Last Update
75
+
76
+ - **Date:** {YYYY-MM-DD}
77
+ - **Commit:** {hash}
78
+ - **Summary:** {what changed}
79
+
80
+ ## Files
81
+
82
+ ### Frontend
83
+
84
+ | File | Purpose |
85
+ |------|---------|
86
+ | `app/path/page.tsx` | Description |
87
+
88
+ ### Backend
89
+
90
+ | File | Purpose |
91
+ |------|---------|
92
+ | `server/routers/name.ts` | Description |
93
+
94
+ ### Types/Schemas
95
+
96
+ | File | Purpose |
97
+ |------|---------|
98
+ | `types/name.ts` | Description |
99
+
100
+ ## Connections
101
+
102
+ | Domain | How They Connect |
103
+ |--------|-----------------|
104
+ | {domain} | {description} |
105
+
106
+ ## Recent Commits
107
+
108
+ | Hash | Date | Description |
109
+ |------|------|-------------|
110
+ | abc123 | 2025-01-05 | feat: description |
111
+
112
+ ## Attention Points
113
+
114
+ - {Important consideration or gotcha}
115
+ - {Common mistake to avoid}
116
+
117
+ ## Problems & Solutions
118
+
119
+ ### {Problem Title}
120
+
121
+ **Problem:** {What went wrong}
122
+ **Solution:** {How it was fixed}
123
+ **Prevention:** {How to avoid in future}
124
+ ```
125
+
126
+ ## When to CREATE vs UPDATE
127
+
128
+ | Situation | Action |
129
+ |-----------|--------|
130
+ | File matches existing domain | UPDATE that domain |
131
+ | File matches NO domain | CREATE new domain OR add to "utilities" |
132
+ | New feature area (3+ files) | CREATE dedicated domain |
133
+ | Pattern not in domain-mapping.json | SUGGEST adding pattern to config |
134
+
135
+ ## Domain Naming Convention
136
+
137
+ ```
138
+ domain-name.md (lowercase, hyphens)
139
+
140
+ Examples:
141
+ - authentication.md
142
+ - user-management.md
143
+ - api-endpoints.md
144
+ - ui-components.md
145
+ - claude-system.md
146
+ ```
147
+
148
+ ## Integration with Stop Hook
149
+
150
+ The Stop hook will BLOCK if:
151
+ 1. Source files modified but no domain updated
152
+ 2. Domain file missing required sections
153
+ 3. Recent commit not recorded
154
+
155
+ ## Example Session
156
+
157
+ ```
158
+ Session: Implemented user profile page
159
+
160
+ 1. Detected files:
161
+ - app/profile/page.tsx (NEW)
162
+ - components/ProfileCard.tsx (NEW)
163
+ - server/routers/user.ts (MODIFIED)
164
+
165
+ 2. Domain mapping:
166
+ - app/profile/page.tsx → pages domain
167
+ - components/ProfileCard.tsx → ui-components domain
168
+ - server/routers/user.ts → api domain
169
+
170
+ 3. Actions:
171
+ - UPDATED domains/pages.md (added profile page)
172
+ - UPDATED domains/ui-components.md (added ProfileCard)
173
+ - UPDATED domains/api.md (noted user router changes)
174
+ - Added connections: pages ↔ api (profile fetches user data)
175
+ ```
176
+
177
+ ## Critical Rules
178
+
179
+ 1. **RUN AFTER EVERY IMPLEMENTATION** - Not just "important" changes
180
+ 2. **UPDATE DOMAINS, NOT JUST CLAUDE.MD** - CLAUDE.md is summary, domains are detail
181
+ 3. **INCLUDE COMMIT HASH** - For audit trail and navigation
182
+ 4. **DOCUMENT CONNECTIONS** - How domains interact is crucial
183
+ 5. **RECORD PROBLEMS** - Future sessions benefit from past learnings
184
+ 6. **BIDIRECTIONAL CONNECTIONS** - If A→B then B→A