Skip to content

Bind per-agent skills into openclaw.json (step 2) - #141

Merged
yikkuro merged 1 commit into
sunt-microsoft-feat-agent-skills-binding-step1from
sunt-microsoft-feat-agent-skills-binding-step2
Jul 30, 2026
Merged

Bind per-agent skills into openclaw.json (step 2)#141
yikkuro merged 1 commit into
sunt-microsoft-feat-agent-skills-binding-step1from
sunt-microsoft-feat-agent-skills-binding-step2

Conversation

@yikkuro

@yikkuro yikkuro commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Step 2 of the agent-skills binding feature: MicroClaw now writes each agent's skill allowlist into config.agents.list[*].skills when it generates/reconciles openclaw.json. This is the OpenClaw-native way to bind skills per agent — at runtime resolveEffectiveAgentSkillFilter reads agents.list[<id>].skills and, when present, uses it to filter the agent's skills (replacing agents.defaults.skills).

Skills are read per-agent from the catalog (agent-catalog.ts skills field / getAgentSkills) — never hardcoded — so later steps can vary skills per agent without touching this plumbing. Since step 1 defaults every agent to all 23 skills, every entry currently receives the full list.

Changes (desktop/src/agent-personas.ts)

  • Added skills: readonly string[] to AgentPersona, populated from the catalog in AGENT_PERSONAS.
  • createAgentEntry writes entry.skills = [...persona.skills] (fresh array copy) into every newly generated entry.
  • ensureAgentPersonasConfig enforces skills authoritatively and idempotently for catalog-known agents (overwrites stale values with a fresh copy); custom/non-catalog agent ids are left untouched. Existing changed detection still correctly reports true when skills are newly added.
  • All existing reconcile behavior (id normalization, list/entries merge, default handling, workspaces) preserved.

Tests (desktop/src/agent-personas.test.ts)

Added coverage: generated entries' skills deep-equal catalog; distinct array instances per agent; stale skills overwritten; custom agent left without skills; changed reported true when skills newly added.

Validation

  • npm test → 676 passed
  • npx tsc --noEmit → clean
  • eslint on changed files → clean (pre-existing unrelated main.ts error left as-is)

No UI/renderer/gateway changes.

Stacking

This PR is stacked on and depends on #140 (step 1, still open). Base branch is sunt-microsoft-feat-agent-skills-binding-step1, not main.

Write each agent's catalog skill allowlist into agents.list[*].skills so OpenClaw's per-agent skill filter binds skills natively. Skills are read per-agent from the catalog (never hardcoded) and enforced authoritatively for catalog-known agents during reconciliation; custom agent ids are left untouched.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1fe75171-fea2-45ef-9401-bf8a4ea0f2ba
@yikkuro
yikkuro merged commit 6cbf674 into sunt-microsoft-feat-agent-skills-binding-step1 Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant