Skip to content

Conversation

@forcetrainer
Copy link
Contributor

@forcetrainer forcetrainer commented Jan 8, 2026

Summary

  • Rework links to work appropriately on both GH and Astro/Starlight.
  • Add 'fix-doc-links.js' to convert any relative paths to proper site-relative paths without .md extension
  • Add 'validate-doc-links.js' to check validity of links in documents.
  • Remove check-doc-links.js and replaced with 'validate-doc-links.js' to ensure links are valid before build can complete.
  • Reorganize docs structure: remove unused section index files, archive v4 tutorial
  • Standardize BMad acronym across all files.
  • Update README to streamlined version with updated links to docs site. This makes the docs page the primary doc source for users going forward (you've been warned)!!
  • FAQs updated to new format.

Test plan

  • npm run docs:fix-links fixes any relative paths
  • 'npm docs:validate-links' identifies and fixes any invalid links
  • npm run docs:build passes locally
  • 'nom run docs:preview' executes and server operates properly
  • All lint and test checks pass

forcetrainer and others added 4 commits January 8, 2026 00:08
- Add audit-doc-links.js to scan docs for broken links with auto-resolution
- Add fix-doc-links.js to apply suggested fixes (dry-run by default)
- Remove stale "Back to Core Concepts" breadcrumb links
- Update BMad acronym to "Breakthrough Method of Agile AI Driven Development"
- Update README links to docs.bmad-method.org
- Simplify upgrade callout in getting-started tutorial

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove unused section index files (tutorials, how-to, explanation, reference)
- Move getting-started-bmadv4.md to _archive
- Update quick-start-bmgd.md to remove archived file reference
- Update upgrade-to-v6.md
- Update astro.config.mjs for new structure

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update check-doc-links.js to skip _archive, _planning, and other
underscore-prefixed directories when validating links.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add links to v4 documentation archive and upgrade guide for users
migrating from previous versions.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

This PR restructures the documentation from autogenerated flat indexes to a hierarchical Starlight sidebar navigation, removes and consolidates documentation index pages, updates tutorial content formatting, rewrites the README with streamlined branding, and introduces new tooling for auditing and fixing broken documentation links.

Changes

Cohort / File(s) Summary
README & Main Docs Index
README.md, docs/index.md
README rewritten with streamlined BMAD branding, removing installer history and multi-version narratives in favor of concise "Why BMAD?", "Quick Start", and "Modules" sections; docs/index.md title and welcome content updated to reference "The BMad Method" and consolidated tutorial links.
Deleted Documentation Index Pages
docs/explanation/index.md, docs/how-to/index.md, docs/reference/index.md, docs/tutorials/index.md
Four index/overview pages removed entirely; content consolidated into hierarchical sidebar structure managed by website config.
Tutorial & How-To Content
docs/tutorials/getting-started/getting-started-bmadv6.md, docs/tutorials/getting-started/quick-start-bmgd.md, docs/how-to/installation/upgrade-to-v6.md
Markdown tables restructured with explicit alignment and improved spacing; titles updated from version-specific (v4/v6) naming to generic terminology; content reformatted for consistency and readability.
Navigation Link Cleanup
docs/explanation/features/web-bundles.md, docs/how-to/customization/index.md
Trailing "Back to Core Concepts" navigation links removed from pages.
Website Sidebar Configuration
website/astro.config.mjs
Sidebar structure for four documentation sections (Tutorials, How-To Guides, Explanation, Reference) migrated from single-level autogenerate to multi-entry hierarchical items arrays with explicit labels and per-entry directory targets.
Documentation Link Auditing Tools
tools/audit-doc-links.js, tools/fix-doc-links.js, tools/check-doc-links.js
New audit-doc-links.js tool scans Markdown files, extracts links, validates existence, infers moved files via glob-based search, and generates JSON report with auto-fixable/needs-review/missing categorization; new fix-doc-links.js script automates link replacement from audit report with dry-run and --apply modes; check-doc-links.js updated to ignore underscore-prefixed directories.

Sequence Diagram(s)

sequenceDiagram
    participant FS as File System
    participant Auditor as Link Auditor
    participant Resolver as Path Resolver
    participant Searcher as Moved File Searcher
    participant Reporter as Report Generator

    FS->>Auditor: Scan all .md/.mdx files
    Auditor->>Auditor: Extract links from each file
    Auditor->>Resolver: Resolve link to absolute path
    Resolver-->>Auditor: File exists or not found
    alt Link Not Found
        Auditor->>Searcher: Search for moved file
        Searcher->>FS: Glob pattern search
        FS-->>Searcher: Potential matches
        Searcher-->>Auditor: Single/multiple/no matches
        Auditor->>Auditor: Classify as auto-fixable/needs-review/missing
    end
    Auditor->>Reporter: Aggregate findings
    Reporter->>Reporter: Generate JSON report
    Reporter->>FS: Write .link-audit-report.json
    Reporter->>Reporter: Output console summary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely summarizes the three main changes: adding link auditor tools, reorganizing documentation, and updating the README.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The pull request description clearly relates to the changeset, detailing documentation reorganization, link tooling, README updates, and BMad acronym standardization that match the file modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In @docs/how-to/installation/upgrade-to-v6.md:
- Around line 2-8: The document title "Upgrading from Previous Versions" is too
generic for the file named upgrade-to-v6.md and the v4→v6-specific content;
either make the scope explicit by changing the title and heading to "BMad v4 to
v6 Upgrade Guide" (update the title string and any H1/H2 headings) so the
filename and content match, or convert this into a true generic upgrade guide by
renaming the file to upgrade-guide.md and broadening the content to cover
multiple version transitions; pick one approach and apply it consistently across
the title text and filename so search/findability and user expectations match.

In @README.md:
- Line 8: Clarify whether "21 specialized agents" and "12+ domain experts (PM,
Architect, Developer, UX, Scrum Master, and more)" are overlapping,
hierarchical, or separate categories: either update the README to explain the
relationship (e.g., "21 specialized agents, including 12+ domain experts such as
PM, Architect, Developer, UX, Scrum Master..." or "21 specialized agents (core
AI roles) plus 12+ human domain experts for oversight and strategy") or
reconcile the counts to avoid confusion by aligning the terminology and numbers
so both phrases consistently describe the same group.

In @tools/audit-doc-links.js:
- Around line 82-103: extractLinksWithPositions currently computes matches on
strippedContent (using LINK_PATTERN) but passes indexes into getLineNumber for
the stripped text, producing incorrect file line numbers when code blocks were
removed; fix by making the code translate match.index back to the original
content offset before calling getLineNumber (either update stripCodeBlocks to
return a mapping of removed-block ranges or offsets, or compute removed ranges
and add their cumulative length back to the match.index), then call
getLineNumber(originalContent, translatedIndex) so reported line numbers reflect
the original file; update references in extractLinksWithPositions (and keep
shouldIgnoreLink checks and fullMatch extraction unchanged).
🧹 Nitpick comments (4)
tools/fix-doc-links.js (1)

102-107: Consider validating the report structure.

If the audit report is malformed or manually edited, accessing report.autoFixable.length on undefined will throw a TypeError with an unhelpful message. A simple validation would improve error messaging.

♻️ Suggested fix
   const report = loadReport();
 
+  if (!Array.isArray(report.autoFixable)) {
+    console.error(`\n  ${colors.red}Error:${colors.reset} Invalid report format - missing autoFixable array.\n`);
+    process.exit(1);
+  }
+
   if (report.autoFixable.length === 0) {
     console.log(`  ${colors.green}✓${colors.reset} No auto-fixable links found.\n`);
     process.exit(0);
   }
tools/audit-doc-links.js (3)

210-214: Consider wrapping file read in try/catch.

While unlikely, a file could be deleted between the glob scan and this read. The global error handler would catch it, but the error message wouldn't indicate which file failed.

♻️ Suggested fix
   for (const file of files) {
-    const content = readFileSync(file, 'utf-8');
+    let content;
+    try {
+      content = readFileSync(file, 'utf-8');
+    } catch (error) {
+      console.warn(`  ${colors.yellow}⚠${colors.reset} Skipping unreadable file: ${relative(DOCS_DIR, file)}`);
+      continue;
+    }
     const links = extractLinksWithPositions(content, file);

209-210: Unused variable allFiles.

This variable is declared but never used. Consider removing it.


225-229: Unused variable fileName.

The fileName variable is declared but never used.

      // Check if target exists
      if (!existsSync(targetFile)) {
        // Try to find the file elsewhere
        const candidates = await findMovedFile(linkPath);
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e165b9 and bfc9c71.

📒 Files selected for processing (16)
  • README.md
  • docs/_archive/getting-started-bmadv4.md
  • docs/explanation/features/web-bundles.md
  • docs/explanation/index.md
  • docs/how-to/customization/index.md
  • docs/how-to/index.md
  • docs/how-to/installation/upgrade-to-v6.md
  • docs/index.md
  • docs/reference/index.md
  • docs/tutorials/getting-started/getting-started-bmadv6.md
  • docs/tutorials/getting-started/quick-start-bmgd.md
  • docs/tutorials/index.md
  • tools/audit-doc-links.js
  • tools/check-doc-links.js
  • tools/fix-doc-links.js
  • website/astro.config.mjs
💤 Files with no reviewable changes (6)
  • docs/how-to/customization/index.md
  • docs/explanation/features/web-bundles.md
  • docs/tutorials/index.md
  • docs/explanation/index.md
  • docs/how-to/index.md
  • docs/reference/index.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*

⚙️ CodeRabbit configuration file

**/*: Focus on inconsistencies, contradictions, edge cases and serious issues.
Avoid commenting on minor issues such as linting, formatting and style issues.
When providing code suggestions, use GitHub's suggestion format:

<code changes>

Files:

  • tools/fix-doc-links.js
  • README.md
  • website/astro.config.mjs
  • tools/check-doc-links.js
  • tools/audit-doc-links.js
  • docs/index.md
  • docs/how-to/installation/upgrade-to-v6.md
  • docs/tutorials/getting-started/quick-start-bmgd.md
  • docs/tutorials/getting-started/getting-started-bmadv6.md
**/*.js

⚙️ CodeRabbit configuration file

**/*.js: CLI tooling code. Check for: missing error handling on fs operations,
path.join vs string concatenation, proper cleanup in error paths.
Flag any process.exit() without error message.

Files:

  • tools/fix-doc-links.js
  • tools/check-doc-links.js
  • tools/audit-doc-links.js
🧬 Code graph analysis (3)
tools/fix-doc-links.js (2)
tools/audit-doc-links.js (5)
  • require (13-13)
  • require (14-14)
  • require (15-15)
  • REPORT_PATH (18-18)
  • report (265-277)
website/src/rehype-markdown-links.js (3)
  • node (24-86)
  • tree (23-87)
  • rehypeMarkdownLinks (22-88)
tools/audit-doc-links.js (1)
tools/fix-doc-links.js (6)
  • require (12-12)
  • require (13-13)
  • REPORT_PATH (15-15)
  • content (38-38)
  • content (51-51)
  • report (102-102)
docs/index.md (1)
tools/build-docs.js (1)
  • main (42-60)
🔇 Additional comments (8)
website/astro.config.mjs (1)

85-199: All referenced directories exist and are properly configured.

The sidebar configuration correctly references all directories:

  • Tutorials: getting-started and advanced directories exist
  • How-To: All five subdirectories (installation, workflows, customization, brownfield, troubleshooting) exist, and the slug file get-answers-about-bmad.md is present
  • Explanation: All eleven subdirectories exist
  • Reference: All four subdirectories exist

The mixed approach in the How-To section (combining the direct slug reference on line 105 with autogenerate subdirectories) is intentional and working correctly. Section index files have been properly removed as referenced in the PR objectives.

README.md (2)

49-58: Verify documentation links are accessible.

The documentation links reference docs.bmad-method.org as the primary documentation site. Ensure that:

  • The full documentation URL (line 51) is properly configured and publicly accessible
  • The specific tutorial and upgrade guide links (lines 53-54) resolve correctly
  • The v4 documentation reference (line 58) to the V4 branch remains stable

This aligns with the PR objective to update links to the new documentation site, but verification is important for user experience.


1-79: README structure and branding align well with PR objectives.

The rewrite successfully streamlines the documentation experience by:

  • Consolidating module descriptions into a clear, scannable table (Modules section)
  • Providing a concise quick-start workflow with track selection guidance
  • Removing historical context and v4/v6 migration narratives
  • Unifying branding around BMAD terminology throughout

The structure prioritizes getting started and documentation discovery, which is consistent with the broader documentation reorganization goals. Overall presentation is clear and developer-friendly.

tools/check-doc-links.js (1)

199-203: LGTM!

The ignore pattern correctly excludes underscore-prefixed directories from scanning. This aligns well with the documentation reorganization that archives content under _archive and keeps planning docs under _planning.

tools/fix-doc-links.js (2)

30-45: LGTM!

Good error handling with existence check before reading and try/catch around JSON parsing with informative error messages.


50-76: LGTM!

The function correctly handles anchor preservation and uses proper regex escaping. The caller wraps this in try/catch for I/O error handling.

tools/audit-doc-links.js (2)

137-170: LGTM!

Good multi-strategy approach to finding moved files with appropriate handling for the generic index.md case.


20-21: Reference-style links are not supported, but none exist in the documentation.

The LINK_PATTERN regex only matches inline [text](path) links, unlike check-doc-links.js which supports both inline and reference-style [text]: path formats. However, no reference-style links are present in the docs, so this difference has no practical impact.

Comment on lines +2 to +8
title: "Upgrading from Previous Versions"
---


## Overview

BMad v6 represents a complete ground-up rewrite with significant architectural changes. This guide will help you migrate your v4 project to v6.
The latest version of BMad represents a complete ground-up rewrite with significant architectural changes. This guide will help you migrate from version 4.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Title and content scope mismatch.

The title "Upgrading from Previous Versions" suggests a generic upgrade guide, but the filename (upgrade-to-v6.md) and all content are specifically about migrating from v4 to v6. This inconsistency could confuse users:

  • Users upgrading from future versions (e.g., v7→v8) might expect this guide to help them
  • The generic title doesn't align with the specific filename, creating a findability problem
  • Search results and links may mislead users about the document's scope

Consider either:

  1. Keeping the specific title: "BMad v4 to v6 Upgrade Guide"
  2. Or renaming the file to match the generic scope: upgrade-guide.md and restructuring content to handle multiple version transitions
🤖 Prompt for AI Agents
In @docs/how-to/installation/upgrade-to-v6.md around lines 2 - 8, The document
title "Upgrading from Previous Versions" is too generic for the file named
upgrade-to-v6.md and the v4→v6-specific content; either make the scope explicit
by changing the title and heading to "BMad v4 to v6 Upgrade Guide" (update the
title string and any H1/H2 headings) so the filename and content match, or
convert this into a true generic upgrade guide by renaming the file to
upgrade-guide.md and broadening the content to cover multiple version
transitions; pick one approach and apply it consistently across the title text
and filename so search/findability and user expectations match.

**Build More, Architect Dreams** (BMAD) with **21 specialized AI agents** across 4 official modules, and **50+ guided workflows** that adapt to your project's complexity—from quick bug fixes to enterprise platforms, and new step file workflows that allow for incredibly long workflows to stay on the rails longer than ever before!

Additionally - when we say 'Build More, Architect Dreams' - we mean it! The BMad Builder has landed, and now as of Alpha.15 is fully supported in the installation flow via NPX - custom stand along agents, workflows and the modules of your dreams! The community forge will soon open, endless possibility awaits!
**Build More, Architect Dreams** — An AI-driven agile development framework with 21 specialized agents, 50+ guided workflows, and scale-adaptive intelligence that adjusts from bug fixes to enterprise systems.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

head -80 README.md | cat -n

Repository: bmad-code-org/BMAD-METHOD

Length of output: 4226


Clarify the distinction between "21 specialized agents" and "12+ domain experts".

Line 8 mentions "21 specialized agents" while line 16 states "12+ domain experts (PM, Architect, Developer, UX, Scrum Master, and more)". These numbers and terminology may refer to different concept groups, but the distinction is unclear to readers. Either clarify the relationship between these two categories or align the numbers and terminology.

🤖 Prompt for AI Agents
In @README.md at line 8, Clarify whether "21 specialized agents" and "12+ domain
experts (PM, Architect, Developer, UX, Scrum Master, and more)" are overlapping,
hierarchical, or separate categories: either update the README to explain the
relationship (e.g., "21 specialized agents, including 12+ domain experts such as
PM, Architect, Developer, UX, Scrum Master..." or "21 specialized agents (core
AI roles) plus 12+ human domain experts for oversight and strategy") or
reconcile the counts to avoid confusion by aligning the terminology and numbers
so both phrases consistently describe the same group.

Comment on lines 82 to 103
function extractLinksWithPositions(content, filePath) {
const strippedContent = stripCodeBlocks(content);
const links = [];

let match;
LINK_PATTERN.lastIndex = 0;

while ((match = LINK_PATTERN.exec(strippedContent)) !== null) {
const rawLink = match[2];
if (!shouldIgnoreLink(rawLink)) {
const lineNumber = getLineNumber(strippedContent, match.index);
links.push({
raw: rawLink,
text: match[1],
line: lineNumber,
fullMatch: match[0],
});
}
}

return links;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Line numbers may be inaccurate due to code block stripping.

getLineNumber operates on strippedContent (after code blocks are removed), not the original content. This means reported line numbers won't match actual file positions when code blocks precede the link.

Consider calculating line numbers from the original content using the match position adjusted for removed blocks, or document this limitation.

🤖 Prompt for AI Agents
In @tools/audit-doc-links.js around lines 82 - 103, extractLinksWithPositions
currently computes matches on strippedContent (using LINK_PATTERN) but passes
indexes into getLineNumber for the stripped text, producing incorrect file line
numbers when code blocks were removed; fix by making the code translate
match.index back to the original content offset before calling getLineNumber
(either update stripCodeBlocks to return a mapping of removed-block ranges or
offsets, or compute removed ranges and add their cumulative length back to the
match.index), then call getLineNumber(originalContent, translatedIndex) so
reported line numbers reflect the original file; update references in
extractLinksWithPositions (and keep shouldIgnoreLink checks and fullMatch
extraction unchanged).

forcetrainer and others added 5 commits January 8, 2026 01:31
- Convert all relative links (./  ../) to site-relative paths (/path/)
- Strip .md extensions and use trailing slashes for Astro/Starlight
- Add fix-doc-links.js to convert relative links to site-relative
- Add validate-doc-links.js to check links point to existing files
- Remove old audit-doc-links.js and check-doc-links.js
- Update build-docs.js to use new validation script
- Add npm scripts: docs:fix-links, docs:validate-links
- Update style guide with validation steps

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace incorrect "BMAD" with correct "BMad" in text and frontmatter
while preserving "BMAD-METHOD" in GitHub URLs.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Correct acronym to "Breakthrough Method of Agile AI Driven Development"
- Remove unused README-draft.md

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add TOC with jump links under "## Questions"
- Use ### headers for questions (no Q: prefix)
- Direct answers without **A:** prefix
- Remove horizontal rules and "Related Documentation" sections
- End each FAQ with issue/Discord CTA
- Update style guide with new FAQ guidelines
- Delete redundant faq/index.md (sidebar handles navigation)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@forcetrainer forcetrainer marked this pull request as draft January 8, 2026 07:26
Convert all documentation links to repo-relative format (/docs/path/file.md)
so they work when browsing on GitHub. The rehype plugin strips /docs/ prefix
and converts .md to trailing slash at build time for Astro/Starlight.

- Update rehype-markdown-links.js to strip /docs/ prefix from absolute paths
- Update fix-doc-links.js to generate /docs/ prefixed paths with .md extension
- Convert 217 links across 64 files to new format

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@forcetrainer forcetrainer marked this pull request as ready for review January 8, 2026 07:56
forcetrainer and others added 2 commits January 8, 2026 11:57
Update resolveLink to strip /docs/ prefix from repo-relative links
before checking if files exist.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Re-add the FAQ index page that was accidentally deleted, with
updated repo-relative link format.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@bmadcode bmadcode merged commit 12d3492 into bmad-code-org:main Jan 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants