Skills

Turn an agent's skills on and off.

Forge's skills

5 of 40
  • Fix a flaky test

    Draft from the agent

    Use when a test passes on rerun. Find the race; never add a retry or a sleep.

    Written by Forge from Tuesday's session

    Instructions
    1. Run the test 20 times and note the failures.
    2. Look for timers, shared state and order.
    3. Fix the cause and run it 20 times again.
  • Write a database migration

    Use when a change needs a new column or table. Migrations are reversible.

    v3 · Used in 4 runs this week

    Instructions
    Write the up and the down. Test both on a copy of production.
  • Review a pull request

    Published

    Use when asked to review. Comment on correctness first, style last.

    v7 · Used in 31 runs this week

    Instructions
    Read the description, then the tests, then the code.
  • Write release notes

    Use before tagging a release. Group changes by who they affect.

    Instructions
    Features, fixes, then breaking changes with how to migrate.
  • Upgrade a dependency

    Use when a package needs a new major version. Read the changelog first.

    From the platform team

    Managed by the platform team.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/skills

Usage

import { type Skill, SkillLibrary } from "./ui/uicontext/components/kit/Skills.ts"
const Message = UiSchema.TaggedEnum({	SavedSkill: { skill: Schema.NullOr(Schema.String), name: Schema.String, description: Schema.String, body: Schema.String },	EnabledSkill: { skill: Schema.String, on: Schema.Boolean },})// your app stores the skills; the library asks for each changeexport const AgentSkills = (h: Html.H<typeof Message.Type>, skills: ReadonlyArray<Skill>) =>	SkillLibrary(h, {		props: { id: "forge", label: "Skills", skills, can: ["create", "edit", "enable"] },		onEmit: {			RequestedSave: ({ skill, name, description, body }) => Message.SavedSkill({ skill, name, description, body }),			RequestedEnable: ({ skill, on }) => Message.EnabledSkill({ skill, on }),			RequestedScope: () => undefined,			RequestedPublish: () => undefined,			RequestedSync: () => undefined,			RequestedDefault: () => undefined,			RequestedAccept: () => undefined,			RequestedDecline: () => undefined,			RequestedDelete: () => undefined,			RequestedImport: () => undefined,		},	})

API reference

Props

SkillLibrary props
NameTypeDefaultDescription
idrequiredstring—Identifies the library in the events it sends
labelrequiredstring—The library's heading: "Skills"
skillsrequiredSkill[]—The skills in the current scope
status"loading" | "ready""ready""loading" shows a placeholder; "ready" by default
scopes{ id, label }[]—Tabs: personal, team, organization, repository
scopestring—The id of the scope tab showing
canrequiredSkillAction[]—What this person may do: create, edit, delete, publish, sync, enable, set defaults, accept drafts and import files
limit{ used, max }—"12 of 200 skills"
nounstring—The word for what's listed: "skill", "playbook", "plugin"
deleteCopy{ label, pendingLabel, description }—Copy for a removal such as taking a plugin off the current account.
empty{ title, hint }—What shows when there are no skills
outcomeOutcome | null—The app's answer to the request in flight. Its request is the action, and the skill's id after a colon when it's about one skill: "save", "delete:notes" (see skillRequest).
agentIdstring—The id agents see this library by; skills:<id> when left out

Events

SkillLibrary events
EventPayloadDescription
RequestedScope{ id: string; scope: string }The person picked another scope tab
RequestedSave{ id: string; skill: string | null; name: string; description: string; body: string }skill is null for a new one
RequestedEnable{ id: string; skill: string; on: boolean }The person switched a skill on or off
RequestedPublish{ id: string; skill: string; publish: boolean }The person shared a skill, or stopped sharing it
RequestedSync{ id: string; skill: string }The person sent a published skill's edits to the shared copy
RequestedDefault{ id: string; skill: string; on: boolean }The person made a skill a default, or took that back
RequestedAccept{ id: string; skill: string }The person kept a skill an agent drafted
RequestedDecline{ id: string; skill: string }The person turned down a skill an agent drafted
RequestedDelete{ id: string; skill: string }The person confirmed deleting a skill
RequestedImport{ id: string; files: instanceOf[] }The person picked skill files to import (Markdown); the app reads them

Agent actions

What agents can do with SkillLibrary
ActionDescription
ChoseScopeShow another scope by id
ClickedNewStart a new skill
ClickedEditEdit a skill by id
UpdatedDraftType the name, description or body of the skill being edited
SubmittedDraftSave the skill being edited (name and description are required)
ToggledEnabledTurn a skill on or off for this agent
ClickedPublishPublish a skill to others, or stop publishing it
ClickedSyncSync a published skill's edits to the shared copy
ClickedDefaultMake a skill a default, or stop
ClickedAcceptAccept a draft skill an agent wrote
ClickedDeclineDecline a draft skill an agent wrote
ClickedDeleteOpen confirmation to remove an entry from the library
ConfirmedDeleteasks firstRemove the library entry being confirmed. Name it as your target.

Accessibility

  • Each skill is an article named by its title; its on and off control is a switch, and every button names the skill it acts on.
  • Scopes are a row of toggle buttons (aria-pressed). A missing name or description is announced and marked aria-invalid.
  • Removing a skill asks first, and agents must name the skill they remove.

Source