start-vibing 2.0.25 → 2.0.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "start-vibing",
3
- "version": "2.0.25",
3
+ "version": "2.0.27",
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": {
@@ -1,49 +1,43 @@
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
+
1
9
  # Claude MD Compactor Agent
2
10
 
3
- > **Purpose:** Intelligently compact CLAUDE.md when it exceeds 40,000 characters while preserving critical project knowledge.
11
+ Intelligently compact CLAUDE.md when it exceeds 40,000 characters while preserving critical project knowledge.
4
12
 
5
- ---
13
+ ## Research-Based Best Practices (Sources)
6
14
 
7
- ## Trigger
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
8
19
 
9
- AUTOMATICALLY invoke when:
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
10
25
 
11
- - CLAUDE.md exceeds 40,000 characters
12
- - Stop hook blocks with `CLAUDE_MD_SIZE_EXCEEDED` error
13
- - User says "compact", "reduce", "shrink" CLAUDE.md
14
-
15
- ---
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
16
30
 
17
31
  ## Execution Steps
18
32
 
19
33
  ### Step 1: Analyze Current State
20
34
 
21
35
  ```bash
22
- # Get current size
23
- wc -m CLAUDE.md
24
-
25
- # Get section breakdown
26
- grep -n "^## " CLAUDE.md
27
- ```
28
-
29
- ### Step 2: Research Best Practices
30
-
31
- Use MCP servers to get latest recommendations:
32
-
33
- ```
34
- 1. context7 - Query Claude Code documentation patterns
35
- 2. WebSearch - "Anthropic Claude system prompt best practices 2024 2025"
36
- 3. WebSearch - "Claude context window optimization techniques"
37
- ```
38
-
39
- ### Step 3: Read Template for Structure
40
-
41
- ```
42
- Read: .claude/skills/codebase-knowledge/TEMPLATE.md
43
- Read: .claude/CLAUDE.md (agent context file for reference)
36
+ wc -m CLAUDE.md # Current size
37
+ grep -n "^## " CLAUDE.md # Section breakdown
44
38
  ```
45
39
 
46
- ### Step 4: Apply Compaction Rules
40
+ ### Step 2: Apply Compaction Rules
47
41
 
48
42
  #### MUST KEEP (Critical Sections)
49
43
 
@@ -939,6 +939,11 @@ interface HookResult {
939
939
 
940
940
  /**
941
941
  * Maps error types to the subagent that should be launched to fix them.
942
+ * IMPORTANT: Only use built-in Claude Code agent types that exist in the Task tool.
943
+ * Custom agents defined in .claude/agents/ are NOT available as subagent_type.
944
+ *
945
+ * Available built-in types: general-purpose, documenter, commit-manager, branch-manager,
946
+ * analyzer, tester, security-auditor, quality-checker, debugger, etc.
942
947
  */
943
948
  const ERROR_TO_SUBAGENT: Record<string, { agent: string; prompt: string }> = {
944
949
  FEATURE_BRANCH_NOT_MERGED: {
@@ -962,8 +967,16 @@ const ERROR_TO_SUBAGENT: Record<string, { agent: string; prompt: string }> = {
962
967
  prompt: 'Create CLAUDE.md with required sections: Last Change, 30s Overview, Stack, Architecture',
963
968
  },
964
969
  CLAUDE_MD_SIZE_EXCEEDED: {
965
- agent: 'claude-md-compactor',
966
- prompt: 'Compact CLAUDE.md to under 40k characters while preserving critical project knowledge',
970
+ agent: 'general-purpose',
971
+ prompt: `Compact CLAUDE.md to under 40,000 characters. Follow these rules from Anthropic best practices:
972
+
973
+ 1. KEEP (critical): Title, Last Change (latest only), 30s Overview, Stack table, Architecture tree
974
+ 2. REMOVE: Verbose prose (use bullets), code examples >5 lines (use file refs), duplicate info, old Last Change entries, commented sections
975
+ 3. TARGET: <60 lines ideal, <300 max per HumanLayer research
976
+ 4. CONDENSE: "Auth uses JWT via lib/auth.ts" instead of paragraphs explaining JWT
977
+
978
+ Read .claude/agents/07-documentation/claude-md-compactor.md for detailed compaction template.
979
+ Validate with: wc -m CLAUDE.md (must be < 40000)`,
967
980
  },
968
981
  CLAUDE_MD_TEMPLATE_MERGE_NEEDED: {
969
982
  agent: 'documenter',
@@ -1155,14 +1168,26 @@ ${error.message}
1155
1168
  ${error.action}
1156
1169
 
1157
1170
  --------------------------------------------------------------------------------
1158
- REQUIRED ACTION: Launch the following subagent to fix this issue
1171
+ STEP 1: Fix the issue using this subagent
1159
1172
  --------------------------------------------------------------------------------
1160
1173
 
1161
1174
  Task(subagent_type="${subagentInfo.agent}", prompt="${subagentInfo.prompt}")
1162
1175
 
1163
1176
  --------------------------------------------------------------------------------
1164
- AFTER FIXING: You MUST try to complete the task again to trigger re-validation.
1165
- The stop hook will check for remaining issues. Repeat until ALL CHECKS PASSED.
1177
+ STEP 2: After fixing, run the validator MANUALLY to verify
1178
+ --------------------------------------------------------------------------------
1179
+
1180
+ Bash(command="npx tsx .claude/hooks/stop-validator.ts", description="Run stop validator manually")
1181
+
1182
+ This will show if the fix worked or if there are more issues to resolve.
1183
+ DO NOT try to complete the task until the validator returns "ALL CHECKS PASSED".
1184
+
1185
+ --------------------------------------------------------------------------------
1186
+ STEP 3: Repeat Steps 1-2 until ALL CHECKS PASSED
1187
+ --------------------------------------------------------------------------------
1188
+
1189
+ Only after seeing "ALL CHECKS PASSED" from the manual validator run,
1190
+ you may proceed to complete the task.
1166
1191
  ================================================================================
1167
1192
  `;
1168
1193