docs
Generate a documentation site from your ADRs and specs. Use when the user says "generate docs", "create a docs site", or wants to publish their architecture decisions.
What this skill does
# Generate Docusaurus Documentation Site
Transform ADRs and OpenSpec specs (located via the **Artifact Path Resolution** pattern from `references/shared-patterns.md`) into a polished documentation website with:
- RFC 2119 keyword highlighting (MUST, SHALL, MAY, etc.)
- ADR cross-reference linking (ADR-0001 becomes a clickable link)
- SPEC cross-reference linking (PREFIX-NNN links to spec requirement anchors)
- Status/Date/Domain badge components
- Requirement box components for spec tables
- Consequence keyword highlighting (Good/Bad/Neutral) in ADRs
- Dark mode support
- Auto-generated sidebars
Supports two modes:
- **Scaffold mode**: Creates a standalone `docs-site/` with its own Docusaurus installation
- **Integration mode**: Generates a build-time plugin into an existing Docusaurus site
## Process
### Step 0: Resolve Artifact Paths
<!-- Governing: ADR-0016 (Workspace Mode), SPEC-0014 REQ "Artifact Path Resolution" -->
Follow the **Artifact Path Resolution** pattern from `references/shared-patterns.md` to determine the ADR and spec 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}` and spec directory is `{spec-dir}`.
<!-- Governing: ADR-0016 (Workspace Mode), SPEC-0014 REQ "Cross-Module Aggregation" -->
**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.
### Step 1: Pre-flight Checks
- Check if Node.js is installed. If not, tell the user: "Node.js is required to run the docs site. Please install it from https://nodejs.org/ and re-run this command." and stop.
- Check if `{adr-dir}` has any ADR `.md` files
- Check if `{spec-dir}` has any spec directories (containing `spec.md`). Validate spec pairing per `references/shared-patterns.md` § "Spec Pairing Validation".
- If NEITHER has content, tell the user: "No ADRs or specs found. Create some first with `/sdd:adr` or `/sdd:spec`, then re-run `/sdd:docs`." and stop.
- If only one has content, proceed but note which is empty (e.g., "No specs found yet -- the docs site will only include ADRs for now.")
### Step 2: Detect Existing Docusaurus Site and Upgrade State
#### 2.1: Check for upgrade manifest
Check if `.sdd-docs.json` exists at the project root.
**If `.sdd-docs.json` exists:**
- Read and parse the manifest
- Check if the `siteDir` referenced in the manifest still exists on disk
- **If siteDir exists** → enter **Upgrade Mode** (Step 3C). Skip Steps 2.2 and 2.3.
- **If siteDir is missing** → warn the user: "Found `.sdd-docs.json` but the site directory `{siteDir}` no longer exists." Use `AskUserQuestion` to offer:
- "Re-scaffold a new docs site" → proceed with **Scaffold Mode** (Step 3A)
- "Cancel" → stop
**If `.sdd-docs.json` does NOT exist**, continue to Step 2.2.
#### 2.2: Scan for existing Docusaurus sites
Scan the project root for directories containing `docusaurus.config.ts` or `docusaurus.config.js`:
```bash
find . -maxdepth 2 -name 'docusaurus.config.*' -not -path './docs-site/*' -not -path './node_modules/*' 2>/dev/null
```
#### 2.3: Choose mode
**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`**:
- Warn: "Upgrade tracking unavailable — `.sdd-docs.json` not found."
- Use `AskUserQuestion` to offer:
- "Create manifest from current state" → compute SHA-256 checksums of all managed files in the existing site, write `.sdd-docs.json` using the current state as baseline, then enter **Upgrade Mode** (Step 3C)
- "Continue without upgrade tracking" → proceed to mode selection below
- "Cancel" → stop
**If an existing non-scaffold Docusaurus site is found** (from Step 2.2), use `AskUserQuestion` to let the user choose:
- Option A: "Integrate into {directory}" -- proceed with **Integration Mode** (Step 3B)
- Option B: "Scaffold a new docs site" -- proceed with **Scaffold Mode** (Step 3A)
**If no existing site is found**, proceed directly with **Scaffold Mode** (Step 3A).
---
### Step 3A: Scaffold Mode
Read and follow the plugin's `skills/docs/references/scaffold-mode.md` for the full scaffold workflow. After completion, proceed to Step 4 below.
---
### Step 3B: Integration Mode
Read and follow the plugin's `skills/docs/references/integration-mode.md` for the full integration workflow. After completion, proceed to Step 4 below.
---
### Step 3C: Upgrade Mode
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.
---
### Step 4: Create Manifest
Runs after Step 3A or 3B to establish upgrade tracking.
**Determine managed files** based on mode:
- **Scaffold**: files in `docs-site/plugins/sdd-content/`, `docs-site/src/components/`, `docs-site/src/css/`, `docs-site/src/theme/`
- **Integration**: files in `{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`:
```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."
---
## Key Template Files Reference
### Scaffold Mode Templates (`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`.
#### Docusaurus Plugin (plugins/sdd-content/)
- `index.js` -- Consolidated Docusaurus plugin that:
- Uses `lib-artifact-transforms` for YAML frontmatter parsing (replaces ~120 lines of custom YAML)
- Builds the artifact graph per SPEC-0018 edge schema with 5 ADR edge types + 4 spec edge types
- Generates MDX files from ADRs and specs with badges, RFC 2119 keyword highlighting, cross-references (Governing: ADR-0006, SPEC-0004)
- Generates index pages (landing page, ADR section, spec section) with sidebar hierarchy diagrams
- Generates the artifact graph page with stats, full Mermaid flowchart, and orphan lists
- Implements `getPathsToWatch()` for native Docusaurus hot reload (replaces chokidar-cli + concurrently)
### Integration Mode Templates (`templates/integration/sync-spec-docs/`)
A self-contained Docusaurus plugin with adapted transform scripts.
#### Plugin Entry
- `index.js` -- Docusaurus plugin that runs transforms during `loadContent()` and watches source files via `getPathsToWatch()`
#### Transform Scripts (lib/)
- `transform-adrs.js` -- ADR transforms with parameterized paths
- `transform-openspecs.js` -- OpenSpec transforms with parameterized pathsRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.