refactor(agents): store each contract once, as a preloaded skill #83
No reviewers
Labels
No labels
already-shipped
bug
documentation
duplicate
enhancement
good first issue
help wanted
in progress
invalid
needs-decision
proposal
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: crenshawdev/cadence#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cadence/74-contract-skills"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Each agent's contract now lives in exactly one place, a skill preloaded via the
skills:frontmatter field, instead of being restated in the agent body. Storage change, not a behaviour change.What moved
Six contract skills, one per role rather than per file —
cad-plan-checkerandcad-plan-checker-highshare one, which is what that pair always claimed to be. Five of six moved byte-identical; the seven agent files dropped from 1154-8786 B to 464-592 B and are now frontmatter plus a pointer.The visibility question
Contract skills must not land in the user's
/menu. The answer isuser-invocable: false, which hides a skill from the slash-command menu while leaving it model-invocable — which is whatskills:preloading requires, and whydisable-model-invocation: trueis unusable here. All six carry it; the 23 user-facing skills are untouched. Honest caveat recorded in the issue: the description still appears in the model's skill listing, and there is no documented flag that hides from both and stays preloadable.The self-verify check
A missing or disabled skill is skipped silently, producing an agent running with no contract at all — a failure that reads as an agent ignoring its instructions. Check 6 asserts every
skills:reference resolves, and additionally flags a resolved skill that setsdisable-model-invocation: true(same end state, different cause). The tools lint now also scans preloaded contracts as agent prose; without that this refactor would have silently emptied its input.Verified by breaking a reference on purpose:
{"ok":false,..."missing-agent-skill"...}, clean again on revert.cad-plan-checker-high
The
@-include workaround is retired — no more runtimeReadof another agent file. The file itself stays: it exists to carryeffort: high, which is frozen in frontmatter and named by string inroute-table.json'sescalate_effort_variant. Retiring it depends on #63/#81.One judgement call: the high variant carried real behaviour (stricter on borderline BLOCKER vs WARNING). Shipping behaviour in a rung file is exactly the failure this issue names, so it moved into the shared contract as a
<rung>section and both files now state only which rung they are. That is the single non-verbatim adaptation in the change.Verification
node --test cadence-core/bin/*.test.mjs→ 745 pass, 0 fail (6 new)npx tsc -p tsconfig.ci.json→ exit 0node cadence-core/bin/self-verify.mjs→ok:true, checks now includeagent-skillsAlso repointed
METHOD.md's "Where each rule lives" table and tworeferences/citations at the contract skills; left alone they would have cited two-line stubs.Closes #74