Skip to content

Dev-only per-agent Skills panel (agent-skills step 4) - #144

Merged
yikkuro merged 1 commit into
sunt-microsoft-feat-agent-skills-binding-step2from
sunt-microsoft-feat-dev-skills-panel
Jul 30, 2026
Merged

Dev-only per-agent Skills panel (agent-skills step 4)#144
yikkuro merged 1 commit into
sunt-microsoft-feat-agent-skills-binding-step2from
sunt-microsoft-feat-dev-skills-panel

Conversation

@yikkuro

@yikkuro yikkuro commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

STEP 4 of the agent↔skills feature: a DEV-ONLY per-agent "Skills" panel so developers can toggle each agent's skill set at runtime and reload the gateway once — no code edits required.

The Skills tab and panel are gated on import.meta.env.DEV, so they are completely absent from production builds (import.meta.env.DEV is statically replaced with false and the v-if="isDev" gate keeps the button/panel out of the release DOM).

Stacking

This PR is stacked on:

Review/merge #140 and #141 first.

What changed

  • ChatView: extend the viewMode union with "skills"; add a third mode-toggle-bar button (v-if="isDev", right of Chat/Studio) and render SkillsDevPanel when selected.
  • SkillsDevPanel (new): agent picker (catalog agents), 23 skill toggles reflecting config.agents.list[<id>].skills, select-all / clear-all, and an Apply & reload button with applying/applied/failed feedback. Defaults to the current chat agent, else main.
  • main.ts: new skills:set-agent-skills IPC — validates the agent id and that every skill id ∈ ALL_SKILL_IDS, writes openclaw.json atomically, and restarts the gateway once (with rollback on failure). Exposed via preload as window.openclaw.skills.setAgentSkills.
  • agent-catalog: add pure isKnownSkillId / sanitizeAgentSkillIds helpers.
  • agent-personas (step-2 seeding change): ensureAgentPersonasConfig now seeds a catalog agent's skills fill-if-missing (only when the entry has no skills key) instead of authoritatively overwriting every gateway boot. This prevents the boot seeding from wiping dev toggles when the gateway reloads to apply them. Fresh installs still get the full catalog list seeded via createAgentEntry; only the "heal stale values every boot" behavior is dropped, which is safe for release (no Skills UI ships to users).
  • i18n: add skills.dev.* keys in both en-US and zh-CN.

Validation (from desktop/)

  • npm test (main): 679 passed
  • npm test (renderer): 198 passed
  • npx tsc --noEmit: clean
  • npx vue-tsc --noEmit (renderer): clean
  • npx vite build (renderer): succeeds; import.meta.env.DEV → 0 unreplaced occurrences, so the dev button/panel are inert in prod
  • ESLint on changed files: no new issues (only pre-existing warnings + the known main.ts preserve-caught-error remain)

Manual test

  1. npm run dev in desktop/.
  2. A Skills button appears next to Chat/Studio.
  3. Pick an agent, toggle some skills, click Apply & reload.
  4. The gateway comes back and config.agents.list[<agent>].skills reflects the change — and the change survives the reload (fill-if-missing seeding no longer overwrites it).
  5. Build a release (vite build) and confirm the Skills button is not present.

Add a DEV-ONLY "Skills" tab to ChatView that lets developers toggle each
agent's skill set at runtime and reload the gateway once, without editing
code. The tab and panel are gated on import.meta.env.DEV so they are absent
from production builds.

- ChatView: extend viewMode union with "skills"; add a v-if="isDev" toggle
  button and render SkillsDevPanel when selected.
- SkillsDevPanel: agent picker (catalog agents), 23 skill toggles reflecting
  config.agents.list[id].skills, select/clear all, Apply & reload with
  applying/applied/failed feedback.
- main.ts: new skills:set-agent-skills IPC that validates the agent id and
  skill ids, writes openclaw.json atomically, and restarts the gateway with
  rollback on failure. Exposed via preload as skills.setAgentSkills.
- agent-catalog: add pure isKnownSkillId / sanitizeAgentSkillIds helpers.
- agent-personas: change catalog-skill seeding from authoritative overwrite
  to fill-if-missing so dev-edited skills survive gateway reloads. Fresh
  installs still seed the full catalog list.
- i18n: add skills.dev.* keys in en-US and zh-CN.
- Update/extend unit tests for the seeding change and new helpers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1fe75171-fea2-45ef-9401-bf8a4ea0f2ba
yikkuro pushed a commit that referenced this pull request Jul 30, 2026
Clean auto-merge; i18n unioned #146 skills.dev.* status/global keys with existing #145/#144 keys.

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

Copilot-Session: 1fe75171-fea2-45ef-9401-bf8a4ea0f2ba
@yikkuro
yikkuro merged commit a8ec96d into sunt-microsoft-feat-agent-skills-binding-step2 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