Compound Engineering System
自动触发规则: 任务完成后自动调用此 skill 进行反思。错误/复杂任务必反思,简单配置可跳过。
Quick Start
After finishing any task, run the reflection pipeline:
# Full reflection (auto-detects level)
~/.hermes/skills/compound-system/scripts/compound.sh --task "description" --status "success|partial|failed"
# Manual search before starting a new task
~/.hermes/skills/compound-system/scripts/search.sh "error keyword"
# Write a solution manually
~/.hermes/skills/compound-system/scripts/write-solution.sh
# Lifecycle maintenance
~/.hermes/skills/compound-system/scripts/refresh.sh
Workflow
After Every Task
Rule Gate (zero cost) — checks if reflection is needed
- Skip: simple config changes, documentation only, trivial fixes
- Trigger: errors, retries, complexity, partial success
Quick Reflect (~$0.0002) — flash model extracts:
- What happened
- Root cause
- Solution (if any)
- Tags for retrieval
Deep Reflect (~$0.03) — pro model for:
- Cross-domain patterns
- Architecture decisions
- Reusable insights
Before Starting a New Task
Search the solutions directory:
scripts/search.sh "error description"
Check CONCEPTS.md for vocabulary:
- Read
solutions/CONCEPTS.md
- Use domain-specific terms in searches
Use search tips:
- Try:
[tag] error_keyword (e.g., [auth] api key)
- Try:
module_name error (e.g., lark-cli timeout)
- Try:
error_code (e.g., 401, 500)
- Check frontmatter first, then content
Directory Structure
solutions/
├── CONCEPTS.md # Auto-maintained vocabulary
├── bugs/ # Error patterns & fixes
│ ├── 2026-06-14-api-401.md
│ └── 2026-06-14-yaml-type-error.md
├── knowledge/ # Architecture & best practices
│ └── 2026-06-14-storage-schema.md
└── patterns/ # Reusable solutions
└── 2026-06-14-retry-pattern.md
File Format (YAML Frontmatter)
---
title: "Error Description"
module: "tool/project name"
tags: [error_type, tool, context]
problem_type: "bug|knowledge|pattern"
severity: "low|medium|high|critical"
root_cause: "Why it happened"
solution: "How to fix it"
created: "2026-06-14"
last_updated: "2026-06-14"
occurrence_count: 1
---
Cost Optimization
| Level |
Trigger |
Cost |
When |
| Skip |
Simple tasks |
$0 |
Config changes, docs |
| Quick |
Errors, complexity |
~$0.0002 |
Most situations |
| Deep |
Critical, cross-domain |
~$0.03 |
Architecture decisions |
Rule Gate: Zero-cost filtering saves 40-50% of LLM calls.
Tags Reference
| Category |
Tags |
| API/Auth |
auth, 401, expired-key, rate-limit |
| Config |
yaml, env, port-conflict, type-error |
| Network |
ssh, vpn, dns, timeout |
| Tool |
mcp, pydantic, import-error |
| Code |
type-mismatch, null-ref, logic-error |
Maintenance
Run scripts/refresh.sh periodically:
- Finds stale docs (90+ days)
- Archives low-value stale docs
- Updates CONCEPTS.md
- Reports duplicates
1---2name: compound-system3description: Post-task reflection and knowledge management system. Auto-extracts errors and solutions, builds searchable knowledge base.4---56# Compound Engineering System78> **自动触发规则**: 任务完成后自动调用此 skill 进行反思。错误/复杂任务必反思,简单配置可跳过。910## Quick Start1112After finishing any task, run the reflection pipeline:1314```bash15# Full reflection (auto-detects level)16~/.hermes/skills/compound-system/scripts/compound.sh --task "description" --status "success|partial|failed"1718# Manual search before starting a new task19~/.hermes/skills/compound-system/scripts/search.sh "error keyword"2021# Write a solution manually22~/.hermes/skills/compound-system/scripts/write-solution.sh2324# Lifecycle maintenance25~/.hermes/skills/compound-system/scripts/refresh.sh26```2728## Workflow2930### After Every Task31321. **Rule Gate** (zero cost) — checks if reflection is needed33 - Skip: simple config changes, documentation only, trivial fixes34 - Trigger: errors, retries, complexity, partial success35362. **Quick Reflect** (~$0.0002) — flash model extracts:37 - What happened38 - Root cause39 - Solution (if any)40 - Tags for retrieval41423. **Deep Reflect** (~$0.03) — pro model for:43 - Cross-domain patterns44 - Architecture decisions45 - Reusable insights4647### Before Starting a New Task48491. **Search** the solutions directory:50 ```bash51 scripts/search.sh "error description"52 ```53542. **Check CONCEPTS.md** for vocabulary:55 - Read `solutions/CONCEPTS.md`56 - Use domain-specific terms in searches57583. **Use search tips**:59 - Try: `[tag] error_keyword` (e.g., `[auth] api key`)60 - Try: `module_name error` (e.g., `lark-cli timeout`)61 - Try: `error_code` (e.g., `401`, `500`)62 - Check frontmatter first, then content6364## Directory Structure6566```67solutions/68├── CONCEPTS.md # Auto-maintained vocabulary69├── bugs/ # Error patterns & fixes70│ ├── 2026-06-14-api-401.md71│ └── 2026-06-14-yaml-type-error.md72├── knowledge/ # Architecture & best practices73│ └── 2026-06-14-storage-schema.md74└── patterns/ # Reusable solutions75 └── 2026-06-14-retry-pattern.md76```7778## File Format (YAML Frontmatter)7980```yaml81---82title: "Error Description"83module: "tool/project name"84tags: [error_type, tool, context]85problem_type: "bug|knowledge|pattern"86severity: "low|medium|high|critical"87root_cause: "Why it happened"88solution: "How to fix it"89created: "2026-06-14"90last_updated: "2026-06-14"91occurrence_count: 192---93```9495## Cost Optimization9697| Level | Trigger | Cost | When |98|-------|---------|------|------|99| Skip | Simple tasks | $0 | Config changes, docs |100| Quick | Errors, complexity | ~$0.0002 | Most situations |101| Deep | Critical, cross-domain | ~$0.03 | Architecture decisions |102103**Rule Gate**: Zero-cost filtering saves 40-50% of LLM calls.104105## Tags Reference106107| Category | Tags |108|----------|------|109| API/Auth | `auth`, `401`, `expired-key`, `rate-limit` |110| Config | `yaml`, `env`, `port-conflict`, `type-error` |111| Network | `ssh`, `vpn`, `dns`, `timeout` |112| Tool | `mcp`, `pydantic`, `import-error` |113| Code | `type-mismatch`, `null-ref`, `logic-error` |114115## Maintenance116117Run `scripts/refresh.sh` periodically:118- Finds stale docs (90+ days)119- Archives low-value stale docs120- Updates CONCEPTS.md121- Reports duplicates