一键导入
requesting-code-review
Use after implementation work or an intentional review checkpoint, and before merging, to verify the work meets requirements
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use after implementation work or an intentional review checkpoint, and before merging, to verify the work meets requirements
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
You MUST use this before exploring a feature idea, behavior change, or architecture direction. Refines user intent, requirements, and design before implementation.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
Use when implementation is complete and release notes, changelog, TODO, or handoff documentation need a release-quality pass before merge
Use when you have an engineering-approved FeatureForge implementation plan and need to execute it in a separate session
Use when implementation is complete, verification passes, and you need to decide how to integrate the work through merge, PR, or cleanup
Use when a written FeatureForge design or architecture spec needs CEO or founder review before implementation planning, including scope expansion, selective expansion, hold-scope rigor, or scope reduction
| name | requesting-code-review |
| description | Use after implementation work or an intentional review checkpoint, and before merging, to verify the work meets requirements |
_REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
_BRANCH_RAW=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo current)
[ -n "$_BRANCH_RAW" ] && [ "$_BRANCH_RAW" != "HEAD" ] || _BRANCH_RAW="current"
_BRANCH="$_BRANCH_RAW"
_FEATUREFORGE_INSTALL_ROOT="$HOME/.featureforge/install"
_FEATUREFORGE_BIN="$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge"
if [ ! -x "$_FEATUREFORGE_BIN" ] && [ -f "$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge.exe" ]; then
_FEATUREFORGE_BIN="$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge.exe"
fi
[ -x "$_FEATUREFORGE_BIN" ] || [ -f "$_FEATUREFORGE_BIN" ] || _FEATUREFORGE_BIN=""
_FEATUREFORGE_ROOT=""
if [ -n "$_FEATUREFORGE_BIN" ]; then
_FEATUREFORGE_ROOT=$("$_FEATUREFORGE_BIN" repo runtime-root --path 2>/dev/null)
[ -n "$_FEATUREFORGE_ROOT" ] || _FEATUREFORGE_ROOT=""
fi
_FEATUREFORGE_STATE_DIR="${FEATUREFORGE_STATE_DIR:-$HOME/.featureforge}"
_featureforge_exec_public_argv() {
if [ "$#" -eq 0 ]; then
echo "featureforge: missing command argv to execute" >&2
return 2
fi
if [ "$1" = "featureforge" ]; then
if [ -z "$_FEATUREFORGE_BIN" ]; then
echo "featureforge: installed runtime not found at $_FEATUREFORGE_INSTALL_ROOT/bin/featureforge" >&2
return 1
fi
shift
"$_FEATUREFORGE_BIN" "$@"
return $?
fi
echo "featureforge: refusing non-featureforge public argv: $1" >&2
return 2
}
Live workflow routing uses only $_FEATUREFORGE_BIN; never use ./bin/featureforge, target/debug/featureforge, or cargo run for live routing. Query workflow/operator JSON with $_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --json.
If the installed runtime/root cannot be resolved, stop before making workflow mutations. Use only typed operator JSON route surfaces: execute recommended_public_command_argv when present; when recommended_public_command_template appears, treat required_inputs as validation metadata and materialize templates only by rerunning $_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --input NAME=VALUE --json. Detailed binding and route-specific stop rules live in $_FEATUREFORGE_ROOT/references/operator-route-authority.md. Treat display-only recommended_command as non-executable; if no typed executable surface exists, stop and report the route diagnostic.
Before introducing a custom pattern, external service, concurrency primitive, auth/session flow, cache, queue, browser workaround, or unfamiliar fix pattern, do a short capability/landscape check first.
Use three lenses, then decide from local repo truth:
External search results are inputs, not answers. Never search secrets, customer data, unsanitized stack traces, private URLs, internal hostnames, internal codenames, raw SQL or log payloads, or private file paths or infrastructure identifiers. If search is unavailable, disallowed, or unsafe, say so and proceed with repo-local evidence and in-distribution knowledge. If safe sanitization is not possible, skip external search.
See $_FEATUREFORGE_ROOT/references/search-before-building.md.
For every interactive user question, use this structure:
RECOMMENDATION: Choose [X] because [one-line reason]A) ... B) ... C) ...Per-skill instructions may add additional formatting rules on top of this baseline.
Dispatch the code-reviewer sub-agent or custom agent with precisely crafted context for evaluation - never your session's history. This keeps the reviewer focused on the work product and preserves your own context for continued work.
In Codex, FeatureForge installs the code-reviewer custom agent alongside the shared skills checkout. In GitHub Copilot local installs, FeatureForge installs the same reviewer through the platform's custom-agent path.
Core principle: Review at the right checkpoints, then fail closed on the final whole-diff gate.
Invocation identity: featureforge:requesting-code-review. Valid modes: terminal whole-diff review when workflow/operator selects the final-review lane, or non-terminal checkpoint/task-boundary review before execution continues. For late-stage phase/action vocabulary, reference $_FEATUREFORGE_ROOT/review/late-stage-precedence-reference.md; do not use that reference to infer the next lane.
Mandatory: For the final cross-task review gate in workflow-routed work when workflow/operator selects terminal final review for the current HEAD, after completing major feature work, and before merge to the target base branch.
1. If this review is for plan-routed work, capture execution state first:
$_FEATUREFORGE_BIN plan contract analyze-plan --spec <approved-spec-path> --plan <approved-plan-path> --format json before dispatching the reviewer.contract_state != valid or packet_buildable_tasks != task_count, stop and return to the current execution flow; do not review stale or malformed approved artifacts.$_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --json before dispatching the reviewer.$_FEATUREFORGE_BIN plan execution status --plan <approved-plan-path> only when you need extra execution-dirty or strategy-checkpoint diagnostics from the current workflow context.active_task, blocking_task, and resume_task from that status JSON.active_task, blocking_task, or resume_task is non-null, stop and return to the current execution flow; final review is only valid when all three are null.workflow operator as the normal route authority; use plan execution status only when you need extra diagnostic fields for review context.phase=final_review_pending with phase_detail=final_review_dispatch_required.phase_detail=final_review_outcome_pending, do not dispatch a second reviewer; wait for the current final-review result or return to the current execution flow.final_review_dispatch_required, keep the normal path operator-led and treat low-level dispatch commands as compatibility/debug-only.$_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --external-review-result-ready --json after the external review result is ready.--external-review-result-ready --json, then follow the Installed Control Plane section and canonical route reference.legacy_evidence_format, keep them in review context but do not treat them as blockers while authoritative runtime/operator gate outputs remain non-blocking.2. Use the provided base branch context and derive the review range:
Keep base-branch selection runtime-aligned and stable for this review. For plan-routed final review, BASE_BRANCH must come from $_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --json (base_branch) and stay aligned with the runtime-owned release lineage/document-release context. For non-plan-routed review, provide BASE_BRANCH explicitly before running this step. Do not redetect it here.
if [ -z "$BASE_BRANCH" ]; then
echo "Missing BASE_BRANCH. Set it from workflow/operator base_branch and runtime-owned release lineage (plan-routed) or provide it explicitly (non-plan-routed) before continuing."
exit 1
fi
git fetch origin "$BASE_BRANCH" --quiet 2>/dev/null || true
BASE_SHA=$(git merge-base HEAD "origin/$BASE_BRANCH" 2>/dev/null || git merge-base HEAD "$BASE_BRANCH" 2>/dev/null)
if [ -z "$BASE_SHA" ]; then
echo "Could not derive merge-base for BASE_BRANCH=$BASE_BRANCH. Stop and provide a valid base branch."
exit 1
fi
HEAD_SHA=$(git rev-parse HEAD)
Do not use PR metadata or repo default-branch APIs as a fallback. For workflow-routed review, require BASE_BRANCH from $_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --json (base_branch). For non-plan-routed review, require an explicitly provided BASE_BRANCH.
The reviewer MUST use $_REPO_ROOT/review/checklist.md when available, otherwise $_FEATUREFORGE_ROOT/review/checklist.md.
3. Dispatch the code-reviewer agent:
Use the code-reviewer agent and fill the template at skill-local code-reviewer.md.
For workflow-routed final review, dispatch a dedicated fresh-context reviewer independent of the implementation context. Do not reuse the implementation agent or its session for the terminal whole-diff review gate.
The controller owns any FeatureForge runtime queries before dispatch. Fill the skill-local code-reviewer.md template with all context the reviewer must consider, including unfamiliar platform patterns or known footguns when relevant; if required runtime context is absent, return to the current execution flow instead of dispatching an under-contextualized review. The reviewer prompt owns the reviewer-only recursion contract.
Use skill-local code-reviewer.md as the placeholder source of truth. Fill all plan, diff, runtime-provenance, skill-root, live-state, and description fields before dispatch.
3.5. Required review-dispatch provenance for FeatureForge-on-FeatureForge work:
4. Act on feedback:
Fix Critical issues immediately and Important issues before proceeding. Note Minor issues for later, push back on incorrect findings with code/test evidence, and require deterministic repair-packet fields: Finding ID, Severity, Task, Violated Field or Obligation, Evidence, Required Fix, and Hard Fail.
4.25. Enforce runtime-owned remediation checkpoints before fixes:
writing-plans or plan-eng-review just because remediation is needed.review_remediation: runtime records this automatically when reviewable execution work enters remediation after non-pass findings.cycle_break: runtime records this automatically when the same task hits three review-dispatch/reopen cycles in one run.cycle_break strategy automatically (no human replanning loopback required).$_FEATUREFORGE_BIN plan execution status --plan ...:
strategy_statestrategy_checkpoint_kindlast_strategy_checkpoint_fingerprintstrategy_reset_required4.5. Keep review artifacts runtime-owned:
Use ANALYZE_JSON=$("$_FEATUREFORGE_BIN" plan contract analyze-plan --spec "$SOURCE_SPEC_PATH" --plan "$APPROVED_PLAN_PATH" --format json) and stop unless contract_state=valid and packet_buildable_tasks=task_count.
Use OPERATOR_JSON=$("$_FEATUREFORGE_BIN" workflow operator --plan "$APPROVED_PLAN_PATH" --json) and request final review only for phase=final_review_pending plus phase_detail=final_review_dispatch_required.
Set BASE_BRANCH from workflow/operator for plan-routed review and derive BASE_SHA/HEAD_SHA. Stop here: dispatch the dedicated fresh-context reviewer, wait for its result, then set REVIEWER_SOURCE=, REVIEWER_ID=, REVIEW_RESULT=pass|fail, and SUMMARY_FILE=.
After the reviewer returns, obtain RECORDING_READY_JSON=$("$_FEATUREFORGE_BIN" workflow operator --plan "$APPROVED_PLAN_PATH" --external-review-result-ready --json), then follow the Installed Control Plane section and canonical route reference. The final-review materializer lives in the Final-Review Recording Route Materializer section of $_FEATUREFORGE_ROOT/references/operator-route-authority.md; use that materializer's --input NAME=VALUE operator query for any template inputs and execute only the returned recommended_public_command_argv through _featureforge_exec_public_argv.
Do not hand-write advance-late-stage for final review recording. If workflow/operator does not return an executable final-review recording route, stop and report RECORDING_READY_JSON.
See $_FEATUREFORGE_ROOT/references/execution-review-qa-examples.md for example findings and dispatch logistics.
active_task, blocking_task, or resume_task as execution-dirty and rejects final review until execution returns to a clean state$_FEATUREFORGE_BIN workflow operator --plan ... --json as the authoritative late-stage route, requests external final review when routed, and records final-review outcome only through the returned public route after --external-review-result-ready --jsonreopen itselfNever skip review because "it's simple", ignore Critical issues, proceed with unfixed Important issues, or argue with valid technical feedback.
If reviewer feedback is wrong, push back with technical reasoning, code/tests, or a clarification request.
See template at skill-local code-reviewer.md.