D
DevcoreAI

Customization

Rules

Rules are persistent instructions that shape how DevcoreAI writes code — your standards, your architecture, your way.

What Are Rules?

Rules are Markdown files that DevcoreAI reads before every task. They can define coding standards, architectural decisions, testing requirements, naming conventions — anything you want the agent to consistently follow across all tasks.

Rules also support .cursorrules, .windsurfrules, and AGENTS.md formats — so existing rule files from other editors work automatically.

Where Rules Live

Workspace rules

.clinerules/

A folder at the root of your project. Commit it to version control to share standards with your team.

Global rules

~/Documents/DevcoreAI/Rules/

Applied to every task across all projects. Great for personal preferences like formatting style.

Example .clinerules/ structure

your-project/
├── .clinerules/
│   ├── coding.md       # Coding standards
│   ├── testing.md      # Test requirements
│   └── architecture.md # Structural decisions
├── src/
└── ...

Creating Rules

Two ways to create a rule:

  • 1.Type /newrule in the chat after a productive session — DevcoreAI extracts the standards from the conversation and writes the file automatically.
  • 2.Create a .md file manually in .clinerules/ and write instructions in plain Markdown.

Example Rule File

.clinerules/coding.md

# Coding Standards

## TypeScript
- Always use strict TypeScript (no implicit any)
- Prefer interfaces over type aliases for object shapes
- All async functions must return typed Promises

## Error handling
- Use Result<T, E> pattern instead of try/catch where possible
- Never swallow errors silently — always log or rethrow

## Testing
- Unit tests for all utility functions
- Integration tests for all API routes
- Minimum 80% coverage for new files

Conditional Rules

Rules can be made conditional — they only activate when the agent is working in a particular context. For example, apply stricter standards only when editing test files:

.clinerules/testing.md (conditional)

# Testing Standards
<!-- Applies when editing *.test.ts or *.spec.ts files -->

- Every test must have a descriptive name
- Use describe() blocks to group related tests
- Mock all external dependencies
- Assert specific error messages, not just error types

Conditional activation is configured via the Rules UI in the DevcoreAI sidebar — toggle individual rule files on/off, or set them to activate automatically based on file patterns.