From forge-skills
Use when .forge/prd.md exists and the system needs a structural design before task breakdown, when modules will be implemented in parallel and need interface contracts to prevent integration failures, or when non-obvious technical decisions need to be recorded for future reference.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge-skills:architecture-and-contractsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Read `.forge/prd.md` and produce three artifacts: a system architecture document, precise interface contracts per module boundary, and ADRs for non-obvious decisions. Contracts must be specific enough that two engineers can implement different modules independently and integrate without surprises.
Read .forge/prd.md and produce three artifacts: a system architecture document, precise interface contracts per module boundary, and ADRs for non-obvious decisions. Contracts must be specific enough that two engineers can implement different modules independently and integrate without surprises.
.forge/prd.md exists and is completespec-driven-development firsttdd| Thought | Reality |
|---|---|
| "We don't need contracts for a small feature" | Contracts protect parallel workers — without them, work diverges |
| "I'll define interfaces as I implement" | Interfaces defined during implementation encode accidents as decisions |
| "ADRs are bureaucratic overhead" | ADRs are the only record of why — without them, decisions get relitigated |
| "The architecture is obvious from the PRD" | Make the obvious explicit — it's where disagreements hide |
| "I can keep the architecture in my head" | You can. Your parallel workers can't. |
.forge/contracts/ has no files after this skill runsRead .forge/prd.md. Identify: module list, interaction points, data flows, NFRs that impose architectural constraints.
If a codebase exists, explore it. Understand current patterns, tech stack, existing module boundaries. The architecture must fit the existing system unless the PRD explicitly calls for a rewrite.
Produce a system overview:
For each module boundary identified in the PRD, write a contract file at .forge/contracts/<module-name>.md. See contract-templates.md.
Each contract must define:
For each non-obvious decision made in steps 3-4, write an ADR at .forge/adr/NNN-<slug>.md. Use the format in contract-templates.md.
Required fields:
forge:meta header with last_reviewed_at set equal to generated_at on creation.Status: (Accepted on creation), Superseded by: (blank), Supersedes: (blank unless this ADR replaces a previous one).<date> — Created.When this skill re-runs and the user identifies a decision that has been superseded:
ADR-N+1) with Supersedes: ADR-N.Status: Superseded by ADR-N+1, Superseded by: ADR-N+1, bump last_reviewed_at to now-UTC, append a review-log line.Before re-writing architecture or contracts on a re-run, read .forge/feedback/*.md. For every entry where status: PENDING AND target_artifact is one of this skill's outputs (architecture.md, contracts/*.md, adr/*.md):
status: RESOLVED, resolved_at: <now UTC>, resolved_by: <commit short sha or "manual">. Append a brief note describing what changed.If a feedback entry's recommendation is rejected (the team decides the current artifact is correct), mark it status: DEFERRED with a reason in the body. Do not delete feedback entries — they are historical record.
Include a cost model section in the architecture:
Write .forge/architecture.md with system overview, component diagram, tech stack table, cost model section, and a table of all contracts with their module names and file paths. Prepend a forge:meta header (generated_by: architecture-and-contracts, generated_at: <ISO 8601 UTC with Z>, depends_on: [.forge/prd.md] — paths only, never hashes, generated_from: {.forge/prd.md: <upstream content_hash AT generation time>}, content_hash: <sha256 first 8 of THIS file's body>). Same header convention on every file under .forge/contracts/ and .forge/adr/ (co-output: each carries the same depends_on + generated_from set). See forge-dependency-graph.
When the user requests deeper analysis, generate supplementary docs:
docs/architecture/scalability-analysis.mddocs/architecture/microservices-design.mddocs/planning/testing-strategy.mddocs/planning/feature-priority-matrix.mdThese are deeper dives on specific sections. Generate only when explicitly requested.
.forge/prd.md read in fullresolved_at + resolved_by.forge/contracts/last_reviewed_at set on creation (== generated_at)Status: Superseded by ADR-NNN AND Superseded by: field filled.forge/architecture.md written with component diagramBefore declaring done, emit one of:
Silence is not allowed. See docs/skill-anatomy.md#fit-check.
npx claudepluginhub aneja5/forge-skills --plugin forge-skillsSearches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.