From 70e9c29e35ce2458dae77593c0d86a0d288eb15d Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:29:52 -0400 Subject: [PATCH 01/23] feat: add debugger subagent for root cause analysis --- skel/.claude/agents/debugger.md | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 skel/.claude/agents/debugger.md diff --git a/skel/.claude/agents/debugger.md b/skel/.claude/agents/debugger.md new file mode 100644 index 0000000..25ea6c4 --- /dev/null +++ b/skel/.claude/agents/debugger.md @@ -0,0 +1,57 @@ +--- +name: debugger +description: Debugging specialist for errors and test failures. Use PROACTIVELY when encountering any errors, failures, or unexpected behavior. +tools: Read, Edit, Bash, Grep, Glob +--- + +You are a debugging machine. Find root cause. Fix it. Move on. + +WHEN INVOKED: + +1. Capture error - full stack trace +2. Reproduce - exact steps +3. Isolate - minimal failing case +4. Fix - change only what's broken +5. Verify - run tests + +APPROACH: + +- Start with error message +- Work backwards from failure +- Add debug output temporarily +- Remove debug code after fix +- Document only if subtle + +DEBUGGING PROCESS: + +```bash +# Get recent changes +git diff HEAD~1 + +# Check test output +npm test 2>&1 | head -50 + +# Find error patterns +rg "Error|Failed|Exception" --type-add 'log:*.{log,txt}' -t log + +# Check recent commits +git log --oneline -10 +``` + +FIX CATEGORIES: + +1. **Type errors** - Add proper types +2. **Import errors** - Fix paths +3. **Runtime errors** - Add guards +4. **Test failures** - Fix code, not tests +5. **Build errors** - Check configs + +OUTPUT: + +``` +ROOT CAUSE: [one line] +FIX: [file:line] +VERIFIED: [test command] +``` + +No theories. Only facts and fixes. \ No newline at end of file From c196b1f1ddcb6cfb4b7b3f501fb19f87750e3c3d Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:29:57 -0400 Subject: [PATCH 02/23] feat: add /commit slash command with Haiku model --- skel/.claude/commands/commit.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 skel/.claude/commands/commit.md diff --git a/skel/.claude/commands/commit.md b/skel/.claude/commands/commit.md new file mode 100644 index 0000000..02e8f78 --- /dev/null +++ b/skel/.claude/commands/commit.md @@ -0,0 +1,15 @@ +--- +description: Create git commit with message +argument-hint: [commit-message] +allowed-tools: Bash(git:*) +model: claude-3-5-haiku-20241022 +--- + +## Context +- Status: !`git status --short` +- Staged changes: !`git diff --cached --stat` + +## Task +Stage and commit changes with message: $ARGUMENTS + +Use conventional commit format. Be concise. \ No newline at end of file From d4ce24261598e929ac81cfc00b1339b412fed186 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:03 -0400 Subject: [PATCH 03/23] feat: add /explain slash command for code explanations --- skel/.claude/commands/explain.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 skel/.claude/commands/explain.md diff --git a/skel/.claude/commands/explain.md b/skel/.claude/commands/explain.md new file mode 100644 index 0000000..4e7bf46 --- /dev/null +++ b/skel/.claude/commands/explain.md @@ -0,0 +1,8 @@ +--- +description: Explain code or architecture +argument-hint: [file-or-component] +--- + +Explain $ARGUMENTS + +One paragraph max. Focus on what it does, not how. \ No newline at end of file From ffe1066714812f06d0713268748b4863b5721adb Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:09 -0400 Subject: [PATCH 04/23] feat: add /fix slash command for structured issue resolution --- skel/.claude/commands/fix.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 skel/.claude/commands/fix.md diff --git a/skel/.claude/commands/fix.md b/skel/.claude/commands/fix.md new file mode 100644 index 0000000..6153d88 --- /dev/null +++ b/skel/.claude/commands/fix.md @@ -0,0 +1,12 @@ +--- +description: Fix issue or bug +argument-hint: [issue-description-or-number] +--- + +Fix issue: $ARGUMENTS + +1. Understand the problem +2. Find root cause +3. Implement minimal fix +4. Verify with tests +5. No side effects \ No newline at end of file From a5fe61f80e596b793bfb59b87be1ce024c45dfb9 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:15 -0400 Subject: [PATCH 05/23] feat: add /optimize slash command for performance improvements --- skel/.claude/commands/optimize.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 skel/.claude/commands/optimize.md diff --git a/skel/.claude/commands/optimize.md b/skel/.claude/commands/optimize.md new file mode 100644 index 0000000..c43c537 --- /dev/null +++ b/skel/.claude/commands/optimize.md @@ -0,0 +1,8 @@ +--- +description: Optimize code for performance +argument-hint: [file-or-function] +--- + +Optimize: $ARGUMENTS + +Find performance bottlenecks. Implement specific improvements. Measure impact. \ No newline at end of file From 7bff6a15e562245ff7341467a268f76e5cfd1323 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:20 -0400 Subject: [PATCH 06/23] feat: add /pr slash command for pull request creation --- skel/.claude/commands/pr.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 skel/.claude/commands/pr.md diff --git a/skel/.claude/commands/pr.md b/skel/.claude/commands/pr.md new file mode 100644 index 0000000..8485c62 --- /dev/null +++ b/skel/.claude/commands/pr.md @@ -0,0 +1,14 @@ +--- +description: Create pull request with changes summary +argument-hint: [branch-name] +allowed-tools: Bash(git:*), Read(*), Write(*) +--- + +## Context +- Current branch: !`git branch --show-current` +- Git status: !`git status --short` +- Recent commits: !`git log --oneline -5` +- Files changed: !`git diff --stat HEAD~1` + +## Task +Create a pull request for current changes. Summarize what changed and why. Include test plan. \ No newline at end of file From 56abe6b386e9ac152e378cd9b2d3f3c31b7ead6d Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:25 -0400 Subject: [PATCH 07/23] feat: add /review slash command for brutal code reviews --- skel/.claude/commands/review.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 skel/.claude/commands/review.md diff --git a/skel/.claude/commands/review.md b/skel/.claude/commands/review.md new file mode 100644 index 0000000..6056a76 --- /dev/null +++ b/skel/.claude/commands/review.md @@ -0,0 +1,15 @@ +--- +description: Code review with brutal honesty +argument-hint: [file-or-directory] +--- + +Review $ARGUMENTS + +Focus on: +1. Performance bottlenecks +2. Security vulnerabilities +3. Code smells +4. Missing tests +5. Unnecessary complexity + +Be direct. No sugar coating. \ No newline at end of file From f189bc67fd5d82f848ec3ef269134683521dc2c5 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:30 -0400 Subject: [PATCH 08/23] feat: add session-end hook for cleanup on exit --- skel/.claude/hooks/session-end.cjs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 skel/.claude/hooks/session-end.cjs diff --git a/skel/.claude/hooks/session-end.cjs b/skel/.claude/hooks/session-end.cjs new file mode 100755 index 0000000..03dfcfd --- /dev/null +++ b/skel/.claude/hooks/session-end.cjs @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +const { execSync } = require('node:child_process'); + +try { + execSync('find . -type f -name "*.tmp" -o -name "*.log" -o -name ".DS_Store" | head -20 | xargs rm -f 2>/dev/null', { + encoding: 'utf-8', + stdio: 'pipe' + }); + + const branch = execSync('git branch --show-current 2>/dev/null || echo "not-git"', { + encoding: 'utf-8', + stdio: 'pipe' + }).trim(); + + const changes = execSync('git status --short 2>/dev/null | wc -l || echo "0"', { + encoding: 'utf-8', + stdio: 'pipe' + }).trim(); + + if (changes !== '0') { + console.log(`✓ Session complete. ${changes} file(s) modified on ${branch}`); + } +} catch (e) { + // Silent fail - not critical +} \ No newline at end of file From f6e68ddd26727c7d11ec69b794569f4d4b8f1097 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:35 -0400 Subject: [PATCH 09/23] refactor: enhance pre-commit agent with structured validation --- skel/.claude/agents/pre-commit.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/skel/.claude/agents/pre-commit.md b/skel/.claude/agents/pre-commit.md index a44df5d..35bb17d 100644 --- a/skel/.claude/agents/pre-commit.md +++ b/skel/.claude/agents/pre-commit.md @@ -7,6 +7,7 @@ tools: Bash, Read, Edit, Grep You are a ruthless pre-commit validator. Zero tolerance for broken code. WHEN INVOKED: + 1. Check git status first - what's being committed? 2. Run ALL validation checks in sequence 3. STOP at first failure - no partial commits @@ -14,12 +15,14 @@ WHEN INVOKED: 5. BLOCK commit until everything passes APPROACH: + - Be thorough but fast - Report failures immediately with fixes - No warnings - only pass/fail - Include exact commands to fix issues VALIDATION CHECKLIST: + 1. Run ALL tests - must pass 2. TypeScript compilation - zero errors 3. Type checking - mypy/pyright/ty @@ -27,6 +30,7 @@ VALIDATION CHECKLIST: 5. Security patterns - no debug/secrets AUTOMATED CHECKS: + ```bash # Cross-platform command existence check cmd_exists() { @@ -79,7 +83,8 @@ if cmd_exists rg; then fi ``` -VERDICT: +## Verdict + - READY ✓ - All checks pass - BLOCKED ✗ - Fix [specific issues] From b82f8b58a3726400e04f4d40a10114d9c52f683a Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:40 -0400 Subject: [PATCH 10/23] refactor: enhance refactor agent with aggressive complexity reduction --- skel/.claude/agents/refactor.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skel/.claude/agents/refactor.md b/skel/.claude/agents/refactor.md index ea13eda..6a53d64 100644 --- a/skel/.claude/agents/refactor.md +++ b/skel/.claude/agents/refactor.md @@ -7,6 +7,7 @@ tools: Read, Edit, MultiEdit, Grep, Glob You are a ruthless code simplifier. Complexity is the enemy. WHEN INVOKED: + 1. Git diff - see what's actually changing 2. Read bloated files - count the damage 3. Delete complexity immediately @@ -14,12 +15,14 @@ WHEN INVOKED: 5. Commit kill count APPROACH: + - Use git to focus effort - Delete without permission - Tests validate, don't paralyze - Ship simplified code fast IMMEDIATE ACTIONS: + 1. Count lines - if >50, split or simplify 2. Find duplicate code - eliminate 3. Check functions - if >20 lines, refactor @@ -27,16 +30,16 @@ IMMEDIATE ACTIONS: 5. Delete console.logs, debug code, unused imports DECISION CRITERIA: + - Can't explain in one sentence = too complex - Abstraction without 3+ uses = delete - Nested beyond 2 levels = flatten - Try/catch everywhere = you don't understand your code OUTPUT: -``` + LINES KILLED: [number] FUNCTIONS SIMPLIFIED: [list] COMPLEXITY BEFORE/AFTER: [X/Y] -``` NO EXPLANATIONS. Fix or delete. From 28d692d424a41ca161f0a97135c4d6770e13bd91 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:46 -0400 Subject: [PATCH 11/23] feat: implement bypassPermissions mode with enhanced safety boundaries --- skel/.claude/settings.local.json | 111 ++++++++++++++++--------------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/skel/.claude/settings.local.json b/skel/.claude/settings.local.json index 01e0e49..9300b1b 100644 --- a/skel/.claude/settings.local.json +++ b/skel/.claude/settings.local.json @@ -1,64 +1,49 @@ { "permissions": { - "allow": [ - "Bash", - "Edit", - "Glob", - "Grep", - "LS", - "MultiEdit", - "NotebookEdit", - "NotebookRead", - "Read", - "Task", - "TodoWrite", - "WebFetch", - "WebSearch", - "Write" - ], + "allow": ["*"], "deny": [ - "Bash(:*sudo:*)", - "Bash(:*su :*)", - "Bash(:*doas:*)", + "Bash(sudo rm:*)", + "Bash(rm -rf /:*)", + "Bash(rm -rf ~:*)", + "Bash(dd:*of=/dev/:*)", + "Bash(mkfs:*)", + "Bash(fdisk:*)", + "Bash(curl:*|:*)", + "Bash(wget:*|:*)", "Bash(:*eval:*)", - "Bash(:*|:*sh:*)", - "Bash(:*|:*bash:*)", - "Bash(:*curl:*|:*sh:*)", - "Bash(:*wget:*|:*sh:*)", - "Read(/etc/**)", - "Read(/root/**)", - "Read(/sys/**)", - "Read(/proc/**)", - "Read(**/.env)", - "Read(**/.env.*)", - "Read(**/secrets/**)", - "Read(./config/credentials.json)", - "Read(~/.ssh/**)", + "Bash(:*exec:*)", + "Write(//etc/passwd)", + "Write(//etc/shadow)", + "Edit(//etc/passwd)", + "Edit(//etc/shadow)", + "Read(~/.ssh/id_*)", "Read(**/*.key)", "Read(**/*.pem)", - "Read(**/build/**)", - "Edit(/etc/**)", - "Edit(/root/**)", - "Edit(/sys/**)", - "Edit(/proc/**)", - "Write(/etc/**)", - "Write(/root/**)", - "Write(/sys/**)", - "Write(/proc/**)" + "Read(.env*)", + "Read(**/secrets/**)", + "Read(~/.aws/credentials)", + "Read(~/.config/gcloud/**)" ], "ask": [ - "Bash(:*rm :*)", - "Bash(:*rmdir:*)", - "Bash(:*trash:*)", - "Bash(:*find:*-delete:*)", - "Bash(:*xargs:*rm:*)", - "Bash(:*dd :*)", - "Bash(:*mkfs:*)", - "Bash(:*fdisk:*)", - "mcp__filesystem__delete*", - "mcp__filesystem__move*", - "mcp__*__write*", - "mcp__*__delete*" + "Bash(rm )", + "Bash(rm -)", + "Bash(rmdir:*)", + "Bash(trash:*)", + "Bash(find:*-delete:*)", + "Bash(xargs:*rm:*)", + "Bash(chmod 777:*)", + "Bash(chown:*)", + "Bash(git push:*)", + "Bash(npm publish:*)", + "Bash(pip install:*)", + "Bash(brew install:*)", + "Bash(apt install:*)", + "Bash(apt-get install:*)", + "Bash(yum install:*)", + "Bash(curl )", + "Bash(wget )", + "WebFetch", + "mcp__github__merge_pull_request" ], "defaultMode": "bypassPermissions" }, @@ -82,7 +67,18 @@ { "type": "command", "command": "node $CLAUDE_PROJECT_DIR/.claude/hooks/safety.cjs", - "timeout": 5 + "timeout": 2 + } + ] + } + ], + "SessionEnd": [ + { + "hooks": [ + { + "type": "command", + "command": "node $CLAUDE_PROJECT_DIR/.claude/hooks/session-end.cjs", + "timeout": 2 } ] } @@ -93,5 +89,10 @@ "command": "node $CLAUDE_PROJECT_DIR/.claude/scripts/statusline.cjs", "padding": 0 }, - "outputStyle": "terse" + "outputStyle": "terse", + "env": { + "CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "1", + "BASH_DEFAULT_TIMEOUT_MS": "120000", + "BASH_MAX_TIMEOUT_MS": "600000" + } } From 9853bf81eb1958ce21ecc7b96bd74beb065b0d18 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:51 -0400 Subject: [PATCH 12/23] feat: add PROJECT_IMPORTS template variable for dynamic config inclusion --- skel/CLAUDE.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/skel/CLAUDE.md b/skel/CLAUDE.md index 5b808ef..9d4671c 100644 --- a/skel/CLAUDE.md +++ b/skel/CLAUDE.md @@ -2,6 +2,8 @@ Brutal efficiency. Code first. Ship fast. +See @README.md for project overview{{#PROJECT_IMPORTS}} and {{PROJECT_IMPORTS}}{{/PROJECT_IMPORTS}}. + ## Rules - Functions: <50 lines or refactor @@ -45,3 +47,8 @@ Example: `Fixed parser.js:23` not "I've identified and resolved the memory leak 2. Simple over clever 3. Delete over maintain 4. Ship over discuss + +## Individual Preferences + +Include your personal preferences (not checked into git): +- @~/.claude/{{PROJECT_NAME}}-preferences.md From 7f9109f6b9c5b67882fe9e4291c956bf9831b94b Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:30:56 -0400 Subject: [PATCH 13/23] refactor: enhance safety hook with permissive mode detection --- skel/.claude/hooks/safety.cjs | 38 +++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/skel/.claude/hooks/safety.cjs b/skel/.claude/hooks/safety.cjs index 249f920..50a5c30 100644 --- a/skel/.claude/hooks/safety.cjs +++ b/skel/.claude/hooks/safety.cjs @@ -123,24 +123,29 @@ function getArgForTool(toolName, toolInput) { const permissions = loadPermissions(); +const isPermissiveMode = permissions.defaultMode === 'bypassPermissions' || + permissions.defaultMode === 'allow' || + !permissions.defaultMode; + +if (isPermissiveMode) { + // Skip all permission list checking +} + function additionalSafetyChecks(toolCall) { const { tool_name, tool_input } = toolCall; if (tool_name === 'Bash' && tool_input?.command) { const cmd = tool_input.command.toLowerCase(); const dangerousPatterns = [ - /rm\s+(-rf?|--recursive)/, - /sudo\s+/, - /\bsu\s+/, - /eval\s*[\(\$`]/, - /\|\s*sh\b/, - /\|\s*bash\b/, - /curl.*\|.*sh/, - /wget.*\|.*sh/, - /chmod.*777/, - /dd\s+.*of=/, - /mkfs\./, - /fdisk/ + /rm\s+-rf\s+\//, // Only block rm -rf on root paths + /rm\s+-rf\s+~\/[^/]*$/, // Block rm -rf on home directory + /sudo\s+rm/, // Block sudo rm + /dd\s+.*of=\/dev\//, // Block dd to devices + /mkfs\./, // Block filesystem formatting + /fdisk/, // Block disk partitioning + />\s*\/dev\/null\s+2>&1/, // Don't hide errors + /curl.*\|.*sudo/, // Block curl piped to sudo + /wget.*\|.*sudo/ // Block wget piped to sudo ]; for (const pattern of dangerousPatterns) { @@ -215,18 +220,25 @@ if (matchesPatterns(toolCall, permissions.ask)) { process.exit(0); } -if (matchesPatterns(toolCall, permissions.allow)) { +if (!isPermissiveMode && matchesPatterns(toolCall, permissions.allow)) { + process.exit(0); +} + +if (isPermissiveMode) { process.exit(0); } const defaultMode = permissions.defaultMode || 'ask'; switch (defaultMode) { + case 'bypassPermissions': case 'allow': process.exit(0); + break; case 'deny': console.error(`BLOCKED: Operation denied by default policy - ${tool_name}`); process.exit(1); + break; case 'ask': default: console.error(`CONFIRMATION REQUIRED: ${tool_name}${tool_input ? ` ${getArgForTool(tool_name, tool_input)}` : ''}`); From c8164956f8d1e3a976d89a08f415e7ff510d8fb4 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:01 -0400 Subject: [PATCH 14/23] feat: enhance test command with pattern support --- skel/.claude/commands/test.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skel/.claude/commands/test.md b/skel/.claude/commands/test.md index 3325058..a81d3b2 100644 --- a/skel/.claude/commands/test.md +++ b/skel/.claude/commands/test.md @@ -1,6 +1,7 @@ --- description: Run tests and find untested code +argument-hint: [test-pattern] allowed-tools: Bash(*), Grep(*) --- -Run all tests. Find untested code. Zero tolerance for failures. +Run all tests $ARGUMENTS. Find untested code. Zero tolerance for failures. From 16826a81fdce59885e5bef7304560a2f73c0a6f1 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:07 -0400 Subject: [PATCH 15/23] fix: update CLI to list all 20 created files --- src/cli.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 432301d..a21a78f 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -59,12 +59,22 @@ async function runInit(options: { dryRun?: boolean; directory?: string | undefin const createdFiles = [ ' + .claude/settings.local.json', ' + .claude/agents/pre-commit.md', - ' + .claude/agents/refactor.md', + ' + .claude/agents/refactor.md', + ' + .claude/agents/debugger.md', + ' + .claude/commands/commit.md', + ' + .claude/commands/explain.md', + ' + .claude/commands/fix.md', + ' + .claude/commands/optimize.md', + ' + .claude/commands/pr.md', + ' + .claude/commands/review.md', + ' + .claude/commands/test.md', + ' + .claude/commands/validate.md', ' + .claude/hooks/format.cjs', ' + .claude/hooks/safety.cjs', - ' + .claude/commands/validate.md', - ' + .claude/commands/test.md', + ' + .claude/hooks/session-end.cjs', ' + .claude/scripts/statusline.cjs', + ' + .claude/scripts/statusline-git.cjs', + ' + .claude/scripts/statusline-detect.cjs', ' + .claude/output-styles/terse.md', ' + CLAUDE.md' ]; From 8825a6ce352527fb258a3eb8f7953a46c3beb756 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:12 -0400 Subject: [PATCH 16/23] fix: add all 20 files to validation list --- src/init.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/init.ts b/src/init.ts index e0333cb..9900601 100644 --- a/src/init.ts +++ b/src/init.ts @@ -76,12 +76,22 @@ async function validateSkelFiles(): Promise { '.claude/settings.local.json', '.claude/agents/pre-commit.md', '.claude/agents/refactor.md', + '.claude/agents/debugger.md', + '.claude/commands/commit.md', + '.claude/commands/explain.md', + '.claude/commands/fix.md', + '.claude/commands/optimize.md', + '.claude/commands/pr.md', + '.claude/commands/review.md', '.claude/commands/test.md', '.claude/commands/validate.md', '.claude/hooks/format.cjs', '.claude/hooks/safety.cjs', + '.claude/hooks/session-end.cjs', '.claude/output-styles/terse.md', '.claude/scripts/statusline.cjs', + '.claude/scripts/statusline-git.cjs', + '.claude/scripts/statusline-detect.cjs', 'CLAUDE.md' ]; From 6a62bafe9676b0083cde0249a11cf0457c1b3709 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:17 -0400 Subject: [PATCH 17/23] feat: add PROJECT_IMPORTS template variable generation --- src/projects.ts | 64 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/src/projects.ts b/src/projects.ts index 5906d49..7adc92d 100644 --- a/src/projects.ts +++ b/src/projects.ts @@ -180,6 +180,66 @@ function formatRuntime(runtime: string): string { return runtimeNames[runtime] || runtime.charAt(0).toUpperCase() + runtime.slice(1); } +async function getProjectImports( + projectPath: string, + runtime: string +): Promise { + const importMappings: Record> = { + 'typescript': [ + { file: 'package.json', text: '@package.json for available scripts' }, + { file: 'tsconfig.json', text: '@tsconfig.json for TypeScript configuration' } + ], + 'node': [ + { file: 'package.json', text: '@package.json for available scripts' } + ], + 'bun': [ + { file: 'package.json', text: '@package.json for available scripts' }, + { file: 'bun.lockb', text: '@bun.lockb for locked dependencies' } + ], + 'python': [ + { file: 'pyproject.toml', text: '@pyproject.toml for project configuration' }, + { file: 'requirements.txt', text: '@requirements.txt for dependencies' }, + { file: 'setup.py', text: '@setup.py for package configuration' }, + { file: 'Pipfile', text: '@Pipfile for dependencies' } + ], + 'go': [ + { file: 'go.mod', text: '@go.mod for module dependencies' }, + { file: 'go.sum', text: '@go.sum for dependency checksums' } + ], + 'rust': [ + { file: 'Cargo.toml', text: '@Cargo.toml for project configuration' }, + { file: 'Cargo.lock', text: '@Cargo.lock for locked dependencies' } + ], + 'java': [ + { file: 'pom.xml', text: '@pom.xml for Maven configuration' }, + { file: 'build.gradle', text: '@build.gradle for Gradle configuration' }, + { file: 'build.gradle.kts', text: '@build.gradle.kts for Gradle Kotlin DSL' } + ], + 'c/c++': [ + { file: 'CMakeLists.txt', text: '@CMakeLists.txt for CMake configuration' }, + { file: 'Makefile', text: '@Makefile for build configuration' }, + { file: 'meson.build', text: '@meson.build for Meson configuration' } + ] + }; + + const configs = importMappings[runtime]; + if (!configs) return undefined; + + const foundImports: string[] = []; + for (const config of configs) { + const filePath = join(projectPath, config.file); + if (await exists(filePath)) { + foundImports.push(config.text); + } + } + + if (foundImports.length === 0) return undefined; + if (foundImports.length === 1) return foundImports[0]; + + const lastImport = foundImports.pop()!; + return foundImports.join(', ') + ' and ' + lastImport; +} + export async function getTemplateVariables( context: ProjectContext, projectPath: string @@ -188,6 +248,7 @@ export async function getTemplateVariables( const gitInfo = context.hasGit ? await getGitInfo(projectPath) : {}; const purpose = await detectPurpose(projectPath); + const projectImports = await getProjectImports(projectPath, context.runtime); const variables: TemplateVariables = { PROJECT_NAME: context.projectName, @@ -203,7 +264,8 @@ export async function getTemplateVariables( ...(context.gitRemoteUrl ? { GIT_REMOTE_URL: context.gitRemoteUrl } : {}), ...(gitInfo.userName ? { USER_NAME: gitInfo.userName } : {}), ...(gitInfo.userEmail ? { USER_EMAIL: gitInfo.userEmail } : {}), - ...(purpose ? { PURPOSE: purpose } : {}) + ...(purpose ? { PURPOSE: purpose } : {}), + ...(projectImports ? { PROJECT_IMPORTS: projectImports } : {}) }; logger.debug('Template variables ready', { From 3b548ddfbaa29735eaa14a01943348d52a6368f7 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:22 -0400 Subject: [PATCH 18/23] feat: add PROJECT_IMPORTS to template validation --- src/template.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/template.ts b/src/template.ts index cc9bb94..563d899 100644 --- a/src/template.ts +++ b/src/template.ts @@ -9,6 +9,7 @@ const ALLOWED_TEMPLATE_KEYS = new Set([ 'VERSION_CONTROL', 'FRAMEWORK', 'PURPOSE', + 'PROJECT_IMPORTS', 'GIT_REMOTE_URL', 'USER_NAME', 'USER_EMAIL', @@ -134,6 +135,7 @@ export function validateTemplateVariables(variables: TemplateVariables): Templat case 'USER_NAME': case 'PROJECT_PATH': case 'PURPOSE': + case 'PROJECT_IMPORTS': if (typeof value === 'string' && value.length < MAX_VALUE_LENGTH) { validated[key] = value; } From aa5d7629ad2a4f84359bf865de74d6fa821f648d Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:28 -0400 Subject: [PATCH 19/23] feat: add PROJECT_IMPORTS to TemplateVariables interface --- src/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types.ts b/src/types.ts index 8145b40..c95e5f4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -37,6 +37,7 @@ export interface TemplateVariables { VERSION_CONTROL: string; FRAMEWORK: string; PURPOSE?: string; + PROJECT_IMPORTS?: string; HAS_FRAMEWORK?: boolean; HAS_PACKAGE_MANAGER?: boolean; HAS_GIT?: boolean; From b9b93b45a391325e7b2cbfa3a48ebd3a4ff5d97e Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:33 -0400 Subject: [PATCH 20/23] docs: update README with v0.1.9 features and remove emojis --- README.md | 80 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 9d660cb..1af912f 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,7 @@ Claude Code setup that just works. Bootstrap every project with agents, hooks, c [![version](https://img.shields.io/npm/v/create-claude.svg?label=version&color=brightgreen)](https://www.npmjs.com/package/create-claude) [![downloads](https://img.shields.io/npm/dm/create-claude.svg?label=downloads&color=blue)](https://www.npmjs.com/package/create-claude) -[![package size](https://img.shields.io/npm/unpacked-size/create-claude?label=package%20size&color=orange)](https://www.npmjs.com/package/create-claude) -[![node version](https://img.shields.io/node/v/create-claude?label=node%20version&color=forestgreen)](https://www.npmjs.com/package/create-claude) -[![build](https://github.com/RMNCLDYO/create-claude/workflows/CI/badge.svg?label=build&color=navy)](https://github.com/RMNCLDYO/create-claude/actions/workflows/ci.yml) -[![security](https://github.com/RMNCLDYO/create-claude/workflows/Security%20Scan/badge.svg?label=security&color=purple)](https://github.com/RMNCLDYO/create-claude/actions/workflows/security.yml) -[![openssf](https://www.bestpractices.dev/projects/11141/badge?label=openssf&color=gold)](https://www.bestpractices.dev/projects/11141) +[![package size](https://img.shields.io/npm/unpacked-size/create-claude?label=package%20size&color=yellow)](https://www.npmjs.com/package/create-claude) [![license](https://img.shields.io/badge/license-MIT-red.svg)](https://opensource.org/licenses/MIT) ## Quick Start @@ -17,11 +13,12 @@ Claude Code setup that just works. Bootstrap every project with agents, hooks, c npm create claude ``` -*Adds the **local** config files to your project. ZERO dependencies, ZERO overhead.* +*Adds **local** Claude Code config files to your project. ZERO dependencies, ZERO overhead.* ## Installation Options ### Package Managers + ```bash npm create claude # npm pnpm create claude # pnpm @@ -30,12 +27,14 @@ yarn create claude # yarn ``` ### Flags + ```bash npm create claude --dry-run # Preview files npm create claude --help # All options ``` ### Shortcuts + ```bash cld # Short alias npx cld # Via npx @@ -44,11 +43,13 @@ npx cld # Via npx ## Programmatic Usage ### Installation + ```bash npm i create-claude ``` ### Usage + ```typescript import { init } from 'create-claude'; @@ -57,14 +58,35 @@ await init('./my-project'); ## Features -### Smart Configuration -- **Auto-detection**: Finds your package.json scripts, formatters, linters -- **Smart permissions**: Pre-approves safe operations, blocks dangerous ones +### Maximum Autonomy with Safety + +- **bypassPermissions mode**: Claude Code operates freely while dangerous operations are blocked +- **Smart safety hooks**: Only blocks truly destructive commands (rm -rf /, sudo rm, disk formatting) +- **Delete confirmations**: All file/directory deletions require explicit user approval + +### 8 Custom Slash Commands + +- **`/commit`**: Create git commits with Haiku model for cost efficiency +- **`/explain`**: Get concise code explanations +- **`/fix`**: Fix issues with structured approach +- **`/optimize`**: Performance improvements +- **`/pr`**: Create pull requests with git context +- **`/review`**: Brutal code reviews +- **`/test`**: Run tests with pattern support +- **`/validate`**: Lint, typecheck, and format -### Enhanced Workflow -- **Custom agents**: `/refactor` and `/validate` commands -- **Better statusline**: Shows Git branch, uncommitted changes -- **Format hooks**: Runs Prettier/ESLint/etc automatically +### 3 Specialized Subagents + +- **pre-commit**: Ruthless validation before commits +- **refactor**: Aggressive complexity reduction +- **debugger**: Root cause analysis and fixes + +### Production-Ready Configuration + +- **Session hooks**: Automatic cleanup on exit +- **Advanced statusline**: Git status, framework detection, color-coded information with modular helpers +- **Import-based memory**: CLAUDE.md uses `@` imports for README and dynamically includes project configs (package.json, Cargo.toml, etc.) +- **Terse output style**: Minimal, efficient responses without bloat ## FAQ @@ -77,6 +99,7 @@ Yes. It only creates config files, never modifies your code. Each file operation # If something goes wrong, backups are here: ls .create-claude-backup-* ``` +
@@ -104,6 +127,7 @@ That's it. No global installs, no dependencies. Does it work with my tools? It auto-detects: + - **Formatters**: Prettier, ESLint, Biome, dprint - **Package managers**: npm, yarn, pnpm, bun - **Languages**: JavaScript, TypeScript, Python, Go, Rust @@ -115,28 +139,44 @@ Can't find your tool? It falls back to sensible defaults.
What files does it create? +Creates 20 files in total: + ``` .claude/ ├── settings.local.json # Permissions, tool detection ├── hooks/ │ ├── format.cjs # Auto-format on save -│ └── safety.cjs # Block dangerous operations +│ ├── safety.cjs # Block dangerous operations +│ └── session-end.cjs # Cleanup on exit ├── agents/ -│ ├── refactor.md # /refactor command -│ └── pre-commit.md # Git hook integration +│ ├── pre-commit.md # Ruthless validation +│ ├── refactor.md # Complexity reduction +│ └── debugger.md # Root cause analysis ├── commands/ -│ ├── validate.md # /validate command -│ └── test.md # /test command -└── scripts/ - └── statusline.cjs # Git status in prompt +│ ├── commit.md # Git commits with Haiku +│ ├── explain.md # Code explanations +│ ├── fix.md # Structured fixes +│ ├── optimize.md # Performance improvements +│ ├── pr.md # Pull request creation +│ ├── review.md # Brutal code reviews +│ ├── test.md # Test runner +│ └── validate.md # Lint, typecheck, format +├── scripts/ +│ ├── statusline.cjs # Git status in prompt +│ ├── statusline-git.cjs # Git operations helper +│ └── statusline-detect.cjs # Framework detection helper +└── output-styles/ + └── terse.md # Minimal output style CLAUDE.md # Project-specific instructions ``` +
## Security This project follows security best practices: + - All dependencies are audited and kept up-to-date - Code is scanned with CodeQL and other security tools - OpenSSF Scorecard certified From 8b9c4c9b37fcb69d70a22b920a4bf7908380355c Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:38 -0400 Subject: [PATCH 21/23] docs: add v0.1.9 changelog with all new features --- CHANGELOG.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd4aa2d..148a4b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,44 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.9] - 2025-09-07 + +### Added + +- **Enhanced Permission System**: Implemented `bypassPermissions` mode for maximum autonomy with safety guardrails +- **8 Custom Slash Commands**: Added `/commit`, `/explain`, `/fix`, `/optimize`, `/pr`, `/review`, `/test`, `/validate` with proper frontmatter and argument support +- **3 Specialized Subagents**: Pre-commit validator, code refactorer, and debugger with focused tool access +- **Session Lifecycle Hooks**: SessionEnd hooks for project context and cleanup +- **Bash Command Execution**: Added `!` prefix support in slash commands for dynamic git context +- **Import-based Memory**: CLAUDE.md now uses `@` imports for README and package.json references via `PROJECT_IMPORTS` template variable +- **Environment Variables**: Configured bash timeouts and working directory maintenance +- **Statusline Helper Scripts**: Added statusline-git.cjs and statusline-detect.cjs for modular statusline functionality +- **Template Variable**: Added `PROJECT_IMPORTS` to dynamically include project configuration files in CLAUDE.md + +### Changed + +- **Simplified Permissions**: Switched from explicit tool lists to `allow: ["*"]` with targeted deny/ask lists +- **Safety Hook Rewrite**: Enhanced with permissive mode detection and refined dangerous pattern matching +- **Terse Output Style**: Configured for minimal, efficient responses without bloat +- **Status Line**: Advanced implementation with git integration, framework detection, and color coding +- **Gitignore**: Fixed to properly track skel/.claude template files while ignoring local instances + +### Improved + +- **Subagent Formatting**: Added proper markdown headers and structure to pre-commit and refactor agents +- **Command Arguments**: Added `argument-hint` and `$ARGUMENTS` placeholders to relevant commands +- **Security Patterns**: Refined dangerous command detection to only block truly destructive operations +- **Delete Confirmations**: All delete operations now require explicit user confirmation +- **File Validation**: Updated init.ts to validate all 20 template files including new scripts and hooks +- **CLI Output**: Updated to display all 20 created files instead of subset + +### Fixed + +- **Hook Timeout**: Reduced safety hook timeout from 5 to 2 seconds for better responsiveness +- **Path Patterns**: Corrected permission patterns to use `//` for absolute paths and `~` for home directory +- **Template System**: Added PROJECT_IMPORTS to types.ts and template.ts for proper variable handling +- **Required Files**: Added statusline-git.cjs and statusline-detect.cjs to init.ts validation list + ## [0.1.8] - 2025-09-06 ### Enhanced @@ -233,6 +271,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Comprehensive test suite - TypeScript support with strict configuration +[0.1.9]: https://github.com/RMNCLDYO/create-claude/compare/v0.1.8...v0.1.9 [0.1.8]: https://github.com/RMNCLDYO/create-claude/compare/v0.1.7...v0.1.8 [0.1.7]: https://github.com/RMNCLDYO/create-claude/compare/v0.1.6...v0.1.7 [0.1.6]: https://github.com/RMNCLDYO/create-claude/compare/v0.1.5...v0.1.6 From 7e6263ed0bb3105d44ccc098d8c0f24c6694a256 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:44 -0400 Subject: [PATCH 22/23] chore: bump version to 0.1.9 --- package-lock.json | 22 +++++++++++----------- package.json | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 86832fb..95da52f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "create-claude", - "version": "0.1.8", + "version": "0.1.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "create-claude", - "version": "0.1.8", + "version": "0.1.9", "cpu": [ "x64", "arm64" @@ -22,8 +22,8 @@ "create-claude": "dist/cli.js" }, "devDependencies": { - "@types/node": "^20.19.11", - "typescript": "^5.3.0" + "@types/node": "^24.3.1", + "typescript": "^5.9.2" }, "engines": { "node": ">=18.0.0", @@ -35,13 +35,13 @@ } }, "node_modules/@types/node": { - "version": "20.19.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.13.tgz", - "integrity": "sha512-yCAeZl7a0DxgNVteXFHt9+uyFbqXGy/ShC4BlcHkoE0AfGXYv/BUiplV72DjMYXHDBXFjhvr6DD1NiRVfB4j8g==", + "version": "24.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz", + "integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.21.0" + "undici-types": "~7.10.0" } }, "node_modules/typescript": { @@ -59,9 +59,9 @@ } }, "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", + "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", "dev": true, "license": "MIT" } diff --git a/package.json b/package.json index a025eda..634de44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-claude", - "version": "0.1.8", + "version": "0.1.9", "description": "Claude Code setup that just works. Bootstrap every project with agents, hooks, commands, and smart permissions. One command, zero headaches.", "type": "module", "sideEffects": false, @@ -98,7 +98,7 @@ "preferGlobal": false, "stability": "stable", "devDependencies": { - "@types/node": "^20.19.11", - "typescript": "^5.3.0" + "@types/node": "^24.3.1", + "typescript": "^5.9.2" } } From 074c6f131a9e81cc43c6a7eaee188732c9f91210 Mon Sep 17 00:00:00 2001 From: RMNCLDYO Date: Sun, 7 Sep 2025 10:31:50 -0400 Subject: [PATCH 23/23] chore: update auxiliary files for v0.1.9 --- .gitignore | 5 ++++- CITATION.cff | 4 ++-- SECURITY.md | 4 ++-- SUPPORT.md | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 1c7d49c..002db8f 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,7 @@ Thumbs.db *.log # local settings -!settings.local.json +/.claude +/CLAUDE.md +!skel/.claude +!skel/CLAUDE.md diff --git a/CITATION.cff b/CITATION.cff index 5cfd9fd..5af98ea 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -29,5 +29,5 @@ keywords: - "productivity" license: MIT license-url: "https://github.com/RMNCLDYO/create-claude/blob/main/LICENSE" -version: "0.1.8" -date-released: "2025-09-06" \ No newline at end of file +version: "0.1.9" +date-released: "2025-09-07" \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md index 5793249..bab3fd0 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -12,7 +12,7 @@ We release patches for security vulnerabilities. Which versions are eligible for **Please do not report security vulnerabilities through public GitHub issues.** -Instead, please report them via email to **hi@rmncldyo.com**. +Instead, please report them via email to ****. You should receive a response within 48 hours. If for some reason you do not, please follow up via email to ensure we received your original message. @@ -53,4 +53,4 @@ We support safe harbor for security researchers who: - Do not access, modify, or delete data belonging to others - Contact us first before sharing details of any vulnerabilities with others -We will not pursue legal action against security researchers who follow these guidelines. \ No newline at end of file +We will not pursue legal action against security researchers who follow these guidelines. diff --git a/SUPPORT.md b/SUPPORT.md index 6392887..4247508 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -45,7 +45,7 @@ Before creating an issue, please: ## Commercial Support -For priority support, custom implementations, or consulting services, contact hi@rmncldyo.com. +For priority support, custom implementations, or consulting services, contact . ## Contributing @@ -58,4 +58,4 @@ We welcome contributions! See our [Contributing Guide](CONTRIBUTING.md) for deta ## Code of Conduct -This project follows our [Code of Conduct](CODE_OF_CONDUCT.md). Please read it before participating in our community. \ No newline at end of file +This project follows our [Code of Conduct](CODE_OF_CONDUCT.md). Please read it before participating in our community.