Files
AgentHub/skills/update-project-docs/scripts/doc-coverage.sh
T
nntrivi2001 b7c573f8d9 feat(plugin): ship the repo's skills as ccam plugin skills
The repo root already IS the `ccam` plugin root (`"source": "./"`), so the
conventional `skills/` dir at the root is the plugin's skills dir — while
`.claude/skills/` only loaded for a session whose cwd was inside this
checkout. That is useless for a lane working in another repo, which is why
`ccam skills install` existed at all.

Move all seven skills to `skills/`: they now reach every plugin user as
`/ccam:<name>` (bare `/<name>` as an alias). `ccam skills install` stays as
the fallback for a plain checkout without the plugin, sourcing from the new
path.

Agents deliberately do NOT move. A plugin agent is addressed as
`ccam:qc-local`, which would break the `subagent_type: qc-local` references
in ship-feature-lane; `ccam lanes agents install` keeps writing them into the
lane's own `.claude/agents/`, the highest-priority agent source. MCP was
already plugin-shipped via `plugins/ccam/.mcp.json`.

Mechanical fallout: ~115 source files carry a doc-comment pointer to
`.claude/skills/file-headers/`, repointed to `skills/file-headers/`. The
generic Claude Code config-surface examples in openapi/cc-config (`.claude/
skills/code-reviewer`) describe any user's layout and are left alone.

Also fixes the two file-headers scripts, whose `ROOT=` climbed four levels
from `.claude/skills/file-headers/scripts/` and would have escaped the repo
from the new depth — it scanned sibling projects until corrected to three.

npm run test:server (1160 pass), test:client (422 pass), mcp:typecheck,
mcp:build + mcp:check-build all green.
2026-08-21 17:17:33 +07:00

59 lines
1.6 KiB
Bash
Executable File

#!/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:
# skills/update-project-docs/scripts/doc-coverage.sh DASHBOARD_SESSION_SYNC_MS
# 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 Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
set -u
# The canonical doc set kept in sync. Translations + HTML + per-area READMEs.
DOCS=(
"README.md"
"ARCHITECTURE.md"
"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