AGENT SKILL

finalize

End-of-task quality gate — typecheck → lint → format → tests. Runs in order, once. Stops on first failure and fixes before continuing.

License 许可
MIT
最近更新
2026-11-03
Stars
★ 2
Forks
0

01 前言 Front Matter

name
finalize
description
End-of-task quality gate — typecheck → lint → format → tests. Runs in order, once. Stops on first failure and fixes before continuing.
when_to_use
Run after all implementation is complete. Called automatically by /workflow, or standalone. Check AGENTS.md for the project's actual commands. Not for auditing whether requirements and plan steps are complete (preflight, first); not for running the change and watching it work (live-verification, after).
argument-hint
[package or path to scope — optional]

02 资源文件 3

03 SKILL.md 正文

/finalize

One quality gate at the end. Typecheck → lint → format → test. In that order. Once.

Usage

/finalize              # full repo
/finalize apps/web     # scoped to package or path

Before Running

Check AGENTS.md for the project's finalize commands. If AGENTS.md defines a finalize script or step sequence, use that. Otherwise fall back to reading package.json scripts and infer the right commands. If no .condux/plans/*<slug>*.md exists for the inferred feature slug, note it in the output below — don't block. This is informational only, surfacing when a task ran without going through /workflow or /draft-plan, not a gate.

How It Works

┌──────────────────────────────────────────────────────────────────┐
│                         FINALIZE                                │
├──────────────────────────────────────────────────────────────────┤
│  Step 1: TYPECHECK                                              │
│  Run: typecheck script from AGENTS.md or package.json          │
│  → Failure: fix type errors, re-run typecheck only             │
│  → Clean: proceed to Step 2                                     │
│                                                                  │
│  Step 2: LINT                                                   │
│  Run: lint script from AGENTS.md or package.json               │
│  → Errors: fix, re-run lint only to confirm                    │
│  → Warnings: note them, do not block                           │
│  → Clean: proceed to Step 3                                     │
│                                                                  │
│  Step 3: FORMAT                                                 │
│  Run: format check, then auto-fix if dirty                     │
│  → Report which files were changed                             │
│  → Continue to Step 4 regardless (format is auto-fixed)        │
│                                                                  │
│  Step 4: TEST                                                   │
│  Run: test script from AGENTS.md or package.json               │
│  → Failure: diagnose, make one targeted fix, re-run            │
│    failing tests only (not full suite)                         │
│  → Still failing: stop, report, do not loop                    │
│  → Clean: done                                                  │
└──────────────────────────────────────────────────────────────────┘

Failure Handling

Typecheck fails
  → Read the error carefully
  → Fix the type issue
  → Re-run typecheck only — do not proceed until clean

Lint fails (errors, not warnings)
  → Fix flagged issues (auto-fix with --fix if safe)
  → Re-run lint only to confirm clean
  → Do not proceed to tests until clean

Format is dirty
  → Run format --write
  → Note changed files in output
  → Continue — format never blocks

Tests fail
  → Read failure output carefully
  → Make one targeted fix
  → Re-run the failing test(s) only
  → If still failing: STOP and report — do not loop

Output Format

The Plan line below only appears when no matching plan doc was found for the inferred feature slug — it's omitted entirely otherwise. In a mobile app project a Native line joins Env (see Companion Files); the example below is a web project, so it has none.

## Finalize: [task or feature name]

Typecheck  ✓ clean
Lint       ✓ clean  (2 warnings — not blocking)
Format     ✓ 2 files auto-fixed (Button.tsx, invoice.router.ts)
Tests      ✓ 18 passed, 0 failed
Env        ✓ 1 new var → .env.example updated (STRIPE_WEBHOOK_SECRET)
Plan       (none found for this task — treating as standalone scope)

Ready to commit.

On failure:

## Finalize: [task or feature name]

Typecheck  ✗ FAILED
  apps/web/src/components/InvoiceTable.tsx:42
  Property 'onExport' does not exist on type 'InvoiceTableProps'
  Fix: added onExport?: () => void to InvoiceTableProps
  Re-run: ✓ clean

Lint       ✓ clean
Format     ✓ clean
Tests      ✓ 18 passed

Companion Files

One cheap scan of the diff, reported alongside the gate. It never blocks — it exists because a new env var that never reaches the example file is invisible until it breaks someone else's checkout.

  • A new env var anywhere in the diff (process.env.X, import.meta.env.X, a new key in an env schema, a new docker-compose/CI variable) ⇒ the project's example file (.env.example, .env.sample, or whatever it uses) gains the same key in the same change — placeholder value only, never a real secret.
  • Report Env ✓ n/a when the diff adds none, so the check is visibly running.
  • Native (mobile app projects only). None of the gates above compiles the native layer, so a diff that touches it passes everything and still is not in the app until it is rebuilt and reinstalled. Classify the diff as JS only or native rebuild and report it as a Native line; on a native rebuild, end "Ready to commit — native rebuild needed before it can run" and name the project's rebuild command. The path list, the fingerprint check and when to omit the line are in references/native-change.md.

What Does NOT Happen

✗ Running tests mid-implementation
✗ Running lint/typecheck after individual file edits
✗ Looping on test failures — one fix attempt, then stop and report
✗ Blocking on lint warnings (errors only)
✗ Running the full test suite multiple times
✗ Skipping steps because "the change was small"

See Also

  • references/rationalization-table.md — common rationalizations for skipping finalize and why they're wrong
  • references/native-change.md — mobile apps: when a diff needs a native rebuild, the fingerprint check, the Native line

04 同仓库更多 Skills

jabworks
jabworks/agentic-toolkit

orphan

暂无简介

★ 2
jabworks
jabworks/agentic-toolkit

no-blurb

暂无简介

★ 2
jabworks
jabworks/agentic-toolkit

workflow

Routes any dev task into the right execution tier (Small/Medium/Large) and carries condux's operating rules — proportional effort, lazy skill loading, soft gates, implement-yourself-by-default.

★ 2
jabworks
jabworks/agentic-toolkit

usage-trace

Checks and manages durable, local usage capture — ingest, health status, and the opt-in limit snapshot — for Claude Code and Codex. Capture itself runs automatically at session start.

★ 2
jabworks
jabworks/agentic-toolkit

toolkit-skill-standards

Use when writing or reviewing a SKILL.md for jabworks/agentic-toolkit — frontmatter budgets, the trigger contract ("Use when…" description or when_to_use field), progressive disclosure into references/, and keeping a new description out of existing skills' trigger space. Triggers include "review this skill description", "write the frontmatter", "does this collide with an existing skill", "where should this content live". Not for scaffold/sync mechanics; use toolkit-foundry.

★ 2
jabworks
jabworks/agentic-toolkit

toolkit-research-frontier

Use when planning improvement work on jabworks/agentic-toolkit itself — open problems (trigger-collision automation, YAML-strict frontmatter checks, docs-catalog enforcement), existing assets, the next three concrete steps, and the four-front library-health campaign with commands and success criteria. Triggers include "let's improve our toolkit", "let's improve this repo", "what should we improve next", "toolkit roadmap", "open problems", "run the health campaign".

★ 2