Notes from building the
skill-manager-routerskill — how to stop a large AI skill library from becoming chaos. Agar tumhare paas bhi 50+ skills hain, ye architecture rescue karega.
Problem
Hermes 100+ skills ho sakte hain. Ek task aata hai ("traffic drop?") aur 5 skills activate ho jati hain — sab apna analysis dete hain, conflict ho jata hai. Output confusing ho jata hai, aur agent galat skill ke conclusion pe action leta hai. More skills ≠ more intelligence. Zyada skills sirf zyada confusion laate hain agar unhe manage na kiya jaye.
Doctrine (6 rules)
- More skills do NOT automatically mean more intelligence. Ek focused skill 10 generic skills se better hai.
- Har skill ka clear domain, trigger, exclusions hona chahiye. Agar ye nahi hai, skill incomplete hai.
- One task = one primary skill. Support max 2 ho sakte hain.
- Support skills tools hain, competing decision-makers nahi.
- Duplicate skills merge ya deprecate karo.
- Value-na-dikhaye skill default inactive raho.
Mandatory metadata (har SKILL.md mei)
name, version, domain, purpose, triggers, exclusions,
inputs, outputs, primary_or_support, priority, dependencies,
conflicts_with, source_requirements, health_status,
usage_count, success_count, last_error
Ye 16 fields har skill ko self-describing banate hain. Bina iske, router decide nahi kar sakta kon sa skill kis task ke liye hai.
Router decision tree (10 steps)
- Parse user/task intent.
- Determine domain.
- Retrieve candidate skills from registry.
- Remove excluded/conflicting skills.
- Rank by: specificity > health > recency > success history > dependency availability.
- Select exactly ONE PRIMARY.
- Add max TWO SUPPORT skills only if required.
- Execute.
- Validate output.
- Record outcome (usage_count++, success/fail).
Step 6 sabse important hai — ek se zyada primary hone se conflict guaranteed hai.
Context budget guard
MAX_PRIMARY_SKILLS = 1
MAX_SUPPORT_SKILLS = 2
MAX_ACTIVE_SKILL_DOCS = 3
MAX_DUPLICATE_CAPABILITY = 1
Load: summary metadata first; full SKILL.md only for SELECTED skills. Isse context window bachaata hai aur speed badhti hai.
Conflict resolution
- Specialized skill beats general skill.
- Verified-healthy beats experimental.
- First-party-data skill beats estimate-only for owned-site decisions.
- Two skills cannot both issue final decisions on same subtask.
- If conflict remains → record UNCERTAINTY, do NOT blend incompatible conclusions.
Last point critical hai: agent kabhi bhi do alag skills ke contradictory answers mix nahi karega. Wo uncertainty report karega.
Real script I built
registry_scan.py saare skills scan karta hai, metadata extract karta hai, registry.json mei dump karta hai. Multi-domain skills flag karta hai consolidation ke liye.
route.py <task> task leta hai, registry se PRIMARY + SUPPORT suggest karta hai. Ranking function specificity (trigger words match), health (active=3, experimental=2), aur success_count count karta hai.
Maine 15 skills scan kiye — multiple skills same domain mei mile (publishing, seo variants). Ye consolidate karne ke candidates hain.
Example: SEO routing
| Task | Primary | Support |
||||
| Why did traffic drop? | gsc-intelligence | ga4-intelligence |
| Why is this page slow? | technical-seo-guardian | none |
| What article next? | content-opportunity-hunter | gsc-intelligence |
| Write evidence article | citation-article-engine-v2 | content-opportunity-hunter |
| Why not indexed? | indexing-sitemap-guardian | technical-seo-guardian |
| Who cited us? | entity-citation-monitor | none |
Consolidation rule
Jab conflicts_with ya overlapping triggers mile:
- Higher
health_status+success_countwale ko PRIMARY rakho. - Doosre ko deprecate karo (
health_status: deprecated,absorbed_intoadd karo). - Pinned skill ko bina owner approval delete mat karo.
Why this matters for autonomous agents
Autonomous agent (jaise Hermes mesh) bina router ke random skills activate karega. Ek simple "article likho" task 5 skills trigger kar dega — seo-system, hindi-writer, publishing, governance, social. Router ensures: primary = seo-system, support = hindi-writer + social. Baaki exclude.
My experience
Pehle mere paas 11 skills the bina metadata. Task aata tha toh sab respond karte the. Ab registry_scan + route.py se exactly 1 primary milta hai. Output clarity 10x better hai, aur agent faster decide karta hai.
FAQ
Q: Har skill mei 16 fields bharna zaroori hai? Haan, at least name/domain/triggers/health_status. Baaki progressive fill karo.
Q: Duplicate kaise identify karu? registry_scan.py multi-domain report deta hai. Manual bhi: triggers overlap dekho.
Q: Router khud skill hai ya system? Dono — ek skill jo doosre skills ko route karta hai.
Common mistakes
- 2 primary skills choose karna — conflict guaranteed.
- Metadata skip karna — router blind ho jata hai.
- Deprecated skills delete kar dena — pinned hone par nuksan. Inactive rakho.
- Context budget ignore karna — saare SKILL.md load karo toh context bharta hai.
Infra note. Not trading/investment advice.
Deep dive: ranking function kaise kaam karti hai
Router har candidate skill ko score karta hai. Formula simplified:
score = (trigger_matches × 2)
+ (health_rank × 2)
+ (success_count × 0.01)
+ recency_bonus
trigger_matches: task description mei jo words skill ke triggers/domain me hain, unka count. "traffic drop" task mei agar skill ke triggers mei "traffic", "ranking", "gsc" hain aur task mei "traffic" hai, +2.
health_rank: active=3, verified=3, experimental=2, inactive=1, deprecated=0.
success_count: historical wins. Zyada weight nahi (0.01) taaki new skill bhi chance paye.
Final: top scorer = PRIMARY. Agle 2 (score > 1) = SUPPORT.
Registry.json structure (real)
{
"gsc-intelligence": {
"domain": "seo/gsc",
"triggers": "traffic drop, ranking, query performance, ctr",
"health_status": "active",
"source_requirements": "GSC_OAUTH_TOKEN",
"success_count": 12
},
"citation-article-engine-v2": {
"domain": "content/creation",
"triggers": "write article, draft, evidence",
"health_status": "active",
"success_count": 30
}
}
Is JSON ko route.py read karta hai. Har task pe rebuild nahi, sirf registry_scan.py jab skills change hon.
Scenario: "NIFTY article likho with SEO"
Bina router: seo-system + hindi-writer + publishing + social + nse-options-mcp sab trigger ho jayenge.
Router ke saath:
- Domain = "content creation + seo"
-
citation-article-engine-v2(triggers: write article) → PRIMARY score highest -
seo-system(triggers: seo, on-page) → SUPPORT -
hindi-writer(only if lang=hi requested) → SUPPORT or excluded
Result: 1 primary + max 2 support. Clean.
Scaling to 100+ skills
Jab 100 skills ho jayengi:
-
MAX_ACTIVE_SKILL_DOCS = 3ensure karta hai ki context window mei sirf 3 full SKILL.md load hon. - Baaki sirf metadata se match karo.
-
conflicts_withgraph se circular dependencies detect karo.
Ye hi difference hai working agent aur chaotic agent mei.
Kyun maine ye banaya
Mera mesh 3 nodes pe chalta hai (Mac + 2 phones). Har node alag skills chala raha tha. Ek task "publish karo" pe Mac pe 5 skills activate ho rahe the, phones pe alag. Inconsistency thi. Router ne standardize kiya — har node same routing logic use karta hai.
Migration guide (apne skills par lagao)
- Har SKILL.md ke frontmatter mei 16 fields add karo.
-
registry_scan.pyrun karo → registry.json banega. - Har task pe
route.pycall karo pehle. - Conflicts resolve karo (merge duplicates).
- Health status update karo har week.
2 ghante ka kaam, lifetime ki clarity.
Infra note. Not trading/investment advice.
More From Shakti Tiwari
- 🌐 Websites: shaktitiwari.github.io/shakti-tiwari-nse · OptionTradingWithAI.in
- 📚 Books: Build Your Own AI (Amazon) · Option Trading with AI (Amazon)
- 💬 Community: Discord · X · about.me
- 💻 Code: GitHub/shaktitiwari
- 🏛️ Entity: Wikidata Q140689249
Real implementation notes
Maine registry_scan.py pehli baar 15 skills pe chalaaya. Output mei multi-domain conflicts mili — governed-publishing-discipline aur governed-content-publishing dono "publishing/governance" domain mei. Consolidation candidate. route.py ne "why did traffic drop" ke liye gsc-intelligence ko top rank diya (trigger match + active health).
Scaling lessons
Jab 50+ skills ho jayengi, manual metadata impossible hai. Isliye mandatory 16 fields frontmatter mei — registry_scan automate kar leta hai. New skill add karte hi metadata bharo, warna router usse ignore karega (health_status default inactive).
Why this is infrastructure, not optional
Autonomous mesh (3 nodes) mei har node alag skills chala raha tha. Ek task pe inconsistent responses. Router ne standardize kiya — har node same logic. Is bina, distributed agent chaos hai.
Infra note. Not trading/investment advice.
Final recommendation
Agar tumhare paas 10+ skills hain, aaj hi registry_scan banao. Conflicts visible honge. Ek primary rule enforce karo. 1 week mei agent ki clarity 10x ho jayegi.
Infra note. Not trading/investment advice.
Skill chaos silent killer hai. More skills = more confusion jab tak router na ho. 16 fields + 1 primary rule = scalable intelligence.
Infra note. Not trading/investment advice.
Build the router before you build the 50th skill. Order matters — chaos pehle aati hai, discipline baad mei nahi.
Infra note. Not trading/investment advice.
A well-routed skill library scales. A chaotic one collapses. Choose routing.
Infra note. Not trading/investment advice.
One more principle
Router khud ek skill hai jo doosre skills ko route karta hai — isliye ise "meta-skill" kehte hain. Iska apna koi conclusion nahi hota, sirf routing. Ye separation of concerns hai: decision skills decide karein, router sirf assign kare.
Top comments (0)