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.
Files changed (85) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE +21 -0
  3. package/README.md +126 -0
  4. package/bin/cli.ts +112 -0
  5. package/core/agents/ct-code-reviewer.md +123 -0
  6. package/core/agents/ct-github-workflow.md +137 -0
  7. package/core/commands/ct/code-quality.md +59 -0
  8. package/core/commands/ct/onboard.md +84 -0
  9. package/core/commands/ct/pr-review.md +104 -0
  10. package/core/commands/ct/pr-summary.md +59 -0
  11. package/core/commands/ct/proto-check.md +74 -0
  12. package/core/commands/ct/ticket.md +71 -0
  13. package/core/hooks/skill-eval.js +381 -0
  14. package/core/hooks/skill-eval.sh +35 -0
  15. package/core/hooks/skill-rules.schema.json +112 -0
  16. package/core/skills/systematic-debugging/SKILL.md +44 -0
  17. package/core/skills/testing-patterns/SKILL.md +52 -0
  18. package/core/skills/typescript-conventions/SKILL.md +57 -0
  19. package/core/skills/verification-before-completion/SKILL.md +42 -0
  20. package/docs/README.md +49 -0
  21. package/docs/agents/code-reviewer.md +76 -0
  22. package/docs/agents/github-workflow.md +98 -0
  23. package/docs/best-practices/solidjs/README.md +43 -0
  24. package/docs/best-practices/solidjs/anti-patterns.md +166 -0
  25. package/docs/best-practices/solidjs/component-patterns.md +131 -0
  26. package/docs/best-practices/solidjs/context-and-global-state.md +131 -0
  27. package/docs/best-practices/solidjs/control-flow.md +124 -0
  28. package/docs/best-practices/solidjs/data-fetching.md +205 -0
  29. package/docs/best-practices/solidjs/effects-and-lifecycle.md +113 -0
  30. package/docs/best-practices/solidjs/performance.md +100 -0
  31. package/docs/best-practices/solidjs/props-patterns.md +100 -0
  32. package/docs/best-practices/solidjs/reactivity-model.md +104 -0
  33. package/docs/best-practices/solidjs/signals-and-state.md +78 -0
  34. package/docs/best-practices/solidjs/stores-and-nested-state.md +111 -0
  35. package/docs/best-practices/solidjs/typescript-integration.md +186 -0
  36. package/docs/best-practices/typescript/README.md +45 -0
  37. package/docs/best-practices/typescript/any-and-unknown.md +73 -0
  38. package/docs/best-practices/typescript/deriving-vs-decoupling.md +83 -0
  39. package/docs/best-practices/typescript/discriminated-unions.md +75 -0
  40. package/docs/best-practices/typescript/enums-alternatives.md +72 -0
  41. package/docs/best-practices/typescript/essential-patterns.md +119 -0
  42. package/docs/best-practices/typescript/generics-patterns.md +105 -0
  43. package/docs/best-practices/typescript/micro-opinions.md +87 -0
  44. package/docs/best-practices/typescript/runtime-validation.md +62 -0
  45. package/docs/best-practices/typescript/satisfies-operator.md +100 -0
  46. package/docs/best-practices/typescript/tsconfig-cheat-sheet.md +129 -0
  47. package/docs/best-practices/typescript/type-organization.md +64 -0
  48. package/docs/best-practices/typescript/type-vs-interface.md +80 -0
  49. package/docs/commands/code-quality.md +42 -0
  50. package/docs/commands/onboard.md +72 -0
  51. package/docs/commands/pr-review.md +102 -0
  52. package/docs/commands/pr-summary.md +50 -0
  53. package/docs/commands/proto-check.md +59 -0
  54. package/docs/commands/ticket.md +56 -0
  55. package/docs/skills/systematic-debugging.md +70 -0
  56. package/docs/skills/testing-patterns.md +89 -0
  57. package/docs/skills/typescript-conventions.md +137 -0
  58. package/docs/skills/verification-before-completion.md +91 -0
  59. package/docs/stacks/cloudflare-d1-kv.md +110 -0
  60. package/docs/stacks/i18n-typesafe.md +141 -0
  61. package/docs/stacks/protobuf-contracts.md +85 -0
  62. package/docs/stacks/rust-wasm-patterns.md +106 -0
  63. package/docs/stacks/solidjs-patterns.md +110 -0
  64. package/docs/stacks/vanilla-extract-patterns.md +115 -0
  65. package/package.json +58 -0
  66. package/src/generator.ts +317 -0
  67. package/src/index.ts +30 -0
  68. package/src/types.ts +85 -0
  69. package/src/utils.ts +53 -0
  70. package/stacks/cloudflare/skills/cloudflare-d1-kv/SKILL.md +84 -0
  71. package/stacks/cloudflare/stack.json +26 -0
  72. package/stacks/i18n-typesafe/skills/i18n-typesafe/SKILL.md +64 -0
  73. package/stacks/i18n-typesafe/stack.json +25 -0
  74. package/stacks/protobuf/skills/protobuf-contracts/SKILL.md +78 -0
  75. package/stacks/protobuf/stack.json +25 -0
  76. package/stacks/rust-wasm/skills/rust-wasm-patterns/SKILL.md +76 -0
  77. package/stacks/rust-wasm/stack.json +26 -0
  78. package/stacks/solidjs/skills/solidjs-patterns/SKILL.md +66 -0
  79. package/stacks/solidjs/stack.json +52 -0
  80. package/stacks/vanilla-extract/skills/vanilla-extract-patterns/SKILL.md +76 -0
  81. package/stacks/vanilla-extract/stack.json +40 -0
  82. package/templates/claude-toolkit.config.ts +34 -0
  83. package/templates/configs/biome.base.json +35 -0
  84. package/templates/configs/tsconfig.base.json +16 -0
  85. package/templates/skill-rules.base.json +98 -0
@@ -0,0 +1,35 @@
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
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Skill Rules Configuration",
4
+ "description": "Configuration for automatic skill activation based on prompt analysis",
5
+ "type": "object",
6
+ "required": ["version", "config", "scoring", "skills"],
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string",
10
+ "description": "JSON Schema reference"
11
+ },
12
+ "version": {
13
+ "type": "string",
14
+ "description": "Schema version",
15
+ "pattern": "^\\d+\\.\\d+$"
16
+ },
17
+ "config": {
18
+ "type": "object",
19
+ "description": "Global configuration options",
20
+ "required": ["minConfidenceScore", "showMatchReasons", "maxSkillsToShow"],
21
+ "properties": {
22
+ "minConfidenceScore": {
23
+ "type": "integer",
24
+ "minimum": 1,
25
+ "description": "Minimum score required to suggest a skill"
26
+ },
27
+ "showMatchReasons": {
28
+ "type": "boolean",
29
+ "description": "Whether to show why each skill was matched"
30
+ },
31
+ "maxSkillsToShow": {
32
+ "type": "integer",
33
+ "minimum": 1,
34
+ "maximum": 10,
35
+ "description": "Maximum number of skills to show in output"
36
+ }
37
+ }
38
+ },
39
+ "scoring": {
40
+ "type": "object",
41
+ "description": "Points assigned to each match type",
42
+ "required": [
43
+ "keyword",
44
+ "keywordPattern",
45
+ "pathPattern",
46
+ "directoryMatch",
47
+ "intentPattern",
48
+ "contentPattern",
49
+ "contextPattern"
50
+ ],
51
+ "properties": {
52
+ "keyword": { "type": "integer", "minimum": 1 },
53
+ "keywordPattern": { "type": "integer", "minimum": 1 },
54
+ "pathPattern": { "type": "integer", "minimum": 1 },
55
+ "directoryMatch": { "type": "integer", "minimum": 1 },
56
+ "intentPattern": { "type": "integer", "minimum": 1 },
57
+ "contentPattern": { "type": "integer", "minimum": 1 },
58
+ "contextPattern": { "type": "integer", "minimum": 1 }
59
+ }
60
+ },
61
+ "directoryMappings": {
62
+ "type": "object",
63
+ "description": "Map directory paths to skill names",
64
+ "additionalProperties": { "type": "string" }
65
+ },
66
+ "skills": {
67
+ "type": "object",
68
+ "description": "Skill definitions and their triggers",
69
+ "additionalProperties": {
70
+ "type": "object",
71
+ "required": ["description", "triggers"],
72
+ "properties": {
73
+ "description": { "type": "string" },
74
+ "priority": {
75
+ "type": "integer",
76
+ "minimum": 1,
77
+ "maximum": 10,
78
+ "default": 5
79
+ },
80
+ "triggers": {
81
+ "type": "object",
82
+ "properties": {
83
+ "keywords": { "type": "array", "items": { "type": "string" } },
84
+ "keywordPatterns": {
85
+ "type": "array",
86
+ "items": { "type": "string" }
87
+ },
88
+ "pathPatterns": {
89
+ "type": "array",
90
+ "items": { "type": "string" }
91
+ },
92
+ "intentPatterns": {
93
+ "type": "array",
94
+ "items": { "type": "string" }
95
+ },
96
+ "contentPatterns": {
97
+ "type": "array",
98
+ "items": { "type": "string" }
99
+ },
100
+ "contextPatterns": {
101
+ "type": "array",
102
+ "items": { "type": "string" }
103
+ }
104
+ }
105
+ },
106
+ "excludePatterns": { "type": "array", "items": { "type": "string" } },
107
+ "relatedSkills": { "type": "array", "items": { "type": "string" } }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: ct-systematic-debugging
3
+ description: Four-phase methodology for diagnosing and fixing bugs efficiently without guesswork.
4
+ ---
5
+
6
+ # Systematic Debugging
7
+
8
+ Replace trial-and-error with structured investigation. Follow phases in order.
9
+
10
+ ## Phase 1: Observe
11
+
12
+ - Reproduce reliably with minimal steps. No repro = no verified fix.
13
+ - Read the full stack trace and error message. Do not skim.
14
+ - `git log`/`git diff` to identify what changed since last known-good state.
15
+ - Record observations (environment, input, timing), not theories.
16
+
17
+ ## Phase 2: Hypothesize
18
+
19
+ - List 2-3 possible causes before investigating any.
20
+ - Rank by: what changed recently, simplest explanation, where evidence points.
21
+ - Trace data flow from input to error. Check assumptions about dependencies/configs.
22
+
23
+ ## Phase 3: Test
24
+
25
+ - Change one variable per experiment. Multiple changes = ambiguous results.
26
+ - Write minimal reproduction (unit test, script, reduced input).
27
+ - Add logging at function boundaries and data transformations.
28
+ - Design tests that would **disprove** each hypothesis.
29
+ - Binary search large problem spaces systematically.
30
+
31
+ ## Phase 4: Fix
32
+
33
+ - Fix root cause, not symptom. A null check that hides a null source is not a fix.
34
+ - Smallest change possible. Run reproduction to confirm fix.
35
+ - Run full test suite for regressions. Add a test for this bug class.
36
+ - Commit message explains cause and why fix is correct.
37
+
38
+ ## Anti-Patterns
39
+
40
+ 1. **Shotgun debugging** -- Random changes without hypotheses.
41
+ 2. **Fixing symptoms** -- Null checks/try-catch without understanding the unexpected state.
42
+ 3. **Debug by rewriting** -- Bug may survive the rewrite; new bugs may appear.
43
+ 4. **"It works now"** -- Intermittent bugs are race conditions or state leaks. Investigate.
44
+ 5. **Assuming the bug is elsewhere** -- Check your own code first. The framework is rarely the problem.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: ct-testing-patterns
3
+ description: Generic test-driven development practices and patterns applicable to any language or test framework.
4
+ ---
5
+
6
+ # Testing Patterns
7
+
8
+ ## TDD Cycle
9
+
10
+ 1. **Red** -- Write a failing test for desired behavior. Confirm it fails for the right reason.
11
+ 2. **Green** -- Minimal code to pass. No optimization yet.
12
+ 3. **Refactor** -- Clean up while keeping tests green. Commit at each stage.
13
+
14
+ ## Test Behavior, Not Implementation
15
+
16
+ Test *what* code does (public interface, observable outputs), not *how* (internal state, call counts). Implementation-coupled tests break on every refactor.
17
+
18
+ ## Factory Pattern
19
+
20
+ ```
21
+ function getMockUser(overrides = {}) {
22
+ return { id: "user-1", email: "test@example.com", name: "Test User", role: "member", ...overrides };
23
+ }
24
+ const admin = getMockUser({ role: "admin" });
25
+ ```
26
+
27
+ New required fields update the factory once, not every test.
28
+
29
+ ## Organization
30
+
31
+ - Co-locate tests or mirror source structure. One test file per module (`module.test.ext`).
32
+ - Group with `describe`, name as sentences: `it("rejects expired tokens")`.
33
+
34
+ ## Mocking Rules
35
+
36
+ - Prefer real dependencies (in-memory DB, local server) when feasible.
37
+ - Mock at boundaries only (external APIs, email, payments), not internal modules.
38
+ - Keep mocks minimal -- only methods your code calls. Reset between tests.
39
+ - Verify mocks match the real API. Update when APIs change.
40
+
41
+ ## Test Pyramid
42
+
43
+ Many unit tests (fast, focused) > some integration tests (multi-component) > few E2E tests (full flow).
44
+
45
+ ## Anti-Patterns
46
+
47
+ 1. **Testing implementation** -- Asserting internal state or call counts breaks on refactors.
48
+ 2. **Overmocking** -- If most of the test is mock setup, you're testing mocks.
49
+ 3. **Copy-paste tests** -- Use factories and parameterized tests.
50
+ 4. **No assertions** -- Worse than no test. False confidence.
51
+ 5. **Ignoring flaky tests** -- Fix or delete; never skip indefinitely.
52
+ 6. **Happy path only** -- Error cases and boundary conditions are where bugs live.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: ct-typescript-conventions
3
+ description: Strict TypeScript patterns for type safety, readability, and maintainable codebases.
4
+ ---
5
+
6
+ # TypeScript Conventions
7
+
8
+ Strict mode enabled. Catch errors at compile time, not runtime.
9
+
10
+ ## Rules
11
+
12
+ - **No `any`** -- Use `unknown` + narrowing, generics, or specific types.
13
+ - **`interface` for objects**, `type` for unions/intersections/utilities.
14
+ - **`as const`** for literal types and readonly tuples.
15
+ - **Never disable strict checks.** Hard-to-type code = design issue.
16
+
17
+ ## Exhaustive Switch
18
+
19
+ ```typescript
20
+ function getPerms(role: UserRole): string[] {
21
+ switch (role) {
22
+ case "admin": return ["read", "write", "delete"];
23
+ case "member": return ["read", "write"];
24
+ case "guest": return ["read"];
25
+ default: { const _: never = role; throw new Error(`Unhandled: ${_}`); }
26
+ }
27
+ }
28
+ ```
29
+
30
+ Adding a new `UserRole` value causes a compile error at `never`, forcing handling.
31
+
32
+ ## Discriminated Unions
33
+
34
+ Model states with different data as unions. Narrowing on the discriminant gives type-safe access.
35
+
36
+ ```typescript
37
+ type AsyncState<T> =
38
+ | { status: "loading" }
39
+ | { status: "success"; data: T }
40
+ | { status: "error"; error: Error };
41
+ ```
42
+
43
+ ## Generic Constraints
44
+
45
+ ```typescript
46
+ function findById<T extends { id: string }>(items: T[], id: string): T | undefined {
47
+ return items.find(item => item.id === id);
48
+ }
49
+ ```
50
+
51
+ ## Anti-Patterns
52
+
53
+ 1. **`as` casts** -- Use type guards and narrowing instead.
54
+ 2. **Non-null assertion `!`** -- Handle the null case explicitly.
55
+ 3. **Enums** -- Prefer string literal unions. Enums generate runtime code with surprising behavior.
56
+ 4. **`Object`, `Function`, `{}`** -- Use specific interfaces or `Record<string, unknown>`.
57
+ 5. **`@ts-ignore`** -- Without an explanatory comment and tracking issue, the error will be forgotten.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: ct-verification-before-completion
3
+ description: Evidence-based completion claims -- never say "done" without proof that the work is correct.
4
+ ---
5
+
6
+ # Verification Before Completion
7
+
8
+ **Never claim "done" without evidence.** "I wrote the code" is not evidence. "Tests pass, types check, here is the output" is evidence.
9
+
10
+ ## Checklist
11
+
12
+ Before claiming complete, run and show output for each:
13
+
14
+ 1. **Tests pass** -- Full suite or related tests. Show actual output, not just "tests pass".
15
+ 2. **Types check** -- `tsc --noEmit` with zero errors on changed files.
16
+ 3. **Lint passes** -- Fix violations introduced by your changes.
17
+ 4. **Feature works** -- Show actual output (API response, CLI output, screenshot) for user-facing changes.
18
+
19
+ ## Edge Cases to Verify
20
+
21
+ - Empty inputs (empty string, empty array, null, undefined)
22
+ - Boundary values (zero, negative, max, off-by-one)
23
+ - Invalid inputs (wrong types, malformed data, missing fields)
24
+ - Error paths (network failure, permission denied)
25
+
26
+ Do not assume edge cases work because the happy path works.
27
+
28
+ ## Regression Check
29
+
30
+ - Run tests for modules that depend on changed code.
31
+ - Verify consumers of changed APIs/schemas still work.
32
+ - Smoke test the running application if applicable.
33
+
34
+ ## Evidence Format
35
+
36
+ ```
37
+ ## Completed: [task name]
38
+ - Tests: X passing (Y new, Z existing) -- [command output]
39
+ - Types: tsc --noEmit: 0 errors
40
+ - Manual: [endpoint/action]: [status/result]
41
+ - Edge cases: [what was verified]
42
+ ```
package/docs/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # claude-toolkit Documentation
2
+
3
+ Complete reference for all skills, commands, and agents provided by claude-toolkit.
4
+
5
+ ## Core Skills
6
+
7
+ Skills that are always included regardless of stack configuration.
8
+
9
+ | Skill | Description |
10
+ | -------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
11
+ | [ct-systematic-debugging](skills/systematic-debugging.md) | Four-phase methodology for diagnosing and fixing bugs without guesswork |
12
+ | [ct-testing-patterns](skills/testing-patterns.md) | Framework-agnostic TDD practices, mocking strategies, and test organization |
13
+ | [ct-typescript-conventions](skills/typescript-conventions.md) | Strict TypeScript patterns for type safety and maintainability |
14
+ | [ct-verification-before-completion](skills/verification-before-completion.md) | Evidence-based completion claims with structured verification checklist |
15
+
16
+ ## Commands
17
+
18
+ Slash commands available in Claude Code sessions.
19
+
20
+ | Command | Description |
21
+ | ----------------------------------------- | -------------------------------------------------------------------------- |
22
+ | [/ct:code-quality](commands/code-quality.md) | Run lint, typecheck, and format checks with structured reporting |
23
+ | [/ct:pr-review](commands/pr-review.md) | Checklist-based code review against project standards |
24
+ | [/ct:pr-summary](commands/pr-summary.md) | Generate a structured PR summary from branch diff and commits |
25
+ | [/ct:onboard](commands/onboard.md) | Systematically explore and understand a codebase area |
26
+ | [/ct:ticket](commands/ticket.md) | Work end-to-end on a ticket: understand, explore, plan, implement, deliver |
27
+ | [/ct:proto-check](commands/proto-check.md) | Validate protobuf definitions, lint, breaking changes, and code generation |
28
+
29
+ ## Agents
30
+
31
+ Specialized agents with dedicated models and review capabilities.
32
+
33
+ | Agent | Model | Description |
34
+ | -------------------------------------------- | ------ | -------------------------------------------------------------------------- |
35
+ | [ct-code-reviewer](agents/ct-code-reviewer.md) | Opus | Senior code reviewer with stack-aware analysis and severity-based feedback |
36
+ | [ct-github-workflow](agents/ct-github-workflow.md) | Sonnet | Git workflow assistant for branching, commits, and PR creation |
37
+
38
+ ## Stack Skills
39
+
40
+ Stack-specific skills activated based on your `claude-toolkit.config.ts` configuration.
41
+
42
+ | Skill | Stack | Description |
43
+ | -------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------ |
44
+ | [ct-solidjs-patterns](stacks/solidjs-patterns.md) | `solidjs` | Reactivity, signals, effects, component patterns, and props handling |
45
+ | [ct-vanilla-extract-patterns](stacks/vanilla-extract-patterns.md) | `vanilla-extract` | Type-safe CSS with zero runtime: styles, recipes, themes, sprinkles |
46
+ | [ct-rust-wasm-patterns](stacks/rust-wasm-patterns.md) | `rust-wasm` | Rust WASM for Cloudflare Workers: routing, handlers, env bindings |
47
+ | [ct-protobuf-contracts](stacks/protobuf-contracts.md) | `protobuf` | Protocol Buffers for API contracts: schema design, versioning, code generation |
48
+ | [ct-cloudflare-d1-kv](stacks/cloudflare-d1-kv.md) | `cloudflare` | D1 database and KV cache: queries, migrations, caching patterns |
49
+ | [ct-i18n-typesafe](stacks/i18n-typesafe.md) | `i18n-typesafe` | Type-safe internationalization with compile-time key checking |
@@ -0,0 +1,76 @@
1
+ # Code Reviewer Agent
2
+
3
+ > Senior code reviewer with stack-aware analysis.
4
+
5
+ **Type:** Agent
6
+ **Model:** Opus (highest capability)
7
+ **Source:** [`core/agents/ct-code-reviewer.md`](../core/agents/ct-code-reviewer.md)
8
+
9
+ ## Overview
10
+
11
+ A senior code reviewer agent that thoroughly reviews code changes, providing actionable feedback organized by severity. It adapts review criteria to the project's stack and conventions.
12
+
13
+ ## Review Process
14
+
15
+ 1. **Read the full diff** and all changed files in their entirety -- understands surrounding context, not just changed lines
16
+ 2. **Identify the stack** by reading project config files -- adapts criteria accordingly
17
+ 3. **Apply the review checklist** to every changed file
18
+ 4. **Compile findings** with severity levels and specific file/line references
19
+
20
+ ## Review Checklist
21
+
22
+ ### Critical Issues
23
+
24
+ | Category | Checks |
25
+ | --- | --- |
26
+ | **Logic Correctness** | Off-by-one errors, inverted conditions, unhandled edge cases, race conditions, incorrect state transitions, dead code |
27
+ | **Error Handling** | Swallowed errors, missing context in error messages, leaked resources, unhandled crashes, missing error boundaries |
28
+ | **Security** | SQL/XSS/command injection, missing auth, secrets in code, CORS issues, missing rate limiting |
29
+
30
+ ### Warnings
31
+
32
+ | Category | Checks |
33
+ | --- | --- |
34
+ | **Type Safety** | `any` usage, unsafe casts, missing null checks, implicit coercions, overly broad generics |
35
+ | **Performance** | Unnecessary re-renders, N+1 queries, missing pagination, sync-when-should-be-async, memory leaks |
36
+ | **Testing** | New behavior without tests, implementation-detail tests, missing edge cases, flaky patterns |
37
+
38
+ ### Suggestions
39
+
40
+ | Category | Checks |
41
+ | --- | --- |
42
+ | **Naming and Readability** | Misleading names, abbreviations, functions doing too much, deep nesting, comments describing "what" instead of "why" |
43
+
44
+ ## Output Format
45
+
46
+ ```markdown
47
+ ## Code Review
48
+
49
+ **Reviewed:** {files or PR description}
50
+ **Verdict:** APPROVE | REQUEST_CHANGES | COMMENT
51
+
52
+ ### Critical ({count})
53
+ ### Warnings ({count})
54
+ ### Suggestions ({count})
55
+ ### Looks Good
56
+ ### Summary
57
+ ```
58
+
59
+ ## Best Practices Reference
60
+
61
+ Stack-aware review informed by these guides:
62
+
63
+ | Review Area | Guide |
64
+ | --- | --- |
65
+ | `any` usage, type safety patterns | [any & unknown](../best-practices/typescript/any-and-unknown.md) |
66
+ | `type` vs `interface` conventions | [Type vs Interface](../best-practices/typescript/type-vs-interface.md) |
67
+ | SolidJS-specific mistakes (destructuring, effects) | [SolidJS Anti-Patterns](../best-practices/solidjs/anti-patterns.md) |
68
+ | Props reactivity issues | [SolidJS Props Patterns](../best-practices/solidjs/props-patterns.md) |
69
+
70
+ ## Principles
71
+
72
+ - **Be specific** -- "This catch block on line 42 swallows the database connection error" is useful; "This could be improved" is not
73
+ - **Distinguish severity honestly** -- not everything is critical, not everything is a suggestion
74
+ - **Acknowledge good work** -- reviews that only list problems are incomplete
75
+ - **Stay in scope** -- review the changes, not the entire codebase
76
+ - **Offer alternatives, not just objections** -- suggest a fix or direction for every problem flagged
@@ -0,0 +1,98 @@
1
+ # GitHub Workflow Agent
2
+
3
+ > Git workflow assistant for branching, commits, and PRs.
4
+
5
+ **Type:** Agent
6
+ **Model:** Sonnet
7
+ **Source:** [`core/agents/ct-github-workflow.md`](../core/agents/ct-github-workflow.md)
8
+
9
+ ## Overview
10
+
11
+ A Git workflow assistant that helps with branch management, commit formatting, and pull request creation following consistent conventions.
12
+
13
+ ## Branch Naming
14
+
15
+ Format: `{prefix}/{short-description}`
16
+
17
+ | Prefix | Use Case | Example |
18
+ |---|---|---|
19
+ | `feat` | New feature | `feat/user-avatar-upload` |
20
+ | `fix` | Bug fix | `fix/login-redirect-loop` |
21
+ | `chore` | Maintenance, deps, config | `chore/upgrade-eslint-9` |
22
+ | `refactor` | Code restructuring | `refactor/extract-auth-service` |
23
+ | `docs` | Documentation only | `docs/api-authentication` |
24
+ | `test` | Test additions or fixes | `test/payment-edge-cases` |
25
+ | `hotfix` | Urgent production fix | `hotfix/null-crash-checkout` |
26
+
27
+ **Rules:** lowercase with hyphens, under 4 words, specific enough to identify at a glance.
28
+
29
+ ## Conventional Commits
30
+
31
+ Format: `{type}({scope}): {description}`
32
+
33
+ | Type | When |
34
+ |---|---|
35
+ | `feat` | New feature visible to users |
36
+ | `fix` | Bug fix |
37
+ | `refactor` | Code change with no behavior difference |
38
+ | `test` | Adding or updating tests |
39
+ | `docs` | Documentation changes |
40
+ | `chore` | Build, CI, dependency updates |
41
+ | `perf` | Performance improvement |
42
+ | `style` | Formatting, whitespace (no logic change) |
43
+
44
+ **Examples:**
45
+ ```
46
+ feat(auth): add JWT refresh token rotation
47
+ fix(cart): prevent duplicate items on rapid clicks
48
+ refactor(api): extract validation middleware from route handlers
49
+ chore(deps): upgrade next.js to 15.1
50
+ ```
51
+
52
+ **Rules:**
53
+ - Scope is optional but encouraged (module or feature area)
54
+ - Description starts lowercase, imperative mood ("add" not "added")
55
+ - Body explains "why" not "what"
56
+ - Breaking changes: add `!` after type/scope (e.g., `feat(api)!: change auth response format`)
57
+
58
+ ## PR Creation Workflow
59
+
60
+ ### 1. Pre-flight Checks
61
+ - Tests pass
62
+ - Types check
63
+ - No lint errors
64
+ - No merge conflicts
65
+
66
+ ### 2. PR Title
67
+ Same conventional format as commits, under 70 characters.
68
+
69
+ ### 3. PR Description
70
+ ```markdown
71
+ ## Summary
72
+ {1-3 bullet points: what and why}
73
+
74
+ ## Changes
75
+ - {Grouped list of meaningful changes}
76
+
77
+ ## Testing
78
+ - [ ] {How to test}
79
+ - [ ] {Edge cases verified}
80
+
81
+ ## Notes
82
+ {Trade-offs, follow-up work, deployment considerations}
83
+ ```
84
+
85
+ ### 4. Pre-Open Checklist
86
+ - Branch up to date with base
87
+ - All tests pass
88
+ - Types check cleanly
89
+ - No lint errors
90
+ - PR title follows conventional format
91
+ - Changes are focused (one concern per PR)
92
+
93
+ ## Principles
94
+
95
+ - **Small PRs** -- if a PR touches more than 10 files or 300 lines, consider splitting
96
+ - **One concern per PR** -- do not mix a feature with a refactor with a dependency upgrade
97
+ - **Commit history matters** -- each commit should be a logical, buildable unit
98
+ - **PR description is for the reviewer** -- write it to save their time
@@ -0,0 +1,43 @@
1
+ # SolidJS Best Practices
2
+
3
+ > A curated collection of SolidJS best practices, patterns, and guidance sourced from the [official SolidJS documentation](https://docs.solidjs.com/), [Ryan Carniato](https://dev.to/ryansolid) (SolidJS creator), and the SolidJS community.
4
+
5
+ SolidJS uses **fine-grained reactivity** with no virtual DOM. Components run once; only reactive expressions re-execute when dependencies change. This is fundamentally different from virtual DOM frameworks — and most best practices stem from this core difference.
6
+
7
+ ## Reactivity
8
+
9
+ Understanding reactivity is the foundation of everything in Solid.
10
+
11
+ | Guide | Summary |
12
+ |---|---|
13
+ | [Reactivity Model](reactivity-model.md) | How fine-grained reactivity works — signals, tracking, subscriptions. |
14
+ | [Signals & State](signals-and-state.md) | `createSignal`, `createMemo`, derived values, and when to use what. |
15
+ | [Stores & Nested State](stores-and-nested-state.md) | `createStore`, path syntax, `produce`, `reconcile` for complex state. |
16
+ | [Effects & Lifecycle](effects-and-lifecycle.md) | `createEffect`, `onMount`, `onCleanup` — and when NOT to use effects. |
17
+
18
+ ## Components
19
+
20
+ Patterns for building and composing components.
21
+
22
+ | Guide | Summary |
23
+ |---|---|
24
+ | [Props Patterns](props-patterns.md) | Never destructure. Use `mergeProps`, `splitProps`, `children` helper. |
25
+ | [Component Patterns](component-patterns.md) | Composition, typed components, generic components, refs. |
26
+ | [Control Flow](control-flow.md) | `<Show>`, `<For>`, `<Switch>`/`<Match>`, `<ErrorBoundary>`, `<Suspense>`. |
27
+
28
+ ## Architecture
29
+
30
+ Scaling patterns for real applications.
31
+
32
+ | Guide | Summary |
33
+ |---|---|
34
+ | [Data Fetching](data-fetching.md) | `createResource`, `createAsync`, Suspense, error handling, optimistic updates. |
35
+ | [Context & Global State](context-and-global-state.md) | Context + stores pattern, provider factories, avoiding prop drilling. |
36
+ | [TypeScript Integration](typescript-integration.md) | Component types, typed signals/stores/context, event handling, TSConfig. |
37
+
38
+ ## Performance & Pitfalls
39
+
40
+ | Guide | Summary |
41
+ |---|---|
42
+ | [Performance](performance.md) | `lazy`, `batch`, `untrack`, code splitting, and what Solid optimizes for you. |
43
+ | [Anti-Patterns](anti-patterns.md) | The most common mistakes and how to avoid them. |