Agent SkillsMageByte-Zero/spec-superflow › contract-builder

contract-builder

GitHub

将已批准的规划工件转换为执行契约。在用户要求开始构建、从规划转向实施或执行契约缺失/过时时触发。该技能负责整合提案、规范、设计和任务,生成统一的执行协议,并强制通过DP-3审批门禁以确保实施合规性。

skills/contract-builder/SKILL.md MageByte-Zero/spec-superflow

Trigger Scenarios

用户希望开始构建项目 请求从规划阶段转入实施阶段 execution-contract.md 文件缺失或已过时

Install

npx skills add MageByte-Zero/spec-superflow --skill contract-builder -g -y
More Options

Use without installing

npx skills use MageByte-Zero/spec-superflow@contract-builder

指定 Agent (Claude Code)

npx skills add MageByte-Zero/spec-superflow --skill contract-builder -a claude-code -g -y

安装 repo 全部 skill

npx skills add MageByte-Zero/spec-superflow --all -g -y

预览 repo 内 skill

npx skills add MageByte-Zero/spec-superflow --list

SKILL.md

Frontmatter
{
    "name": "contract-builder",
    "description": "Convert approved planning artifacts into an execution contract. Invoke when the user wants to start building, asks to move from planning to implementation, or when execution-contract.md is missing or stale."
}

Contract Builder

Converts planning artifacts into a single execution handshake: execution-contract.md. Load the baseline with npx --yes --package spec-superflow@0.12.1 ssf runtime asset read templates/execution-contract.md.

Read before generating: .spec-superflow.yaml (especially dp_0_decisions), proposal.md, specs/, design.md, tasks.md, then load docs/artifact-contract.md with npx --yes --package spec-superflow@0.12.1 ssf runtime asset read docs/artifact-contract.md.

Artifact Language

Read artifact_language=<concrete-language> from dp_0_decisions. Generate execution-contract.md in the same language as that resolved value and the approved planning artifacts. Preserve required schema keywords and code identifiers verbatim; language consistency applies to explanatory prose and headings. If the concrete artifact language is missing or still auto, route back to workflow-start before writing the contract instead of guessing or silently defaulting to English.

Artifact Mapping

Source Extract
proposal.md## Why + ## What Changes Intent Lock (problem + scope)
proposal.md## Scope > ### Out of Scope Scope Fence
specs/ → each ### Requirement: Approved Requirements, Scenarios, Test Obligations
design.md## Decisions Architecture, Interface, Dependency Constraints
tasks.md → numbered task groups Execution Batches, Completion Definitions, Review Timing

Cross-Check: Requirement Coverage

Before finalizing:

  1. List every SHALL/MUST from specs/
  2. Verify each is reflected in Approved Behavior, has a test obligation, and appears in at least one batch
  3. Flag unmapped requirements in Escalation Rules
  4. Note cross-batch dependencies

Contract Structure

Must make obvious: approved behavior, out-of-scope, constraints, batches, test obligations, review gates, and conditions that force a rewind to planning. Prefer compression over repeating planning details.

Approval Model (DP-3)

After drafting: summarize handoff rules, identify ambiguity, flag unmapped requirements, ask user to approve explicitly. After approval:

npx --yes --package spec-superflow@0.12.1 ssf state set <change-dir> dp_3_result "approved: <summary>"
npx --yes --package spec-superflow@0.12.1 ssf state set <change-dir> dp_3_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)

DP-3 is a hard gate — no implementation without this record.

Stale Contract Detection

Refresh if: scope changed in proposal, requirements changed in specs, constraints changed in design, batches changed materially in tasks, or the contract no longer matches intent.

Hotfix Mode

Generate a minimal contract only for a legacy Hotfix: Intent Lock (one sentence), Task List (numbered), Approval Gate (DP-3). Skip Scope Fence, Build Rules, Review Gates, Test Evidence. Still requires DP-3 approval. Quick direct execution and direct incident Hotfix do not invoke this skill; they use the signed receipt and finish with test_result: pass instead.

Guardrails

  • Do not continue to implementation if ambiguity remains
  • Do not approve the contract on the user's behalf
  • Do not skip the contract because planning docs look complete
  • Flag unmapped requirements; do not silently drop them

Post-Generation

Run npx --yes --package spec-superflow@0.12.1 ssf state init <change-dir> to create .spec-superflow.yaml with hashes.

For a legacy Hotfix, after writing the minimal contract, run npx --yes --package spec-superflow@0.12.1 ssf state init <change-dir> or npx --yes --package spec-superflow@0.12.1 ssf state rebuild <change-dir> so contract_hash is recorded. DP-3 remains mandatory before build.

Exception Handling

  • Parse failures: Report specific file and section. Suggest re-running spec-writer.
  • Missing files: List every missing artifact. Route back to spec-writer.
  • User interruption: Re-read all artifacts on resume; check contract staleness via content comparison.
  • Validation failure: Flag unmapped requirements in Escalation Rules and approval summary.

Version History

  • 1970fe7 Current 2026-07-30 20:20

Same Skill Collection

skills/bug-investigator/SKILL.md
skills/build-executor/SKILL.md
skills/code-reviewer/SKILL.md
skills/need-explorer/SKILL.md
skills/release-archivist/SKILL.md
skills/spec-merger/SKILL.md
skills/spec-writer/SKILL.md
skills/workflow-start/SKILL.md

Metadata

Files
0
Version
1970fe7
Hash
968d529c
Indexed
2026-07-30 20:20

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-31 08:17
浙ICP备14020137号-1 $방문자$