trae-skill-writer
Trae Skill Writer
Analyze project code AND business context, then delegate to skill-creator for SKILL.md creation.
Phase 1: Understand Project (REQUIRED)
Before creating ANY skill, you MUST understand the project first.
1.1 Check Project Size
If project is too large (>50 top-level items, monorepo):
- STOP - Don't analyze entire project
- ASK - Use
AskUserQuestionfor target folders - SCOPE - Only analyze user-specified folders
"This project is large. Which folders should I focus on?"
Options: "src/features/", "lib/core/", "Other..."
1.2 Scan Project Structure
Quick scan to understand what exists (NOT deep reading):
1. List top-level directories
2. Identify tech stack (package.json, go.mod, etc.)
3. Find existing skills/rules/automation
4. List major domains/modules for skill breakdown
Note: Deep code reading happens in Phase 2 for each specific skill.
1.3 Understand Business
Ask user and read docs to capture business context:
| Source | What to Extract |
|---|---|
| User input | Domain terminology, workflows |
| README/docs | Project purpose, architecture |
| Code comments | Business rules |
| Naming | Domain concepts |
Ask: "What business problem does this solve?"
Phase 2: Create Skills (SEQUENTIAL)
Create skills ONE at a time, not in parallel.
2.1 Plan Skill Breakdown
First, identify all skills needed:
Example: ecommerce-app
├── app-style (style system)
├── app-component (UI components)
├── app-api (API patterns)
└── app-monitor (monitoring)
2.2 For EACH Skill (Sequential Loop)
┌─────────────────────────────────────────────┐
│ For each skill: │
│ │
│ 0. Initialize SKILL.md from template │
│ - Run scripts/init_skill.py │
│ - Edit generated scaffold │
│ │
│ 1. Deep-dive into THIS skill's code │
│ - Read 2-5 key files for this domain │
│ - Extract patterns specific to it │
│ │
│ 2. Design spec for THIS skill │
│ - Name, triggers, exclusions │
│ - Key files, workflow │
│ - Business context │
│ │
│ 3. Delegate to skill-creator │
│ - Use template below │
│ - Wait for completion │
│ │
│ 4. Move to next skill │
└─────────────────────────────────────────────┘
Initialization command:
python {skill_dir}/scripts/init_skill.py \
--skill-dir {skill_dir} \
--name {new_skill_name} \
--summary "One-line skill purpose" \
--output-root {project_root}/skills
2.3 Delegation Template
Use skill `skill-creator` to create the skill with this spec:
**Skill Name:** {prefix}-{domain}
**Purpose:** {what it does}
**Triggers:** {phrases that should activate it}
**Exclusions:** {when NOT to use}
**Language:** English (or specify)
**Key Files:** {list of files - relative paths only}
**Workflow:** {numbered steps}
**Location:** .trae/skills/{name}/
Project context:
- Tech stack: {detected tech}
- Patterns: {from actual code}
Business context:
- Domain concepts: {terminology}
- Business rules: {constraints}
Phase 3: Quality & Lessons Learned
⚠️ Common Mistakes (CRITICAL)
These mistakes break skills. Always check:
| Wrong ❌ | Correct ✅ | Why |
|---|---|---|
/Users/john/project/src/ |
src/ |
NO absolute paths! Use relative paths only |
/home/dev/lib/utils.go |
lib/utils.go |
Paths start from project root, no leading / |
globs: "*.ts" |
globs: *.ts,*.tsx |
No quotes in globs |
| Mixed 中英文 | Single language | Confuses AI |
super-long-name |
app-style |
prefix + short domain |
Path Rule: Always use paths relative to project root. Just src/file.ts, never /absolute/path/src/file.ts.
Quality Checklist
Before delegating each skill:
- Paths - All relative, no absolute paths
- Naming -
{prefix}-{domain}format - Language - Single language throughout
- Code study - Based on actual codebase
- Business - Includes domain terminology
- Granularity - Single responsibility
Best Practices
Naming: {prefix}-{domain}
| Good ✅ | Bad ❌ |
|---|---|
app-style |
style (no prefix) |
fe-component |
my-app-template (too long) |
Single Responsibility
Each skill = ONE domain:
- Good:
app-style(only style) - Bad:
app-style-and-component(too broad)
Cross-Reference
After creating all skills:
- Check for overlap
- Add "Related Skills" sections
- Verify no duplicate content
Agents
| Stage | Agent | When |
|---|---|---|
| Phase 1 | Project Scanner | Large projects |
| Phase 1 | Tech Stack Analyzer | Domain-specific |
| Phase 3 | Quality Validator | Validation |
References
More from learnwy/skills
english-learner
Use this skill on EVERY user message written in English to auto-detect grammar, word choice, and expression issues — teach corrections before proceeding with the task. Also use when the user looks up a single word, asks about a phrase like 'break the ice', requests translation, or asks for quiz/review. Triggers on: any English message, single English words, idioms, '查单词', '学英语', 'what does X mean', vocabulary review. Stores vocabulary in ~/.english-learner/ with mastery tracking and spaced repetition.
320memory-manager
Cross-session memory for AI. ALWAYS load this skill at session start to read SOUL.md and USER.md. This skill should be loaded for EVERY conversation to maintain continuity. Also triggers on "save memory", "end session", "update memory" for saving. Handles session history creation, memory consolidation, and USER.md/SOUL.md updates. Memory stored in ~/.learnwy/ai/memory/.
220trae-rules-writer
Use this skill when the user wants to create or update Trae IDE rules (.trae/rules/*.md) for AI behavior constraints. Use for: code style enforcement, naming conventions, commit message formats, or making the AI always follow specific patterns. NOT for skills (use project-skill-writer) or agents (use project-agent-writer). Triggers on: 'create rule', 'add rule', 'set up code style', 'enforce convention', 'configure AI behavior', 'AI rule', 'always do X', or when the user wants consistent AI behavior across sessions.
88knowledge-consolidation
Use this skill when the user wants to save, summarize, or persist knowledge from the current AI conversation into structured documents. Captures debugging breakthroughs, architecture decisions, patterns, and lessons learned. Triggers on: '总结一下', '记录下来', 'save this knowledge', 'document this', 'we figured it out', 'that was hard to solve', 'remember this', 'write this down', or when a hard-won insight should be preserved for future sessions. Saves to .trae/knowledges/, .claude/knowledges/, or .cursor/knowledges/ based on AI IDE.
59requirement-workflow
Structured software development workflow orchestrator using Spec-Driven Development (SDD). Transforms vague requirements into spec.md → tasks.md → implementation → verification. Triggers on: '开发功能', '实现这个', 'build this feature', 'implement', 'add new module', 'fix bug', 'develop', 'create feature'.
56english-prompt-optimizer
Optimize and restructure user prompts for better AI responses. Use when user writes in non-English (Chinese, Japanese, Korean, etc.), request is vague/unclear, or user asks to improve their prompt. Triggers on: '帮我', '请帮忙', 'お願い', any non-English complex request. Translates, restructures, and shows optimized prompt before proceeding.
29