/closedloop-core:decision-tablefrom closedloop-core
Generates code-grounded decision tables for control-flow, stateful edge cases, retry/recovery, validation, and review-heavy behavior. Reads actual code paths and guardrails to produce reviewable artifacts.
Ships in closedloop-core. 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.
Read when SKILL.md points to them.
Generate a repo-local decision-table artifact that makes control-flow and stateful edge cases reviewable. The decision table is the source of truth; a Mermaid diagram is optional and secondary.
Write artifacts under <repo-root>/.closedloop-ai/decision-tables/. Create the directory if missing.
Default to one artifact per work item:
<plan-id>.md<short-work-name>.md (lowercase kebab-case)Keep multiple behavior areas as sections inside the same artifact. Only split into multiple files when one artifact would be too large to review quickly or when the work clearly spans separate repos/systems.
AGENTS.md, CLAUDE.md), compatibility rules, contributor docs, API contracts. If the plan and guardrails conflict, record the tension in the artifact, add a Plan Clarifications note when appropriate, and surface the conflict to the user if it affects implementation or review.references/edge-cases.md. Each must be represented by rows or an explicit non-applicability note with source-backed evidence. When multiple evidence, authority, history, or fallback sources can coexist, add a bounded interaction pass: cover pairwise and high-risk intersections instead of an unbounded Cartesian product, including legacy/absent plus fresh valid, corrupt/undated plus fresh valid, irrelevant historical plus current authoritative, tied/conflicting current records, and source/state precedence. For distributed command, signing, key, capability, or cross-process state work, treat client app, server, desktop or native runtime, local store, notification layer, cache, and remote peer behavior as separate surfaces unless code proves they are the same surface.Current Code and Intended Change.references/artifact-format.md.Current Code, Intended Change, Delta Checklist, and Required Tests. When no plan is in scope, omit Intended Change and focus on the current-state table plus gaps or suspicious branches.Required Tests, map each test to one or more row IDs and name the invariant being proved, the positive path, and the wrong-input, mixed-state, failure, or compatibility mutation. A test must prove the specific binding/fallback/diagnostic the row claims; it cannot just trigger a generic rejection. When a row depends on an exact external contract literal, the test oracle must fail closed for the wrong literal: feature-flag mocks enable only the exact expected key, query/header/event assertions check exact names and values, and cache/storage/command/plugin identifiers are asserted by semantic type rather than broad substring or "any key" matching.Current Code and Intended Change. All later updates are append-only in Verification Findings, Fixes Applied, Final Alignment Status, and optional Plan Clarifications.Final Alignment Status: Not aligned is a terminal stop: do not proceed to PR creation, merge, completion, or any downstream success state while it remains. Fixable repo-local findings remain unresolved work and must be fixed and re-verified; they cannot be normalized into a successful handoff.references/artifact-format.md and capture the actual command or source evidence for changed exports, package subpaths, CLI flags, route/query/header/event/cache/storage/command literals, path or filesystem writes, untrusted input fields, persisted schema fields, replay/idempotency behavior, and test-boundary coverage. Do not accept an assertion such as "no consumers", "not externally visible", or "covered by tests" without the corresponding evidence.Fixes Applied by discovery source when more than one source exists (e.g., Initial verification, Adversarial abuse/filesystem lane, Adversarial compatibility lane, Runtime testing, Review findings, Validation failures, Repo guardrails, Plan clarification, Final hygiene). Do not leave a broad During verification bucket once other sources have produced fixes.Verification Findings as a resolution queue, not a backlog. Every finding must be (a) fixed, (b) marked not applicable with source-backed evidence, or (c) carried into Final Alignment Status: Not aligned with a specific human/external blocker (credentials, deployment access, product decision, unavailable independent adversarial review, etc.). Do not record fixable repo-local work as a permanent gap when the user asked for implementation.references/review-prevention.md. Each item must be fixed, already covered by a named row/test, marked not applicable with source-backed evidence, or carried into Not aligned. Do not mark Aligned while any item is merely assumed covered.Covered or already covered disposition, whether it appears in Verification Findings, in the Behavioral Edge-Case Expansion, in the adversarial lanes, or in the review-prevention pass, must cite a specific test name and the wrong-input or negative case that test fails closed on. Every not applicable disposition must cite source-backed evidence such as grep output, export/package inventory, call-site inventory, schema/query inventory, or code references proving the surface is absent or out of scope. A coverage claim backed only by a happy-path assertion, a pure helper test for an integration boundary, or no evidence is treated as Not aligned, not as covered. This applies to security findings: do not mark a security finding Covered without a named test proving the rejected or blocked case.Intended Change post-implementation if the plan itself was ambiguous or wrong. Record this as Plan Clarifications with reason and source. Never silently rewrite the target.Not aligned, explicitly state that downstream PR/merge/completion is blocked, name every unresolved blocker, and give the exact next action and owner; never phrase it as completion. If the agent cannot complete something autonomously (product decision, credentials, deployment access, independent adversarial review), ask the user directly. If no user action is required, say so. If the user also asked for review, use the artifact as a first-class input rather than recreating the analysis.The decision table author must not be the only adversary when the work is contract-heavy, security-sensitive, filesystem-facing, input-parser-facing, replay/idempotency-heavy, or when the work item explicitly asks for independent review.
When this skill is invoked by a coordinator or main agent with delegation available, split post-implementation verification into independent adversarial lanes after the diff exists. Lane workers receive the frozen decision table, the diff, relevant code, repo guardrails, evidence artifacts, and test results. They return findings only: missing rows, invalid Covered or not applicable dispositions, missing real-boundary tests, concrete bugs/regressions, and the exact evidence behind each finding.
Use the smallest lane set that matches the touched surfaces. Default lanes for high-risk work:
0/empty/invalid values, coercion, validation ownership, sentinel values, and validation of the representation actually consumed.When this skill is invoked inside a worker or subagent that cannot spawn additional subagents, do not attempt delegation. Instead:
External Adversarial Review Needed verification finding instead of marking the artifact fully aligned.Do not mark Final Alignment Status: Aligned solely on the basis of unavailable delegated review when independent adversarial review was required. Either hand the artifact back to the coordinator for lane review or mark Not aligned with the blocker independent adversarial review not run.
Not aligned until corrected.Intended Change even if the plan text is narrower.Covered or already covered disposition must cite a specific test name and the wrong-input or negative case that test fails closed on. Coverage for a CLI, route, package export, worker/job, replay, ingest, attribution, or other integration surface must cite a test through that real boundary; a pure helper test only covers helper-local invariants. Every not applicable disposition must cite source-backed evidence such as grep output, export/package inventory, call-site inventory, schema/query inventory, or code references proving the surface is absent or out of scope.Partially aligned, Mostly aligned, Recorded Gaps). Use Aligned only when no known fixable drift or required-test gap remains; otherwise Not aligned with the blocker.Not aligned as a hard workflow gate, not a report-only status. No PR, merge, completion signal, or success closeout may follow until the artifact is re-verified as Aligned.Aligned if repo guardrails are violated, a required backward-compatible fallback is missing, plan/guardrail tension is unresolved, throw-capable preparation or framework-managed retry/reconnect paths are unrepresented, required evidence artifacts are missing, required independent adversarial review was not run, or the review-prevention pass is incomplete.Default invocation:
Invoke the decision-table skill for this work item. Infer what needs to be mapped, write one artifact under
.closedloop-ai/decision-tables/, then implement, verify final code against that artifact, and fix any drift or missing tests before finishing. Treat verification findings as a resolution queue: every finding must be fixed, proven not applicable with source-backed evidence, or carried intoFinal Alignment Status: Not alignedwith a concrete human/external blocker. Record evidence artifacts for high-yield claims, run the adversarial responsibility split when available, and keep baseline and target sections frozen; append verification and fixes.
When a plan is in scope, replace "this work item" with the plan ID, point the artifact path at .closedloop-ai/decision-tables/<plan-id>.md, and add: "Read repo guardrails such as agent instruction files and compatibility docs and treat them as co-equal requirements. Model dependency success, null/absent, and thrown/rejected branches anywhere the surface promises exact status or error behavior."
The final user-facing message must not assume the user will read the artifact. Include:
Normal review is enough once the artifact exists. Review the change against the decision table, the plan, and repo-level guardrails. Treat mismatches as issues to fix, not just findings to report, and surface user-actionable items directly in the final response.
For contract-heavy work, walk references/review-prevention.md against the implemented surfaces. A separate review skill is only worth adding if this becomes a repeated, high-volume workflow that needs a fixed rubric layered on top of the existing review prompt.
Only produce a Mermaid diagram if the user asks for it or if the table is too large to scan quickly. Derive Mermaid from the decision table, not the other way around.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
decision-table, control-flow, edge-cases, code-review, state-machine
npx claudepluginhub closedloop-ai/claude-plugins --plugin closedloop-core12 skills in this plugin
/closedloop-intelClosedLoop ticket + codebase intelligence over a shared remote instance. Use PROACTIVELY for questions about ticket scope overlap or duplicate work ("do these tickets overlap", "is someone already doing this", "is this a duplicate"), blast radius ("if I change this file or symbol, what breaks", "which tickets touch this code", "what depends on this module"), ticket lookup by keyword or slug, ticket lineage (which plan produced which issue, branches and PRs for a ticket), and aggregate rollups ("what shipped last week", "what is in progress per project", "what is stale"). Answers with cited evidence (ticket slugs, file paths, graph facts) using the closedloop-graph MCP server. Read-only./erd-diagramGenerate or update an interactive ERD (entity relationship diagram) as a single offline HTML file for a Postgres repository, built only from the repo's schema code (a Prisma schema, a SQL schema dump, or a folder of SQL migrations; other ORMs through a model the agent writes from the code). Two styles, canvas-sidebar (one pannable canvas of every table with a table list) and schema-explorer (overview, focused table view, per-domain diagrams). Use when the user asks for an ERD, a database or schema diagram, a map of tables and relationships, or to refresh an existing ERD file.Other plugins' skills for the same job