Validate Counts
Validates hook, skill, and agent counts are consistent across CLAUDE.md, hooks.json, manifests, and source directories. Use when counts may be stale after adding or removing components, before releases, or when CLAUDE.md Project Overview looks wrong.
Validate Counts
Checks that hook, skill, and agent counts are consistent across all authoritative sources in OrchestKit. Outputs a comparison table and flags drift with precise file references.
Quick Start
# Full validation: counts src/ vs CLAUDE.md and manifests (run from repo root)
bash src/skills/validate-counts/scripts/validate-counts.sh
# Just get raw counts from src/
bash src/skills/validate-counts/scripts/count-all.shRules
| Category | Rule | Impact | Key Pattern |
|---|---|---|---|
| Count Sources | rules/sources-authoritative.md | HIGH | Filesystem is authoritative; derived sources must match |
| Drift Detection | rules/drift-reporting.md | HIGH | Comparison table + flag with file:field references |
Total: 2 rules across 2 categories
Workflow
- Run
scripts/validate-counts.shfor full validation (counts + drift comparison), orscripts/count-all.shfor raw counts only - Read
CLAUDE.md— extract counts from Project Overview and Version section - Read
manifests/ork.jsonandmanifests/orkl.json— check skill/agent/hook array lengths - Build the comparison table (see
rules/drift-reporting.mdfor format) - Flag any mismatches with file + field references; otherwise output "All counts consistent."
References
- Count Locations — Where every count lives and why drift happens
Related Skills
release-checklist— Uses validate-counts as step 5 of the release gatedoctor— Broader health check that includes count validationaudit-skills— Quality audit for skill structure and completeness
Common Mistakes
- Counting from
plugins/instead ofsrc/— plugins/ may be empty after an interrupted build - Flagging
orklvsorkskill differences as drift —orklintentionally excludes some skills - Forgetting the hook breakdown: global + agent-scoped + skill-scoped must sum to total
Rules (2)
Report drift accurately so CLAUDE.md counts reflect the actual codebase state — HIGH
Drift Detection and Reporting
After counting all sources, compare them and report using a structured table. Flag every mismatch with a specific file and field reference.
Comparison Table Format
Output one table row per source. Use MATCH or DRIFT in the Status column.
| Source | Skills | Agents | Hooks | Status |
|-------------------------------|--------|--------|-------|--------|
| src/skills/ (actual) | 63 | — | — | — |
| src/agents/ (actual) | — | 37 | — | — |
| src/hooks/hooks.json (actual) | — | — | 87 | — |
| CLAUDE.md Project Overview | 63 | 37 | 87 | MATCH |
| CLAUDE.md Version section | — | — | 85 | DRIFT |
| manifests/ork.json | 63 | 36 | 87 | MATCH |
| manifests/orkl.json | 46 | 36 | 87 | — |Flagging Drift
For each DRIFT row, output a specific fix instruction:
DRIFT: CLAUDE.md Version section says "85 entries" but hooks.json has 87.
Fix: Update src/hooks/README.md line ~5 and CLAUDE.md Version section to "87 entries"Include:
- Which file has the wrong value
- What the correct value is
- Approximate line number or field name where the stale count appears
Known Legitimate Differences
These are NOT drift — do not flag them:
| Difference | Reason |
|---|---|
orkl skills < ork skills | orkl excludes Python/React/LLM/creative skills by design |
manifests/ork-creative.json skills < ork | creative plugin is an add-on with its own subset |
| Agent count in manifests = actual - 1 | Some agents may be internal-only and excluded from manifest |
Incorrect:
DRIFT: CLAUDE.md has wrong hook count.Correct:
DRIFT: CLAUDE.md Version section says "85 entries" but hooks.json has 87.
Fix: Update CLAUDE.md Version section (line ~42) to "87 entries"Key Rules
- If all counts match, output "All counts consistent." and stop
- Always show the full table even when there is no drift — it confirms what was checked
- Reference file + field, not just file, when flagging drift (e.g., "CLAUDE.md line 7, Project Overview")
Read from authoritative count sources to prevent false-positive drift detection — HIGH
Authoritative Count Sources
Each count has exactly one authoritative source (the filesystem/JSON) and multiple derived sources (docs/manifests) that must stay in sync.
Hooks
Authoritative: src/hooks/hooks.json — count entries in the top-level hooks array.
# Count hook entries
jq '.hooks | length' src/hooks/hooks.jsonDerived sources to check against:
CLAUDE.mdProject Overview line: "N hooks (X global + Y agent-scoped + Z skill-scoped)"CLAUDE.mdVersion section: "N entries (X global + Y agent-scoped + Z skill-scoped, ...)"src/hooks/hooks.jsontop-leveldescriptionfield (may embed count)manifests/ork.jsonandmanifests/orkl.json— hook count in metadata
Skills
Authoritative: src/skills/ — count subdirectories (each directory = one skill).
# Count skill directories
ls -d src/skills/*/ | wc -lDerived sources:
CLAUDE.mdProject Overview: "N skills"manifests/ork.json— skill list lengthmanifests/orkl.json— skill list length (legitimately lower — excludes Python/React/LLM skills)
Agents
Authoritative: src/agents/ — count .md files.
# Count agent files
ls src/agents/*.md | wc -lDerived sources:
CLAUDE.mdProject Overview: "N agents"manifests/ork.json— agent list lengthmanifests/orkl.json— agent list length
Incorrect:
# Counting from generated plugins/ — stale if build was interrupted
ls -d plugins/ork/skills/*/ | wc -lCorrect:
# Always count from src/ — the authoritative source
ls -d src/skills/*/ | wc -lKey Rules
- Never count
plugins/— it's generated fromsrc/and may be stale if build was interrupted orklskill/agent counts WILL differ fromork— this is expected, not drift- Hook breakdown (global + agent-scoped + skill-scoped) must sum to the total count
References (1)
Count Locations
Count Locations in OrchestKit
Overview of every place counts appear and what they represent.
Where Counts Live
Source of Truth (filesystem)
| What | Path | How to Count |
|---|---|---|
| Skills | src/skills/*/ | Subdirectory count |
| Agents | src/agents/*.md | .md file count |
| Hooks | src/hooks/hooks.json → .hooks[] | Array length |
Derived Counts (must stay in sync)
| File | Field | Example |
|---|---|---|
CLAUDE.md | Project Overview line | "68 skills, 38 agents, 77 hooks" |
CLAUDE.md | Version section | "85 entries (63 global + 22 agent-scoped...)" |
src/hooks/hooks.json | top-level description | May embed hook count |
manifests/ork.json | skills[] length, agents[] length | Counted from arrays |
manifests/orkl.json | skills[] length, agents[] length | Subset of ork |
Why Counts Drift
Counts in documentation and manifests must be updated manually after adding or removing components. Common drift scenarios:
- Added a skill —
src/skills/count increases, butCLAUDE.mdand manifests may not be updated untilnpm run buildis run and CLAUDE.md is manually edited. - Added a hook —
hooks.jsonentry count increases, but thedescriptionfield and CLAUDE.md still show the old count. - Interrupted build —
plugins/is emptied at build start; if build fails mid-run, plugins are gone but src counts are fine.
Hook Breakdown
CLAUDE.md tracks hooks with a breakdown: N hooks (X global + Y agent-scoped + Z skill-scoped).
- Global: hooks that run on all Claude Code sessions
- Agent-scoped: hooks only active during named agent sessions
- Skill-scoped: hooks only active when a specific skill is running
The three numbers must sum to the total. The authoritative breakdown comes from src/hooks/hooks.json — each entry has a scope field or equivalent.
Upgrade Assessment
Assess platform upgrade readiness for Claude model and CC version changes. Use when evaluating upgrades.
Verify
Comprehensive verification with parallel test agents. Use when verifying implementations or validating changes.
Last updated on