Manage Project Context
Purpose
Provide a script-driven workflow to create, update, and verify the repository's curated context artifacts under docs/context/.
When to use
Use this skill when you need to:
- •add or update an API contract (
openapi.yaml) - •add or update the database schema mapping (
schema.json) - •add or update BPMN process files (
*.bpmn) - •ensure CI can verify that context changes were performed correctly
Do NOT use this skill if:
- •the repository does not include
docs/context/and the Context Awareness add-on is not installed
Inputs
- •Target repository root (the working directory where
.ai/anddocs/live). - •The intended context change:
- •artifact type (
openapi,db-schema,bpmn, etc.) - •artifact path (repo-relative, MUST be under
docs/context/) - •whether the artifact is contract (authoritative) or generated (produced by a command)
- •artifact type (
Outputs
- •Updated/created context artifacts under
docs/context/** - •Updated
docs/context/registry.jsonwith:- •sha256 checksums (
checksumSha256) - •timestamps (
updatedAt,lastUpdated)
- •sha256 checksums (
- •A verification result (pass/fail) from
contextctl verify
Steps
- •
Initialize the context layer (idempotent):
- •
node .ai/scripts/contextctl.js init
- •
- •
If adding a new artifact, register it:
- •
node .ai/scripts/contextctl.js add-artifact --id <id> --type <type> --path <docs/context/...> [--create]
- •
- •
Edit the artifact file (for example
docs/context/api/openapi.yaml). - •
Update registry checksums after edits:
- •
node .ai/scripts/contextctl.js touch
- •
- •
Verify consistency (CI-ready):
- •
node .ai/scripts/contextctl.js verify --strict
- •
Boundaries
- •You MUST NOT edit
docs/context/registry.jsonby hand. - •You MUST keep artifact paths under
docs/context/(no external paths). - •You SHOULD prefer "contract mode" unless you have a reliable generator command and CI support.
- •You MUST NOT store secrets in context artifacts; store only non-secret contracts/mappings.
References
- •
reference.md