| name | das-review |
| description | Review coding changes against the approved plan, identify concrete bugs, regressions, and plan-adherence gaps, run approved isolated fix passes, then close the loop with optional planning-doc cleanup and PR/MR creation. |
Coding Loop Reviewer And Closeout
Overview
Use this skill after execution. Validate the implemented work against overview.md, plan.yaml, execution.md, and the actual repository state. If needed, run a bounded review-fix loop. When the review passes, own closeout: optional planning-doc cleanup and optional PR/MR creation.
The reviewer is the final gate for the loop.
Input Contract
- Require one argument: the feature planning folder.
- Require
overview.md, plan.yaml, and execution.md.
- Stop if artifacts are missing, conflict materially, or show execution did not reach reviewer handoff.
- If execution reached reviewer handoff only by explicit user request despite known blockers, review the blocked implementation only within that stated purpose.
- Derive the expected branch as
cl/YYYY-MM-DD_FEATURE_NAME.
- Require the expected branch to exist and be clean before review starts, except for safe reviewer artifact initialization.
- Check whether
.project_planning/ is gitignored by running git check-ignore -q .project_planning/. If exit code is 0, planning artifacts are local-only — do not stage or commit them at any point during this workflow. If exit code is non-zero, planning artifacts are version-controlled — commit them as described below.
- Treat planner and executor artifacts as immutable inputs unless the user explicitly requests replanning or artifact correction.
Review Flow
Follow this sequence:
- Validate artifacts and branch state.
- Check out the expected feature branch.
- Run the review pass.
- If blocking findings exist, ask approval for one consolidated fix plan.
- Run approved review-fix work through sub-agent delegation.
- Rerun relevant checks.
- Repeat only if new blocking findings remain.
- Mark final status.
- Offer closeout actions: planning-doc cleanup and PR/MR creation.
Stop and report blockers instead of widening scope.
Review Artifact
review.md is optional.
Do not create review.md by default. Create it only when the user chooses to keep planning docs or declines planning-doc deletion during closeout.
When created, review.md is a compact final-state file under the planning folder. It should record:
- scope and inputs reviewed
- review status:
fail, pass_with_notes, or pass
- blocking findings and resolution state
- non-blocking notes
- verification reruns and results
- residual risks
- closeout actions chosen and results
Do not maintain a verbose review history unless needed to preserve finding resolution.
Review Standard
Compare these inputs:
overview.md for original intent, boundaries, and verification strategy
plan.yaml for the approved implementation contract
execution.md for completed steps, deviations, and verification
- repository state for what actually landed
Focus on:
- plan and scope adherence — including whether each step's implementation honors its
approach and the Key Decisions cited in its decisions list
- obvious bugs or regressions
- missing or weak verification
- correctness against accepted intent
- maintainability issues that materially affect correctness or future work
Review touched files and directly adjacent regression-risk areas: call sites, interfaces, tests, config, data paths, and package boundaries touched by or directly depending on the change. Do not broadly re-review unrelated code.
For inspection, use native tools directly — Read to examine files, grep and glob to locate code and call sites, Write for review.md. Do not route through Bash when a dedicated tool exists.
Prefer evidence over speculation. Findings should reference concrete code, artifacts, missing checks, or reproducible reasoning.
Findings
Classify findings as:
blocking: must be fixed before closeout
non_blocking: record but does not block closeout
informational: useful note only
Map final status as:
fail if blocking findings remain
pass_with_notes if no blocking findings remain but non-blocking findings remain
pass if only informational findings or no findings remain
Only fixable blocking findings enter the fix plan by default. Include non-blocking fixes only when directly adjacent and negligible in scope.
Review-Fix Loop
Do not edit code before a review pass has produced concrete findings and the user has approved the fix plan.
Each review pass may produce one consolidated fix plan. The plan must map fixes to blocking finding ids and state which verification will be rerun.
The reviewer prefers the highest available delegation tier for fix passes:
- Isolated delegation (preferred): fix pass runs in a dedicated worktree on a temporary branch. Provides full isolation from the feature branch.
- Direct delegation (fallback): fix pass runs directly on the feature branch via a sub-agent. Used when worktrees are unavailable or provisioning fails.
- Inline fixes (last resort): reviewer applies fixes directly. Used only when delegation is itself unavailable.
Prefer isolated delegation. Fall back through tiers in order. Do not skip direct delegation and jump to inline fixes just because worktrees failed.
The reviewer owns provisioning, merge, verification, cleanup, and any review.md updates.
Worktree Provisioning Checks
After git worktree add, verify the worktree before dispatching:
ls -d <worktree-path> — confirm the directory was created.
git -C <worktree-path> branch --show-current — confirm it is on the expected temporary branch.
If either check fails, prune the entry with git worktree remove <worktree-path> and fall back to direct delegation.
Review-Fix Delegation
The review-fix sub-agent must:
- receive only the approved findings, fix plan, relevant files, constraints, and verification strategy
- run the pre-commit checklist before committing (see below)
- commit its changes on the working branch (temporary branch for isolated delegation, feature branch for direct delegation)
- avoid unrelated cleanup or scope expansion
- not merge, rebase, or clean up reviewer-owned git state
Review-fix work is sequential. Do not parallelize it.
Delegation
Use the cheapest capable sub-agent or delegation profile available in the current runtime.
The reviewer must provide a tight, self-contained task with known context, relevant files, approved decisions, constraints, expected output, non-goals, and the pre-commit checklist below.
Pre-Commit Checklist
Include the appropriate checklist verbatim in every delegated task that commits. The sub-agent must run all checks before git commit.
Isolated delegation mode:
git branch --show-current — must equal the temporary branch name given in the task. If it shows the feature branch, STOP and report without committing.
git rev-parse --show-toplevel — must equal the worktree path given in the task. If it shows a different path, STOP and report without committing.
git status — must show only files within the declared scope as modified. If unexpected files appear, STOP and report.
Direct delegation mode:
git branch --show-current — must equal the feature branch name given in the task. If it shows a different branch, STOP and report without committing.
git status — must show only files within the declared scope as modified. If unexpected files appear, STOP and report.
If any check fails, the sub-agent must not commit. It must report the mismatch and let the executor recover.
Verification After Fixes
Before running linters, clean any linter cache that stores results by absolute path. Stale entries from deleted worktrees cause false positives (e.g. golangci-lint cache clean for Go projects).
Reuse the verification strategy in overview.md by default. Rerun the narrowest checks that cover the fixes and any affected acceptance criteria.
If verification fails, either run another approved review-fix pass or report a blocker. Do not silently downgrade failures.
Closeout
Closeout starts only when final review status is pass or pass_with_notes, blocking findings are resolved, and the feature branch is clean.
Offer the user these closeout actions:
- stop after review approval
- delete the planning folder
- prepare and create a PR/MR
- both delete planning folder and prepare/create a PR/MR
Do not delete planning artifacts, push, or create a PR/MR without explicit user confirmation.
Planning-Doc Cleanup
Planning docs are disposable after successful review unless the user wants to keep them.
If the user chooses cleanup:
- delete
.project_planning/YYYY-MM-DD_FEATURE_NAME/
- if planning artifacts are version-controlled, commit the deletion unless the user explicitly asks otherwise
- include the cleanup result in the closeout message
If the user declines cleanup, create or update review.md with the final review and closeout state.
PR Or MR Preparation
Use commit messages for PR/MR summaries. Do not broad-diff the branch against origin/main by default.
Build the PR/MR body from:
- non-merge commit messages created for the loop
- final review status and any residual risks from the current review
Use loop artifacts only as fallback if they still exist and commit messages are missing, vague, contradictory, or clearly insufficient.
Inspect targeted diffs only if commit messages and available artifacts are insufficient.
Detect the remote provider from the current branch tracking remote or origin.
Choose the target branch in this order:
- upstream or tracking base if clearly known
origin/main
origin/master
- ask the user
Use only known provider flows:
- GitHub: push if needed, then
gh pr create --title <title> --body <body> --base <target> --head <branch>
- GitLab:
git push -o merge_request.create -o merge_request.target=<target> <remote> <branch>
- Azure DevOps: push if needed, then
az repos pr create --title <title> --description <body> --source-branch <branch> --target-branch <target>
- Bitbucket or unknown provider: report unsupported automatic PR/MR creation
Ask for confirmation before pushing or creating a PR/MR. Do not dump the full PR/MR body unless the user asks.
Completion
The loop is complete when review has passed and the user has either accepted, declined, or completed closeout actions. Unsupported PR/MR creation does not invalidate the reviewed work; it only prevents automatic PR/MR creation.