Skip to content

oliver-kriska/claude-elixir-phoenix / targets/dsh/skills/phx-compound

phx-compound

Verified

Capture solved problems as searchable solution docs. Use after fixing bugs, when "that worked", or after successful /phx-review or /phx-investigate.

FileKindSize
SKILL.mdskill md3.7 KB
references/compound-workflow.mdmarkdown3.3 KB

references/compound-workflow.md

View on GitHub
# Compound Workflow — Detailed Steps

## The Compounding Effect

```
Cycle 1: Fix bug → Document solution
Cycle 2: Hit similar bug → Find solution in docs → Fix faster
Cycle 3: Agent finds solution → Prevents bug before it ships
```

Each documented solution reduces future debugging time. After
10-20 solutions, agents can proactively catch known issues.

## Detailed Workflow

### Phase 1: Context Detection

#### From Arguments

```
/phx-compound Fixed N+1 query in UserListLive — was missing preload on posts
```

Extract: module=UserListLive, symptom=N+1, root_cause=missing preload

#### From Session Context

Check these sources in order:

1. **Scratchpad DEAD-END and DECISION entries**:

   ```bash
   grep -A 5 "DEAD-END\|DECISION" .claude/plans/*/scratchpad.md 2>/dev/null | tail -20
   ```

2. **Recent git changes**:

   ```bash
   git log --oneline -5
   git diff HEAD~1 --stat
   ```

3. **Progress file completions**:

   ```bash
   ls -t .claude/plans/*/progress.md 2>/dev/null | head -1
   ```

#### Trivial Fix Filter

Skip documentation for:

- Typo fixes (single character changes)
- Import/alias additions
- Config value changes
- Formatting-only changes
- Changes to fewer than 3 lines with no investigation

### Phase 2: Duplicate Detection

Search existing solutions before creating new:

```bash
grep -rl "NotLoaded\|timeout\|N+1" .claude/solutions/ 2>/dev/null
grep -rl "module: \"Accounts\"" .claude/solutions/ 2>/dev/null
```

If match found, read the file and compare:

- **Same root cause + same module**: Update existing (add new symptom)
- **Same root cause + different module**: Create new with cross-reference
- **Different root cause**: Create new (different problem)

### Phase 3: Information Gathering

```yaml
module: "Accounts"
date: "2025-12-01"
problem_type: runtime_error
component: ecto_query
symptoms:
  - "Ecto.Association.NotLoaded on user.posts"
root_cause: "missing preload on :posts association"
severity: medium
tags: [preload, association, n-plus-one]
```

Gathering strategy:

1. Check session context first (scratchpad, git diff, progress)
2. Fill what you can automatically
3. Ask user ONLY for missing critical fields

### Phase 4: Schema Validation

Validate frontmatter against `../../compound-docs/references/schema.md`.
Use suggested values when they fit; create descriptive labels when
they don't. Only `severity` is a strict enum.

### Phase 5: File Creation

Create in `.claude/solutions/{category}/` using the template from
`../../compound-docs/references/resolution-template.md`.

Filename: `{sanitized-symptom}-{module}-{YYYYMMDD}.md`

### Phase 6: Cross-Referencing

After creating the solution file:

1. Search for related solutions by tags
2. Add `related_solutions` to new file if matches found
3. Update related files to reference new solution

### Phase 7: Promotion Check

If the solution matches any of these, suggest promotion:

- **severity: critical** — Suggest adding to Iron Law checks
- **Iron Law violation** — Suggest updating iron-law-judge
- **Recurring pattern** (3+ similar) — Suggest adding to skill reference

## Integration with Other Skills

- `/phx-learn-from-fix` captures quick patterns in `common-mistakes.md`
- `/phx-compound` captures detailed solutions with full context
- `/phx-investigate` searches `.claude/solutions/` before investigating
- `/phx-plan` consults for known risks in planned areas
rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).Stars: 198kUpdated Claude CodeCodexUnverifiedInstall
doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.Stars: 198kUpdated Claude CodeCodexVerifiedInstall