Repository navigation
docs(agents): restructure agent docs for progressive disclosure - #130
Merged
Merged
Conversation
Shrink AGENTS.md to what every task needs (description, every-task rules, security invariants, non-standard commands, git safety) plus a "read when" table linking the topic files. Resolve contradictions between docs and tooling: drop the 100-char line rule (Prettier enforces 90), ban `any` in src/ only, allow acyclic lib->lib and utils->utils imports, use the vitest coverage thresholds, document both .merlinrc.json locations and the non-throwing config validation. Scope naming.md and security.md by path so no rule loads in every session, and remove rules already enforced by Prettier and ESLint, generic DRY/KISS/SOLID primers, stale statistics, date stamps and link lists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π― Overview
Restructures the agent docs around progressive disclosure. AGENTS.md shrinks to what every task needs and links the topic files with a "read when" trigger. The rule files stop contradicting the tooling and code. No rule loads in every Claude session any more: the always-loaded baseline drops from about 680 lines (AGENTS.md +
naming.md+security.md) to the 62-line AGENTS.md.Docs only. No source, test or config changes.
β¨ Changes
Root AGENTS.md
Minimal root:
.jsimports, layer direction, noanyinsrc/, hyphens, docs sync), the 6 security invariants, the non-standard commands plus the CI gate, and the git safety lines@imports, so CLAUDE.md's@AGENTS.mddoes not pull every file into context)architecture.md), the hook details (already ingit-workflow.md), formatting rules that Prettier and ESLint enforce, and standard npm scriptsContradictions resolved
Docs now match the tooling and code:
.prettierrcenforces 90)any: banned insrc/only (ESLint turnsno-explicit-anyoff fortests/**)vitest.config.tsthresholds (80/80/80/75) are the rule. Removed the 100% targets and the false "enforced in CI" claim (CI does not run coverage)~/.merlinrc.json,<repo-root>/.merlinrc.json), andvalidateConfigdrops invalid fields instead of throwingvi.mock, so the gotcha now covers usingvi.hoistedfor variables a mock factory needsTrimmed
Removed:
docs/development/releases.md)π§ Technical Details
Files Modified:
AGENTS.md- 113 β 62 lines, links tableCLAUDE.md- load table updated; guides are indexed from AGENTS.md.claude/rules/naming.md- 331 β 69 lines, now scoped to**/*.ts.claude/rules/security.md- 236 β 51 lines, now scoped tosrc/**/*.ts; keeps only what AGENTS.md doesn't say.claude/rules/{code-style,clean-code,commands,lib,utils,testing}.md- contradiction fixes and trims.claude/guides/{architecture,development,git-workflow}.md- stale tables, Mock Placement fix, link lists.claude/maintenance/codebase-map.md- coverage targetdocs/development/{architecture,contributing,testing}.md- import rules,anyscope, coverage wordingπ Testing
How to Test:
Expected Behavior: Prettier passes, and every link in the AGENTS.md table resolves. The pre-commit and pre-push hooks (lint-staged, type-check, knip, test, build) passed.
π Related Issues
None.
β Checklist
π Notes
.claude/Markdown was not Prettier-clean before this branch. It is now, but CI still only checksdocs/**, so these files can drift again.security.mdnow loading only forsrc/**/*.ts(the invariants themselves always load through AGENTS.md).