Skip to content

feat(docs-hygiene): write-for-agents — authoring-time skill for agent-consumed markdown - #3003

Merged
kyle-sexton merged 5 commits into
mainfrom
claude/pocock-steering-course-00zkvd
Aug 18, 2026
Merged

feat(docs-hygiene): write-for-agents — authoring-time skill for agent-consumed markdown#3003
kyle-sexton merged 5 commits into
mainfrom
claude/pocock-steering-course-00zkvd

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

Closes #2962

Summary

Adds docs-hygiene:write-for-agents — the write-side complement to the plugin's seven audit/transform skills: authoring-time doctrine that fires while agent-consumed markdown is being written, closing the writing-for-agents re-evaluation's gaps 1–2 (no authoring-time home for non-skill agent docs; completion-criteria doctrine homeless) plus the two-loads budget. docs-hygiene 0.16.1 → 0.17.0.

Fix

  • New skill plugins/docs-hygiene/skills/write-for-agents/ (model-invoked): inlines the adapted doctrine — budget both loads (context + cognitive), branch-covering front-loaded pointers, steps-vs-reference separation with co-location, observable completion criteria (premature-completion / post-completion / legwork guards), split-by-sequence, positive-form prompting — and points at audit-progressive-disclosure's tier model, the invocation-mode rubric (§ Splitting by invocation, per the lane 8 coordination note), claude-memory:audit's navigation-pointer remediation (per the lane 9 coordination note), and curate-language instead of restating any of them. Route-away fence keeps SKILL.md authoring, audit requests, and human-facing docs with their incumbent owners.
  • reference/agent-doc-surfaces.md: shipped adaptation of the docs-verified auto-read surface enumeration (Claude Code v2.1.233 baseline, re-verify note) plus other-ecosystem analogues.
  • evals/: 9-case suite gating trigger reliability — 5 positive writing-moment cases, 3 negative route-away controls, 1 doctrine-behavior case over a planted-flaw fixture.
  • docs/PLUGIN-PHILOSOPHY.md: one-line cognitive-load cross-reference in Instruction economy.
  • docs/upstream/mattpocock-skills.md: decomposition-table gap-1/2 verdicts flipped to ADOPTED; leading-words tracked strand retired (both per the Brief's on-merge criteria).

Verification

  • markdownlint-cli2 over all touched markdown: 0 issues in 7 files.
  • jq empty on plugin.json and evals.json: both parse.
  • scripts/check-changelog-parity.sh --check and --check-bump origin/main: both exit 0 (0.17.0 entry present and matching).
  • Description length is well inside the 1,536-char listing cap; the eval suite is the standing regression gate for the trigger families (CI's plugin-gate/skill-quality lanes run their checks on this PR).

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01QbfCrj3X9FfGL7VRZYmrn4


Generated by Claude Code

…-consumed markdown

The write-side complement to the audit siblings, per the lane 7 design
contract (docs/specs/write-for-agents-brief.md): model-invoked at the
writing moment for CLAUDE.md/AGENTS.md content, rules files, agent-loaded
reference docs, pointer lines, and doc-plus-pointer extractions. Inlines
the adapted doctrine (two loads, branch-covering pointers, steps vs
reference with co-location, observable completion criteria,
split-by-sequence, positive-form prompting) and points at the audit
siblings, the invocation-mode rubric, claude-memory's pointer
remediation, and curate-language instead of restating them. Ships the
docs-verified surface reference and a 9-case trigger/behavior eval
suite. PLUGIN-PHILOSOPHY gains the cognitive-load cross-reference; the
SSOT decomposition flips gaps 1-2 to ADOPTED and retires the
leading-words tracked strand. docs-hygiene 0.17.0. Closes #2962.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbfCrj3X9FfGL7VRZYmrn4
@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 3m 26s —— View job


Claude finished the code review

Todo list

  • Gather context (PR diff, changed files)
  • Understand the request (invoke /review:code-review)
  • Run code-review skill/process over the PR diff
  • Post inline comments for findings anchored to changed lines
  • Post final summary review

Summary

Reviewed all 9 changed files (git diff origin/main...HEAD) against the /review:code-review criteria (correctness, CLAUDE.md/AGENTS.md alignment, high-signal bar). This is doc-only content (new skill, reference table, evals, changelog/README/plugin.json bumps), so the review focused on factual/cross-reference accuracy of the claims the new skill makes about itself and sibling plugins, rather than code logic.

1 finding, posted inline:

  • plugins/docs-hygiene/skills/write-for-agents/SKILL.md:46 — claims claude-memory:audit owns "navigation-pointer remediation guidance" / "the restructure-before-pointer call." I checked plugins/claude-memory/skills/audit/ in full (all of reference/criteria.md's checks C1–C9/R1–R4/RD1/M1–M4, plus every context/*.md and SKILL.md) and the string "pointer" does not appear anywhere in that skill — no check addresses restructuring vs. pointing across distant folders. An agent following this pointer will find nothing there.

Verified as correct (no findings):

  • Cross-references that do resolve: ../audit-progressive-disclosure/context/tier-model.md, docs/conventions/invocation-mode/README.md § Splitting by invocation, docs/specs/write-for-agents-brief.md.
  • domain-driven-design:curate-language and the "(if installed)" cross-plugin attribution pattern — both plugins exist in-repo and the phrasing matches existing repo convention (planning:design, architecture:improve use the same pattern).
  • The absolute GitHub-blob link to docs/conventions/invocation-mode/README.md (rather than a relative path) matches existing convention for plugin skills linking outside their own plugin root (claude-config:audit, claude-memory:audit, discipline:sweep-all all do the same, since a plugin installed standalone wouldn't carry the monorepo's docs/ tree).
  • reference/agent-doc-surfaces.md's claims about CLAUDE.md/rules/skills compaction and re-injection behavior are consistent with the existing, independently-sourced compaction table in plugins/claude-memory/skills/audit/reference/official-guidance.md.
  • plugin.json and evals.json parse (jq empty); plugin.json version bump (0.16.1 → 0.17.0) matches the new CHANGELOG.md entry; the eval-suite composition (5 positive / 3 negative / 1 behavior = 9 cases) matches the PR description's claim, and the draft-rule.md fixture actually contains the two prohibitions, blind pointer, and premature-completion step ("Done when it works") that eval case 9 expects it to.
  • docs/upstream/mattpocock-skills.md table edits are internally consistent (gap 1/2 rows flip to ADOPTED, the leading-words tracked strand is marked RETIRED, and skill-quality: add completion-criteria check criterion + pointer to write-for-agents doctrine #2963 is correctly still called out as the one open follow-on for the audit-side completion-criteria half).

Everything else — markdownlint, check-changelog-parity.sh, the description-length cap — is the PR author's claimed verification; I did not have markdownlint-cli2/gh available in this environment to independently re-run those, so I'm not counting them as confirmed either way.
· branch

@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 41s —— View job


Security review — PR #3003

Skip gate: stop early — the full diff (git diff origin/main...HEAD) touches only markdown/doc content, a plugin manifest version bump, a changelog, and a new skill's SKILL.md + evals/*.json + reference/*.md files. No code, no GitHub Actions workflow changes, no auth/authz logic, no injection surfaces (command/SQL/path/template), no secret/token/credential handling, and no permission or dependency-pin changes. There is no security-relevant surface in this change.

  • Gather context (PR diff, custom instructions)
  • Invoke /review:security-review skill and follow its instructions
  • Post findings / summary

No security issues found. This PR is a documentation-only addition (a new authoring-time skill plus its supporting reference/eval fixtures) with no security-relevant surface — skip gate condition 2 applies.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

Last security-reviewed head: 71e44ca95c61812263aff69d0d5abeec7d84dec0. On the next push, the relevance gate compares only the commits since this SHA; delete this comment to force a full re-review.

Comment thread plugins/docs-hygiene/skills/write-for-agents/SKILL.md Outdated
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

Claude has reviewed this PR 5 times. The lane skips further automatic reviews after 5; deleting this comment resets the count.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07341a266c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/docs-hygiene/skills/write-for-agents/SKILL.md Outdated
Comment thread plugins/docs-hygiene/skills/write-for-agents/SKILL.md Outdated
…ts, contract-clean links, add-dir row

Addresses the automated review findings on #3003: the
restructure-before-pointer caveat is stated inline (its claude-memory
home is #2987's unbuilt deliverable — a pointer to nothing, caught by
review; #2987 may convert this to a pointer when it lands); the sibling
tier-model link is replaced with the slash-only public-surface form per
the encapsulation contract; operative handoffs use the explicit
Skill-tool invocation phrasing the invocation-mode convention binds new
skill text to; the reference table regains the conditional --add-dir
load row dropped in trimming.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbfCrj3X9FfGL7VRZYmrn4

Copy link
Copy Markdown
Contributor Author

Review round addressed in 71e44ca9 — all four findings verified against the tree before fixing, all valid:

markdownlint clean after the round.


Generated by Claude Code

@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 16s —— View job


Code review — /review:code-review

  • Gather context (PR diff, changed files)
  • Invoke /review:code-review and follow its instructions
  • Post inline findings anchored to changed lines
  • Post final summary review

Summary

Skip-gate checks: PR is open, not a draft, and while HEAD (71e44ca) has an existing successful review on this lane, that review targeted the prior commit (07341a2) and this new commit (71e44ca) specifically addresses that review's findings plus two P2s from chatgpt-codex-connector — so it doesn't fully "still apply" and a fresh pass over the delta is warranted.

Re-verified the four prior findings against 71e44ca — all four are correctly fixed:

  1. The claude-memory:audit "navigation-pointer remediation" attribution (my prior finding) is gone; SKILL.md:45-48 now states the restructure-before-pointer caveat inline instead of citing an unimplemented sibling capability.
  2. The sibling-private-context link into ../audit-progressive-disclosure/context/tier-model.md (Codex P2) is replaced with SKILL.md:50-52's slash-invocation form (invoke /docs-hygiene:audit-progressive-disclosure via the Skill tool) — contract-clean per audit-encapsulation/context/public-surface-contract.md.
  3. The bare "Route to X" handoffs (Codex P2) are now explicit Invoke ... via the Skill tool phrasing throughout the "After writing" section, matching docs/conventions/invocation-mode/README.md's Cross-skill invocation phrasing convention.
  4. The dropped --add-dir load row (Codex P2) is restored at reference/agent-doc-surfaces.md:24, matching docs/specs/agent-doc-surfaces.md:22's source enumeration.

I also confirmed the invocation-reach invariant holds for every skill write-for-agents now chains to via the Skill tool (docs-hygiene:audit-progressive-disclosure, extract-ssot, audit-noise, audit-derivability, domain-driven-design:curate-language) — all five carry disable-model-invocation: false, so none is an invalid chain target.

1 new finding, posted inline (introduced by the fix commit, not present before):

  • plugins/docs-hygiene/CHANGELOG.md:15 — the 0.17.0 entry still claims the skill "points at ... claude-memory:audit's navigation-pointer remediation," but that's exactly the pointer the fix commit removed from SKILL.md (because the target doesn't exist). The changelog now documents a cross-reference the shipped skill no longer makes.

Also checked, no issues:

  • docs/upstream/mattpocock-skills.md table edits are internally consistent with the fix (still correctly attributes gap-1/2 doctrine to write-for-agents, doesn't reference claude-memory:audit).
  • evals/evals.json and evals/fixtures/draft-rule.md are untouched by the fix commit and remain consistent with the current SKILL.md doctrine.
  • plugin.json version bump (0.16.1 → 0.17.0) and description update are consistent with CHANGELOG.md's version header; README.md's new skill row is accurate.

Per this lane's rules, I did not independently re-run markdownlint-cli2 or check-changelog-parity.sh (no tool access in this environment) — treating those as author-claimed and unverified, not confirmed.
· branch

@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 50s —— View job


Security review — PR #3003

Skip gate: stop early — this run reviews only the commits since the last security-reviewed head (07341a266c571e44ca95c6, per the bot's relevance-gate comment). That diff touches exactly two files, both markdown, both doc-text edits addressing the prior review round's findings:

  • plugins/docs-hygiene/skills/write-for-agents/SKILL.md — replaces the inaccurate claude-memory:audit pointer-remediation attribution with inline doctrine text, and switches three "Route to <skill>" phrasings to explicit "Invoke /plugin:skill via the Skill tool" invocation-mode language.
  • plugins/docs-hygiene/skills/write-for-agents/reference/agent-doc-surfaces.md — adds one table row documenting the conditional --add-dir CLAUDE.md/rules load path (gated on CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1).

No code, no GitHub Actions workflow changes, no auth/authz logic, no injection surfaces (command/SQL/path/template), no secret/token/credential handling, and no permission or dependency-pin changes. There is no security-relevant surface in this change — skip gate condition 2 applies.

  • Gather context (diff since last-reviewed SHA, custom instructions)
  • Invoke /review:security-review skill and follow its instructions
  • Post findings / summary

No security issues found.
· branch

Comment thread plugins/docs-hygiene/CHANGELOG.md Outdated
…l body

The entry still described the removed claude-memory:audit pointer; it now
matches the shipped skill (caveat stated inline pending #2987).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbfCrj3X9FfGL7VRZYmrn4
@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 52s —— View job


Code review — /review:code-review

  • Gather context (PR diff, changed files, prior review rounds)
  • Invoke /review:code-review and follow its instructions
  • Verify the new commit (30e233d) against the prior finding it addresses
  • Post inline findings anchored to changed lines
  • Post final summary review

Summary

This lane's last pass (on 71e44ca) found one new issue: CHANGELOG.md's 0.17.0 entry still credited claude-memory:audit with "navigation-pointer remediation," even though the same commit had just removed that (nonexistent) pointer from SKILL.md. Commit 30e233d — the only change since — fixes exactly that.

Re-verified the fix against the tree at 30e233d:

No new findings. This commit only edits plugins/docs-hygiene/CHANGELOG.md (+3/-2 lines), and the edit is a straightforward doc-accuracy correction with no other observable effect.
· branch

plugin-gate caught the stale generated catalog block after the
write-for-agents manifest description change; regenerated via
scripts/generate-catalog.mjs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbfCrj3X9FfGL7VRZYmrn4
@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 29s —— View job


Code review — /review:code-review

  • Gather context (PR diff, prior review rounds, latest commit)
  • Invoke /review:code-review and follow its instructions
  • Verify latest commit (19b1dd2) since last-reviewed head (30e233d)
  • Post inline findings anchored to changed lines
  • Post final summary review

Summary

The only change since the last reviewed commit (30e233d) is 19b1dd2, which touches a single file: docs/CATALOG.md (+1/-1) — regenerating the docs-hygiene entry's description line to include write-for-agents.

Verified: the new CATALOG.md line is byte-for-byte consistent with plugins/docs-hygiene/.claude-plugin/plugin.json's description field (confirmed via jq -r .description), so this is a correct, mechanical regeneration with no drift.

I also re-walked the full PR diff (git diff origin/main...HEAD, all 10 files) end to end rather than trusting the prior rounds' conclusions blindly:

  • SKILL.md — re-read in full. All three prior finding classes are fixed and stayed fixed: no claude-memory:audit reference anywhere in the file; the pointer-quality cross-reference at lines 50-52 uses the slash-invocation form (/docs-hygiene:audit-progressive-disclosure via the Skill tool) rather than a private sibling context/ path; all "After writing" handoffs (lines 98-103) use explicit "Invoke /plugin:skill via the Skill tool" phrasing.
  • reference/agent-doc-surfaces.md — the --add-dir conditional-load row (line 24) is present and matches the source enumeration's semantics.
  • CHANGELOG.md — the 0.17.0 entry's "points at the audit siblings, the invocation-mode rubric, and curate-language... restructure-before-pointer caveat is stated inline pending its audit-side home (claude-memory: patch audit criteria for navigation pointers — C5 carve-out, C7 stale-highway note, C3 nested CLAUDE.md + @-mention rows, design-smell remediation #2987)" phrasing matches what SKILL.md actually does — no more claiming a claude-memory:audit capability that doesn't exist.
  • docs/upstream/mattpocock-skills.md, docs/PLUGIN-PHILOSOPHY.md, plugins/docs-hygiene/README.md — table/prose edits are internally consistent with each other and with the shipped skill (gap-1/2 rows ADOPTED, leading-words strand RETIRED, README's new skill row and axis list match, PLUGIN-PHILOSOPHY's cognitive-load cross-reference points at the right skill).
  • evals/evals.json — 9 cases (5 positive / 3 negative / 1 behavior) match the PR's claimed composition; case 9's expectations line up with evals/fixtures/draft-rule.md's actual content (two prohibitions, a blind pointer, and a "Done when it works" premature-completion step).
  • plugin.json and evals.json both parse (jq empty); version bump (0.16.1 → 0.17.0) matches CHANGELOG.md's header.

No new findings. All findings from earlier review rounds on this PR (the claude-memory:audit misattribution, the two Codex P2s on sibling-private linking and bare "Route to" phrasing, the missing --add-dir row, and the stale changelog clause) were fixed in 71e44ca/30e233d and remain fixed in the current head (19b1dd2). This round's only change (CATALOG.md) is a correct, verified regeneration with nothing to flag.

Per this lane's constraints, I did not have markdownlint-cli2 available to independently re-run in this environment (attempted npx markdownlint-cli2; sandboxed out) — treating markdownlint-clean as author-claimed, consistent with prior rounds.
· branch

Second generated surface behind plugin-gate; the third
(identity-prerequisites) verified in sync, and validate-plugins.sh now
passes locally end to end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbfCrj3X9FfGL7VRZYmrn4
@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 44s —— View job


Code review — /review:code-review

  • Gather context (PR diff, prior review rounds, latest commit)
  • Invoke /review:code-review and follow its instructions
  • Verify latest commit (e0d767f) since last-reviewed head (19b1dd2)
  • Post inline findings anchored to changed lines
  • Post final summary review

Summary

The only change since the last reviewed commit (19b1dd2) is e0d767f, which touches a single file: docs/SKILL-CHEAT-SHEET.md (+1/-0) — adding the write-for-agents row to the "Anytime / cross-cutting" table.

Verified: the new row is correct and consistent —

  • docs/SKILL-CHEAT-SHEET.md:187 — link path ../plugins/docs-hygiene/skills/write-for-agents/SKILL.md resolves correctly, and the summary text "Authoring-time doctrine for agent-consumed markdown" is a byte-for-byte match of SKILL.md's own metadata.summary frontmatter field (SKILL.md:6).
  • Row placement is alphabetically correct (write-for-agents sorts after rename-references among docs-hygiene: entries) and the "Anytime / cross-cutting" section is the right home for an authoring-time (not audit-triggered) skill.

I also re-walked the full PR diff (git diff origin/main...HEAD, all 11 files) to confirm nothing regressed:

  • No claude-memory reference anywhere in SKILL.md or CHANGELOG.md (the misattributed pointer stays removed).
  • No bare Route to phrasing remains in SKILL.md (the Skill-tool invocation phrasing from the earlier fix round is intact).
  • The --add-dir conditional-load row is present in reference/agent-doc-surfaces.md:24.
  • File count/diff shape (11 files, +331/-17) matches the PR's reported stats exactly.

No new findings. All findings from earlier review rounds on this PR (the claude-memory:audit misattribution, the two Codex P2s on sibling-private linking and bare "Route to" phrasing, the missing --add-dir row, and the stale changelog clause) were fixed in 71e44ca/30e233d and remain fixed in the current head (e0d767f). This round's only change (SKILL-CHEAT-SHEET.md) is a correct, verified mechanical regeneration with nothing to flag.

Per this lane's constraints, I did not have markdownlint-cli2 available to independently re-run in this environment — treating markdownlint-clean as author-claimed, consistent with prior rounds.
· branch

@kyle-sexton
kyle-sexton merged commit 96a9775 into main Aug 18, 2026
48 checks passed
@kyle-sexton
kyle-sexton deleted the claude/pocock-steering-course-00zkvd branch August 18, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs-hygiene: implement write-for-agents — authoring-time skill for agent-consumed markdown

2 participants