Install
$ agentstack add skill-erikole21-refacil-sdd-ai-review ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
refacil:review — Review Entrypoint
This skill is a thin wrapper that delegates the heavy review to the refacil-auditor sub-agent. Before delegating, it builds a structured briefing with the changed files and detected project type — the sub-agent starts evaluating, not discovering.
Prerequisites: agents profile from refacil-prereqs/SKILL.md + output mode from METHODOLOGY-CONTRACT.md.
Flow
Step 0: Resolve scope
- Determine the review scope BEFORE invoking the sub-agent. Prioritize in this order:
1) User argument ($ARGUMENTS) 2) Active change in refacil-sdd/changes/ 3) Uncommitted changes (git diff)
- If there are multiple active changes in
refacil-sdd/changes/and no$ARGUMENTS, stop and ask the user to explicitly select which change to review. Do not invoke the sub-agent with ambiguous scope.
Autopilot mode detection: once changeName is resolved (and not null), try to read refacil-sdd/.autopilot-active. If the file exists and its changeName field matches → autopilotMode = true. Otherwise autopilotMode = false (normal mode, ask user as usual).
Step 0.3: Git working tree snapshot (run once)
After scope is unambiguous (you are not stopping for multiple active changes), collect git state exactly once for this skill invocation:
- Run
git diff --name-only HEAD→ setpathsFromDiff. - Run
git status --porcelain→ parse each line (strip the first two status columns) → setpathsFromStatus. changedFilesUnion= sorted unique union ofpathsFromDiffandpathsFromStatus(drop empty entries).
Rules:
- Reuse
changedFilesUnionand the samegit status --porcelaininterpretation everywhere below — do not rungit diff --name-onlyorgit status --porcelainagain in this skill. - If a later step needs “is the working tree non-empty?”, derive it from the snapshot (e.g. non-empty
changedFilesUnionor any porcelain line) instead of re-runninggit status.
If you already have a changeName, run refacil-sdd-ai sdd status --json to get the change status (artifacts, tasks, reviewPassed).
Review already approved: If reviewPassed is true in the status JSON (or if the target change already has .review-passed), verify if there are changes after the review (marker existence: METHODOLOGY-CONTRACT.md §8):
- Read the
datefrom.review-passed. - Compare with
git log --since="[date]" --onelineand reuse the Step 0.3 snapshot for working-tree activity (do not rungit statusagain). - If there are new changes (commits since marker date and/or paths in
changedFilesUnion): delete the previous.review-passedand continue (build briefing and invoke the sub-agent). - If there are NO new changes: inform the user and finish without invoking the sub-agent:
`` The change [name] already has an approved review ([verdict] — [date]) and there are no subsequent changes. ``
Step 0.4: Incremental scope (CA-07 — only if re-running after REQUIERE CORRECCIONES)
If changeName is not null, check whether refacil-sdd/changes//.review-last-fails.json exists (read by explicit path — it is NOT a dotfile but may be hidden in listings):
- If the file EXISTS: read
failedFilesfrom it. Compute:
incrementalScope = failedFiles ∪ changedFilesUnion
- If
incrementalScopeis empty (CR-02): fall back tochangedFilesUnionand add a comment in the briefing:"# warning: incremental scope was empty — using full changedFilesUnion". - Use
incrementalScopeaschangedFilesin the briefing (Step 0.5), instead of the fullchangedFilesUnion. - If the file does NOT exist: use
changedFilesUnionaschangedFilesnormally.
Step 0.5: Build briefing for the sub-agent (reduces auditor tool calls)
Before invoking the sub-agent, extract the context that the auditor would otherwise calculate on its own.
3C criterion reference: the auditor applies the 3D framework per METHODOLOGY-CONTRACT.md §3C — 3C Criterion: Completeness, Correctness, Coherence — include codegraphAvailable in the briefing so the auditor can use CodeGraph for Dimension 3 (Coherence) analysis when available. If codegraphAvailable: true and the change touches modules with high fan-out, codegraph_impact is recommended before approving (the auditor decides based on the briefing).
CodeGraph detection: run refacil-sdd-ai codegraph status --json and extract:
codegraphAvailable = trueifinstalled === trueANDinitialized === truecodegraphAvailable = falseotherwise
- Changed files — use the scope resolved in Step 0.4 (
incrementalScopeif available, otherwisechangedFilesUnion). Do not rungit difforgit statusagain.
- Project type — read
package.json(if it exists) and inspect the dependencies:
- Backend indicators:
@nestjs/*,express,fastify,koa,typeorm,prisma,pg,mongoose,bullmq,amqplib - Frontend indicators:
react,vue,angular,next,nuxt,svelte,vite,@tanstack/* - If both →
fullstack; if only backend →backend; if only frontend →frontend. - If
package.jsonexists but none of the above apply (CLI/methodology package, minimal deps, no web/API framework) →library. - If no
package.jsonor still unclear → read the first 20 lines ofAGENTS.mdto infer.
- Change objective (only if there is an active change in
refacil-sdd/changes/) — read the first section ofproposal.md. Extract the objective in 1-2 sentences. If the scope isgit-diffwithout an active change →null.
- Cross-skill memory — run
refacil-sdd-ai sdd get-memory --jsonand parse the JSON to extractstackDetected,touchedFiles,commandsRun,criteriaRun, andlastStep. Include them in the briefing so the auditor skips re-discovery and does not re-run the test suite (§3.2). If the command outputs{}or fails, omit — do not block (CR-04).
- Mode — default
concise. If re-running after a priorREQUIERE CORRECCIONES(i.e.,.review-last-fails.jsonwas found with non-emptyfailedFilesin Step 0.4): setmode: focused— the auditor re-evaluates only the failing checklist items on thefailedFiles(CR-05: focused mode still reads those files). Otherwise keepconcise.
Build the BRIEFING block:
BRIEFING:
scope:
changedFiles: [path/file-1.ts, path/file-2.ts, ...]
projectType: backend | frontend | fullstack | library
changeObjective:
mode: concise | detailed | focused
codegraphAvailable: true | false # from CodeGraph detection above
stackDetected:
touchedFiles: [...] # from memory.yaml — omit if not present
commandsRun: [, ...] # from memory.yaml — omit if not present
criteriaRun: [CA-01, ...] # from memory.yaml — omit if not present
lastStep: test | verify | apply | ... # from memory.yaml — omit if not present
testExecution: none # review never runs full suite by default (§3.2)
Step 1: Delegate to the refacil-auditor sub-agent
Invoke the refacil-auditor sub-agent passing it the BRIEFING from the previous step.
The sub-agent:
- Uses
changedFilesfrom the briefing as the blocking scope (without re-running git diff). - Uses
projectTypeto directly load the correct checklists (without a detection phase). - Uses
changeObjectiveas intent context (without re-reading proposal.md). - Reads the checklists and the blocking scope files.
- Evaluates each item with PASS/FAIL/N/A + severity for each FAIL.
- Returns ONE single message with the report + JSON block fenced as
`refacil-review-result.
Step 1.5: Log CodeGraph telemetry (silent)
After the sub-agent completes, run once (do not mention it to the user unless it fails):
refacil-sdd-ai compact log-codegraph-event --skill auditor --has-graph --tool-calls --tokens
--has-graph: thecodegraphAvailablevalue from Step 0.5 of this skill.--tool-calls: number ofcodegraph_*tool calls the sub-agent made (0 if it did not use the graph).--tokens: conservative estimate of tokens saved (~800–1500 per useful tool call; 0 if no graph or no calls).
Estimate --tool-calls and --tokens from the sub-agent's ` block using the same criteria as explore/SKILL.md` Step 1.5. If the command fails, ignore it; it must not block the flow.
Step 2: Process the sub-agent report
Show the user the concise report (everything before the refacil-review-result block). Do not show the JSON block — it is internal metadata.
If the sub-agent returned SCOPE_ERROR: : propagate the error to the user and ask for clarification. Do not write a marker.
Step 2.5: Persist or clean incremental-scope state (CA-06/CA-08/CA-09/CR-01)
Parse the refacil-review-result block from the sub-agent.
If verdict is REQUIERE CORRECCIONES:
- Only if
changeNameis not null (CR-01) AND the block includes afailedFilesfield (CA-09 backward compat): - Run:
refacil-sdd-ai sdd set-review-fails --files "" - If
changeNameis null orfailedFilesis absent: skip silently.
If verdict is APROBADO or APROBADO CON OBSERVACIONES:
- Run:
refacil-sdd-ai sdd clear-review-fails
Step 3: Create .review-passed marker (if applicable)
Parse the `refacil-review-result block from the sub-agent. If verdict is APROBADO or APROBADO CON OBSERVACIONES and changeName is not null:
Run the following command to write the marker:
refacil-sdd-ai sdd mark-reviewed \
--verdict "" \
--summary "" \
--fail-count \
--preexisting-count
Where the values are extracted from the sub-agent's refacil-review-result block:
- `
: the value ofverdict` (APROBADO, APROBADO CON OBSERVACIONES, etc.) - `
: the value ofsummary` - ``: FAILs in new code (default 0)
- ``: pre-existing non-blocking FAILs (default 0)
Do NOT run the command if:
verdictisREQUIERE CORRECCIONES.changeNameis null.- The sub-agent returned
SCOPE_ERROR.
After writing .review-passed with an approved verdict, record the state:
refacil-sdd-ai sdd set-memory --state reviewed --actor review-skill
If the command fails or changeName is null, continue silently — it must not block the flow.
Step 3.5: Offer to apply corrections (only if REQUIERE CORRECCIONES)
If verdict is REQUIERE CORRECCIONES:
autopilotMode = false(normal): show the report, present a numbered list of findings (blockers first, then medium/low) and ask:
``` X corrections are needed. Do you want me to apply them?
- "yes" / "all" — apply all
- "1, 3" (numbers) — apply only those items
- "no" / "skip" — you'll handle them manually
``` Apply according to the user's response (yes/all → all; N,M → selected; no/skip → none).
autopilotMode = true: categorize findings automatically:- Auto-fixable (formatting, naming, missing docstring, small refactor within scope): apply all in a single batch, then re-invoke
/refacil:review. If pass 2 approves → continue to Step 4. - Requires human judgment (architectural concern, scope question, business logic): abort — do not apply, return failure to the autopilot pipeline without asking the user. If pass 2 still does not approve → abort.
After applying corrections (if any):
- Do not run the project's full or scoped test command from AGENTS.md §3.
- If production code or tests were touched, summarize what was applied and recommend
/refacil:testbefore another verify/review cycle. - Then continue to Step 4.
Step 4: Recommend next step
According to the parsed verdict:
If APROBADO or APROBADO CON OBSERVACIONES:
autopilotMode = false(normal): ask the user:
`` The next step is to archive the change. Do you want me to continue with /refacil:archive? ``
autopilotMode = true: proceed to/refacil:archiveimmediately without asking.
If REQUIERE CORRECCIONES (after Step 3.5):
autopilotMode = false(normal): ask the user:
`` The next step is to re-run tests for this change (/refacil:test), then re-verify. Do you want me to continue with /refacil:test? `` (If the user prefers verify only without re-test, they may say so — default is test first per §3.2.)
autopilotMode = true: this is an abort condition — Step 3.5 already returned failure to the autopilot pipeline.
Rules
- Always build the briefing (Step 0.5) before delegating — it is the key piece that reduces the sub-agent cost.
- Always delegate to the sub-agent. Do not replicate checklist or evaluation logic here.
- The marker is created by this skill, not the sub-agent.
- If the sub-agent returned something out of format (no parseable JSON block and not
SCOPE_ERROR), inform the user: "The reviewer returned an unstructured report — no marker was created. Review the report manually." - Flow continuity:
- If verdict is APROBADO/APROBADO CON OBSERVACIONES and user confirms → immediately invoke
skill: "refacil:archive". - If verdict is REQUIERE CORRECCIONES and user confirms (Step 4) → immediately invoke
skill: "refacil:test"(default per §3.2); invokerefacil:verifyonly if the user explicitly chose verify without re-test. - Do not describe the skill in text or wait for the user to type the command. (See
METHODOLOGY-CONTRACT.md §5.)
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Erikole21
- Source: Erikole21/refacil-sdd-ai
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.