agentleFS
SentryKnown publishergetsentry/junior/AGENTS.md

junior

AGENTS.md365 starsChanged 8 months agoApache-2.0View on GitHub

Use pnpm: pnpm install, pnpm dev, pnpm test, pnpm typecheck, pnpm skills:check.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

20 rules. About 0 are common, 10 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the words in TERMINOLOGY.md.

    line 5
  2. Very specific:

    Write docs, policies, plans, and explanations in ASD-STE100 English.

    line 8
  3. Very specific:

    Use pnpm: pnpm install, pnpm dev, pnpm test, pnpm typecheck, pnpm skills:check.

    line 10
  4. Very specific:

    Use /commit for commits, /pr-writer for pull requests, and /skill-writer for skill changes.

    line 32
  5. Distinctive:

    Search every consumer before changing a shared signature, error contract, or name.

    line 34
  6. Distinctive:

    When adding or renaming a shared export, search its exact name and the canonical domain terms a maintainer would use.

    line 35
  7. Distinctive:

    Run applicable checks, move durable explanations beside the owning code, and delete completed plans.

    line 38
  8. Very specific:

    Follow policies/testing.md and policies/evals.md.

    line 42
  9. Distinctive:

    Before adding a test, search every test layer for the behavior and extend its primary owning scenario.

    line 43
  10. Distinctive:

    Do not write automated tests for migrations or migration SQL.

    line 44
  11. Distinctive:

    Do not add tests for most visual changes.

    line 45
  12. Distinctive:

    Add automated coverage for UI only when the change owns a product behavior contract: navigation, interaction, accessibility state, request …

    line 46
  13. Distinctive:

    Do not repeat the same behavioral assertion at multiple layers or add one test per implementation branch.

    line 47
  14. Very specific:

    Test harness mechanics live in packages/junior/tests/README.md and packages/junior-evals/README.md.

    line 48
  15. Very specific:

    Keep all provider-specific routes, API fields, permissions, errors, formatting, and policy in the owning plugin package.

    line 56
  16. Very specific:

    If a plugin needs a runtime capability, add the smallest provider-neutral contract to core or packages/junior-plugin-api.

    line 57
  17. Very specific:

    Treat provider names, hosts, routes, and control flow in core as an architecture warning even when a static dependency rule cannot detect …

    line 58
  18. Very specific:

    Read packages/junior/src/chat/README.md before changing shared chat runtime behavior.

    line 59
  19. Distinctive:

    Keep formatter output. Do not compress or undo formatting to keep a code file below 1,000 lines.

    line 61
  20. Distinctive:

    Do not add mutable runtime globals or test-only singleton mutation APIs.

    line 66

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Agent Instructions

Core Principles

  • Use the words in TERMINOLOGY.md. Do not invent synonyms, overloaded terms, or long compound names when an existing term fits.
  • This is TypeScript/JavaScript, not Java. Prefer functions, plain objects, simple types, and small modules. Avoid class hierarchies, manager/factory names, and interface layers unless they solve a real problem; follow policies/interface-design.md.
  • Optimize for the next maintainer. Choose the smallest design that solves the proven problem, keep complexity local, and avoid speculative abstractions, configuration, extension points, and wrappers; follow policies/correctness-complexity.md.
  • Write docs, policies, plans, and explanations in ASD-STE100 English. Use common words, active voice, short sentences, and one idea per sentence. Keep required terms from TERMINOLOGY.md and explain them when needed. Remove other jargon.

Use pnpm: pnpm install, pnpm dev, pnpm test, pnpm typecheck, pnpm skills:check.

Commands

TaskCommand
Unit/integration test filepnpm --filter @sentry/junior exec vitest run path/to/file.test.ts
Eval harness test filepnpm --filter @sentry/junior-evals test path/to/file.test.ts
Behavioral eval filepnpm --filter @sentry/junior-evals evals:behavioral path/to/eval.eval.ts
Behavioral eval casepnpm --filter @sentry/junior-evals evals:behavioral path/to/eval.eval.ts -t "case name"
Integration eval filepnpm --filter @sentry/junior-evals evals:integration path/to/file.eval.ts
Integration eval casepnpm --filter @sentry/junior-evals evals:integration path/to/file.eval.ts -t "case name"
Guardian eval filepnpm --filter @sentry/junior-evals evals:guardian path/to/file.eval.ts
Guardian eval casepnpm --filter @sentry/junior-evals evals:guardian path/to/file.eval.ts -t "case name"
Router eval filepnpm --filter @sentry/junior-evals evals:router path/to/file.eval.ts
Router eval casepnpm --filter @sentry/junior-evals evals:router path/to/file.eval.ts -t "case name"
Generate package schemapnpm --filter <package> db:generate
Dashboard e2epnpm test:e2e:dashboard
Release package alignmentpnpm release:check

Workflow

  • Use /commit for commits, /pr-writer for pull requests, and /skill-writer for skill changes.
  • For non-trivial changes: discover, implement the smallest vertical slice, verify, and summarize.
  • Search every consumer before changing a shared signature, error contract, or name; use a hard cutover unless compatibility is explicitly required.
  • When adding or renaming a shared export, search its exact name and the canonical domain terms a maintainer would use. The owner and consumers should be easy to distinguish without knowing the file path first.
  • Let unexpected failures reach the owning boundary; retry only expected transient failures. Follow policies/error-handling.md.
  • Exported functions need brief intent-focused JSDoc; follow policies/code-comments.md.
  • Run applicable checks, move durable explanations beside the owning code, and delete completed plans.

Testing And Validation

  • Follow policies/testing.md and policies/evals.md. Product/runtime behavior belongs in integration tests through real Junior wiring (fake only Slack and LLMs via shared harnesses); agent interpretation and reply quality belong in evals; unit tests are reserved for isolated deterministic logic.
  • Before adding a test, search every test layer for the behavior and extend its primary owning scenario. A source change does not automatically require a new test, and equal- or higher-fidelity existing coverage is sufficient.
  • Do not write automated tests for migrations or migration SQL. Use migration metadata and schema generation checks, then test the resulting product behavior through its primary owning scenario.
  • Do not add tests for most visual changes. Layout, styling, spacing, theme, copy presentation, and other look-and-feel work should be manually QA'd with visual evidence. Do not add unit, component, snapshot, or browser regression tests just because a UI file changed.
  • Add automated coverage for UI only when the change owns a product behavior contract: navigation, interaction, accessibility state, request or response shape, auth gating, or a realistic failure path. Even then, extend the primary owning scenario instead of adding a new junk case.
  • Do not repeat the same behavioral assertion at multiple layers or add one test per implementation branch. Add cross-layer coverage only for a distinct contract or failure boundary, and use representative cases unless exhaustive inputs protect a local deterministic invariant.
  • Test harness mechanics live in packages/junior/tests/README.md and packages/junior-evals/README.md.
  • For local evals, run pnpm dev:env once, run docker compose up -d postgres redis, and ensure cloudflared is on PATH. Do not bind environment variables manually; the eval config loads repo env files and provisions test databases.
  • Validate non-Slack agent behavior with pnpm cli -- chat ...; see packages/docs/src/content/docs/contribute/local-agent-validation.md.
  • Telemetry is diagnostic, not a product behavior assertion; follow policies/observability.md and TELEMETRY.md.

Architecture

  • Core owns the runtime and provider-neutral plugin contracts. Plugins own their domain behavior.
  • Keep all provider-specific routes, API fields, permissions, errors, formatting, and policy in the owning plugin package. For example, GitHub behavior belongs in packages/junior-github.
  • If a plugin needs a runtime capability, add the smallest provider-neutral contract to core or packages/junior-plugin-api. Do not add the provider's decision to core.
  • Treat provider names, hosts, routes, and control flow in core as an architecture warning even when a static dependency rule cannot detect the problem. Follow policies/provider-boundaries.md.
  • Read packages/junior/src/chat/README.md before changing shared chat runtime behavior; it owns flow, module boundaries, vocabulary, and invariants.
  • Group files by feature and import feature files directly; do not add feature-directory barrels.
  • Keep formatter output. Do not compress or undo formatting to keep a code file below 1,000 lines. Split a formatted file that exceeds 1,000 lines at a clear feature or ownership boundary. Existing exceptions must stay named and explained in scripts/file-length-exceptions.mjs; follow policies/correctness-complexity.md.
  • Do not add mutable runtime globals or test-only singleton mutation APIs.

Where Rules Live

NeedSource
Repo-wide policy indexpolicies/README.md
Runtime vocabularyTERMINOLOGY.md
Design and failurespolicies/interface-design.md, policies/correctness-complexity.md, policies/error-handling.md
Frontend componentspolicies/frontend-components.md, packages/junior-dashboard/src/client/components/README.md
Agent steeringpolicies/agent-steering.md
Provider boundariespolicies/provider-boundaries.md
Comments and telemetrypolicies/code-comments.md, policies/observability.md, TELEMETRY.md
Chat architecturepackages/junior/src/chat/README.md
Testing and evalspolicies/testing.md, policies/evals.md, packages/junior/tests/README.md, packages/junior-evals/README.md
Local agent validationpackages/docs/src/content/docs/contribute/local-agent-validation.md
Temporary plansopenspec/changes/<slug>/

Feature architecture and non-obvious invariants belong in the owning package or module README.md. Code, schemas, exported types, and tests are authoritative. Plans cannot override policy; update the policy for an exception.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.