ID:WORK-142Status:done
Make plan init tool-agnostic
refrakt plan init currently hardcodes writing workflow instructions to CLAUDE.md. Decouple the init command from any specific AI tool so the plan package works naturally for users of Cursor, GitHub Copilot, Windsurf, Cline, Aider, or no AI tool at all.
Priority:mediumComplexity:moderateSource:SPEC-039
Acceptance Criteria
plan initgenerates a standaloneplan/INSTRUCTIONS.mdcontaining the full workflow guide (CLI commands, ID conventions, status workflows, content structure)- The generated instructions file contains no references to any specific AI tool
plan init --agent claudeappends a short pointer toCLAUDE.mdreferencing the instructions fileplan init --agent cursorappends to.cursorrulesplan init --agent copilotappends to.github/copilot-instructions.mdplan init --agent noneskips appending to any instruction file- Default behavior (no
--agentflag) auto-detects by checking which instruction files exist in the project root - Auto-detect falls back to
CLAUDE.mdwhen no known instruction files are found - The appended content is a short summary with a pointer to the full instructions file, not the full workflow docs
- Existing
plan/CLAUDE.mdcontent is migrated to the newplan/INSTRUCTIONS.mdwith Claude-specific framing removed site/content/runes/plan/workflow.mdrewritten as general "AI assistant integration" guide (currently Claude Code-specific)site/content/runes/plan/index.mdreferences toCLAUDE.mdupdatedsite/content/runes/plan/cli.mdreferences toCLAUDE.mdupdated
Approach
Files to modify
runes/plan/src/commands/init.ts— replaceWORKFLOW_SECTIONwith a short pointer template; add--agentflag handling; generateINSTRUCTIONS.mdrunes/plan/src/cli-plugin.ts— wire--agentargument through tohandleInitrunes/plan/src/commands/templates.ts— may need a new template for the instructions file content
Agent detection
Check for existence of these files in the project root (in order):
CLAUDE.md.cursorrules.github/copilot-instructions.md.windsurfrules.clinerules
Append to all that exist. If none exist, create CLAUDE.md for backwards compatibility.
Pointer content
The appended snippet should be roughly:
## Plan
Project planning content lives in `plan/` using `@refrakt-md/plan`. See `plan/INSTRUCTIONS.md` for the full workflow guide.
Quick start: `refrakt plan next` | `refrakt plan status` | `refrakt plan create work --title "..."`
References
- Plan Package Onboarding & Conventions Review — parent spec
Resolution
Completed: 2026-04-14
Branch: claude/plan-package-review-Z4sJE
What was done
- Added
--agentflag toplan init(claude, cursor, copilot, windsurf, cline, none) plan initnow generatesplan/INSTRUCTIONS.mdwith full tool-agnostic workflow guide- Auto-detection: checks project root for existing agent instruction files, appends pointer to all found
- Short pointer section appended to agent files instead of full workflow docs
InitResult.claudeMdUpdatedreplaced withagentFilesUpdated: string[]- Rewrote
site/content/runes/plan/workflow.mdas generic AI assistant guide - Updated CLAUDE.md and site doc references
- Renamed
plan/CLAUDE.mdtoplan/INSTRUCTIONS.md - 27 tests covering all agent modes (auto-detect, explicit, none)
Files changed
runes/plan/src/commands/init.ts— core logic + INSTRUCTIONS_CONTENT + agent detectionrunes/plan/src/cli-plugin.ts—--agentarg wiringrunes/plan/test/init.test.ts— new agent mode testssite/content/runes/plan/workflow.md— rewrittensite/content/runes/plan/index.md— updated referencessite/content/runes/plan/cli.md— updated init section + fixed milestone dir bug
Relationships
Dependency of
History
- 9d26424statusready→done
- ☑ `plan init` generates a standalone `plan/INSTRUCTIONS.md` containing the full workflow guide (CLI commands, ID conventions, status workflows, content structure)
- ☑ The generated instructions file contains no references to any specific AI tool
- ☑ `plan init --agent claude` appends a short pointer to `CLAUDE.md` referencing the instructions file
- +10 more criteria
- e386005
- + `site/content/runes/plan/workflow.md` rewritten as general "AI assistant integration" guide (currently Claude Code-specific)
- + `site/content/runes/plan/index.md` references to `CLAUDE.md` updated
- + `site/content/runes/plan/cli.md` references to `CLAUDE.md` updated
- 2d6c332Created (ready, medium, moderate, SPEC-039, plan, cli, onboarding, dx)