init_project_docs
Set up standardized documentation structure for projects by creating organized folders and templates based on project type and name.
Instructions
Initialize Universal Project Documentation Standard structure
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory_path | Yes | Path to project directory to initialize | |
| project_name | Yes | Name of the project for templates | |
| project_type | No | Type of project (e.g., 'web-app', 'api', 'library') |
Implementation Reference
- src/index.ts:1752-1812 (handler)Handler for 'document_organizer__init_project_docs' tool (matches 'init_project_docs'): parses input, creates documentation directories (docs/plans/*, docs/progress), generates and writes template MD files (CURRENT_STATUS.md, ACTIVE_PLAN.md, .claude-instructions.md), skips existing files, returns JSON summary
case "document_organizer__init_project_docs": { const { directory_path, project_name, project_type } = InitProjectDocsArgsSchema.parse(args); const validatedPath = validatePath(directory_path); // Create required directory structure const requiredDirs = [ 'docs', 'docs/plans', 'docs/plans/archived', 'docs/plans/superseded', 'docs/progress' ]; for (const dir of requiredDirs) { await fs.mkdir(path.join(validatedPath, dir), { recursive: true }); } // Generate templates const currentStatusContent = generateCurrentStatusTemplate(project_name, project_type); const activePlanContent = generateActivePlanTemplate(project_name); const claudeInstructionsContent = generateClaudeInstructionsTemplate(project_name, project_type); // Write required files const filesToCreate = [ { path: 'CURRENT_STATUS.md', content: currentStatusContent }, { path: 'ACTIVE_PLAN.md', content: activePlanContent }, { path: '.claude-instructions.md', content: claudeInstructionsContent } ]; const createdFiles = []; const skippedFiles = []; for (const file of filesToCreate) { const fullPath = path.join(validatedPath, file.path); try { // Check if file already exists await fs.access(fullPath); skippedFiles.push(file.path); } catch { // File doesn't exist, create it await fs.writeFile(fullPath, file.content, 'utf-8'); createdFiles.push(file.path); } } return { content: [ { type: "text", text: JSON.stringify({ project_initialized: true, project_path: validatedPath, directories_created: requiredDirs, files_created: createdFiles, files_skipped: skippedFiles, message: `Project documentation standard initialized for ${project_name}` }, null, 2) } ] }; } - src/index.ts:71-75 (schema)Zod input schema validation for init_project_docs tool parameters: directory_path (required), project_name (required), project_type (optional)
const InitProjectDocsArgsSchema = z.object({ directory_path: z.string().describe("Path to project directory to initialize with documentation standard"), project_name: z.string().describe("Name of the project for templates"), project_type: z.string().optional().describe("Type of project (e.g., 'web-app', 'api', 'library')") }); - src/index.ts:1331-1334 (registration)MCP tool registration entry for 'document_organizer__init_project_docs' (init_project_docs), with description and schema reference
name: "document_organizer__init_project_docs", description: "π INITIALIZE PROJECT DOCUMENTATION - Create Universal Project Documentation Standard structure with required files (CURRENT_STATUS.md, ACTIVE_PLAN.md, .claude-instructions.md) and directory structure. Generates templates customized for the specific project type and creates docs/plans/archived, docs/progress directories for proper documentation management.", inputSchema: zodToJsonSchema(InitProjectDocsArgsSchema) as ToolInput, }, - src/index.ts:899-932 (helper)Helper function generating content template for CURRENT_STATUS.md file used by the tool handler
function generateCurrentStatusTemplate(projectName: string, projectType?: string): string { const currentDate = new Date().toISOString().split('T')[0]; return `# ${projectName} - Current Project Status **Last Updated:** ${currentDate} **Active Plan:** [ACTIVE_PLAN.md](./ACTIVE_PLAN.md) **Current Branch:** main **Project Focus:** ${projectType || 'Development project'} ## What's Actually Done β - [ ] Initial project setup ## In Progress π‘ - [ ] Document project requirements - [ ] Set up development environment ## Blocked/Issues β - [ ] No current blockers identified ## Next Priority Actions 1. Define project scope and requirements 2. Set up development environment 3. Create initial architecture ## Component/Feature Status Matrix | Component | Design | Backend | Frontend | Testing | Status | |-----------|--------|---------|----------|---------|--------| | Core Setup | π‘ | β | β | β | 25% Complete | ## Recent Key Decisions - **${currentDate}:** Implemented Universal Project Documentation Standard ## Development Environment Status - **Development Setup:** π‘ In Progress `; - src/index.ts:935-990 (helper)Helper function generating content template for ACTIVE_PLAN.md file used by the tool handler
function generateActivePlanTemplate(projectName: string): string { const currentDate = new Date().toISOString().split('T')[0]; return `# ${projectName} Active Development Plan **Status:** ACTIVE **Created:** ${currentDate} **Last Updated:** ${currentDate} **Supersedes:** N/A (Initial plan) ## Current Focus: Initial Project Setup ## Immediate Priorities (Next 1-2 Weeks) ### 1. Project Foundation (High Priority) **Status:** 0% Complete **Remaining Work:** - [ ] Define project scope and objectives - [ ] Set up development environment - [ ] Create initial architecture documentation - [ ] Establish development workflow **Files to Work On:** - \`README.md\` - Project overview and setup instructions - \`.gitignore\` - Version control configuration - \`package.json\` or equivalent - Project dependencies ### 2. Documentation Setup (Medium Priority) **Status:** 50% Complete **Remaining Work:** - [ ] Complete project documentation structure - [ ] Create development guidelines - [ ] Set up automated documentation ## Success Criteria - [ ] Development environment is fully functional - [ ] Project structure is established - [ ] Initial documentation is complete - [ ] Development workflow is defined ## Weekly Milestones ### Week 1 (${currentDate}) - [ ] Complete project setup - [ ] Establish documentation standard - [ ] Define initial architecture ## Risk Mitigation ### High-Risk Items 1. **Scope Creep:** Project requirements may expand - *Mitigation:* Define clear boundaries and priorities - *Fallback:* Phase development approach ## Contact Points ### Immediate Next Actions (This Week) 1. **Priority 1:** Define project scope and requirements 2. **Priority 2:** Set up development environment 3. **Priority 3:** Create initial architecture documentation `;