rebar-mcp 2.0.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.
- package/.claude/agents/template-writer.md +43 -0
- package/.claude/agents/test-runner.md +47 -0
- package/.claude/mcp.json +9 -0
- package/.claude/settings.json +29 -0
- package/.claude/skills/ /SKILL.md +21 -0
- package/.claude/skills/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SKILL.md +21 -0
- package/.claude/skills/bmmibwetxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmibwjgvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmibwsesxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmibwxufxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmibx3r9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmji0lrkxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjiniphxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjio86zxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjiolfbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjit1lvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjita1qxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibweu3/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibwjh4/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibwsey/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibwxup/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibx3rg/SKILL.md +21 -0
- package/.claude/skills/bnd-mmji0lrp/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjinipm/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjio875/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjiolfg/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjit1m3/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjita1x/SKILL.md +21 -0
- package/.claude/skills/coercion-test/SKILL.md +50 -0
- package/.claude/skills/large-skill/SKILL.md +21 -0
- package/.claude/skills/long-desc-skill/SKILL.md +21 -0
- package/.claude/skills/mcp-dev/SKILL.md +61 -0
- package/.claude/skills/nl-mmibweus/SKILL.md +25 -0
- package/.claude/skills/nl-mmibwjhf/SKILL.md +25 -0
- package/.claude/skills/nl-mmibwsf7/SKILL.md +25 -0
- package/.claude/skills/nl-mmibwxvq/SKILL.md +25 -0
- package/.claude/skills/nl-mmibx3rt/SKILL.md +25 -0
- package/.claude/skills/nl-mmji0lrz/SKILL.md +25 -0
- package/.claude/skills/nl-mmjinipx/SKILL.md +25 -0
- package/.claude/skills/nl-mmjio87f/SKILL.md +25 -0
- package/.claude/skills/nl-mmjiolfs/SKILL.md +25 -0
- package/.claude/skills/nl-mmjit1mc/SKILL.md +25 -0
- package/.claude/skills/nl-mmjita26/SKILL.md +25 -0
- package/.claude/skills/rapid-1/SKILL.md +21 -0
- package/.claude/skills/rapid-2/SKILL.md +21 -0
- package/.claude/skills/rapid-3/SKILL.md +21 -0
- package/.claude/skills/rapid-4/SKILL.md +21 -0
- package/.claude/skills/rapid-5/SKILL.md +21 -0
- package/.claude/skills/test/", /"malicious/": /"true/SKILL.md" +69 -0
- package/.claude/skills/test-emoji-/360/237/230/200-skill/SKILL.md +69 -0
- package/.claude/skills/test-skill/SKILL.md +69 -0
- package/.claude/skills/test; rm -rf /; skill/SKILL.md +69 -0
- package/.claude/skills/test<script>alert(1)</script>skill/SKILL.md +69 -0
- package/.claudeignore +5 -0
- package/.mcp.json +3 -0
- package/CHANGELOG.md +29 -0
- package/CLAUDE.md +76 -0
- package/LICENSE +21 -0
- package/README.md +149 -0
- package/ROADMAP.md +526 -0
- package/ccboot-PRD-v1.0.docx.md +732 -0
- package/ccboot-v1.2.0-enforcement-spec.md +1272 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +674 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +25 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +118 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/common.d.ts +62 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +15 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/scaffolding.d.ts +277 -0
- package/dist/schemas/scaffolding.d.ts.map +1 -0
- package/dist/schemas/scaffolding.js +133 -0
- package/dist/schemas/scaffolding.js.map +1 -0
- package/dist/services/claudemd-generator.d.ts +16 -0
- package/dist/services/claudemd-generator.d.ts.map +1 -0
- package/dist/services/claudemd-generator.js +426 -0
- package/dist/services/claudemd-generator.js.map +1 -0
- package/dist/services/codex-generator.d.ts +6 -0
- package/dist/services/codex-generator.d.ts.map +1 -0
- package/dist/services/codex-generator.js +35 -0
- package/dist/services/codex-generator.js.map +1 -0
- package/dist/services/cursor-generator.d.ts +15 -0
- package/dist/services/cursor-generator.d.ts.map +1 -0
- package/dist/services/cursor-generator.js +134 -0
- package/dist/services/cursor-generator.js.map +1 -0
- package/dist/services/file-ops.d.ts +48 -0
- package/dist/services/file-ops.d.ts.map +1 -0
- package/dist/services/file-ops.js +153 -0
- package/dist/services/file-ops.js.map +1 -0
- package/dist/services/output-formatter.d.ts +57 -0
- package/dist/services/output-formatter.d.ts.map +1 -0
- package/dist/services/output-formatter.js +88 -0
- package/dist/services/output-formatter.js.map +1 -0
- package/dist/services/platform-detect.d.ts +14 -0
- package/dist/services/platform-detect.d.ts.map +1 -0
- package/dist/services/platform-detect.js +63 -0
- package/dist/services/platform-detect.js.map +1 -0
- package/dist/services/project-analyzer.d.ts +71 -0
- package/dist/services/project-analyzer.d.ts.map +1 -0
- package/dist/services/project-analyzer.js +595 -0
- package/dist/services/project-analyzer.js.map +1 -0
- package/dist/services/rules-engine.d.ts +41 -0
- package/dist/services/rules-engine.d.ts.map +1 -0
- package/dist/services/rules-engine.js +304 -0
- package/dist/services/rules-engine.js.map +1 -0
- package/dist/services/strictness.d.ts +37 -0
- package/dist/services/strictness.d.ts.map +1 -0
- package/dist/services/strictness.js +182 -0
- package/dist/services/strictness.js.map +1 -0
- package/dist/services/template-engine.d.ts +16 -0
- package/dist/services/template-engine.d.ts.map +1 -0
- package/dist/services/template-engine.js +85 -0
- package/dist/services/template-engine.js.map +1 -0
- package/dist/services/validation.d.ts +41 -0
- package/dist/services/validation.d.ts.map +1 -0
- package/dist/services/validation.js +104 -0
- package/dist/services/validation.js.map +1 -0
- package/dist/services/windsurf-generator.d.ts +15 -0
- package/dist/services/windsurf-generator.d.ts.map +1 -0
- package/dist/services/windsurf-generator.js +127 -0
- package/dist/services/windsurf-generator.js.map +1 -0
- package/dist/tests/enforcement.test.d.ts +2 -0
- package/dist/tests/enforcement.test.d.ts.map +1 -0
- package/dist/tests/enforcement.test.js +541 -0
- package/dist/tests/enforcement.test.js.map +1 -0
- package/dist/tests/enterprise.test.d.ts +2 -0
- package/dist/tests/enterprise.test.d.ts.map +1 -0
- package/dist/tests/enterprise.test.js +353 -0
- package/dist/tests/enterprise.test.js.map +1 -0
- package/dist/tests/fuzzing.test.d.ts +2 -0
- package/dist/tests/fuzzing.test.d.ts.map +1 -0
- package/dist/tests/fuzzing.test.js +596 -0
- package/dist/tests/fuzzing.test.js.map +1 -0
- package/dist/tests/knowledge.test.d.ts +2 -0
- package/dist/tests/knowledge.test.d.ts.map +1 -0
- package/dist/tests/knowledge.test.js +292 -0
- package/dist/tests/knowledge.test.js.map +1 -0
- package/dist/tests/management.test.d.ts +2 -0
- package/dist/tests/management.test.d.ts.map +1 -0
- package/dist/tests/management.test.js +338 -0
- package/dist/tests/management.test.js.map +1 -0
- package/dist/tests/scaffolding.test.d.ts +2 -0
- package/dist/tests/scaffolding.test.d.ts.map +1 -0
- package/dist/tests/scaffolding.test.js +419 -0
- package/dist/tests/scaffolding.test.js.map +1 -0
- package/dist/tests/test-utils.d.ts +76 -0
- package/dist/tests/test-utils.d.ts.map +1 -0
- package/dist/tests/test-utils.js +171 -0
- package/dist/tests/test-utils.js.map +1 -0
- package/dist/tests/tool-harness.d.ts +18 -0
- package/dist/tests/tool-harness.d.ts.map +1 -0
- package/dist/tests/tool-harness.js +51 -0
- package/dist/tests/tool-harness.js.map +1 -0
- package/dist/tools/enterprise.d.ts +8 -0
- package/dist/tools/enterprise.d.ts.map +1 -0
- package/dist/tools/enterprise.js +571 -0
- package/dist/tools/enterprise.js.map +1 -0
- package/dist/tools/knowledge.d.ts +7 -0
- package/dist/tools/knowledge.d.ts.map +1 -0
- package/dist/tools/knowledge.js +120 -0
- package/dist/tools/knowledge.js.map +1 -0
- package/dist/tools/management.d.ts +10 -0
- package/dist/tools/management.d.ts.map +1 -0
- package/dist/tools/management.js +1541 -0
- package/dist/tools/management.js.map +1 -0
- package/dist/tools/scaffolding.d.ts +8 -0
- package/dist/tools/scaffolding.d.ts.map +1 -0
- package/dist/tools/scaffolding.js +736 -0
- package/dist/tools/scaffolding.js.map +1 -0
- package/dist/types.d.ts +54 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/landing/app/layout.tsx +30 -0
- package/landing/app/page.tsx +944 -0
- package/landing/next-env.d.ts +6 -0
- package/landing/next.config.js +6 -0
- package/landing/package-lock.json +896 -0
- package/landing/package.json +20 -0
- package/landing/tsconfig.json +40 -0
- package/package.json +49 -0
- package/rebar-v2.0.0-platform-spec.md +1567 -0
- package/server.json +20 -0
- package/src/cli.ts +735 -0
- package/src/constants.ts +131 -0
- package/src/index.ts +54 -0
- package/src/schemas/common.ts +22 -0
- package/src/schemas/scaffolding.ts +161 -0
- package/src/services/claudemd-generator.ts +481 -0
- package/src/services/codex-generator.ts +44 -0
- package/src/services/cursor-generator.ts +153 -0
- package/src/services/file-ops.ts +172 -0
- package/src/services/platform-detect.ts +80 -0
- package/src/services/project-analyzer.ts +690 -0
- package/src/services/rules-engine.ts +353 -0
- package/src/services/strictness.ts +202 -0
- package/src/services/template-engine.ts +119 -0
- package/src/services/validation.ts +138 -0
- package/src/services/windsurf-generator.ts +145 -0
- package/src/tests/enforcement.test.ts +794 -0
- package/src/tests/enterprise.test.ts +483 -0
- package/src/tests/fuzzing.test.ts +690 -0
- package/src/tests/knowledge.test.ts +371 -0
- package/src/tests/management.test.ts +451 -0
- package/src/tests/scaffolding.test.ts +575 -0
- package/src/tests/test-utils.ts +206 -0
- package/src/tests/tool-harness.ts +70 -0
- package/src/tools/enterprise.ts +666 -0
- package/src/tools/knowledge.ts +162 -0
- package/src/tools/management.ts +1706 -0
- package/src/tools/scaffolding.ts +909 -0
- package/src/types.ts +93 -0
- package/supabase/.temp/cli-latest +1 -0
- package/supabase/.temp/gotrue-version +1 -0
- package/supabase/.temp/pooler-url +1 -0
- package/supabase/.temp/postgres-version +1 -0
- package/supabase/.temp/project-ref +1 -0
- package/supabase/.temp/rest-version +1 -0
- package/supabase/.temp/storage-migration +1 -0
- package/supabase/.temp/storage-version +1 -0
- package/templates/agents/explore.md +41 -0
- package/templates/agents/plan.md +73 -0
- package/templates/agents/security-auditor.md +77 -0
- package/templates/agents/test-runner.md +60 -0
- package/templates/claudemd/fastapi.md +49 -0
- package/templates/claudemd/monorepo.md +48 -0
- package/templates/claudemd/nextjs.md +52 -0
- package/templates/claudemd/react-spa.md +50 -0
- package/templates/claudemd/springboot.md +50 -0
- package/templates/hooks/danger-blocker.json +11 -0
- package/templates/hooks/format-on-write.json +17 -0
- package/templates/hooks/lint-on-write.json +16 -0
- package/templates/hooks/secret-detector.json +11 -0
- package/templates/skills/code-review.md +68 -0
- package/templates/skills/documentation.md +62 -0
- package/templates/skills/performance-audit.md +80 -0
- package/templates/skills/security-scan.md +66 -0
- package/templates/skills/test-writer.md +56 -0
- package/tsconfig.json +19 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TypeScript interfaces for rebar-mcp
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type TechStack =
|
|
6
|
+
| "nextjs"
|
|
7
|
+
| "react"
|
|
8
|
+
| "vue"
|
|
9
|
+
| "angular"
|
|
10
|
+
| "svelte"
|
|
11
|
+
| "express"
|
|
12
|
+
| "fastapi"
|
|
13
|
+
| "django"
|
|
14
|
+
| "flask"
|
|
15
|
+
| "springboot"
|
|
16
|
+
| "rails"
|
|
17
|
+
| "laravel"
|
|
18
|
+
| "go"
|
|
19
|
+
| "rust"
|
|
20
|
+
| "dotnet";
|
|
21
|
+
|
|
22
|
+
export type ComplianceStandard = "hipaa" | "sox" | "pci-dss" | "soc2";
|
|
23
|
+
|
|
24
|
+
export type ArtifactType =
|
|
25
|
+
| "skill"
|
|
26
|
+
| "agent"
|
|
27
|
+
| "hook"
|
|
28
|
+
| "command"
|
|
29
|
+
| "knowledge"
|
|
30
|
+
| "claudemd"
|
|
31
|
+
| "mcp-config"
|
|
32
|
+
| "settings";
|
|
33
|
+
|
|
34
|
+
export type HookEvent =
|
|
35
|
+
| "PreToolCall"
|
|
36
|
+
| "PostToolCall"
|
|
37
|
+
| "Notification"
|
|
38
|
+
| "Stop"
|
|
39
|
+
| "SubagentStop"
|
|
40
|
+
| "PreCompact"
|
|
41
|
+
| "PostCompact"
|
|
42
|
+
| "SessionStart";
|
|
43
|
+
|
|
44
|
+
export type SkillInvocation = "user" | "auto" | "both";
|
|
45
|
+
export type SkillContext = "inline" | "fork";
|
|
46
|
+
|
|
47
|
+
export type AgentRole = "explore" | "plan" | "general" | "custom";
|
|
48
|
+
export type FixMode = "report" | "auto_fix";
|
|
49
|
+
export type ComplianceScope = "full" | "hooks_only" | "skills_only";
|
|
50
|
+
export type SecurityStrictness = "standard" | "strict" | "paranoid";
|
|
51
|
+
export type MCPScope = "project" | "user";
|
|
52
|
+
export type ClaudeMDScope = "root" | "subdir";
|
|
53
|
+
|
|
54
|
+
export interface TemplateVariables {
|
|
55
|
+
[key: string]: string | boolean | string[] | undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ArtifactInfo {
|
|
59
|
+
type: ArtifactType;
|
|
60
|
+
name: string;
|
|
61
|
+
path: string;
|
|
62
|
+
valid: boolean;
|
|
63
|
+
issues: string[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ValidationResult {
|
|
67
|
+
valid: boolean;
|
|
68
|
+
errors: string[];
|
|
69
|
+
warnings: string[];
|
|
70
|
+
fixes_applied: string[];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface ContextBudget {
|
|
74
|
+
total_tokens_estimated: number;
|
|
75
|
+
claudemd_tokens: number;
|
|
76
|
+
skill_tokens: number;
|
|
77
|
+
agent_tokens: number;
|
|
78
|
+
knowledge_tokens: number;
|
|
79
|
+
warnings: string[];
|
|
80
|
+
budget_percentage: number;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ToolResult {
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
content: Array<{ type: "text"; text: string }>;
|
|
86
|
+
isError?: boolean;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface GeneratedFile {
|
|
90
|
+
path: string;
|
|
91
|
+
content: string;
|
|
92
|
+
description: string;
|
|
93
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v2.75.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v2.187.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
postgresql://postgres.vbkhfcxocduwgvrvpjna@aws-1-us-east-1.pooler.supabase.com:5432/postgres
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
17.6.1.063
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
vbkhfcxocduwgvrvpjna
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v14.1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fix-optimized-search-function
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v1.41.8
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Explore Agent
|
|
2
|
+
|
|
3
|
+
A read-only investigator that understands codebases deeply and quickly.
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
You are an expert codebase archaeologist. You search, read, and map code
|
|
8
|
+
to answer questions with precision. You NEVER modify files.
|
|
9
|
+
|
|
10
|
+
## Allowed Tools
|
|
11
|
+
- Read (read files and understand structure)
|
|
12
|
+
- Grep (search for patterns across the codebase)
|
|
13
|
+
- Glob (find files by name patterns)
|
|
14
|
+
- Bash (read-only: `git log`, `git blame`, `wc -l`, `ls`, `tree`)
|
|
15
|
+
|
|
16
|
+
## Methodology
|
|
17
|
+
|
|
18
|
+
1. **Orienting search**: Start with entry points (index.ts, main.py, App.tsx)
|
|
19
|
+
and configuration files (package.json, tsconfig.json) to understand project shape.
|
|
20
|
+
|
|
21
|
+
2. **Targeted investigation**: Use Grep with specific patterns:
|
|
22
|
+
- Function definitions: `function fetchUser|const fetchUser|def fetch_user`
|
|
23
|
+
- Class hierarchies: `extends BaseService|implements Repository`
|
|
24
|
+
- Error patterns: `throw new|raise |panic\(`
|
|
25
|
+
- Data flow: trace how data moves from API → service → database
|
|
26
|
+
|
|
27
|
+
3. **Dependency mapping**: Follow imports to understand module boundaries.
|
|
28
|
+
Identify which modules are tightly coupled vs. loosely coupled.
|
|
29
|
+
|
|
30
|
+
4. **Pattern recognition**: Look for:
|
|
31
|
+
- Architectural patterns (MVC, hexagonal, event-driven)
|
|
32
|
+
- Naming conventions (camelCase, snake_case, PascalCase)
|
|
33
|
+
- Error handling patterns (try/catch, Result types, error callbacks)
|
|
34
|
+
- Testing patterns (mocking strategy, test data setup)
|
|
35
|
+
|
|
36
|
+
## Output Standards
|
|
37
|
+
- Always include **file path and line number** for every reference
|
|
38
|
+
- Provide a **summary first**, then details — don't bury the answer
|
|
39
|
+
- When showing code, include enough context to understand it (3-5 lines around)
|
|
40
|
+
- Distinguish between **facts** (what the code does) and **opinions** (what you think about it)
|
|
41
|
+
- If you can't find something, say so clearly — don't guess
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Plan Agent
|
|
2
|
+
|
|
3
|
+
A software architect that creates detailed, actionable implementation plans.
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
You are a principal engineer designing implementation strategies. You analyze
|
|
8
|
+
requirements and existing code to create plans that a mid-level engineer could
|
|
9
|
+
follow without ambiguity. You NEVER write or modify code directly.
|
|
10
|
+
|
|
11
|
+
## Allowed Tools
|
|
12
|
+
- Read (understand existing code and structure)
|
|
13
|
+
- Grep (find related code, patterns, and dependencies)
|
|
14
|
+
- Glob (discover file structure and naming conventions)
|
|
15
|
+
- Bash (read-only: `git log`, `git diff`, `wc -l`)
|
|
16
|
+
|
|
17
|
+
## Planning Process
|
|
18
|
+
|
|
19
|
+
### 1. Understand the current state
|
|
20
|
+
- Read the relevant source files and tests
|
|
21
|
+
- Identify the existing patterns (how similar features were built)
|
|
22
|
+
- Map dependencies (what will this change touch?)
|
|
23
|
+
- Check for existing abstractions that should be reused
|
|
24
|
+
|
|
25
|
+
### 2. Design the solution
|
|
26
|
+
- Follow existing patterns — don't introduce new ones unless necessary
|
|
27
|
+
- Identify the minimal set of files to create or modify
|
|
28
|
+
- Consider backward compatibility and migration paths
|
|
29
|
+
- Think about testing strategy upfront
|
|
30
|
+
|
|
31
|
+
### 3. Create the plan
|
|
32
|
+
For each step, provide:
|
|
33
|
+
- **What**: File path and specific change
|
|
34
|
+
- **Why**: Reasoning behind this approach
|
|
35
|
+
- **Risk**: What could go wrong and how to mitigate
|
|
36
|
+
|
|
37
|
+
### 4. Validate the plan
|
|
38
|
+
- Verify all referenced files/functions actually exist
|
|
39
|
+
- Check that the plan doesn't conflict with existing code
|
|
40
|
+
- Ensure test strategy covers the changes
|
|
41
|
+
|
|
42
|
+
## Output Format
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
## Summary
|
|
46
|
+
One paragraph describing the approach.
|
|
47
|
+
|
|
48
|
+
## Files to Change
|
|
49
|
+
1. path/to/file.ts — What changes and why
|
|
50
|
+
2. path/to/new-file.ts — New file, what it contains
|
|
51
|
+
|
|
52
|
+
## Implementation Steps
|
|
53
|
+
### Step 1: [Title]
|
|
54
|
+
**File**: path/to/file.ts
|
|
55
|
+
**Change**: [specific description]
|
|
56
|
+
**Why**: [reasoning]
|
|
57
|
+
|
|
58
|
+
### Step 2: [Title]
|
|
59
|
+
...
|
|
60
|
+
|
|
61
|
+
## Testing Plan
|
|
62
|
+
- Unit tests for [what]
|
|
63
|
+
- Integration tests for [what]
|
|
64
|
+
|
|
65
|
+
## Risks
|
|
66
|
+
- [Risk 1]: [Mitigation]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Rules
|
|
70
|
+
- Plans must reference real files and real function names (verify they exist)
|
|
71
|
+
- Every step must be independently reviewable as a commit
|
|
72
|
+
- Don't over-plan — if a step is trivial, say "straightforward" and move on
|
|
73
|
+
- Flag anything that needs product/design input before implementation
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Security Auditor Agent
|
|
2
|
+
|
|
3
|
+
An agent that performs systematic security audits of codebases.
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
You are a security engineer performing a systematic audit. You search for
|
|
8
|
+
real, exploitable vulnerabilities — not theoretical concerns or best-practice
|
|
9
|
+
nitpicks. Every finding must include proof of exploitability and a fix.
|
|
10
|
+
|
|
11
|
+
## Allowed Tools
|
|
12
|
+
- Read (read source code, configs, dependency files)
|
|
13
|
+
- Grep (search for vulnerability patterns)
|
|
14
|
+
- Glob (find sensitive files: .env, credentials, keys)
|
|
15
|
+
- Bash (read-only: `npm audit`, `git log`, dependency checks)
|
|
16
|
+
|
|
17
|
+
## Audit Methodology
|
|
18
|
+
|
|
19
|
+
### Phase 1: Attack Surface Discovery
|
|
20
|
+
- Find all entry points (API routes, form handlers, webhooks)
|
|
21
|
+
- Identify authentication/authorization boundaries
|
|
22
|
+
- Map data flow: user input → processing → storage → output
|
|
23
|
+
- List all external integrations (APIs, databases, queues)
|
|
24
|
+
|
|
25
|
+
### Phase 2: Vulnerability Scanning
|
|
26
|
+
Scan for these patterns using Grep:
|
|
27
|
+
|
|
28
|
+
**Secrets**:
|
|
29
|
+
- `grep -rn "password\s*=\s*['\"]" --include="*.{ts,js,py,java}"`
|
|
30
|
+
- `grep -rn "api[_-]?key\s*=\s*['\"]" --include="*.{ts,js,py,java}"`
|
|
31
|
+
- `grep -rn "AKIA[0-9A-Z]{16}"` (AWS keys)
|
|
32
|
+
- `grep -rn "sk-[a-zA-Z0-9]"` (API keys)
|
|
33
|
+
|
|
34
|
+
**Injection**:
|
|
35
|
+
- `grep -rn "query\s*(\s*\`" --include="*.{ts,js}"` (template literal SQL)
|
|
36
|
+
- `grep -rn "exec\s*(" --include="*.{ts,js,py}"` (command injection)
|
|
37
|
+
- `grep -rn "innerHTML\s*=" --include="*.{ts,tsx,js,jsx}"` (XSS)
|
|
38
|
+
- `grep -rn "dangerouslySetInnerHTML" --include="*.{tsx,jsx}"` (React XSS)
|
|
39
|
+
|
|
40
|
+
**Auth**:
|
|
41
|
+
- Routes without auth middleware
|
|
42
|
+
- JWT verification with `verify: false` or `algorithms: ['none']`
|
|
43
|
+
- Session tokens without httpOnly/secure flags
|
|
44
|
+
|
|
45
|
+
### Phase 3: Dependency Audit
|
|
46
|
+
- Run `npm audit` / `pip audit` / `cargo audit`
|
|
47
|
+
- Check for known CVEs in major dependencies
|
|
48
|
+
- Identify outdated dependencies with security patches available
|
|
49
|
+
|
|
50
|
+
### Phase 4: Configuration Review
|
|
51
|
+
- Check for debug/development settings in production configs
|
|
52
|
+
- Verify HTTPS enforcement
|
|
53
|
+
- Review CORS configuration
|
|
54
|
+
- Check CSP headers
|
|
55
|
+
|
|
56
|
+
## Output Format
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
## Security Audit Report
|
|
60
|
+
|
|
61
|
+
Risk Summary: X Critical, Y High, Z Medium, W Low
|
|
62
|
+
|
|
63
|
+
### [CRITICAL] Title
|
|
64
|
+
File: path/to/file.ts:42
|
|
65
|
+
Category: OWASP A03 (Injection)
|
|
66
|
+
Description: [What the vulnerability is]
|
|
67
|
+
Proof: [How to exploit it — be specific]
|
|
68
|
+
Impact: [What an attacker gains]
|
|
69
|
+
Fix: [Exact code change]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Rules
|
|
73
|
+
- Every finding must be exploitable, not theoretical
|
|
74
|
+
- Include proof of concept (specific input that triggers the issue)
|
|
75
|
+
- Prioritize by real-world impact, not CVSS scores
|
|
76
|
+
- Never expose actual secrets in your report (redact them)
|
|
77
|
+
- If the codebase is secure, say so — don't invent findings
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Test Runner Agent
|
|
2
|
+
|
|
3
|
+
An agent that runs tests, diagnoses failures, and reports results with clarity.
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
You are a QA engineer who runs test suites, analyzes failures at the root cause level,
|
|
8
|
+
and provides actionable fix suggestions. You don't just report "test failed" — you
|
|
9
|
+
explain WHY it failed and exactly how to fix it.
|
|
10
|
+
|
|
11
|
+
## Allowed Tools
|
|
12
|
+
- Read (read test files and source code)
|
|
13
|
+
- Grep (find related code, assertions, mocks)
|
|
14
|
+
- Glob (discover test files)
|
|
15
|
+
- Bash (run tests: `npm test`, `pytest`, `cargo test`, `go test`, etc.)
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
### 1. Discovery
|
|
20
|
+
- Find the test command (check package.json scripts, Makefile, etc.)
|
|
21
|
+
- Identify the test framework and configuration
|
|
22
|
+
- Count total test files to set expectations
|
|
23
|
+
|
|
24
|
+
### 2. Execution
|
|
25
|
+
- Run the full test suite first
|
|
26
|
+
- If too many failures, run tests file-by-file to isolate
|
|
27
|
+
- Capture both stdout and stderr
|
|
28
|
+
|
|
29
|
+
### 3. Failure Analysis
|
|
30
|
+
For each failure:
|
|
31
|
+
- Read the failing test to understand what it expects
|
|
32
|
+
- Read the source code being tested
|
|
33
|
+
- Identify the root cause (not just the assertion that failed):
|
|
34
|
+
- Is the test wrong? (testing outdated behavior)
|
|
35
|
+
- Is the code wrong? (bug in implementation)
|
|
36
|
+
- Is a mock wrong? (mock returns unexpected shape)
|
|
37
|
+
- Is it a timing/race condition? (flaky test)
|
|
38
|
+
|
|
39
|
+
### 4. Reporting
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
## Test Results: [PASSED/FAILED]
|
|
43
|
+
|
|
44
|
+
Total: X tests | Passed: Y | Failed: Z | Skipped: W
|
|
45
|
+
Duration: Xs
|
|
46
|
+
|
|
47
|
+
### Failures
|
|
48
|
+
|
|
49
|
+
#### 1. test_name (file:line)
|
|
50
|
+
Expected: [what the test expects]
|
|
51
|
+
Actual: [what happened]
|
|
52
|
+
Root cause: [why it failed]
|
|
53
|
+
Fix: [specific change needed — in the test or in the code]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Rules
|
|
57
|
+
- Always run the tests — never guess at results
|
|
58
|
+
- If a test is flaky (passes sometimes), run it 3 times and report the pattern
|
|
59
|
+
- Distinguish between test bugs and code bugs
|
|
60
|
+
- Report coverage numbers if the project has coverage configured
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# {{project_name}}
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
A Python FastAPI application{{#if description}} — {{description}}{{/if}}.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- Python 3.11+
|
|
8
|
+
- FastAPI web framework
|
|
9
|
+
- Pydantic v2 for data validation
|
|
10
|
+
- SQLAlchemy 2.0 for ORM (async)
|
|
11
|
+
- Alembic for database migrations
|
|
12
|
+
- pytest for testing
|
|
13
|
+
- Ruff for linting and formatting
|
|
14
|
+
|
|
15
|
+
## Architecture Rules
|
|
16
|
+
- Use dependency injection via FastAPI Depends()
|
|
17
|
+
- All endpoints return Pydantic models (never raw dicts)
|
|
18
|
+
- Use async/await for all I/O operations
|
|
19
|
+
- Keep route handlers thin; business logic in services/
|
|
20
|
+
- Use HTTPException for error responses with proper status codes
|
|
21
|
+
|
|
22
|
+
## Build & Test
|
|
23
|
+
- Dev: `uvicorn app.main:app --reload`
|
|
24
|
+
- Test: `pytest`
|
|
25
|
+
- Lint: `ruff check .`
|
|
26
|
+
- Format: `ruff format .`
|
|
27
|
+
- Type check: `mypy .`
|
|
28
|
+
|
|
29
|
+
## File Structure
|
|
30
|
+
- app/main.py — FastAPI app creation and router includes
|
|
31
|
+
- app/routers/ — API route modules
|
|
32
|
+
- app/models/ — SQLAlchemy models
|
|
33
|
+
- app/schemas/ — Pydantic request/response models
|
|
34
|
+
- app/services/ — Business logic
|
|
35
|
+
- app/dependencies/ — FastAPI dependencies
|
|
36
|
+
- tests/ — Test modules mirroring app structure
|
|
37
|
+
- alembic/ — Database migrations
|
|
38
|
+
|
|
39
|
+
## Code Conventions
|
|
40
|
+
- Type hints on all function signatures
|
|
41
|
+
- Docstrings on all public functions
|
|
42
|
+
- Use `from __future__ import annotations` for modern type syntax
|
|
43
|
+
- Never use `# type: ignore` without explanation
|
|
44
|
+
- All settings via pydantic-settings (not raw os.environ)
|
|
45
|
+
|
|
46
|
+
{{#if compliance}}
|
|
47
|
+
## Compliance
|
|
48
|
+
{{#each compliance}}- {{this}} compliance requirements apply
|
|
49
|
+
{{/each}}{{/if}}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# {{project_name}}
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
A monorepo project{{#if description}} — {{description}}{{/if}}.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- Monorepo managed with {{#if monorepo_tool}}{{monorepo_tool}}{{/if}}{{#unless monorepo_tool}}Turborepo{{/unless}}
|
|
8
|
+
- TypeScript across all packages
|
|
9
|
+
- Shared ESLint and Prettier configuration
|
|
10
|
+
- Package-level CLAUDE.md files for package-specific context
|
|
11
|
+
|
|
12
|
+
## Architecture Rules
|
|
13
|
+
- Each package has its own package.json, tsconfig.json, and tests
|
|
14
|
+
- Shared code goes in packages/shared or packages/common
|
|
15
|
+
- Apps depend on packages; packages never depend on apps
|
|
16
|
+
- Use workspace protocol for internal dependencies
|
|
17
|
+
- Each subdirectory with a CLAUDE.md gets its own context
|
|
18
|
+
|
|
19
|
+
## Build & Test
|
|
20
|
+
- Build all: `npm run build` (from root)
|
|
21
|
+
- Test all: `npm run test` (from root)
|
|
22
|
+
- Build one: `npm run build --filter=package-name`
|
|
23
|
+
- Dev: `npm run dev --filter=app-name`
|
|
24
|
+
|
|
25
|
+
## File Structure
|
|
26
|
+
- apps/ — Deployable applications
|
|
27
|
+
{{#each apps}} - {{this}}/
|
|
28
|
+
{{/each}}- packages/ — Shared libraries
|
|
29
|
+
{{#each packages}} - {{this}}/
|
|
30
|
+
{{/each}}- tooling/ — Shared config (ESLint, TypeScript, etc.)
|
|
31
|
+
|
|
32
|
+
## Monorepo Conventions
|
|
33
|
+
- Root package.json: workspace config and shared scripts only
|
|
34
|
+
- Each package exports through a single index.ts
|
|
35
|
+
- Shared types in packages/types or packages/shared
|
|
36
|
+
- CI runs affected tests only (based on changed packages)
|
|
37
|
+
- Version packages independently unless using fixed versioning
|
|
38
|
+
|
|
39
|
+
## Subdirectory CLAUDE.md
|
|
40
|
+
Each app and package should have its own CLAUDE.md with:
|
|
41
|
+
- Package-specific build/test commands
|
|
42
|
+
- Package-specific architecture rules
|
|
43
|
+
- Dependencies on other packages
|
|
44
|
+
|
|
45
|
+
{{#if compliance}}
|
|
46
|
+
## Compliance
|
|
47
|
+
{{#each compliance}}- {{this}} compliance requirements apply
|
|
48
|
+
{{/each}}{{/if}}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# {{project_name}}
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
A Next.js application{{#if description}} — {{description}}{{/if}}.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- Next.js (App Router)
|
|
8
|
+
- TypeScript (strict mode)
|
|
9
|
+
- React 18+
|
|
10
|
+
{{#if has_prisma}}- Prisma ORM for database access{{/if}}
|
|
11
|
+
{{#if has_tailwind}}- Tailwind CSS for styling{{/if}}
|
|
12
|
+
- ESLint + Prettier for code quality
|
|
13
|
+
|
|
14
|
+
## Architecture Rules
|
|
15
|
+
- Use App Router conventions: page.tsx, layout.tsx, loading.tsx, error.tsx
|
|
16
|
+
- Server Components by default; add "use client" only when needed
|
|
17
|
+
- All data fetching in Server Components or Route Handlers
|
|
18
|
+
- Use next/image for images, next/link for navigation
|
|
19
|
+
- Environment variables: NEXT_PUBLIC_ prefix for client-side only
|
|
20
|
+
{{#if has_prisma}}
|
|
21
|
+
## Database
|
|
22
|
+
- Prisma schema in prisma/schema.prisma
|
|
23
|
+
- Run `npx prisma generate` after schema changes
|
|
24
|
+
- Run `npx prisma db push` to sync schema to database
|
|
25
|
+
- Never commit .env files containing DATABASE_URL
|
|
26
|
+
{{/if}}
|
|
27
|
+
|
|
28
|
+
## Build & Test
|
|
29
|
+
- Dev: `npm run dev` (port 3000)
|
|
30
|
+
- Build: `npm run build`
|
|
31
|
+
- Lint: `npm run lint`
|
|
32
|
+
- Test: `npm run test`
|
|
33
|
+
- Type check: `npx tsc --noEmit`
|
|
34
|
+
|
|
35
|
+
## File Structure
|
|
36
|
+
- app/ — Pages and API routes (App Router)
|
|
37
|
+
- components/ — Reusable React components
|
|
38
|
+
- lib/ — Utility functions and shared logic
|
|
39
|
+
{{#if has_prisma}}- prisma/ — Database schema and migrations{{/if}}
|
|
40
|
+
- public/ — Static assets
|
|
41
|
+
|
|
42
|
+
## Code Conventions
|
|
43
|
+
- Use TypeScript strict mode; no `any` types
|
|
44
|
+
- Prefer named exports over default exports
|
|
45
|
+
- Use Zod for runtime validation of external data
|
|
46
|
+
- Error boundaries for graceful error handling
|
|
47
|
+
- Use React Server Components where possible
|
|
48
|
+
|
|
49
|
+
{{#if compliance}}
|
|
50
|
+
## Compliance
|
|
51
|
+
{{#each compliance}}- {{this}} compliance requirements apply
|
|
52
|
+
{{/each}}{{/if}}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# {{project_name}}
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
A React Single Page Application{{#if description}} — {{description}}{{/if}}.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- React 18+ with TypeScript
|
|
8
|
+
- Vite for build tooling
|
|
9
|
+
{{#if has_tailwind}}- Tailwind CSS for styling{{/if}}
|
|
10
|
+
- React Router for navigation
|
|
11
|
+
- TanStack Query for server state management
|
|
12
|
+
- Zustand or Context for client state
|
|
13
|
+
- Vitest + Testing Library for tests
|
|
14
|
+
|
|
15
|
+
## Architecture Rules
|
|
16
|
+
- Functional components only; no class components
|
|
17
|
+
- Custom hooks for reusable logic (useXxx naming)
|
|
18
|
+
- Collocate related files (component, styles, tests, types)
|
|
19
|
+
- Use React.lazy() for code splitting at route level
|
|
20
|
+
- All API calls through a centralized API client
|
|
21
|
+
- Never store sensitive data in localStorage
|
|
22
|
+
|
|
23
|
+
## Build & Test
|
|
24
|
+
- Dev: `npm run dev`
|
|
25
|
+
- Build: `npm run build`
|
|
26
|
+
- Test: `npm run test`
|
|
27
|
+
- Lint: `npm run lint`
|
|
28
|
+
- Preview: `npm run preview`
|
|
29
|
+
|
|
30
|
+
## File Structure
|
|
31
|
+
- src/components/ — Reusable UI components
|
|
32
|
+
- src/pages/ — Route-level page components
|
|
33
|
+
- src/hooks/ — Custom React hooks
|
|
34
|
+
- src/services/ — API client and service functions
|
|
35
|
+
- src/stores/ — State management
|
|
36
|
+
- src/types/ — TypeScript type definitions
|
|
37
|
+
- src/utils/ — Pure utility functions
|
|
38
|
+
- src/assets/ — Static assets (images, fonts)
|
|
39
|
+
|
|
40
|
+
## Code Conventions
|
|
41
|
+
- TypeScript strict mode; no `any` types
|
|
42
|
+
- Props interfaces named ComponentNameProps
|
|
43
|
+
- Use named exports
|
|
44
|
+
- Test files colocated as ComponentName.test.tsx
|
|
45
|
+
- Use CSS Modules or Tailwind; no inline styles
|
|
46
|
+
|
|
47
|
+
{{#if compliance}}
|
|
48
|
+
## Compliance
|
|
49
|
+
{{#each compliance}}- {{this}} compliance requirements apply
|
|
50
|
+
{{/each}}{{/if}}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# {{project_name}}
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
A Spring Boot enterprise application{{#if description}} — {{description}}{{/if}}.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- Java 17+ / Spring Boot 3.x
|
|
8
|
+
- Spring Data JPA for persistence
|
|
9
|
+
- Spring Security for authentication/authorization
|
|
10
|
+
- Maven or Gradle build system
|
|
11
|
+
- JUnit 5 + Mockito for testing
|
|
12
|
+
- Flyway for database migrations
|
|
13
|
+
|
|
14
|
+
## Architecture Rules
|
|
15
|
+
- Follow standard layered architecture: Controller → Service → Repository
|
|
16
|
+
- Use constructor injection (never field injection)
|
|
17
|
+
- All REST controllers return ResponseEntity<T>
|
|
18
|
+
- Use @Valid and Jakarta Bean Validation for input validation
|
|
19
|
+
- Keep controllers thin; all business logic in @Service classes
|
|
20
|
+
- Use DTOs for API boundaries; never expose entities directly
|
|
21
|
+
|
|
22
|
+
## Build & Test
|
|
23
|
+
- Build: `./mvnw clean package` or `./gradlew build`
|
|
24
|
+
- Test: `./mvnw test` or `./gradlew test`
|
|
25
|
+
- Run: `./mvnw spring-boot:run`
|
|
26
|
+
- Lint: `./mvnw checkstyle:check`
|
|
27
|
+
|
|
28
|
+
## File Structure
|
|
29
|
+
- src/main/java/com/{{package_name}}/ — Application code
|
|
30
|
+
- controller/ — REST controllers
|
|
31
|
+
- service/ — Business logic
|
|
32
|
+
- repository/ — Data access (Spring Data JPA)
|
|
33
|
+
- model/ — JPA entities
|
|
34
|
+
- dto/ — Data Transfer Objects
|
|
35
|
+
- config/ — Spring configuration classes
|
|
36
|
+
- exception/ — Custom exceptions and handlers
|
|
37
|
+
- src/main/resources/ — Configuration files
|
|
38
|
+
- src/test/java/ — Test classes
|
|
39
|
+
|
|
40
|
+
## Code Conventions
|
|
41
|
+
- Use records for DTOs where applicable
|
|
42
|
+
- Use Optional<T> return types for nullable queries
|
|
43
|
+
- Log with SLF4J (@Slf4j annotation)
|
|
44
|
+
- Use @Transactional at service layer
|
|
45
|
+
- Never catch generic Exception; catch specific types
|
|
46
|
+
|
|
47
|
+
{{#if compliance}}
|
|
48
|
+
## Compliance
|
|
49
|
+
{{#each compliance}}- {{this}} compliance requirements apply
|
|
50
|
+
{{/each}}{{/if}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Auto-format files after Claude writes them",
|
|
3
|
+
"hooks": [
|
|
4
|
+
{
|
|
5
|
+
"event": "PostToolCall",
|
|
6
|
+
"matcher": "Write|Edit",
|
|
7
|
+
"command": "{{format_command}}",
|
|
8
|
+
"exit_behavior": "notify"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"variants": {
|
|
12
|
+
"prettier": "npx prettier --write \"$TOOL_INPUT_FILE_PATH\"",
|
|
13
|
+
"black": "black \"$TOOL_INPUT_FILE_PATH\"",
|
|
14
|
+
"gofmt": "gofmt -w \"$TOOL_INPUT_FILE_PATH\"",
|
|
15
|
+
"rustfmt": "rustfmt \"$TOOL_INPUT_FILE_PATH\""
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Auto-lint files after Claude writes them",
|
|
3
|
+
"hooks": [
|
|
4
|
+
{
|
|
5
|
+
"event": "PostToolCall",
|
|
6
|
+
"matcher": "Write|Edit",
|
|
7
|
+
"command": "{{lint_command}}",
|
|
8
|
+
"exit_behavior": "block"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"variants": {
|
|
12
|
+
"eslint": "npx eslint --fix \"$TOOL_INPUT_FILE_PATH\"",
|
|
13
|
+
"ruff": "ruff check --fix \"$TOOL_INPUT_FILE_PATH\"",
|
|
14
|
+
"clippy": "cargo clippy --fix --allow-dirty"
|
|
15
|
+
}
|
|
16
|
+
}
|