Skip to content

AGENTS.md Guide

AGENTS.md is Carry Code’s project-level rule configuration file that allows AI to work according to your project’s standards.


AGENTS.md (Agent Rules) is a Markdown file placed in the project root that defines:

  • 📝 Code standards - Your project’s coding style
  • 🚫 Restrictions - Prohibited operations
  • Best practices - Recommended approaches
  • 🛠️ Tool preferences - Tools and tech stack to use

AdvantageDescription
🤖 Project-specificEach project can have different rules
👥 Team sharingTeam members automatically use the same standards
📋 Auto-enableAI reads automatically, no manual config needed
📁 Version control - Rules can be committed to Git

Create AGENTS.md in the project root:

your-project/
├── AGENTS.md # ← Place here
├── src/
├── package.json
└── ...

# Project Rules
## Code Style
- Use 2-space indentation
- Use TypeScript, avoid any type
- Functions must have comments
## Naming Conventions
- Variables use camelCase
- Constants use UPPER_SNAKE_CASE
- Class names use PascalCase
## Prohibitions
- Don't modify files in config directory
- Don't use eval()
- Don't commit sensitive information
## Best Practices
- Prefer using const
- Errors must be caught and handled
- API interfaces must have type definitions
## Git Commit Standards
- Use Conventional Commits format
- Run tests before committing
---
name: my-project-rules
description: My project rules
version: 1.0.0
---
# Project Rules
...

# TypeScript Project Rules
## Code Style
- Use 2-space indentation
- Enable strict mode
- Never use `any` type
- Use native TypeScript types
## File Organization
- Components in `src/components/`
- Utility functions in `src/utils/`
- Type definitions in `src/types/`
## Naming Conventions
- Components use PascalCase
- Hooks use use prefix
- Utility functions use camelCase
## Prohibitions
- No `any` types
- No `// @ts-ignore`
- No direct DOM manipulation
- No .env file commits
# React Project Rules
## Component Standards
- Use function components
- Use Hooks
- Component files use .tsx extension
## State Management
- Internal state use useState
- Global state use Context or Redux
## Styles
- Use CSS Modules
- Avoid inline styles
# Python Project Rules
## Code Style
- Follow PEP 8
- Use Black for formatting
- Use type hints
## Package Management
- Use Poetry or pipenv
- requirements.txt must lock versions
## Testing
- Use pytest
- Test files in tests/ directory

When you ask AI to help, it automatically:

  1. Detects file - Checks if AGENTS.md exists in project root
  2. Reads rules - Parses file content
  3. Applies rules - Generates code according to rules
  4. Observes restrictions - Avoids triggering prohibited items

Assume you set these rules:

## Prohibitions
- Don't use var for variable declaration

When you ask AI to write code:

You: Help me write a JavaScript function

AI will automatically use const or let, not var.


FeatureAGENTS.md/rule
ScopeCurrent projectGlobal
LocationProject root~/.carry/rules/
Version controlCommitted with projectLocal
PriorityHighestLower

Carry Code reads rules in priority order:

  1. AGENTS.md (project root) - Highest priority
  2. Project-level rules (.carry/rules/)
  3. User-level rules (~/.carry/rules/)

# Project Rules
## Code Style
- Use 2-space indentation
# My Project Rules
## Code Style
- Use 2-space indentation
- Use TypeScript
- Functions must have JSDoc comments
## Naming Conventions
- Variables use camelCase
- Constants use UPPER_SNAKE_CASE
## Prohibitions
- Don't use eval()
- Don't commit .env
## Best Practices
- Errors must be caught
- Code must have tests

Q: Will AGENTS.md affect all conversations?

Section titled “Q: Will AGENTS.md affect all conversations?”

Only affects conversations in the current project.

AI will indicate loaded rules at the start of the conversation.

Yes. Without it, AI works in the default way.

Q: Do team members need to configure individually?

Section titled “Q: Do team members need to configure individually?”

No. Just commit AGENTS.md to Git, and all team members will automatically use the same rules.