$npx -y skills add Tyuts/xiaobai-skills --skill self-improving-agentRepo-local meta-skill for improving Xiaobai Skills over time. Use after significant project changes, user feedback, install failures, promotion experiments, or repeated workflow friction to update AGENTS.md, capture project-specific gotchas, or propose new repo-local skills. Do n
| 1 | # Self-Improving Agent |
| 2 | |
| 3 | This is a repo-local skill for Xiaobai Skills. It helps the project learn from |
| 4 | real work without turning every task into expensive reflection. |
| 5 | |
| 6 | Use it only when one of these happens: |
| 7 | |
| 8 | - A user reports an install or curation failure. |
| 9 | - A promotion experiment teaches something reusable. |
| 10 | - The recommended starter stack changes. |
| 11 | - The agent repeatedly searches for the same repo knowledge. |
| 12 | - A workflow repeats enough to deserve a repo-local skill. |
| 13 | - A release reveals missing docs, checks, or restore steps. |
| 14 | |
| 15 | Do not use it after every small edit. |
| 16 | |
| 17 | ## Step 1: Diagnose The Learning |
| 18 | |
| 19 | Ask: |
| 20 | |
| 21 | 1. Did the repo structure or command flow change? |
| 22 | 2. Did the user correct a behavior that should persist? |
| 23 | 3. Did an install command fail in a way future agents should know? |
| 24 | 4. Did a starter-stack decision prove good or bad? |
| 25 | 5. Did a repeated workflow emerge? |
| 26 | |
| 27 | If the answer is no, make no changes. |
| 28 | |
| 29 | ## Step 2: Choose The Right Artifact |
| 30 | |
| 31 | - Update `AGENTS.md` for short repo rules, commands, gotchas, or decision |
| 32 | history. |
| 33 | - Update `README.md` for user-facing install or positioning changes. |
| 34 | - Update `ROADMAP.md` for future work. |
| 35 | - Update `docs/promotion-kit.md` for launch and marketing learnings. |
| 36 | - Create `skills/<name>/SKILL.md` only for repeatable multi-step workflows. |
| 37 | |
| 38 | Prefer one concise update over several files. |
| 39 | |
| 40 | ## Step 3: Update AGENTS.md Safely |
| 41 | |
| 42 | When editing `AGENTS.md`: |
| 43 | |
| 44 | - Keep entries short and repo-specific. |
| 45 | - Add dated decision notes only when they explain future behavior. |
| 46 | - Remove or revise stale notes instead of appending contradictions. |
| 47 | - Keep the file readable for every future session. |
| 48 | - Never add secrets, payment details, tokens, or private user data. |
| 49 | |
| 50 | ## Step 4: Create Repo-Local Skills Sparingly |
| 51 | |
| 52 | Create a new skill only when the workflow is: |
| 53 | |
| 54 | - repeated |
| 55 | - multi-step |
| 56 | - specific enough to benefit from written procedure |
| 57 | - useful for future maintainers |
| 58 | |
| 59 | Use: |
| 60 | |
| 61 | ```text |
| 62 | skills/<skill-name>/SKILL.md |
| 63 | ``` |
| 64 | |
| 65 | The skill must include: |
| 66 | |
| 67 | - clear `name` |
| 68 | - clear `description` |
| 69 | - trigger conditions |
| 70 | - steps |
| 71 | - output contract |
| 72 | |
| 73 | ## Step 5: Validate |
| 74 | |
| 75 | Before finishing: |
| 76 | |
| 77 | 1. Re-read changed files. |
| 78 | 2. Check for contradictions with existing docs. |
| 79 | 3. Keep project-level instructions conservative. |
| 80 | 4. If code or scripts changed, run the relevant validation. |
| 81 | 5. Summarize the learning in the final response. |
| 82 | |
| 83 | ## Anti-Patterns |
| 84 | |
| 85 | - Turning one-off preferences into permanent rules. |
| 86 | - Creating global skills for Xiaobai-specific workflows. |
| 87 | - Recording private sponsorship/payment data in repo docs. |
| 88 | - Enabling broad self-reflection on every task. |
| 89 | - Creating verbose AGENTS.md notes that cost more than they save. |