Skip to content

Shorten the AGENTS.md block (format 0.3) and note outdated blocks in check - #4

Merged
AngelCodes95 merged 3 commits into
mainfrom
feat/shorter-agents-block
Nov 13, 2026
Merged

AngelCodes95 merged 3 commits into
mainfrom
feat/shorter-agents-block

Conversation

@AngelCodes95

Copy link
Copy Markdown
Owner

What

  1. Shorter block (format 0.3). The block init writes drops from about 806 words to about 389. Same rules; the squash-merge and commitlint appendix becomes a short checklist that points at SPEC.md, which already holds the verification detail. The trailer format itself is unchanged. SPEC.md's version line now says so, and that the number tracks the block too.
  2. check notes an outdated block. On stderr only, never changing the exit code: "older" suggests init --update, "newer" suggests updating the CLI. Reads AGENTS.md at the repository root, compares versions numerically, reuses init's marker rules for ambiguous files, and follows symlinks since it only reads.

Why

Agents load this block at the start of every session in every adopting repo, and about half of it only applied to repos that squash-merge or run commitlint. Shortening it creates the first real outdated block (0.2) in the wild, so check now says so; the README used to claim it already did.

Verification

  • 167 tests pass (13 new), sync-docs:check clean.
  • Manually: a real 0.2 block surrounded by other content reports as out of date, init --update replaces only the block, and the surrounding content survives.
  • agent-commit check on this branch: both commits OK.

Release

These go out as CLI 0.3.0 (new block content plus a new check behavior). Release commit, tag and npm publish come after merge, same as 0.2.0.

Cuts the block init writes from about 800 words to about 390. The rules
are unchanged; the squash-merge and commitlint appendix becomes a short
checklist that points at SPEC.md, which already carries the full
verification detail.

Agent-Context: {"why":"agents load this block at the start of every session in every adopting repo, so its length is a recurring cost, and about half of it only applied to repos that squash-merge or run commitlint. Kept the behavioral rules for those cases in the block (merge-draft, final trailer block placement, gh --body dropping Co-authored-by) and moved only the evidence to SPEC.md, since an agent that never opens the spec still needs the rules","touches":["AGENTS.md","SPEC.md","README.md","cli/src/agentsBlock.ts"]}
check now compares the repository root's AGENTS.md block marker to the
format this CLI writes and prints a one-line note on stderr when it is
older (run init --update) or newer (update the CLI).

Agent-Context: {"why":"the 0.3 block makes 0.2 the first real outdated block in the wild, and nothing told those repos. Kept it a stderr note that never touches the exit code because check's exit code already means something specific (commits missing a usable trailer) and people gate on it. Versions compare numerically so 0.10 is newer than 0.3; a version that isn't dotted numbers is reported as different rather than guessed. Reuses init's marker rules so both commands agree on what's ambiguous, but reads through a symlink since it never writes","touches":["cli/src/init.ts","cli/src/index.ts"]}
Agent-Context: {"why":"the version in the note comes from AGENTS.md, which arrives with any cloned repo, and the marker regex accepts any non-space characters, so an ESC sequence in it reached the terminal raw. Sanitized at the print site with the same sanitizeForTerminal used for commit subjects, rather than narrowing the marker regex, which would also change what init recognizes as a block","touches":["cli/src/index.ts"]}
@AngelCodes95
AngelCodes95 merged commit 77a09cc into main Nov 13, 2026
5 checks passed
@AngelCodes95
AngelCodes95 deleted the feat/shorter-agents-block branch November 13, 2026 20:57
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