required_canon_version: >=3.0.0
Skill: repo-contract-alignment
Version: 0.1.0 Status: Active
Purpose
Align the repository with its stated governance by scanning contract docs, extracting explicit rules, running checks, and implementing the smallest compliant fixes with enforcement.
Trigger
Use when asked to align repo behavior with canon/contract docs, audit governance compliance, or implement minimal fixes plus enforcement for regressions.
Workflow
-
Confirm intent gate
- If the user is asking for analysis or strategy only, stop after Findings/Plan and ask for explicit implementation approval.
- Do not touch CANON or edit existing CONTEXT unless the task is explicitly about rules/governance/memory updates.
-
Ensure cortex is available
- If
CORTEX/_generated/cortex.dbis missing, runpython CORTEX/cortex.build.py. - Use
python CORTEX/query.py --jsonor--findfor file discovery; avoid raw filesystem scans.
- If
-
Identify contract docs
- From the cortex index, collect docs matching:
README.md,AGENTS.md,CANON/,CONTEXT/decisions/(ADRs),ROADMAP,CONTRIBUTING,SECURITY,CONTEXT/maps/*, and any explicit “contract” docs.
- From the cortex index, collect docs matching:
-
Extract explicit rules
- Read only those contract docs and list their rules.
- Resolve conflicts using the authority gradient; note any conflicts.
-
Run existing checks/tests/build scripts
- Always run
python TOOLS/critic.pyandpython CONTRACTS/runner.py. - Run any additional scripts referenced by contract docs.
- Always run
-
Report issues and minimal fixes
- Produce a prioritized issue list (P0 violations, P1 missing enforcement, P2 hygiene).
- Propose the smallest fixes and enforcement to prevent regressions.
-
Implement and re-check
- Apply the smallest correct changes, add/adjust fixtures if behavior changes, then re-run checks until passing.
- Write artifacts only to allowed roots (
CONTRACTS/_runs/,CORTEX/_generated/,MEMORY/LLM_PACKER/_packs/).
Output format
Always respond with: Findings, Plan, Changes, Commands run, Next.
required_canon_version: >=3.0.0