Generate a High Level Design document from a gathered context file. Runs with clean context — reads the context file and produces a complete HLD. Non-interactive.
Instalação
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Generate a High Level Design document from a gathered context file. Runs with clean context — reads the context file and produces a complete HLD. Non-interactive.
version
2.0.0
context
fork
argument-hint
[context-file] [--adr path-to-adr]
allowed-tools
Read, Write, Edit, Glob, Grep
model
opus
HLD Generator
Generate a complete High Level Design document from a previously gathered context file. This skill runs with clean context and is non-interactive — all questions were answered during the gather phase.
Input
$ARGUMENTS — path to the context file (e.g., docs/context/hld/graphql-migration-context.md), and optionally --adr <path> for cross-referencing the predecessor ADR.
Parse Arguments
Extract from $ARGUMENTS:
Context File: First non-flag argument
ADR Path: --adr <path> (optional, for cross-referencing and back-reference updates)
Source Integrity Rules
Every factual claim in this document must be traceable to the context file.
Ground every claim. Every factual statement must trace back to a specific entry in the context file (user answers, codebase findings with file:line, or web research with URLs).
Flag ungrounded claims. If you need to state something not in the context file, mark it explicitly as [ASSUMPTION].
Never invent details. If the context file doesn't cover something, put it in Open Questions — don't fabricate.
Process
Step 1: Read Inputs
Read the context file from $ARGUMENTS.
If --adr provided, read the ADR for cross-referencing.
Read the HLD template at ${CLAUDE_SKILL_DIR}/references/template.md.
Extract from the context file:
Problem statement and goals/non-goals
User answers (scope, consumers, data entities, external systems, NFRs, deployment)
ADR context (if applicable)
Codebase findings with file:line citations
Web research findings with URLs
Change map (files to modify/create/delete, config changes, schema changes)
Implementation phases
Open questions
Step 2: Determine Output Path
If docs/ exists, propose docs/hld/<kebab-case-name>.md
If rfcs/ or designs/ exists, use that directory
Otherwise, propose docs/hld/<kebab-case-name>.md
Create the directory if needed.
Step 3: Generate the HLD
Write the complete HLD document section by section, following the template structure:
Header — Author, date, status (Draft), reviewers from context file stakeholders.
Problem Statement (Section 1) — From context file's problem statement. Ground in codebase/research findings.
Goals and Non-Goals (Section 2) — From context file. Goals must be specific and measurable. Non-goals explicitly scope out adjacent concerns.
Proposed Solution (Section 3):
Overview: 2-3 paragraph summary from context file's approach.
Architecture: Component-level description using codebase findings. Include mermaid diagrams (system architecture, sequence for key flows).
Data Model: From context file's data entities answers. Include entity definitions, relationships, storage, access patterns.
API Design: From context file. Endpoint/method signatures, request/response shapes, error cases.
Key Design Decisions: From ADR decisions and user answers. Explain what, why, and tradeoffs.
Alternatives Considered (Section 4) — At least 2 alternatives with honest tradeoff analysis. A design claiming no downsides is hiding something. Source from ADR's rejected options if available.
Codebase Impact (Section 5) — Direct translation of the context file's change map. Reference actual file paths from codebase findings.
Security Considerations (Section 6) — From NFR answers and web research.
Performance & Scalability (Section 7) — From NFR answers and web research. Include specific targets if provided.
Reliability & Failure Modes (Section 8) — From external systems answers. What can go wrong and how the system handles it.
Before saving, verify that every D-XX decision from the context file is addressed in the HLD.
Build an internal coverage matrix (do NOT include in the output document):
Decision
Section(s) Addressing It
Coverage
D-01
Key Design Decisions, §3.1 Architecture
Full
D-02
API Design, §3.4
Full
D-03
—
MISSING
Rules:
Every User Decision D-XX MUST map to at least one section → if MISSING, add content to address it before saving
Claude's Discretion D-XX should be addressed where relevant, but gaps are acceptable
Scope reduction prevention: If a User Decision is addressed but with weakened language ("placeholder", "v1", "simplified", "for now", "basic version", "static for now"), strengthen it to match the decision's full intent
If the context file has no D-XX decisions (standalone mode), skip this step
Step 6: Save
Write the complete HLD using the Write tool in a single call with the full document.
Re-read the saved file to verify it follows the template.
Report the saved file path.
Output
Report: "HLD saved to <path>. Run /architecture-docs:audit-hld <path> --context <context-file-path> (with optional --adr <adr-path>) to audit it."