contextos-contract-sync
Add or evolve ContextOS runtime contracts across TypeScript types, JSON Schemas, canonical examples, documentation, and drift tests. Use for RunContext, ContextPack, CompiledContext, ToolEnvelope, DecisionRecord, ReplayPacket, or delegation changes; not for prose-only edits.
- License 许可
- MIT
- 最近更新
- 2026-10-07
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- contextos-contract-sync
- description
- Add or evolve ContextOS runtime contracts across TypeScript types, JSON Schemas, canonical examples, documentation, and drift tests. Use for RunContext, ContextPack, CompiledContext, ToolEnvelope, DecisionRecord, ReplayPacket, or delegation changes; not for prose-only edits.
02 资源文件 2
- 参考文档agents/openai.yaml237 B
- 参考文档references/surface-map.md4.2 KB
03 SKILL.md 正文
ContextOS Contract Sync
Keep every executable representation of a runtime contract semantically aligned and versioned. Do not treat successful JSON parsing as proof of compatibility.
Inventory the affected surface
Read the repository instructions, then locate:
- TypeScript declaration and every producer/consumer;
- published JSON Schema and its
$defsdependencies; - canonical scenario/compiler or test harness;
- implementation and reference documentation;
- drift, schema-surface, runtime-schema, compiler, and admission tests.
Read references/surface-map.md for the current contract bundle, parity invariants, and test routing. Confirm the active repository still matches that map before editing.
Decide compatibility first
Classify the change:
- Additive: an optional field or compatible enum-free extension that legacy producers/consumers may omit.
- Tightening: stronger validation or newly required behavior; requires migration analysis even if the filename stays the same.
- Breaking: removed/renamed field, changed meaning, narrowed enum accepted by existing producers, or new required field; use a major contract version and explicit migration.
Separate schema compatibility from runtime trust. An additive field may remain optional for old payloads while the canonical producer always emits it; consumers must treat absence as legacy/unknown, never trusted.
Change the contract coherently
- Update the TypeScript semantic type and comments.
- Update deterministic producers and consumers; unsupported values fail closed.
- Update every published schema copy of shared definitions. Preserve draft 2020-12 and canonical
$idconventions. - Update canonical examples from the reference scenario or actual compiler output.
- Update the API schema index and explanatory docs.
- Add or strengthen tests that compare semantic definitions and producer output; do not merely assert wording.
- Remove superseded public schema versions only when the repository's single-authoritative-surface policy and migration plan require it. Never leave ambiguous duplicates.
Check cross-contract invariants
trace_id, tenant, identity, and lineage propagate across request, compiled context, tools, decision, and replay.- delegation scopes and sub-budgets narrow the parent.
ActionRiskhas identical definitions where declared, compiled, and executed.- compiled context admission/evidence-gate definitions remain identical in the DecisionRecord audit surface.
- tool call and result IDs correlate; policy decision and approval references resolve.
- evidence, omissions, controls, hashes, and release pins required for replay survive to the audit record.
- replay consumes recorded transcripts and does not repeat live effects.
Validate
Run targeted schema-surface, runtime-schema, spec-drift, compiler, and context-admission tests as applicable, followed by typecheck and the full test suite. Parse every published schema and inspect the exact public schema file set.
Return a compatibility note, changed-surface matrix, migration implications, test evidence, and any consumer behavior that remains unverified.
04 同仓库更多 Skills
template-skill
Replace with a description of what this skill does and when Claude should use it.
verify-change
Design and execute a risk-based verification strategy for a software change, bug fix, refactor, migration, configuration update, or release candidate. Use when Codex needs to prove that a change works, choose proportional tests, investigate whether validation is sufficient, or report what remains unverified. Trace claims to evidence across static checks, focused tests, integration boundaries, and runtime behavior instead of merely running the entire test suite.
triage-incident
Triage an active or recent software production incident by establishing impact, stabilizing the system, preserving evidence, building a timestamped timeline, coordinating hypotheses, and choosing reversible mitigations. Use when users report an outage, severe degradation, security or data-integrity event, broken deployment, elevated errors, or ask for incident command, status assessment, mitigation, or investigation support. Prioritize user harm reduction over root-cause completeness and require explicit authority for production mutations.
review-change
Review a code change for concrete correctness, security, data-integrity, compatibility, concurrency, and operability regressions by reconstructing intent and checking affected invariants and boundary paths. Use for local diffs, commits, branches, patches, or pull requests when the user wants actionable review findings. Report only defects introduced or exposed by the change with precise evidence; do not modify code unless asked to address findings.
repo-orient
Map an unfamiliar software repository from code and configuration. Use when Codex needs to understand a new codebase, locate entry points or ownership boundaries, explain architecture and runtime flow, identify where a change belongs, or prepare for implementation without yet modifying files. Produce an evidence-backed repository map, not a directory listing or README paraphrase.
refactor-safely
Restructure existing code while preserving externally observable behavior through explicit invariants, characterization evidence, small reversible steps, and continuous verification. Use when the user asks to refactor, simplify, extract, reorganize, modularize, deduplicate, split a component, improve architecture, or pay down technical debt without intentionally changing product behavior. Distinguish refactoring from feature work and stop scope drift from hiding inside structural edits.