Version: 0.1 (Draft) Status: In Progress — NOT FOR IMPLEMENTATION Last Updated: YYYY-MM-DD Authors: TBD Reviewers: TBD
- Overview & Problem Statement
- Goals & Non-Goals
- Design Principles
- Plugin Architecture
- Core Workflows
- Domain-Specific Core Section
- Testing Strategy
- Open Questions & Decisions Log
- Appendix
[Describe the problem statement here.]
- [Goal 1]
- [Goal 2]
- [Goal 3]
- [Non-goal 1]
- [Non-goal 2]
- [Non-goal 3]
[Preamble here.]
Statement: [One declarative sentence — a decision rule the plugin follows when under implementation pressure. It should tell you what to do in a specific situation, not just express a value.]
Intent: [What specific failure mode does this principle prevent? Name it concretely. The minimum bar: "Prevents [specific bad outcome] that would otherwise occur when [specific pressure]." If no concrete failure mode comes to mind, the principle may be too vague.]
Enforcement Heuristic: [What does a violation look like in practice? Name a specific code pattern, architectural choice, or behavior. E.g., "A hook script that exits non-zero on failure" or "A command that runs a destructive operation without first surfacing a summary for user confirmation." Be specific enough that another developer could identify a violation without asking you.]
Cost of Following This Principle: [What does this plugin or user give up to honor this principle? There must be a real cost. If following this principle is free, it's not a principle — it's a platitude. E.g., "The plugin gives up the ability to run silently end-to-end without user involvement, because confirmation gates are required at key decision points."]
Tiebreaker: [If this principle conflicts with another principle in this plugin, which one wins? State the rule. E.g., "When P2 and P3 conflict, P2 takes precedence — correctness over speed." If no conflict is expected: "None."]
Risk Areas: [Which parts of this plugin are most likely to violate this principle under implementation pressure? E.g., "The session-end hook, where the temptation is to skip the queue review to reduce friction."]
Commands (/[name] <subcommand>)
Skills
- [skill-name]: [When does Claude invoke this contextually?]
Hooks
- [hook-event] → [script-name.sh]: [What does this hook detect/enforce?]
Scripts
- [script-name.sh]: [Called by? Does what?]
Agents (if applicable)
- [agent-name]: [What task does it handle? What tool restrictions apply?]
MCP Server (if applicable)
- [server-name]: [What tools does it expose?]
~/.plugin-name/
config.yaml # [Purpose. Format. What breaks if absent?]
state.json # [Purpose. Format. What breaks if corrupted?]
cache/
snapshot.json # [Purpose. Invalidation policy.]
# ~/.plugin-name/config.yaml (example)
field-one: value # [What does this field control?]
field-two: value # [What does this field control?]| Component | Enters context? | When? |
|---|---|---|
| Command markdown | Yes | On /[name] invocation |
| Skills | Conditionally | When Claude deems relevant |
| Hook scripts | No | Run externally; only stdout returned |
| Scripts | No | Run externally; only stdout returned |
| Agent definitions | No (for parent) | Loaded by spawned agent |
| [State file summary] | Yes | [When?] |
| Failure | Detection | Behavior | Recovery |
|---|---|---|---|
| Config file missing | [How?] | [What happens?] | [How to recover?] |
| [External dependency] unavailable | [How?] | [What happens?] | [Recovery command?] |
| State file corrupted | [How?] | [What happens?] | [Recovery?] |
- [Step 1] [→ P1]
- [Step 2]
- [Step 3] [→ P2]
- [Step 1]
- [Step 2]
- [Step 1]
Self-test checks (all read-only, non-destructive):
- [Check 1: e.g., config file exists and contains required fields]
- [Check 2: e.g., state file is valid JSON or absent]
- [Check 3: e.g., external dependency is reachable]
What bats covers:
- Happy path: [description of core script behavior]
- Error path: [description of failure handling]
- Edge case: [description of boundary condition]
All bats tests use $BATS_TMPDIR/[plugin]-test/ — never production files.
PTH checks for this plugin:
- Hook registration: hooks.json uses the record format (keyed by event name)
- Command structure: all commands have required frontmatter fields
- Skill triggers: skill files have appropriate trigger metadata
- [Plugin-specific]: [describe any non-standard structural contract]
Sandbox setup:
# [Commands to create a throwaway test environment]
# Override config to point at sandbox, not production stateScenarios (one Claude session per scenario):
- [Scenario name] — invoke [command/trigger], verify [expected outcome]
- [Scenario name] — invoke [command/trigger], verify [expected outcome]
- Error path — [trigger failure condition], verify [expected error handling]
| # | Question | Why it matters | Owner | Status |
|---|---|---|---|---|
| OQ1 | [Specific, answerable question] | [Concrete consequence if unresolved] | TBD | Open |
| Term | Definition |
|---|---|
| [Term] | [Definition] |
| Command | Description | Key flags |
|---|---|---|
/[name] [subcommand] |
[Description] | --[flag] |
| Field | Required | Type | Default | Notes |
|---|---|---|---|---|
[field-name] |
✓ | string | — | [What it controls, what breaks if wrong] |