Skip to content

Commit 88fa5df

Browse files
committed
fix(docs-review): accept any file type in docs-review/docs-loop slash grammar, not just .md
1 parent 31f2991 commit 88fa5df

6 files changed

Lines changed: 15 additions & 12 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hyperclaude",
3-
"version": "1.9.1",
3+
"version": "1.9.2",
44
"description": "Push Claude Code beyond stock. Skills, agents, Codex collab — opinionated and personal.",
55
"author": {
66
"name": "zeikar",

docs/decisions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ Rules live in `references/review-brief.md`; the four caller skills (`hyper-plan-
323323

324324
`docs-target` frontmatter now encodes as a JSON array in `--docs-path` list mode (vs. the pre-existing JSON string in `--docs-dir` mode); `resume.mjs`'s identity check normalizes both shapes — a legacy scalar string is wrapped to a 1-element array before the set comparison — so pre-existing single-string artifacts remain resumable without a migration.
325325

326+
**Follow-up 2026-07-16 — skill grammar relaxed from `.md`-only to any file.** The `hyper-docs-review` / `hyper-docs-loop` slash grammars initially accepted only `.md` file tokens, which couldn't express the motivating `site/index.html` target above even though the bridge itself never restricted extension. Relaxed to discriminate file-vs-directory by an existence check (`[ -f ]` / `[ -d ]`) rather than the `.md` extension, so the skills accept any existing file and match the bridge's capability. `--docs-dir` is still non-recursive and still top-level `.md`-only inside a directory (unchanged) — the relaxation is only about which explicit file tokens the `--docs-path` path accepts.
327+
326328
---
327329

328330
## Pointers (decisions documented elsewhere)

docs/gates-and-agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ A gate skill mediates a step in the cycle that produces a canonical `.hyperclaud
141141
- **Slash:** `/hyperclaude:hyper-docs-review [path...] [--diff-base <ref>] [--resume [<artifact>]]` — argument order is `path → --diff-base → --resume`. `path` defaults to `docs/` when omitted, so `/hyperclaude:hyper-docs-review --diff-base main` is valid (reviews `docs/` against the diff).
142142
- Empty → top-level `.md` files in `docs/` (commentarium convention).
143143
- Single file → reviews that file.
144-
- Multiple `.md` files (space-separated) → each maps to its own `--docs-path` flag (repeatable; appends).
144+
- Multiple files (space-separated, any type — e.g. `README.md` + `site/index.html`) → each maps to its own `--docs-path` flag (repeatable; appends).
145145
- Directory → reviews top-level `.md` files in that dir (recursion deferred — see [decisions.md](decisions.md)).
146146
- `--resume` — resume the most recent matching prior review (auto-discovers newest artifact in `.hyperclaude/docs-reviews/` matching on the docs-target SET — order-insensitive — plus diff-base and current `template-version`; falls back to fresh run if none found, records `codex-resume-status: fallback`).
147147
- `--resume <prev-artifact-path>` — resume from an explicit prior review; validation fail → `ok:false`, no fresh run. If docs payload exceeds 200KB on a resume run, bridge returns `ok:false` (no fallback — user must narrow scope).
@@ -153,7 +153,7 @@ A gate skill mediates a step in the cycle that produces a canonical `.hyperclaud
153153

154154
### `hyper-docs-loop` — autonomous docs-hardening loop
155155

156-
- **Slash:** `/hyperclaude:hyper-docs-loop [target]` — same target grammar as `hyper-docs-review` (empty → `docs/` directory; `.md` file → single-file mode; multiple `.md` files → repeated `--docs-path`; existing directory → directory mode).
156+
- **Slash:** `/hyperclaude:hyper-docs-loop [target]` — same target grammar as `hyper-docs-review` (empty → `docs/` directory; a file → single-file mode; multiple files → repeated `--docs-path`; existing directory → directory mode).
157157
- **Mechanics:** team-based docs-hardening loop. The skill confirms agent-teams availability via an env probe (`[ "$CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS" = "1" ]`; a missing env var stops as a clean no-op before any tree mutation), then spawns the [`documenter`](#documenter) agent once as a persistent teammate — same agent the `hyper-docs-sync` flow uses, dispatched in this loop with a structured-findings reply contract (the agent stays loop-agnostic; the per-finding schema and `request-id: <id>` prefix live ONLY in the SKILL.md spawn-prompt, not in the agent file); every lead→teammate SendMessage (findings, corrective, shutdown) runs the §A send-resolution procedure (bare `teammate_name` on the main path; `agent_id` fallback + notification-reply driving on degraded hosts via the removable `§A-DEGRADE` override). Then it invokes Codex `docs-review` directly via the bridge for that first review, sends blocking `### Findings` bullets to the still-live documenter via SendMessage, and repeats until no blocking findings remain (judged semantically — accuracy / drift / actively misleading claims block; pure prose-polish nits and redundancy-only findings do not) or a 6-review cap is reached. Only the `### Findings` section is gating; `### Gaps`, `### Broken Or Suspect Links`, and `### Cross-Doc Inconsistencies` are reported in the final Step 9 summary but never auto-fixed (those sections need human judgment). The reviewer is always the Codex bridge — NOT a team agent — preserving the "Claude builds, Codex reviews" invariant. (At Step 0 the lead Reads both the shared `${CLAUDE_PLUGIN_ROOT}/references/loop-protocol.md` — agent-teams contract, unsolicited-message protocol, teardown, abstract request-id state machine, AND the shared **§F loop skeleton** (Step 0/2/4a/8 boilerplate + degrade-condition pointers) that this SKILL binds to by pointing at the named §F sub-blocks — and the loop-specific `skills/hyper-docs-loop/references/failure-protocol.md` — structured-schema reply with `request-id: <id>` prefix, semantic finding-map validation, docs-loop-specific anti-patterns.)
158158
- **Writes:** the doc edits themselves (uncommitted), plus one `.hyperclaude/docs-reviews/<timestamp>-<slug>.md` per Codex review iteration.
159159
- **No baseline sync:** docs-loop is review ↔ fix only. If you want code-change-driven syncing first, run `/hyperclaude:hyper-docs-sync` separately before invoking this skill (keeping the two flows separate avoids conflating the code-diff-driven sync with the docs-target-driven review).

docs/workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Default: top-level `.md` files in `docs/`. Variants:
153153
/hyperclaude:hyper-docs-review README.md # single file
154154
/hyperclaude:hyper-docs-review docs/api/ # specific subdir
155155
/hyperclaude:hyper-docs-review README.md --diff-base main # with code-diff context
156-
/hyperclaude:hyper-docs-review README.md docs/workflow.md # multiple named files (each maps to its own --docs-path)
156+
/hyperclaude:hyper-docs-review README.md docs/workflow.md site/index.html # multiple named files, any type (each maps to its own --docs-path)
157157
```
158158

159159
Writes `.hyperclaude/docs-reviews/<timestamp>-<slug>.md`. Scope is strict: accuracy / drift / completeness / broken links / cross-doc inconsistencies / redundancy (in-doc duplicated claims, reported Minor; deliberate cross-doc propagation exempt). NOT prose or style — the documenter agent owns those.

skills/hyper-docs-loop/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The lead must also retain the following handle-resolution run-state across turns
4242
`$ARGUMENTS` is a **docs target** (optional path tokens; the loop mirrors `hyper-docs-review`'s target grammar). Resolution:
4343

4444
- `$ARGUMENTS` empty → default to `docs/` (directory mode).
45-
- `$ARGUMENTS` is one or more existing `.md` file paths → multi-file mode (each maps to its own `--docs-path`).
45+
- `$ARGUMENTS` is one or more existing file paths (any type) → multi-file mode (each maps to its own `--docs-path`).
4646
- `$ARGUMENTS` is a single existing directory path → directory mode.
4747
- Anything else → ask the user to clarify and STOP.
4848

@@ -54,18 +54,18 @@ See `${CLAUDE_PLUGIN_ROOT}/references/loop-protocol.md` §F2 for the two-file re
5454

5555
### Step 1 — Resolve the docs target
5656

57-
Apply the resolution table above to `$ARGUMENTS`. Verify each path exists via Bash (`[ -e "<path>" ]`). Record `docs_target` as the bridge argv tokens:
57+
Apply the resolution table above to `$ARGUMENTS`. Classify each token via Bash `[ -f "<path>" ]` (existing file → `--docs-path`) vs `[ -d "<path>" ]` (existing directory → `--docs-dir`); a token that is neither → STOP. Record `docs_target` as the bridge argv tokens:
5858

5959
| Argument | `docs_target` argv |
6060
|---|---|
6161
| Empty | `['--docs-dir', 'docs/']` |
62-
| One or more `.md` files that exist | `['--docs-path', '<path1>', '--docs-path', '<path2>', ...]` (one flag per file, in order) |
62+
| One or more existing files (each `[ -f ]`, any type) | `['--docs-path', '<path1>', '--docs-path', '<path2>', ...]` (one flag per file, in order) |
6363
| Single existing directory | `['--docs-dir', '<path>']` |
6464
| Anything else | Ask the user to clarify, STOP. |
6565

6666
`docs_target` is reused **verbatim** on every iteration in Step 5 and Step 7 — never change it mid-run.
6767

68-
**Directory-target note.** Per `docs-review`'s established contract, `--docs-dir <p>` reviews only the top-level `.md` files directly under `<p>` (not recursive). This is intentional. The loop inherits that scope; if the user wants nested docs reviewed, they invoke the loop once per subdirectory or against a single `.md` path.
68+
**Directory-target note.** Per `docs-review`'s established contract, `--docs-dir <p>` reviews only the top-level `.md` files directly under `<p>` (not recursive). This is intentional. The loop inherits that scope; if the user wants nested docs reviewed, they invoke the loop once per subdirectory or against an explicit file path of any type.
6969

7070
### Step 2 — Confirm agent-teams availability
7171

skills/hyper-docs-review/SKILL.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Apply this regex to the trimmed `$ARGUMENTS`:
3131
^((?:(?!--)\S+\s*)*)(?:--diff-base\s+(\S+))?(?:\s*(--resume)(?:\s+(\S+))?)?\s*$
3232
```
3333

34-
- Group 1 = zero or more space-separated leading path tokens (split on whitespace in Step 1); each is either an existing `.md` file or, if it's the sole token, an existing directory; empty defaults to `docs/`. Negative lookahead per-token prevents matching `--diff-base` or `--resume` as a path. Many `.md` files OR one directory — never both.
34+
- Group 1 = zero or more space-separated leading path tokens (split on whitespace in Step 1); each is either an existing file (any type — not just `.md`) or, if it's the sole token, an existing directory; empty defaults to `docs/`. Negative lookahead per-token prevents matching `--diff-base` or `--resume` as a path. Many files OR one directory — never both.
3535
- Group 2 = optional `--diff-base <ref>` value
3636
- Group 3 = literal `"--resume"` token (truthy when present, undefined when not)
3737
- Group 4 = optional resume artifact path
@@ -42,6 +42,7 @@ When Group 3 is `'--resume'` (truthy) and Group 4 is undefined, treat as `--resu
4242
- `/hyperclaude:hyper-docs-review` — reviews `docs/`, fresh run
4343
- `/hyperclaude:hyper-docs-review docs/api.md` — reviews single file, fresh run
4444
- `/hyperclaude:hyper-docs-review README.md docs/workflow.md docs/architecture.md` — reviews three files, fresh run
45+
- `/hyperclaude:hyper-docs-review README.md site/index.html` — mixed file types (`.md` + `.html`), fresh run
4546
- `/hyperclaude:hyper-docs-review --resume` — reviews `docs/`, resumes from latest artifact
4647
- `/hyperclaude:hyper-docs-review --resume <prev-artifact-path>` — resumes from explicit artifact
4748
- `/hyperclaude:hyper-docs-review docs/api.md --diff-base main` — single file with diff context
@@ -58,14 +59,14 @@ See `${CLAUDE_PLUGIN_ROOT}/references/bridge-review-calls.md` for the shared `--
5859

5960
### Step 1 — Resolve target
6061

61-
Split Group 1 on whitespace into tokens (or default to `docs/` when empty). Verify each path exists first via Bash (`[ -e "<path>" ]`).
62+
Split Group 1 on whitespace into tokens (or default to `docs/` when empty). Classify each token via Bash `[ -f "<path>" ]` (existing file → `--docs-path`) vs `[ -d "<path>" ]` (existing directory → `--docs-dir`); a token that is neither → STOP.
6263

6364
| Group 1 tokens | Bridge argv |
6465
|---|---|
6566
| Empty | `['docs-review', '--docs-dir', 'docs/']` |
66-
| One or more `.md` paths that exist | `['docs-review', '--docs-path', '<path1>', '--docs-path', '<path2>', ...]` (one flag per file, in order) |
67+
| One or more existing files (each `[ -f ]`, any type) | `['docs-review', '--docs-path', '<path1>', '--docs-path', '<path2>', ...]` (one flag per file, in order) |
6768
| Single existing directory path | `['docs-review', '--docs-dir', '<path>']` |
68-
| Anything else (mix of files and a dir, non-`.md` path, or a path that doesn't exist) | Tell user the contract, ask to clarify, STOP. |
69+
| Anything else (mix of files and a dir, more than one directory, or a path that doesn't exist) | Tell user the contract, ask to clarify, STOP. |
6970

7071
### Step 2 — Run the bridge
7172

0 commit comments

Comments
 (0)