Skip to content

Commit a4915d4

Browse files
kyle-sextonclaude
andauthored
docs: promote stranded conventions to path-scoped rules and nested AGENTS.md (#3388)
No linked issue ## Summary Applies the accepted findings of a full-repo `/instruction-placement:audit` run (1,195 files swept, eight adjudication lanes, independent fresh-context verification). The repo's always-loaded instruction layer was nearly empty while several genuinely normative contributor conventions lived only in docs Claude never loads; this PR makes each reachable at its actual trigger point, as pointers so the human-facing docs stay the single source of truth. ## Fix One commit per accepted finding, in ranked order: - IP-001 (`effa775a`): root `AGENTS.md` gains a four-line pointer to README's "Validate a change" contract (zero suites is an error, never "nothing to run"). - IP-002 (`173869be`): `.claude/rules/catalog-taxonomy.md`, scoped to `.claude-plugin/marketplace.json` (1 tracked file), pointing at `docs/CATALOG-TAXONOMY.md`. - IP-003 (`3e78bcc4`): `.claude/rules/hook-budget.md`, scoped to `plugins/*/hooks/**` (146 files), pointing at the hook-budget convention's Rules section. - IP-004 (`b056a6ef`): `.claude/rules/ruff-pin.md`, scoped to `**/*.py` (100 files), pointing at the pinned-ruff wrapper contract in `docs/CI-RUNNER-ROUTING.md`. - IP-005..007 (`730f24e7`, `fa1a3856`, `1c6c37e1`): nested `AGENTS.md` plus mandatory `CLAUDE.md` shim at `plugins/machine-health/skills/audit/`, pointing at the human-only README's layout, dual-invocation, and stateless-checks conventions. The generated on-demand rules index in root `AGENTS.md` is regenerated with each move so every deferred surface stays reachable from subagents. ## Verification - Every `paths:` glob machine-validated (match counts above; no zero-match, no bad brackets, within budget). - Empirical load probes via the plugin's `verify-load.sh` (real CLI with an `InstructionsLoaded` hook): the catalog-taxonomy rule fires on read of `marketplace.json`, and the nested machine-health pair loads via shim traversal; both VERDICT PASS. - `render-index.sh check` reports IN-SYNC at every commit. - `scripts/affected-tests.sh --explain`: all six changed files are recorded no-suite classes (prose), zero suites owed. - `markdownlint-cli2` clean over all changed files. ## Related Findings artifact (statuses per finding, held-back Gate 0 items, routed-out questions) lives under the instruction-placement plugin's data directory, keyed to this project; not committed by design. N/A for tracker links. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01THL7Bu9RBnbob7xMeiXTBU --- _Generated by [Claude Code](https://claude.ai/code/session_01THL7Bu9RBnbob7xMeiXTBU)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent c70d886 commit a4915d4

8 files changed

Lines changed: 104 additions & 1 deletion

File tree

.claude/rules/catalog-taxonomy.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: "Where the marketplace category taxonomy lives; read before adding or changing a plugin's category"
3+
paths:
4+
- ".claude-plugin/marketplace.json"
5+
---
6+
7+
# Catalog category taxonomy
8+
9+
The category vocabulary for `.claude-plugin/marketplace.json` is maintained in
10+
[`docs/CATALOG-TAXONOMY.md`](../../docs/CATALOG-TAXONOMY.md). Read its Form rule, Assignment
11+
principle, and Singleton governance sections before assigning, renaming, or merging any plugin
12+
category; do not invent a category value from the existing entries alone.

.claude/rules/hook-budget.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
description: "Marketplace-wide latency budget for always-on hooks; read before adding or widening a hook"
3+
paths:
4+
- "plugins/*/hooks/**"
5+
---
6+
7+
# Hook budget
8+
9+
This marketplace holds a fixed latency budget for always-on hooks, defined in
10+
[`docs/conventions/hook-budget/README.md`](../../docs/conventions/hook-budget/README.md). Read its
11+
Rules section before adding a hook or widening an existing one's matcher: the change must state
12+
its measured share of the budget in the plugin's README, and the budget never relaxes to absorb
13+
an overage.

.claude/rules/ruff-pin.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
description: "Python linting runs through the pinned ruff wrapper, never a bare ruff on PATH"
3+
paths:
4+
- "**/*.py"
5+
---
6+
7+
# Ruff pin
8+
9+
Lint Python in this repo through `scripts/run-ruff.sh check <paths>` (the wrapper passes any
10+
ruff arguments through and resolves the CI-pinned ruff version); a bare `ruff` on PATH can
11+
disagree with CI in both directions, so never use it for verification here. Do not adopt a newer ruff's new rules in an
12+
unrelated change; bumping the pin is a deliberate Dependabot change. Full rationale:
13+
[`docs/CI-RUNNER-ROUTING.md`, "Local / workstation ruff"](../../docs/CI-RUNNER-ROUTING.md#local--workstation-ruff).

AGENTS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# claude-code-plugins
2+
3+
## Validate a change
4+
5+
Validate with `scripts/affected-tests.sh --run` (add `--explain` to see why each suite was
6+
selected) instead of running every suite; CI still runs everything. A changed file that maps
7+
to zero suites is an error, never "nothing to run". Full contract, including the no-suite
8+
allowlist and the `NOT RUN` ecosystems: [README.md, "Validate a change"](README.md#validate-a-change).
9+
10+
<!-- BEGIN GENERATED: instruction-placement rules index -->
11+
12+
## Conventions that load on demand
13+
14+
Each surface below enters context automatically when Claude reads a file it covers. That trigger
15+
does **not** fire inside subagents, and after a compaction it fires again only when a covered file
16+
is read again. When you are working on something an entry covers and its content is not already in
17+
context, read the file directly.
18+
19+
| Surface | Covers | Topic |
20+
|---|---|---|
21+
| `.claude/rules/catalog-taxonomy.md` | `.claude-plugin/marketplace.json` | Where the marketplace category taxonomy lives; read before adding or changing a plugin's category |
22+
| `.claude/rules/hook-budget.md` | `plugins/*/hooks/**` | Marketplace-wide latency budget for always-on hooks; read before adding or widening a hook |
23+
| `.claude/rules/ruff-pin.md` | `**/*.py` | Python linting runs through the pinned ruff wrapper, never a bare ruff on PATH |
24+
| `plugins/machine-health/skills/audit/AGENTS.md` | `plugins/machine-health/skills/audit/**` | machine-health audit skill: contributor conventions |
25+
26+
<!-- END GENERATED: instruction-placement rules index -->

plugins/machine-health/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
33
"name": "machine-health",
4-
"version": "0.11.7",
4+
"version": "0.11.8",
55
"description": "Workstation health audit: OS-specific checks (disk, OS updates, security posture, CISA KEV correlation) run from a versioned catalog with trend-aware severity, approval-gated remediations, and dated markdown reports. Windows fully implemented; macOS/Linux scaffolded (report UNKNOWN and stop). Machine state persists in the plugin data directory; the report directory and check catalog are configurable.",
66
"author": {
77
"name": "Melodic Software",

plugins/machine-health/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
All notable changes to the `machine-health` plugin are documented here. Format follows
44
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this plugin uses semantic versioning.
55

6+
## [0.11.8]
7+
8+
### Added
9+
10+
- **The audit skill's directory carries a nested `AGENTS.md` with its `CLAUDE.md` shim.** Three
11+
contributor conventions from the human-only skill README (semantics-vs-implementation layout,
12+
dual-invocation script contract, stateless-checks invariant) now load for Claude on any read
13+
under `skills/audit/`, as pointers back to the README rather than copies. Applied from an
14+
instruction-placement audit (findings IP-005 through IP-007); the README remains the single
15+
source of truth.
16+
617
## [0.11.7]
718

819
### Changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# machine-health audit skill: contributor conventions
2+
3+
Maintainer conventions for this skill live in [`README.md`](README.md); the sections below say
4+
when to read each one.
5+
6+
## Layout: semantics vs implementation
7+
8+
Before adding or moving anything under `references/` or `scripts/`, read
9+
[README.md, "Separation of semantics from implementation"](README.md#separation-of-semantics-from-implementation):
10+
OS-agnostic content belongs in `references/shared/`, per-OS detection in `references/<os>/`,
11+
and adding a new OS must be "populate two folders", never a refactor of the skill.
12+
13+
## Check scripts run two ways
14+
15+
Before writing or editing a check script, read
16+
[README.md, "Dual-invocation scripts"](README.md#dual-invocation-scripts): every check emits a
17+
single JSON object on stdout for Claude (schema in `references/shared/output-schema.md`) and
18+
takes `-Human` for readable output, using `Write-Host` in that mode so structured emitters keep
19+
working over pipelines.
20+
21+
## Checks are stateless; the orchestrator owns state
22+
23+
Before touching a check's inputs or anything involving `state/history.jsonl`, read
24+
[README.md, "Stateless checks, stateful orchestrator"](README.md#stateless-checks-stateful-orchestrator):
25+
checks take a current reading and return it, never reading `history.jsonl` directly; the
26+
orchestrator (`Invoke-MachineHealthCheck.ps1`) hands them a history slice over stdin and owns all
27+
trend, severity, timeout, remediation, and reporting logic.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

0 commit comments

Comments
 (0)