AugmentCode supports rule-based AI assistance with YAML frontmatter configuration. rulesync provides intelligent rule generation with automatic type detection and organized file structure for AugmentCode's rule system.
| File Type | Output Path | Description |
|---|---|---|
| Rules | .augment/rules/*.md |
Rule files with YAML frontmatter |
| Legacy Support | .augment-guidelines |
Legacy single-file format (if needed) |
| MCP Configuration | .augment/mcp.json |
Model Context Protocol servers |
| Ignore Rules | .augmentignore |
File exclusion patterns |
AugmentCode supports different rule application types:
- When: Rules applied constantly across entire project
- Generated From: Root rules (
root: true) in rulesync - Behavior: Persistent context for all AI interactions
- When: Rules applied automatically when AI detects relevance
- Generated From: Non-root rules with
descriptionspecified - Behavior: Context-aware automatic rule application
- When: Rules applied only when explicitly invoked
- Generated From: Non-root rules without description (default)
- Behavior: User-controlled rule activation
AugmentCode uses Markdown files with YAML frontmatter:
---
type: always
description: "TypeScript coding standards for all files"
globs: ["**/*.ts", "**/*.tsx"]
---
# TypeScript Development Rules
## Coding Standards
- Use strict TypeScript configuration
- Prefer interfaces over types for object shapes
- Use meaningful variable names
## Architecture Guidelines
- Follow clean architecture principles
- Separate concerns with clear module boundaries
- Use dependency injection for external servicesrulesync automatically determines appropriate rule types:
- Root rules (
root: true) →type: always - Non-root with description →
type: auto - Non-root without description →
type: manual(default)
- type: Automatically determined based on rule characteristics
- description: Used for
autotype rules to help AI detect relevance - globs: File patterns for rule application
# Generate only for AugmentCode
npx rulesync generate --augmentcode
# Generate with verbose output
npx rulesync generate --augmentcode --verbose
# Generate in specific directory
npx rulesync generate --augmentcode --base-dir ./packages/frontend# Import from modern AugmentCode setup
npx rulesync import --augmentcode
# Import from legacy format
npx rulesync import --augmentcode-legacy
# This imports from:
# - .augment/rules/*.md (modern format)
# - .augment-guidelines (legacy format).augment/
├── rules/
│ ├── project-overview.md # Always-applied rules
│ ├── typescript-standards.md # Auto-applied for TypeScript
│ ├── testing-guidelines.md # Auto-applied for tests
│ ├── security-rules.md # Auto-applied for security
│ └── deployment-tools.md # Manual-only rules
├── mcp.json # MCP server configuration
└── legacy/
└── .augment-guidelines # Legacy format (if needed)
Always-Applied Rule (from root rule):
---
type: always
description: "Project-wide development standards"
globs: ["**/*"]
---
# Project Development Standards
## Core Principles
- Clean code practices
- Comprehensive testing
- Security-first approach
- Performance optimizationAuto-Applied Rule (from non-root with description):
---
type: auto
description: "TypeScript-specific coding guidelines and best practices"
globs: ["**/*.ts", "**/*.tsx"]
---
# TypeScript Guidelines
## Type Safety
- Use strict TypeScript configuration
- Avoid `any` type usage
- Implement proper interfaces
## Code Organization
- Export types and interfaces clearly
- Use barrel exports for modules
- Maintain consistent file namingManual Rule (from non-root without description):
---
type: manual
globs: ["**/deploy/**", "**/scripts/**"]
---
# Deployment and Scripting Guidelines
## Deployment Process
- Use staging environment for testing
- Validate all configurations
- Implement rollback procedures
## Script Development
- Include error handling
- Add comprehensive logging
- Document script purposesrulesync supports both modern and legacy AugmentCode formats:
Legacy Import:
# Import from legacy .augment-guidelines file
npx rulesync import --augmentcode-legacyLegacy Format (.augment-guidelines):
# Project Guidelines
## Development Standards
- Follow clean code principles
- Maintain comprehensive test coverage
- Use consistent formatting
## TypeScript Rules
- Enable strict mode
- Use meaningful type names
- Avoid any type usageContext-Specific Rules:
---
type: auto
description: "API development and testing guidelines"
globs: ["**/api/**", "**/routes/**", "**/*.api.ts"]
---
# API Development Rules
Apply these guidelines when working on API endpoints and routing.Framework-Specific Rules:
---
type: auto
description: "React component development patterns"
globs: ["**/*.tsx", "**/components/**"]
---
# React Component Guidelines
## Component Structure
- Use functional components with hooks
- Implement proper TypeScript interfaces
- Follow atomic design principles- Automatic Detection: rulesync detects legacy
.augment-guidelinesformat - Content Parsing: Extracts rules from legacy Markdown content
- Type Assignment: Assigns appropriate rule types based on content analysis
- Modern Generation: Creates organized
.augment/rules/*.mdstructure
- Multi-Tool Import: Import rules from various AI tools
- Type Mapping: Convert rule characteristics to AugmentCode types
- Content Adaptation: Adjust rules for AugmentCode's context system
- Validation: Ensure rules work effectively with AugmentCode
- Type Selection: Choose appropriate rule types based on usage patterns
- Clear Descriptions: Use descriptive text for
autotype rules - Focused Content: Keep rules specific to their intended context
- Regular Updates: Maintain rules as project evolves
- Actionable Rules: Provide specific, implementable guidance
- Context Awareness: Include relevant context for rule application
- Avoid Redundancy: Don't duplicate information across rules
- Performance Optimization: Use appropriate glob patterns
- Rule Reviews: Include rule changes in code reviews
- Consistency Checks: Ensure rules don't contradict each other
- Usage Monitoring: Track effectiveness of different rule types
- Team Training: Educate team on rule types and usage
- Intelligent Assistance: Auto rules activate when AI detects relevance
- Flexible Control: Manual rules provide explicit user control
- Consistent Context: Always rules provide persistent project understanding
- Reduced Noise: Appropriate rule types prevent context overload
- Context-Aware Rules: Auto rules activate based on current work context
- Performance Optimization: Smart rule loading prevents unnecessary processing
- Targeted Guidance: Rules apply to appropriate file types and contexts
- User Control: Manual rules allow explicit guidance activation
- Rules Not Applied: Check rule type and glob patterns
- Context Overload: Use more specific rule types and patterns
- Performance Issues: Optimize glob patterns and rule content
- Type Confusion: Review rule type selection logic
- Check File Structure: Verify rules are in
.augment/rules/directory - Review Rule Types: Ensure appropriate type selection
- Test Glob Patterns: Verify patterns match intended files
- Monitor Performance: Check impact on AI response times
---
type: always
description: "Full-stack development principles"
globs: ["**/*"]
---
# Full-Stack Development Standards
## Architecture
- Clean separation of concerns
- RESTful API design
- Component-based frontend
## Quality Standards
- Comprehensive testing
- Code review requirements
- Documentation standards---
type: auto
description: "Microservices development and deployment guidelines"
globs: ["**/services/**", "**/microservices/**"]
---
# Microservices Guidelines
## Service Design
- Single responsibility principle
- API-first development
- Independent deployment
## Inter-Service Communication
- Use message queues for async operations
- Implement circuit breakers
- Monitor service health---
type: auto
description: "Comprehensive testing strategies and implementation"
globs: ["**/*.test.*", "**/*.spec.*", "**/tests/**"]
---
# Testing Guidelines
## Test Structure
- Follow AAA pattern (Arrange, Act, Assert)
- Use descriptive test names
- Test edge cases and error conditions
## Coverage Requirements
- Minimum 80% code coverage
- Unit tests for all business logic
- Integration tests for API endpoints- Configuration - Frontmatter schema and rule options
- Import Guide - Import existing configurations
- Best Practices - Rule organization strategies