compound-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCompound Docs — Institutional Knowledge Base
Compound Docs — 机构知识库
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/.claude/solutions/
├── ecto-issues/
├── liveview-issues/
├── oban-issues/
├── otp-issues/
├── security-issues/
├── testing-issues/
├── phoenix-issues/
├── deployment-issues/
├── performance-issues/
└── build-issues/Iron Laws
铁则
- ALWAYS search solutions before investigating — Check
for existing fixes before debugging
.claude/solutions/ - YAML frontmatter is MANDATORY — Every solution needs
validated metadata per
references/schema.md - One problem per file — Never combine multiple solutions
- Include prevention — Every solution documents how to prevent recurrence
- 排查前务必先搜索解决方案 — 调试前先检查目录下是否已有现成的修复方案
.claude/solutions/ - 必须包含YAML前置元数据 — 每个解决方案都需要符合中的验证元数据规范
references/schema.md - 一问题一文件 — 切勿将多个解决方案合并到同一个文件中
- 包含预防措施 — 每个解决方案都需记录如何避免问题再次发生
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]
---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
Association NotLoaded on User Posts
Symptoms
Symptoms
Ecto.Association.NotLoaded raised when accessing user.posts
in UserListLive after filtering.
Ecto.Association.NotLoaded raised when accessing user.posts
in UserListLive after filtering.
Root Cause
Root Cause
Query in Accounts context missing preload for :posts.
Query in Accounts context missing preload for :posts.
Solution
Solution
Added to .
Repo.preload(:posts)list_users/1Added to .
Repo.preload(:posts)list_users/1Prevention
Prevention
Use n1-check skill before shipping list views.
undefinedUse n1-check skill before shipping list views.
undefinedSearching Solutions
搜索解决方案
bash
undefinedbash
undefinedSearch by symptom
Search by symptom
grep -rl "NotLoaded" .claude/solutions/
grep -rl "NotLoaded" .claude/solutions/
Search by tag
Search by tag
grep -rl "tags:.*preload" .claude/solutions/
grep -rl "tags:.*preload" .claude/solutions/
Search by component
Search by component
grep -rl "component: ecto" .claude/solutions/
undefinedgrep -rl "component: ecto" .claude/solutions/
undefinedIntegration
集成
- creates solution docs here
/phx:compound - searches here before debugging
/phx:investigate - consults for known risks
/phx:plan - feeds into this system
learn-from-fix
- 会在此处创建解决方案文档
/phx:compound - 会在调试前先在此处搜索
/phx:investigate - 会参考此处内容识别已知风险
/phx:plan - 会将内容同步到此系统中
learn-from-fix
References
参考资料
- — YAML frontmatter validation schema
references/schema.md - — Full solution template
references/resolution-template.md
- — YAML前置元数据验证 schema
references/schema.md - — 完整解决方案模板
references/resolution-template.md