Skip to content

/contract-builder

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.

From plugin
spec-superflow
8849 skills3 commands1 hook

Claude Code

$ npx -y skills add MageByte-Zero/spec-superflow --skill contract-builder --agent claude-code

SKILL.md

contract-builder.SKILL.md
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

Bundled runtime

Before executing a CLI line below, replace its leading `SSF` with `node "<plugin-root>/scripts/spec-superflow.mjs"`; `<plugin-root>` is the absolute directory two levels above this file. Never run `SSF` literally or call an `ssf` from `PATH`.

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.
Read more
@magebyte-zero
Ships withspec-superflow

源码级融合 OpenSpec 规划引擎 + Superpowers 执行纪律的 AI 编程工作流插件。17 平台支持,9 skills,Spec-first,契约驱动。

Stars on GitHub

Momentum

stars in total
884
Star history of MageByte-Zero/spec-superflow on GitHub, a chart by star-history.com

Other skills on spec-superflow.

build-executor
Auto-invoked

build-executor

Execute an active direct request or approved planned change. Native continuous implementation is the default; existing legacy…

code-reviewer
Auto-invoked

code-reviewer

Review completed implementation batches for spec compliance and code quality. Invoke after execution batches complete, before…

need-explorer
Auto-invoked

need-explorer

Clarify intent, scope, constraints, and success criteria before artifact creation. Invoke when the request is fuzzy, the user is…

spec-merger
Auto-invoked

spec-merger

Sync delta specs to main specs before closure. Invoke while an executing change has delta specs to merge into the main spec base,…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about contract-builder.

Which coding agents can use contract-builder?
contract-builder installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.