/sdd:docs [project name or options] [--module <name>]from sdd
Generates a Docusaurus documentation site from ADRs and OpenSpec specs with RFC 2119 highlighting, cross-references, and auto-generated sidebars. Supports scaffold and integration modes.
Ships in sdd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Harness portability. This skill runs on any agent harness that loads Agent Skills — Claude Code, Codex CLI, OpenCode, Crush. Tool names used below (
AskUserQuestion,Task,TeamCreate,SendMessage,TaskCreate,ToolSearch,mcp__*,${CLAUDE_PLUGIN_ROOT}) denote capabilities, not hard requirements: map each to your harness's equivalent or use the documented fallback per${CLAUDE_PLUGIN_ROOT}/references/harness-compat.md. References toCLAUDE.mdmean the project memory file (CLAUDE.md,AGENTS.md, orCRUSH.md) per harness-compat § "Project Memory File". A citation of the formshared-patterns.md § "Section"names one##heading in that file — load only that section (see its "How to Read This File" note), never the whole file. Invocation and arguments. Where your harness has no command layer (Crush, Codex CLI, OpenCode) this skill is reached from itsdescription, not a slash command: the/sdd:{name}form below is Claude Code namespacing.$ARGUMENTSmeans whatever arrived with the invocation: take the target and any--flagsfrom the request that triggered this skill, and when neither is present follow this skill's documented no-argument path instead of reporting missing arguments (harness-compat § "Invocation and Arguments").
Transform ADRs and OpenSpec specs (located via the Artifact Path Resolution pattern from ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Artifact Path Resolution") into a polished documentation website with:
Supports two modes:
docs-site/ with its own Docusaurus installationFollow the Artifact Path Resolution pattern from ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Artifact Path Resolution" to determine the ADR, spec, and PRD directories. If $ARGUMENTS contains --module <name>, resolve paths relative to that module; otherwise, in a workspace, aggregate across all modules. The resolved ADR directory is {adr-dir}, spec directory is {spec-dir}, and PRD directory is {prd-dir} (default docs/prds/, per ADR-0036).
Cross-module aggregation: When in aggregate mode (no --module, workspace detected), include all modules' artifacts in the docs site. Organize the sidebar navigation by module:
Architecture/
├── api/
│ ├── ADRs/
│ │ ├── ADR-0001: Choose REST over GraphQL
│ │ └── ADR-0002: Choose PostgreSQL
│ └── Specs/
│ └── SPEC-0001: Web Dashboard
├── worker/
│ ├── ADRs/
│ │ └── ADR-0001: Choose Redis for queues
│ └── Specs/
│ └── SPEC-0001: Job Processing
└── Overview (cross-module index page)
Each module's artifacts are transformed independently and placed under a module-named directory in the docs output. The index page lists all modules with artifact counts. When --module is provided, generate docs for that single module only (flat structure, no module subdirectory). When in single-module mode (no workspace), operate normally with the existing flat structure.
{adr-dir} has any ADR .md files{prd-dir} has any PRD-*.md files. PRDs are optional (ADR-0036): when the directory is absent or empty, generate no PRD section and no empty placeholder page. When PRDs exist, give them their own sidebar section ahead of ADRs, matching the PRD → ADR → spec lineage, and render each PRD's governs: edges as links to the ADR and spec pages it governs.{spec-dir} has any spec directories (containing spec.md). Validate spec pairing per ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Spec Pairing Validation"./sdd:adr or /sdd:spec, then re-run /sdd:docs." and stop.Check if .sdd-docs.json exists at the project root.
If .sdd-docs.json exists:
siteDir referenced in the manifest still exists on disk
.sdd-docs.json but the site directory {siteDir} no longer exists." Use AskUserQuestion to offer:
If .sdd-docs.json does NOT exist, continue to Step 2.2.
Scan the project root for directories containing docusaurus.config.ts or docusaurus.config.js:
find . -maxdepth 2 -name 'docusaurus.config.*' -not -path './docs-site/*' -not -path './node_modules/*' 2>/dev/null
If an existing docs site directory is detected (docs-site/ exists or an integration site was found in 2.2) but no .sdd-docs.json:
.sdd-docs.json not found."AskUserQuestion to offer:
.sdd-docs.json using the current state as baseline, then enter Upgrade Mode (Step 3C)If an existing non-scaffold Docusaurus site is found (from Step 2.2), use AskUserQuestion to let the user choose:
If no existing site is found, proceed directly with Scaffold Mode (Step 3A).
Read and follow the plugin's skills/docs/references/scaffold-mode.md for the full scaffold workflow. After completion, proceed to Step 4 below.
Read and follow the plugin's skills/docs/references/integration-mode.md for the full integration workflow. After completion, proceed to Step 4 below.
Read and follow the plugin's skills/docs/references/upgrade-mode.md for the full upgrade workflow. This handles manifest-based file management, conflict resolution, and new template detection.
Runs after Step 3A or 3B to establish upgrade tracking.
Determine managed files based on mode:
docs-site/plugins/sdd-content/, docs-site/src/components/, docs-site/src/css/, docs-site/src/theme/{site}/plugins/sync-spec-docs/, {site}/src/components/design-docs/, {site}/src/css/design-docs.css, {site}/src/theme/MDXComponents.tsx (if created/modified)Compute SHA-256 checksum for each file (shasum -a 256 {file-path}), then write .sdd-docs.json:
{
"version": "<plugin version from .claude-plugin/plugin.json>",
"mode": "scaffold" | "integration",
"siteDir": "<relative path to site dir>",
"createdAt": "<ISO 8601>",
"updatedAt": "<ISO 8601>",
"files": {
"<relative-path>": { "checksum": "sha256:<hex-digest>", "managed": true }
}
}
Tell the user: "Created .sdd-docs.json with {N} tracked files. Future runs of /sdd:docs will detect changes and offer upgrades."
templates/docusaurus/)The templates directory contains production-ready versions of all files. The cp -r approach copies everything; you only need to customize docusaurus.config.ts and package.json.
index.js -- Consolidated Docusaurus plugin that:
lib-artifact-transforms for YAML frontmatter parsing (replaces ~120 lines of custom YAML)getPathsToWatch() for native Docusaurus hot reload (replaces chokidar-cli + concurrently)templates/integration/sync-spec-docs/)A self-contained Docusaurus plugin with adapted transform scripts.
index.js -- Docusaurus plugin that runs transforms during loadContent() and watches source files via getPathsToWatch()transform-adrs.js -- ADR transforms with parameterized pathstransform-openspecs.js -- OpenSpec transforms with parameterized pathstransform-utils.js -- Shared utilities (RFC 2119 keywords, cross-references, link fixing)mdx-escape.js -- MDX v3 safety escapingbuild-spec-mapping.js -- Spec ID mapping (returns data instead of writing files)generate-index.js -- Index page generation with parameterized pathsUsed by both modes. In scaffold mode, they live at docs-site/src/components/. In integration mode, they're copied to {site}/src/components/design-docs/.
StatusBadge.tsx -- Status with emoji (accepted, proposed, draft, etc.)DateBadge.tsx -- Date display with calendar emojiDomainBadge.tsx -- Domain/category badgePriorityBadge.tsx -- P0-P4 priority levelsSeverityBadge.tsx -- Critical/High/Medium/Low/InfoRFCLevelBadge.tsx -- Maps RFC 2119 keywords to severity colorsRequirementBox.tsx -- Bordered container for spec requirements with ID anchorsField.tsx / FieldGroup.tsx -- Metadata label-value pairssrc/theme/MDXComponents.tsx -- Registers all custom components for use in MDXsrc/css/custom.css -- All badge, keyword, component, and dark mode stylesspec-emojis.json and spec-mapping.json as generated files (populated by build-spec-mapping.js)docusaurus.config.ts wholesale -- only add the plugin entry and CSS importdesign-docs/ to avoid collisions with existing components{site}/docs/architecture/ -- this directory is gitignored and regenerated on every build.sdd-docs.json after a fresh scaffold or integration install (Step 4)files object uses project-root-relative paths as keyssha256:<hex-digest> (lowercase hex)managed: true and use their current checksums as the baseline--module is provided, generate docs for that single module only using flat structureWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/adrCreate a new Architecture Decision Record (ADR) using MADR format. Use when the user wants to document an architectural decision, says "create an ADR", "we need an ADR for", or discusses a decision that should be recorded./auditComprehensive audit of design artifact alignment across the project. Use when the user says "audit the architecture", "full drift report", or wants a thorough review of spec compliance and ADR adherence./checkQuick-check code against ADRs and specs for drift. Use when the user says "check for drift", "does this match the spec", or wants a fast alignment check on a specific file or directory./discoverDiscover implicit architectural decisions and spec-worthy subsystems in an existing codebase. Use when the user says "discover architecture", "what decisions exist in this code", "bootstrap ADRs", or wants to reverse-engineer design artifacts from code./enrichRetroactively add branch naming and PR convention sections to existing issue bodies. Use when the user says "add branch names to issues", "enrich issues", or wants to add developer workflow conventions to existing issues./graphBuild and query the SDD artifact graph. Use when the user wants to validate frontmatter edges, find impact/ancestors/chain for an ADR or spec, detect orphans or cycles, or backfill edges from prose. Currently supports validate / impact / ancestors / chain / orphans / cycles, with workspace-mode aggregation; backfill lands in Story 7.npx claudepluginhub joestump/claude-plugin-sdd --plugin sddOther plugins' skills for the same job