LLM Artifacts Review Detect common artifacts left behind by LLM coding agents: over-abstraction, dead code, DRY violations in tests, verbose comments, and defensive overkill. Hard gates (sequence) Advance only when each pass condition is objectively true (prevents “review complete” without artifacts): | Gate | Pass condition | |------|----------------| | G1 — Scope | File list is non-empty or you exit with exactly the Step 1 message; is set to or . | | G2 — Four categories | Tests, dead code, abstraction, and style are each reviewed (four runs when Step 3 applies, or four sequential passes co…

|| true\n```\n\n(The trailing `|| true` on the `grep` is intentional — zero source-file matches is a legitimate empty-scope result, distinct from a failed base-ref resolution.)\n\n**B. Full project (`--all`):**\n\nFrom `TARGET` (default `.`), list source files and **prune** excluded dependency/build trees so `find` never descends into them. `! -path \"*/foo/*\"` only filters the output; `find` still walks the tree (minutes of wasted I/O on large `node_modules`, `target`, etc.). Use `-prune` instead:\n\n```bash\nfind \"$TARGET\" \\\n \\( -type d \\( \\\n -name node_modules -o -name .git -o -name vendor -o -name __pycache__ \\\n -o -name .venv -o -name venv -o -name dist -o -name build \\\n -o -name target -o -name .next -o -name coverage -o -name .turbo \\\n \\) -prune \\) -o \\\n \\( -type f \\( \\\n -name \"*.py\" -o -name \"*.ts\" -o -name \"*.tsx\" -o -name \"*.js\" -o -name \"*.jsx\" \\\n -o -name \"*.go\" -o -name \"*.rs\" -o -name \"*.java\" -o -name \"*.rb\" \\\n -o -name \"*.swift\" -o -name \"*.kt\" \\\n \\) -print \\)\n```\n\n**Large repos:** The `--all` path can produce huge file lists. If file count exceeds **400**, warn and suggest narrowing: pass a subdirectory as `TARGET`, or drop `--all` to fall back to the default changed-files scope. Still proceed unless the user explicitly cancels. (This warning does **not** fire on the default changed-files scope, which is already bounded by the PR diff.)\n\nIf no files are found, exit with:\n\n`No files to scan. Check the path, branch, or pass --all for a full-project scan.`\n\nSet `scope` in the report: `\"all\"` for `--all`, `\"changed\"` for the default changed-files scope.\n\n## Step 2: Detect Languages\n\nExtract unique file extensions from the file list:\n\n```bash\necho \"$FILES\" | sed 's/.*\\.//' | sort -u\n```\n\nMap extensions to language names for the report:\n- `.py` -> Python\n- `.ts`, `.tsx` -> TypeScript\n- `.js`, `.jsx` -> JavaScript\n- `.go` -> Go\n- `.rs` -> Rust\n- `.java` -> Java\n- `.rb` -> Ruby\n- `.swift` -> Swift\n- `.kt` -> Kotlin\n\n## Step 3: Spawn Parallel Subagents\n\nIf file count >= 4 OR `--parallel` flag is set, spawn 4 subagents via `Task` tool.\n\nEach subagent MUST:\n1. Load the skill: `Skill(skill: \"beagle-core:llm-artifacts-detection\")`\n2. Review only its assigned category\n3. Return findings in the structured format below\n\n### Subagent 1: Tests Agent\n\n**Focus:** Testing anti-patterns from LLM generation\n\n- DRY violations (repeated setup code, duplicate assertions)\n- Testing library/framework code instead of application logic\n- Wrong mock boundaries (mocking too much or too little)\n- Overly verbose test names that describe implementation\n- Tests that just mirror the implementation\n\n### Subagent 2: Dead Code Agent\n\n**Focus:** Unused or obsolete code\n\n- Unused imports, variables, functions, classes\n- TODO/FIXME comments that should have been resolved\n- Backwards compatibility code for removed features\n- Orphaned test files for deleted code\n- Commented-out code blocks\n- Feature flags that are always on/off\n\n### Subagent 3: Abstraction Agent\n\n**Focus:** Over-engineering patterns\n\n- Unnecessary abstraction layers (interfaces for single implementations)\n- Copy-paste drift (similar code that diverged slightly)\n- Over-configuration (configurable things that never change)\n- Premature generalization\n- Factory/Builder patterns for simple object creation\n- Deep inheritance hierarchies\n\n### Subagent 4: Style Agent\n\n**Focus:** Verbose or defensive patterns\n\n- Verbose comments explaining obvious code\n- Defensive overkill (null checks on non-nullable values)\n- Unnecessary type hints (dynamic languages with obvious types)\n- Overly explicit error messages\n- Redundant logging\n- Self-documenting code with documentation\n\n## Step 4: Consolidate Findings\n\n**Prerequisite:** **G2** satisfied (all four category reviews finished successfully).\n\nWait for all subagents to complete, then:\n\n1. Merge all findings into a single list\n2. Assign unique IDs (1, 2, 3...)\n3. Group by category for display\n\n## Step 5: Write JSON Report\n\nCreate `.beagle` directory if it doesn't exist:\n\n```bash\nmkdir -p .beagle\n```\n\nWrite findings to `.beagle/llm-artifacts-review.json`:\n\n```json\n{\n \"version\": \"1.0.0\",\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"git_head\": \"abc1234\",\n \"scope\": \"all\" | \"changed\",\n \"target\": \".\",\n \"files_scanned\": 42,\n \"languages\": [\"Python\", \"TypeScript\", \"Go\"],\n \"findings\": [\n {\n \"id\": 1,\n \"category\": \"tests\" | \"dead_code\" | \"abstraction\" | \"style\",\n \"type\": \"dry_violation\" | \"unused_import\" | \"over_abstraction\" | \"verbose_comment\" | \"...\",\n \"file\": \"src/utils/helper.py\",\n \"line\": 42,\n \"description\": \"Repeated setup code in 5 test functions\",\n \"suggestion\": \"Extract to a pytest fixture\",\n \"risk\": \"Low\" | \"Medium\" | \"High\",\n \"fix_safety\": \"Safe\" | \"Needs review\",\n \"fix_action\": \"refactor\" | \"delete\" | \"simplify\" | \"extract\"\n }\n ],\n \"summary\": {\n \"total\": 15,\n \"by_category\": {\n \"tests\": 4,\n \"dead_code\": 5,\n \"abstraction\": 3,\n \"style\": 3\n },\n \"by_risk\": {\n \"High\": 2,\n \"Medium\": 8,\n \"Low\": 5\n },\n \"by_fix_safety\": {\n \"Safe\": 10,\n \"Needs review\": 5\n }\n }\n}\n```\n\n## Step 6: Display Summary\n\n**Prerequisite:** **G3** satisfied (JSON on disk and parseable).\n\n```markdown\n## LLM Artifacts Review\n\n**Scope:** Changed files since merge-base with main | Entire project under `\u003cpath>` (when `--all`)\n**Files scanned:** 42\n**Languages:** Python, TypeScript, Go\n\n### Findings by Category\n...\n### Summary Table\n...\n### Next Steps\n\n- Run `/beagle-core:verify-llm-artifacts` to confirm findings and drop false positives before fixing.\n- Run `/beagle-core:fix-llm-artifacts` after verification (or to preview safe-only fixes).\n- Review the JSON report at `.beagle/llm-artifacts-review.json`\n```\n\n## Step 7: Verification (report integrity)\n\nBefore completing, verify the review executed correctly:\n\n1. **JSON validity:** Confirm `.beagle/llm-artifacts-review.json` exists and is parseable\n2. **Subagent success:** All 4 subagents completed without errors\n3. **Git HEAD captured:** The `git_head` field is non-empty in the report\n4. **Staleness check:** If a previous report exists, compare stored `git_head` to current HEAD and warn if different\n\n```bash\npython3 -c \"import json; json.load(open('.beagle/llm-artifacts-review.json'))\" 2>/dev/null && echo \"✓ Valid JSON\" || echo \"✗ Invalid JSON\"\n\nSTORED_HEAD=$(jq -r '.git_head' .beagle/llm-artifacts-review.json 2>/dev/null)\nCURRENT_HEAD=$(git rev-parse --short HEAD)\nif [ \"$STORED_HEAD\" != \"$CURRENT_HEAD\" ]; then\n echo \"⚠️ Report was generated on $STORED_HEAD, current HEAD is $CURRENT_HEAD\"\nfi\n```\n\nIf any verification fails, report the error and do not proceed.\n\n**Finding-level verification** (precision, not JSON syntax) is a **separate** skill: `/beagle-core:verify-llm-artifacts` — run it before mass deletes or `--fix` on risky items.\n\n## Output Format for Each Finding\n\n```text\n[FILE:LINE] **ISSUE_TYPE** (Risk, Fix Safety)\n- Description\n- Suggestion: Specific fix recommendation\n```\n\n## Rules\n\n- Follow **Hard gates** order; do not skip **G3** (JSON before Step 6).\n- Always load the `beagle-core:llm-artifacts-detection` skill first\n- Use `Task` tool for parallel subagents when >= 4 files\n- Every finding MUST have file:line reference\n- Categorize risk honestly (don't inflate or deflate)\n- Mark fix safety as \"Safe\" only if change is mechanical and reversible\n- Create `.beagle` directory if needed\n- Write JSON report before displaying summary\n- Default scope is **changed files since merge-base with main**; pass `--all` for a full-project scan\n---","attachment_filenames":[],"attachments":[],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"LLM Artifacts Review","type":"text"}]},{"type":"paragraph","content":[{"text":"Detect common artifacts left behind by LLM coding agents: over-abstraction, dead code, DRY violations in tests, verbose comments, and defensive overkill.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Hard gates (sequence)","type":"text"}]},{"type":"paragraph","content":[{"text":"Advance only when each ","type":"text"},{"text":"pass condition","type":"text","marks":[{"type":"strong"}]},{"text":" is objectively true (prevents “review complete” without artifacts):","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Gate","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Pass condition","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"G1 — Scope","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"File list is non-empty ","type":"text"},{"text":"or","type":"text","marks":[{"type":"em"}]},{"text":" you exit with exactly the Step 1 message; ","type":"text"},{"text":"scope","type":"text","marks":[{"type":"code_inline"}]},{"text":" is set to ","type":"text"},{"text":"all","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"changed","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"G2 — Four categories","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Tests, dead code, abstraction, and style are each reviewed (four ","type":"text"},{"text":"Task","type":"text","marks":[{"type":"code_inline"}]},{"text":" runs when Step 3 applies, or four sequential passes covering the same categories). ","type":"text"},{"text":"Stop","type":"text","marks":[{"type":"strong"}]},{"text":" if any category did not complete; do not write JSON or a summary that implies a full pass.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"G3 — JSON before summary","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".beagle/llm-artifacts-review.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" exists and is valid JSON ","type":"text"},{"text":"before","type":"text","marks":[{"type":"strong"}]},{"text":" Step 6 markdown.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"G4 — Integrity","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Step 7 checks pass before treating the run as complete.","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Arguments","type":"text"}]},{"type":"paragraph","content":[{"text":"Parse ","type":"text"},{"text":"$ARGUMENTS","type":"text","marks":[{"type":"code_inline"}]},{"text":" for flags and optional path:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Flag","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Effect","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"(default)","type":"text","marks":[{"type":"em"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Changed-files scope","type":"text","marks":[{"type":"strong"}]},{"text":" — only files changed since ","type":"text"},{"text":"git merge-base HEAD main","type":"text","marks":[{"type":"code_inline"}]},{"text":" (PR-style scope)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--all","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Full project scan — all matching source files under the target path","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--parallel","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Force parallel execution (default when 4+ files in scope)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Path","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Root directory to scan (default: current working directory)","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 1: Determine Scope","type":"text"}]},{"type":"paragraph","content":[{"text":"A. Changed files only (default):","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Resolve the base ref explicitly and fail loudly if none exists — ","type":"text"},{"text":"do not","type":"text","marks":[{"type":"strong"}]},{"text":" wrap the ","type":"text"},{"text":"git merge-base","type":"text","marks":[{"type":"code_inline"}]},{"text":" call in ","type":"text"},{"text":"|| true","type":"text","marks":[{"type":"code_inline"}]},{"text":", which would silently swallow a missing ","type":"text"},{"text":"main","type":"text","marks":[{"type":"code_inline"}]},{"text":"/","type":"text"},{"text":"master","type":"text","marks":[{"type":"code_inline"}]},{"text":" ref and report \"no files to scan\" on repos that only have ","type":"text"},{"text":"origin/main","type":"text","marks":[{"type":"code_inline"}]},{"text":" or use ","type":"text"},{"text":"master","type":"text","marks":[{"type":"code_inline"}]},{"text":". If no base ref is found, suggest the user pass ","type":"text"},{"text":"--all","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead of silently falling back.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"BASE=$(for ref in main origin/main master origin/master; do\n git rev-parse --verify \"$ref\" >/dev/null 2>&1 && { echo \"$ref\"; break; }\n done)\nif [ -z \"$BASE\" ]; then\n echo \"error: no main/master ref found (checked main, origin/main, master, origin/master). Pass --all for a full-project scan.\" >&2\n exit 1\nfi\nMERGE_BASE=$(git merge-base HEAD \"$BASE\") || {\n echo \"error: git merge-base HEAD $BASE failed.\" >&2\n exit 1\n}\ngit diff --name-only \"$MERGE_BASE..HEAD\" | grep -E '\\.(py|ts|tsx|js|jsx|go|rs|java|rb|swift|kt)

LLM Artifacts Review Detect common artifacts left behind by LLM coding agents: over-abstraction, dead code, DRY violations in tests, verbose comments, and defensive overkill. Hard gates (sequence) Advance only when each pass condition is objectively true (prevents “review complete” without artifacts): | Gate | Pass condition | |------|----------------| | G1 — Scope | File list is non-empty or you exit with exactly the Step 1 message; is set to or . | | G2 — Four categories | Tests, dead code, abstraction, and style are each reviewed (four runs when Step 3 applies, or four sequential passes co…

|| true","type":"text"}]},{"type":"paragraph","content":[{"text":"(The trailing ","type":"text"},{"text":"|| true","type":"text","marks":[{"type":"code_inline"}]},{"text":" on the ","type":"text"},{"text":"grep","type":"text","marks":[{"type":"code_inline"}]},{"text":" is intentional — zero source-file matches is a legitimate empty-scope result, distinct from a failed base-ref resolution.)","type":"text"}]},{"type":"paragraph","content":[{"text":"B. Full project (","type":"text","marks":[{"type":"strong"}]},{"text":"--all","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"):","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"From ","type":"text"},{"text":"TARGET","type":"text","marks":[{"type":"code_inline"}]},{"text":" (default ","type":"text"},{"text":".","type":"text","marks":[{"type":"code_inline"}]},{"text":"), list source files and ","type":"text"},{"text":"prune","type":"text","marks":[{"type":"strong"}]},{"text":" excluded dependency/build trees so ","type":"text"},{"text":"find","type":"text","marks":[{"type":"code_inline"}]},{"text":" never descends into them. ","type":"text"},{"text":"! -path \"*/foo/*\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" only filters the output; ","type":"text"},{"text":"find","type":"text","marks":[{"type":"code_inline"}]},{"text":" still walks the tree (minutes of wasted I/O on large ","type":"text"},{"text":"node_modules","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"target","type":"text","marks":[{"type":"code_inline"}]},{"text":", etc.). Use ","type":"text"},{"text":"-prune","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"find \"$TARGET\" \\\n \\( -type d \\( \\\n -name node_modules -o -name .git -o -name vendor -o -name __pycache__ \\\n -o -name .venv -o -name venv -o -name dist -o -name build \\\n -o -name target -o -name .next -o -name coverage -o -name .turbo \\\n \\) -prune \\) -o \\\n \\( -type f \\( \\\n -name \"*.py\" -o -name \"*.ts\" -o -name \"*.tsx\" -o -name \"*.js\" -o -name \"*.jsx\" \\\n -o -name \"*.go\" -o -name \"*.rs\" -o -name \"*.java\" -o -name \"*.rb\" \\\n -o -name \"*.swift\" -o -name \"*.kt\" \\\n \\) -print \\)","type":"text"}]},{"type":"paragraph","content":[{"text":"Large repos:","type":"text","marks":[{"type":"strong"}]},{"text":" The ","type":"text"},{"text":"--all","type":"text","marks":[{"type":"code_inline"}]},{"text":" path can produce huge file lists. If file count exceeds ","type":"text"},{"text":"400","type":"text","marks":[{"type":"strong"}]},{"text":", warn and suggest narrowing: pass a subdirectory as ","type":"text"},{"text":"TARGET","type":"text","marks":[{"type":"code_inline"}]},{"text":", or drop ","type":"text"},{"text":"--all","type":"text","marks":[{"type":"code_inline"}]},{"text":" to fall back to the default changed-files scope. Still proceed unless the user explicitly cancels. (This warning does ","type":"text"},{"text":"not","type":"text","marks":[{"type":"strong"}]},{"text":" fire on the default changed-files scope, which is already bounded by the PR diff.)","type":"text"}]},{"type":"paragraph","content":[{"text":"If no files are found, exit with:","type":"text"}]},{"type":"paragraph","content":[{"text":"No files to scan. Check the path, branch, or pass --all for a full-project scan.","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Set ","type":"text"},{"text":"scope","type":"text","marks":[{"type":"code_inline"}]},{"text":" in the report: ","type":"text"},{"text":"\"all\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" for ","type":"text"},{"text":"--all","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"\"changed\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" for the default changed-files scope.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 2: Detect Languages","type":"text"}]},{"type":"paragraph","content":[{"text":"Extract unique file extensions from the file list:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"echo \"$FILES\" | sed 's/.*\\.//' | sort -u","type":"text"}]},{"type":"paragraph","content":[{"text":"Map extensions to language names for the report:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".py","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> Python","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".ts","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tsx","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> TypeScript","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".js","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".jsx","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> JavaScript","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".go","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> Go","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".rs","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> Rust","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".java","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> Java","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".rb","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> Ruby","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".swift","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> Swift","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":".kt","type":"text","marks":[{"type":"code_inline"}]},{"text":" -> Kotlin","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 3: Spawn Parallel Subagents","type":"text"}]},{"type":"paragraph","content":[{"text":"If file count >= 4 OR ","type":"text"},{"text":"--parallel","type":"text","marks":[{"type":"code_inline"}]},{"text":" flag is set, spawn 4 subagents via ","type":"text"},{"text":"Task","type":"text","marks":[{"type":"code_inline"}]},{"text":" tool.","type":"text"}]},{"type":"paragraph","content":[{"text":"Each subagent MUST:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load the skill: ","type":"text"},{"text":"Skill(skill: \"beagle-core:llm-artifacts-detection\")","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Review only its assigned category","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Return findings in the structured format below","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Subagent 1: Tests Agent","type":"text"}]},{"type":"paragraph","content":[{"text":"Focus:","type":"text","marks":[{"type":"strong"}]},{"text":" Testing anti-patterns from LLM generation","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"DRY violations (repeated setup code, duplicate assertions)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Testing library/framework code instead of application logic","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Wrong mock boundaries (mocking too much or too little)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Overly verbose test names that describe implementation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Tests that just mirror the implementation","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Subagent 2: Dead Code Agent","type":"text"}]},{"type":"paragraph","content":[{"text":"Focus:","type":"text","marks":[{"type":"strong"}]},{"text":" Unused or obsolete code","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Unused imports, variables, functions, classes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"TODO/FIXME comments that should have been resolved","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Backwards compatibility code for removed features","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Orphaned test files for deleted code","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Commented-out code blocks","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Feature flags that are always on/off","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Subagent 3: Abstraction Agent","type":"text"}]},{"type":"paragraph","content":[{"text":"Focus:","type":"text","marks":[{"type":"strong"}]},{"text":" Over-engineering patterns","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Unnecessary abstraction layers (interfaces for single implementations)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Copy-paste drift (similar code that diverged slightly)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Over-configuration (configurable things that never change)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Premature generalization","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Factory/Builder patterns for simple object creation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Deep inheritance hierarchies","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Subagent 4: Style Agent","type":"text"}]},{"type":"paragraph","content":[{"text":"Focus:","type":"text","marks":[{"type":"strong"}]},{"text":" Verbose or defensive patterns","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verbose comments explaining obvious code","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Defensive overkill (null checks on non-nullable values)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Unnecessary type hints (dynamic languages with obvious types)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Overly explicit error messages","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Redundant logging","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Self-documenting code with documentation","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 4: Consolidate Findings","type":"text"}]},{"type":"paragraph","content":[{"text":"Prerequisite:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"G2","type":"text","marks":[{"type":"strong"}]},{"text":" satisfied (all four category reviews finished successfully).","type":"text"}]},{"type":"paragraph","content":[{"text":"Wait for all subagents to complete, then:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Merge all findings into a single list","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Assign unique IDs (1, 2, 3...)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Group by category for display","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 5: Write JSON Report","type":"text"}]},{"type":"paragraph","content":[{"text":"Create ","type":"text"},{"text":".beagle","type":"text","marks":[{"type":"code_inline"}]},{"text":" directory if it doesn't exist:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"mkdir -p .beagle","type":"text"}]},{"type":"paragraph","content":[{"text":"Write findings to ","type":"text"},{"text":".beagle/llm-artifacts-review.json","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"version\": \"1.0.0\",\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"git_head\": \"abc1234\",\n \"scope\": \"all\" | \"changed\",\n \"target\": \".\",\n \"files_scanned\": 42,\n \"languages\": [\"Python\", \"TypeScript\", \"Go\"],\n \"findings\": [\n {\n \"id\": 1,\n \"category\": \"tests\" | \"dead_code\" | \"abstraction\" | \"style\",\n \"type\": \"dry_violation\" | \"unused_import\" | \"over_abstraction\" | \"verbose_comment\" | \"...\",\n \"file\": \"src/utils/helper.py\",\n \"line\": 42,\n \"description\": \"Repeated setup code in 5 test functions\",\n \"suggestion\": \"Extract to a pytest fixture\",\n \"risk\": \"Low\" | \"Medium\" | \"High\",\n \"fix_safety\": \"Safe\" | \"Needs review\",\n \"fix_action\": \"refactor\" | \"delete\" | \"simplify\" | \"extract\"\n }\n ],\n \"summary\": {\n \"total\": 15,\n \"by_category\": {\n \"tests\": 4,\n \"dead_code\": 5,\n \"abstraction\": 3,\n \"style\": 3\n },\n \"by_risk\": {\n \"High\": 2,\n \"Medium\": 8,\n \"Low\": 5\n },\n \"by_fix_safety\": {\n \"Safe\": 10,\n \"Needs review\": 5\n }\n }\n}","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 6: Display Summary","type":"text"}]},{"type":"paragraph","content":[{"text":"Prerequisite:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"G3","type":"text","marks":[{"type":"strong"}]},{"text":" satisfied (JSON on disk and parseable).","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"## LLM Artifacts Review\n\n**Scope:** Changed files since merge-base with main | Entire project under `\u003cpath>` (when `--all`)\n**Files scanned:** 42\n**Languages:** Python, TypeScript, Go\n\n### Findings by Category\n...\n### Summary Table\n...\n### Next Steps\n\n- Run `/beagle-core:verify-llm-artifacts` to confirm findings and drop false positives before fixing.\n- Run `/beagle-core:fix-llm-artifacts` after verification (or to preview safe-only fixes).\n- Review the JSON report at `.beagle/llm-artifacts-review.json`","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 7: Verification (report integrity)","type":"text"}]},{"type":"paragraph","content":[{"text":"Before completing, verify the review executed correctly:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"JSON validity:","type":"text","marks":[{"type":"strong"}]},{"text":" Confirm ","type":"text"},{"text":".beagle/llm-artifacts-review.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" exists and is parseable","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Subagent success:","type":"text","marks":[{"type":"strong"}]},{"text":" All 4 subagents completed without errors","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Git HEAD captured:","type":"text","marks":[{"type":"strong"}]},{"text":" The ","type":"text"},{"text":"git_head","type":"text","marks":[{"type":"code_inline"}]},{"text":" field is non-empty in the report","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Staleness check:","type":"text","marks":[{"type":"strong"}]},{"text":" If a previous report exists, compare stored ","type":"text"},{"text":"git_head","type":"text","marks":[{"type":"code_inline"}]},{"text":" to current HEAD and warn if different","type":"text"}]}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python3 -c \"import json; json.load(open('.beagle/llm-artifacts-review.json'))\" 2>/dev/null && echo \"✓ Valid JSON\" || echo \"✗ Invalid JSON\"\n\nSTORED_HEAD=$(jq -r '.git_head' .beagle/llm-artifacts-review.json 2>/dev/null)\nCURRENT_HEAD=$(git rev-parse --short HEAD)\nif [ \"$STORED_HEAD\" != \"$CURRENT_HEAD\" ]; then\n echo \"⚠️ Report was generated on $STORED_HEAD, current HEAD is $CURRENT_HEAD\"\nfi","type":"text"}]},{"type":"paragraph","content":[{"text":"If any verification fails, report the error and do not proceed.","type":"text"}]},{"type":"paragraph","content":[{"text":"Finding-level verification","type":"text","marks":[{"type":"strong"}]},{"text":" (precision, not JSON syntax) is a ","type":"text"},{"text":"separate","type":"text","marks":[{"type":"strong"}]},{"text":" skill: ","type":"text"},{"text":"/beagle-core:verify-llm-artifacts","type":"text","marks":[{"type":"code_inline"}]},{"text":" — run it before mass deletes or ","type":"text"},{"text":"--fix","type":"text","marks":[{"type":"code_inline"}]},{"text":" on risky items.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Output Format for Each Finding","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"text"},"content":[{"text":"[FILE:LINE] **ISSUE_TYPE** (Risk, Fix Safety)\n- Description\n- Suggestion: Specific fix recommendation","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Follow ","type":"text"},{"text":"Hard gates","type":"text","marks":[{"type":"strong"}]},{"text":" order; do not skip ","type":"text"},{"text":"G3","type":"text","marks":[{"type":"strong"}]},{"text":" (JSON before Step 6).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Always load the ","type":"text"},{"text":"beagle-core:llm-artifacts-detection","type":"text","marks":[{"type":"code_inline"}]},{"text":" skill first","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"Task","type":"text","marks":[{"type":"code_inline"}]},{"text":" tool for parallel subagents when >= 4 files","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every finding MUST have file:line reference","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Categorize risk honestly (don't inflate or deflate)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Mark fix safety as \"Safe\" only if change is mechanical and reversible","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Create ","type":"text"},{"text":".beagle","type":"text","marks":[{"type":"code_inline"}]},{"text":" directory if needed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Write JSON report before displaying summary","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Default scope is ","type":"text"},{"text":"changed files since merge-base with main","type":"text","marks":[{"type":"strong"}]},{"text":"; pass ","type":"text"},{"text":"--all","type":"text","marks":[{"type":"code_inline"}]},{"text":" for a full-project scan","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"review-llm-artifacts","author":"@skillopedia","source":{"stars":61,"repo_name":"beagle","origin_url":"https://github.com/existential-birds/beagle/blob/HEAD/plugins/beagle-core/skills/review-llm-artifacts/SKILL.md","repo_owner":"existential-birds","body_sha256":"c70e87d30f58d1524943e9e11fb61d0e12931f6af00aa2f3e45841eda90c4475","cluster_key":"451592ff63f1b353ad7bef71297a7973ad1ec2191c7f27ef880e3cbaefcfcde4","clean_bundle":{"format":"clean-skill-bundle-v1","source":"existential-birds/beagle/plugins/beagle-core/skills/review-llm-artifacts/SKILL.md","bundle_sha256":"eb6f71a31b1be8ed6465d0aa038ae5e439c70aba4f147f99e5074d918148f862","attachment_count":0,"text_attachments":0,"binary_attachments":0},"cluster_size":1,"skill_md_path":"plugins/beagle-core/skills/review-llm-artifacts/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"testing-qa","category_label":"Testing"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"testing-qa","import_tag":"clean-skills-v1","description":"Detects common LLM coding agent artifacts by spawning four parallel subagents over the project or changed files. Scans files changed since main by default; use --all for full-project scan. Triggers on LLM cruft cleanup, agent-generated code review, dead code sweeps, test-quality passes, or when the user asks to scan the whole repo.","disable-model-invocation":true}},"renderedAt":1782981312112}

LLM Artifacts Review Detect common artifacts left behind by LLM coding agents: over-abstraction, dead code, DRY violations in tests, verbose comments, and defensive overkill. Hard gates (sequence) Advance only when each pass condition is objectively true (prevents “review complete” without artifacts): | Gate | Pass condition | |------|----------------| | G1 — Scope | File list is non-empty or you exit with exactly the Step 1 message; is set to or . | | G2 — Four categories | Tests, dead code, abstraction, and style are each reviewed (four runs when Step 3 applies, or four sequential passes co…