Skip to content

feat(engineering): add karpathy-coder — active coding discipline enforcer - #522

Merged
alirezarezvani merged 2 commits into
devfrom
feature/karpathy-coder
Apr 12, 2026
Merged

feat(engineering): add karpathy-coder — active coding discipline enforcer#522
alirezarezvani merged 2 commits into
devfrom
feature/karpathy-coder

Conversation

@alirezarezvani

Copy link
Copy Markdown
Owner

Summary

  • New POWERFUL-tier skill implementing Karpathy's 4 coding principles as an active enforcement plugin
  • Inspired by forrestchang/andrej-karpathy-skills but goes far beyond with automated detection tools
  • Ships 4 Python tools, 1 review agent, 1 slash command, 1 pre-commit hook, 3 reference guides

What makes this "better and greater"

Aspect forrestchang (source) karpathy-coder (ours)
Enforcement Passive prompt (SKILL.md) 4 Python tools that detect violations
Review None karpathy-reviewer agent runs all 4 principles against a diff
Measurement "Fewer unnecessary changes" Concrete: complexity score, diff noise ratio, assumption count, goal verification %
Scripts 0 4 stdlib-only Python tools
Hook None karpathy-gate.sh pre-commit (non-blocking)
Command None /karpathy-check slash command
CI None GitHub Actions workflow template in enforcement-patterns.md
Examples Separate EXAMPLES.md Integrated anti-patterns.md reference (10+ before/after examples)
Cross-tool Claude Code only AGENTS.md compatible (Codex, Cursor, Antigravity, etc.)
Adoption guide None 4-level progressive enforcement (passive → review → hook → CI)

The 4 tools

Script Principle What it detects
complexity_checker.py #2 Simplicity Cyclomatic complexity, class density, nesting depth, function length, premature ABC/Protocol
diff_surgeon.py #3 Surgical Comment-only changes, whitespace noise, style drift, quote swaps, drive-by refactors
assumption_linter.py #1 Think "just", "obviously", "should work", vague verbs, unscoped users, missing format specs
goal_verifier.py #4 Goals Scores each plan step 0-3 for verification quality, flags missing final check

Smoke test results

complexity_checker on itself: 85/100 (1 finding: nesting depth 5 > 4)
assumption_linter on "I'll just export all user data. Obviously we need caching": 
  → 4 findings: assumption-just, assumption-obvious, assumption-hopeful, missing-format
goal_verifier on a 4-step plan (2 verified, 2 not): 33% MISSING verdict
diff_surgeon: graceful "no diff" handling
hook: bash syntax OK

Test plan

  • All 4 scripts pass --help
  • complexity_checker.py on its own source → detects nesting depth warning
  • diff_surgeon.py handles empty diff gracefully
  • assumption_linter.py catches "just", "obviously", "should work", unscoped exports
  • goal_verifier.py scores verified vs unverified plan steps correctly
  • karpathy-gate.sh passes bash -n syntax check
  • plugin.json valid JSON with correct fields
  • Reviewer: install via /plugin install karpathy-coder@claude-code-skills and run /karpathy-check

🤖 Generated with Claude Code

…rcer

Implements Karpathy's 4 coding principles (Think Before Coding, Simplicity
First, Surgical Changes, Goal-Driven Execution) as an active enforcement
plugin, not just passive guidelines. Derived from Karpathy's X post on LLM
coding pitfalls but goes far beyond the source material with automated
detection tools, a review agent, and CI integration patterns.

Differentiator vs forrestchang/andrej-karpathy-skills (prompt-only, single
SKILL.md): this version ships real tooling that DETECTS violations instead
of just documenting principles.

Plugin contents (engineering/karpathy-coder/):
- SKILL.md with `context: fork` for skill chaining
- 4 Python tools (stdlib only):
  - complexity_checker.py — cyclomatic complexity, class density, nesting
    depth, function length, premature abstractions (Principle #2)
  - diff_surgeon.py — diff noise ratio: comment-only changes, whitespace,
    style drift, drive-by refactors, quote-style swaps (Principle #3)
  - assumption_linter.py — detects "just", "obviously", "should work",
    vague actions, unscoped users, missing format specs (Principle #1)
  - goal_verifier.py — scores plan steps 0-3 for verification quality,
    flags vague criteria, checks for final verification (Principle #4)
- 1 sub-agent: karpathy-reviewer (runs all 4 principles against a diff)
- 1 slash command: /karpathy-check (dispatches the reviewer)
- 1 pre-commit hook: karpathy-gate.sh (non-blocking, warns on violations)
- 3 reference docs: karpathy-principles.md (full context + when to relax),
  anti-patterns.md (10+ before/after examples), enforcement-patterns.md
  (Husky, pre-commit framework, GitHub Actions CI integration)
- .claude-plugin/plugin.json manifest (v2.3.0)
- Cross-tool compatible: works with any AGENTS.md-based CLI

All 4 scripts verified: --help passes, smoke tests run correctly.
complexity_checker catches its own nesting depth. assumption_linter
correctly flags "just", "obviously", "should work". goal_verifier
correctly scores plans with/without verification steps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🛡️ VirusTotal Security Scan

File Analysis
engineering-karpathy-coder.zip Report

Scanned with 70+ antivirus engines

Automated by ghaction-virustotal

@github-actions

github-actions Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

🔒 Skill Security Audit Results

engineering — FAIL

Severity Count
🔴 Critical 41
🟡 High 15
Findings detail
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 125,
  "pattern": "\"risk\": \"Arbitrary command execution via os.system()\",",
  "risk": "Arbitrary command execution via os.system()",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 132,
  "pattern": "\"risk\": \"Command execution via os.popen()\",",
  "risk": "Command execution via os.popen()",
  "fix": "Use subprocess.run() with list arguments and capture_output=True"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 154,
  "pattern": "\"risk\": \"Arbitrary code execution via eval()\",",
  "risk": "Arbitrary code execution via eval()",
  "fix": "Use ast.literal_eval() for data parsing or explicit parsing logic"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 161,
  "pattern": "\"risk\": \"Arbitrary code execution via exec()\",",
  "risk": "Arbitrary code execution via exec()",
  "fix": "Remove exec() \u2014 rewrite logic to avoid dynamic code execution"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 162,
  "pattern": "\"fix\": \"Remove exec() \u2014 rewrite logic to avoid dynamic code execution\",",
  "risk": "Arbitrary code execution via exec()",
  "fix": "Remove exec() \u2014 rewrite logic to avoid dynamic code execution"
}
{
  "severity": "CRITICAL",
  "category": "PRIV-ESC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 342,
  "pattern": "\"fix\": \"Remove sudo usage. Skills should never require elevated privileges\",",
  "risk": "Sudo invocation \u2014 privilege escalation attempt",
  "fix": "Remove sudo usage. Skills should never require elevated privileges"
}
{
  "severity": "HIGH",
  "category": "DESERIAL",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 378,
  "pattern": "\"fix\": \"Use yaml.safe_load() or yaml.load(data, Loader=yaml.SafeLoader)\",",
  "risk": "Unsafe YAML loading \u2014 can execute arbitrary code",
  "fix": "Use yaml.safe_load() or yaml.load(data, Loader=yaml.SafeLoader)"
}
{
  "severity": "CRITICAL",
  "category": "PRIV-ESC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 468,
  "pattern": "\"regex\": r\"<!--\\s*(?:system|instruction|override|ignore|execute|run|sudo|admin)\",",
  "risk": "Sudo invocation \u2014 privilege escalation attempt",
  "fix": "Remove sudo usage. Skills should never require elevated privileges"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 579,
  "pattern": "\"risk\": \"Dynamic Function constructor \u2014 equivalent to eval()\",",
  "risk": "Arbitrary code execution via eval()",
  "fix": "Use ast.literal_eval() for data parsing or explicit parsing logic"
}
{
  "severity": "HIGH",
  "category": "FS-ABUSE",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 918,
  "pattern": "shutil.rmtree(tmp_dir, ignore_errors=True)",
  "risk": "Recursive directory deletion \u2014 destructive operation",
  "fix": "Remove or restrict to specific, validated paths within skill scope"
}
{
  "severity": "HIGH",
  "category": "FS-ABUSE",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 930,
  "pattern": "shutil.rmtree(tmp_dir, ignore_errors=True)",
  "risk": "Recursive directory deletion \u2014 destructive operation",
  "fix": "Remove or restrict to specific, validated paths within skill scope"
}
{
  "severity": "HIGH",
  "category": "FS-ABUSE",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 1046,
  "pattern": "shutil.rmtree(cleanup_dir, ignore_errors=True)",
  "risk": "Recursive directory deletion \u2014 destructive operation",
  "fix": "Remove or restrict to specific, validated paths within skill scope"
}
{
  "severity": "CRITICAL",
  "category": "NET-EXFIL",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/tech-debt-tracker/assets/sample_codebase/src/payment_processor.py",
  "line": 100,
  "pattern": "response = requests.post(",
  "risk": "Outbound HTTP write request \u2014 potential data exfiltration",
  "fix": "Remove outbound POST/PUT/PATCH or verify destination is trusted and necessary"
}
{
  "severity": "CRITICAL",
  "category": "NET-EXFIL",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/tech-debt-tracker/assets/sample_codebase/src/payment_processor.py",
  "line": 142,
  "pattern": "response = requests.post(",
  "risk": "Outbound HTTP write request \u2014 potential data exfiltration",
  "fix": "Remove outbound POST/PUT/PATCH or verify destination is trusted and necessary"
}
{
  "severity": "CRITICAL",
  "category": "NET-EXFIL",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/tech-debt-tracker/assets/sample_codebase/src/payment_processor.py",
  "line": 182,
  "pattern": "response = requests.post(",
  "risk": "Outbound HTTP write request \u2014 potential data exfiltration",
  "fix": "Remove outbound POST/PUT/PATCH or verify destination is trusted and necessary"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 123,
  "pattern": "code = 'os.system(\"ls -la\")'",
  "risk": "Arbitrary command execution via os.system()",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 128,
  "pattern": "code = 'result = eval(user_input)'",
  "risk": "Arbitrary code execution via eval()",
  "fix": "Use ast.literal_eval() for data parsing or explicit parsing logic"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 133,
  "pattern": "code = 'exec(user_code)'",
  "risk": "Arbitrary code execution via exec()",
  "fix": "Remove exec() \u2014 rewrite logic to avoid dynamic code execution"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 138,
  "pattern": "code = 'subprocess.run(cmd, shell=True)'",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CRED-HARVEST",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 297,
  "pattern": "api_key = os.environ.get(\"API_KEY\")",
  "risk": "Reads sensitive environment variables",
  "fix": "Remove credential access. Skills should not need external credentials"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 441,
  "pattern": "os.system(\"echo \" + user_input)",
  "risk": "Arbitrary command execution via os.system()",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 464,
  "pattern": "subprocess.run(cmd, shell=True)",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 486,
  "pattern": "return eval(user_input)",
  "risk": "Arbitrary code execution via eval()",
  "fix": "Use ast.literal_eval() for data parsing or explicit parsing logic"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/tests/test_security_scorer.py",
  "line": 507,
  "pattern": "exec(user_code)",
  "risk": "Arbitrary code execution via exec()",
  "fix": "Remove exec() \u2014 rewrite logic to avoid dynamic code execution"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/scripts/security_scorer.py",
  "line": 429,
  "pattern": "- os.system(), os.popen() usage",
  "risk": "Arbitrary command execution via os.system()",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/scripts/security_scorer.py",
  "line": 429,
  "pattern": "- os.system(), os.popen() usage",
  "risk": "Command execution via os.popen()",
  "fix": "Use subprocess.run() with list arguments and capture_output=True"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/scripts/security_scorer.py",
  "line": 431,
  "pattern": "- eval(), exec() usage",
  "risk": "Arbitrary code execution via eval()",
  "fix": "Use ast.literal_eval() for data parsing or explicit parsing logic"
}
{
  "severity": "CRITICAL",
  "category": "CODE-EXEC",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-tester/scripts/security_scorer.py",
  "line": 431,
  "pattern": "- eval(), exec() usage",
  "risk": "Arbitrary code execution via exec()",
  "fix": "Remove exec() \u2014 rewrite logic to avoid dynamic code execution"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/autoresearch-agent/evaluators/test_pass_rate.py",
  "line": 13,
  "pattern": "result = subprocess.run(TEST_CMD, shell=True, capture_output=True, text=True, timeout=300)",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/autoresearch-agent/evaluators/build_speed.py",
  "line": 20,
  "pattern": "subprocess.run(CLEAN_CMD, shell=True, capture_output=True, timeout=60)",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/autoresearch-agent/evaluators/build_speed.py",
  "line": 23,
  "pattern": "result = subprocess.run(BUILD_CMD, shell=True, capture_output=True, timeout=600)",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/autoresearch-agent/evaluators/benchmark_size.py",
  "line": 26,
  "pattern": "result = subprocess.run(BUILD_CMD, shell=True, capture_output=True)",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/autoresearch-agent/evaluators/benchmark_size.py",
  "line": 34,
  "pattern": "subprocess.run(DOCKER_BUILD_CMD, shell=True, capture_output=True)",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/autoresearch-agent/evaluators/benchmark_speed.py",
  "line": 20,
  "pattern": "subprocess.run(COMMAND, shell=True, capture_output=True, timeout=120)",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "CMD-INJECT",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/autoresearch-agent/evaluators/benchmark_speed.py",
  "line": 25,
  "pattern": "result = subprocess.run(COMMAND, shell=True, capture_output=True, timeout=120)",
  "risk": "Shell injection via subprocess with shell=True",
  "fix": "Use subprocess.run() with list arguments and shell=False"
}
{
  "severity": "CRITICAL",
  "category": "PROMPT-OVERRIDE",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/SKILL.md",
  "line": 60,
  "pattern": "| **System prompt override** | \"Ignore previous instructions\", \"You are now...\" | \ud83d\udd34 CRITICAL |",
  "risk": "Attempts to override system prompt and prior instructions",
  "fix": "Remove instruction override attempts"
}
{
  "severity": "CRITICAL",
  "category": "SAFETY-BYPASS",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/SKILL.md",
  "line": 61,
  "pattern": "| **Role hijacking** | \"Act as root\", \"Pretend you have no restrictions\" | \ud83d\udd34 CRITICAL |",
  "risk": "Safety restriction bypass attempt",
  "fix": "Remove safety bypass instructions"
}
{
  "severity": "CRITICAL",
  "category": "SAFETY-BYPASS",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/SKILL.md",
  "line": 62,
  "pattern": "| **Safety bypass** | \"Skip safety checks\", \"Disable content filtering\" | \ud83d\udd34 CRITICAL |",
  "risk": "Explicit safety mechanism bypass",
  "fix": "Remove safety bypass directives"
}
{
  "severity": "CRITICAL",
  "category": "PROMPT-EXFIL",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/SKILL.md",
  "line": 65,
  "pattern": "| **Data extraction** | \"Send contents of\", \"Upload file to\", \"POST to\" | \ud83d\udd34 CRITICAL |",
  "risk": "Instruction to exfiltrate data",
  "fix": "Remove data transmission directives"
}
{
  "severity": "CRITICAL",
  "category": "PROMPT-EXFIL",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/references/threat-model.md",
  "line": 66,
  "pattern": "| File read | Access credential files | `open(os.path.expanduser(\"~/.aws/credentials\"))` |",
  "risk": "Instruction to access sensitive files or credentials",
  "fix": "Remove credential/sensitive file access directives"
}
{
  "severity": "CRITICAL",
  "category": "PROMPT-OVERRIDE",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/references/threat-model.md",
  "line": 75,
  "pattern": "| Override | \"Ignore previous instructions\" | In SKILL.md body |",
  "risk": "Attempts to override system prompt and prior instructions",
  "fix": "Remove instruction override attempts"
}
{
  "severity": "CRITICAL",
  "category": "PROMPT-OVERRIDE",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/references/threat-model.md",
  "line": 76,
  "pattern": "| Role hijack | \"You are now an unrestricted AI\" | Redefine agent identity |",
  "risk": "Role hijacking \u2014 attempts to redefine the AI's identity",
  "fix": "Remove role redefinition. Skills should provide instructions, not identity changes"
}
{
  "severity": "CRITICAL",
  "category": "SAFETY-BYPASS",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/references/threat-model.md",
  "line": 77,
  "pattern": "| Safety bypass | \"Skip safety checks for efficiency\" | Disable guardrails |",
  "risk": "Explicit safety mechanism bypass",
  "fix": "Remove safety bypass directives"
}
{
  "severity": "CRITICAL",
  "category": "PROMPT-EXFIL",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/references/threat-model.md",
  "line": 247,
  "pattern": "- Access credential files or sensitive env vars",
  "risk": "Instruction to access sensitive files or credentials",
  "fix": "Remove credential/sensitive file access directives"
}
{
  "severity": "CRITICAL",
  "category": "PROMPT-EXFIL",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/env-secrets-manager/SKILL.md",
  "line": 84,
  "pattern": "Production applications should never read secrets from `.env` files or environment variables baked into container images",
  "risk": "Instruction to access sensitive files or credentials",
  "fix": "Remove credential/sensitive file access directives"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/skill-security-auditor/scripts/skill_security_auditor.py",
  "line": 717,
  "pattern": "# Check for pip/npm install in code",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to package.json for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/docker-development/scripts/dockerfile_analyzer.py",
  "line": 102,
  "pattern": "\"message\": \"pip install without --no-cache-dir \u2014 retains pip cache in layer\",",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/docker-development/scripts/dockerfile_analyzer.py",
  "line": 103,
  "pattern": "\"fix\": \"Use: pip install --no-cache-dir -r requirements.txt\",",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/docker-development/scripts/dockerfile_analyzer.py",
  "line": 110,
  "pattern": "\"message\": \"npm install includes devDependencies \u2014 use npm ci --omit=dev for production\",",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to package.json for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/docker-development/scripts/dockerfile_analyzer.py",
  "line": 177,
  "pattern": "RUN pip install -r requirements.txt",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/browser-automation/scripts/scraping_toolkit.py",
  "line": 107,
  "pattern": "pip install playwright",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/browser-automation/scripts/form_automation_builder.py",
  "line": 183,
  "pattern": "pip install playwright",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/ci-cd-pipeline-builder/scripts/pipeline_generator.py",
  "line": 150,
  "pattern": "\"      - run: python3 -m pip install -U pip\",",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/ci-cd-pipeline-builder/scripts/pipeline_generator.py",
  "line": 151,
  "pattern": "\"      - run: python3 -m pip install -r requirements.txt || true\",",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/ci-cd-pipeline-builder/scripts/pipeline_generator.py",
  "line": 235,
  "pattern": "\"    - python3 -m pip install -U pip\",",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}
{
  "severity": "HIGH",
  "category": "DEPS-RUNTIME",
  "file": "/home/runner/work/claude-skills/claude-skills/engineering/ci-cd-pipeline-builder/scripts/pipeline_generator.py",
  "line": 236,
  "pattern": "\"    - python3 -m pip install -r requirements.txt || true\",",
  "risk": "Runtime package installation \u2014 may install untrusted code",
  "fix": "Move dependencies to requirements.txt for pre-install review"
}

engineering/karpathy-coder — PASS

No findings.

@github-actions

github-actions Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

📊 Skill Quality Review (Tessl)

Skill Score Description Content Verdict
engineering/karpathy-coder 0/100 ⚠️ 0% 0% NEEDS WORK

Threshold: 70/100 — skills below this score need improvement before merge.

🔧 Internal Validation

  • engineering/karpathy-coder: structure 75.0/100 (GOOD), scripts 4/4 PASS, security PASS

@claude

claude Bot commented Apr 12, 2026

Copy link
Copy Markdown

Review: feat(engineering): add karpathy-coder

Overall: Strong, well-conceived POWERFUL-tier skill. The comparison table in the PR description makes the value proposition clear, and the 4-tool approach with progressive enforcement levels is exactly the right design for this kind of discipline enforcer. A few concrete issues to address before merging.


Bugs

1. Dead code in assumption_linter.py

NO_VERIFICATION (lines ~55-58) is defined but never passed to lint_text(). The only caller ignores it entirely. The numbered-plan block check at lines ~103-112 handles verification separately, so this dead list is never consulted.

Either wire it into lint_text() or remove it.

2. Quote-style swap detection uses sorted pairs (positional mismatch)

In diff_surgeon.py:

for a, d in zip(sorted(additions), sorted(deletions)):

Sorting independently destroys positional context. A removal on line 10 gets paired with an addition on line 50 if the sorted strings happen to align. Use positional pairs from consecutive -/+ lines in the same hunk instead.


Documentation / Configuration Issues

3. $CLAUDE_PLUGIN_ROOT is not a real variable

Both hooks/karpathy-gate.sh and references/enforcement-patterns.md reference ${CLAUDE_PLUGIN_ROOT} in the Claude Code settings.json example:

"command": "${CLAUDE_PLUGIN_ROOT}/hooks/karpathy-gate.sh"

This env variable doesn't appear to be a Claude Code built-in. Users following this example will get a broken hook with no clear error. Replace with either an absolute path placeholder or document that users must substitute the actual install path.

4. Hook triggers on every Bash call, not just commits

The PostToolUse/Bash hook fires after every shell command Claude Code runs. The early-exit guard (if [ -z "$(git diff --staged --name-only)" ]; then exit 0; fi) mitigates most noise, but still spawns a git subprocess on every Bash tool use. Consider recommending Husky as the primary integration and framing the Claude Code PostToolUse hook as a secondary option.


Minor Issues

5. Score formula is step-function, not graduated

In complexity_checker.py:

score = max(0, 100 - len(findings) * 15)

Seven or more findings all produce 0. A file with 7 minor warnings scores the same as one with 20 severe ones. Worth weighting by severity if you ever add error vs warn levels.

6. The tool self-fails its own threshold

Acknowledged in the smoke tests (complexity_checker on itself: 85/100, nesting depth 5 > 4). The nesting depth 5 in extract_functions() could be reduced by extracting the inner loop. Minor, but ironic for a complexity checker.

7. No CHANGELOG.md or marketplace update

Adding a new POWERFUL-tier skill typically warrants a CHANGELOG entry. Not a blocker.


What's Working Well

  • Plugin schema is correct — only the required fields, version matches repo 2.3.0
  • All scripts are stdlib-only — zero external dependencies
  • Shell injection preventionsubprocess.run() uses list form throughout, no shell=True
  • Graceful empty-diff handlingdiff_surgeon.py exits cleanly when nothing is staged
  • anti-patterns.md before/after examples are some of the best in the repo — specific and actionable
  • Progressive enforcement levels (Level 1-4) is a practical adoption path
  • SKILL.md frontmatter is complete and properly structured

Verdict

Mergeable after addressing issues 1-3. Issues 4-7 are recommended improvements but not blockers. The dead NO_VERIFICATION code and the $CLAUDE_PLUGIN_ROOT documentation hole are the highest-priority fixes.

🤖 Reviewed with Claude Code

Auto-fixes from plugin-audit pipeline:

Phase 2 (70.4 → 75.0 GOOD):
- Added README.md with quick start, tool descriptions, enforcement levels

Phase 3 (51.7 → 63.5, above 60):
- Added expected_outputs/ with 4 JSON fixtures (one per tool)
- Completeness 66.7 → 85.0

Phase 6 (marketplace + agent + command):
- Added karpathy-coder to .claude-plugin/marketplace.json (category: development)
- Mirrored cs-karpathy-reviewer to agents/engineering/
- Mirrored /karpathy-check to commands/
- mkdocs.yml: added skill + command nav entries

Phase 7 (ecosystem sync):
- Ran sync-codex-skills.py + sync-gemini-skills.py
- karpathy-coder now in both indexes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🛡️ VirusTotal Security Scan

File Analysis
engineering-karpathy-coder.zip Report

Scanned with 70+ antivirus engines

Automated by ghaction-virustotal

@claude

claude Bot commented Apr 12, 2026

Copy link
Copy Markdown

Code Review — karpathy-coder skill

Overall: Strong addition. Well-structured POWERFUL-tier skill that follows the repo's package pattern. The tooling-over-prose approach is exactly right, the expected_outputs/ fixtures are a nice touch for documentation, and the 4-level enforcement guide in references/enforcement-patterns.md is genuinely useful. A few bugs and inconsistencies to address before merge.


Bugs

1. assumption_linter.pyNO_VERIFICATION is dead code

NO_VERIFICATION = [
    (re.compile(r"^(?:(?!(?:test|verify|check|assert|confirm|ensure|validate)).)*$", re.I),
     "no-verification", "No verification step found in this block."),
]

This list is defined but never iterated in lint_text(). The function only loops over ASSUMPTION_SIGNALS and MISSING_CLARIFICATION. Either wire it or remove it.

2. diff_surgeon.py — quote-style swap detection is unreliable

for a, d in zip(sorted(additions), sorted(deletions)):
    a_norm = a[1:].replace('"', "'").strip()
    d_norm = d[1:].replace('"', "'").strip()

zip(sorted(additions), sorted(deletions)) pairs lines by alphabetical sort order, not semantic correspondence. A diff with 5 additions and 5 deletions that are completely unrelated will generate false positive quote-swap findings whenever their normalized forms happen to collide. This should pair lines by proximity in the hunk instead (track added/removed lines with their hunk line numbers).

3. karpathy-gate.sh — word splitting on filenames with spaces

for f in $CHANGED_FILES; do

If any staged file has a space in its path, $CHANGED_FILES will split incorrectly. Use:

while IFS= read -r f; do
    ...
done <<< "$CHANGED_FILES"

Documentation / Path inconsistencies

4. Wrong agent path in both command files

commands/karpathy-check.md (line 36) and engineering/karpathy-coder/commands/karpathy-check.md both say:

Dispatches the `karpathy-reviewer` agent. See `agents/karpathy-reviewer.md`.

The actual path is agents/engineering/cs-karpathy-reviewer.md. The wrong path will confuse users trying to follow the reference.

5. Duplicate agent file

agents/engineering/cs-karpathy-reviewer.md and engineering/karpathy-coder/agents/karpathy-reviewer.md are byte-for-byte identical. The karpathy-coder/agents/ copy should be a symlink (like the .gemini/ entries) or reference the canonical path to avoid drift.


Minor / Design

6. complexity_checker.py exceeds its own strict threshold

The file is 317 lines. The strict setting flags files over 300. Running complexity_checker.py . --threshold strict on the skill's own source tree will flag the checker itself. Not a hard blocker, but worth noting as self-defeating, and easy to resolve by trimming ~20 lines or relaxing the strict threshold to 350.

7. scope-absolute pattern is very noisy

(re.compile(r"\b(?:all users|every|everything|always|never)\b", re.I), ...)

"always" and "never" are common English connectives that appear constantly in plan prose without representing scope assumptions. Expect high false-positive rates. Consider restricting to all users, every user, all data, etc., rather than bare adverbs.


Checklist

Item Status
Follows skill package pattern (SKILL.md, scripts/, references/)
YAML frontmatter present in SKILL.md
Scripts use stdlib only
plugin.json fields conform to schema
Cross-tool indexes updated (.codex, .gemini)
Index counts are arithmetically correct
Expected output fixtures included
Pre-commit hook is non-blocking
NO_VERIFICATION wired in assumption_linter.py ❌ Dead code
Quote-swap detection uses correct line pairing ❌ False positives
Hook handles filenames with spaces ❌ Word splitting bug
Agent path references correct ❌ Wrong path in command docs

🤖 Generated with Claude Code

@alirezarezvani
alirezarezvani merged commit a5cc806 into dev Apr 12, 2026
5 of 7 checks passed
@alirezarezvani
alirezarezvani deleted the feature/karpathy-coder branch April 12, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant