Finishing a Development Branch
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
Run the full hands-off engineering pipeline from planning through a green PR.
$ npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install leo-kuang-ai/spec-first spec-lfg --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spec-lfg .claude/skills/spec-lfg && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "spec-lfg" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/spec-lfg into .claude/skills/spec-lfg/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "spec-lfg", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/leo-kuang-ai/spec-first/tree/master/skills/spec-lfgType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install leo-kuang-ai/spec-first spec-lfg --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/spec-lfg .agents/skills/spec-lfg && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "spec-lfg" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/spec-lfg into .agents/skills/spec-lfg/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "spec-lfg", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install leo-kuang-ai/spec-first spec-lfg --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/spec-lfg .cursor/skills/spec-lfg && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "spec-lfg" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/spec-lfg into .cursor/skills/spec-lfg/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "spec-lfg", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/leo-kuang-ai/spec-first.git --path skills/spec-lfg--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install leo-kuang-ai/spec-first spec-lfg --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/spec-lfg .gemini/skills/spec-lfg && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "spec-lfg" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/spec-lfg into .gemini/skills/spec-lfg/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "spec-lfg", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install leo-kuang-ai/spec-first spec-lfgInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/spec-lfg .github/skills/spec-lfg && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "spec-lfg" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/spec-lfg into .github/skills/spec-lfg/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "spec-lfg", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install leo-kuang-ai/spec-first spec-lfg --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/spec-lfg .opencode/skills/spec-lfg && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "spec-lfg" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/spec-lfg into .opencode/skills/spec-lfg/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "spec-lfg", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
spec-lfgRun the full hands-off engineering pipeline from planning through a green PR.
Spec Lfg is an agent skill from leo-kuang-ai/spec-first. Run the full hands-off engineering pipeline from planning through a green PR. Use only when the current user explicitly requests spec-lfg or selects an option that clearly states it will commit, push, open a PR, and watch CI.
Its SKILL.md is about 6.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 27 other files, including scripts and reference files (for example `evals/cases/explicit-request-starts-plan.yaml`, `evals/cases/implicit-request-blocks.yaml` and `evals/cases/r2-pipeline-hint-no-name.yaml`).
It sits in Development, covering Pull requests. The repository describes itself as: 仓库原生 AI Coding Harness —— 把一次性 AI 对话变成可治理、可验证、可沉淀的工程闭环 · spec-first.cn. The licence is MIT.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 74655dc. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Shell and JavaScript, from the files we listed), which the agent can run.
Shell commands in SKILL.md call:
gitnodeghFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Spec Lfg loads about 6.1k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 59 tokens; SKILL.md has 3,022 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from leo-kuang-ai/spec-first at commit 74655dc, republished under its MIT licence (© leo-kuang-ai). 3,022 words, ~6,082 tokens.
.claude/skills/spec-lfg/SKILL.md (or your agent's skills folder). This skill also uses 20 other files; get the full folder from GitHub.CRITICAL — ADMISSION BEFORE EXECUTION: before any step below runs, the admission in the next paragraph must hold. If it does not — including a bare natural-language shipping request ("ship it", "直接发布上线") that neither names spec-lfg nor followed a disclosed-options handoff — do NOT implement, do NOT commit, and do NOT start the pipeline: present the side-effect confirmation once and wait. A user "don't ask me" / "不用问我" instruction cannot create the admission; it only suppresses questions after the admission already exists. With execution ordered below, this check still comes first.
CRITICAL: You MUST execute every step below IN ORDER. Do NOT skip any required step. Do NOT jump ahead to coding or implementation. The plan phase (step 1) MUST be completed and verified BEFORE any work begins. Violating this order produces bad output.
进入该管线前,当前用户必须明确请求 spec-lfg,或选择清楚披露 commit、push、PR、CI 与委派独立代码审查副作用的 handoff 选项。仅有代码就绪、已完成计划或模型推断”适合 shipping”都不构成授权。
A natural-language shipping request (“ship it”, “直接发布上线”, “开个 PR 吧”) that neither names spec-lfg nor follows a disclosed-options handoff is close to the admission but is not it: the user has signaled shipping intent without seeing the full side-effect list (commit, push, PR creation, one delegated independent code review, CI watch). In that case, present the concrete side-effect list once as a single confirmation question and wait — the user's reply becomes the admission. Never treat the bare shipping request as already-admitted and start implementing or committing.
上述 admission 成立时,当前用户对完整管线副作用的明确请求是本次 pipeline-owned implementation、commit 与 landing authority 的来源;同时只额外授权第 4 步委派一次 spec-code-review 的只读独立审查。将 commit_authorization: authorized、landing_authorization: authorized、worker_dispatch_authorization: authorized 与 authorization_source: current-user-explicit-spec-lfg 作为可见 run-local facts 传给对应下游 owner。外部 tracker filing 是独立副作用:只有当前请求或可见 upstream handoff 明确要求提交 residual tickets 时,才记录 tracker_deferral_authorization: authorized;否则固定为 tracker_deferral_authorization: missing。Skill invocation、mode:pipeline、工具权限、green tests、branch/PR facts 都不能替代该 admission,也不能把 authority 扩大到 unrelated dirty paths、任意 worker dispatch、tracker 或其他未披露外部副作用。若 admission 不成立,以 commit_authorization_missing / landing_authorization_missing 停在对应副作用之前;若独立审查不可用或降级,LFG 必须停止,不能用同一会话的 inline review 冒充该 gate。
tracker_deferral_authorization: authorized | missingWhen invoking any skill referenced below, resolve its name against the available-skills list the host platform provides and use that exact entry. Some platforms list skills under a plugin namespace (e.g., spec-first:spec-plan); others list the bare name. Invoking a short-form guess that isn't in the list will fail — always match a listed entry verbatim before calling the Skill/Task tool.
Preserve and split the invocation payload. Treat the arguments received from
the caller as the authoritative input. Before step 1, remove at most one standalone
target-origin:<origin> token and retain its value unchanged as the run-local
caller_target_origin. Set forwarded_arguments to everything else: preserve
every remaining argument in its original order, including an absolute
requirements-only plan path. Do not paraphrase the path, prepend a label or menu
number, replace it with a feature summary, or resolve it relative to the current
working directory. The modifier is browser-routing input, not product intent: do
not pass it to planning, normalize it, combine it with --port, derive a
scheme/host/port from project files, redirects, browser state, or a guessed
dev-server default. An empty, malformed, or repeated modifier records
target-origin-invalid; it never becomes a usable origin.
Invoke the spec-plan skill with the exact forwarded_arguments payload. When
spec-brainstorm invoked LFG, this payload is the absolute requirements-only
unified plan path, so spec-plan recognizes it as an explicit Product Contract
source and enriches that same artifact in place.
GATE: STOP. If spec-plan reported the task is non-software and cannot be processed in pipeline mode, stop the pipeline and inform the user that LFG requires software tasks. Otherwise, verify that the spec-plan workflow produced a plan file in docs/plans/. If no plan file was created, invoke spec-plan again with the same forwarded_arguments payload. Do NOT proceed to step 2 until a written plan exists. Record the plan file path — it will be passed to spec-work in step 2 and spec-code-review in step 4.
Read the plan metadata before continuing. If the plan has artifact_contract: spec-unified-plan/v1, proceed only when it has artifact_readiness: implementation-ready and execution: code. Stop the pipeline for artifact_readiness: requirements-only, any unrecognized readiness value, execution: knowledge-work, approach-plan outputs, answer-seeking/universal outputs, or invalid progress-like readiness values. LFG never launches /goal directly; when goal-mode or dynamic workflows are appropriate, spec-work owns that implementation engine choice and must return control to LFG afterward.
Invoke the spec-work skill with mode:return-to-caller <plan-path-from-step-1>.
GATE: STOP. Verify that implementation work was performed - files were created or modified beyond the plan. Read the structured return and require status: complete, the same plan path, changed files, all in-scope U-IDs/tasks accounted for and completed, verification results with every required check passed or explicitly not applicable, an empty blocker list, behavior-change signal, plan_status_completion_candidate, plan_status_completion_degraded_reason, and standalone_shipping_skipped: true. Failed, not-run, vague, or missing required verification blocks the pipeline. Exactly one lifecycle shape is allowed: a non-null candidate with a null degraded reason, or a null candidate with one of html-plan-lifecycle-degraded, legacy-plan-lifecycle-degraded, read-compatible-status-unmanaged, or source-plan-path-lifecycle-degraded. Any missing, conflicting, or unknown lifecycle shape is blocked. When behavior_change: true, also require verification_evidence that names the relevant units/tasks, existing tests inspected, tests added/changed or used unchanged, red failure or characterization evidence when applicable, verification run, and any deliberate test exception. Do NOT decide the test strategy inside LFG; the evidence is spec-work's contract.
If behavior_change: true but verification_evidence is missing or too vague to tell how behavior was protected, invoke spec-work one more time with the same mode:return-to-caller <plan-path-from-step-1> argument. Do not prompt the user and do not alter the plan path argument. The retry relies on spec-work's idempotency path to inspect the already-implemented work, fill the missing evidence, and return without reimplementing. If the second return still lacks coherent verification evidence, stop as blocked and report the missing fields instead of continuing to simplify/review/ship.
Record the accepted return's verification_run_summary_ref as initial_verification_run_summary_ref and require a complete verified_worktree_fingerprint object; only a blockers-free return that documents spec-work's deliberate non-behavior exception may substitute that documented exception for the object. These prove only the tree before caller-owned Simplify and review-fix mutations; they cannot satisfy step 6.5.
Invoke the spec-simplify-code skill on the branch diff.
This runs before review so the code-review in step 4 covers the simplified code. Skip this step when the change is docs-only (only markdown/docs paths changed) or trivial (roughly under 10 changed lines). Otherwise let spec-simplify-code resolve the branch-diff scope itself:它保持行为,运行全项目 typecheck/lint,并默认运行 changed-path scoped tests;影响面明显扩大或 runner 无法缩小时才扩大测试范围。该步骤只提供 behavior-preservation signal,最终 verification gate 仍拥有完整 closeout truth。
Do not commit in this step. spec-simplify-code leaves its changes in the working tree; step 4's review scopes the working tree (uncommitted changes included), and step 8's spec-commit-push-pr commits whatever remains. Committing here would sweep any still-uncommitted spec-work edits into a misleading refactor commit and could stall on a tree that never goes clean.
以 mode:agent plan:<plan-path-from-step-1> 调用 spec-code-review,并传递以下可见上游上下文:
worker_dispatch_authorization: authorized
authorization_source: current-user-explicit-spec-lfg
authorization_scope: one delegated read-only independent code review传递步骤 1 的 plan path,使 spec-code-review 能核对 requirements completeness。mode:agent 返回单一 JSON object,而非 Markdown Actionable Findings summary。解析其中的 status、actionable_findings、findings、artifact_path、run_id 与 coverage.dispatch_reason_code。
GATE: 只有 status: complete、coverage.dispatch_reason_code 为 null,且实际 reviewer 不只是 inline-fallback 时才能继续。JSON 损坏或缺失,以及 failed、degraded、skipped 或其他不完整结果都表示独立审查不可用;保留其有界 findings,并在步骤 5、browser verification、lifecycle、commit、push、PR、tracker 或 CI 副作用前停止。
mode:agent is report-only by design — it surfaces findings but never edits the tree; LFG applies the eligible ones in step 5. When narrating progress to the user, frame this as "review found X → applied X in step 5," not as "code review did not auto-fix." A report-only review followed by an LFG-applied fix is the intended contract, not a gap.
Apply review fixes locally (REQUIRED after step 4)
Load references/review-followup.md and execute its apply step. Apply eligible
mechanical findings and run their targeted verification, but leave verified
review fixes in the working tree. Do not stage, commit, push, file tracker
items, edit a PR, or perform any other durable or outward shipping side effect
before the browser/cleanup gate in step 6 closes.
Decide browser applicability, then verify when applicable. Decide
browser_applicability: applicable | not_applicable from the settled plan and
actual changed flow, not filename extension alone. A changed user-visible
route, form, navigation, client interaction/state, or an explicit
browser/runtime verification obligation is applicable; docs-only,
library/CLI, or backend-only work without a changed user-visible flow may be
not_applicable. Record the concrete reason either way. For not_applicable,
record an explicit not_applicable browser result and continue without invoking the browser skill or its wrapper.
For applicable, first validate any supplied caller_target_origin. An
invalid caller value is the diagnostic blocker target-origin-invalid; do
not fall back from malformed or repeated caller input. A missing caller value
returns not_run / target-origin-missing before browser invocation and blocks
the applicable flow. With a valid caller value, invoke spec-test-browser
with mode:pipeline target-origin:<origin>. Do not infer an origin from
redirects, page state, ambient listeners, free ports, framework defaults, or
other project files.
The caller owns the project server lifecycle. LFG forwards the exact origin
but does not read local runtime profiles, start or stop a project server, or
inspect project process state. Before the browser test plan is written,
determine whether its expected navigation or interaction has a durable or
external effect. A caller-provided origin is not mutation authorization: when
the current call lacks named authorization for that origin, flow, and effect,
record not_run / browser-mutation-authorization-required, do not write the
blocked step, and do not continue to lifecycle or landing actions.
Consume the browser result item by item: origin provenance, wrapper probe status/execution_readiness/reason_code,
capabilities.exact_origin_confirmed/exact_origin_evidence, conformance_status, repair_scope, next_action, every route/step status, action_process_calls, browser cleanup status/reason_code,
private evidence refs, and limitations. A wrapper, pipeline, applicable
capability, browser cleanup, or result that is not_supported, not_run,
failed, missing, or indeterminate is a diagnostic blocker with its returned
reason code; do not let passed route/step results hide cleanup failure.
GATE: STOP. Before the shipping precondition, require browser verification
to have passed or be explicitly not_applicable with its recorded reason. A
failed, not-run, missing, or indeterminate result blocks lifecycle mutation
and every landing side effect for an applicable flow.
6.5. Final working-tree verification (REQUIRED after all code mutations)
After Simplify, review-fix application, targeted fix checks, and applicable
browser verification have finished, resolve SKILL_DIR from the directory of
this skill's currently loaded SKILL.md and run the bundled
node "$SKILL_DIR/scripts/working-tree-fingerprint.cjs" helper, storing its
complete object as pre_final_verification_fingerprint. The bundled copy is
a byte-identical package-local projection of the canonical spec-work helper
(scripts/working-tree-fingerprint.cjs in the spec-work package); never
locate it through a skills/ source checkout path — target repos only have
the host-projected Skill roots.
Re-invoke spec-work with the exact same
mode:return-to-caller <plan-path-from-step-1> argument. This is an
idempotent final-verification pass: it must not reimplement the feature. It
re-reads the current tree, reruns the plan's complete applicable Verification
Contract, records a fresh verification_run_summary_ref, and returns a
verified_worktree_fingerprint captured after those commands.
GATE: require all of the following before residual, lifecycle, commit, push, PR, or CI actions:
status: complete, the same plan path, all in-scope units/tasks still
accounted for, empty blockers, and every required final verification check
passed or explicitly not applicable;verification_run_summary_ref that is different from
initial_verification_run_summary_ref; an earlier summary cannot prove the
post-fix tree;verified_worktree_fingerprint.fingerprint exactly equals
pre_final_verification_fingerprint.fingerprint;final-verification-stale
and stops the pipeline. final-verification-stale is a stop with a named cause, not a terminal
verdict. Before treating a fingerprint mismatch as tree mutation, confirm
the spec-first managed .gitignore block is present so .spec-first/workflows/
run summaries stay outside the fingerprint — a missing block makes the fresh
verification-run-summary file break equality, and the real cause is setup,
not verification staleness. When the helper itself cannot run, report the
missing runtime asset (repair via spec-first init) instead of estimating a
fingerprint by hand. After the named cause is remediated, re-enter step 6.5
from a fresh pre-capture; never reuse any earlier fingerprint or summary.
This gate owns final local verification freshness. Targeted checks from Simplify or review-fix application are additive and never replace it.
Shipping precondition (steps 7–9). Only after step 6.5 closes, run git remote
once. If it lists no remote (e.g. a sandbox/throwaway checkout that has
git init but no origin), shipping is local-only: make the local commits
called for below, but skip every push, PR create/edit, and CI-watch action in
steps 7–9. A missing remote is a terminal local-only state, not an error: never
retry a push or hunt for a remote. Run steps 7–9 normally when a remote exists.
Autonomous residual handoff (only when step 4 reported one or more actionable downstream-resolver findings not applied in step 5; skip when it reported Actionable findings: none.)
Do not prompt the user. This step embraces the autopilot contract: residuals must become durable before DONE, but the agent never stops to ask.
If tracker_deferral_authorization: authorized, Load references/tracker-defer.md in non-interactive mode and pass the residual actionable findings from step 4/5 (or the run artifact when the summary was truncated). If tracker_deferral_authorization: missing, do not invoke an external tracker sink; record tracker_deferral_authorization_missing and put every residual directly in no_sink so the already-authorized PR-body or local durable fallback owns persistence.
Collect or construct the structured return: { filed: [...], failed: [...], no_sink: [...] }.
Compose a ## Residual Review Findings markdown section from the structured return:
filed: a bullet with severity, file:line, title, and a link to the tracker ticket URL.failed: a bullet with severity, file:line, title, and the failure reason (e.g., Defer failed: gh returned 401 — tracker unavailable).no_sink: a bullet with severity, file:line, and title inlined verbatim so the PR body or fallback file is the durable record.Detect the current branch's open PR without prompting:
gh pr view --json number,url,body,stateIf an open PR exists, update it directly with gh; do not load any confirmation-driven PR update skill. Append or replace the ## Residual Review Findings section in the current PR body, write the new body to an OS temp file, then run:
gh pr edit PR_NUMBER --body-file BODY_FILEIf no open PR exists, create a tracked fallback file at docs/residual-review-findings/<branch-or-head-sha>.md containing the composed section and the source PR-review run context. Stage only that file, commit it with docs(review): record residual review findings, and push the current branch when a remote is configured (per the shipping precondition). If an upstream exists, run git push. If no upstream exists but a remote is configured, resolve a writable remote dynamically: prefer origin when present, otherwise use git remote and choose the first configured remote. Then run git push --set-upstream <remote> HEAD. If there is no remote at all, do not push — the committed fallback file is the durable sink. This is the durable no-PR sink. Do not output DONE until the residual findings are durable: either the existing PR body has been updated, or this fallback file commit has been made (pushed when a remote exists, committed locally when none). A push that fails when a remote exists is a stop-and-report; never retry a push, or block DONE, when no remote exists.
Never block DONE on tracker filing failures once residuals have been durably recorded. A no_sink outcome is success only when the findings are present in the PR body or in the pushed fallback file.
7.5. Complete the source plan lifecycle marker. The spec-work Return-to-Caller envelope never writes status; its candidate already resolves either the direct plan or a validated task pack's source_plan. After simplification, required review, residual handoff, and final verification have closed, use the validated lifecycle shape from step 2. When plan_status_completion_candidate is present, invoke spec-first internal plan-status complete --target-repo <root> --plan <candidate> --json; accept active → completed or the already-completed idempotent result, and block DONE on any other helper result. When the candidate is null with an allowed plan_status_completion_degraded_reason, skip mutation, preserve the verified development result, and surface that degraded boundary in DONE. This marker is not CI, merge, release, or field-outcome proof.
Invoke the spec-commit-push-pr skill with mode:pipeline and pass this visible upstream authority context:
commit_authorization: authorized
landing_authorization: authorized
authorization_source: current-user-explicit-spec-lfg
authorization_scope: pipeline-owned paths and the current branch PRThese facts come from the entry admission above; mode:pipeline only selects unattended execution and never grants authority. If either authority fact is absent or cannot be traced to that explicit request, stop before invoking the helper with commit_authorization_missing or landing_authorization_missing.
This commits any remaining pipeline-owned changes, pushes the branch, and opens a pull request — non-interactively, per the mode token. If it prints a New concepts: trailer after the PR URL, record the concept name(s) for step 10. If step 7 already opened or edited a PR (check with gh pr view --json number,url,state 2>/dev/null), skip PR creation but still commit and push any uncommitted pipeline-owned changes. Per the shipping precondition, when no remote is configured, do NOT invoke spec-commit-push-pr — its commit step pushes unconditionally (git push -u origin HEAD), so a literal invocation would still hit the impossible push. Instead stage only pipeline-owned paths, commit the remaining changes locally, and skip push and PR creation entirely.
Bounded review, CI, head, and base-currency watch (only when an open PR exists)
Load references/pr-watch-loop.md and follow its append-only snapshot, single-writer, active-budget, untrusted-provider-content, event-routing, verification-return, and terminal-state contract. Fetch only structured allowlisted fields and pass minimized facts to scripts/pr-watch-state.cjs; never store or execute PR body, comment, check-log, or provider-message text.
Review events route to spec-resolve-pr-feedback mode:pipeline-return. CI failures route to spec-debug mode:pipeline-return. After any accepted fix, re-enter step 6.5 for fresh final verification and fingerprint equality before committing and pushing the new head. Base movement may use only an explicitly allowed non-rewriting repo-policy update; missing policy or any rebase/force/history rewrite need terminates as branch-currency-update-required.
Continue until one bounded terminal: looks-ready, manual-blocker, budget-exhausted, local-only, or externally closed/merged. looks-ready is advisory and never merge authority. For any non-ready terminal, write a sanitized durable PR-body handoff containing only ids, URLs, short agent-authored summaries, reason codes, and limitations; do not paste untrusted raw provider content.
Offer an optional next-work handoff, then finish.
After the current pipeline reaches its terminal state, inspect the canonical
plan retained from step 1 for a Product Contract section that clearly names
this plan's area, future separately planned areas, and their relationships.
Load references/next-work-handoff.md only when that semantic signal exists;
the reference owns eligibility, candidate selection, and the opt-in offer.
Do not infer future work from ordinary non-goals or residual delivery tasks,
and do not invoke spec-handoff before the user explicitly accepts the
offer in a later turn.
If step 8 recorded a New concepts: trailer, first echo one line per concept: New concept introduced: <name> — run spec-explain <name> to go deeper. Then make any eligible non-blocking next-work offer and output <promise>DONE</promise>.
Start with step 1 now. Remember: plan FIRST, then work. Never skip the plan.
© leo-kuang-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 20 other files (scripts, references) in skills/spec-lfg of leo-kuang-ai/spec-first.
Open the folder on GitHubat commit 74655dc
Spec Lfg next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Spec Lfg this skillleo-kuang-ai/spec-first | 107 | — | ~6.1k | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 297k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| PR Babysitteropeninterpreter/openinterpreter | 69k | 3 repos | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Check PRonyx-dot-app/onyx | 32k | 2 repos | ~2.3k | Automated safety check: Pass | MIT | |
| PR Design DocOpenHands/OpenHands | 91k | — | ~2.4k | Automated safety check: Pass | MIT | |
| WooCommerce Code Reviewwoocommerce/woocommerce | 11k | 3 repos | ~1.1k | Automated safety check: Pass | Custom licence |
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
openinterpreter/openinterpreter
Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.
onyx-dot-app/onyx
Checks a GitHub, GitLab, or Perforce (p4) pull request (or merge request, or shelved changelist) for unresolved review comments, failing status checks, and incomplete PR descriptions.
OpenHands/OpenHands
For a non-trivial pull request, write a self-contained HTML design doc under the temporary .pr/ directory and link a visibility-appropriate preview in the PR description, so maintainers grasp the…
woocommerce/woocommerce
Reviews WooCommerce code changes against the project's standards, flagging backend PHP architecture, naming, documentation, data integrity and testing violations.
payloadcms/payload
A skill your agent uses when a Payload pull request needs a concise visual walkthrough for reviewers.
leo-kuang-ai/spec-first
Audit mobile App PRD/Figma/local-source consistency across page routes, KMP/Clean Architecture, components, analytics, i18n, engineering quality, and industry lenses before runtime validation; use…
leo-kuang-ai/spec-first
Create a durable cross-session handoff or resume from a user-selected continuity source.
leo-kuang-ai/spec-first
Give a decisive, project-grounded verdict on an external input — judged against the current project, not in the abstract.
leo-kuang-ai/spec-first
Resolve PR review feedback by evaluating validity and fixing issues with conflict-aware resolver dispatch.
leo-kuang-ai/spec-first
Analyze explicit Riffrec product-feedback captures, including riffrec-.zip, the Riffrec session.json + events.json + recording.webm + voice.webm bundle, or media/notes the user identifies as a…
leo-kuang-ai/spec-first
Document a recently solved problem or durable project vocabulary in docs/solutions/ or CONCEPTS.md.
Categories
Run the full hands-off engineering pipeline from planning through a green PR. Spec Lfg is an agent skill from leo-kuang-ai/spec-first. Run the full hands-off engineering pipeline from planning through a green PR.
Spec Lfg fits situations like: tasks that involve Pull requests.
Run `npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a claude-code`. Or copy the skill folder (skills/spec-lfg in leo-kuang-ai/spec-first) into .claude/skills/spec-lfg in your project. Claude Code loads it when a task matches its description.
Run `npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a codex`. Or copy the skill folder (skills/spec-lfg in leo-kuang-ai/spec-first) into .agents/skills/spec-lfg in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add leo-kuang-ai/spec-first --skill spec-lfg -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spec-lfg, .gemini/skills/spec-lfg, .github/skills/spec-lfg and .opencode/skills/spec-lfg in your project.
Going by SKILL.md and its folder, Spec Lfg needs a shell and JavaScript for the scripts in its folder and the command-line tools its instructions call (git, node and gh). Our summary lists: Node.js; A Bash shell.
SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Spec Lfg is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 6.1k tokens (SKILL.md is roughly 24k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.7k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Spec Lfg: Finishing a Development Branch (obra/superpowers, 297k stars), PR Babysitter (openinterpreter/openinterpreter, 69k stars), Check PR (onyx-dot-app/onyx, 32k stars) and PR Design Doc (OpenHands/OpenHands, 91k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
leo-kuang-ai (a GitHub user) maintains it in leo-kuang-ai/spec-first, which has 107 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 8, 2026.
Source: leo-kuang-ai/spec-first on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.