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

contract-builder

GitHub

将现有遗留变更的规划工件(提案、规范、设计等)转换为执行合同,明确范围、需求覆盖及审批流程。仅适用于需要合同的旧版变更,新版变更不触发此技能。

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

Trigger Scenarios

处理需要执行合同的遗留变更 从规划工件生成执行握手文档

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": "Maintain an execution contract only for an existing legacy change that requires one. New direct\/planned changes do not invoke this skill when a contract is absent."
}

Contract Builder

Legacy compatibility only: new planned changes use proposal.md + tasks.md and ssf workflow start --path planned. Do not generate a contract or request a second approval for them. Read the remaining instructions only for an existing legacy change.

Converts planning artifacts into a single execution handshake: execution-contract.md. Load the baseline with 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 ssf runtime asset read docs/artifact-contract.md.

Enter bridging before writing the contract; skip the transition if already there. Honor configured specs/design omissions. Reference requirement IDs and task IDs instead of copying their full text; preserve scope, obligations, tests, and review policy.

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 and flag unmapped requirements. Reuse explicit approval already covering this exact contract; otherwise request it once, together with any still-pending planning decisions and the default Native execution choice. Approval of scope alone does not approve a contract that has not been shown. Never ask the user to approve the same unchanged contract twice. After approval:

ssf state set <change-dir> dp_3_result "approved: <summary>"
ssf state set <change-dir> dp_3_timestamp now
ssf state rebuild <change-dir>

Advance the state after approval:

ssf state transition <change-dir> approved-for-build

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

The approved contract is recorded by state rebuild in the DP-3 sequence above, before the guarded transition. This applies to Full and legacy Hotfix. Do not refresh hashes merely to suppress an unapproved content change.

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

  • 10d5f08 Current 2026-09-22 02:00

    重构v2工作流,简化新变更为直接/计划执行并默认Native模式;修复Codex和Windows工作流不一致问题;新增独立评审提示。

  • 1bf565a 2026-09-02 22:22

    修复状态跟踪与收口流程的系统性缺陷:解决轻量路径卡死、worktree隔离问题、review凭证死锁及finish收尾流程优化。

  • fd8cf86 2026-08-04 19:02
  • 9105098 2026-08-02 21:57

    更新资产读取命令,移除硬编码的包版本号和npx前缀,改为使用ssf runtime asset read指令。

  • 1970fe7 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
10d5f08
Hash
1909a3e4
Indexed
2026-07-30 20:20

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-22 02:36
浙ICP备14020137号-1