.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
testing
Use when the user asks to create test sets, enumerate scenarios, generate edge cases, or draft a coverage matrix before implementation.
testing
Use when the user asks to review, audit, score, or validate test sets for missed cases before execution or merge.
tools
Test harness plugins in isolation using tmux panes. Runs MCP servers, unit tests, typecheck, and Claude plugin loading. Use when user says "test plugin", "check plugin", "run plugin tests", "validate plugin", or names a specific plugin to test.
development
Guide for designing integration and e2e tests using BDD (Behavior-Driven Development) methodology with Cucumber-style Given/When/Then scenarios. Use when writing or reviewing tests for any service, API, or component. Language-agnostic — covers scenario structure, step notation, assertion principles, async patterns, and common anti-patterns.