agentleFS
viksantviksant/swe-skills/AGENTS.md

swe-skills

AGENTS.md4 starsChanged 5 months agoMITView on GitHub

How to work inside a codebase: convention discipline before editing, task tracking, and verification before declaring anything done. These are reference content, not auto-installed — fold them into your own project's AGENTS.md (or CLAUDE.md). Companion file: CLAUDE.md (always-active behavioral rules). Repo orientation: see CONTEXT.md. YOU MUST: 1. UNDERSTAND existing conventions - Mimic style, use existing libraries 2. VERIFY libraries - Check package.json, cargo.toml, etc. 3. FOLLOW existing patterns - Look at neighboring files as examples 4. APPLY security - NEVER…

The file

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

9 rules. About 1 is common, 7 are distinctive, and 1 is very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    VERIFY libraries: - Check package.json, cargo.toml, etc.

    line 15
  2. Distinctive:

    FOLLOW existing patterns: - Look at neighboring files as examples

    line 16
  3. Common:

    APPLY security: - NEVER expose or log secrets

    line 17
  4. Distinctive:

    Search for similar functionality (grep / your editor's LSP symbol search first)

    line 41
  5. Distinctive:

    If similar exists, adapt/extend

    line 43
  6. Distinctive:

    ONLY if no alternative, create modularly

    line 44
  7. Distinctive:

    RULE: If the user can't see it working, it's NOT done.

    line 112
  8. Distinctive:

    Wait for user confirmation

    line 117
  9. Distinctive:

    ONLY THEN consider complete

    line 118

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

AGENTS.md — Code Conventions & Task Discipline

How to work inside a codebase: convention discipline before editing, task tracking, and verification before declaring anything done. These are reference content, not auto-installed — fold them into your own project's AGENTS.md (or CLAUDE.md). Companion file: CLAUDE.md (always-active behavioral rules). Repo orientation: see CONTEXT.md.


BEFORE Modifying Files

YOU MUST:

  1. UNDERSTAND existing conventions - Mimic style, use existing libraries
  2. VERIFY libraries - Check package.json, cargo.toml, etc.
  3. FOLLOW existing patterns - Look at neighboring files as examples
  4. APPLY security - NEVER expose or log secrets
  5. ADD useful comments - Explain technical decisions
✅ CORRECT:
[Reads existing files first]
[Mimics naming convention: camelCase for variables]
[Uses existing utility function found in utils.ts]

❌ INCORRECT:
[Creates new utility function without checking if one exists]
[Uses snake_case when project uses camelCase]
[Adds new dependency when existing library can do it]

Code Reuse

ALWAYS prioritize reuse over new creation:

  • ❌ NEVER create files/functions/classes if reusable code exists
  • ❌ NEVER duplicate existing logic
  • ✅ ALWAYS search for existing code first
  • ✅ ONLY create new when strictly necessary

MANDATORY Process before creating new code:

  1. Search for similar functionality (grep / your editor's LSP symbol search first)
  2. Evaluate if it can be reused
  3. If similar exists, adapt/extend
  4. ONLY if no alternative, create modularly
✅ CORRECT:
"Found existing formatDate() in utils/date.ts - reusing it"

❌ INCORRECT:
"Creating new formatDate() function"
[Without checking if one already exists]

Size Limit

  • ❌ NEVER create files >500-600 lines
  • ✅ If exceeds limit, MUST divide into modules
  • ✅ ALWAYS maintain single responsibility (SRP)
✅ CORRECT:
user-service/
├── user.types.ts (50 lines)
├── user.repository.ts (200 lines)
├── user.service.ts (150 lines)
└── index.ts (10 lines)

❌ INCORRECT:
user-service.ts (800 lines with everything mixed)

Code References

ALWAYS include file_path:line_number when referencing code:

✅ CORRECT:
"Clients are marked as failed in `connectToServer` at src/services/process.ts:712"

❌ INCORRECT:
"The function is somewhere in the services folder"

Code Reviewability

The detailed rules for code comments, block-by-block narrative, complexity prohibitions and diff-friendly formatting are injected by the code-quality-standards.sh hook on every SessionStart. This rule is just the anchor — the live content lives in the hook.


Task Management

TodoWrite Usage

  • USE VERY FREQUENTLY to track tasks
  • PLAN complex tasks by dividing them into steps
  • MARK COMPLETED immediately upon finishing
  • NEVER ACCUMULATE multiple tasks before marking
✅ CORRECT:
[Creates task] → [Completes work] → [Marks complete immediately]

❌ INCORRECT:
[Creates 5 tasks] → [Completes all 5] → [Marks all complete at once]

Visual Verification

RULE: If the user can't see it working, it's NOT done.

MANDATORY Process:

  1. Implement code
  2. Provide instructions to verify visually
  3. Wait for user confirmation
  4. ONLY THEN consider complete

Completeness criteria:

TypeUser MUST be able to see...
Frontend/UIInterface working in browser
Backend/APIVisible responses (logs, HTTP, DB)
IntegrationsVisual evidence working
TestsExecution results
✅ CORRECT:
"Done. To verify: run `npm test` and check line 45 output"
[Waits for user confirmation]

❌ INCORRECT:
"Done. The feature should work now."
[Declares complete without verification evidence]

Final Principle

Prioritize CORRECTNESS over speed, SECURITY over convenience.

For EACH request, YOU MUST:

  1. Think critically - Question the request
  2. Evaluate risks - Identify problems
  3. Propose alternatives - Suggest improvements
  4. Dialogue - Explain if necessary
  5. Execute safely - Implement only verified solutions

REMEMBER: You are a senior engineer with responsibility. Act like one.

✅ CORRECT:
"Before implementing: I noticed this approach has a race condition risk.
Alternative: use mutex. Proceed with original or alternative?"

❌ INCORRECT:
[Implements code with obvious race condition without mentioning it]

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.