codehub-contract-map
Standalone group-only skill. Renders group_contracts into a Markdown +
Mermaid artifact. Fires on direct invocations (“map the contracts”)
without needing the full codehub-document orchestration.
Frontmatter
Section titled “Frontmatter”name: codehub-contract-mapargument-hint: "<group-name> [--output <path>] [--committed]"color: magentamodel: sonnetPreconditions
Section titled “Preconditions”- A
<group-name>positional argument is required. Missing or unknown group:Contract map requires a named group — run 'codehub group list' to see registered groups. - Every member repo must be
freshpermcp__opencodehub__group_status. Stale members abort with named repos.
Process
Section titled “Process”mcp__opencodehub__group_list— confirm<group-name>.mcp__opencodehub__group_status({group})— confirm freshness per member.mcp__opencodehub__group_contracts({group})— the spine.- If zero contracts: write the artifact with a “No inter-repo contracts detected” banner. Don’t error (spec 001 AC-5-5).
mcp__opencodehub__group_query({group, text: "api handlers"})— disambiguate producer-side locations.mcp__opencodehub__route_map({repo})per member — for handler citations.- Build the N×N consumer/producer matrix + Mermaid flow + notable-contracts list.
- Write to the resolved output path.
Output shape
Section titled “Output shape”# <group> · Contract map
## Contracts matrixRows = producers, columns = consumers. Cell = contract count.
| | billing | core | web ||-------|---------|------|-----|| billing | — | 3 | 5 || core | — | — | 12 || web | — | — | — |
## Flow```mermaidflowchart LR web --> billing : 5 web --> core : 12 billing --> core : 3Notable contracts
Section titled “Notable contracts”web:packages/checkout/src/api.ts:22→billing:packages/api/src/handlers/invoice.ts:45- Method:
POST /v1/invoices - Shape:
{amount, userId, idempotencyKey}…
- Method:
<Aside type="note" title="Citation grammar">Every citation in a contract map uses the group-qualified form:`` `<repo>:<path>:<LOC>` ``. Plain `path:LOC` is rejected.</Aside>
## Arguments
| Flag | Meaning ||---|---|| `<group-name>` (required) | The group to map. Must appear in `group_list`. || `--output <path>` | Override output path. || `--committed` | Write to `docs/<group>/contracts.md` instead of `.codehub/groups/<name>/contracts.md`. |
## Related
- [codehub-document](/opencodehub/skills/codehub-document/) — full group-mode docs- [ADR 0007 — Artifact factory](/opencodehub/architecture/adrs/#adr-0007--artifact-factory)- [Skills index](/opencodehub/skills/)