alint
AGENTS.md123 starsChanged 3 months agoMITView on GitHub
Use pnpm workspace filters to scope tasks. Examples below are generic; replace the filter with the target workspace name (e.g. @alint-js/core, etc.). - Typecheck - pnpm -F <package.json name> typecheck - Example: pnpm -F @alint-js/cli typecheck (runs tsc). - Unit tests (Vitest) - Targeted: pnpm exec vitest run <path/to/file> e.g. pnpm exec vitest run packages/cli/src/cli/cli.test.ts (not recommended as we prefer to run entire package test instead of file) - Workspace: pnpm -F <package.json name> exec vitest run e.g. pnpm -F…
We split this AGENTS.md into the rules it gives an agent
35 rules. About 0 are common, 21 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Keep runtime entrypoints lean.
- Very specific: line 39
Prefer functional patterns + DI (injeca) for testability.
- Distinctive: line 40
Use Valibot for schema validation.
- Very specific: line 41
Use Eventa (@moeru/eventa) for structured IPC/RPC contracts where needed.
- Very specific: line 42
Use errorMessageFrom(error) from @moeru/std to extract error messages instead of manual patterns like error instanceof Error ?
- Distinctive: line 43
Do not add backward-compatibility guards.
- Distinctive: line 44
If the refactor scope is small, do a progressive refactor step by step.
- Distinctive: line 45
When modifying code, always check for opportunities to do small, minimal progressive refactors alongside the change.
- Distinctive: line 51
When an issue reproduction test is possible, include the tracker identifier in the test case name:
- Distinctive: line 54
Add the actual report link as a comment directly above the regression test:
- Very specific: line 61
When writing tests, prefer line-by-line expect or assertion statements.
- Very specific: line 62
Avoid writing tests for impossible runtime states, such as expect against constants that never change, or asserting object mutations that …
- Very specific: line 68
Keep JSON Schemas provider-compliant (explicit type: object, required fields.
- Distinctive: line 71
Import types from the module or package that owns the contract.
- Very specific: line 73
Do not directly modify or override tsconfig.json to make an import/type error disappear.
- Distinctive: line 74
When Node-only and browser-only types are mixed through one import chain, split the type declarations into a neutral type file and keep …
- Distinctive: line 75
If a wrong export or missing export causes an error, trace the full import chain and side-effect chain before changing imports at the leaf.
- Distinctive: line 76
Treat circular imports as a design problem.
- Distinctive: line 77
When a user asks to use a specific tool or dependency, first check Context7 docs with the search tool, then inspect actual usage of the …
- Distinctive: line 78
If multiple names are returned from Context7 without a clear distinction, ask the user to choose or confirm the desired one.
- Very specific: line 79
If docs conflict with typecheck results, inspect the dependency source under node_modules to diagnose root cause and fix types/bugs.
- Distinctive: line 87
Avoid names that encode multiple layers of ownership into one symbol.
- Distinctive: line 88
Use nouns for resolved domain concepts and verbs for transformations or side effects.
- Distinctive: line 89
Prefer classes for runtime/browser APIs and substantial business modules when the class owns state, lifecycle, or a stable domain boundary.
- Distinctive: line 90
Use dependency injection only at real external boundaries: database, model runtime, queue, Redis/cache, filesystem, network, clock, …
- Distinctive: line 92
Write comments where a reader would otherwise ask why this case can happen, why this branch is ignored, why this fallback exists, why this …
- Very specific: line 100
Do not add broad comments like // Config, // Host, or // Update state unless they explain a non-obvious boundary or transition.
- Distinctive: line 101
Add clear, concise comments for utils, math, OS-interaction, algorithm, shared, and architectural functions that explain non-obvious …
- Very specific: line 102
When using a workaround, add a // NOTICE: comment explaining why, the root cause, and any source context.
- Very specific: line 104
When moving/refactoring/fixing/updating code, keep still-accurate comments with the code.
- Distinctive: line 105
Avoid stubby/hacky scaffolding.
- Very specific: line 116
Keep changes scoped; use workspace filters (pnpm -F <package> <script>).
- Very specific: line 118
Always run pnpm typecheck and pnpm lint after finishing a task.
- Very specific: line 119
Use Conventional Commits for commit messages (e.g., feat(<package name>): added something).
- Distinctive: line 121
Before planning or writing new utilities/functions, always search for existing internal implementations first.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
alint Agent Guide
- pnpm workspace, TypeScript, Vitest, ESLint.
- Components:
packages/cli: CLI entrypoint, argument parsing, setup/config commands, reporter output, and handoff into core.packages/config: project config loading plus global/local setup TOML paths, parsing, merging, and writing.packages/core: public rule/plugin DSL, run engine, source extraction/runtime, model resolution, diagnostics, cache, and usage tracking.packages/plugin-example: example rule plugin that exercises the public SDK and model-backed rule flow.
Structure & Responsibilities
- Build pipeline refs:
.github/workflows; lint rules ineslint.config.ts.
Commands (pnpm with filters)
Use pnpm workspace filters to scope tasks. Examples below are generic; replace the filter with the target workspace name (e.g.
@alint-js/core, etc.).
- Typecheck
pnpm -F <package.json name> typecheck- Example:
pnpm -F @alint-js/cli typecheck(runstsc).
- Unit tests (Vitest)
- Targeted:
pnpm exec vitest run <path/to/file>e.g.pnpm exec vitest run packages/cli/src/cli/cli.test.ts(not recommended as we prefer to run entire package test instead of file) - Workspace:
pnpm -F <package.json name> exec vitest rune.g.pnpm -F @alint-js/cli exec vitest run - Root
pnpm test:run: runs all tests across registered projects. If no tests are found, checkvitest.config.tsinclude patterns. - Root
vitest.config.tsincludespackages/cliand other projects; each app/package can have its ownvitest.config.
- Targeted:
- Lint
pnpm lintandpnpm lint:fix- Formatting is handled via ESLint;
pnpm lint:fixapplies formatting.
- Build
pnpm -F <package.json name> build- Example:
pnpm -F @alint-js/cli build(typecheck + electron-vite build).
Development Practices
- Favor clear module boundaries; shared logic goes in
packages/. - Keep runtime entrypoints lean; move heavy logic into services/modules.
- Prefer functional patterns + DI (
injeca) for testability. - Use Valibot for schema validation; keep schemas close to their consumers.
- Use Eventa (
@moeru/eventa) for structured IPC/RPC contracts where needed. - Use
errorMessageFrom(error)from@moeru/stdto extract error messages instead of manual patterns likeerror instanceof Error ? error.message : String(error). Pair with?? 'fallback'when a default is needed. - Do not add backward-compatibility guards. If extended support is required, write refactor docs and spin up another Codex or Claude Code instance via shell command to complete the implementation with clear instructions and the expected post-refactor shape.
- If the refactor scope is small, do a progressive refactor step by step.
- When modifying code, always check for opportunities to do small, minimal progressive refactors alongside the change.
Testing Practices
- Vitest per project; keep runs targeted for speed.
- For any investigated bug or issue, try to reproduce it first with a test-only reproduction before changing production code. Prefer a unit test; if that is not possible, use the smallest higher-level automated test that can still reproduce the problem.
- When an issue reproduction test is possible, include the tracker identifier in the test case name:
- GitHub issues: include
Issue #<number> - Internal bugs tracked in Linear: include the Linear issue key
- GitHub issues: include
- Add the actual report link as a comment directly above the regression test:
- GitHub issue URL for GitHub reports
- Discord message or thread URL for IM reports
- Linear issue URL for internal bugs
- Mock IPC/services with
vi.fn/vi.mock; do not rely on real Electron runtime. - For external providers/services, add both mock-based tests and integration-style tests (with env guards) when feasible. You can mock imports with Vitest.
- Grow component/e2e coverage progressively (Vitest browser env where possible). Use
expectand assert mock calls/params. - When writing tests, prefer line-by-line
expector assertion statements. - Avoid writing tests for impossible runtime states, such as
expectagainst constants that never change, or asserting object mutations that can only happen inside the same Vitest case setup. - Avoid mocking
globalThisor built-in modules by directly usingObject.defineProperty(...). If needed, usenode:worker_threadsto load another worker and simulate that situation, or build a mini CLI to reproduce and verify behavior. For DOM and Web Platform APIs, prefer Vitest browser mode instead of hard-mocking platform internals. If tests already use those patterns, progressively refactor them. - Do not use Vitest mocks, hoisting, dynamic imports,
as unknown as, or test-only alternate import paths to maliciously bypass real import problems. If a test cannot import a module, investigate the actual compile/runtime boundary: package exports, side effects, mixed Node/browser type dependencies, circular imports, and whether the public module shape is wrong. Fix the boundary instead of hiding the failure in the test.
TypeScript / IPC / Tools
- Keep JSON Schemas provider-compliant (explicit
type: object, required fields; avoid unbounded records). - Favor functional patterns + DI (
injeca); avoid new class hierarchies unless extending browser APIs (classes are harder to mock/test). - Centralize Eventa contracts; use
@moeru/eventafor all events. - Import types from the module or package that owns the contract. Do not redeclare external/public contracts locally just to use a narrower subset, and do not route type imports through local runtime assembly modules when the original side-effect-free type source is available.
- Do not use inline type imports such as
typeof import('...').xorimport('...').Typeto avoid normal module boundaries. Export explicit shared types from the owning module, import external contract types from their owning package, or split a dedicated side-effect-free type module when runtime imports would pull in the wrong environment. - Do not directly modify or override
tsconfig.jsonto make an import/type error disappear. First investigate compilation behavior,package.jsonexportsdeclarations, type declarations, and whether the dependency exposes the intended browser/node entrypoints. - When Node-only and browser-only types are mixed through one import chain, split the type declarations into a neutral type file and keep runtime modules environment-specific. Avoid importing values from modules that carry side effects just to obtain types.
- If a wrong export or missing export causes an error, trace the full import chain and side-effect chain before changing imports at the leaf. Prefer fixing package/module exports and the owning boundary over adding local workaround imports.
- Treat circular imports as a design problem. If a cycle appears, first reconsider ownership, module boundaries, and whether shared types or pure helpers need to move. If the cycle cannot be resolved confidently, ask the user for direction before continuing.
- When a user asks to use a specific tool or dependency, first check Context7 docs with the search tool, then inspect actual usage of the dependency in this repo.
- If multiple names are returned from Context7 without a clear distinction, ask the user to choose or confirm the desired one.
- If docs conflict with typecheck results, inspect the dependency source under
node_modulesto diagnose root cause and fix types/bugs.
Readability, Naming, and Comments
- File names: kebab-case.
- Language ids (
LanguageDefinition.name) use VS Code's language identifiers: https://code.visualstudio.com/docs/languages/identifiers. Plugins register languages, so the set is open and only this convention prevents one language from having several names. Plain text isplaintext, nottext/plain. LSP shares these ids but has no plain-text entry. - Prefer names that rely on the module boundary for context instead of repeating package, product, protocol, or transport prefixes inside every symbol. A well-named module should let exported functions use short action-first names; repeat the larger context only when the symbol crosses a boundary where that context is no longer obvious.
- Name functions after the domain operation they perform, not after the implementation layer that happens to contain them. This keeps call sites readable after refactors and avoids names becoming stale when code moves between files.
- Avoid names that encode multiple layers of ownership into one symbol. If a name needs several qualifiers to be understandable, reconsider the module boundary or introduce a clearer local concept.
- Use nouns for resolved domain concepts and verbs for transformations or side effects. When a function derives a policy/configuration from an event or request, name the domain result explicitly so callers understand what decision is being made.
- Prefer classes for runtime/browser APIs and substantial business modules when the class owns state, lifecycle, or a stable domain boundary. Prefer FP for pure transformations and local helpers.
- Use dependency injection only at real external boundaries: database, model runtime, queue, Redis/cache, filesystem, network, clock, environment, and feature gates. Do not introduce
Dependencies/Depsobjects for internal functions that only call sibling helpers or forward parameters. - Comments should reduce reader uncertainty, not increase documentation volume.
- Write comments where a reader would otherwise ask why this case can happen, why this branch is ignored, why this fallback exists, why this order matters, what state changed here, what external side effect just happened, or what protocol/invariant this line is preserving.
- Good comments explain hidden intent, constraints, ownership, invariants, ordering, side effects, protocol shape, or non-obvious fallback behavior.
- Bad comments translate code into English, restate names/types, or exist only to satisfy hover documentation.
- Important implementation comments should live near the confusing line or branch, not only on exported declarations.
- For calculation-heavy code, prefer inline comments near the intermediate values and branches that need explanation. Do not rely only on function-level JSDoc when the hard part is a coordinate system, unit conversion, clamp, rounding rule, aggregation, fallback, or precedence decision.
- Apply this especially to geometry, graphics and shader math, billing or metering, analytics or statistics, UI layout and positioning, ranking or scoring, and normalization code.
- Format longer comments as short paragraphs separated by blank comment lines. Do not compress background, symptom, rejected alternatives, final rationale, and references into one dense block.
- For investigation-heavy comments, prefer this order when useful: source/context, observed failure, why the obvious fix is insufficient, chosen fix, and references/removal condition.
- Do not add broad comments like
// Config,// Host, or// Update stateunless they explain a non-obvious boundary or transition. - Add clear, concise comments for utils, math, OS-interaction, algorithm, shared, and architectural functions that explain non-obvious intent, invariants, constraints, or why the code is needed.
- When using a workaround, add a
// NOTICE:comment explaining why, the root cause, and any source context. If validated vianode_modulesinspection or external sources (e.g., GitHub), include relevant line references and links in code-formatted text. - When copying, adapting, or deriving code, configuration, constants, schemas, ignore patterns, algorithms, or rules from an external repository, add a nearby
// NOTICE:comment with a GitHub permalink pinned to the source commit and exact line reference. Use single-line references likehttps://github.com/eslint/eslint/blob/833ec10fd702644e94334edd3cd2aa313174a958/.editorconfig#L11and multi-line references likehttps://github.com/eslint/eslint/blob/833ec10fd702644e94334edd3cd2aa313174a958/.editorconfig#L11-L17. Do not use branch links such asmainor links without line numbers for traceable source references. - When moving/refactoring/fixing/updating code, keep still-accurate comments with the code. Remove obsolete comments rather than preserving their history in source; explain notable removals in review notes when needed.
- Avoid stubby/hacky scaffolding; prefer small refactors that leave code cleaner.
- Use markers:
// TODO:follow-ups// REVIEW:concerns/needs another eye// NOTICE:magic numbers, hacks, important context, external references/links
PR / Workflow Tips
- Rebase pulls; branch naming
username/feat/short-name; clear commit messages (gitmoji is prohibited). - Summarize changes, how tested (commands), and follow-ups.
- Improve legacy you touch; avoid one-off patterns.
- Keep changes scoped; use workspace filters (
pnpm -F <package> <script>). - Maintain structured
README.mddocumentation for eachpackages/andapps/entry, covering what it does, how to use it, when to use it, and when not to use it. - Always run
pnpm typecheckandpnpm lintafter finishing a task. - Use Conventional Commits for commit messages (e.g.,
feat(<package name>): added something). - For new feature requirements or requirement-related tasks involving
node:*built-in modules, DOM operations, Vue composables, React hooks, Vite plugins, or GitHub Actions workflows, always do deep research for suitable existing libraries or open source modules first. Before choosing any library, always ask the user to choose and help judge which option is right. Never choose generalized utility libraries on your own (for example,es-toolkit, utilities fromgithub.com/unjs, or tiny tools fromgithub.com/tinylib) without explicit user confirmation. If the user is working spec-driven, list candidate choices in a clear and concise Markdown comparison table. - Before planning or writing new utilities/functions, always search for existing internal implementations first. If the logic could become shared utilities, proactively propose that shared approach to users and developers.
Other versions1 project uses a version of this.
Word for word · 1
- moeru-ai/alint★ 123100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- pnpmSkill
- simple-englishSkill
- xsaiSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

