.pi/agent/skills/plan/SKILL.md
Plan phase for atom workflow. Guides LLM to produce a structured _notes/plan.md with acceptance criteria and TODOs. Never executes — only plans. Use when entering plan phase, after /atom:init, or when /atom:recall shows phase=plan.
npx skillsauth add popoffvg/dotfiles planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a planner, not an executor.
_notes/._notes/plan.md and _notes/worklog.md ONLY.plan → /work:implement → auto-verify → verify → /work:plan → ...
Check if this is:
_notes/plan.md content (only scaffold from /atom:init)_notes/research-*.md files exist with findingsIf iterating:
_notes/worklog.md for what was attemptedBefore writing or rewriting major plan sections, run a Decision Freeze Check:
Read all _notes/*.md files for current state.
You may also READ source files to understand the codebase — but never modify them.
If _notes/research-*.md files exist, incorporate their findings into the plan.
While reading, collect implementation guidelines: coding patterns, naming conventions, test styles, or project rules the implementer must follow. You will write these into the plan in Step 3.
Write everything to a single file _notes/plan.md. The plan is a TODO list.
Every Acceptance Criteria and TODO entry must be a - [ ] checkbox. This is the contract with the implement phase — it can only check off TODOs, not change the plan text.
# Plan
## Description
<what this work is about>
## Implementation Guidelines
> Rules the implementer must follow. Written by the planner based on codebase reading and available skills.
### Skills
List skills the implementer should load. Reference skills from `<available_skills>` by name.
- `go-modify` — for any Go file edits (pre-edit analysis, gopls validation)
- `bdd-tests` — all new tests must follow BDD Given/When/Then scenario structure
- `work-commit` — commit message conventions
### Coding Patterns
Patterns discovered from reading the codebase that the implementer must replicate:
- <pattern observed in file X — e.g. "all handlers return structured errors via `pkg/errors.Wrap`">
- <e.g. "tests use helper transactions with retry on conflict">
### References
Existing files or docs that demonstrate the expected style:
- `<path/to/example_file>` — reference implementation for <pattern>
- `<path/to/test_file>` — shows expected test structure
> If no project-specific patterns were found, write "No project-specific guidelines identified — follow language defaults and loaded skills."
## Acceptance Criteria
- [ ] Auth endpoint returns 401 for expired tokens
- [ ] Refresh token rotation works with Redis TTL
- [ ] SDK client handles token refresh transparently
- [ ] Integration tests pass for all auth flows
## TODOs
- [ ] Add refresh endpoint to `core/pl/pkg/auth/handler.go`
- endpoint path: POST /auth/refresh
- ```pseudo
func HandleRefresh(w, r)
body = decode(r.Body) -> RefreshRequest
if body.Token == "" -> 400
pair, err = tokenService.Refresh(body.Token)
if err == ErrExpired or ErrNotFound -> 401
respond(w, 200, pair)
```
- edge cases:
- empty body → 400, not panic
- malformed JSON → 400 with message
- expired refresh token → 401
- [ ] Implement token rotation in `core/pl/pkg/auth/token.go`
- ```pseudo
func (s *Service) Refresh(token string) -> (TokenPair, error)
stored = s.store.Get(token)
if stored == nil -> return ErrNotFound
if stored.Expired() -> s.store.Delete(token); return ErrExpired
newPair = s.generate(stored.UserID)
s.store.Delete(token)
s.store.Set(newPair.Refresh, TTL)
return newPair
```
- edge cases:
- concurrent refresh with same token → only first succeeds
- refresh token valid but user deleted → error, not new tokens
- store unavailable (Redis down) → 500, not silent failure
- [ ] Update SDK client in `core/platforma/sdk/src/auth.ts`
- transparent refresh on 401 response
- retry original request after refresh
- edge cases:
- refresh itself returns 401 → surface error, don't retry infinitely
- concurrent requests during refresh → queue, don't fire N refreshes
- [ ] Add integration tests in `core/pl/pkg/auth/handler_test.go`
- test expired token → 401
- test valid refresh → new tokens
- test rotation invalidates old token
## Repos
- repo: .
branch: <current branch>
## Work Notes
- `_notes/worklog.md` — progress log
## Decisions Log
- D1: <short decision statement>
- status: fixed
- rationale: <why>
- trade-offs: <pros/cons>
## Open Questions
- Q1: <question that blocks detailed planning>
- owner: <user/agent>
- needed by: <TODO ID or milestone>
Plan MUST have both Acceptance Criteria and TODOs. Do not signal readiness until both sections are filled.
If a TODO depends on an unresolved question, mark it explicitly (e.g., depends on Q1) instead of guessing.
decisions: D1, D3)Ask clarifying questions instead of guessing when:
Prefer 1–3 focused questions, then update the plan.
Every TODO that introduces or changes a function MUST include:
Example:
- [ ] Add token refresh in `pkg/auth/handler.go`
- file: `pkg/auth/handler.go`
- ```pseudo
func RefreshToken(req RefreshRequest) -> (TokenPair, error)
token = store.Get(req.RefreshToken)
if token == nil or token.Expired() -> return ErrInvalidToken
newPair = generateTokenPair(token.UserID)
store.Delete(req.RefreshToken) // rotate: old token dies
store.Set(newPair.RefreshToken, TTL)
return newPair
```
- edge cases:
- expired refresh token → 401, old token removed from store
- missing refresh token (empty string) → 400, not 500
- concurrent refresh with same token → only first succeeds, second gets 401
- refresh token valid but user deleted → 401
When pseudocode is NOT needed:
When edge case tests are NOT needed:
For stateful TODOs, default to:
Do not create a separate .qnt spec by default. Avoid duplicating logic across multiple docs.
Use Quint only when all are true:
quint typecheck/quint verify in this repo.If any condition is false, keep formal content inline as pseudocode + invariants.
Before introducing Quint, ask:
Append to _notes/worklog.md: - YYYY-MM-DD HH:MM: <action summary>
When the plan has both Acceptance Criteria and TODOs filled, and no critical unresolved questions:
Plan is ready. Run `/work:implement` to begin autonomous implementation.
Do NOT signal readiness if Acceptance Criteria is missing OR critical Open Questions remain.
If unknowns surface:
Unknowns found: <list>. Clarifications/research needed before planning can continue.
| User says | You do |
|-----------|--------|
| "add X feature" | Add as TODO with sub-items for details |
| "fix bug in Y" | Add as TODO, note the file/location |
| "use approach Z" | Record in Decisions Log (with a new D# entry) |
| "what about X?" | Discuss, then update plan if agreed |
| "looks good" | Confirm plan is ready, suggest /work:implement |
| "change the order" | Reorder TODOs |
Every user message refines the plan. Nothing gets executed.
plan → implement: User runs /work:implement. Never transition manually.plan → research: If unknowns found, suggest user switch to research.plan → todo: User runs /work:todo for ad-hoc chat.Eval checklist:
Implementation Guidelines section (skills + patterns or explicit "none")?_notes/?Test inputs:
Can change: plan template, TODO format, criteria examples, design decision format Cannot change: read-only enforcement (no code changes), plan location (_notes/plan.md), checkbox contract Min sessions before eval: 5 Runs per experiment: 3
tools
Improve a whole CLAUDE.local.md — the private, per-project rules captured from user corrections. Wraps each conditional rule in a <task-relevant> block so it only surfaces for matching work, merges duplicates, generalizes one-off facts, drops stale entries, and routes raw project facts to engram. Use when the user says "improve claude.local", "clean up the local rules", "claude.local is bloated", or after the Stop hook has appended many rules.
testing
WM pipeline and conventions shared across all phases. Agents must read this before spec, impl, or verify work.
development
One entry point for spec writing, implementation, and bug fixing. Default is new (write spec → grill loop → produce notes → author TODO bodies). Other subcommands: verify (audit), revise (sync to shipped), prototype (settle a decision), code-map (diagram), impl (execute one TODO), fix (analyze cause, correct thoughts, fix behavior), help (this page). Invoke as /code <subcommand>.
development
Red-Green-Refactor cycle for bug fixes. Before fixing a bug, first write a failing test that reproduces it (Red), then make the minimal change to pass (Green), then clean up the code (Refactor). Use on any bug fix, error correction, failing test repair, or when user says "fix this bug".