trae-rules-writer
12
总安装量
8
周安装量
#26966
全站排名
安装命令
npx skills add https://github.com/learnwy/skills --skill trae-rules-writer
Agent 安装分布
github-copilot
8
codex
8
kimi-cli
8
gemini-cli
8
amp
8
cursor
8
Skill 文档
Trae Rules Writer
Create Trae IDE rules by analyzing project conventions first, then designing rules that match existing patterns.
Workflow
1. ANALYZE â Scan project structure, code style (ls .trae/rules/, cat AGENTS.md)
2. IDENTIFY â What conventions exist? What needs guidance?
3. DESIGN â Choose rule type and application mode
4. CREATE â Write rules in Trae's official format
Rule Format
---
description: When to apply this rule (for intelligent mode)
globs: "*.ts,*.tsx"
alwaysApply: false
---
# Rule Title
Concise guidance for AI.
Application Modes
| Mode | Frontmatter | Use Case |
|---|---|---|
| Always Apply | alwaysApply: true |
Global conventions (naming) |
| File-Specific | globs: "*.tsx,*.jsx" |
Language-specific rules |
| Apply Intelligently | description: "When doing X..." |
Context-dependent guidance |
| Manual Only | (no frontmatter) | Invoke with #RuleName |
Rule Types
| Type | Location | Scope |
|---|---|---|
| User Rules | Settings > Rules & Skills | All projects |
| Project Rules | .trae/rules/*.md |
Current project |
Compatible Files
| File | Description |
|---|---|
AGENTS.md |
Reusable across IDEs |
CLAUDE.md |
Compatible with Claude Code |
CLAUDE.local.md |
Local-only, gitignored |
Example
User: "Create rules for this TypeScript React project"
Analysis:
- Structure: src/components/, src/hooks/
- Naming: PascalCase components, camelCase functions
- No existing .trae/rules/
Creating: .trae/rules/
ð code-style.md
---
alwaysApply: true
---
# Code Style
- PascalCase for components and types
- camelCase for functions and variables
ð react-patterns.md
---
globs: "*.tsx,*.jsx"
---
# React Patterns
- Use functional components with hooks
- Custom hooks go in src/hooks/
References
- Application Mode Examples – Complete examples
- Rule Template – Starter template