amplifier-philosophy
Amplifier design philosophy using Linux kernel metaphor. Covers mechanism vs policy, module architecture, event-driven design, and kernel principles. Use when designing new modules or making architectural decisions.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 12
- Forks
- 11
01 前言 Front Matter
- name
- amplifier-philosophy
- license
- MIT
- version
- 1.0.0
- metadata
- { "category": "architecture", "complexity": "medium" }
- description
- Amplifier design philosophy using Linux kernel metaphor. Covers mechanism vs policy, module architecture, event-driven design, and kernel principles. Use when designing new modules or making architectural decisions.
03 SKILL.md 正文
Amplifier Philosophy: The Linux Kernel Metaphor
Core Principle: Mechanism Not Policy
If two teams might want different behavior, it belongs in a module, not the kernel.
The kernel provides mechanisms (mount, emit, dispatch). Modules provide policies (what to mount, when to emit, how to handle).
Architecture Patterns
Kernel (amplifier-core)
Keep it minimal and stable:
- Session management (
session_create,mount,unmount) - Event emission (
emit) - Hook registration
- Context access
Never add to kernel:
- Provider selection
- Tool routing
- Plan generation
- Default behaviors
- File I/O
Modules (Everything Else)
All capabilities as modules:
- Providers: LLM backends (Anthropic, OpenAI, Ollama)
- Tools: Capabilities (filesystem, bash, web)
- Orchestrators: Execution strategies
- Context Managers: State management
- Hooks: Lifecycle observers
Mount Point System
Think of modules as devices mounted at paths:
/mnt/providers/{name} - LLM backends
/mnt/tools/{name} - Agent capabilities
/mnt/hooks/{event} - Lifecycle observers
/mnt/context - Conversation state
/mnt/orchestrator - Execution loop
Each mount point has a stable connector (Protocol interface).
Event-Driven Design
If it's important, emit an event:
session:start,session:endprompt:submit,prompt:completeprovider:request,provider:responsetool:pre,tool:postcontext:pre_compact,context:post_compact
Hooks observe, never interfere:
- Logging hooks record events
- Approval hooks check permissions
- Cost tracking hooks monitor usage
- Failures in hooks never stop execution
Module Development Checklist
When creating a new module:
- ✅ Implements Protocol only - No kernel internals
- ✅ Emits canonical events - Observable lifecycle
- ✅ Handles own failures - Never crash kernel
- ✅ Configuration via mount() - No hard-coded defaults
- ✅ Entry point registration - Discoverable
Decision Framework
Is This Kernel Work?
Ask: "Would every team use this the exact same way?"
- Yes → Might be kernel (rare)
- No → Definitely a module
Extract to Kernel?
Only after:
- Two real implementations exist
- Clear convergence on mechanism
- No opinion baked in
Prefer Regeneration
- Don't patch modules - Regenerate from spec
- Keep connectors stable - Module internals can change
- Update spec, rebuild module - Not line-by-line edits
Remember
Ruthless simplicity. If two designs solve it, pick the one with fewer moving parts and clearer failure modes.
Modules compete at edges. The kernel enables them, doesn't choose between them.
Observability is mandatory. If it's not in the logs, it didn't happen.
04 同仓库更多 Skills
verification-discipline
Use when verifying that completed work actually works. Auto-surface during /verify mode, post-implementation review, or before claiming a task is done. Teaches testing outcomes vs implementation, the unit/integration/smoke gradient, and what "done" actually means.
user-advocate
User-need reviewer that speaks for the person who isn't in the room — the one who will actually live with what gets built. Hunts the gap between "we can build this" and "they actually want this," in the patient, impatient voice of the absent user. Use at any checkpoint — brainstorm, design, plan, implement, debug, review — when a feature is being built because it's buildable rather than wanted, the recovery path is missing, or nobody can name the person this serves: "do they actually want this, and can they live with it?"
tester-breaker
Adversarial breaker that reviews code by trying to make it fail, not by confirming it works. Hunts the unhappy paths — malformed input, the empty string, the reversed range, the race condition — as a gleeful adversary who assumes everything is broken until a concrete attempt to break it comes up empty. Use at any checkpoint — brainstorm, design, plan, implement, debug, review — when the happy path is celebrated while the edges sit unexamined, "looks fine" stands in for "I tried to break it and couldn't," or nobody has named the input that makes this fall over: "how does this fail, and where are the edges?"
skills-assist
Authoritative consultant for all skills-related questions. Use when creating or modifying skills, understanding the Agent Skills spec, troubleshooting skill loading or invocation issues, leveraging enhanced format features (context fork, model_role, user-invocable), writing cross-harness portable skills, ensuring Claude Code Skills 2.0 compatibility, or deciding between skills vs agents.
skillify
Capture a repeatable process from the current session into a reusable Amplifier SKILL.md skill file. Use when the user wants to create a skill, save a workflow as a skill, turn a process into a reusable skill, or mentions "skillify", "create skill", "make a skill", "save as skill", "capture workflow", "turn this into a skill", "new skill", or wants to automate a repeatable process they just performed.
session-debug
Diagnose issues in the current Amplifier session — misconfigured tools, failing operations, unexpected behavior. Use when something isn't working right.