← ClaudeAtlas

madr-genlisted

Analyze current session for architectural decisions and generate/update mADR documents
Tazic123/madr-gen · ★ 0 · Data & Documents · score 64
Install: claude install-skill Tazic123/madr-gen
# mADR Generator Skill Generate and update Markdown Architecture Decision Records (mADR) by analyzing the current Claude Code session. ## Overview This skill implements a 3-phase pipeline: 1. **Phase 1 - Detection** (Parallel): Analyze session context to detect architectural decisions 2. **Phase 2 - Validation** (Sequential): Check proposals against existing ADRs 3. **Phase 3 - Execution** (Interactive): Present options and write selected ADRs ## Step-by-Step Workflow ### Step 0: Initialize Ensure the `docs/decisions/` directory exists in the project root. If not, create it. ``` mkdir -p docs/decisions ``` Check for existing ADRs: ``` ls docs/decisions/*.md 2>/dev/null ``` ### Step 1: Gather Session Context Collect information from multiple sources in parallel: #### 1a. Git Changes (run in parallel) ```bash git diff --stat git log --oneline -20 ``` #### 1b. Existing ADRs (run in parallel) ```bash ls docs/decisions/*.md 2>/dev/null ``` Read each existing ADR to understand what's already documented. #### 1c. Session JSONL Logs (run in parallel) Claude Code stores session histories as JSONL at `~/.claude/projects/<encoded-cwd>/`. ```bash # Encode current directory path PROJECT_DIR=$(pwd) ENCODED=$(echo "$PROJECT_DIR" | sed 's|^/||' | sed 's|/|-|g') SESSION_DIR="$HOME/.claude/projects/-${ENCODED}" # Find recent session files (last 24h) find "$SESSION_DIR" -name "*.jsonl" -mmin -1440 -type f 2>/dev/null | sort -r | head -5 ``` For each session file, extract the use