Skip to content

docs(agents): slim AGENTS.md to non-derivable context; move guidance into tooling - #598

Merged
goosewobbler merged 5 commits into
mainfrom
docs/comment-refs-as-links
Jul 21, 2026
Merged

goosewobbler merged 5 commits into
mainfrom
docs/comment-refs-as-links

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Jul 20, 2026 •

Copy link
Copy Markdown
Owner

Reworks AGENTS.md around the principle that comprehensive / auto-generated context files hurt agent performance — a global instruction is spent on every request even when irrelevant. Keep only what an agent can't derive by exploring; move everything deterministic into tooling that fires exactly when relevant.

AGENTS.md: 103 → 16 lines

Kept only the non-derivable core: the six release architecture invariants, one orientation line (standing-PR / release/next), and a pointer to docs/adr/. Cut tech-stack, monorepo tree, verification gate, coding-standards prose, testing locations, doc tables, and the "read the tree" boilerplate — all derivable or now tooling-enforced.

Guidance moved into deterministic tooling

Test-title convention → eslint. "every it/test title starts with should" is now vitest/valid-title (mustMatch: ^should) in eslint.config.js (+ fixed the one straggler).

"Never hand-edit generated files" → banner + CI check. Each generated file now has both layers, so the AGENTS.md prose is redundant and removed:

  • releasekit.schema.json gains a $comment banner (it lacked one — the config docs already had theirs), self-documenting on open.
  • docs/configuration.md gains a CI check (docs:check, mirroring schema:check), so a hand-edit fails the build — it previously had only a banner, no enforcement.

Discovery (banner) catches it in-context; the CI check is the deterministic backstop that fires regardless of whether any agent read anything.

Relationship to #573

Supersedes the comment-ref codification that was on this branch (we're removing prose, not adding it). Remaining #573 work (bare-#NNN cleanup + a custom comment-ref lint rule) and the other replacements (pre-push hook, commitlint) are follow-ups.

Validation

  • eslint + biome clean; the schema-generator test passes; schema:check and docs:check both green.
  • Negative test: a hand-edit to docs/configuration.md now fails docs:check.

🤖 Generated with Claude Code

Greptile Summary

This PR moves repository guidance into focused lint and CI enforcement. The main changes are:

  • Slimmed AGENTS.md to release architecture invariants.
  • Enforced test titles and comment references through ESLint.
  • Added a CI freshness check for generated configuration docs.
  • Added generated-file notices to the schema and configuration docs.
  • Regenerated the example smoke workflow from its templates.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues were found in the updated code.

Important Files Changed

Filename Overview
AGENTS.md Keeps the non-derivable release invariants and removes guidance now enforced or discoverable elsewhere.
eslint.config.js Adds lint rules for test-title conventions and bare issue references in source comments.
scripts/generate-config-docs.ts Adds check-mode support for detecting stale generated configuration documentation.
.github/workflows/ci.yml Runs the generated configuration-document check in CI.
.github/workflows/examples-smoke.yml Synchronizes generated smoke-test setup steps with the source example workflows.

Reviews (6): Last reviewed commit: "chore(ci): regenerate examples-smoke.yml..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Standing release PR: #595 · v0.41.2 queued (4 packages) · open 4h 52m · ✅ ready to merge

Release Preview — v0.41.1 → v0.41.2

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

These changes will be added to the release PR (#595) when merged:

Changelog

monorepo 0.41.1 → 0.41.2

Changed

  • regenerate examples-smoke.yml to match the example templates (ci)
  • sweep bare issue refs from source comments; enforce in eslint (PR #600)
  • enforce comment + test-title issue-ref conventions in eslint (lint) (PR #599)
  • make generated files self-guarding; drop the AGENTS.md prose (config)
  • slim AGENTS.md to non-derivable context; move test-title rule to eslint (agents)

Fixed

  • recover the release tags output from git when stdout can't be parsed (action) (PR #597)
  • retry action-dist network ops and auto-heal failed releases (ci) (PR #596)

All packages → 0.41.2 (sync versioning)

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release

After merge — predicted release

No version escalation — this PR's changes will be included in the queued release without affecting the projected versions.

Package Standing PR This PR After merge
monorepo 0.41.2 0.41.2 0.41.2

Updated automatically by ReleaseKit

@goosewobbler
goosewobbler force-pushed the docs/comment-refs-as-links branch from 042f87f to b8b6781 Compare July 20, 2026 22:45
@goosewobbler goosewobbler changed the title docs(agents): require kept issue refs in comments to be links, not bare numbers docs(agents): slim AGENTS.md to non-derivable context; test-title rule → eslint Jul 20, 2026
…e rule to eslint

Rework AGENTS.md around "keep only what an agent can't derive by exploring"
(auto-generated / comprehensive context files hurt agent performance):
- Cut tech-stack, monorepo tree, verification-gate, coding-standards, testing,
  and doc-table sections — all derivable from the tree / package.json / configs,
  or already enforced by tooling.
- Keep the load-bearing release invariants, the never-hand-edit generated files,
  and a pointer to architecture / ADRs.
- Move "every it/test title starts with should" into a vitest/valid-title eslint
  rule and fix the one straggler.

This supersedes the comment-ref codification (#573) that was on this branch; the
remaining #573 work (ref linkification/removal, custom comment-ref lint) and the
other deterministic replacements (pre-push hook, commitlint) move to follow-ups.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K6CmYRXTZQYs4MNo6AETxT
@goosewobbler
goosewobbler force-pushed the docs/comment-refs-as-links branch from b8b6781 to 1dd0947 Compare July 20, 2026 22:49
… prose

Replace the "never hand-edit generated files" AGENTS.md section with deterministic
guards that fire when someone touches the file, not on every request:
- releasekit.schema.json now carries a `$comment` banner (it lacked one; the config
  docs already had theirs), so it self-documents the moment it's opened.
- docs/configuration.md gains a CI check (`docs:check`, mirroring `schema:check`) so
  a hand-edit fails the build — it previously had only the banner, no enforcement.

Both generated files now have banner (discovery) + CI check (enforcement), so the
global AGENTS.md instruction is redundant and removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K6CmYRXTZQYs4MNo6AETxT
@goosewobbler goosewobbler changed the title docs(agents): slim AGENTS.md to non-derivable context; test-title rule → eslint docs(agents): slim AGENTS.md to non-derivable context; move guidance into tooling Jul 20, 2026
goosewobbler and others added 3 commits July 21, 2026 01:52
…lint (#599)

The #573 comment convention becomes deterministic instead of prose (see #598):
- Custom `local/no-bare-issue-refs` eslint rule flags bare `#NNN` in comments
  (link as a full URL or drop it). Set to `warn` for now — the ~330 existing
  source-comment refs are swept in a follow-up, then it flips to `error`.
- `vitest/valid-title` gains `mustNotMatch: #\d`, so test titles carry no issue
  refs; stripped the refs from the ~50 existing titles.
- Removed a dead `eslint-disable @typescript-eslint/no-explicit-any` directive
  (that plugin was never installed) now that eslint lints package sources.

Stacked on #598 (builds on its valid-title rule). The source-comment sweep +
flip-to-error is the separate #573 PR, which touches packages/*/src.


Claude-Session: https://claude.ai/code/session_01K6CmYRXTZQYs4MNo6AETxT

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…600)

Complete the #573 comment-ref cleanup and turn on enforcement:
- Dropped ~237 bare #NNN provenance citations from packages/*/src comments
  (all were standalone origin tags; none load-bearing, so none needed URLs).
- Flipped local/no-bare-issue-refs from warn to error, scoped to packages/*/src
  — test comments legitimately reference mock issue/PR data (fixture numbers,
  external-repo PRs), so they aren't enforced.
- Exempted the three ref-parsing files whose #NNN are format examples, not
  citations: changelogRefs.ts, conventional-changelog.ts, commitParser.ts.
- Also dropped ~55 provenance refs from test comments (opportunistic cleanup).

All edits are comment-only (verified); eslint/typecheck/biome clean. The only
failing tests are pre-existing/environmental integration cases (templates,
sync-tags, pipeline fixture) that fail identically on the base.

Stacked on #599; touches packages/*/src so it drives a natural standing-PR release.


Claude-Session: https://claude.ai/code/session_01K6CmYRXTZQYs4MNo6AETxT

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The committed smoke workflow had setup-node@v7 (bumped on the generated file)
while the source templates it is generated from are at @v6 — so
examples:smoke:check failed on every PR. Regenerate to match the source; no
template or consumer change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K6CmYRXTZQYs4MNo6AETxT
@goosewobbler
goosewobbler merged commit 6c9b641 into main Jul 21, 2026
34 checks passed
@goosewobbler
goosewobbler deleted the docs/comment-refs-as-links branch July 21, 2026 01:43
@github-actions github-actions Bot mentioned this pull request Jul 21, 2026
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.

1 participant