Decision Extraction
Purpose / When to Activate
Activate after:
- Discovery produces epics, scope clarifications, or priorities
- Delivery resolves technical trade-offs or architectural constraints
- QA surfaces systemic issues requiring policy decisions
- Product direction materially changes
Do NOT use for trivial steps, implementation details, brainstorming, or reversible micro-choices.
Process
Decision Consistency Gate (mandatory). Before extracting any new decision:
- Read
contexts/memory/index.md → scan the Decision Registry by domain to identify relevant existing decisions
- Load the specific
decisions/DEC-{ID}.md files for decisions in the affected domain(s)
- Verify the proposed decision does NOT contradict any active decision
- If contradiction found: either explicitly supersede (set
superseded_by in old file + supersedes in new file) with rationale, or STOP and escalate to human.When escalating due to contradiction: before surfacing the escalation, grep
contexts/ for all occurrences of DEC-{id} (where {id} is the contradicted decision's
ID). Collect every file path that references the contradicted DEC — memory files, stories,
and architecture docs. Present this impact list alongside the escalation message so the human
can assess scope before deciding.
If the contexts/ directory scan fails: proceed with the escalation without the impact
list — the escalation is more important than the impact details.
- If unable to determine consistency → STOP and escalate to human
- Never record a decision silently if it may conflict with an existing one
Scan outputs for explicit or implicit decisions: architectural choices, accepted trade-offs, scope boundaries, prioritization shifts, constraints introduced
Filter strictly for durable, governance-relevant decisions
Deduplication check: Scan the Decision Registry in index.md for existing entries covering the same topic. If found: (a) if the new decision supersedes the old, update the old DEC-{ID}.md file's frontmatter (status: superseded, superseded_by: DEC-{new-id}) and record the supersession in the new entry's supersedes field; (b) if the new decision confirms the old, skip writing a duplicate.
3b. Cross-reference assignment: For the new decision, populate related_to with up to 5 DEC IDs that are directly related (same domain cluster, supersession chain, or shared concern). Only include decisions the new entry explicitly builds on, refines, or constrains. If no strong relation exists, leave as [].
Convert each into a structured ADR file (see Output Format below):
Classify using the 10 canonical domains: architecture, matching, expert-system, billing, booking, infrastructure, strategy, governance, market, content. And 3 levels: strategic (WHAT/WHY), architectural (HOW), operational (PROCESS).
Get next available ID via allocate-id.sh dec (from .gaai/core/scripts/lib/) → write decisions/DEC-{N}.md. The allocator serialises allocation under flock + git-CAS, preventing the concurrent-session collision mode (two Discovery sessions both taking the same DEC number). Fallback when the allocator script is absent or not executable: scan decisions/_log.md and decisions/DEC-*.md filenames for the highest N, take max + 1 as the next ID — document the fallback in the commit message. Both paths still proceed to step 7 to update _log.md as the human-readable log.
Update _log.md: add one-line entry for the new decision (the allocator manages the sequential ID; _log.md is the human-readable audit log, NOT the ID source)
MANDATORY GATE — Update Decision Registry (index.md or sibling index-decisions.md if extracted): Add one row per new decision. Row form is pointer-only (per memory-index-compact skill, SKILL-MEMORY-INDEX-COMPACT-001): | DEC-{N} | {domain} | {level} | {≤30-word topic + key relations e.g. amends/supersedes} | {status} {YYYY-MM-DD} |. HARD CAP : ≤ 200 chars per row. Forbidden in row : Tier 2 cycle trails (F-counts, REFINE narratives), commit SHAs, §-numbered substance dumps duplicating DEC body, validation ceremony prose, drift-heal forensic prose — these live in _log.md and the DEC body, NOT in the registry. Increment file count in Shared Categories table. Verify: re-read the row + count its chars ; if > 200 chars, compact before completing. Blocking gate — do not output success until confirmed.
Summary range check: Read the Summaries section of index.md. If the new DEC ID exceeds the highest DEC covered by the latest summary file (e.g., summary covers 90–155 but new DEC is 156), append a line to decisions/_log.md: # ⚠️ PENDING: extend summary range to DEC-{new-max-id} — run memory-refresh. This signals the next memory-refresh cycle to extend the summary. Do NOT create a new summary mid-delivery.
Output Format
Each decision is an individual ADR file: decisions/DEC-{N}.md (sequential numeric ID).
---
id: DEC-{N}
domain: architecture | matching | expert-system | billing | booking | infrastructure | strategy | governance | market | content
level: strategic | architectural | operational
title: "Decision Title"
status: active
created_by: discovery
created_at: YYYY-MM-DD
last_updated_by: discovery
last_updated_at: YYYY-MM-DD
supersedes: null # or DEC-{old-id} if replacing
superseded_by: null
tags:
- {relevant tags}
related_to: [] # optional — max 5 DEC IDs
---
# DEC-{N} — Decision Title
## Context
...
## Decision
...
## Impact
...
Quality Checks
- All major decisions become explicit memory
- No repeated reasoning across sessions
- Governance trail is traceable
- Memory grows only with high-signal knowledge
Non-Goals
This skill must NOT:
- Summarize entire sessions
- Capture raw logs
- Duplicate existing decisions
- Store trivial steps
- Invent interpretation without artefact support
If future agents benefit from knowing it → extract it. If not → do not store it. Memory is leverage — not history.
1---2name: decision-extraction3description: Identify and formalize durable product and technical decisions from agent outputs into long-term memory. Activate after Discovery produces artefacts, Delivery resolves trade-offs, or product direction materially changes.4license: ELv25---67# Decision Extraction89## Purpose / When to Activate1011Activate after:12- Discovery produces epics, scope clarifications, or priorities13- Delivery resolves technical trade-offs or architectural constraints14- QA surfaces systemic issues requiring policy decisions15- Product direction materially changes1617Do NOT use for trivial steps, implementation details, brainstorming, or reversible micro-choices.1819---2021## Process22230. **Decision Consistency Gate (mandatory).** Before extracting any new decision:24 - Read `contexts/memory/index.md` → scan the Decision Registry by domain to identify relevant existing decisions25 - Load the specific `decisions/DEC-{ID}.md` files for decisions in the affected domain(s)26 - Verify the proposed decision does NOT contradict any active decision27 - If contradiction found: either explicitly supersede (set `superseded_by` in old file + `supersedes` in new file) with rationale, or STOP and escalate to human.28 <!-- Impact list added before escalation to give the human full ripple-effect context29 at decision time. Prevents escalations that lack scope — the human needs to know what30 else references the contradicted decision before resolving it. Drift prevention. -->31 **When escalating due to contradiction:** before surfacing the escalation, grep32 `contexts/` for all occurrences of `DEC-{id}` (where `{id}` is the contradicted decision's33 ID). Collect every file path that references the contradicted DEC — memory files, stories,34 and architecture docs. Present this impact list alongside the escalation message so the human35 can assess scope before deciding.36 **If the `contexts/` directory scan fails:** proceed with the escalation without the impact37 list — the escalation is more important than the impact details.38 - If unable to determine consistency → STOP and escalate to human39 - Never record a decision silently if it may conflict with an existing one40411. Scan outputs for explicit or implicit decisions: architectural choices, accepted trade-offs, scope boundaries, prioritization shifts, constraints introduced422. Filter strictly for **durable, governance-relevant decisions**433. **Deduplication check:** Scan the Decision Registry in `index.md` for existing entries covering the same topic. If found: (a) if the new decision supersedes the old, update the old `DEC-{ID}.md` file's frontmatter (`status: superseded`, `superseded_by: DEC-{new-id}`) and record the supersession in the new entry's `supersedes` field; (b) if the new decision confirms the old, skip writing a duplicate.443b. **Cross-reference assignment:** For the new decision, populate `related_to` with up to 5 DEC IDs that are directly related (same domain cluster, supersession chain, or shared concern). Only include decisions the new entry explicitly builds on, refines, or constrains. If no strong relation exists, leave as `[]`.454. Convert each into a structured ADR file (see Output Format below):46 - Context47 - Decision48 - Impact495. Classify using the **10 canonical domains**: `architecture`, `matching`, `expert-system`, `billing`, `booking`, `infrastructure`, `strategy`, `governance`, `market`, `content`. And **3 levels**: `strategic` (WHAT/WHY), `architectural` (HOW), `operational` (PROCESS).506. **Get next available ID** via `allocate-id.sh dec` (from `.gaai/core/scripts/lib/`) → write `decisions/DEC-{N}.md`. The allocator serialises allocation under flock + git-CAS, preventing the concurrent-session collision mode (two Discovery sessions both taking the same DEC number). Fallback when the allocator script is absent or not executable: scan `decisions/_log.md` and `decisions/DEC-*.md` filenames for the highest N, take `max + 1` as the next ID — document the fallback in the commit message. Both paths still proceed to step 7 to update `_log.md` as the human-readable log.517. **Update `_log.md`:** add one-line entry for the new decision (the allocator manages the sequential ID; `_log.md` is the human-readable audit log, NOT the ID source)528. **MANDATORY GATE — Update Decision Registry (`index.md` or sibling `index-decisions.md` if extracted):** Add one row per new decision. **Row form is pointer-only (per `memory-index-compact` skill, SKILL-MEMORY-INDEX-COMPACT-001):** `| DEC-{N} | {domain} | {level} | {≤30-word topic + key relations e.g. amends/supersedes} | {status} {YYYY-MM-DD} |`. **HARD CAP : ≤ 200 chars per row.** Forbidden in row : Tier 2 cycle trails (F-counts, REFINE narratives), commit SHAs, §-numbered substance dumps duplicating DEC body, validation ceremony prose, drift-heal forensic prose — these live in `_log.md` and the DEC body, NOT in the registry. Increment file count in Shared Categories table. **Verify:** re-read the row + count its chars ; if > 200 chars, compact before completing. Blocking gate — do not output success until confirmed.539. **Summary range check:** Read the Summaries section of `index.md`. If the new DEC ID exceeds the highest DEC covered by the latest summary file (e.g., summary covers 90–155 but new DEC is 156), append a line to `decisions/_log.md`: `# ⚠️ PENDING: extend summary range to DEC-{new-max-id} — run memory-refresh`. This signals the next `memory-refresh` cycle to extend the summary. Do NOT create a new summary mid-delivery.5455---5657## Output Format5859Each decision is an individual ADR file: `decisions/DEC-{N}.md` (sequential numeric ID).6061```yaml62---63id: DEC-{N}64domain: architecture | matching | expert-system | billing | booking | infrastructure | strategy | governance | market | content65level: strategic | architectural | operational66title: "Decision Title"67status: active68created_by: discovery69created_at: YYYY-MM-DD70last_updated_by: discovery71last_updated_at: YYYY-MM-DD72supersedes: null # or DEC-{old-id} if replacing73superseded_by: null74tags:75 - {relevant tags}76related_to: [] # optional — max 5 DEC IDs77---7879# DEC-{N} — Decision Title8081## Context82...8384## Decision85...8687## Impact88...89```9091---9293## Quality Checks9495- All major decisions become explicit memory96- No repeated reasoning across sessions97- Governance trail is traceable98- Memory grows only with high-signal knowledge99100---101102## Non-Goals103104This skill must NOT:105- Summarize entire sessions106- Capture raw logs107- Duplicate existing decisions108- Store trivial steps109- Invent interpretation without artefact support110111**If future agents benefit from knowing it → extract it. If not → do not store it. Memory is leverage — not history.**