claude-toolkit 0.1.9
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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +126 -0
- package/bin/cli.ts +112 -0
- package/core/agents/ct-code-reviewer.md +123 -0
- package/core/agents/ct-github-workflow.md +137 -0
- package/core/commands/ct/code-quality.md +59 -0
- package/core/commands/ct/onboard.md +84 -0
- package/core/commands/ct/pr-review.md +104 -0
- package/core/commands/ct/pr-summary.md +59 -0
- package/core/commands/ct/proto-check.md +74 -0
- package/core/commands/ct/ticket.md +71 -0
- package/core/hooks/skill-eval.js +381 -0
- package/core/hooks/skill-eval.sh +35 -0
- package/core/hooks/skill-rules.schema.json +112 -0
- package/core/skills/systematic-debugging/SKILL.md +44 -0
- package/core/skills/testing-patterns/SKILL.md +52 -0
- package/core/skills/typescript-conventions/SKILL.md +57 -0
- package/core/skills/verification-before-completion/SKILL.md +42 -0
- package/docs/README.md +49 -0
- package/docs/agents/code-reviewer.md +76 -0
- package/docs/agents/github-workflow.md +98 -0
- package/docs/best-practices/solidjs/README.md +43 -0
- package/docs/best-practices/solidjs/anti-patterns.md +166 -0
- package/docs/best-practices/solidjs/component-patterns.md +131 -0
- package/docs/best-practices/solidjs/context-and-global-state.md +131 -0
- package/docs/best-practices/solidjs/control-flow.md +124 -0
- package/docs/best-practices/solidjs/data-fetching.md +205 -0
- package/docs/best-practices/solidjs/effects-and-lifecycle.md +113 -0
- package/docs/best-practices/solidjs/performance.md +100 -0
- package/docs/best-practices/solidjs/props-patterns.md +100 -0
- package/docs/best-practices/solidjs/reactivity-model.md +104 -0
- package/docs/best-practices/solidjs/signals-and-state.md +78 -0
- package/docs/best-practices/solidjs/stores-and-nested-state.md +111 -0
- package/docs/best-practices/solidjs/typescript-integration.md +186 -0
- package/docs/best-practices/typescript/README.md +45 -0
- package/docs/best-practices/typescript/any-and-unknown.md +73 -0
- package/docs/best-practices/typescript/deriving-vs-decoupling.md +83 -0
- package/docs/best-practices/typescript/discriminated-unions.md +75 -0
- package/docs/best-practices/typescript/enums-alternatives.md +72 -0
- package/docs/best-practices/typescript/essential-patterns.md +119 -0
- package/docs/best-practices/typescript/generics-patterns.md +105 -0
- package/docs/best-practices/typescript/micro-opinions.md +87 -0
- package/docs/best-practices/typescript/runtime-validation.md +62 -0
- package/docs/best-practices/typescript/satisfies-operator.md +100 -0
- package/docs/best-practices/typescript/tsconfig-cheat-sheet.md +129 -0
- package/docs/best-practices/typescript/type-organization.md +64 -0
- package/docs/best-practices/typescript/type-vs-interface.md +80 -0
- package/docs/commands/code-quality.md +42 -0
- package/docs/commands/onboard.md +72 -0
- package/docs/commands/pr-review.md +102 -0
- package/docs/commands/pr-summary.md +50 -0
- package/docs/commands/proto-check.md +59 -0
- package/docs/commands/ticket.md +56 -0
- package/docs/skills/systematic-debugging.md +70 -0
- package/docs/skills/testing-patterns.md +89 -0
- package/docs/skills/typescript-conventions.md +137 -0
- package/docs/skills/verification-before-completion.md +91 -0
- package/docs/stacks/cloudflare-d1-kv.md +110 -0
- package/docs/stacks/i18n-typesafe.md +141 -0
- package/docs/stacks/protobuf-contracts.md +85 -0
- package/docs/stacks/rust-wasm-patterns.md +106 -0
- package/docs/stacks/solidjs-patterns.md +110 -0
- package/docs/stacks/vanilla-extract-patterns.md +115 -0
- package/package.json +58 -0
- package/src/generator.ts +317 -0
- package/src/index.ts +30 -0
- package/src/types.ts +85 -0
- package/src/utils.ts +53 -0
- package/stacks/cloudflare/skills/cloudflare-d1-kv/SKILL.md +84 -0
- package/stacks/cloudflare/stack.json +26 -0
- package/stacks/i18n-typesafe/skills/i18n-typesafe/SKILL.md +64 -0
- package/stacks/i18n-typesafe/stack.json +25 -0
- package/stacks/protobuf/skills/protobuf-contracts/SKILL.md +78 -0
- package/stacks/protobuf/stack.json +25 -0
- package/stacks/rust-wasm/skills/rust-wasm-patterns/SKILL.md +76 -0
- package/stacks/rust-wasm/stack.json +26 -0
- package/stacks/solidjs/skills/solidjs-patterns/SKILL.md +66 -0
- package/stacks/solidjs/stack.json +52 -0
- package/stacks/vanilla-extract/skills/vanilla-extract-patterns/SKILL.md +76 -0
- package/stacks/vanilla-extract/stack.json +40 -0
- package/templates/claude-toolkit.config.ts +34 -0
- package/templates/configs/biome.base.json +35 -0
- package/templates/configs/tsconfig.base.json +16 -0
- package/templates/skill-rules.base.json +98 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ct-vanilla-extract-patterns
|
|
3
|
+
description: Type-safe CSS with vanilla-extract, sprinkles, and recipes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Vanilla Extract Patterns
|
|
7
|
+
|
|
8
|
+
All styles in `*.css.ts` files only. Build-time extraction, zero runtime.
|
|
9
|
+
|
|
10
|
+
## Core APIs
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
// style() -- scoped class
|
|
14
|
+
export const button = style({ padding: '8px 16px', ':hover': { opacity: 0.9 } });
|
|
15
|
+
|
|
16
|
+
// Compose via array
|
|
17
|
+
export const primary = style([button, { background: 'blue', color: 'white' }]);
|
|
18
|
+
|
|
19
|
+
// styleVariants() -- variant map
|
|
20
|
+
export const color = styleVariants({
|
|
21
|
+
primary: { background: 'blue', color: 'white' },
|
|
22
|
+
danger: { background: 'red', color: 'white' },
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## recipe() -- Multi-Variant Components
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
export const btn = recipe({
|
|
30
|
+
base: { padding: '8px 16px', border: 'none' },
|
|
31
|
+
variants: {
|
|
32
|
+
color: { primary: { background: 'blue' }, secondary: { background: 'gray' } },
|
|
33
|
+
size: { sm: { fontSize: '12px' }, md: { fontSize: '14px' }, lg: { fontSize: '16px' } },
|
|
34
|
+
},
|
|
35
|
+
compoundVariants: [{ variants: { color: 'primary', size: 'lg' }, style: { fontWeight: 'bold' } }],
|
|
36
|
+
defaultVariants: { color: 'primary', size: 'md' },
|
|
37
|
+
});
|
|
38
|
+
// Usage: btn({ color: 'secondary', size: 'lg' })
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Theming
|
|
42
|
+
|
|
43
|
+
Contract-first approach -- define shape, then fill per theme:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
export const vars = createThemeContract({
|
|
47
|
+
color: { brand: null, text: null, bg: null },
|
|
48
|
+
space: { sm: null, md: null, lg: null },
|
|
49
|
+
});
|
|
50
|
+
export const light = createTheme(vars, {
|
|
51
|
+
color: { brand: '#0066ff', text: '#1a1a1a', bg: '#fff' },
|
|
52
|
+
space: { sm: '4px', md: '8px', lg: '16px' },
|
|
53
|
+
});
|
|
54
|
+
// Use in styles: style({ color: vars.color.brand })
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Sprinkles
|
|
58
|
+
|
|
59
|
+
Constrained atomic utility classes with responsive conditions:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
const props = defineProperties({
|
|
63
|
+
conditions: { mobile: {}, tablet: { '@media': '(min-width: 768px)' } },
|
|
64
|
+
defaultCondition: 'mobile',
|
|
65
|
+
properties: { display: ['none', 'flex', 'block'], padding: vars.space },
|
|
66
|
+
});
|
|
67
|
+
export const sprinkles = createSprinkles(props);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Anti-Patterns
|
|
71
|
+
|
|
72
|
+
1. **Inline styles** -- Use `style()` or `sprinkles()`.
|
|
73
|
+
2. **Runtime CSS** -- No `document.createElement('style')` or CSS-in-JS libs alongside.
|
|
74
|
+
3. **Overusing globalStyle** -- Prefer scoped `style()`. Reserve global for resets only.
|
|
75
|
+
4. **Non-`.css.ts` files** -- Build plugin only processes `*.css.ts`.
|
|
76
|
+
5. **Raw CSS variable strings** -- Use the `vars` object for type-safe references.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ct-vanilla-extract-patterns",
|
|
3
|
+
"description": "Type-safe CSS with vanilla-extract, sprinkles, and recipes",
|
|
4
|
+
"defaultMappings": {
|
|
5
|
+
"src/styles": "ct-vanilla-extract-patterns",
|
|
6
|
+
"src/theme": "ct-vanilla-extract-patterns"
|
|
7
|
+
},
|
|
8
|
+
"fileExtensions": ["css.ts"],
|
|
9
|
+
"skillRules": {
|
|
10
|
+
"ct-vanilla-extract-patterns": {
|
|
11
|
+
"description": "Type-safe CSS with vanilla-extract styling patterns",
|
|
12
|
+
"priority": 7,
|
|
13
|
+
"triggers": {
|
|
14
|
+
"keywords": [
|
|
15
|
+
"vanilla-extract",
|
|
16
|
+
"style",
|
|
17
|
+
"sprinkles",
|
|
18
|
+
"recipe",
|
|
19
|
+
"theme",
|
|
20
|
+
"css.ts",
|
|
21
|
+
"styleVariants"
|
|
22
|
+
],
|
|
23
|
+
"keywordPatterns": ["\\bstyle\\(", "\\brecipe\\(", "\\bsprinkles\\(", "\\.css\\.ts\\b"],
|
|
24
|
+
"pathPatterns": ["**/*.css.ts", "**/styles/**", "**/theme/**"],
|
|
25
|
+
"intentPatterns": [
|
|
26
|
+
"(?:style|design|theme|css).*(?:component|page|layout)",
|
|
27
|
+
"(?:create|add).*(?:style|variant|theme)"
|
|
28
|
+
],
|
|
29
|
+
"contentPatterns": [
|
|
30
|
+
"style\\(",
|
|
31
|
+
"styleVariants\\(",
|
|
32
|
+
"recipe\\(",
|
|
33
|
+
"globalStyle\\(",
|
|
34
|
+
"createTheme\\("
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"relatedSkills": ["ct-solidjs-patterns"]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineConfig } from "claude-toolkit";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
// Stack packs to activate — each adds skills, directory mappings, and hook rules
|
|
5
|
+
stacks: [],
|
|
6
|
+
|
|
7
|
+
// Package manager used for install/run commands
|
|
8
|
+
packageManager: "bun",
|
|
9
|
+
|
|
10
|
+
// Hook automation — commands run automatically on file changes
|
|
11
|
+
hooks: {
|
|
12
|
+
formatter: "bun run prettier --write",
|
|
13
|
+
testRunner: "bun run vitest run",
|
|
14
|
+
typeCheck: "bun run tsc --noEmit",
|
|
15
|
+
// extraChecks: ['cargo check --target wasm32-unknown-unknown'],
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
// Directory → skill mappings (merged with stack defaults)
|
|
19
|
+
directoryMappings: {
|
|
20
|
+
// 'src/components': 'my-skill',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Git workflow configuration
|
|
24
|
+
git: {
|
|
25
|
+
branchPrefix: "dev",
|
|
26
|
+
protectedBranches: ["main"],
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// Project metadata for CLAUDE.md generation
|
|
30
|
+
project: {
|
|
31
|
+
name: "my-project",
|
|
32
|
+
description: "Project description",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignoreUnknown": false
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "tab",
|
|
14
|
+
"lineWidth": 100
|
|
15
|
+
},
|
|
16
|
+
"linter": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"rules": {
|
|
19
|
+
"recommended": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"javascript": {
|
|
23
|
+
"formatter": {
|
|
24
|
+
"quoteStyle": "double"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"assist": {
|
|
28
|
+
"enabled": true,
|
|
29
|
+
"actions": {
|
|
30
|
+
"source": {
|
|
31
|
+
"organizeImports": "on"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noUncheckedIndexedAccess": true,
|
|
8
|
+
"exactOptionalPropertyTypes": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"declarationMap": true,
|
|
14
|
+
"sourceMap": true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skills": {
|
|
3
|
+
"ct-systematic-debugging": {
|
|
4
|
+
"description": "Four-phase debugging with root cause analysis",
|
|
5
|
+
"priority": 9,
|
|
6
|
+
"triggers": {
|
|
7
|
+
"keywords": ["bug", "debug", "fix", "error", "issue", "broken", "crash", "failing"],
|
|
8
|
+
"keywordPatterns": [
|
|
9
|
+
"\\bbug\\b",
|
|
10
|
+
"\\bfix\\b",
|
|
11
|
+
"\\berror\\b",
|
|
12
|
+
"\\bissue\\b",
|
|
13
|
+
"doesn't work",
|
|
14
|
+
"not working"
|
|
15
|
+
],
|
|
16
|
+
"intentPatterns": [
|
|
17
|
+
"(?:fix|debug|resolve|investigate).*(?:bug|error|issue|problem)",
|
|
18
|
+
"(?:why).*(?:not working|broken|failing|crash)",
|
|
19
|
+
"(?:something).*(?:wrong|broken)"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"excludePatterns": ["fix typo", "fix formatting", "fix lint"]
|
|
23
|
+
},
|
|
24
|
+
"ct-testing-patterns": {
|
|
25
|
+
"description": "Test-driven development workflow and patterns",
|
|
26
|
+
"priority": 9,
|
|
27
|
+
"triggers": {
|
|
28
|
+
"keywords": ["test", "spec", "tdd", "mock", "factory", "vitest", "jest"],
|
|
29
|
+
"keywordPatterns": ["\\btest(?:s|ing)?\\b", "\\bspec\\b", "unit test"],
|
|
30
|
+
"pathPatterns": [
|
|
31
|
+
"**/*.test.ts",
|
|
32
|
+
"**/*.test.tsx",
|
|
33
|
+
"**/*.spec.ts",
|
|
34
|
+
"**/test-utils/**",
|
|
35
|
+
"**/__mocks__/**"
|
|
36
|
+
],
|
|
37
|
+
"intentPatterns": [
|
|
38
|
+
"(?:write|add|create|fix).*(?:test|spec)",
|
|
39
|
+
"(?:test|spec).*(?:for|of|the)",
|
|
40
|
+
"(?:red.green.refactor|tdd)"
|
|
41
|
+
],
|
|
42
|
+
"contentPatterns": ["describe\\(", "it\\(", "expect\\(", "vi\\.mock", "jest\\.mock"]
|
|
43
|
+
},
|
|
44
|
+
"excludePatterns": ["e2e", "end-to-end"]
|
|
45
|
+
},
|
|
46
|
+
"ct-typescript-conventions": {
|
|
47
|
+
"description": "TypeScript strict mode and conventions",
|
|
48
|
+
"priority": 5,
|
|
49
|
+
"triggers": {
|
|
50
|
+
"keywords": ["typescript", "type", "interface", "generic", "strict mode"],
|
|
51
|
+
"keywordPatterns": ["\\btype\\b", "\\binterface\\b", "\\bgeneric\\b"],
|
|
52
|
+
"pathPatterns": ["**/*.d.ts", "**/types/**", "**/types.ts"],
|
|
53
|
+
"intentPatterns": ["(?:define|create).*(?:type|interface)", "(?:type).*(?:error|issue)"],
|
|
54
|
+
"contentPatterns": ["interface ", "type ", ": unknown", "as const"]
|
|
55
|
+
},
|
|
56
|
+
"excludePatterns": ["issue type", "type of bug"]
|
|
57
|
+
},
|
|
58
|
+
"ct-verification-before-completion": {
|
|
59
|
+
"description": "Evidence-based completion claims protocol",
|
|
60
|
+
"priority": 8,
|
|
61
|
+
"triggers": {
|
|
62
|
+
"keywords": ["verify", "check", "confirm", "done", "complete", "finished"],
|
|
63
|
+
"intentPatterns": [
|
|
64
|
+
"(?:is it|are we).*(?:done|complete|finished)",
|
|
65
|
+
"(?:verify|check|confirm).*(?:works|passes)"
|
|
66
|
+
],
|
|
67
|
+
"contextPatterns": ["before claiming", "make sure", "double check"]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"ct-github-actions": {
|
|
71
|
+
"description": "GitHub Actions CI/CD workflow patterns",
|
|
72
|
+
"priority": 6,
|
|
73
|
+
"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)"
|
|
80
|
+
],
|
|
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"],
|
|
90
|
+
"intentPatterns": [
|
|
91
|
+
"(?:respond|address|handle).*(?:review|feedback|comment)",
|
|
92
|
+
"(?:reviewer).*(?:said|suggested|asked)"
|
|
93
|
+
],
|
|
94
|
+
"contextPatterns": ["from the reviewer", "in the pr", "review feedback"]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|