Skip to content

feat(chat): surface org skills in the "/" picker - #4373

Merged
guitavano merged 5 commits into
mainfrom
guitavano/storefront-skills-agent
Jul 8, 2026
Merged

guitavano merged 5 commits into
mainfrom
guitavano/storefront-skills-agent

Conversation

@guitavano

@guitavano guitavano commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The chat / picker only surfaced MCP prompts and resources. Skills (including the always-loaded storefront public set) were only discoverable by the agent via the <available-skills> catalog + the skill tool — the user had no way to insert one from chat.

This adds the org skill catalog as a third category in the / dropdown (order: prompts → resources → skills).

Selection behavior (inline + file note)

Selecting a skill inlines its SKILL.md body into the message (same model as MCP prompts/resources) and appends a note pointing the agent at the sandbox dir where the skill's files are mounted, so it can read any referenced scripts/templates via bash:

This skill's files are mounted in the sandbox at <sandboxPath>/. To load any file, script, or template this skill references, read it from there with bash (e.g. cat <sandboxPath>/<file>).

This closes the gap of pure-inline (SKILL.md often references sibling files) without needing the agent to blind-call the skill tool.

Changes

  • use-org-fs.ts — OrgFsSkillCatalogEntry + fetchOrgFsSkillCatalog (reuses the existing /fs/skills endpoint → buildSkillCatalog) and fetchOrgFsText (/read).
  • mention-slash.tsx — third kind: "skill"; fetch skills in parallel, filter by name/id/description, fetchAndInsertSkill reads SKILL.md on select. Skill fetch is fault-tolerant (missing ORG_FS_READ degrades to [], never breaks prompts/resources).
  • mention/node.tsx — "skill" added to kind; skill chip is non-clickable (no edit dialog).
  • derive-parts.ts — skillMentionToParts renders the inlined body + file note.

Using the same /fs/skills catalog the runtime uses keeps the picker from ever drifting from <available-skills>.

Testing

  • bun run --cwd=apps/mesh check → exit 0
  • bun run fmt → clean
  • bun run lint → 0 errors (7 pre-existing warnings, untouched files)

Not yet done (flagging for review):

  • Not run in the live app — validation was static. Worth confirming "/" shows storefront skills and that selecting one inlines the SKILL.md.
  • No unit test added for the derive-parts skill branch (pure, testable) — can add if wanted.
  • UI: single flat list (no section header/icon for skills) — grouping is a possible follow-up.

🤖 Generated with Claude Code


Summary by cubic

Add org skills to the chat “/” picker and inline skill docs on select. Picking a skill inserts its SKILL.md and sibling text/markdown files as <skill-file> blocks and lists other files under the sandbox mount.

  • New Features

    • Show org skill catalog in “/” picker using /fs/skills (order: prompts → resources → skills); stays in sync with <available-skills>.
    • Filter by name, id, or description; includes org home and public sets (incl. storefront).
    • On select, inline SKILL.md + sibling text files as <skill-file path="…"> blocks; non-text/oversized files stay on disk and are listed under <sandboxPath>/.
    • Bounded crawl for inlinable docs (md/mdx/markdown/txt only; depth/count/size caps) with fault-tolerant fetching so prompts/resources never break.
    • Prompt chips remain editable; resources and skills are inert.
  • Bug Fixes

    • Prevent suggestion key collisions by namespacing list keys by kind; added kind to BaseItem.
    • Use KEYS.slashSkills for picker caching (distinct from KEYS.orgFsSkills).
    • Remove unused fetchOrgFsText export to satisfy knip.

Written for commit 14875b2. Summary will update on new commits.

Review in cubic

guitavano and others added 2 commits July 8, 2026 15:13
The slash picker only listed MCP prompts + resources. Add the org skill
catalog (home + public sets, incl. storefront) as a third category so
users can insert a skill directly from chat.

Selecting a skill inlines its SKILL.md (like a prompt) and appends a note
pointing the agent at the sandbox dir where the skill's files are mounted,
so it can read any referenced scripts/templates via bash.

The catalog comes from the existing /fs/skills endpoint (buildSkillCatalog),
so the picker never drifts from what the runtime exposes in
<available-skills>. Skill fetch is fault-tolerant — a failure never takes
down the prompts/resources picker.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Applies the Important findings from the multi-perspective review:

- Route the skills query key through a new KEYS.slashSkills constant instead
  of an inline array (convention). Distinct from KEYS.orgFsSkills, which
  caches an incompatible stripped shape on the same endpoint.
- Namespace the suggestion list's React key by kind so a skill and a
  prompt/resource sharing a name no longer collide (added optional `kind`
  to BaseItem).
- Harden the inlined SKILL.md: wrap the body in <skill-content> delimiters and
  frame it as untrusted reference data (public sets sync from external repos),
  and put the resolvable skill id in the header so the agent's
  "already loaded" dedup matches <available-skills>.
- Add derive-parts.test.ts covering skillMentionToParts (happy path, empty/
  whitespace content, null + wrong-shape metadata, prompt not misclassified).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
guitavano and others added 3 commits July 8, 2026 15:52
Selecting a skill now inlines SKILL.md plus its sibling text/reference files
(each wrapped in a <skill-file path="…"> delimiter) instead of just SKILL.md
with a prose "cat the rest with bash" instruction. Scripts and binaries are
left on disk and pointed to with one short line, so the agent isn't handed a
manual step and doesn't get executable/binary content dumped into context.

fetchOrgFsSkillFiles does a bounded recursive walk of the skill folder
(depth/count/size caps, text extensions only), reads matches in parallel, and
flags `truncated` when a cap trims the set.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
fetchOrgFsText is now only used internally by fetchOrgFsSkillFiles (the "/"
skill picker switched from a single SKILL.md read to the folder walk), so its
export is dead — knip fails the build on it. Make it module-private.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Drop the verbose "Apply the skill / do NOT call the skill tool" framing.
Selecting a skill now inlines just like a prompt: a `[/name]` label + the
markdown/text docs baked in (each in a <skill-file path="…"> block). Files
left on disk (scripts, assets, oversized/binary) are surfaced as a compact
path list under the mount, so the agent knows what exists without re-reading
the skill.

fetchOrgFsSkillFiles now returns { files, omittedPaths } instead of a
truncated flag, and only inlines md/mdx/markdown/txt (everything else → path).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@guitavano
guitavano merged commit 4f2d72d into main Jul 8, 2026
14 checks passed
@guitavano
guitavano deleted the guitavano/storefront-skills-agent branch July 8, 2026 19:34
decocms Bot pushed a commit that referenced this pull request Jul 8, 2026
PR: #4373 feat(chat): surface org skills in the "/" picker
Bump type: minor

- decocms (apps/mesh/package.json): 3.106.1 -> 3.107.0

Deploy-Scope: web
tlgimenes pushed a commit that referenced this pull request Jul 16, 2026
…TS.md (#4475)

Mined ~300 merged PRs for the delta between the first PR proposal and the
work added before merge. The dominant shape: a first draft ships the happy
path, then a hardening pass (often a different engineer who takes over the
branch and merges — the vibecoder→engineer handoff) adds the same categories
every time. Encoded those 9 categories as an actionable first-pass checklist,
each citing a real PR (#4008, #4230, #4365, #4409, #4426, #4445, #4357, #4355,
#4449, #4350, #4373, #4416, #4446, #4461, #4134, #4469).

Covers: variant/edge-case handling, tenant/permission scoping, concurrency &
silent-data-loss, test-per-fix + invert-bug-tests + real-PG, dead-code/knip,
lifecycle symmetry + state reset, kill-switch/GC/git-exclude for risky infra,
input validation vs over-engineering, compile-time type-safety.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.

2 participants