본문으로 건너뛰기
cccskills
무료GitHub에 공개

write-adr

Use when you want to generate Architecture Decision Records from this session. Triggers on "write ADRs", "document our decisions", "create decision records", "record the choices we made". Also useful after design discussions where decisions were reached but not documented. Does NOT extract decisions alone (use adr-decision-extraction) or provide MADR template (use adr-writing). Orchestrates the full workflow: subagent extraction, user confirmation, parallel generation, and verification.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구PostgreSQL
설치 방법 보기

포함된 파일(1)

  • SKILL.md9.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Write ADR

Generate Architecture Decision Records (ADRs) from decisions made during the current session.

Workflow Overview

  1. Context - Gather repository context and existing ADRs
  2. Extract - Analyze conversation for decisions using a subagent
  3. Confirm - Present decisions to user for selection
  4. Write - Generate ADRs in parallel using subagents
  5. Report - Summarize created files and status
  6. Verify - Validate generated ADRs against Definition of Done

Gates (objective pass conditions)

Advance only when the pass condition holds. These are checkable without “I verified internally.”

AfterPass condition
Step 2 (extract)The subagent response is valid JSON with a top-level decisions array (empty is OK). Each non-empty item has id, title, and at least one of context, decision, alternatives, or rationale present as a non-empty string or non-empty array. If parsing fails or the shape is wrong, re-run extraction or fix the payload before Step 3.
Step 4 (pre-allocate)From repo root, python plugins/beagle-analysis/skills/adr-writing/scripts/next_adr_number.py --count N prints exactly N lines (one number per line). You have a written mapping (in the reply draft or notes) from each selected decision to one of those lines before launching any ADR writer unit.
Step 5 (report)Every file path in the summary table is copied from a subagent completion output (not invented). Optionally spot-check: test -f <path> for each path before marking success.
Step 6 (verify)For each ADR path, opening the file shows line 1 is ---, frontmatter parses as YAML, status and date are present, and the body meets the Step 6 bullets below (alternatives count, Good/Bad consequences).

Step 1: Gather Context

# Get current branch and recent commits
git branch --show-current
git log --oneline -5

# Check for existing ADRs
ls docs/adrs/ 2>/dev/null || echo "No ADR directory found"

# Count existing ADRs for numbering
find docs/adrs -name "*.md" 2>/dev/null | wc -l

This context helps the ADR writer:

  • Reference related commits in the ADR
  • Avoid duplicate ADRs for already-documented decisions
  • Determine correct sequence numbering

Step 2: Extract Decisions

Analyze the current conversation for architectural decisions. If the agent supports subagents, dispatch this as a single extraction subagent; otherwise run the same extraction inline — identical output. Use this brief:

Load the **adr-decision-extraction** skill ([../adr-decision-extraction/SKILL.md](../adr-decision-extraction/SKILL.md)).

Analyze the conversation for decisions that warrant ADRs:
- Technology choices, architecture patterns, design trade-offs
- Rejected alternatives, significant implementation approaches

Return JSON:
{
  "decisions": [
    {
      "id": 1,
      "title": "Use PostgreSQL for primary datastore",
      "context": "Brief context about why this came up",
      "decision": "What was decided",
      "alternatives": ["What was considered but rejected"],
      "rationale": "Why this choice was made"
    }
  ]
}

If the subagent returns an empty decisions array, skip to Step 5 with message: "No architectural decisions detected in this session."

Gate: Meet the Step 2 row in Gates (objective pass conditions) before Step 3.

Step 3: Confirm with User

Display all extracted decisions with full details, then ask user to select:

## Detected Decisions

### 1. Use PostgreSQL for primary datastore
**Confidence:** high

**Problem:** Need ACID transactions for financial records

**Decision:** PostgreSQL for user data storage

**Alternatives discussed:**
- MongoDB
- SQLite

**Rationale:** ACID compliance, team familiarity, mature ecosystem

**Source:** Discussion about database selection in planning phase

---

### 2. Implement event sourcing for audit trail
**Confidence:** medium

**Problem:** Compliance requires complete audit history

**Decision:** Event sourcing pattern for state changes

**Alternatives discussed:**
- Database triggers
- Application-level logging

**Rationale:** Immutable audit trail, temporal queries, debugging capability

**Source:** Compliance requirements discussion

---

## Selection

Which decisions should I write ADRs for?
- Enter numbers (e.g., "1,2" or "1-2"), "all", or "none" to skip

Important: Always display the full decision details (problem, decision, alternatives, rationale) from the extraction output BEFORE asking for selection. Do not truncate to just title and context.

Parse user response:

  • "all" - Process all decisions
  • "none" or empty - Skip with message "No ADRs will be created."
  • "1,2" or "1-2" - Process specified decisions

Step 4: Write ADRs (Parallel)

Pre-allocate ADR numbers before launching subagents to prevent numbering conflicts:

# Pre-allocate numbers for all confirmed decisions (from repository root)
# Example: If user selected 3 decisions
python plugins/beagle-analysis/skills/adr-writing/scripts/next_adr_number.py --count 3
# Output:
# 0003
# 0004
# 0005

Assign each pre-allocated number to its corresponding decision before launching subagents.

Gate: Meet the Step 4 row in Gates (objective pass conditions) before launching the first ADR writer unit.

For each confirmed decision, run an ADR writer unit with its pre-assigned number. If the agent supports subagents, dispatch one writer per decision in parallel; otherwise write each ADR sequentially — identical output. Use this brief:

Load the **adr-writing** skill ([../adr-writing/SKILL.md](../adr-writing/SKILL.md)).

Write an ADR for this decision:
```json
{decision JSON}

IMPORTANT: Use this pre-assigned ADR number: {assigned_number}

Instructions:

  1. Explore codebase for additional context
  2. Write MADR-formatted ADR to docs/adrs/
  3. Use the pre-assigned number {assigned_number} - DO NOT call next_adr_number.py
  4. Filename format: {assigned_number}-slugified-title.md
  5. Return created file path

**Critical:** Pass the pre-allocated number to each writer unit. Writers must NOT call `next_adr_number.py` themselves - this causes duplicate numbers when running in parallel.

Wait for all writer units to complete before proceeding.

## Step 5: Report Results

**Gate:** Meet the Step 5 row in **Gates (objective pass conditions)** when building the summary (paths from subagent outputs; optional `test -f`).

Collect outputs from all subagents and present summary:

```markdown
## ADR Generation Complete

| File | Decision | Status |
|------|----------|--------|
| docs/adrs/0003-use-postgresql.md | Use PostgreSQL for primary datastore | Draft |

### Next Steps
- Review generated ADRs for accuracy
- Update status from "proposed" to "accepted" when finalized

### Gaps Requiring Investigation
- [List any decisions where subagent noted missing context]

If no decisions were processed:

No ADRs were created. Run this command again after making architectural decisions.

Step 6: Verify Generated ADRs

For each created ADR, validate against Definition of Done:

## Verification Checklist

| ADR | E | C | A | D | R | Status |
|-----|---|---|---|---|---|--------|
| 0003-use-postgresql.md | ✓ | ✓ | ✓ | ⚠ | ✗ | Incomplete |

Legend: E=Evidence, C=Criteria, A=Agreement, D=Documentation, R=Realization

Gate: Meet the Step 6 row in Gates (objective pass conditions) for every created ADR.

Verification steps:

  1. Open each generated ADR file
  2. Confirm filename follows NNNN-slugified-title.md pattern
  3. Verify YAML frontmatter exists at file start:
    • File MUST begin with ---
    • Contains status: draft (or valid status)
    • Contains date: YYYY-MM-DD (actual date)
    • Ends with --- before title
    • If frontmatter is missing, add it immediately
  4. Review for [INVESTIGATE] prompts - these need follow-up
  5. Verify at least 2 alternatives are documented
  6. Confirm consequences section has both Good and Bad items

If gaps exist:

  • Keep status as draft until gaps are resolved
  • Use [INVESTIGATE] prompts to guide follow-up session
  • Schedule review with stakeholders before changing to accepted

Output Location

ADRs are written to docs/adrs/ (same convention as adr-writing). If no ADR directory exists, create it with an initial 0000-use-madr.md template record.

MADR Format Reference

---
status: draft
date: YYYY-MM-DD
---

# {TITLE}

## Context and Problem Statement

{What is the issue motivating this decision?}

## Decision Drivers

* {driver 1}
* {driver 2}

## Decision Outcome

Chosen option: "{option}", because {reason}.

### Consequences

* Good, because {positive}
* Bad, because {negative}

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when you need to mine a conversation, session transcript, or design discussion for architectural decisions before writing ADRs. Identifies problem-solution pairs, trade-off debates, technology choices, and explicit "[ADR]" tags. Triggers on "what decisions did we make", "extract decisions from this chat", "find the choices in our discussion", or "summarize architectural decisions". Also useful after long planning sessions to capture decisions that were made implicitly. Does NOT write ADR documents — use adr-writing or write-adr for that.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

existential-birds/beagle842026년 9월 16일 업데이트

Use when writing or formatting an ADR document using the MADR template, applying Definition of Done (E.C.A.D.R.) criteria, or verifying ADR completeness. Triggers on "write the ADR", "format as MADR", "check ADR quality", "mark gaps in ADR". Also triggers when a decision has been extracted and needs to become a document. Does NOT extract decisions from conversations (use adr-decision-extraction) or orchestrate the full extract-confirm-write workflow (use write-adr).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

existential-birds/beagle842026년 9월 16일 업데이트

Use when auditing an agent codebase against the 12-Factor Agents methodology, reviewing LLM-powered system architecture, or assessing agentic app compliance. Triggers on "analyze agent architecture", "12-factor audit", "how compliant is this agent", or "evaluate this LLM app". Also applies when comparing frameworks or planning agent improvements. Not for quick checklists — this performs deep per-factor codebase analysis with file-level evidence.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

existential-birds/beagle842026년 9월 16일 업데이트

Vercel AI Elements for workflow UI components. Use when building chat interfaces, displaying tool execution, showing reasoning/thinking, or creating job queues. Triggers on ai-elements, Queue, Confirmation, Tool, Reasoning, Shimmer, Loader, Message, Conversation, PromptInput.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

existential-birds/beagle842026년 9월 16일 업데이트

Reviews App Intents code for intent structure, entities, shortcuts, and parameters. Use when reviewing code with import AppIntents, @AppIntent, AppEntity, AppShortcutsProvider, or @Parameter.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

existential-birds/beagle842026년 9월 16일 업데이트

Use when the user wants a cited, structured read of local documents and project knowledge. Triggers on: "analyze these docs", "scan my project for context", "read the docs folder", "summarize what's in .beagle/concepts/", "extract context from docs/", "what's in this folder", "go read everything in X and tell me what's there". Also invoked programmatically by other beagle skills (prfaq-beagle Ignition, brainstorm-beagle reference points, strategy-interview context grounding) via the companion contract. Does NOT trigger on codebase lookups ("find this function", "search the repo"), web research (use web-research), LLM-as-judge evaluation (use llm-judge), or document editing (use humanize-beagle). Produces a written scan plan, parallel-subagent findings, and a cited synthesis report on disk — never inline prose, never unsourced claims.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

existential-birds/beagle842026년 9월 16일 업데이트

existential-birds의 스킬 모두 보기

이 스킬의 문제 신고