writing-plan-docs
Skill188 starsChanged 5 months agoApache-2.0View on GitHub
Write planning documents for new permit0 features, integrations, or significant changes. Use when the user asks to plan, design, spec, or write a plan for a new integration, pack, feature, or architectural change in the permit0 repository.
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- driveSkill
- reviewing-plan-docsSkill
- revising-plan-docsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 10 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when the user asks you to plan a new integration (e.g.
- Very specific: line 30
Path: Always under docs/plans/<feature-name>/.
- Distinctive: line 32
Naming: Use lowercase-kebab-case for the feature directory.
- Distinctive: line 36
Not every plan needs all six docs.
- Very specific: line 92
NOT changed is important in permit0 because most features are I/O-layer changes with no engine/scoring/pack impact.
- Distinctive: line 148
Every doc should open with:
- Distinctive: line 158
Write docs in dependency order.
- Very specific: line 170
Start with 00-overview and 01-protocol (can be parallel), then 02-implementation, then 03-configuration / 04-testing / 05-limitations (can …
- Distinctive: line 176
Before writing any plan doc:
- Very specific: line 178
Read the reference implementation: if one exists. For integrations, read crates/permit0-cli/src/cmd/hook.rs (the Claude Code hook) end to …
- Distinctive: line 181
Research the external system's hook/plugin docs: Use web search. Read the actual schema, not just summaries.
- Distinctive: line 189
No emojis in plan docs.
- Distinctive: line 190
Use tables for comparisons and matrices.
- Very specific: line 191
Use fenced code blocks for JSON/TOML/Rust with the language tag.
- Distinctive: line 192
Keep each doc under 300 lines.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing Plan Docs for permit0
When to Use
Use this skill when the user asks you to plan a new integration (e.g. a new agent host like Codex, Cursor, CrewAI), a new pack, a new crate, or any multi-step change that benefits from upfront design before code.
Where to Place Plans
docs/plans/<feature-name>/
00-overview.md
01-protocol.md (if wire format / API contract exists)
02-implementation.md
03-configuration.md (if user-facing setup is needed)
04-testing.md
05-limitations.md- Path: Always under
docs/plans/<feature-name>/. - Numbering: Prefix with
00-through0N-for reading order. - Naming: Use lowercase-kebab-case for the feature directory.
Documents to Write
Not every plan needs all six docs. Pick the ones that apply.
00-overview.md (always required)
The entry point. A reader should understand what, why, and how far after reading only this file.
Cover:
- Goal -- What this feature does, in one paragraph. If it replicates an existing integration, say so and link to the reference implementation.
- Data flow -- ASCII or mermaid diagram showing the end-to-end path.
- Comparison table -- If a similar feature exists (e.g. Claude Code integration), a side-by-side table of what is the same and what differs.
- Scope -- Bullet list of what is in v1 vs deferred to v2+.
- Crate dependencies -- Which crates are touched and which are not. permit0's architecture makes most features crate-local; call that out.
Header template:
# 00 -- <Feature>: Overview and Architecture
**Status:** Draft
**Depends on:** None
**Blocks:** 01-protocol, 02-implementation01-protocol.md (when there is a wire format)
Exact schemas for any JSON, TOML, HTTP, or stdin/stdout contract.
Cover:
- Input schema -- Every field, type, whether always present or optional.
- Output schema -- Every possible response shape. Show concrete JSON examples for each verdict/outcome.
- Mapping table -- How permit0 types (
Permission,Tier, etc.) map to the external system's values. - Error handling matrix -- What happens on crash, timeout, malformed output, transport failure. Table format works well.
- Session / identity extraction -- Where session IDs come from, fallback chain.
- Future extensions -- Schemas or hooks that exist in the external system but are not used in v1.
02-implementation.md (always required)
The code-level plan. A developer should know exactly which files to touch and what to add after reading this.
Cover:
- Changes -- Numbered list of specific code changes. Include the file path and a Rust/TS/Python snippet showing the type or function signature.
- Files changed vs not changed -- Table format. Explicitly listing files NOT changed is important in permit0 because most features are I/O-layer changes with no engine/scoring/pack impact.
- Key decisions -- If there were architectural choices (new file vs extend existing, new enum variant vs trait impl), state the decision and the reasoning in one sentence.
- Migration path -- What existing users need to do (usually nothing).
- Risk assessment -- What breaks if this goes wrong, what the blast radius is.
03-configuration.md (when user-facing setup exists)
Step-by-step guide a user follows to enable the feature.
Cover:
- Prerequisites -- What to install, build, or configure first.
- Step-by-step -- Numbered steps with copy-pasteable config snippets. Show both JSON and TOML if the external system supports both.
- Configuration variants -- One subsection per mode (local, remote, session-aware, shadow, calibration, project-local, with-profile).
- Environment variable overrides -- Table of env vars, what they override, and example values.
- Verification -- How to confirm the integration works end-to-end.
Important: use absolute paths in examples. Note when ~ does not expand.
04-testing.md (always required)
Cover:
- Unit tests -- List each test by name with a one-line description and a code snippet showing the assertion. Group by concern (parsing, output serialization, session ID, edge cases).
- Regression tests -- Explicit list of existing tests that must still pass unchanged.
- Integration tests -- Shell commands that pipe input through the binary and assert stdout/exit code.
- Manual test script -- A
scripts/test-<feature>.shthat a developer can run interactively. - Edge case matrix -- Table of scenarios and expected behavior (timeout, large input, missing fields, daemon down, etc.).
05-limitations.md (when there are known gaps)
Cover:
- v1 limitations -- Each limitation gets its own subsection with:
- Problem: What does not work.
- v1 workaround: What the user sees instead.
- Impact: How bad is it (low/medium/high).
- Risk: What happens if a developer accidentally hits this.
- Future work -- Versioned roadmap (v2, v3) with one paragraph per item describing the approach, not just the goal.
Document Metadata
Every doc should open with:
**Status:** Draft | Review | Approved
**Depends on:** <list of docs that must be read/written first>
**Blocks:** <list of docs that depend on this one>Dependency Order
Write docs in dependency order. The typical graph:
00-overview (first)
+-> 01-protocol
+-> 02-implementation (depends on 00 + 01)
+-> 03-configuration
+-> 04-testing
01-protocol +-> 05-limitations
02-implementation +-> 05-limitationsStart with 00-overview and 01-protocol (can be parallel), then
02-implementation, then 03-configuration / 04-testing / 05-limitations
(can be parallel).
Research Before Writing
Before writing any plan doc:
- Read the reference implementation if one exists. For integrations,
read
crates/permit0-cli/src/cmd/hook.rs(the Claude Code hook) end to end. Understand the existing I/O protocol, not just the engine. - Research the external system's hook/plugin docs. Use web search. Read the actual schema, not just summaries. Pay attention to what is supported vs "parsed but not implemented."
- Identify the critical difference. Most integrations share 90% of the flow. Find the 10% that differs and make that the focus of the plan.
Style
- No emojis in plan docs.
- Use tables for comparisons and matrices.
- Use fenced code blocks for JSON/TOML/Rust with the language tag.
- Keep each doc under 300 lines. If it grows beyond that, split.
- Link to source files using relative paths from the doc location
(e.g.
[hook.rs](../../../crates/permit0-cli/src/cmd/hook.rs)).
Reference Example
The Codex CLI integration plan at docs/plans/codex-integration/ is the
reference for this skill. Read those files for concrete examples of each
document type.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

