Contract
Repository audit chains may use code-review as the producer and hand its RepositoryAuditArtifact to diagnosing-bugs, testing, project-viability, architecture review, or a specialist audit. Verify the artifact schema and preserve finding classification at every edge.
- Input: an ordered skill chain with declared edges and a budget.
- Output: a
SkillChainReport with per-edge evidence, artifacts produced, and budget spent.
- Scope: the chain runs only the declared skills in the declared order. An edge that fails its compatibility check stops the chain before execution.
- Rule: every handoff is an artifact handoff (see
artifact-handoff). A skill that "just knows" what the previous skill produced is a broken edge.
Procedure
- Declare the chain. List the skills in order and, for each edge, the artifact the producer emits and the input the consumer declares. Use
analyze-artifacts to check spec/plan/ticket agreement across the chain.
- Verify edges. Before running, check each edge: the producer's declared
outputs satisfy the consumer's declared inputs. An incompatible edge is a design error, not a runtime error.
- Budget. Declare the chain budget (iterations, wall time, cost) and track it per edge (see
loop-budget).
- Execute. Run each skill in order, persisting each artifact with provenance. After each skill, record the edge evidence in the report.
- Close. Emit the
SkillChainReport with the final artifact, the budget spent, and the next consumer.
Provenance
| Question |
Answer |
| What is the source of truth? |
The declared chain, the per-edge artifact contracts, and the chain budget |
| What is in scope? |
Declare, verify edges, budget, execute in order, close with evidence |
| What is explicitly out of scope? |
Running undeclared skills, reordering edges, or spending past the budget |
| Who or what consumes this artifact afterward? |
The next skill in the workflow or the user receiving the final artifact |
| What evidence proves it is done? |
SkillChainReport with per-edge compatibility evidence and budget spent |
| What risk remains? |
An implicit edge that "just knows" the previous output without a contract |
Artifact
SkillChainReport with status, chain, edges, artifacts, budgetSpent, nextConsumer, and riskRemaining.
Reference
- The canonical prompt for this skill is versioned at
.agents/skills/prompts/skill-composition/v1.md (prompt version 1.0).
- Governing skills: see the dependencies in the frontmatter for the skills this one composes with.
Every execution is traced via record-execution.mjs. The trace includes traceId, spanId, model tier, duration, tool calls, and quality score.
Rationale
Skills chained by assumption drift: each step reinterprets the previous output until the workflow silently diverges. Declared producer-consumer edges with per-edge artifact compatibility checks turn a fragile sequence into a verifiable chain.
Completion
- Every edge passed its compatibility check before execution.
- Every artifact carries provenance and satisfies its consumer's declared inputs.
- The chain stayed inside its declared budget, or stopped with
budget-exceeded.
- No approval is required for composition itself: it only coordinates declared skills inside their own budgets, and each skill's own approval gates still apply.
Failure modes
- Implicit edges: skills chained by assumption rather than by declared artifact contracts.
- Budget drift: the chain budget is spent on early edges and the final skill runs degraded; check the budget at every edge.
- Cycle: a chain that routes back to an earlier skill; the dependency graph (
skill-dependency-graph) must stay a DAG.
@include .agents/skills/platform/contract-base.xml
1---2name: "skill-composition"3category: "foundation"4maturity: "experimental"5version: "1"6description: "Compose skills into chains and workflows with explicit contracts: declare the producer-consumer edges between skills, verify artifact compatibility at each edge, and keep the chain inside a declared budget."7license: "MIT"8capabilities:9 - verify artifact compatibility at each edge before execution10 - run a chain inside a declared iteration and cost budget11 - report per-edge handoff evidence for the chain12 - trace skill composition decisions across inputs, constraints, and failure paths13 - validate foundation outcomes with evidence, assumptions, and explicit next steps14inputs:15 - an ordered set of skills forming a workflow16 - the artifact contract at each edge (producer outputs, consumer inputs)17 - the declared budget for the whole chain18outputs:19 - type: object20 name: SkillChainReport21 properties:22 status: { type: string, enum: [completed, blocked, budget-exceeded, partial] }23 chain: { type: "array", items: { type: "string" } }24 edges: { type: "array", items: { type: "object" } }25 artifacts: { type: "array", items: { type: "string" } }26 budgetSpent: { type: "object" }27 nextConsumer: { type: "string" }28 riskRemaining: { type: "string" }29 required: [status, chain, nextConsumer]30sideEffects:31 - orchestration32dependencies:33 - artifact-handoff34 - loop-budget35 - analyze-artifacts36 - work-item-router37stopCondition: "Every edge in the chain passed its artifact compatibility check and the chain stayed inside its declared budget."38risk: "medium"39trustTier: "3"40maxIterations: "10"41promptVersion: "1.0"42artifactType: "skill-chain-report"43modelTier: "reasoning"44evaluators: ["behavioral", "regression"]45fixturesPath: .agents/skills/platform/fixtures/behavioral/skill-composition.json46diataxis: "how-to"47tags: ["composition", "workflows", "handoff", "orchestration"]48compatibility: []49approvalRequired: "false"50approvalFor: []51metadata:52 source: https://skillmd.com/skills/quantumquirkxyz/skill-composition53---5455## Contract5657Repository audit chains may use `code-review` as the producer and hand its `RepositoryAuditArtifact` to `diagnosing-bugs`, `testing`, `project-viability`, architecture review, or a specialist audit. Verify the artifact schema and preserve finding classification at every edge.5859- Input: an ordered skill chain with declared edges and a budget.60- Output: a `SkillChainReport` with per-edge evidence, artifacts produced, and budget spent.61- Scope: the chain runs only the declared skills in the declared order. An edge that fails its compatibility check stops the chain before execution.62- Rule: every handoff is an artifact handoff (see `artifact-handoff`). A skill that "just knows" what the previous skill produced is a broken edge.6364## Procedure65661. **Declare the chain.** List the skills in order and, for each edge, the artifact the producer emits and the input the consumer declares. Use `analyze-artifacts` to check spec/plan/ticket agreement across the chain.672. **Verify edges.** Before running, check each edge: the producer's declared `outputs` satisfy the consumer's declared `inputs`. An incompatible edge is a design error, not a runtime error.683. **Budget.** Declare the chain budget (iterations, wall time, cost) and track it per edge (see `loop-budget`).694. **Execute.** Run each skill in order, persisting each artifact with provenance. After each skill, record the edge evidence in the report.705. **Close.** Emit the `SkillChainReport` with the final artifact, the budget spent, and the next consumer.7172## Provenance7374| Question | Answer |75|---|---|76| What is the source of truth? | The declared chain, the per-edge artifact contracts, and the chain budget |77| What is in scope? | Declare, verify edges, budget, execute in order, close with evidence |78| What is explicitly out of scope? | Running undeclared skills, reordering edges, or spending past the budget |79| Who or what consumes this artifact afterward? | The next skill in the workflow or the user receiving the final artifact |80| What evidence proves it is done? | SkillChainReport with per-edge compatibility evidence and budget spent |81| What risk remains? | An implicit edge that "just knows" the previous output without a contract |8283## Artifact8485`SkillChainReport` with `status`, `chain`, `edges`, `artifacts`, `budgetSpent`, `nextConsumer`, and `riskRemaining`.8687## Reference8889- The canonical prompt for this skill is versioned at `.agents/skills/prompts/skill-composition/v1.md` (prompt version 1.0).90- Governing skills: see the dependencies in the frontmatter for the skills this one composes with.9192Every execution is traced via `record-execution.mjs`. The trace includes traceId, spanId, model tier, duration, tool calls, and quality score.9394## Rationale9596Skills chained by assumption drift: each step reinterprets the previous output until the workflow silently diverges. Declared producer-consumer edges with per-edge artifact compatibility checks turn a fragile sequence into a verifiable chain.9798## Completion99100- Every edge passed its compatibility check before execution.101- Every artifact carries provenance and satisfies its consumer's declared inputs.102- The chain stayed inside its declared budget, or stopped with `budget-exceeded`.103- No approval is required for composition itself: it only coordinates declared skills inside their own budgets, and each skill's own approval gates still apply.104105## Failure modes106107- Implicit edges: skills chained by assumption rather than by declared artifact contracts.108- Budget drift: the chain budget is spent on early edges and the final skill runs degraded; check the budget at every edge.109- Cycle: a chain that routes back to an earlier skill; the dependency graph (`skill-dependency-graph`) must stay a DAG.110111---112@include .agents/skills/platform/contract-base.xml