docs

A set of commands for browsing, searching, reading, and serving a project's living documentation. It reads the documentation folders configured in the project.

In plain words
What is it for?
Use it to show a documentation dashboard, find or load documents, read architecture decision records, serve documentation, or check documentation status.
Why use it?
Project documentation can be spread across several folders, making it difficult to find the right page or see its current state. This gives those documents one place to inspect.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/anton-abyzov/specweave/docs
Clone the repo
git clone --depth 1 https://github.com/anton-abyzov/specweave
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,201 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.02201
Opus 5 $0.00023 $0.01100
Sonnet 5 $0.00009 $0.00440
Haiku 4.5 $0.00005 $0.00220

Measured 2d ago against content hash 71759c663a91, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

docs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/specweave/commands/docs.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Documentation Hub

Project Overrides

Skill Memories: If .specweave/skill-memories/docs.md exists, read and apply its learnings.

Browse, search, load, and serve SpecWeave living documentation.

Config-Driven Directories

Read configured doc directories before any operation:

# Read configured doc directories (default: .specweave/docs)
DOC_DIRS=$(jq -r '(.documentation.directories // [".specweave/docs"])[]' .specweave/config.json 2>/dev/null)
[ -z "$DOC_DIRS" ] && DOC_DIRS=".specweave/docs"

All search/list commands below MUST iterate over $DOC_DIRS instead of hardcoding .specweave/docs.

Behavior

1. No arguments: Show documentation dashboard

Run these diagnostic commands:

# Read configured doc directories
DOC_DIRS=$(jq -r '(.documentation.directories // [".specweave/docs"])[]' .specweave/config.json 2>/dev/null)
[ -z "$DOC_DIRS" ] && DOC_DIRS=".specweave/docs"

# Count documents across all directories
DOC_COUNT=0
for dir in $DOC_DIRS; do
  if [ -d "$dir" ]; then
    C=$(find "$dir" -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ')
    DOC_COUNT=$((DOC_COUNT + C))
  fi
done
echo "DOC_COUNT:$DOC_COUNT"

# Detect umbrella mode and list child repo docs
UMB_REPOS=$(jq -r '.umbrella | select(.enabled==true) | .childRepos[]? | "\(.id):\(.path)"' .specweave/config.json 2>/dev/null)
if [ -n "$UMB_REPOS" ]; then
  echo "UMBRELLA:true"
  for entry in $UMB_REPOS; do
    REPO_ID="${entry%%:*}"
    REPO_PATH="${entry#*:}"
    REPO_DOC_COUNT=0
    for scope_dir in internal public; do
      CHILD_DOCS="$REPO_PATH/.specweave/docs/$scope_dir"
      if [ -d "$CHILD_DOCS" ]; then
        C=$(find "$CHILD_DOCS" -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ')
        REPO_DOC_COUNT=$((REPO_DOC_COUNT + C))
      fi
    done
    echo "CHILD_REPO:$REPO_ID:$REPO_DOC_COUNT docs"
  done
fi

# Check Docusaurus install status
[ -d ".specweave/docs-site-internal/node_modules" ] && echo "DOCUSAURUS:installed" || echo "DOCUSAURUS:not_installed"

# Check if docs server is running
SERVER_INFO=$(lsof -i :3000-3010 -sTCP:LISTEN 2>/dev/null | grep -i node | head -1 | awk '{print $9}' | cut -d: -f2)
[ -n "$SERVER_INFO" ] && echo "SERVER:running:$SERVER_INFO" || echo "SERVER:stopped"

# List topics per directory
for dir in $DOC_DIRS; do
  echo "=== $dir ==="
  if [ -d "$dir/public" ]; then
    echo "  Public:"
    ls "$dir/public/" 2>/dev/null || echo "  (none)"
  fi
  if [ -d "$dir/internal" ]; then
    echo "  Internal:"
    ls "$dir/internal/" 2>/dev/null || echo "  (none)"
  fi
  if [ -d "$dir/internal/architecture/adr" ]; then
    echo "  ADRs:"
    ls "$dir/internal/architecture/adr/" 2>/dev/null || echo "  (none)"
  fi
  # For non-standard directories (e.g., docs/), list top-level folders
  if [ "$dir" != ".specweave/docs" ] && [ -d "$dir" ]; then
    echo "  Folders:"
    ls -d "$dir"/*/ 2>/dev/null | xargs -I{} basename {} || echo "  (none)"
  fi
done

# In umbrella mode, also list child repo doc topics
if [ -n "$UMB_REPOS" ]; then
  for entry in $UMB_REPOS; do
    REPO_ID="${entry%%:*}"
    REPO_PATH="${entry#*:}"
    CHILD_DOC_DIR="$REPO_PATH/.specweave/docs"
    if [ -d "$CHILD_DOC_DIR" ]; then
      echo "=== $REPO_ID ==="
      [ -d "$CHILD_DOC_DIR/internal" ] && echo "  Internal:" && ls "$CHILD_DOC_DIR/internal/" 2>/dev/null || true
      [ -d "$CHILD_DOC_DIR/public" ] && echo "  Public:" && ls "$CHILD_DOC_DIR/public/" 2>/dev/null || true
    fi
  done
fi

Read the full file on GitHub · 216 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 216 lines · 45 tokens per session scan A 71759c663a91

Subscribe to this mod's changes

docs is a command published in the GitHub repository anton-abyzov/specweave (159 stars, last pushed 3d ago), licensed MIT. It adds 45 tokens to every session and 2,201 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.