askit-build-chain-contract
Creates and improves a plugin's chain contract (agents/_chain-permitted.yaml) to the Advanced Skill Library Standard. Use when a skill or subagent invokes another component and you need to declare the permitted inter-component invocations, or to resolve S4 orphan or phantom findings.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- askit-build-chain-contract
- metadata
- { "tier": "universal", "version": "0.1.0", "audience": "advanced" }
- description
- Creates and improves a plugin's chain contract (agents/_chain-permitted.yaml) to the Advanced Skill Library Standard. Use when a skill or subagent invokes another component and you need to declare the permitted inter-component invocations, or to resolve S4 orphan or phantom findings.
02 资源文件 3
- 参考文档examples/golden-1-two-edge-contract.md6.6 KB
- 参考文档README.md660 B
- 参考文档references/authoring-chain-contracts.md3.4 KB
03 SKILL.md 正文
askit-build-chain-contract
Purpose
Author a plugin's chain contract: the explicit declaration of which components may invoke which others (Standard sec 3.6). A chain contract is a CONDITIONAL MUST - required if and only if a component invokes another, so a plugin with no inter-component invocation ships no contract (no empty governance files). Two modes: create authors agents/_chain-permitted.yaml (and the optional agents/_pairing.yaml); improve resolves S4 findings. Authoring depth is in references/authoring-chain-contracts.md. Follows the shared builder contract (../../docs/reference/builder-pattern.md).
When to use
When a skill or subagent declares a chain: to another component and you need to permit it, or when evaluate reports an S4 orphan (an invocation not permitted) or phantom (a contract entry naming a missing component).
create mode
- Scan components for
chain:declarations (which caller invokes which callees). Skip the contract entirely if nothing chains (the conditional MUST). - Author
agents/_chain-permitted.yaml: one entry per caller, listing the components it may invoke. Copytemplates/chain-permitted.yamlif none exists. - Optionally author
agents/_pairing.yamlfor recommended (not required) skill plus subagent pairings. - Evaluate (
node scripts/evaluate.mjs . --json) until S4 is clean: everychain:invocation is permitted (no orphan) and every contract entry names an on-disk component (no phantom).
improve mode
- Run
node scripts/evaluate.mjs . --jsonand read the S4 findings. - For an orphan, add the missing
caller: [callee]permission. For a phantom, fix the misspelled name, remove the stale entry, or create the missing component. - Re-run to confirm S4 is clean.
Scope
The contract is agent-agnostic: one agents/_chain-permitted.yaml (no per-target form). It binds exactly when there is an invocation to make safe (sec 3.6), so it is a safety mechanism, not ceremony. S4 (chain-contract integrity) flags orphans and phantoms; do not ship an empty contract for a plugin that does not chain.
04 同仓库更多 Skills
fx-demo
A fixture skill that exists so the re-derived manifest has a component list to compare. Use only from tests/unit/self-consistency.test.mjs.
fx-demo
A fixture skill that exists so the re-derived manifest has a component list to compare. Use only from tests/unit/self-consistency.test.mjs.
fx-demo
A fixture skill that exists so the re-derived manifest has a component list to compare. Use only from tests/unit/self-consistency.test.mjs.
sf-caller
Calls the worker subagent to do a thing. Use when delegating work to sf-worker.
sf-do-thing
Converts CSV input into a formatted summary. Use when the user asks to summarize or tabulate spreadsheet data.
root-skill-plugin
Summarizes a changelog section into one release-note sentence. Use when the user asks to condense a list of changelog bullets into a single announcement line.