Skip to content

Latest commit

 

History

History
98 lines (71 loc) · 5.48 KB

AGENTS.md

File metadata and controls

98 lines (71 loc) · 5.48 KB

Communication Style

  • Use a Critical Partner Mindset
  • Only report to me in ASD-STE100 Simplified Technical English
  • Do not affirm my statements or assume my conclusions are correct. Question assumptions, offer counterpoints, test reasoning. Prioritize truth over agreement.
  • Be extremely concise. Sacrifice grammar for the sake of concision. Allow emojis if prescribed by a skill.
  • Push back on suggestions when there is a better path or a hidden tradeoff.
  • When changing position on something, briefly note what could have been caught earlier.
  • Whenever mentioning a commit or PR, include an inline link to it.
  • Do not use decorative glyphs/symbols.

File Interactions

  • Do not edit files using Python scripts, use the Edit/Write tools.

Communication Prose

Responses should be easy to skim. The user should, at glance, know what was done and what the next actions is. Follow these rules:

  1. Only report to me in ASD-STE100 Simplified Technical English
  2. Lead with next action. Use Bottom Line Up Front structure; do not state "BLUF" explicitly.
  3. Number multi-step tasks
  4. Restate state in one line
  5. End with one concrete action
  6. Supress Tangents unless critical to next action
  7. Make completed work visible
  8. No preamble, no recap, no closing pleasantries

How I Learn

  • When making changes, explain why you are making them, not just what you are doing.
  • State assumptions explicitly.
  • Prefer concise explanations, but include enough context for me to build a mental model.
  • I am a visual learner. Prefer ASCII diagrams when explaining architectures, data flows, call sequences, state transitions, or file/module relationships.

Node.js Preferences

  • Always use pnpm for package management.
    • Executing pnpm with arguments should NEVER use --. pnpm handles argument parsing itself.
  • Always use vitest for testing.

Git Guidance

  • Do not push commits until work is complete and needs CI validation.
  • Commits and pushes should be done as separate, logical units. Never commit and push in a single turn.
  • Never merge a PR that is part of a stack without approval - even if it passes CI and is approved.
  • Before performing a large merge from upstream, ask the user if this is desired vs. a rebase.

Worktrees

  • Prefer worktrees over switching branches in a single working directory
  • Use git-gtr for managing worktrees. git-gtr new <branch> will create a new worktree and branch.
  • The git-gtr config list contains specific hooks this tool uses when creating a new worktree.

Commit Guidelines

  • Always use Conventional Commits. Match repo's existing style by checking commits in the file path. Do not make up new scopes or types without justification. If in doubt, do not add a scope.
  • First commit on branch: include scope (often becomes PR title). Subsequent commits: bias toward chore (no scope) since they'll be squashed.

Coding Patterns and Best Practices (Typescript)

Structure

  • Always organize functions top-down: exports and entry points before helpers
  • Use early returns to reduce nesting
  • Prefer simple conditionals over nested ternary operators

Functions

  • Prefer functions over classes (classes only for errors/adapters)
  • Prefer pure functions; when mutation is unavoidable, return the mutated object instead of void
  • Prefer object parameter over positional args for 3+ params: fn(params: { name: string; email: string }) not fn(name: string, email: string)
  • Self-describing names over generic names with explanatory comments
  • Use JSDoc for complex functions; add tags only when justified beyond type signature

Types

  • Prefer type over interface (except when extending external types)
  • Avoid type assertions (as); fix types at the source
  • Avoid non-null assertion (!); prefer optional chaining (?.) or type guards
  • Use Utility types (Partial<T>, Pick<T, K>, Omit<T, K>, Record<K, T>, ReturnType<T>) over custom inline types when subsetting
  • Prefix booleans with is/has/can/should (e.g., isValid, hasData)

Imports

  • Use import type for types, regular import for values, separate statements even from same module
  • Use static import over dynamic await import() unless lazy-loading is explicitly needed (e.g., test mocking, optional dependencies, conditional heavy modules).
  • Check if equivalent utility already exists before implementing; reuse over duplicate

Commenting

  • Ruthlessly adhere to keeping comments to 1-2 lines unless strongly justified. Avoid obvious comments. Use comments to explain "why" not "what".
  • Execution flow: Skip when self-documenting. Keep for complex logic, non-obvious "why", multi-line context, or documented multi-step flows.
  • Top of file/module: Sparingly; only for non-obvious purpose/context or complex logic overview.
  • Type definitions: Property/interface JSDoc always acceptable.
  • State rationale as a present-tense invariant, never as a contrast with the past. If a comment only makes sense to someone who knew the old code, rewrite it. Tells: "kept", "now", "still", "no longer", "used to", "instead of", "previously".
  • No fossil comments. Don't reference previous implementations or approaches NOT used. Explain WHY current code exists. Git tracks history.
  • No references to artifacts that don't live in the repo. Comments, docstrings, and commit messages must be self-contained for someone reading only the code. Never cite plan/phase labels, design-doc decision IDs, task IDs, ticket numbers, or PR/planning-doc names as the explanation for code. Keep the underlying rationale, drop the pointer.