From design-decision-extraction
Extract structured design decisions from a technical document. Reads the document, identifies architectural choice points, interviews the author to fill gaps, and writes complete decision frameworks as markdown and JSONL files. Use when you have a design guide, architecture spec, or technical document and want to capture its decision knowledge in a form AI systems can reason over.
How this skill is triggered — by the user, by Claude, or both
Slash command
/design-decision-extraction:extract-decisionsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Extract the design decisions embedded in a technical document. Each decision captures the alternatives, the conditions under which you'd choose each, the trade-offs, the implications, and the evidence — structured so AI systems can reason over them.
Extract the design decisions embedded in a technical document. Each decision captures the alternatives, the conditions under which you'd choose each, the trade-offs, the implications, and the evidence — structured so AI systems can reason over them.
This skill runs a five-phase workflow:
Ask the user for the document path if they haven't provided one. Then begin Phase 1.
All state is persisted in {output_dir}/session.json. Write this file using the Write tool. Update it after every phase transition and after every elicitation answer — do not buffer updates.
Schema:
{
"source_doc": "filename.pdf",
"output_dir": "./output/",
"phase": "elicitation",
"candidates": [
{"id": "decision_001", "question": "...", "alternatives": ["A", "B"], "source_sections": ["..."]}
],
"assessments": {
"decision_001": {
"alternatives": {"status": "SUFFICIENT", "source_excerpt": "...", "questions": ["..."]},
"conditions": {"status": "WEAK", "source_excerpt": "...", "questions": ["..."]},
"tradeoffs": {"status": "ABSENT", "source_excerpt": "", "questions": ["..."]},
"implications": {"status": "ABSENT", "source_excerpt": "", "questions": ["..."]},
"evidence": {"status": "WEAK", "source_excerpt": "...", "questions": ["..."]}
}
},
"elicitation_answers": {
"decision_001": {
"alternatives": "user answer or 'skipped' or 'deferred' or 'in the doc'",
"conditions": "user answer"
}
},
"completed_decisions": ["decision_001"]
}
Write rules:
phase to: inventory, filter, gap_analysis, elicitation, synthesis, or completecandidates contains only the user-approved listassessments is fully populatedelicitation_answers immediatelycompleted_decisionsThis skill requires no external tools, Python packages, or shell commands. Use only Claude Code's built-in tools:
ls, test -f). Not for document parsing.PDF-specific rules:
Read with the pages parameter for large PDFs: pages: "1-10", pages: "11-20", etc. Maximum 20 pages per call.Read the document using the Read tool. If the document is very large (over 800 lines for text files, or over 20 pages for PDFs), read it in sections.
Then identify design decision candidates by thinking like a Network Architecture and Design Analyst:
A valid design decision:
Look for:
Skip purely operational content (how to run or maintain something after it's deployed).
For each candidate, note:
After identifying candidates, write session.json with phase: "filter" and the full candidates list before presenting them to the user.
Present the candidates as a numbered table:
# | Decision | Alternatives | Confidence
---|-----------------------------------|-----------------------|----------
1 | Should you use X or Y? | X, Y | ● high
2 | When to use centralized vs dist.? | Centralized, Dist. | ◐ medium
Legend: ● high ◐ medium ◑ low
Tell the user the total count and ask them to remove any they don't want to capture. They can specify:
31-51-3, 5, 7-9Confirm the final list before proceeding. Then update session.json: replace candidates with only the approved list and set phase: "gap_analysis".
For each selected candidate, assess it as a Gap Analyst:
The five required decision elements are:
Classify each element:
For every element (SUFFICIENT, WEAK, or ABSENT), prepare elicitation questions:
For every element, draft a model pre-answer from your own training knowledge. This will be shown to the expert during elicitation so they can confirm, correct, or expand rather than answer from scratch. Label these clearly as model pre-answers — the expert must know this is not from the document.
Before showing the gap summary, write session.json with phase: "elicitation" and the fully-populated assessments object.
Show the user a brief gap summary before starting elicitation:
Decision 1: Should you use X or Y?
✓ alternatives (sufficient) ? conditions (weak) ✗ tradeoffs (absent)
✗ implications (absent) ✓ evidence (sufficient)
→ ~6 questions estimated
Work through each decision one at a time. For each decision:
Decision 2/5 — "Should you use X or Y?" — Question 3/7Model's pre-trained understanding (not from the document):. Then, for SUFFICIENT and WEAK elements, also show the relevant source excerpt as supporting context. Always ask two things: (1) is the model's understanding correct, incomplete, or wrong? (2) what would you add that the model wouldn't know?
User commands to accept at any prompt:
elicitation_answers, write session.json, then move to the next questionskip — record "skipped" for this element, write session.json, move ondefer — record "deferred" for this element, write session.json, move onin the doc — record "in the doc" for this element, write session.json, move onsave — write session.json (it should already be current), confirm to the user, and continuequit — write session.json and stop; tell the user to run /extract-decisions resume to continueEvery answer must be written to disk before asking the next question. Never accumulate answers in memory and write them later.
After all questions for a decision are complete, show the user a summary of their answers and ask if they want to correct anything before synthesis.
Key rule: one question at a time. Never present multiple questions together.
For each completed decision, act as a Decision Framework Synthesizer:
Write a complete, self-contained decision framework. Every sentence must stand alone — no references to other sections, figures, or external documents.
Writing rules:
[S] source-derived, [E] elicited (includes expert-confirmed model pre-answers), [I] inferred and not validated by the expert[MISSING: ...] markers — every section must have substantive contentDecision framework format:
**Decision Question:** [The architectural choice point]
**Alternatives:**
- **[Alternative 1]:** [1-2 sentences: what it is, purpose, key characteristics] [S/E/I]
- **[Alternative 2]:** [1-2 sentences: what it is, purpose, key characteristics] [S/E/I]
**When to Use Each Alternative:**
- **[Alternative 1]:** [Conditions/situations, quantified where possible] [S/E/I]
- **[Alternative 2]:** [Conditions/situations, quantified where possible] [S/E/I]
**Trade-offs:**
- **[Alt 1 vs Alt 2]:** [Cost, complexity, flexibility, performance — with conditions] [S/E/I]
**Implications:**
- **[If you choose Alt 1]:** [Downstream decisions and consequences] [S/E/I]
- **[If you choose Alt 2]:** [Downstream decisions and consequences] [S/E/I]
Rule: every alternative must have its own implication entry. For every constraint or limitation named in Trade-offs, carry it forward into Implications as "when this limitation becomes relevant, here is what the organization does instead."
**Evidence:** [Examples, validation results, real-world outcomes] [S/E/I]
After writing, re-read every sentence and flag any that reference something outside the framework itself.
Write the output immediately after each decision is synthesized — don't wait until all decisions are complete. After writing each decision's files, append its id to completed_decisions in session.json and write the updated session file.
Write to the directory the user specifies (default: ./output/):
Per decision — markdown file (output/<decision-id>.md):
The full decision framework with [S]/[E]/[I] annotations.
Aggregate JSONL file (output/rag/chunks.jsonl):
One JSON object per line, one per section per decision. Append as each decision completes.
{"decision_id": "decision_001", "decision_question": "Should you use X or Y?", "section": "alternatives", "text": "Alternative 1 is... Alternative 2 is...", "source_doc": "filename.pdf", "extracted_date": "2026-05-10", "has_inferred_content": false}
Sections: anchor, alternatives, when_to_use_each, tradeoffs, implications, evidence
Strip [S], [E], [I] annotations from JSONL text (keep them only in the markdown).
Set has_inferred_content: true if any sentence in that section has an [I] annotation.
Ask the user for the output directory (default: ./output/). Then read {output_dir}/session.json.
If session.json exists, restore full state from it:
source_doc — what document was being analyzedcandidates — the filtered list (skip inventory and filter phases)assessments — the gap analysis (skip gap analysis phase)elicitation_answers — answers already recorded (skip those questions)completed_decisions — decisions already synthesized (skip those entirely)Show the user a resume summary before continuing:
Resuming session for: filename.pdf
Completed decisions (2): decision_001, decision_003
In-progress: decision_002 — 3 of 7 questions answered
Remaining: decision_004, decision_005
Then continue from where it left off:
completed_decisions: skip entirelyelicitation_answers, continue with the first unanswered elementIf session.json does not exist, look for .md files in the output directory to identify completed decisions, then ask the user what document to continue with and which decisions remain to be processed.
Never re-ask questions that already have answers in elicitation_answers, even if the answer is "skipped" or "deferred".
When all decisions are complete, report:
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub jgolbez/design-decision-extraction --plugin design-decision-extraction