agentleFS
joonchungpersonal-devjoonchungpersonal-dev/claude-skills/skills/grill/SKILL.md

grill

Skill1 starsChanged 8 months agoMITView on GitHub

Adversarial 2-phase code review with 5C findings, OWASP risk scoring, and GPTLens critic validation. Use before pushing code.

53 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use kickoff, debug and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • pcatattacksSkill

    kickoff

    Launch a collaborative team meeting using agent teams. Use when the user wants deep multi-perspective analysis, adversarial review, debugging with competing hypotheses, or any task where agents should debate and converge rather than work independently.

    Also in 3 projects that use this

  • AnthropicSkill

    debug

    Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.

    Also in 8 projects that use this

  • WordPressSkill

    blueprint

    Use when the deliverable is WordPress Playground Blueprint JSON or a Blueprint bundle, including creating, editing, reviewing, validating schema keys, choosing steps/resources, and debugging Blueprint files. For only running or sharing a Playground environment, use wp-playground.

    Also in 3 projects that use this

  • GitHubSkill

    prd

    Generate high-quality Product Requirements Documents (PRDs) for software systems and AI-powered features. Includes executive summaries, user stories, technical specifications, and risk analysis.

    Also in 4 projects that use this

  • MicrosoftSkill

    diagnose

    Use to systematically diagnose why scenarios fail — identifies root causes by analyzing agent traces, codebase, and behavioral patterns

    Also in 5 projects that use this

  • allieraysSkill

    explain

    Explain what code does line by line so you can understand and learn from it.

    Also in 4 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

27 rules. 0 are common, 11 are distinctive, and 16 are very specific to this project.

  • 0

    Common

    Most of the 44 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If $ARGUMENTS specifies files or directories, use those.

    line 36
  2. Distinctive:

    Read each changed file in full before launching agents.

    line 42
  3. Distinctive:

    SmartBear limit note: If any single file exceeds 400 LOC, flag it in the report header (defect detection drops beyond this threshold per …

    line 44
  4. Very specific:

    After Agent 1 returns, launch a 2nd agent using the Agent tool with subagent_type: general-purpose.

    line 134
  5. Distinctive:

    After the Critic returns, combine validated findings into a single prioritized report:

    line 175
  6. Distinctive:

    Report header: must include:

    line 184
  7. Distinctive:

    After presenting findings, auto-detect and run the project's test suite:

    line 194
  8. Very specific:

    If pytest is available (Python project): python -m pytest tests/ -v (activate venv first if present)

    line 195
  9. Very specific:

    If package.json exists with test script: npm test

    line 196
  10. Very specific:

    If Makefile has test target: make test

    line 197
  11. Very specific:

    If Cargo.toml exists: cargo test

    line 198
  12. Distinctive:

    If no test runner found, note "No test runner detected" in the report

    line 199
  13. Distinctive:

    If tests fail, report the failures alongside audit findings but do not block the audit report.

    line 201
  14. Distinctive:

    After the audit completes (findings presented, tests run), log the results.

    line 205
  15. Distinctive:

    Run these commands to collect project info:

    line 209
  16. Very specific:

    Read ~/.claude/audit-log.json.

    line 269
  17. Distinctive:

    Create a timestamped directory:

    line 275
  18. Very specific:

    Create the directory: mkdir -p ~/.claude/audit-trails/grill/<timestamp>_<project>

    line 288
  19. Very specific:

    Write metadata.json — the full JSON log entry

    line 289
  20. Very specific:

    Write each agent's raw output to its .md file

    line 290
  21. Very specific:

    Write the consolidated report to consolidated_report.md

    line 291
  22. Very specific:

    Write the list of audited files with line counts to files_audited.txt

    line 292
  23. Very specific:

    If fixes were applied, capture git diff and save as diff_applied.patch

    line 293
  24. Distinctive:

    Commit the new trail to the audit-trails git repo:

    line 294
  25. Very specific:

    After updating audit-log.json, update the inline data block in the dashboard HTML:

    line 301
  26. Very specific:

    Read the full contents of ~/.claude/audit-log.json

    line 303
  27. Very specific:

    Write the updated index.html back

    line 312

“Common” is measured: kept by at least 6 in 10 of the 44 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/grill — Adversarial Code Review (2-Phase)

Stress-test code changes using a Comprehensive Reviewer agent + GPTLens Critic agent. Produces 5C findings with OWASP risk scores, eliminates false positives via critic validation, logs results to the audit dashboard.

Attribution & Sources

This skill extends a prompting technique into a formalized tool. Proper credit:

  • "Grill me" prompting technique: Boris Cherny (creator of Claude Code), from his "10 Tips from Inside the Claude Code Team" (Threads post). The core idea — challenging Claude to rigorously review your changes before proceeding — originates from Cherny's workflow recommendations.
  • GPTLens Auditor/Critic pattern: Hu et al., "Large Language Model-Powered Smart Contract Vulnerability Detection: New Perspectives," IEEE TPS (2023). arXiv:2310.01152. The two-phase diverge/converge approach (auditor generates findings, critic validates) to reduce false positives originates from this paper.
  • Trail of Bits security configuration: trailofbits/claude-code-config. Security review patterns and hardened Claude Code configuration from the Trail of Bits security research team.
  • obra/superpowers: obra/superpowers. An agentic skills framework and software development methodology by Jesse Vincent that informed the skill file structure and agent orchestration patterns.
  • 5C Audit Finding Format (IIA): The Condition-Criteria-Cause-Effect-Recommendation framework is an informal label for the IIA's "Five Attributes of a Finding" (Condition, Criteria, Cause, Effect, Recommendation), commonly associated with IIA Standards 2410/2420. The "5C" label is a mnemonic convenience — IIA's own terminology uses "Five Attributes," not "5C."
  • OWASP Risk Rating Methodology: OWASP Foundation. The Likelihood x Impact scoring matrix is a heavily simplified adaptation of the OWASP Risk Rating Methodology (owasp.org/www-community/OWASP_Risk_Rating_Methodology). OWASP's original uses 16 factors across 4 categories; this skill reduces it to 2 factors (Likelihood and Impact) on a 0–3 scale. The severity mapping (7–9=CRITICAL, 4–6=HIGH, 2–3=MEDIUM, 0–1=LOW) is custom to this skill, not a standard OWASP classification.
  • Fagan Inspection limits: The 400 LOC threshold originates from the SmartBear/Cisco study of 2,500 code reviews, not directly from Fagan (1976). Fagan's original work recommended ~250 LOC per session. The SmartBear study popularized the 400 LOC guideline based on empirical defect-detection drop-off data.

Modifications by Joon Chung: Extended from Cherny's prompting technique into a structured skill. Consolidated from a 5-agent parallel architecture (/plus-audit) into a streamlined 2-agent sequential architecture (Comprehensive Reviewer + Critic). Added 5C audit format, OWASP risk scoring, panel-tagging system, dashboard logging integration, paper trail archiving, and the "Think & Verify" self-disproof step before reporting.

Methodology

  • 5C Audit Finding Format: Condition, Criteria, Cause, Effect, Recommendation — an informal mnemonic for IIA's "Five Attributes of a Finding" (IIA Standards 2410/2420)
  • OWASP-Inspired Risk Rating: Severity = Likelihood (0-3) x Impact (0-3), score 0-9. Heavily simplified from OWASP's 16-factor methodology down to 2 factors. Severity mapping (7–9=CRITICAL, 4–6=HIGH, 2–3=MEDIUM, 0–1=LOW) is custom to this skill. Note: scores 5, 7, and 8 are unreachable with integer inputs (e.g., no integer pair produces L×I=5)
  • GPTLens Auditor/Critic Pattern: Two-phase diverge/converge to eliminate false positives
  • Think & Verify Prompting: Reviewer must attempt to disprove findings before reporting
  • SmartBear/Cisco Review Limits: Files exceeding 400 LOC are flagged (from SmartBear/Cisco study of 2,500 code reviews; Fagan's 1976 original recommended ~250 LOC)

Step 1: Identify files to audit

If $ARGUMENTS specifies files or directories, use those. Otherwise, run:

  • git diff --name-only HEAD to find uncommitted changes
  • git diff --name-only HEAD~1 to include the latest commit (if HEAD~1 exists; on single-commit repos, use git diff --cached --name-only instead)

Deduplicate the file list. If the file list is empty after deduplication, report "No changed files detected" and exit — do not launch agents.

Read each changed file in full before launching agents. If any single file exceeds 2,000 LOC, note this in the report header as a context-window risk — the agent may need to focus on the changed hunks rather than the full file.

SmartBear limit note: If any single file exceeds 400 LOC, flag it in the report header (defect detection drops beyond this threshold per SmartBear/Cisco study).

Step 2: Launch Comprehensive Reviewer agent

Launch ONE agent using the Agent tool with subagent_type: general-purpose. This agent covers ALL 7 review categories, pre-tagging each finding by panel.

Agent 1: Comprehensive Reviewer

The prompt for this agent must include the full contents of every file being audited, then the following instructions:

You are a skeptical senior code reviewer. Your job is to find real problems, not praise. Review every file above across ALL 7 categories below. Pre-tag each finding with its PANEL for downstream sorting.

CATEGORIES (with panel tags):

[PANEL: security] 1. SECURITY & PRIVACY
- Hardcoded secrets, API keys, tokens, PII exposure
- Injection vulnerabilities (SQL, command, template, XSS)
- Missing input validation or sanitization
- Rate limiting bypass, TOCTOU race conditions
- Insecure randomness, weak hashing
- Missing authentication/authorization checks

[PANEL: logic] 2. CORRECTNESS
- Off-by-one errors, boundary conditions
- None/null/empty handling, missing data paths
- Incorrect boolean logic, operator precedence
- Type mismatches, silent type coercion bugs

[PANEL: logic] 3. EDGE CASES
- Empty/large/Unicode inputs, concurrent access
- Network failures, timeout handling
- Exception paths that leave state inconsistent
- Test assertions that always pass (tautologies)

[PANEL: scalability] 4. PERFORMANCE
- N+1 queries, unbounded loops, missing pagination
- Memory leaks, unbounded data structures
- Blocking calls in async context
- O(n^2) or worse on non-trivial data sizes
- Missing timeouts on network/LLM calls

[PANEL: logic] 5. BREAKING CHANGES
- API contract violations, backward compatibility
- Database migration issues, schema changes
- Removed or renamed public interfaces

[PANEL: ux] 6. TEST COVERAGE
- Are changes tested? What cases are missing?
- Dead code, unreachable branches
- Note: UX panel caps at HIGH severity (no CRITICAL)

[PANEL: ux] 7. CODE QUALITY
- Unclear error messages, broken formatting
- Unused imports, dead variables, commented-out code
- Inconsistent naming or patterns
- Note: UX panel caps at HIGH severity (no CRITICAL)

METHODOLOGY — For EACH finding:

A) Think & Verify: Before reporting, attempt to DISPROVE it. Check if the code has guards, exception handlers, upstream validation, or framework guarantees. Only report findings that survive your counter-evidence check.

B) Use 5C format:
- **Condition**: What IS happening (quote the specific code)
- **Criteria**: What SHOULD be happening (cite OWASP/CWE where applicable)
- **Cause**: WHY the gap exists
- **Effect**: What's the IMPACT if exploited/triggered
- **Recommendation**: Exact fix with code suggestion

C) Score using OWASP risk rating:
- Likelihood (0-3): How likely to occur? (0=theoretical, 1=difficult, 2=moderate, 3=trivial/every-invocation)
- Impact (0-3): How bad? (0=negligible, 1=minor, 2=significant/data-loss, 3=catastrophic/RCE)
- Risk Score = Likelihood x Impact (0-9)
- Map: 7-9=CRITICAL, 4-6=HIGH, 2-3=MEDIUM, 0-1=LOW
- Exception: UX panel findings cap at HIGH

D) Assign confidence score (0-100): how certain after counter-evidence check?

FORMAT each finding as:

**[PANEL: xxx] [SEVERITY] (Risk: LxI=Score, Confidence: N%)** file:line
- Condition: ...
- Criteria: ...
- Cause: ...
- Effect: ...
- Recommendation: ...

Step 3: Launch Critic agent (GPTLens pattern)

After Agent 1 returns, launch a 2nd agent using the Agent tool with subagent_type: general-purpose. This agent validates every finding to eliminate false positives.

Agent 2: GPTLens Critic

The prompt must include the full file contents AND the raw findings from Agent 1:

You are a senior code reviewer acting as a Critic. Your job is to VALIDATE or REJECT each finding from the prior reviewer. LLM reviewers produce false positives — your job is to catch them.

Here are the files being reviewed:
[FULL FILE CONTENTS]

Here are the raw findings:
[AGENT_1_FINDINGS]

For EACH finding:
1. Re-read the actual code at the cited file:line
2. Is this a real issue or a hallucinated concern?
3. Does the code already handle this via guards, try/except, upstream validation, or framework guarantees?
4. Is the severity rating appropriate? Re-score using Likelihood x Impact if needed
5. Is the confidence score reasonable?
6. Is this a duplicate of another finding? If so, merge them

Produce a validated findings list. For each finding, assign a verdict:
- **CONFIRMED**: Real issue. Keep it (optionally adjust severity/confidence)
- **DOWNGRADED**: Real but over-scored. Adjust severity downward with explanation
- **REJECTED**: False positive. Explain why with code evidence
- **MERGED**: Duplicate of another finding. Specify which one it merges into

Output the validated list preserving the 5C format and panel tags for all confirmed/downgraded findings.

At the end, report summary stats:
- Total findings in
- Confirmed out
- Rejected (with reasons)
- Downgraded (with new scores)
- Merged (with merge targets)

Step 4: Consolidate findings

After the Critic returns, combine validated findings into a single prioritized report:

  1. Remove rejected findings — drop anything the Critic flagged as false positive
  2. Merge duplicates — combine findings the Critic identified as overlapping
  3. Sort by risk score — highest first, then by confidence
  4. Split into two sections:
    • Actionable Now — CRITICAL and HIGH findings, plus MEDIUM with confidence >80%
    • Deferred — LOW findings, MEDIUM with confidence <80%, and downgraded items

Report header must include:

  • Files audited (count and names)
  • Fagan limit warnings (files >400 LOC)
  • False positive rate (rejected / total raw findings)
  • Validation summary (confirmed / downgraded / rejected / merged)

Present the consolidated report and ask: "Want me to fix the actionable items?"

Step 5: Run tests

After presenting findings, auto-detect and run the project's test suite:

  • If pytest is available (Python project): python -m pytest tests/ -v (activate venv first if present)
  • If package.json exists with test script: npm test
  • If Makefile has test target: make test
  • If Cargo.toml exists: cargo test
  • If no test runner found, note "No test runner detected" in the report

If tests fail, report the failures alongside audit findings but do not block the audit report. Test failures are informational context, not gating criteria for the audit itself.

Step 6: Log audit results

After the audit completes (findings presented, tests run), log the results.

6a: Gather metadata

Run these commands to collect project info:

  • git remote get-url origin → extract repo name (fallback: directory basename)
  • pwd → project_path
  • git branch --show-current → branch
  • git rev-parse --short HEAD → commit_sha

6b: Construct the log entry

Build a JSON object with this schema:

{
  "id": "<ISO-timestamp>",
  "timestamp": "<ISO-8601 UTC>",
  "project": "<repo-name>",
  "project_path": "<absolute-path>",
  "branch": "<current-branch>",
  "commit_sha": "<HEAD-short-SHA>",
  "scope": "<description of what was audited>",
  "files_audited": "<number>",
  "fagan_warnings": "<count of files >400 LOC>",
  "panels": {
    "security":    {"critical": 0, "high": 0, "medium": 0, "low": 0},
    "logic":       {"critical": 0, "high": 0, "medium": 0, "low": 0},
    "ux":          {"high": 0, "medium": 0, "low": 0},
    "scalability": {"critical": 0, "high": 0, "medium": 0, "low": 0}
  },
  "totals": {"critical": 0, "high": 0, "medium": 0, "low": 0, "total": 0},
  "validation": {
    "raw_findings": "<total before critic>",
    "confirmed": "<count>",
    "downgraded": "<count>",
    "rejected": "<count>",
    "merged": "<count>",
    "false_positive_rate": "<rejected / raw_findings as percentage>"
  },
  "disposition": {"actioned": "<count>", "deferred": "<count>"},
  "tests": {"passed": "<count>", "failed": "<count>"},
  "findings": [
    {
      "panel": "security|logic|ux|scalability",
      "severity": "CRITICAL|HIGH|MEDIUM|LOW",
      "risk_score": "<0-9>",
      "confidence": "<0-100>",
      "file": "path/to/file",
      "line": "<line number>",
      "condition": "What IS happening",
      "criteria": "What SHOULD be happening",
      "cause": "WHY the gap exists",
      "effect": "IMPACT if not fixed",
      "recommendation": "Exact fix",
      "critic_verdict": "confirmed|downgraded|merged",
      "status": "actioned|deferred"
    }
  ]
}

6c: Append to audit-log.json

Read ~/.claude/audit-log.json. If it exists, parse the JSON array and append the new entry. If it doesn't exist, create it with [entry]. Write the updated array back.

Important: This file is append-only. Never overwrite or remove existing entries.

6d: Save full paper trail

Create a timestamped directory:

~/.claude/audit-trails/grill/<YYYY-MM-DD>_<HH-MM-SS>_<project>/
  metadata.json          # The JSON entry from 6b
  agent1_reviewer.md     # Full raw output from the Comprehensive Reviewer
  agent2_critic.md       # Full raw output from the GPTLens Critic
  consolidated_report.md # The final report as presented to the user
  files_audited.txt      # List of files with their line counts
  diff_applied.patch     # (if fixes were applied) git diff of changes made

Steps:

  1. Create the directory: mkdir -p ~/.claude/audit-trails/grill/<timestamp>_<project>
  2. Write metadata.json — the full JSON log entry
  3. Write each agent's raw output to its .md file
  4. Write the consolidated report to consolidated_report.md
  5. Write the list of audited files with line counts to files_audited.txt
  6. If fixes were applied, capture git diff and save as diff_applied.patch
  7. Commit the new trail to the audit-trails git repo:
    cd ~/.claude/audit-trails && git add grill/<timestamp>_<project>/ && git commit -m "grill: <project> <timestamp>"

Step 7: Regenerate dashboard data

After updating audit-log.json, update the inline data block in the dashboard HTML:

  1. Read the full contents of ~/.claude/audit-log.json
  2. Read ~/.claude/audit-dashboard/index.html
  3. Locate the <script id="audit-data"> tag. If the marker is not found, warn the user ("Dashboard HTML missing <script id=\"audit-data\"> marker — skipping dashboard update") and skip this step. Otherwise, replace everything between the opening tag and the next </script> with:
    <script id="audit-data">
    // AUTO-GENERATED by /grill Step 7 — do not edit manually
    const AUDIT_DATA = <full JSON array from audit-log.json>;
    </script>
  4. Write the updated index.html back
  5. Tell the user: "Dashboard updated. Open ~/.claude/audit-dashboard/index.html in your browser (Code Review tab)."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.