Documentation Reorganization
Introduction
The mekara documentation needed restructuring to better separate standards (timeless best practices) from wiki content (how-to guides). This reorganization establishes a clear information architecture with a unified Standards section and separate Wiki tab, making it easier for both humans and AI agents to find relevant information.
Objectives
Reorganize the documentation to:
- Move mekara standards to a unified
standards/folder (sidebar position 3, after philosophy) - Move project commands to
wiki/project/and symlink them from.claude/commands/project/ - Create a separate "Wiki" tab at the top level of the Docusaurus site
- Standardize design document terminology and structure across all planning workflows
Architecture
Before:
docs/docs/
├── code-base/
│ ├── mekara/standard-mekara-project.md
│ └── documentation/
│ ├── standard-mekara-docs.md
│ └── planning-documents.md
├── usage/standard-mekara-workflow.md
└── roadmap/
.claude/commands/ # Directory with .md files
.mekara/scripts/ # Directory with .py files
After:
docs/
├── docs/
│ ├── standards/ # NEW: Unified standards section
│ │ ├── project.md
│ │ ├── documentation.md
│ │ ├── workflow.md
│ │ └── design-documents.md
│ └── roadmap/
└── wiki/ # NEW: Separate Wiki plugin
├── ai-tooling/
├── project/
└── target-platform/
.mekara/scripts/
├── nl/ # Natural language scripts (source of truth)
│ ├── plan-design-doc.md # Renamed from plan-roadmap.md
│ └── project/
└── compiled/ # Compiled scripts (source of truth)
.claude/commands/ # Symlink → .mekara/scripts/nl/
Design Details
File Organization Principles
- Standards (
docs/docs/standards/) contain timeless best practices and structural requirements - Wiki (
docs/wiki/) contains practical how-to guides organized by category - Roadmap (
docs/docs/roadmap/) contains design documents for planned features
Symlink Strategy
.claude/commands/is a symlink to.mekara/scripts/nl/for backward compatibility- Wiki content is copied (not symlinked) from
.mekara/scripts/nl/- the mekara scripts are the source of truth
Invariants
- All file moves must preserve git history via
git mv - Build must pass after each phase
- All cross-references must be updated when files move
Implementation Plan
Phase 1: Docusaurus Configuration ✅
Goal: Set up Wiki as a separate Docusaurus plugin with its own sidebar
Tasks:
- Create
docs/sidebarsWiki.tsfor wiki sidebar configuration - Update
docs/docusaurus.config.tsto add wiki plugin and navbar item - Create initial
docs/wiki/index.mdwith user's updated content - Verify configuration works with test build
Phase 2: Standards Reorganization ✅
Goal: Move all standards to a unified docs/docs/standards/ folder at sidebar position 3
Tasks:
- Create
docs/docs/standards/folder structure - Create
docs/docs/standards/index.mdwith overview - Move files with
git mv(preserves history):code-base/mekara/standard-mekara-project.md→standards/project.mdcode-base/documentation/standard-mekara-docs.md→standards/documentation.mdusage/standard-mekara-workflow.md→standards/workflow.md
- Update internal cross-references within moved files
- Update sidebar positions to integers:
- Philosophy:
sidebar_position: 2 - Standards:
sidebar_position: 3 - Usage:
sidebar_position: 4 - Development:
sidebar_position: 5 - Code Base:
sidebar_position: 6
- Philosophy:
- Update all external references across documentation:
docs/docs/index.mddocs/docs/philosophy.mddocs/docs/usage/index.mddocs/docs/development/quickstart/for-humans.mddocs/docs/code-base/mekara/index.mddocs/docs/code-base/documentation/index.md
- Fix cross-plugin link in wiki/index.md
- Verify build succeeds with no broken links
Phase 3: Complete Standards Section ✅
Goal: Add design documents standard and clean up sidebar labels
Tasks:
- Move
code-base/documentation/design-documents.mdtostandards/withgit mv - Update
design-documents.mdtitle to "Standard Mekara Design Documents" - Update
standards/index.md:- Change "three core standards" to "four core standards"
- Add link:
- [Design Documents](./design-documents.md) – Standard structure for roadmap and refactor plans
- Update all references to
design-documents.mdpath:.claude/commands/plan-design-doc.md.claude/commands/plan-refactor.mddocs/docs/code-base/documentation/index.md- Any other files found via grep
- Run bundle scripts to sync changes to
src/mekara/bundled/scripts/ - Remove "Standard Mekara" prefix from sidebar labels (keep in page titles):
project.md: Addsidebar_label: "Project"(title stays "Standard Mekara Project")documentation.md: Addsidebar_label: "Documentation"(title stays "Standard Mekara Documentation")workflow.md: Addsidebar_label: "Workflow"(title stays "Standard Mekara Workflow")design-documents.md: Addsidebar_label: "Design Documents"(title becomes "Standard Mekara Design Documents")
- Verify build succeeds with no broken links
Phase 4: Restructure Scripts Directory ✅
Goal: Reorganize .mekara/scripts/ and create symlink from .claude/commands/
Current structure:
.claude/commands/ # Directory with .md files
.mekara/scripts/ # Directory with .py files
Target structure:
.mekara/scripts/
├── nl/ # Natural language scripts (source of truth)
│ ├── *.md # Non-project commands
│ └── project/ # Project commands
│ └── *.md
└── compiled/ # Compiled scripts (source of truth)
├── *.py # Non-project compiled scripts
└── project/ # Project compiled scripts
└── *.py
.claude/commands/ # Symlink → .mekara/scripts/nl/
Tasks:
- Create directory structure:
-
.mekara/scripts/nl/and.mekara/scripts/nl/project/ -
.mekara/scripts/compiled/and.mekara/scripts/compiled/project/
-
- Move all
.pyfiles from.mekara/scripts/to.mekara/scripts/compiled/usinggit mv- Move
project/*.pyto.mekara/scripts/compiled/project/ - Move non-project
*.pyto.mekara/scripts/compiled/
- Move
- Move all
.mdfiles from.claude/commands/to.mekara/scripts/nl/usinggit mv- Move
project/*.mdto.mekara/scripts/nl/project/ - Rename
systematize-repo-setup.mdtosystematize.mdduring move (becomes/project:systematize) - Move non-project
*.mdto.mekara/scripts/nl/
- Move
- Remove empty
.claude/commands/directory - Create symlink:
.claude/commands→../.mekara/scripts/nl - Verify symlink works:
ls -la .claude/commands/should show content from.mekara/scripts/nl/
Phase 5: Create Wiki as Documentation Copy ✅
Goal: Create wiki structure with "How To's" organized by category
Note: These are documentation copies, not symlinks. The source of truth remains in .mekara/scripts/nl/.
Tasks:
- Create wiki directory structure:
-
docs/wiki/ai-tooling/(sidebar position 1) - AI Tooling How To's -
docs/wiki/project/(sidebar position 2) - Project How To's -
docs/wiki/target-platform/(sidebar position 3) - Target Platform How To's
-
- Copy project commands from
.mekara/scripts/nl/project/*.mdtodocs/wiki/project/- Exclude
systematize.md(mekara-internal command) - Remove
<UserContext>tags from all copied files - Add frontmatter with
sidebar_labelandsidebar_position
- Exclude
- Move
setup-mekara-mcp.mdtodocs/wiki/ai-tooling/ - Copy
mobile-app.mdfrom.mekara/scripts/nl/todocs/wiki/target-platform/ - Create index pages for all three sections
- Add
sidebar_position: 0todocs/wiki/index.mdto keep Wiki at top - Update source files in
.mekara/scripts/nl/project/:- Add Step 6 (Setup GitHub Pages) to
new.md - Remove "New" from
new-repo-init.mdtitle (now "Repository Initialization")
- Add Step 6 (Setup GitHub Pages) to
- Set sidebar ordering with
sidebar_positionto match invocation order in "New Project Setup" - Verify build succeeds with no broken links
Phase 6: Update Standard Mekara Workflow ✅
Goal: Simplify workflow documentation to reference only /project:new
File: docs/docs/standards/workflow.md
Tasks:
- Remove detailed references to individual setup scripts (setup-docs, setup-github-pages, etc.)
- Keep only
/project:newas the main entry point - Update "Get In" section to focus on the orchestrated command
Phase 7: Standardize Design Document Terminology ✅
Goal: Update planning documents to use "design documents" terminology and restructure to match new standard
Tasks:
- Restructure
docs/docs/standards/design-documents.mdwith new sections:- Add Introduction section (brief background and context)
- Rename "Goal" to "Objectives"
- Add Architecture section (before/after diagrams)
- Add Design Details section (end-state design, invariants, constraints)
- Rename "Implementation Phases" to "Implementation Plan"
- Update all "planning documents" references to "design documents":
-
docs/docs/index.md -
docs/docs/standards/index.md -
docs/docs/standards/documentation.md -
docs/docs/code-base/documentation/index.md -
docs/docs/roadmap/documentation-reorganization.md -
.mekara/scripts/nl/check-plan-completion.md -
src/mekara/bundled/scripts/nl/check-plan-completion.md
-
- Rename
/plan-roadmapto/plan-design-doc:- Rename
.mekara/scripts/nl/plan-roadmap.md→plan-design-doc.mdwithgit mv - Rename
src/mekara/bundled/scripts/nl/plan-roadmap.md→plan-design-doc.md - Update script content to use "design" terminology throughout
- Update all references in documentation and scripts
- Rename
- Update
plan-refactor.mdto match new structure:- Update references to design-documents.md
- Update example template to include Introduction, Objectives, Architecture sections
- Reorganize Design Details subsections (Invariants, Constraints, Non-goals)
- Update both source and bundled versions
- Verify build succeeds with no broken links
Phase 8: Update Standard Mekara Project Documentation and Scripts ✅
Goal: Update documentation and scripts to reflect new directory structure, and implement bidirectional sync
Content Sync Principle: Content between .mekara/scripts/nl/project/*.md and docs/wiki/project/*.md should be copied verbatim, except that docs/wiki/project/*.md files have Docusaurus frontmatter prepended (sidebar_label, sidebar_position). The body content must be identical.
Tasks:
- Update
docs/docs/standards/project.md:- Update Core Directories section to show new
.mekara/scripts/structure - Update structure diagram to show
nl/andcompiled/subdirectories - Explain that
.claude/commands/is a symlink to.mekara/scripts/nl/ - Do NOT mention
docs/wiki/orproject/subdirectories (mekara-specific, not part of Standard Mekara Project)
- Update Core Directories section to show new
- Update
.mekara/scripts/nl/project/new-repo-init.md:- Create
.mekara/scripts/nl/and.mekara/scripts/compiled/directories - Create
.gitkeepfiles in both directories (ONLY nl/ and compiled/, NOT project/ subdirectories) - Create
.claude/commandsas symlink to.mekara/scripts/nl/ - Remove old instructions about creating
.claude/commands/as directory - Note:
project/subdirectories are mekara-specific, not part of Standard Mekara Project
- Create
- Create
scripts/sync-nl.pyscript:- Accept
--directionargument: eitherto-docsorto-mekara - Sync logic covers multiple wiki directories:
- Include:
project/,ai-tooling/,target-platform/ - Exclude:
project/systematize.md(mekara-internal command)
- Include:
- When
--direction=to-docs:- Read files from
.mekara/scripts/nl/{project,ai-tooling,target-platform}/*.md(excluding project/systematize.md) - Preserve existing frontmatter in
docs/wiki/{project,ai-tooling,target-platform}/*.mdfiles - Replace body content (everything after frontmatter) with content from .mekara/
- Read files from
- When
--direction=to-mekara:- Read files from
docs/wiki/{project,ai-tooling,target-platform}/*.md - Strip frontmatter (everything before first non-frontmatter line)
- Write body content to
.mekara/scripts/nl/{project,ai-tooling,target-platform}/*.md
- Read files from
- Always sync to
src/mekara/bundled/scripts/nl/{project,ai-tooling,target-platform}/(verbatim copy from whichever source was updated) - Return exit code 0 on success, non-zero on error
- Accept
- Update pre-commit hook script:
- Implement bidirectional sync with conflict detection using
scripts/sync-nl.py:- Source of truth #1:
.mekara/scripts/nl/*.md(including nl/project/*.md) - Source of truth #2:
.mekara/scripts/compiled/*.py(including compiled/project/*.py) - Source of truth #3:
docs/wiki/project/*.md(for project commands only) - same content as #1 but with frontmatter - Derived:
src/mekara/bundled/scripts/nl/andsrc/mekara/bundled/scripts/compiled/(must mirror directory structure) - Exclusion:
project/systematize.mdis excluded from wiki sync (mekara-internal command)
- Source of truth #1:
- Detect changes with
git diff --cached --name-only - Error if BOTH
.mekara/scripts/nl/project/ANDdocs/wiki/project/changed in same commit (conflict) - Sync appropriately based on which source(s) changed:
- If only
.mekara/scripts/nl/changed: runscripts/sync-nl.py --direction=to-docsto sync to docs/wiki/project/ and bundled/scripts/nl/ - If only
docs/wiki/project/changed: runscripts/sync-nl.py --direction=to-mekarato sync to .mekara/scripts/nl/project/ and bundled/scripts/nl/ - If only
.mekara/scripts/compiled/changed: copy verbatim to bundled/scripts/compiled/ (not a conflict)
- If only
- Stage updated files
- Implement bidirectional sync with conflict detection using
Phase 9: Verification ✅
Goal: Verify all changes work correctly
Tasks:
- Run
pnpm run build- verify no broken links - Start dev server with
pnpm start- verify navigation works - Check Standards appears at position 3 in sidebar
- Verify Wiki tab shows separate sidebar
- Verify wiki sidebar only contains Wiki intro and Project commands
- Test symlink:
cat .claude/commands/project/new.mdshould work - Run
git status- verify clean working tree - Verify all file moves tracked with
git mv(should show as renames)
Notes
- All
git mvoperations preserve file history - Wiki and Docs are separate Docusaurus plugins with independent sidebars
.claude/commands/symlink maintains backward compatibility- Pre-commit hook ensures bundled scripts stay in sync with sources