Claude Skill

update-project-docs

MANDATORY for every coding agent (Claude Code, Codex, or any other) — keep this repository's documentation in sync after any change to behavior, configuration, interfaces, events, schema, or features. Use automatically (without being asked) at the end of ANY change-set that adds

LLM Mart · 0 points · 10 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download hoangsonww-Claude-Code-Agent-Monitor-.claude_skills_update-project-docs-3a7630b.zip · 10 KB
Part of hoangsonww/claude-code-agent-monitor — 86 skills

Install

skills CLI npx skills add https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/master/.claude/skills/update-project-docs
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install hoangsonww-claude-code-agent-monitor@llmmart
Git git clone https://github.com/hoangsonww/Claude-Code-Agent-Monitor.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole hoangsonww/claude-code-agent-monitor collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Update Project Docs

This repository keeps an unusually large, multi-surface, multi-language doc set. Docs drift silently because a change often belongs in 6–10 files across 5 languages plus two HTML pages. This skill encodes which docs exist, which change-types touch which docs, and how to propagate consistently (including the wiki i18n + cache-bump dance).

Authoritative inventory with exact section anchors lives in references/doc-map.md — read it when deciding where a specific change lands. The repo rules .claude/rules/docs-markdown.md ("update all affected docs together"), .claude/rules/wiki-i18n.md, and .claude/rules/i18n-parity.md are binding. Translation propagation — the mirrored READMEs, the wiki bundles, and the UI keys — is owned by the i18n-parity skill; run it whenever this skill's mapping sends you into a localized file.

When to update (including without being asked)

Update docs in the same change-set (PR/commit) as the code, before claiming done — do not wait for the user to ask — whenever the change is observable from outside the module:

  • New/changed env var → every env-var table + .env.example.
  • New event type (e.g. an events.event_type value) → every event-type list/table.
  • New/changed hook behavior or session/agent state transition → hook docs + every state-machine diagram.
  • New/changed API route or response shape → API docs + route tables + OpenAPI.
  • DB schema change (table/column/index) → database docs + ERD.
  • New WebSocket message type → client/server WS docs.
  • New MCP tool → MCP docs.
  • New CLI command / script / renamed file referenced in docs → command lists + onboarding guides.
  • New user-facing feature / page / background service → feature tables + landing + wiki + architecture.

Do NOT auto-update for: pure internal refactors with no observable/interface/config change, test-only changes, comment/typo fixes, or work the user explicitly scoped as "no docs". When unsure whether a change is observable, check the mapping below; if it touches any row, update.

Change → docs mapping

Change type Docs to update
Env var README.md, README-CN.md, README-VN.md, README-KO.md, README-ES.md (env tables), ARCHITECTURE.md (inline), server/README.md, wiki/index.html (env table) + wiki i18n, .env.example
Event type README.md+CN+VN+KO+ES (hook-event table), ARCHITECTURE.md (Event types line), docs/PLUGINS.md, wiki/index.html + i18n, docs/DATABASE.md (if it enumerates types)
Hook behavior / state transition docs/HOOKS.md, state-machine mermaid diagrams in README.md+CN+VN+KO+ES + server/README.md + docs/DATABASE.md + wiki/index.html, ARCHITECTURE.md (hooks.js row)
API route / response docs/API.md, server/README.md (routes), ARCHITECTURE.md (routes row), server/openapi*.js (code)
DB schema docs/DATABASE.md, ARCHITECTURE.md (ERD/schema)
WebSocket message client/README.md (Event Types), server/README.md, wiki/index.html
MCP tool mcp/README.md, docs/MCP.md
Feature / page / background service README.md+CN+VN+KO+ES (feature table + data-flow list), ARCHITECTURE.md (module table), index.html (landing blurb), wiki/index.html + i18n, server/README.md or client/README.md
CLI command / script README.md commands, CLAUDE.md / AGENTS.md, INSTALL.md / SETUP.md
New language Run the i18n-parity skill and work through its new-language checklist — it covers docs/I18N.md, client/src/i18n/**, the switchers, format.ts, README-<XX>.md, and the full wiki bundle

Procedure

  1. Classify the change against the table above. A change can hit multiple rows (a new feature with a new env var hits both).
  2. Write the canonical English version first — usually README.md and/or ARCHITECTURE.md. Get the wording right there; it anchors everything else.
  3. Propagate to translations README-CN.md, README-VN.md, README-KO.md, and README-ES.md: mirror the SAME edits at the corresponding sections. Keep identifiers, env-var names, event names, and code in English; translate only prose. Render "Waiting" as 等待中 (zh) / Đang chờ (vi) / 대기 중 (ko) / En espera (es). Match each file's existing terminology — read the neighboring lines first. The i18n-parity skill owns this propagation and its glossary.
  4. Landing page index.html: one concise marketing sentence in the most relevant existing feature card — light touch, no new sections.
  5. Wiki wiki/index.html: add the detailed prose/table/diagram at the length and in the position its neighbours already use (see Match the wiki's existing shape below), then follow .claude/rules/wiki-i18n.md — add zh + vi + ko + es entries for every new English string to wiki/i18n-content.js, then bump the cache: increment CACHE_NAME in wiki/sw.js and the i18n-content.js?v= query string in wiki/index.html. Skipping the cache bump means returning visitors never see the update.
  6. Area READMEs / docs/: update server/README.md, client/README.md, and the relevant docs/*.md per the mapping.
  7. Diagrams: when a state transition changes, edit every mermaid stateDiagram-v2 block that models it (they are duplicated across README/CN/VN/KO/ES, server/README, docs/DATABASE, wiki). Keep transition labels consistent.

Match the wiki's existing shape

The wiki is a designed page, not a changelog: several of its blocks live in fixed-size boxes. A block written at 2–3x the length of its neighbours breaks the layout, so measure before you write, and copy the pattern you find.

  • Feature carousel cards (#feature-carousel .feature-card) share one fixed-height box. All 39 of them are a single <p>; the group runs 209–628 characters with a ~494 median, so write to roughly 450–550 characters (~65–80 words) — one paragraph, no lists, no sub-headings, no exhaustive enumeration of every keybinding and edge case. Say what the feature is and the two or three things that make it distinctive; the depth belongs in the feature's own section further down the page.
  • Screenshot captions (.screenshot-caption) run ~150–300 characters: the emoji, the bolded screen name, an em dash, one dense sentence.
  • Card order is editorial, not chronological. A new feature does NOT go first. Insert it where it belongs by importance among the existing cards — a newly shipped convenience feature belongs in the middle or later half of the carousel, not ahead of the dashboard, board, and session cards.
  • Deep, unabridged prose (full keyboard maps, degradation behaviour, group-by- group breakdowns) belongs in a normal <section> with h3 + <ul>, never crammed into a card or caption.
  • Run .claude/skills/update-project-docs/scripts/wiki-block-lengths.sh and confirm your block sits inside the group's budget before finishing.
  • Changing wiki CSS? Verify it in a browser that ran script.js (see .claude/rules/wiki-i18n.md) — the scroll-reveal pass adds classes at runtime, so a :not([class]) selector that looks right in the file and in jsdom can apply to nothing on the live page.
  • The same rule of thumb applies everywhere on the page: before adding a block of any kind, read the two blocks around it and match their length, tone, markup, and heading depth. Do not invent a new pattern for one entry.

Verify (do not skip)

  • Coverage: run scripts/doc-coverage.sh <new-term> [...] (e.g. the new env var / event type / identifier) and confirm every doc the mapping flags shows a HIT. The matrix is advisory — not every term belongs in every file — but a flagged doc reading 0 is a miss to fix.
  • Tables: markdown tables stay pipe-balanced (header column count == every row).
  • Mermaid: each edited block still parses (valid source --> target: label).
  • i18n: every new wiki English string resolves to zh, vi, ko, and es; cache versions bumped — CACHE_NAME in wiki/sw.js plus the ?v= query strings, which must match between wiki/index.html and the service-worker PRECACHE list (it matches on the full URL, query included, so a stale entry is simply never served).
  • Wiki block sizing: .claude/skills/update-project-docs/scripts/wiki-block-lengths.sh exits 0 — no carousel card or caption is an outlier, and any new card is placed by importance rather than dropped at the front.
  • Format/tests: run npm run format (or prettier --check on touched files); for any code touched, run the verification from CLAUDE.md (npm run test:server / test:client / mcp:typecheck).
  • State exactly which docs were updated and which were intentionally skipped (with reason), mirroring the repo's verification policy.

Tips

  • The fastest way to find where something already lives: grep -n "<existing-neighbor-term>" <doc> (e.g. grep an adjacent env var to find the env table). references/doc-map.md lists the stable anchors per file.
  • Parallelize translations + HTML across subagents when the change is large, but write the canonical English edit yourself first so the translations have a faithful source.
  • One language/area per subagent keeps edits reviewable and tables un-corrupted.
Files (claude-code-agent-monitor)
  • references
    • doc-map.md 6.6 KB
      # Documentation Map
      
      Authoritative inventory of this repository's documentation surface: every doc that must be kept in sync, what each contains, and the stable anchors to grep for when placing an edit. Section line numbers drift — grep the anchor strings, don't trust line numbers.
      
      ## Tier 1 — primary, always consider
      
      ### `README.md` (English, canonical)
      The source of truth most other docs mirror. Key sections:
      - **Feature table** — rows like `**Kanban Board**`, `**Transcript Cache**`, `**Pre-Existing Session Detection**`, `**Continuous Project Sync**`. Grep a neighboring row label.
      - **Data-flow numbered list** — bullets describing hook ingestion, the watchdog, periodic sweep, continuous sync. Grep `Error detection watchdog` / `periodic server sweep`.
      - **Agent State Machine** + **Session State Machine** — two `mermaid stateDiagram-v2` blocks. Grep `stateDiagram-v2`.
      - **Hook Events table** — `| Hook Type | Trigger | Dashboard Action |`. Lists `SessionStart`…`SessionEnd`, plus synthetic `Compaction`, `APIError`, `TurnDuration`, `ToolError`, `Interrupted`. Grep `## Hook Events`.
      - **Configuration / Environment Variables table** — `| Environment Variable | Default | Description |`. Grep `DASHBOARD_PORT` or `DASHBOARD_HOST`.
      
      ### `README-CN.md` / `README-VN.md` / `README-KO.md` / `README-ES.md` (full translations)
      Standalone full translations of `README.md` — zh, vi, ko, es. **Every** README change must be mirrored into **all four** at the corresponding section. Terminology, glossary, and the never-translate list live in [`.claude/skills/i18n-parity/references/translation-style.md`](../../i18n-parity/references/translation-style.md); verify with `bash .claude/skills/i18n-parity/scripts/i18n-audit.sh`. Conventions:
      - Keep in English/code: identifiers, env-var names, event-type names, `awaiting_input_since`, `pendingInterrupt`, "watchdog", `fs.watch`, model IDs, mermaid transition labels.
      - Translate prose. "Waiting" → **等待中** (zh) / **Đang chờ** (vi) / **대기 중** (ko) / **En espera** (es). "watchdog" often kept; in zh sometimes 看门狗.
      - The second (update-checker) env table exists in EN but may be absent in VN/CN — don't invent rows that aren't there.
      
      ### `ARCHITECTURE.md`
      - **Module responsibility table** — one row per source file (`scripts/import-history.js`, `lib/transcript-cache.js`, `routes/hooks.js`, `server/index.js`, …). Update the row whose file you changed. Grep the file path.
      - **Data-flow + sequence diagrams**, **state machines**, **Continuous background sync** prose block (grep `Continuous background sync`).
      - **Event types line** — grep `| Event types |`.
      - **ERD / schema** mermaid + `event_type "PreToolUse|PostToolUse|Stop|etc"`.
      
      ### `index.html` (root landing / marketing)
      Feature cards (`<div class="feature-card">`) with concise marketing copy. Light touch only — one sentence in the most relevant existing card. Grep an existing feature headline (e.g. `History import`, `Kanban`).
      
      ### `wiki/index.html` + `wiki/i18n-content.js` + `wiki/sw.js`
      Detailed wiki. Governed by `.claude/rules/wiki-i18n.md`:
      - Add prose/tables/diagrams in `wiki/index.html` (Hook table `<th>Hook Type</th>`, Environment Variables `<th>Variable</th>`, mermaid `stateDiagram-v2` blocks).
      - For **every new English string**, add a `zh`, `vi`, `ko`, and `es` entry in `wiki/i18n-content.js` (keyed by the exact English text). See `.claude/skills/i18n-parity/` for the full wiki mechanism.
      - **Bump the cache**: increment `CACHE_NAME` in `wiki/sw.js` (e.g. `wiki-v24` → `wiki-v25`) AND the `i18n-content.js?v=N` query in `wiki/index.html`. Without this, returning visitors get stale cached content.
      
      ## Tier 2 — area-specific
      
      ### `server/README.md`
      Backend reference: routes table, **Error Detection Watchdog** / **User-Interrupt (Esc) Recovery** / **Continuous Project Sync** sections, Agent/Session lifecycle mermaid diagrams, Environment Variables bash block under `## Deployment`. Update for any backend behavior, route, state, env var, or background service.
      
      ### `client/README.md`
      Frontend reference: component list, **Event Types** table (WebSocket broadcast message types like `session_created`, `agent_updated`), session/agent status TypeScript unions. Update for new WS message types or client-facing behavior. NOT needed for server-only changes the UI already renders generically.
      
      ### `docs/HOOKS.md`
      Per-hook deep reference (`### 1. SessionStart` … `### 8. SessionEnd`), the `awaiting_input_since` overlay rules, the "User interrupts (Esc) — no hook fires" section, transcript-derived sync. Update for any hook semantics or state behavior.
      
      ### `docs/DATABASE.md`
      Schema reference: `sessions` / `agents` / `events` tables, column docs, status CHECK constraints, lifecycle mermaid diagrams. Update for schema or state-machine changes.
      
      ### `docs/API.md`
      REST API reference (endpoints, params, example responses). Update for route/response changes. Pair with `server/openapi*.js` (code, not docs).
      
      ### `docs/PLUGINS.md`
      Plugin/marketplace docs incl. an **Event Types** enumeration line — keep it in sync with the canonical event-type list.
      
      ### `docs/MCP.md` + `mcp/README.md`
      MCP server + tool reference. Update for new/changed MCP tools.
      
      ### `docs/I18N.md`
      i18n architecture: **Supported languages** list, `supportedLngs`, the 15 namespaces. Update when adding a language or namespace. Client UI strings live in `client/src/i18n/locales/{en,zh,vi,ko,es}/*.json` (code).
      
      ## Tier 3 — situational
      
      - `.env.example` — every env var belongs here with a sane default + comment.
      - `INSTALL.md`, `SETUP.md`, `DEPLOYMENT.md`, `docs/DEPLOYMENT.md` — install/run/deploy commands.
      - `CLAUDE.md`, `AGENTS.md` — agent working guides; update when commands, file locations, or workflows change.
      - `docs/README.md` — docs index; add a link when a new `docs/*.md` is created.
      - `desktop/README.md`, `vscode-extension/README.md`, `statusline/README.md` — surface-specific; update only when that surface changes.
      
      ## Consistency invariants
      
      - The **event-type set** must match across: `README` hook table (+CN/VN/KO/ES), `ARCHITECTURE` Event types line, `docs/PLUGINS.md`, `wiki`. When adding one, grep the existing set (e.g. `TurnDuration`) across all and add everywhere it appears.
      - **Env-var set** must match across: README (+CN/VN/KO/ES) tables, `server/README.md`, `wiki`, `.env.example`, and any inline `ARCHITECTURE` mention.
      - **State-machine diagrams** are duplicated across README (+CN/VN/KO/ES), `server/README.md`, `docs/DATABASE.md`, `wiki`. A transition change touches all of them.
      - Run `scripts/doc-coverage.sh <term>` to confirm a new identifier/var/event reached every doc that should mention it.
      
  • scripts
    • doc-coverage.sh 1.8 KB
      #!/usr/bin/env bash
      # doc-coverage.sh — verify that one or more terms (a new env var, event type,
      # route, identifier, feature name, …) are documented across this repo's
      # canonical doc surface. Prints a HIT/miss matrix so a docs update can be
      # checked for "full coverage" before finishing.
      #
      # Usage:
      #   .claude/skills/update-project-docs/scripts/doc-coverage.sh DASHBOARD_SESSION_SYNC_MS
      #   .claude/skills/update-project-docs/scripts/doc-coverage.sh Interrupted pendingInterrupt
      #
      # Run from the repo root. Exit code is non-zero if any term is missing from a
      # doc that the change-type mapping (see references/doc-map.md) says it belongs
      # in — but treat the matrix as advisory: not every term belongs in every file.
      # @author Son Nguyen <hoangson091104@gmail.com>
      
      set -u
      
      # The canonical doc set kept in sync. Translations + HTML + per-area READMEs.
      DOCS=(
        "README.md"
        "README-VN.md"
        "README-CN.md"
        "README-KO.md"
        "README-ES.md"
        "ARCHITECTURE.md"
        "index.html"
        "wiki/index.html"
        "wiki/i18n-content.js"
        "server/README.md"
        "client/README.md"
        "docs/HOOKS.md"
        "docs/DATABASE.md"
        "docs/API.md"
        "docs/PLUGINS.md"
        "docs/MCP.md"
        "mcp/README.md"
        "docs/I18N.md"
        ".env.example"
      )
      
      if [ "$#" -eq 0 ]; then
        echo "usage: $0 <term> [term2 ...]" >&2
        exit 2
      fi
      
      missing_any=0
      for term in "$@"; do
        echo "── coverage for: $term ──────────────────────────────"
        for doc in "${DOCS[@]}"; do
          if [ ! -f "$doc" ]; then
            printf "  %-26s (absent)\n" "$doc"
            continue
          fi
          n=$(grep -Fc -- "$term" "$doc" 2>/dev/null || true)
          n=${n:-0}
          if [ "$n" -gt 0 ]; then
            printf "  ✅ %-26s %s\n" "$doc" "$n"
          else
            printf "  ·  %-26s 0\n" "$doc"
          fi
        done
        echo
      done
      
      exit $missing_any
      
    • wiki-block-lengths.sh 3.4 KB
      #!/usr/bin/env bash
      # wiki-block-lengths.sh — measure the length of the wiki's fixed-size prose
      # blocks so a new entry matches the ones already there instead of blowing up
      # the layout. The feature carousel gives every card the same box: a card that
      # is far longer than its neighbours overflows or squashes the whole carousel.
      #
      # Usage (from the repo root):
      #   .claude/skills/update-project-docs/scripts/wiki-block-lengths.sh          # both groups
      #   .claude/skills/update-project-docs/scripts/wiki-block-lengths.sh cards
      #   .claude/skills/update-project-docs/scripts/wiki-block-lengths.sh captions
      #
      # Prints one line per block (character count of the tag-stripped text) plus the
      # min/median/max of the group and flags any block outside the existing range.
      # @author Son Nguyen <hoangson091104@gmail.com>
      
      set -u
      cd "$(git rev-parse --show-toplevel 2>/dev/null || echo .)" || exit 1
      WHICH="${1:-all}"
      
      python3 - "$WHICH" <<'PY'
      import re, statistics, sys
      from html import unescape
      
      which = sys.argv[1]
      html = open("wiki/index.html", encoding="utf-8").read()
      strip = lambda s: unescape(" ".join(re.sub(r"<[^>]+>", "", s).split()))
      status = 0
      
      
      def report(title, items, tolerance):
          """tolerance is the multiple of the group median a block may not exceed.
          Carousel cards share one fixed-height box, so they get the tighter bound."""
          global status
          if not items:
              return
          lengths = [n for _, n in items]
          lo, hi = min(lengths), max(lengths)
          # Keep this arithmetic identical to the gate in client/tests/wiki-i18n.test.ts:
          # statistics median (mean of the two middles when the group is even), then
          # truncate both it and the budget, so the two never disagree on a block.
          med = int(statistics.median(lengths))
          budget = int(med * tolerance)
          print(
              f"\n{title} — {len(items)} blocks | min {lo} · median {med} · max {hi} chars"
              f" | budget {budget}"
          )
          for name, n in items:
              flag = ""
              if n > budget:
                  flag = "  <-- TOO LONG: trim toward the median"
                  status = 1
              print(f"  {n:5d}  {name}{flag}")
      
      
      if which in ("all", "cards"):
          # The carousel runs to the end of its section; `.feature-card` is also used
          # in grids elsewhere on the page, so bound the slice instead of scanning all.
          start = html.index('<div class="carousel" id="feature-carousel">')
          seg = html[start : html.index("</section>", start)]
          # Most cards carry an `id` on their <h3> (they are cross-referenced from the
          # nav and from other docs), but plenty do not — match the card container and
          # fall back to the heading text so no card escapes the budget.
          card_re = re.compile(
              r'<div\b[^>]*\bclass="[^"]*\bfeature-card\b[^"]*"[^>]*>'
              r'.*?<h3(?:[^>]*\bid="([^"]+)")?[^>]*>(.*?)</h3>\s*<p>(.*?)</p>',
              re.S,
          )
          cards = [
              (m.group(1) or strip(m.group(2)), len(strip(m.group(3))))
              for m in card_re.finditer(seg)
          ]
          report("Feature carousel cards", cards, 1.5)
      
      if which in ("all", "captions"):
          # Same class-token match as the cards: one caption carries an inline style,
          # and an exact-tag pattern would skip it.
          caption_re = re.compile(
              r'<div\b[^>]*\bclass="[^"]*\bscreenshot-caption\b[^"]*"[^>]*>(.*?)</div>', re.S
          )
          caps = [
              (strip(m.group(1))[:48], len(strip(m.group(1)))) for m in caption_re.finditer(html)
          ]
          report("Screenshot captions", caps, 2.0)
      
      print()
      sys.exit(status)
      PY
      
  • SKILL.md 10.2 KB
    ---
    name: update-project-docs
    description: MANDATORY for every coding agent (Claude Code, Codex, or any other) — keep this repository's documentation in sync after any change to behavior, configuration, interfaces, events, schema, or features. Use automatically (without being asked) at the end of ANY change-set that adds or alters an env var, event type, hook behavior, session/agent state transition, API route or response shape, DB schema, WebSocket message, MCP tool, CLI command, or user-facing feature — and whenever the user asks to "update the docs / README / wiki / architecture". Knows the full doc surface (README + CN/VN/KO/ES, ARCHITECTURE, root index.html, wiki + i18n, server/client READMEs, docs/*) and which docs each kind of change touches.
    ---
    
    # Update Project Docs
    
    This repository keeps an unusually large, multi-surface, multi-language doc set. Docs drift silently because a change often belongs in 6–10 files across 5 languages plus two HTML pages. This skill encodes **which docs exist, which change-types touch which docs, and how to propagate consistently** (including the wiki i18n + cache-bump dance).
    
    Authoritative inventory with exact section anchors lives in [`references/doc-map.md`](references/doc-map.md) — read it when deciding where a specific change lands. The repo rules [`.claude/rules/docs-markdown.md`](../../rules/docs-markdown.md) ("update all affected docs together"), [`.claude/rules/wiki-i18n.md`](../../rules/wiki-i18n.md), and [`.claude/rules/i18n-parity.md`](../../rules/i18n-parity.md) are binding. Translation propagation — the mirrored READMEs, the wiki bundles, and the UI keys — is owned by the [`i18n-parity`](../i18n-parity/SKILL.md) skill; run it whenever this skill's mapping sends you into a localized file.
    
    ## When to update (including without being asked)
    
    Update docs **in the same change-set (PR/commit) as the code**, before claiming done — do not wait for the user to ask — whenever the change is observable from outside the module:
    
    - **New/changed env var** → every env-var table + `.env.example`.
    - **New event type** (e.g. an `events.event_type` value) → every event-type list/table.
    - **New/changed hook behavior or session/agent state transition** → hook docs + every state-machine diagram.
    - **New/changed API route or response shape** → API docs + route tables + OpenAPI.
    - **DB schema change** (table/column/index) → database docs + ERD.
    - **New WebSocket message type** → client/server WS docs.
    - **New MCP tool** → MCP docs.
    - **New CLI command / script / renamed file referenced in docs** → command lists + onboarding guides.
    - **New user-facing feature / page / background service** → feature tables + landing + wiki + architecture.
    
    **Do NOT** auto-update for: pure internal refactors with no observable/interface/config change, test-only changes, comment/typo fixes, or work the user explicitly scoped as "no docs". When unsure whether a change is observable, check the mapping below; if it touches any row, update.
    
    ## Change → docs mapping
    
    | Change type | Docs to update |
    |---|---|
    | **Env var** | `README.md`, `README-CN.md`, `README-VN.md`, `README-KO.md`, `README-ES.md` (env tables), `ARCHITECTURE.md` (inline), `server/README.md`, `wiki/index.html` (env table) + wiki i18n, `.env.example` |
    | **Event type** | `README.md`+CN+VN+KO+ES (hook-event table), `ARCHITECTURE.md` (Event types line), `docs/PLUGINS.md`, `wiki/index.html` + i18n, `docs/DATABASE.md` (if it enumerates types) |
    | **Hook behavior / state transition** | `docs/HOOKS.md`, state-machine **mermaid** diagrams in `README.md`+CN+VN+KO+ES + `server/README.md` + `docs/DATABASE.md` + `wiki/index.html`, `ARCHITECTURE.md` (hooks.js row) |
    | **API route / response** | `docs/API.md`, `server/README.md` (routes), `ARCHITECTURE.md` (routes row), `server/openapi*.js` (code) |
    | **DB schema** | `docs/DATABASE.md`, `ARCHITECTURE.md` (ERD/schema) |
    | **WebSocket message** | `client/README.md` (Event Types), `server/README.md`, `wiki/index.html` |
    | **MCP tool** | `mcp/README.md`, `docs/MCP.md` |
    | **Feature / page / background service** | `README.md`+CN+VN+KO+ES (feature table + data-flow list), `ARCHITECTURE.md` (module table), `index.html` (landing blurb), `wiki/index.html` + i18n, `server/README.md` or `client/README.md` |
    | **CLI command / script** | `README.md` commands, `CLAUDE.md` / `AGENTS.md`, `INSTALL.md` / `SETUP.md` |
    | **New language** | Run the [`i18n-parity`](../i18n-parity/SKILL.md) skill and work through its [new-language checklist](../i18n-parity/references/new-language-checklist.md) — it covers `docs/I18N.md`, `client/src/i18n/**`, the switchers, `format.ts`, `README-<XX>.md`, and the full wiki bundle |
    
    ## Procedure
    
    1. **Classify** the change against the table above. A change can hit multiple rows (a new feature with a new env var hits both).
    2. **Write the canonical English version first** — usually `README.md` and/or `ARCHITECTURE.md`. Get the wording right there; it anchors everything else.
    3. **Propagate to translations** `README-CN.md`, `README-VN.md`, `README-KO.md`, and `README-ES.md`: mirror the SAME edits at the corresponding sections. Keep identifiers, env-var names, event names, and code in English; translate only prose. Render "Waiting" as **等待中** (zh) / **Đang chờ** (vi) / **대기 중** (ko) / **En espera** (es). Match each file's existing terminology — read the neighboring lines first. The [`i18n-parity`](../i18n-parity/SKILL.md) skill owns this propagation and its glossary.
    4. **Landing page** `index.html`: one concise marketing sentence in the most relevant existing feature card — light touch, no new sections.
    5. **Wiki** `wiki/index.html`: add the detailed prose/table/diagram **at the length and in the position its neighbours already use** (see *Match the wiki's existing shape* below), then follow `.claude/rules/wiki-i18n.md` — add `zh` + `vi` + `ko` + `es` entries for every new English string to `wiki/i18n-content.js`, then **bump the cache**: increment `CACHE_NAME` in `wiki/sw.js` and the `i18n-content.js?v=` query string in `wiki/index.html`. Skipping the cache bump means returning visitors never see the update.
    6. **Area READMEs / docs/**: update `server/README.md`, `client/README.md`, and the relevant `docs/*.md` per the mapping.
    7. **Diagrams**: when a state transition changes, edit every mermaid `stateDiagram-v2` block that models it (they are duplicated across README/CN/VN/KO/ES, server/README, docs/DATABASE, wiki). Keep transition labels consistent.
    
    ## Match the wiki's existing shape
    
    The wiki is a designed page, not a changelog: several of its blocks live in
    fixed-size boxes. A block written at 2–3x the length of its neighbours breaks
    the layout, so **measure before you write, and copy the pattern you find**.
    
    - **Feature carousel cards** (`#feature-carousel .feature-card`) share one
      fixed-height box. All 39 of them are a single `<p>`; the group runs
      **209–628 characters with a ~494 median**, so write to roughly **450–550
      characters (~65–80 words)** — one paragraph, no lists, no sub-headings, no
      exhaustive enumeration of every keybinding and edge case. Say what the feature is and
      the two or three things that make it distinctive; the depth belongs in the
      feature's own section further down the page.
    - **Screenshot captions** (`.screenshot-caption`) run **~150–300 characters**:
      the emoji, the bolded screen name, an em dash, one dense sentence.
    - **Card order is editorial, not chronological.** A new feature does NOT go
      first. Insert it where it belongs by importance among the existing cards —
      a newly shipped convenience feature belongs in the middle or later half of
      the carousel, not ahead of the dashboard, board, and session cards.
    - Deep, unabridged prose (full keyboard maps, degradation behaviour, group-by-
      group breakdowns) belongs in a normal `<section>` with `h3` + `<ul>`, never
      crammed into a card or caption.
    - Run `.claude/skills/update-project-docs/scripts/wiki-block-lengths.sh` and
      confirm your block sits inside the group's budget before finishing.
    - Changing wiki **CSS**? Verify it in a browser that ran `script.js` (see
      `.claude/rules/wiki-i18n.md`) — the scroll-reveal pass adds classes at
      runtime, so a `:not([class])` selector that looks right in the file and in
      jsdom can apply to nothing on the live page.
    - The same rule of thumb applies everywhere on the page: before adding a block
      of any kind, read the two blocks around it and match their length, tone,
      markup, and heading depth. Do not invent a new pattern for one entry.
    
    ## Verify (do not skip)
    
    - **Coverage**: run `scripts/doc-coverage.sh <new-term> [...]` (e.g. the new env var / event type / identifier) and confirm every doc the mapping flags shows a HIT. The matrix is advisory — not every term belongs in every file — but a flagged doc reading `0` is a miss to fix.
    - **Tables**: markdown tables stay pipe-balanced (header column count == every row).
    - **Mermaid**: each edited block still parses (valid `source --> target: label`).
    - **i18n**: every new wiki English string resolves to `zh`, `vi`, `ko`, and `es`; cache versions bumped — `CACHE_NAME` in `wiki/sw.js` plus the `?v=` query strings, which must match between `wiki/index.html` and the service-worker `PRECACHE` list (it matches on the full URL, query included, so a stale entry is simply never served).
    - **Wiki block sizing**: `.claude/skills/update-project-docs/scripts/wiki-block-lengths.sh` exits 0 — no carousel card or caption is an outlier, and any new card is placed by importance rather than dropped at the front.
    - **Format/tests**: run `npm run format` (or `prettier --check` on touched files); for any code touched, run the verification from `CLAUDE.md` (`npm run test:server` / `test:client` / `mcp:typecheck`).
    - State exactly which docs were updated and which were intentionally skipped (with reason), mirroring the repo's verification policy.
    
    ## Tips
    
    - The fastest way to find where something already lives: `grep -n "<existing-neighbor-term>" <doc>` (e.g. grep an adjacent env var to find the env table). `references/doc-map.md` lists the stable anchors per file.
    - Parallelize translations + HTML across subagents when the change is large, but write the canonical English edit yourself first so the translations have a faithful source.
    - One language/area per subagent keeps edits reviewable and tables un-corrupted.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related