/subagent-system:completion-checkerfrom subagent-system
Verifies subagent task completion by parsing COMPLETION_CHECKLIST blocks with deterministic grep counts instead of LLM estimation. Detects premature termination and escalates when checklists are missing or incomplete.
Ships in subagent-system. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Input: Original task list assigned to the subagent + the subagent's full output.
Step 1 — Save output to a temp file for deterministic counting.
If PROJECT_ROOT was injected in the input, use it as an absolute base path. Otherwise fall back to the relative path (works only when session cwd = project root — warn if uncertain):
Bash("mkdir -p [PROJECT_ROOT_OR_DOT]/.claude/tmp")
Write("[PROJECT_ROOT_OR_DOT]/.claude/tmp/cc_input.txt", [subagent output])
Warning: If the Claude session was started from a directory other than the project root, .claude/tmp/ resolves to the wrong location and grep counts will be 0. Always inject PROJECT_ROOT from PIPELINE_CONFIG.md when calling this skill in a multi-project setup.
Step 2 — Count deterministically with grep.
First, extract only the COMPLETION_CHECKLIST section to avoid counting [x] in code snippets or findings text:
Bash("grep -Ec 'COMPLETION[_ ]?CHECKLIST' [PROJECT_ROOT_OR_DOT]/.claude/tmp/cc_input.txt") # block exists (-E optional separator: matches COMPLETION_CHECKLIST, COMPLETION CHECKLIST, COMPLETIONCHECKLIST; case-sensitive to stay in sync with the sed below)
Bash("sed -nE '/COMPLETION[_ ]?CHECKLIST/,/^STATUS:/p' [PROJECT_ROOT_OR_DOT]/.claude/tmp/cc_input.txt > [PROJECT_ROOT_OR_DOT]/.claude/tmp/cc_checklist.txt") # sed regex MUST match the grep above (same optional separator) — else block is "found" but extracts nothing
Bash("[ -s [PROJECT_ROOT_OR_DOT]/.claude/tmp/cc_checklist.txt ] && echo CHECKLIST_FOUND || echo CHECKLIST_EMPTY") # guard: sed -n exits 0 even on no match → rely on this non-empty test, NOT the exit code
Bash("grep -Fc '[x]' [PROJECT_ROOT_OR_DOT]/.claude/tmp/cc_checklist.txt") # done count (checklist only)
Bash("grep -Fc '[o]' [PROJECT_ROOT_OR_DOT]/.claude/tmp/cc_checklist.txt") # skipped count (checklist only)
If the guard prints CHECKLIST_EMPTY (no COMPLETION_CHECKLIST extracted — note sed -n exits 0 even when nothing matches, so trust the [ -s ] non-empty test, NOT the exit code): do NOT count from the full file — set STATUS=SUSPICIOUS and ACTION=ESCALATE immediately, with reason "CHECKLIST_NOT_FOUND — subagent did not produce a completion checklist." Skip Steps 3-4.
Both the grep and the sed use the same [_ ]? optional separator (extended regex, case-sensitive — neither uses -i/I, so they agree on case) to match COMPLETION_CHECKLIST, COMPLETION CHECKLIST, and COMPLETIONCHECKLIST — agents sometimes use a space or no separator instead of an underscore. The exact uppercase header is mandated below, so case-sensitivity is intentional. Keep the two regexes in sync.
Use -Fc for [x]/[o] counts (fixed-string, no escaping issues). Use these counts as ground truth. Do NOT rely on LLM estimation.
Format enforcement note: Sub-agents MUST write their checklist header as exactly COMPLETION_CHECKLIST: (underscore, colon). If the detected block uses a different format, note it in the report as a FORMAT_WARNING alongside the counts.
Step 3 — Identify missing tasks.
Compare task names in the original task list against lines found in the COMPLETION_CHECKLIST block. A task is MISSING if its name or identifier does not appear in any [x] or [o] line. This step uses LLM matching — flag any uncertain matches explicitly.
Uncertain match threshold: if more than 30% of matches are flagged uncertain, set STATUS to SUSPICIOUS regardless of grep counts. Uncertain matches that include critical-path tasks (implementation, security, database) → set ACTION to ESCALATE.
Step 4 — Compare totals. Compare grep-counted items (Step 2) against the number of tasks in the original task list. If checklist item count < assigned task count, flag SUSPICIOUS.
Step 5 — Determine action.
COMPLETED — all tasks accounted for in the checklist AND skipped count [o] = 0PARTIAL — some tasks missing, or any task skipped ([o] count > 0); list them in REMAINING_TASKS. A checklist where every task is present but ≥1 is [o] is PARTIAL, never COMPLETED (matches completion-protocol.md)SUSPICIOUS — checklist has fewer items than tasks assigned (possible truncation or skipping)Note: FAILED (agent crash/error) is intentionally absent from this skill's output. Agent execution failures are detected upstream by structured-output.md parsing — a missing or invalid STATUS block in the subagent's raw output causes the main agent to retry in foreground mode before invoking completion-checker. By the time completion-checker is invoked, the input is always a valid output; hence only COMPLETED, PARTIAL, and SUSPICIOUS are valid completion states.
Note: Invoke this skill once per subagent output, not once for a merged multi-agent batch. If checking multiple agents in a batch, invoke sequentially with each agent's individual output. Merging outputs before invoking produces incorrect grep counts.
Output format:
COMPLETION_CHECK:
Tasks assigned: N
Tasks in checklist: M
Tasks completed [x]: P
Tasks skipped [o]: Q
Tasks MISSING from checklist: [list or NONE]
STATUS: COMPLETED | PARTIAL | SUSPICIOUS
REMAINING_TASKS: [list if PARTIAL or SUSPICIOUS]
ACTION: PROCEED | RE_DISPATCH [list of missing tasks] | ESCALATE
Set ACTION: ESCALATE when STATUS is SUSPICIOUS and missing tasks are critical-path items.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
21 skills in this plugin
/apply-improvementsThis skill should be used when the user asks to apply improvement proposals ('apply improvements', 'ap dung improvement proposals') from .claude/improvement-proposals.md (written by pipeline-retrospective) to the plugin files./audit-outputThis skill should be used after a pipeline run completes, when the user asks to audit the pipeline output ('audit output', 'audit the run', '4-level audit'). Requires the project's test command as argument - without it Level 4 regression tests are skipped and the report is marked incomplete./chain-verifierThis skill should be used at the final step of any multi-phase pipeline to verify the complete working-tree state satisfies the original requirements. Trigger after all fix agents and pipeline-reviewer have completed. Also invoke when user asks to "run chain-verifier", "verify the pipeline output", or "confirm requirements are met"./checkpoint-writerThis skill should be used when saving current pipeline phase state to disk and creating a recovery commit. Trigger at the end of every implementation phase, when the user asks to "save a checkpoint", "commit this phase", or before any /compact or session end. Enables resume-from-checkpoint to reconstruct pipeline state after interruption./consolidate-findingsThis skill should be used when the user asks to "merge findings", "consolidate audit results", "combine security findings", or after all parallel audit agents complete and before running finding-validator or severity-gate. Produces FINDINGS_REPORT.md sorted CRITICAL→HIGH→MEDIUM→LOW with duplicates removed./context-packagerThis skill should be used before spawning a dependent agent when the previous phase produced interface changes, breaking changes, new constraints, or key file modifications the next agent must not violate. Extracts only the minimum necessary context — not the full prior output. Uses character count to decide INJECT (≤4,000 chars) vs USE_FORK (>4,000 chars). Also trigger when user asks to "package context for next phase", "prepare agent handoff", or "extract phase context".npx claudepluginhub minhthang1009/dotclaude --plugin subagent-systemOther plugins' skills for the same job