This guide explains how to extend the repository by adding new skills to the HCSA architecture.
| Layer | When to Add Here | Example |
|---|---|---|
| Meta | Strategic planning, task decomposition | task-planner, orchestrator |
| Workflow | Multi-step process coordination | coding-workflow, debugging-workflow |
| Action | Specific operations, tool usage | code-generator, test-generator |
| Domain | Domain-specific expertise | python, react, docker |
.trae/skills/{layer}/{skill-name}/
├── SKILL.md # Required: Skill definition
└── examples/ # Optional: Example files
└── example-1.md
Every skill must have standardized frontmatter:
---
name: skill-name
description: "Clear description of what this skill does"
layer: meta | workflow | action | domain
role: planner | coordinator | executor | expert
version: 1.0.0
invokes: [] # Skills this skill calls
invoked_by: [] # Skills that call this skill
capabilities: [] # What this skill can do
triggers:
keywords: [] # Keywords that trigger this skill
metrics:
avg_execution_time: 2s
success_rate: 0.95
token_efficiency: 0.88
---## Purpose
What this skill does and when to use it.
## Capabilities
- Capability 1
- Capability 2
## Usage
When and how to invoke this skill.
## Examples
### Example 1: Title
Input: ...
Output: ...
## Best Practices
- Practice 1
- Practice 2
## Error Handling
How to handle common errors.
## Related Skills
- related-skill-1
- related-skill-2Meta skills handle strategic decisions:
layer: meta
role: planner
capabilities:
- intent_analysis
- task_decomposition
- complexity_assessment
- execution_planning
invokes:
- workflow-skillsWorkflow skills coordinate processes:
layer: workflow
role: coordinator
capabilities:
- process_coordination
- state_management
- result_aggregation
invokes:
- action-skills
invoked_by:
- meta-skillsAction skills execute operations:
layer: action
role: executor
capabilities:
- specific_operation
- tool_usage
- data_processing
invoked_by:
- workflow-skillsDomain skills provide expertise:
layer: domain
role: expert
capabilities:
- domain_knowledge
- best_practices
- patterns
invoked_by:
- action-skills
- workflow-skillsAfter adding a new skill, update config/routing.yaml:
routing_rules:
- name: "new_skill_route"
condition:
keywords: ["keyword1", "keyword2"]
route:
layer: action
skill: new-skill-name- Verify frontmatter is valid YAML
- Check all invoked skills exist
- Test keyword triggers
- Validate routing rules
- Single Responsibility: Each skill should do one thing well
- Clear Naming: Use descriptive, action-oriented names
- Complete Metadata: Fill all required frontmatter fields
- Document Examples: Provide clear usage examples
- Update Index: Add skill to SKILLS-INDEX.md