Add this skill
npx mdskills install ZhangHanDong/evolutionComprehensive self-evolution system with hooks-based auto-triggering and structured contribution workflows
1---2name: evolution3description: |4 CRITICAL: Use for makepad-skills self-evolution and contribution. Triggers on:5 evolve, evolution, contribute, contribution, self-improve, self-improvement,6 add pattern, new pattern, capture learning, document solution,7 hooks, hook system, auto-trigger, skill routing,8 template, pattern template, shader template, troubleshooting template,9 演进, 贡献, 自我改进, 添加模式, 记录学习, 文档化解决方案10---1112# Makepad Skills Evolution1314This skill enables makepad-skills to self-improve continuously during development.1516## Quick Navigation1718| Topic | Description |19|-------|-------------|20| [Collaboration Guidelines](references/collaboration.md) | **Contributing to makepad-skills** |21| [Hooks Setup](#hooks-based-auto-triggering) | Auto-trigger evolution with hooks |22| [When to Evolve](#when-to-evolve) | Triggers and classification |23| [Evolution Process](#evolution-process) | Step-by-step guide |24| [Self-Correction](#self-correction) | Auto-fix skill errors |25| [Self-Validation](#self-validation) | Verify skill accuracy |26| [Version Adaptation](#version-adaptation) | Multi-branch support |2728---2930## Hooks-Based Auto-Triggering3132For reliable automatic triggering, use Claude Code hooks. Install with `--with-hooks`:3334```bash35# Install makepad-skills with hooks enabled36curl -fsSL https://raw.githubusercontent.com/ZhangHanDong/makepad-skills/main/install.sh | bash -s -- --with-hooks37```3839This will install hooks to `.claude/hooks/` and configure `.claude/settings.json`:4041```json42{43 "hooks": {44 "UserPromptSubmit": [45 {46 "matcher": "",47 "hooks": [48 {49 "type": "command",50 "command": "bash .claude/hooks/makepad-skill-router.sh"51 }52 ]53 }54 ],55 "PreToolUse": [56 {57 "matcher": "Bash|Write|Edit",58 "hooks": [59 {60 "type": "command",61 "command": "bash .claude/hooks/pre-tool.sh"62 }63 ]64 }65 ],66 "PostToolUse": [67 {68 "matcher": "Bash",69 "hooks": [70 {71 "type": "command",72 "command": "bash .claude/hooks/post-bash.sh"73 }74 ]75 }76 ]77 }78}79```8081### What Hooks Do8283| Hook | Trigger Event | Action |84|------|---------------|--------|85| `makepad-skill-router.sh` | UserPromptSubmit | Auto-route to relevant skills |86| `pre-tool.sh` | Before Bash/Write/Edit | Detect Makepad version from Cargo.toml |87| `post-bash.sh` | After Bash command fails | Detect Makepad errors, suggest fixes |88| `session-end.sh` | Session ends | Prompt to capture learnings |8990---9192## Skill Routing and Bundling9394The `makepad-skill-router.sh` hook automatically loads relevant skills based on user queries.9596### Context Detection9798| Context | Trigger Keywords | Skills Loaded |99|---------|------------------|---------------|100| **Full App** | "build app", "从零", "完整应用" | basics, dsl, layout, widgets, event-action, app-architecture |101| **UI Design** | "ui design", "界面设计" | dsl, layout, widgets, animation, shaders |102| **Widget Creation** | "create widget", "创建组件", "自定义组件" | widgets, dsl, layout, animation, shaders, font, event-action |103| **Production** | "best practice", "robrix pattern", "实际项目" | app-architecture, widget-patterns, state-management, event-action |104105### Skill Dependencies106107When loading certain skills, related skills are auto-loaded:108109| Primary Skill | Auto-loads |110|---------------|------------|111| robius-app-architecture | makepad-basics, makepad-event-action |112| robius-widget-patterns | makepad-widgets, makepad-layout |113| makepad-widgets | makepad-layout, makepad-dsl |114| makepad-animation | makepad-shaders |115| makepad-shaders | makepad-widgets |116| makepad-font | makepad-widgets |117| robius-event-action | makepad-event-action |118119### Example120121```122User: "我想从零开发一个 Makepad 应用"123124[makepad-skills] Detected Makepad/Robius query125[makepad-skills] App development context detected - loading skill bundle126[makepad-skills] Routing to: makepad-basics makepad-dsl makepad-event-action127 makepad-layout makepad-widgets robius-app-architecture128```129130---131132## When to Evolve133134Trigger skill evolution when any of these occur during development:135136| Trigger | Target Skill | Priority |137|---------|--------------|----------|138| New widget pattern discovered | robius-widget-patterns/_base | High |139| Shader technique learned | makepad-shaders | High |140| Compilation error solved | makepad-reference/troubleshooting | High |141| Layout solution found | makepad-reference/adaptive-layout | Medium |142| Build/packaging issue resolved | makepad-deployment | Medium |143| New project structure insight | makepad-basics | Low |144| Core concept clarified | makepad-dsl/makepad-widgets | Low |145146---147148## Evolution Process149150### Step 1: Identify Knowledge Worth Capturing151152Ask yourself:153- Is this a reusable pattern? (not project-specific)154- Did it take significant effort to figure out?155- Would it help other Makepad developers?156- Is it not already documented in makepad-skills?157158### Step 2: Classify the Knowledge159160```161Widget/Component Pattern → robius-widget-patterns/_base/162Shader/Visual Effect → makepad-shaders/163Error/Debug Solution → makepad-reference/troubleshooting.md164Layout/Responsive Design → makepad-reference/adaptive-layout.md165Build/Deploy Issue → makepad-deployment/SKILL.md166Project Structure → makepad-basics/167Core Concept/API → makepad-dsl/ or makepad-widgets/168```169170### Step 3: Format the Contribution171172**For Patterns**:173```markdown174## Pattern N: [Pattern Name]175176Brief description of what this pattern solves.177178### live_design!179```rust180live_design! {181 // DSL code182}183```184185### Rust Implementation186```rust187// Rust code188```189```190191**For Troubleshooting**:192```markdown193### [Error Type/Message]194195**Symptom**: What the developer sees196197**Cause**: Why this happens198199**Solution**:200```rust201// Fixed code202```203```204205### Step 4: Mark Evolution (NOT Version)206207Add an evolution marker above new content:208209```markdown210<!-- Evolution: 2024-01-15 | source: my-app | author: @zhangsan -->211```212213### Step 5: Submit via Git214215```bash216# Create branch for your contribution217git checkout -b evolution/add-loading-pattern218219# Commit your changes220git add robius-widget-patterns/_base/my-pattern.md221git commit -m "evolution: add loading state pattern from my-app"222223# Push and create PR224git push origin evolution/add-loading-pattern225```226227---228229## Self-Correction230231When skill content causes errors, automatically correct it.232233### Trigger Conditions234235```236User follows skill advice → Code fails to compile/run → Claude identifies skill was wrong237 ↓238 AUTO: Correct skill immediately239```240241### Correction Flow2422431. **Detect** - Skill advice led to an error2442. **Verify** - Confirm the skill content is wrong2453. **Correct** - Update the skill file with fix246247### Correction Marker Format248249```markdown250<!-- Correction: YYYY-MM-DD | was: [old advice] | reason: [why it was wrong] -->251```252253---254255## Self-Validation256257Periodically verify skill content is still accurate.258259### Validation Checklist260261```markdown262## Validation Report263264### Code Examples265- [ ] All `live_design!` examples parse correctly266- [ ] All Rust code compiles267- [ ] All patterns work as documented268269### API Accuracy270- [ ] Widget names exist in makepad-widgets271- [ ] Method signatures are correct272- [ ] Event types are accurate273```274275### Validation Prompt276277> "Please validate makepad-skills against current Makepad version"278279---280281## Version Adaptation282283Provide version-specific guidance for different Makepad branches.284285### Supported Versions286287| Branch | Status | Notes |288|--------|--------|-------|289| main | Stable | Production ready |290| dev | Active | Latest features, may break |291| rik | Legacy | Older API style |292293### Version Detection294295Claude should detect Makepad version from:2962971. **Cargo.toml branch reference**:298 ```toml299 makepad-widgets = { git = "...", branch = "dev" }300 ```3013022. **Cargo.lock content**3033043. **Ask user if unclear**305306---307308## Personalization309310Adapt skill suggestions to project's coding style.311312### Style Detection313314Claude analyzes the current project to detect:315316| Aspect | Detection Method | Adaptation |317|--------|------------------|------------|318| Naming convention | Scan existing widgets | Match snake_case vs camelCase |319| Code organization | Check module structure | Suggest matching patterns |320| Comment style | Read existing comments | Match documentation style |321| Widget complexity | Count lines per widget | Suggest appropriate patterns |322323---324325## Quality Guidelines326327### DO Add328- Generic, reusable patterns329- Common errors with clear solutions330- Well-tested shader effects331- Platform-specific gotchas332- Performance optimizations333334### DON'T Add335- Project-specific code336- Unverified solutions337- Duplicate content338- Incomplete examples339- Personal preferences without rationale340341---342343## Skill File Locations344345```346skills/347├── # === Core Skills (16) ===348├── makepad-basics/ ← Getting started, app structure349├── makepad-dsl/ ← DSL syntax, inheritance350├── makepad-layout/ ← Layout, sizing, alignment351├── makepad-widgets/ ← Widget components352├── makepad-event-action/ ← Event handling353├── makepad-animation/ ← Animation, states354├── makepad-shaders/ ← Shader basics355├── makepad-platform/ ← Platform support356├── makepad-font/ ← Font, typography357├── makepad-splash/ ← Splash scripting358├── robius-app-architecture/ ← App architecture patterns359├── robius-widget-patterns/ ← Widget reuse patterns360├── robius-event-action/ ← Custom actions361├── robius-state-management/ ← State persistence362├── robius-matrix-integration/ ← Matrix SDK363├── molykit/ ← AI chat toolkit364│365├── # === Extended Skills (3) ===366├── makepad-shaders/ ← Advanced shaders, SDF367│ ├── _base/ ← Official patterns368│ └── community/ ← Community contributions369├── makepad-deployment/ ← Build & packaging370├── makepad-reference/ ← Troubleshooting, code quality371│372├── # Note: Production patterns integrated into robius-* skills:373├── # - Widget patterns → robius-widget-patterns/_base/374├── # - State patterns → robius-state-management/_base/375├── # - Async patterns → robius-app-architecture/_base/376│377└── evolution/ ← Self-evolution system378 ├── hooks/ ← Auto-trigger hooks379 ├── references/ ← Detailed guides380 └── templates/ ← Contribution templates381```382383---384385## Auto-Evolution Prompts386387Use these prompts to trigger self-evolution:388389### After Solving a Problem390> "This solution should be added to makepad-skills for future reference."391392### After Creating a Widget393> "This widget pattern is reusable. Let me add it to makepad-patterns."394395### After Debugging396> "This error and its fix should be documented in makepad-troubleshooting."397398### After Completing a Feature399> "Review what I learned and update makepad-skills if applicable."400401---402403## Continuous Improvement Checklist404405After each Makepad development session, consider:406407- [ ] Did I discover a new widget composition pattern?408- [ ] Did I solve a tricky shader problem?409- [ ] Did I encounter and fix a confusing error?410- [ ] Did I find a better way to structure layouts?411- [ ] Did I learn something about packaging/deployment?412- [ ] Would any of this help other Makepad developers?413414If yes to any, evolve the appropriate skill!415416## References417418- [makepad-skills repository](https://github.com/ZhangHanDong/makepad-skills)419- [Makepad documentation](https://github.com/makepad/makepad)420- [Project Robius](https://github.com/project-robius)421
Full transparency — inspect the skill content before installing.