Initialize project with standard directory structure
Sets up project management structure with directories and CLAUDE.md template.
/plugin marketplace add dionridley/claude-plugins/plugin install project-management@dion-toolsThis command initializes a project with the standard directory structure and CLAUDE.md file for project management workflows.
You are executing the /dr-init command to set up or verify the project management structure.
CRITICAL: Before doing anything else, determine the current state of the project.
Check if CLAUDE.md exists in the current working directory
CLAUDE.mdIf CLAUDE.md exists AND has content, check for version marker:
<!-- Plugin: project-management near the top of the fileCheck if _claude/ directory exists:
ls -la _claude to check_claude/ structure exists_claude/ does NOT existDetermine project state based on findings:
STATE A (Fresh Project):
_claude/ directory existsSTATE B (Already Initialized):
<!-- Plugin: project-management_claude/ directory exists with expected structureSTATE C (Uninitialized):
_claude/ directoryExecute these steps in order:
Create directory structure:
mkdir -p _claude/docs
mkdir -p _claude/plans/draft
mkdir -p _claude/plans/in_progress
mkdir -p _claude/plans/completed
mkdir -p _claude/prd
mkdir -p _claude/resources
mkdir -p _claude/research
Create .gitkeep files in ALL 7 leaf directories:
_claude/docs/.gitkeep_claude/plans/draft/.gitkeep_claude/plans/in_progress/.gitkeep_claude/plans/completed/.gitkeep_claude/prd/.gitkeep_claude/resources/.gitkeep_claude/research/.gitkeepUse: touch _claude/docs/.gitkeep for each file
Get current date:
Read the CLAUDE.md template:
${CLAUDE_PLUGIN_ROOT}/templates/CLAUDE-template.mdReplace placeholders in template:
{{CURRENT_DATE}} with actual current date from systemCreate CLAUDE.md:
CLAUDE.md in working directoryShow success feedback:
â
Project structure initialized!
Created:
_claude/docs/ (.gitkeep added)
_claude/plans/draft/ (.gitkeep added)
_claude/plans/in_progress/ (.gitkeep added)
_claude/plans/completed/ (.gitkeep added)
_claude/prd/ (.gitkeep added)
_claude/resources/ (.gitkeep added)
_claude/research/ (.gitkeep added)
CLAUDE.md (project guidelines)
Next steps:
1. Review and customize CLAUDE.md for your project
2. Add project-specific commands (build, test, lint, etc.)
3. Commit the new structure: git add _claude/ CLAUDE.md
4. Create your first PRD: /dr-prd [feature description]
5. Or conduct research: /dr-research [topic]
đĄ Note: CLAUDE.md is yours to customize. The plugin will never automatically modify it.
Execute these steps:
Check which folders exist:
_claude/Create any missing folders:
mkdir -pNEVER modify CLAUDE.md:
Show appropriate feedback:
If nothing was missing:
â
Project structure verified
Directory structure: Already exists (â)
CLAUDE.md: Already exists (â)
Your project is already initialized.
đĄ Your CLAUDE.md is customized for your project. The plugin will never
automatically modify it to preserve your customizations.
To adopt new template features from plugin updates:
1. Review plugin release notes
2. Manually add desired improvements to your CLAUDE.md
If folders were missing:
â
Project structure updated
Created missing directories:
_claude/plans/in_progress/ (.gitkeep added)
CLAUDE.md: Preserved (â)
Your existing CLAUDE.md has been preserved. Missing directories have been created.
Execute these steps:
Count lines in existing CLAUDE.md:
wc -l CLAUDE.md or similarShow detection message with options:
â ī¸ CLAUDE.md exists but project is not initialized with plugin structure
Current CLAUDE.md: [X] lines
This appears to be a custom or minimal CLAUDE.md file. The project-management
plugin can help set up the recommended structure.
Options:
[a] Append plugin template to your existing CLAUDE.md
- Adds plugin sections to end of your file
- Preserves all existing content
- Creates _claude/ folder structure
[s] Show plugin template (you copy/paste what you want)
- Displays full template content
- Creates _claude/ folder structure
- You manually add desired sections
[c] Cancel (do nothing)
Choice [a/s/c]:
Wait for user to type choice (Use AskUserQuestion tool if available, otherwise inform user to respond)
Handle user choice:
If user chooses 'a' (Append):
a. Create _claude/ folder structure and .gitkeep files (same as State A steps 1-2)
b. Read existing CLAUDE.md content
c. Get current date from system
d. Read plugin template from ${CLAUDE_PLUGIN_ROOT}/templates/CLAUDE-template.md
e. Replace {{CURRENT_DATE}} with actual date
f. Combine content:
\n---\n\ng. Write combined content to CLAUDE.md
h. Show feedback:
â
Plugin structure added!
Created:
_claude/docs/ (.gitkeep added)
_claude/plans/draft/ (.gitkeep added)
_claude/plans/in_progress/ (.gitkeep added)
_claude/plans/completed/ (.gitkeep added)
_claude/prd/ (.gitkeep added)
_claude/resources/ (.gitkeep added)
_claude/research/ (.gitkeep added)
Updated: CLAUDE.md
- Added version tracking comment at top
- Appended plugin template sections:
âĸ Project Structure explanation
âĸ Plan Management Workflow
âĸ Available Commands
âĸ Development principles
Your existing content has been preserved at the beginning of the file.
Next steps:
1. Review CLAUDE.md - your content is at the top, plugin sections at the bottom
2. Reorganize/merge sections as desired
3. Commit the new structure: git add _claude/ CLAUDE.md
4. Start using plugin commands: /dr-prd, /dr-plan, /dr-research
If user chooses 's' (Show):
a. Create _claude/ folder structure and .gitkeep files (same as State A steps 1-2)
b. Get current date from system
c. Read plugin template from ${CLAUDE_PLUGIN_ROOT}/templates/CLAUDE-template.md
d. Replace {{CURRENT_DATE}} with actual date
e. Display template content:
â
Folder structure created!
Created:
_claude/docs/ (.gitkeep added)
_claude/plans/draft/ (.gitkeep added)
_claude/plans/in_progress/ (.gitkeep added)
_claude/plans/completed/ (.gitkeep added)
_claude/prd/ (.gitkeep added)
_claude/resources/ (.gitkeep added)
_claude/research/ (.gitkeep added)
CLAUDE.md: Preserved (not modified)
đ Plugin template content (copy sections you want to your CLAUDE.md):
---BEGIN TEMPLATE---
[Display full template content here]
---END TEMPLATE---
Next steps:
1. Review the template above
2. Copy sections you want to your CLAUDE.md
3. Commit the new structure: git add _claude/ CLAUDE.md
If user chooses 'c' (Cancel):
Show message:
âšī¸ Cancelled - no changes made
Your CLAUDE.md and project structure remain unchanged.
Run /dr-init again when you're ready to set up the plugin structure.
_claude/plans/draft not _claude\plans\draftThe template path uses the plugin root environment variable:
${CLAUDE_PLUGIN_ROOT}/templates/CLAUDE-template.mdUse the Read tool to access it with the full path.
Follow the instructions above to initialize or update the project structure. Start with Phase 1: Detect Project State.