/d3nexus:sync-shared-contractsfrom d3nexus
Audits shared contract deltas (check), generates requirements briefs with snapshot watermarks (brief), and records scope-bound acknowledgements (ack) across Satellite and Hub repositories with dev-lifecycle integration.
Ships in d3nexus. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The sync-shared-contracts skill automates Day-2 continuous synchronization for multi-repository ecosystems initialized with d3nexus:setup-shared-contracts.
While setup-shared-contracts handles Day-0 topology initialization, sync-shared-contracts provides a zero-dependency standard-library Python engine (sync_contracts.py) to continuously audit contract deltas, evaluate target codebase readiness, generate structured Contract Requirements Briefs, and orchestrate target repository feature work through d3nexus:dev-lifecycle.
brief) with a composite snapshot_id to feed into d3nexus:dev-lifecycle.dev-implementation) inside nested git worktrees (.worktrees/<epic_dir>) where relative symlinks must resolve cleanly against the primary checkout root.ack) with snapshot-bound guards, selective RFC scope tracking, and semantic baseline persistence in .agents/contract_sync.json.The CLI engine evaluates synchronization state across three complementary layers:
api_contract.md, architecture_and_flow.md, gaps_and_rfcs.md) and a composite snapshot_id.baseline_snapshot in .agents/contract_sync.json (including dotted payload_fields type mappings such as metrics.execution_time_ms: integer and rfcs metadata) to enable semantic diffing even without Git history or with uncommitted edits.setup-shared-contracts Markdown tables and live narrative contracts (HTML comment metadata Version: X.Y.Z, ### Title (METHOD /path) headings, and bullet pairs * **Method**: ... / * **Path**: ...).gaps_and_rfcs.md into ACTIONABLE_PENDING (OPEN, PROPOSED, DRAFT, IN_REVIEW), ACKNOWLEDGED_ACTIVE (ACCEPTED, APPROVED, IMPLEMENTED), and INACTIVE (SUPERSEDED, REJECTED).1 (UNSUPPORTED_CONTRACT_FORMAT)..git, .worktrees, shared-contracts, .devtool, .agents, and build artifacts)./api/v1/lyrics-sync/tasks/{id}/progress -> static route fragments /api/v1/lyrics-sync/tasks and /progress), authentication headers, and snake_case / camelCase DTO field keys (lease_duration_ms / leaseDurationMs) as FOUND_IN_CODE or MISSING_IN_CODE.In Satellite repositories, shared-contracts is a relative symbolic link pointing to a Hub domain (e.g., ../Hub/shared-contracts/<domain>).
When Stage 3 (dev-implementation) tasks execute inside an isolated worktree at .worktrees/<epic_dir>, directory nesting shifts by two levels. sync_contracts.py automatically detects worktrees via .git metadata and resolves the relative symlink target against the primary repository root without modifying the tracked symlink. Codebase scanning and .agents/contract_sync.json writes remain strictly local to the worktree.
Symlink traversal is bounded to a maximum of 10 hops (MAX_SYMLINK_HOPS = 10) to prevent infinite recursion on circular links.
When bridging contract changes into target codebase implementation, follow this 5-step lifecycle workflow:
flowchart TD
S1["1. Preflight Audit<br/>sync_contracts.py check & brief"]
S2["2. Scope Confirmation<br/>Confirm snapshot_id & --rfc scope"]
S3["3. Inception (Stage 1 & 2)<br/>dev-brainstorming & dev-designer"]
S4["4. Implementation (Stage 3)<br/>Worktree TDD + sync_contracts.py ack"]
S5["5. Finish (Stage 4)<br/>finishing-a-development-branch"]
S1 --> S2 --> S3 --> S4 --> S5
Run sync_contracts.py check and sync_contracts.py brief --domain <domain>.
shared-contracts is missing or dangling, run d3nexus:setup-shared-contracts.IN_SYNC and no MISSING_IN_CODE items remain, report synchronization is complete and stop.Present the generated Contract Requirements Brief to the developer:
snapshot_id.--rfc <ID> ...) or all active RFCs (--all-rfcs).Enter d3nexus:dev-lifecycle using the brief as grounding context:
dev-brainstorming): Draft the English spec without re-opening settled wire contracts.dev-designer):
task_01 as the contract update task. At the end of task_01, run sync_contracts.py brief to record the refreshed snapshot_id. The final Hub task binds ack --snapshot <refreshed_id> to that refreshed snapshot.task_01 as consumer DTO/client update. The tracked symlink shared-contracts remains strictly read-only (never added to Allowed files)..agents/contract_sync.json in Allowed files, executes sync_contracts.py ack --snapshot <id> [--rfc <ID> ... | --all-rfcs], and verifies completion with sync_contracts.py check --strict (global) or sync_contracts.py check --strict --rfc <ID> (scoped).Execute tasks inside an isolated worktree (.worktrees/<epic_dir>) through d3nexus:dev-implementation:
sync_contracts.py ack and confirms strict check passes.quality_check + traceability checks + audit) and present Review Choice.Invoke d3nexus:finishing-a-development-branch to merge the branch and archive epic artifacts.
# Audit contract drift (exits 0 on IN_SYNC or informational, exits 1 on drift with --strict)
python3 sync_contracts.py check [--repo-root <path>] [--domain <name>] [--json] [--strict] [--rfc <ID> ...]
# Generate Contract Requirements Brief
python3 sync_contracts.py brief [--repo-root <path>] [--domain <name>] [--output <path>]
# Acknowledge watermark state and update baseline snapshot atomically
python3 sync_contracts.py ack [--repo-root <path>] [--domain <name>] [--snapshot <id>] [--rfc <ID> ...] [--all-rfcs]
# Verify branch diff against shared contract mappings and waivers
python3 sync_contracts.py diff-check [--repo-root <path>] [--base-ref <ref>] [--domain <name>] [--allow-dirty] [--json]
The diff-check subcommand enforces contract governance during pull requests and Gate 4 quality checks:
.agents/contract_map.json) must be accompanied by:
shared-contracts/<domain>/.ack) in .agents/contract_sync.json matching the live snapshot_id.--repo-root <path>: Path to repository root (defaults to current working directory).--base-ref <ref>: Git reference for merge-base calculation (e.g. main, develop, {base_ref}). If omitted, falls back to the base_ref declared in .agents/contract_map.json.--domain <name>: Optional repeatable filter to verify only specific domains. Passing an unknown domain exits 2 (BLOCKED).--allow-dirty: Permitted only for uncommitted review_tier: "full" Tier C task tests running inside worker slots; audits committed merge_base..HEAD while STILL returning BLOCKED (exit 2) whenever shared-contracts, .agents/contract_map.json, or .agents/contract_sync.json (tracked or untracked) is dirty. Omit --allow-dirty at Gate 4 and release to preserve strict clean-tree enforcement.--json: Emits machine-readable verification summary including per-domain domains proof records and active_waivers.0 (PASS): All mapped file changes are accompanied by contract changes, fresh ack, or valid waivers (or no mapped files changed).1 (FAIL): Unacknowledged mapped file changes, outdated ack, or invalid/stale waivers.2 (BLOCKED): Dirty tracked working tree (or dirty protected contract path under --allow-dirty), missing/invalid .agents/contract_map.json, missing shared-contracts/ directory or symlink, unresolved base ref, git command failure, or unknown --domain filter.git diff --no-ext-diff --no-renames --name-only -z <merge_base>..HEAD to parse exact file paths with NUL delimiters, preserving whitespace and paths requiring C-quoting.git ls-tree at merge-base.shared-contracts is a symlink bound to a single domain. diff-check verifies that contract_map.json only configures that linked domain.merge-base cannot mask new file changes.gap: null or reference a documented GAP-XX in gaps_and_rfcs.md with active/pending status (ACTIONABLE_PENDING)..agents/quality/*-quality.json across all five quality providers (always omitting --allow-dirty so Gate 4 enforces a clean working tree):
["python3", "{skills_dir}/sync-shared-contracts/resources/scripts/sync_contracts.py", "diff-check", "--base-ref", "{base_ref}"]2 to check status BLOCKED for contract_diff, while exit code 0 maps to PASS and 1 maps to FAIL.{
"schema_version": 1,
"base_ref": "develop",
"domains": {
"lyrics-sync": {
"paths": [
"src/models/lyrics/**",
"src/adapters/lyrics/**"
],
"exclude": [
"src/models/lyrics/internal/**",
"**/*.md"
]
}
},
"waivers": [
{
"id": "W-2026-10-31-01",
"domain": "lyrics-sync",
"paths": ["src/models/lyrics/experimental/**"],
"gap": "GAP-01",
"reason": "Temporary experimental model pending upstream review"
}
]
}
{
"schema_version": 1,
"mode": "satellite",
"domains": {
"lyrics-sync": {
"snapshot_id": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"hub_commit_sha": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
"contract_version": "1.1.0",
"last_synced_at": "2026-10-30T18:30:00Z",
"file_hashes": {
"api_contract.md": "sha256:...",
"architecture_and_flow.md": "sha256:...",
"gaps_and_rfcs.md": "sha256:..."
},
"acknowledged_rfcs": ["RFC-001"],
"pending_rfcs": [],
"acknowledged_endpoints": [
"POST /api/v1/lyrics-sync/tasks/claim",
"GET /api/v1/lyrics-sync/status"
],
"baseline_snapshot": {
"endpoints": ["POST /api/v1/lyrics-sync/tasks/claim"],
"headers": ["Authorization", "X-Worker-Token"],
"payload_keys": ["task_id", "lease_duration_ms"],
"payload_fields": {
"task_id": "string",
"lease_duration_ms": "integer"
},
"pipeline_steps": ["Lease Acquisition", "Input Validation"],
"rfcs": {
"RFC-001": {
"status": "ACKNOWLEDGED_ACTIVE",
"raw_status": "APPROVED",
"title": "Initial Baseline"
}
}
}
}
}
}
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub danhdue/ai-agent-tools --plugin d3nexus72 skills in this plugin
/android-api-integrationGenerates a standardized Network Module, API Interface, Remote Data Source, Repository, UseCase, Models, and ViewModel updates for Android using the Hybrid Network Architecture and MVI Pattern./android-quality-checkRead-only Android quality assurance provider implementing the common quality contract. Executes project-configured Gradle, Spotless, Detekt, and Konsist capabilities from .agents/quality/android-quality.json, enforces BCV and architecture policies, and outputs structured results bound to repository SHA./android-ui-auditAudits Jetpack Compose and Android UI code for recomposition stability, state hoisting, Material3 design system adherence, and modifier best practices.Other plugins' skills for the same job