mh-cto-sdlc-integration-design
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-05-13
- Stars
- ★ 2
- Forks
- 0
02 资源文件 2
- 其他customize.toml614 B
- 参考文档mh-skill-manifest.yaml558 B
03 SKILL.md 正文
Integration Design
Mode: synthesize-first (D34). Read the system diagram and arch drivers for integration points. Derive contracts and resilience patterns from those inputs. Ask only when a third-party API's behavior cannot be determined from context.
Elite character: Every integration is a trust boundary and a failure mode. The question is never "will this integration fail?" — it will. The question is "what does our system do when it fails?" Systems that have not answered this question are systems that fail silently in production.
ADR rule (D27): Write an ADR for integration pattern choices that are hard to reverse and surprising without context — e.g. choosing event-driven over synchronous for a critical integration, choosing a polling strategy over webhooks.
Step 1 — Load Artifacts
Confirm present:
- System diagram (
system-diagram.md) ✓ / ✗ — REQUIRED - Arch drivers (
arch-drivers.md) ✓ / ✗ — REQUIRED - Constraint inventory (
constraint-inventory.md) ✓ / ✗ - Stories referencing external systems ✓ / ✗
Missing system diagram: cannot proceed.
Step 2 — Enumerate Integration Points
From the system diagram, identify every external system:
- Third-party APIs (payment processors, auth providers, email services, analytics)
- Internal services in separate deployment units
- Databases as external dependencies (when treated as shared infrastructure)
- File storage, CDN, or message brokers
For each integration point:
- System: [name and what it does]
- Integration direction: inbound (calls us) / outbound (we call it) / both
- Criticality: critical (core functionality fails without it) / important / optional
- Data exchanged: [what data crosses this boundary in each direction]
Step 3 — Define Integration Contracts
For each outbound integration (we call them), define the contract:
Integration: {system name}
Request contract:
- Method / endpoint / protocol
- Required inputs (fields, types, constraints)
- Authentication method
Response contract:
- Success shape (fields returned, their types)
- Error codes (which errors are recoverable, which are terminal)
- Rate limits or quotas
Availability SLA: [their stated uptime — or "unknown" if not published]
Latency characteristic: [P50 / P99 response time — from their docs or empirical]
For inbound integrations (they call us), define the webhook/callback contract we expose.
Step 4 — Resilience Pattern Per Integration
For every critical integration, design the failure behavior:
When unavailable:
- Retry strategy: [none / immediate / exponential backoff with jitter — and max attempts]
- Circuit breaker: [yes / no — and what the open/half-open thresholds are]
- Fallback: [degraded mode the product enters — e.g. "payment unavailable" screen, cached data, skip non-critical enrichment]
- Queue/buffer: [is the request buffered for later processing, or lost on failure?]
When slow (latency spike):
- Timeout: [hard timeout value — what is returned to the user if it is exceeded]
- Bulkhead: [does a slow integration starve other system capabilities?]
Data consistency on partial failure:
- If the call fails mid-saga (multi-step operation), what is the rollback strategy?
- Are there compensating transactions needed?
For non-critical integrations: document the degraded mode only — no retry/circuit-breaker needed.
Step 5 — Event and Async Pattern Design
For any integration using events, queues, or webhooks:
Producer contract:
- Event name and schema
- Ordering guarantees (ordered / unordered)
- At-least-once / exactly-once / at-most-once delivery
Consumer contract:
- Idempotency key (what makes a message safe to re-process)
- Dead letter strategy (what happens to unprocessable messages)
- Consumer lag tolerance (how far behind can the consumer be before it matters?)
Flag any integration where "exactly-once processing" is assumed but not guaranteed — this is a common source of production data corruption.
Step 6 — Write ADR Entries (D27)
For integration pattern choices that qualify:
Save to docs/adr/000{N}-{slug}.md. Scan for current highest number.
Candidates: choice of synchronous vs. event-driven for a critical integration, choice of saga vs. distributed transaction, choice of polling vs. webhook, choice of circuit breaker implementation.
Step 7 — Write Output
Save to _mh-output/cto/sdlc/integration-design/{YYYY-MM-DD}_{r###}_integration-contracts.md:
# Integration Contracts
**Product:** {name}
**Date:** {date}
---
## Integration Inventory
| System | Direction | Criticality | Auth Method |
| ------ | ------------------------- | ------------------------------- | ----------- |
| {name} | outbound / inbound / both | critical / important / optional | {method} |
## Contract Definitions
### {Integration Name}
**Request:** {method, endpoint, required inputs}
**Response:** {success shape, error codes}
**Availability SLA:** {their SLA or unknown}
**Latency:** {P99 characteristic}
**Failure behavior:**
- When unavailable: {retry strategy + fallback}
- When slow: {timeout value + bulkhead strategy}
- Data consistency: {rollback / compensating transaction / none needed}
{Repeat for each integration}
## Event / Async Contracts
{For each async integration — producer contract, consumer contract, idempotency key}
## Integration Risk Register
| Integration | Risk | Severity | Mitigation |
| ----------- | -------------- | ---------------- | ---------- |
| {name} | {failure mode} | High / Med / Low | {pattern} |
## ADRs Written
{List of ADR files created}
Step 8 — Present Summary
Integration Design complete. {N} integrations defined: {N} critical, {N} important, {N} optional.
Resilience patterns:
- Circuit breakers: {N} integrations
- Async/buffered: {N} integrations
- Degraded-mode fallbacks: {N} integrations
Risks flagged: {N} integration risks to address in Phase 5 contract tests.
Next step: Run /mh-cto-sdlc-observability-design and /mh-cto-sdlc-security-arch (can overlap after system-decomp is done).
04 同仓库更多 Skills
mh-vo-vault-brief
Weekly vault intelligence report — health score, pipeline status, OS alignment, and top issues. Use when the user says vault brief, weekly vault report, vault intelligence, run the vault brief, or weekly review brief.
mh-vo-output-bridge
Scan _mh-output/ for new artifacts and create or update corresponding vault entries. Use when the user says run the bridge, sync outputs to vault, output bridge, create vault entries, sync mh-output to vault, or bridge outputs.
mh-vo-moc-builder
Create or update Maps of Content for vault sections and ensure every note is reachable from a MOC. Use when the user says build MOCs, update MOCs, rebuild maps of content, MOC builder, create maps of content, or update the MOCs.
mh-vo-link-architect
Identify missing vault connections and generate precise link recommendations. Use when the user says recommend links, find missing connections, link architect, what should be connected, or identify missing links.
mh-vo-base-builder
Generate Obsidian Bases (.base files) for live database views of vault data. Use when the user says build base views, create base files, generate bases, build live views, or create database views.
mh-vo-taxonomy-enforcer
Audit vault tags and frontmatter, find drift, and apply corrections. Use when the user says fix the taxonomy, enforce tags, fix frontmatter, clean up tags, taxonomy enforcer, or fix tags.