claude-toolkit 0.10.0 → 0.15.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 (40) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +2 -0
  3. package/core/agents/ct-code-reviewer.md +5 -4
  4. package/core/agents/ct-github-workflow.md +28 -15
  5. package/core/commands/ct/code-quality.md +22 -2
  6. package/core/commands/ct/onboard.md +8 -3
  7. package/core/commands/ct/pr-review.md +22 -88
  8. package/core/commands/ct/pr-summary.md +6 -3
  9. package/core/commands/ct/ticket.md +20 -3
  10. package/core/hooks/{skill-eval.js → skill-eval.cjs} +103 -41
  11. package/core/hooks/skill-rules.schema.json +4 -0
  12. package/core/skills/ct-code-style/SKILL.md +134 -0
  13. package/core/skills/ct-systematic-debugging/SKILL.md +1 -1
  14. package/core/skills/ct-testing-patterns/SKILL.md +5 -7
  15. package/core/skills/ct-typescript-conventions/SKILL.md +15 -11
  16. package/core/skills/ct-verification-before-completion/SKILL.md +2 -1
  17. package/docs/README.md +2 -0
  18. package/docs/commands/code-quality.md +2 -8
  19. package/docs/commands/onboard.md +2 -11
  20. package/docs/commands/pr-review.md +2 -13
  21. package/docs/commands/pr-summary.md +2 -2
  22. package/docs/commands/proto-check.md +4 -4
  23. package/docs/commands/ticket.md +2 -2
  24. package/docs/skills/code-style.md +26 -0
  25. package/docs/skills/systematic-debugging.md +1 -1
  26. package/docs/skills/testing-patterns.md +78 -56
  27. package/docs/skills/typescript-conventions.md +23 -10
  28. package/docs/skills/verification-before-completion.md +1 -1
  29. package/docs/stacks/esnext-idioms.md +25 -0
  30. package/package.json +2 -1
  31. package/src/detect.ts +74 -0
  32. package/src/generator.ts +19 -2
  33. package/src/types.ts +1 -0
  34. package/stacks/esnext/skills/ct-esnext-idioms/SKILL.md +130 -0
  35. package/stacks/esnext/stack.json +37 -0
  36. package/{core/commands/ct → stacks/protobuf/commands}/proto-check.md +11 -2
  37. package/stacks/solidjs/skills/ct-solidjs-patterns/SKILL.md +1 -1
  38. package/templates/configs/biome.base.json +8 -1
  39. package/templates/skill-rules.base.json +18 -23
  40. package/core/hooks/skill-eval.sh +0 -35
@@ -1,7 +1,16 @@
1
1
  ---
2
- description: "Validate protobuf definitions and check for breaking changes"
2
+ description: Validate protobuf definitions and check for breaking changes
3
3
  allowed-tools:
4
- - Bash
4
+ - Bash(buf:*)
5
+ - Bash(protoc:*)
6
+ - Bash(npm run:*)
7
+ - Bash(pnpm:*)
8
+ - Bash(bun run:*)
9
+ - Bash(yarn:*)
10
+ - Bash(tsc:*)
11
+ - Bash(cargo build:*)
12
+ - Bash(cargo check:*)
13
+ - Bash(go build:*)
5
14
  - Read
6
15
  - Glob
7
16
  - Grep
@@ -29,7 +29,7 @@ const [data] = createResource(userId, fetchUser); // async: data(), data.loading
29
29
 
30
30
  ## Props
31
31
 
32
- **CRITICAL: Never destructure props.** Destructuring breaks reactivity.
32
+ **CRITICAL: Never destructure props.** Destructuring breaks reactivity. (This overrides the general "use destructuring" guidance in `ct-code-style` — destructure plain data, never reactive `props`.)
33
33
 
34
34
  ```tsx
35
35
  // WRONG -- reads once, never updates
@@ -16,7 +16,14 @@
16
16
  "linter": {
17
17
  "enabled": true,
18
18
  "rules": {
19
- "recommended": true
19
+ "recommended": true,
20
+ "style": {
21
+ "noUselessElse": "error",
22
+ "noNestedTernary": "error"
23
+ },
24
+ "complexity": {
25
+ "useArrowFunction": "error"
26
+ }
20
27
  }
21
28
  },
22
29
  "javascript": {
@@ -40,8 +40,7 @@
40
40
  "(?:red.green.refactor|tdd)"
41
41
  ],
42
42
  "contentPatterns": ["describe\\(", "it\\(", "expect\\(", "vi\\.mock", "jest\\.mock"]
43
- },
44
- "excludePatterns": ["e2e", "end-to-end"]
43
+ }
45
44
  },
46
45
  "ct-typescript-conventions": {
47
46
  "description": "TypeScript strict mode and conventions",
@@ -67,31 +66,27 @@
67
66
  "contextPatterns": ["before claiming", "make sure", "double check"]
68
67
  }
69
68
  },
70
- "ct-github-actions": {
71
- "description": "GitHub Actions CI/CD workflow patterns",
69
+ "ct-code-style": {
70
+ "description": "Code structure & style — guard clauses, lookup tables, destructuring, no magic values",
72
71
  "priority": 6,
73
72
  "triggers": {
74
- "keywords": ["github action", "github workflow", "workflow", "ci/cd", "cicd", "pipeline"],
75
- "keywordPatterns": ["github.action", "ci/?cd", "\\bworkflow\\b"],
76
- "pathPatterns": [".github/workflows/**", ".github/**/*.yml"],
77
- "intentPatterns": [
78
- "(?:create|add|update).*(?:workflow|action|pipeline)",
79
- "(?:ci|cd).*(?:pipeline|workflow)"
73
+ "keywords": [
74
+ "refactor",
75
+ "clean up",
76
+ "guard clause",
77
+ "early return",
78
+ "destructure",
79
+ "ternary",
80
+ "magic number",
81
+ "magic string",
82
+ "lookup table",
83
+ "arrow function"
80
84
  ],
81
- "contentPatterns": ["runs-on:", "uses:", "steps:"]
82
- }
83
- },
84
- "ct-code-review": {
85
- "description": "Handle code review feedback",
86
- "priority": 4,
87
- "triggers": {
88
- "keywords": ["code review", "pr feedback", "review comment"],
89
- "keywordPatterns": ["code.review", "pr.feedback", "review.comment"],
85
+ "contentPatterns": ["else if", "else\\s*\\{", "\\bclass\\b", "this\\.", "\\bfunction\\b"],
90
86
  "intentPatterns": [
91
- "(?:respond|address|handle).*(?:review|feedback|comment)",
92
- "(?:reviewer).*(?:said|suggested|asked)"
93
- ],
94
- "contextPatterns": ["from the reviewer", "in the pr", "review feedback"]
87
+ "(?:refactor|clean up|simplify|tidy).*(?:code|function|logic)",
88
+ "(?:extract|avoid).*(?:magic|constant|conditional)"
89
+ ]
95
90
  }
96
91
  }
97
92
  }
@@ -1,35 +0,0 @@
1
- #!/bin/bash
2
- # Skill Evaluation Hook v2.0
3
- # Wrapper script that delegates to the Node.js evaluation engine
4
- #
5
- # This hook runs on UserPromptSubmit and analyzes the prompt for:
6
- # - Keywords and patterns indicating skill relevance
7
- # - File paths mentioned in the prompt
8
- # - Intent patterns (what the user wants to do)
9
- # - Directory mappings (what directories map to which skills)
10
- #
11
- # Configuration is in skill-rules.json
12
-
13
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
- NODE_SCRIPT="$SCRIPT_DIR/skill-eval.js"
15
-
16
- # Check if Node.js is available (bun also works)
17
- if command -v bun &>/dev/null; then
18
- RUNTIME="bun"
19
- elif command -v node &>/dev/null; then
20
- RUNTIME="node"
21
- else
22
- # Fallback: exit silently if no runtime found
23
- exit 0
24
- fi
25
-
26
- # Check if the Node script exists
27
- if [[ ! -f "$NODE_SCRIPT" ]]; then
28
- exit 0
29
- fi
30
-
31
- # Pipe stdin to the evaluation script (suppress stderr noise from shell init)
32
- cat | $RUNTIME "$NODE_SCRIPT" 2>/dev/null
33
-
34
- # Always exit 0 to allow the prompt through
35
- exit 0