一键导入
compound-docs
Schema + conventions for compound solution docs. Used by /dotnet:compound to write durable problem→solution records in .claude/solutions/{category}/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Schema + conventions for compound solution docs. Used by /dotnet:compound to write durable problem→solution records in .claude/solutions/{category}/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Full-project health audit — spawns 5 specialists (dotnet-reviewer, security-analyzer, testing-reviewer, performance-profiler, deployment-validator) in parallel. Use for onboarding or pre-release.
Analyze project/namespace boundaries, detect circular refs and layering violations via dotnet-depends and solution graph. Use before major refactors or to validate Clean Architecture.
Senior-engineer challenge mode — aggressively question the current approach, hunt for N+1 queries, captive deps, missing auth, sync-over-async, leaks. Use before finalizing significant changes.
Capture a solved problem as institutional knowledge. Writes `.claude/solutions/{category}/{slug}.md` with symptoms, root cause, fix, category, tags. Use after notable fixes.
Generate or update documentation — XML doc comments, README, architecture docs, OpenAPI descriptions. Uses code as source of truth; no hallucinated features.
Extract durable lessons from a just-finished fix — propose CLAUDE.md rule, Iron Law addition, or Solution doc. Use after resolving a surprising/repeatable bug.
| name | compound-docs |
| description | Schema + conventions for compound solution docs. Used by /dotnet:compound to write durable problem→solution records in .claude/solutions/{category}/. |
| effort | low |
| user-invocable | false |
Reference for the Solution Doc format used by the compound knowledge system.
.claude/solutions/
├── ef-issues/
│ ├── n-plus-one-in-order-list.md
│ └── concurrent-update-conflict.md
├── api-issues/
│ ├── over-posting-in-dto.md
│ └── missing-authorize-on-delete.md
├── blazor-issues/
├── maui-issues/
├── wpf-issues/
├── di-issues/
├── async-issues/
├── security-issues/
├── perf-issues/
├── deploy-issues/
└── build-issues/
---
title: N+1 query in order list endpoint
category: ef-issues
tags: [ef-core, n-plus-one, include, performance]
date: 2026-04-18
project: myapp
severity: high
time_to_fix: 20m
iron_laws: [11, 6]
---
## Problem
GET /api/orders took 1.8s p99. DB log showed N queries for customer
lookup, one per order.
## Symptoms
- Observed: p99 latency 1.8s
- Expected: <200ms
- Trigger: GET /api/orders with ≥50 records
## Root Cause
`src/Api/Orders/OrdersController.cs:47` iterates orders and accesses
`.Customer.Name` with lazy loading enabled → one query per order.
```csharp
foreach (var o in orders)
result.Add(new { o.Id, Customer = o.Customer.Name }); // N+1
Project to DTO inside the query — one SQL, no navigation after materialization:
var result = await _ctx.Orders
.AsNoTracking()
.Select(o => new OrderSummaryDto(o.Id, o.Customer.Name))
.ToListAsync(ct);
ef-issues/projection-over-include.md
## Required Fields
- `title` — short problem statement
- `category` — one of the layout folders above
- `tags` — 3–6 searchable tags, lowercase
- `date` — ISO 8601
- `severity` — low / medium / high / critical
- `iron_laws` — list of violated law numbers (empty `[]` if none)
Optional:
- `project` — if multiple projects in one workspace
- `time_to_fix` — human-readable estimate
- `related` — paths to other solution docs
## Naming Convention
`{short-slug}.md` — kebab-case, verb-oriented, unique within category.
Good: `n-plus-one-in-order-list.md`. Bad: `fix.md`, `bug-23.md`.
## Usage by `/dotnet:compound`
The compound skill:
1. Reads the just-finished fix (git diff / plan progress)
2. Classifies by category (which domain did the bug live in)
3. Generates the solution doc in this schema
4. Writes to `.claude/solutions/{category}/{slug}.md`
## Integration
/dotnet:work (fix landed) ↓ /dotnet:compound → .claude/solutions/{category}/{slug}.md ↓ future /dotnet:plan / /dotnet:investigate searches solutions/
## References
- `${CLAUDE_SKILL_DIR}/references/schema.md` — full field reference
- `${CLAUDE_SKILL_DIR}/references/categories.md` — when to pick each
folder
- `${CLAUDE_SKILL_DIR}/references/example-solution.md` — full worked
example
## Anti-patterns
- Missing `iron_laws` field — breaks cross-referencing
- Vague titles ("bug fix", "tuning") — not searchable
- Dumping a git diff without the Problem / Root Cause / Fix narrative
- Writing solution docs for one-off issues unlikely to recur