agentleFS
MN-Lizard-TeamMN-Lizard-Team/aiyu-multi-agent/.cursor/rules/domain/documentation-rules.mdc

aiyu-multi-agent / domain

Cursor rule8 starsChanged 7 months agoApache-2.0View on GitHub

Standards for clear, helpful, and maintainable documentation.

  • Reads credentials
  • Installs packages

The file

We split this documentation-rules.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every project must have a README with:

    line 19
  2. Distinctive:

    Update docs when code changes

    line 154
  3. Distinctive:

    CREATE INDEX idx_users_email ON users(email).

    line 221

≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule 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
documentation-rules.mdc
---
description: "Standards for clear, helpful, and maintainable documentation."
globs:
  - "**/*.md"
  - "**/README*"
  - "**/CHANGELOG*"
alwaysApply: false
---
# Documentation Rules — Aiyu Agent Kit

> Standards for clear, helpful, and maintainable documentation.

---

## 🔴 CRITICAL: Documentation Essentials

### README.md Requirements

Every project must have a README with:

```markdown
# Project Name

> One-line description of what this project does

## Features

- Feature 1: Brief description
- Feature 2: Brief description

## Installation

```bash
npm install
# or
pip install -r requirements.txt
```

## Usage

```bash
npm start
# or
python main.py
```

## Configuration

Environment variables needed:
- `API_KEY` — Your API key
- `DATABASE_URL` — Connection string

## License

[MIT](LICENSE)
```

### Code Comments

```python
# ✅ GOOD — Explain WHY, not WHAT
# Retry 3 times because external API is occasionally flaky
MAX_RETRIES = 3

# ✅ GOOD — Document complex logic
# Using sliding window approach to maintain O(n) complexity
# instead of naive O(n²) nested loop approach
def find_substring(s: str, pattern: str) -> int:
    ...

# ❌ BAD — Obvious comments
x = x + 1  # Increment x by 1
```

---

## 🟡 HIGH: API Documentation

### Function/Method Documentation

```python
def create_user(
    email: str,
    password: str,
    role: str = "user"
) -> User:
    """
    Create a new user account.
    
    Args:
        email: User's email address (must be unique)
        password: Plain text password (will be hashed)
        role: User role, defaults to "user"
        
    Returns:
        User object with generated ID
        
    Raises:
        ValidationError: If email format is invalid
        DuplicateError: If email already exists
        
    Example:
        >>> user = create_user("alice@example.com", "secure123")
        >>> user.email
        'alice@example.com'
    """
    ...
```

### API Endpoint Documentation

```markdown
## POST /api/users

Create a new user.

### Request

```json
{
  "email": "user@example.com",
  "password": "securepassword",
  "role": "user"
}
```

### Response

**201 Created**
```json
{
  "id": "usr_123",
  "email": "user@example.com",
  "role": "user",
  "created_at": "2024-01-15T10:30:00Z"
}
```

**400 Bad Request**
```json
{
  "error": "Invalid email format",
  "field": "email"
}
```
```

---

## 🟢 MEDIUM: Documentation Maintenance

### Keep Docs Updated

- Update docs when code changes
- Version documentation with releases
- Remove outdated information
- Mark experimental features clearly

### Documentation Structure

```
docs/
├── README.md           # Quick start guide
├── architecture.md     # System design
├── api-reference.md    # API documentation
├── guides/
│   ├── installation.md
│   ├── configuration.md
│   └── deployment.md
└── examples/
    ├── basic-usage.md
    └── advanced-features.md
```

### Writing Style

- **Be concise:** Get to the point quickly
- **Be specific:** Include exact commands, paths, versions
- **Use examples:** Show, don't just tell
- **Consider audience:** Beginner vs expert docs

---

## Documentation Checklist

- [ ] README exists with essential sections
- [ ] Installation steps are tested and work
- [ ] Configuration options are documented
- [ ] API has complete documentation
- [ ] Code has helpful comments
- [ ] Examples are provided
- [ ] Error messages are explained
- [ ] Changelog is maintained

---

## Good Documentation Example

```markdown
## Troubleshooting

### "Connection refused" error

**Cause:** Database is not running

**Solution:**
```bash
# Start PostgreSQL
sudo systemctl start postgresql

# Or with Docker
docker-compose up -d db
```

### Slow query performance

**Cause:** Missing database index

**Solution:**
```sql
CREATE INDEX idx_users_email ON users(email);
```
```

---

> 📝 **Remember:** Documentation is a feature. Undocumented code doesn't exist.

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.