compound-docs
Compound Docs creates a searchable, YAML-frontmatter-indexed repository of solved problems organized by issue type (Ecto, Phoenix, testing, deployment, etc.). Use it before debugging new issues to discover existing solutions, prevent recurring errors, and accelerate troubleshooting across Elixir/Phoenix/Ecto projects by consulting institutional knowledge from past fixes.
git clone --depth 1 https://github.com/oliver-kriska/claude-elixir-phoenix /tmp/compound-docs && cp -r /tmp/compound-docs/targets/amp/skills/compound-docs ~/.claude/skills/compound-docsSKILL.md
# Compound Docs — Institutional Knowledge Base Searchable, categorized solution documentation that makes each debugging session easier than the last. ## Directory Structure ``` .claude/solutions/ ├── ecto-issues/ ├── liveview-issues/ ├── oban-issues/ ├── otp-issues/ ├── security-issues/ ├── testing-issues/ ├── phoenix-issues/ ├── deployment-issues/ ├── performance-issues/ └── build-issues/ ``` ## Iron Laws 1. **ALWAYS search solutions before investigating** — Check `.claude/solutions/` for existing fixes before debugging 2. **YAML frontmatter is MANDATORY** — Every solution needs validated metadata per `references/schema.md` 3. **One problem per file** — Never combine multiple solutions 4. **Include prevention** — Every solution documents how to prevent recurrence ## Solution File Format ```markdown --- module: "Accounts" date: "2025-12-01" problem_type: runtime_error component: ecto_schema symptoms: - "Ecto.Association.NotLoaded on user.posts" root_cause: missing_preload severity: medium tags: [preload, association, n-plus-one] --- # Association NotLoaded on User Posts ## Symptoms Ecto.Association.NotLoaded raised when accessing user.posts in UserListLive after filtering. ## Root Cause Query in Accounts context missing preload for :posts. ## Solution Added `Repo.preload(:posts)` to `list_users/1`. ## Prevention Use n1-check skill before shipping list views. ``` ## Searching Solutions Use Grep to search `.claude/solutions/` by symptom (e.g., `NotLoaded`), by tag (e.g., `tags:.*preload`), or by component (e.g., `component: ecto`). ## Integration - `phx-compound` creates solution docs here - `phx-investigate` searches here before debugging - `phx-plan` consults for known risks - `learn-from-fix` feeds into this system ## References - `references/schema.md` — YAML frontmatter validation schema - `references/resolution-template.md` — Full solution template
Ash Framework — resources, actions, policies, aggregates, calculations,
Compatibility alias for the Elixir/Phoenix plugin's LiveView assigns audit. Invoke explicitly with /lv:assigns.
Inspect LiveView socket assigns for memory bloat — missing temporary_assigns, unused assigns, unbounded lists needing streams, memory estimates. Use when LiveView memory grows or you need to add temporary_assigns.
Project health audit and health check — architecture, performance, tests, dependencies, code quality. Use when assessing overall project health, before releases, or after refactors.
Analyze Phoenix context boundaries and module coupling via mix xref. Use when checking cross-context calls, validating dependencies, before splitting modules, or reviewing architecture.
Brainstorm Elixir/Phoenix features — explore ideas, compare approaches, gather requirements. Use when vague idea, not sure how to approach, or want to discuss before plan.
Interactive briefing of a plan file — explains reasoning, schema decisions, component choices. Use when developers need to understand a plan before approving.
Summarize and review what changed while you were away. Use after a weekend, vacation, or flight to check missed PRs, git commits, Linear tickets, and meetings — one prioritized brief, not a firehose.