ワンクリックで
spec-kitty-tasks-finalize
Validate dependencies, finalize WP metadata, and commit all task artifacts.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Validate dependencies, finalize WP metadata, and commit all task artifacts.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Validate an approved mission before merge
Cross-artifact consistency and quality analysis
Interview and compile a project charter
Open the mission dashboard
Execute a work package implementation
Merge an accepted mission
| name | spec-kitty.tasks-finalize |
| description | Validate dependencies, finalize WP metadata, and commit all task artifacts. |
| user-invocable | true |
Run this at most once per active agent session before the first Spec Kitty command workflow.
If you already ran spec-kitty upgrade --agent-check --json in this session, reuse that result and skip this block.
Do not run or announce an upgrade check again for later Spec Kitty commands in the same session.
Otherwise, before continuing, run:
spec-kitty upgrade --agent-check --json
If JSON action is none, continue.
If action is auto_upgrade, run upgrade_command before continuing. If it fails, tell the user and continue with the current Spec Kitty version.
If action is guidance, show upgrade_note briefly, then continue.
If action is prompt, ask the user with the host-native question UI when available:
Spec Kitty {latest_version} is available. You are on {installed_version}. Upgrade now?
Use these choices:
upgrade_now, run upgrade_command, then continue.always, run upgrade_command, then continue.not_now, then continue.never_ask, then continue.Record the selected choice before continuing:
spec-kitty upgrade --agent-choice <upgrade_now|always|not_now|never_ask> --agent-latest <latest_version> --json
If no host-native question UI is available, present the same four choices in plain text and wait for the user.
In non-interactive hosts, choose not_now and continue.
Version: 3.2.0
Run the finalization command to parse dependencies from tasks.md, validate
them, update WP frontmatter, and commit all task artifacts to the target branch.
IMPORTANT: This step works in the planning repository. NO worktrees created.
The content of the user's message that invoked this skill (everything after the skill invocation token, e.g. after /spec-kitty.<command> or $spec-kitty.<command>) is the User Input referenced elsewhere in these instructions.
You MUST consider this user input before proceeding (if not empty).
CRITICAL: Run this preflight command from repo root before any mutating finalization:
spec-kitty agent mission finalize-tasks --validate-only --mission <mission-slug> --json
This command will:
Requirement Refs from tasks.mdIf the JSON output contains "error": "Requirement mapping validation failed",
do not run finalization. Report the blocking fields
(missing_requirement_refs_wps, unknown_requirement_refs, and
unmapped_functional_requirements), then fix mappings with
spec-kitty agent tasks map-requirements --mission <mission-slug> --json or by
updating WP requirement_refs.
If validate-only fails with "error": "Ownership validation failed" and
ownership_errors listing overlapping owned_files:
Ownership collisions are EXPECTED for domain-focused and refactor-oriented missions (cross-cutting strangler work, repo-wide migrations, boundary enforcement) where many work packages legitimately edit the same files. This is not a defect in the slicing. Handle it as follows:
Depends on WPxx) so they
execute sequentially in one lane and share a single worktree (or run
direct-to-branch). Limited parallelism is acceptable and expected for these
missions — do not force artificial parallelism. Note: linearization protects
the worktree from concurrent edits; it does not by itself satisfy
ownership validation (see step 3).scope: codebase-wide in its
frontmatter; the ownership validator exempts codebase-wide WPs from overlap
and authoritative-surface checks. Keep the genuinely-targeted WPs (single test
file, single module) narrow and mutually disjoint.codebase-wide is the ONLY exemption. Two narrow WPs that claim the same
files always fail ownership validation — regardless of whether they sit in
different lanes or are linked in a dependency hierarchy. Dependency/lane
structure never bypasses the overlap check. If WPs legitimately share a
surface, mark the broadly-overlapping one scope: codebase-wide; otherwise
re-slice so the narrow WPs are disjoint.Do not fabricate disjoint owned_files that misrepresent which WP edits
which files solely to pass validation — linearize and/or declare codebase-wide
instead.
Only after validate-only exits successfully, run the mutating finalization command from repo root:
spec-kitty agent mission finalize-tasks --mission <mission-slug> --json
This command will update WP frontmatter, compute lanes, and commit all tasks to the target branch.
The JSON output includes:
"commit_created": true/false — whether a commit was made"commit_hash" — the commit hash if created"wp_count" — number of WP files processed"dependencies_parsed" — dependency relationships found"requirement_refs_parsed" — requirement reference mapping found"ownership_warnings" — soft warnings (glob-pattern zero-match, audit coverage)missing_requirement_refs_wps, unknown_requirement_refs, unmapped_functional_requirements)CRITICAL — Ownership warnings require action before proceeding:
If ownership_warnings is non-empty, or if the command emits ERROR: Ownership
lines to stderr, you MUST act on each issue before starting implementation:
Hard error (ownership_literal_path_errors present, exit 1): A
owned_files entry is a literal file path that does not exist in the
repository. Fix by:
create_intent in the WP frontmatter if the file will
be created by this WP (planned-new-file).Do NOT proceed to implement while any hard error is present.
Soft warning (ownership_warnings non-empty, exit 0): A owned_files
glob pattern matched zero files. This may indicate in-flight work. Verify the
pattern is correct and adjust if needed before starting implementation.
Example create_intent frontmatter for a planned-new-file entry:
owned_files:
- "src/specify_cli/new_module.py"
create_intent:
- "src/specify_cli/new_module.py" # will be created by this WP
IMPORTANT — DO NOT COMMIT AGAIN AFTER THIS COMMAND:
finalize-tasks commits the files automaticallycommit_created=true, files are ALREADY committed — do not run git commit againgit status (templates, config) are UNRELATEDcommit_hash from JSON output, not by running git add/commit againProvide a concise outcome summary:
tasks.md/spec-kitty.analyze or /spec-kitty.implement)After completing this step:
dependencies field in frontmatterrequirement_refs field in frontmatterNext step: spec-kitty next --agent <name> will advance to implementation.