Tutorial: Using the Merge Command
This tutorial shows how to use the aichaku merge-docs command to merge documentation from completed projects into the
central documentation structure.
Prerequisites
Section titled “Prerequisites”- Aichaku installed and configured
- At least one completed project in
docs/projects/done/ - Documentation files following naming conventions
Step 1: Understanding the Merge Process
Section titled “Step 1: Understanding the Merge Process”The merge command automatically:
- Scans
docs/projects/done/for completed projects - Identifies documentation files by naming patterns
- Copies them to appropriate central locations
- Adds metadata headers for tracking
Step 2: Preview the Merge
Section titled “Step 2: Preview the Merge”Before making changes, preview what will happen:
aichaku merge-docs --dry-runThis shows you:
- Which files will be merged
- Where they will be placed
- Any conflicts that need resolution
Step 3: Perform the Merge
Section titled “Step 3: Perform the Merge”Once you’re satisfied with the plan:
aichaku merge-docsOr to merge a specific project:
aichaku merge-docs --project done-2025-07-28-my-featureStep 4: Handle Conflicts
Section titled “Step 4: Handle Conflicts”If files already exist, use the --force flag:
aichaku merge-docs --forceFile Classification
Section titled “File Classification”The merge command classifies files by naming pattern:
tutorial-*.md→docs/tutorials/how-to-*.md→docs/how-to/reference-*.md→docs/reference/explanation-*.md→docs/explanation/
Best Practices
Section titled “Best Practices”- Use descriptive filenames that indicate the document type
- Review the dry-run output before merging
- Check merged files to ensure proper formatting
- Update indexes after merging new documentation
Troubleshooting
Section titled “Troubleshooting”File Not Merged
Section titled “File Not Merged”- Check the filename follows the naming convention
- Verify the project is in
docs/projects/done/ - Ensure the file is a
.mdfile
Permission Errors
Section titled “Permission Errors”- Verify write permissions to the docs directory
- Check that target directories exist
Conflicts
Section titled “Conflicts”- Use
--forceto overwrite existing files - Review existing content before overwriting
Next Steps
Section titled “Next Steps”After merging documentation:
- Update the main documentation index
- Test links and references
- Consider updating navigation menus
- Review the merged content for accuracy
This completes the documentation merge tutorial!