style-review
Vendored from https://github.com/yzhao062/agent-style/tree/main/skills/style-review
and based on The Elements of Agent Style by Yuxuan Zhao, CC BY 4.0.
Post-hoc review for prose an AI agent has already written. The generation-time rules shipped via CLAUDE.md / AGENTS.md tilt the model; this skill is the opt-in second pass that catches whatever the first pass missed.
Invocation
| Shape |
Behavior |
/style-review FILE |
Audit FILE against all 21 rules. Show per-rule scorecard. Ask the user: "produce a polished draft at FILE.reviewed.md?" On yes, write revised file and print diff. |
/style-review A.md B.md |
A/B compare. Emit per-rule delta. No polish, no ask. Used for benchmarking. |
Mode is inferred from argument count. No flags.
Workflow (single file)
- Deterministic audit. Shell out to
agent-style review --audit-only FILE. Capture the canonical JSON. Mechanical rules (RULE-B, D, G, I, 12, 05, 06) and structural rules (RULE-A, C, E) return concrete violations with line numbers and excerpts.
- Semantic audit. For each rule marked
status: "skipped" with detector semantic (RULE-01, 03, 04, 08, 11, F, H), run a per-rule judgment using the rule's directive plus its BAD/GOOD examples from .agent-style/RULES.md as the judge prompt. Parse the host model's response into the same violation schema.
- Merge. Combine deterministic + semantic rule results into the full scorecard.
- Report. Print the scorecard: per rule, count + first 3 violations. If total is zero, report "no violations" and exit.
- Ask. "Produce a polished draft at FILE.reviewed.md?" Wait for the user's yes/no.
- Polish (on yes). Compose a revision prompt using
references/revision-prompt.md + the violation list + .agent-style/RULES.md. Invoke the host model. Write the output to FILE.reviewed.md. Never touch FILE.
- Verify. Shell out to
agent-style review --audit-only FILE.reviewed.md. Show before → after scorecard.
- Diff. Print
diff FILE FILE.reviewed.md so the user can accept or discard hunks.
Workflow (A/B compare)
- Shell out to
agent-style review --mechanical-only --compare A.md B.md.
- Print the per-rule delta table from the JSON output.
- Exit.
No ask, no polish, no file writes. This is the benchmark / regression-check shape.
Polish invariants (hard)
The revision prompt enforces these in its template (see references/revision-prompt.md):
- No new facts. No metrics, numbers, citations, references, links, code behavior, or claims that are not already in the source. If a claim is flagged as unsupported (RULE-H), leave it flagged — do not invent support.
- Preserve Markdown structure. Code fences, tables, frontmatter, link syntax, heading levels, list nesting, and inline code spans are preserved exactly unless the violation IS the structure.
- Preserve meaning. Revisions only resolve flagged violations. Do not rewrite paragraphs the audit did not flag.
- Write-beside only. Output at
FILE.reviewed.md. Never in-place.
References
references/rule-detectors.md: per-rule detection approach (mechanical regex + structural heuristics + semantic judge prompts).
references/revision-prompt.md: the polish-pass template with hard invariants above.
Self-verification
When asked "is style-review active?", reply on one line using this exact format:
style-review active: audit 21 rules (deterministic: RULE-B, D, G, I, 12, 05, 06, A, C, E; semantic via host: RULE-01, 03, 04, 08, 11, F, H); workflow at skills/style-review/SKILL.md.
1---2name: style-review3description: Review Markdown prose against agent-style's 21 rules. `/style-review FILE` audits the file and (on user confirm) writes a polished copy at `FILE.reviewed.md`. `/style-review A.md B.md` A/B-compares two drafts and emits a per-rule delta table. Complements the generation-time rules installed via `agent-style enable <tool>`.4license: CC-BY-4.05---67# style-review89Vendored from `https://github.com/yzhao062/agent-style/tree/main/skills/style-review`10and based on *The Elements of Agent Style* by Yuxuan Zhao, CC BY 4.0.1112Post-hoc review for prose an AI agent has already written. The generation-time rules shipped via `CLAUDE.md` / `AGENTS.md` tilt the model; this skill is the **opt-in second pass** that catches whatever the first pass missed.1314## Invocation1516| Shape | Behavior |17| --- | --- |18| `/style-review FILE` | Audit FILE against all 21 rules. Show per-rule scorecard. Ask the user: "produce a polished draft at FILE.reviewed.md?" On yes, write revised file and print diff. |19| `/style-review A.md B.md` | A/B compare. Emit per-rule delta. No polish, no ask. Used for benchmarking. |2021Mode is inferred from argument count. No flags.2223## Workflow (single file)24251. **Deterministic audit.** Shell out to `agent-style review --audit-only FILE`. Capture the canonical JSON. Mechanical rules (RULE-B, D, G, I, 12, 05, 06) and structural rules (RULE-A, C, E) return concrete violations with line numbers and excerpts.262. **Semantic audit.** For each rule marked `status: "skipped"` with detector `semantic` (RULE-01, 03, 04, 08, 11, F, H), run a per-rule judgment using the rule's directive plus its BAD/GOOD examples from `.agent-style/RULES.md` as the judge prompt. Parse the host model's response into the same violation schema.273. **Merge.** Combine deterministic + semantic rule results into the full scorecard.284. **Report.** Print the scorecard: per rule, count + first 3 violations. If total is zero, report "no violations" and exit.295. **Ask.** "Produce a polished draft at FILE.reviewed.md?" Wait for the user's yes/no.306. **Polish (on yes).** Compose a revision prompt using `references/revision-prompt.md` + the violation list + `.agent-style/RULES.md`. Invoke the host model. Write the output to `FILE.reviewed.md`. Never touch `FILE`.317. **Verify.** Shell out to `agent-style review --audit-only FILE.reviewed.md`. Show before → after scorecard.328. **Diff.** Print `diff FILE FILE.reviewed.md` so the user can accept or discard hunks.3334## Workflow (A/B compare)35361. Shell out to `agent-style review --mechanical-only --compare A.md B.md`.372. Print the per-rule delta table from the JSON output.383. Exit.3940No ask, no polish, no file writes. This is the benchmark / regression-check shape.4142## Polish invariants (hard)4344The revision prompt enforces these in its template (see `references/revision-prompt.md`):4546- **No new facts.** No metrics, numbers, citations, references, links, code behavior, or claims that are not already in the source. If a claim is flagged as unsupported (RULE-H), leave it flagged — do not invent support.47- **Preserve Markdown structure.** Code fences, tables, frontmatter, link syntax, heading levels, list nesting, and inline code spans are preserved exactly unless the violation IS the structure.48- **Preserve meaning.** Revisions only resolve flagged violations. Do not rewrite paragraphs the audit did not flag.49- **Write-beside only.** Output at `FILE.reviewed.md`. Never in-place.5051## References5253- [`references/rule-detectors.md`](references/rule-detectors.md): per-rule detection approach (mechanical regex + structural heuristics + semantic judge prompts).54- [`references/revision-prompt.md`](references/revision-prompt.md): the polish-pass template with hard invariants above.5556## Self-verification5758When asked "is style-review active?", reply on one line using this exact format:5960`style-review active: audit 21 rules (deterministic: RULE-B, D, G, I, 12, 05, 06, A, C, E; semantic via host: RULE-01, 03, 04, 08, 11, F, H); workflow at skills/style-review/SKILL.md.`