Agent Skills: Add Actions

Add Actions Menu commands to scripts and scriptlet bundles with setActions() and companion .actions.md files.

UncategorizedID: johnlindquist/script-kit-next/add-actions

Install this agent skill to your local

pnpm dlx add-skill https://github.com/johnlindquist/script-kit-next/tree/HEAD/kit-init/skills/add-actions

Skill Files

Browse the full folder contents for add-actions.

Download Skill

Loading file tree…

kit-init/skills/add-actions/SKILL.md

Skill Metadata

Name
add-actions
Description
Add Actions Menu commands to scripts and scriptlet bundles with setActions() and companion .actions.md files.

Add Actions

Use this skill when the user wants Actions Menu commands (Cmd+K), script-local actions via setActions(), or shared scriptlet actions via <bundle>.actions.md.

Write Here

For scripts: ~/.scriptkit/plugins/main/scripts/<name>.ts

For scriptlet bundles: ~/.scriptkit/plugins/main/scriptlets/<bundle>.md ~/.scriptkit/plugins/main/scriptlets/<bundle>.actions.md

Script Example

import "@scriptkit/sdk";

await setActions([
  {
    name: "Copy Input",
    shortcut: "cmd+c",
    onAction: async (input) => {
      await copy(input);
      await hud("Copied");
    },
  },
  {
    name: "Clear Input",
    shortcut: "cmd+backspace",
    onAction: async () => {
      await setInput("");
      await hud("Cleared");
    },
  },
]);

await arg("Type something");

Scriptlet Companion File

Parent bundle:

## Script Kit

~~~metadata
description: Open the Script Kit homepage
~~~

~~~open
https://www.scriptkit.com
~~~

Companion actions file:

### Copy URL

~~~bash
echo -n "{{content}}" | pbcopy
~~~

### Open in Safari

~~~bash
open -a Safari "{{content}}"
~~~

Common Pitfalls

  • Discovery belongs in the Actions Menu. Do not add persistent chrome to solve discoverability.
  • The companion file must share the same basename: main.md + main.actions.md.
  • Use {{content}} inside companion actions to read the selected parent command content.

Related Examples

  • Canonical: ~/.scriptkit/plugins/examples/scriptlets/custom-actions/main.md — parent bundle entries that receive shared actions
  • Canonical: ~/.scriptkit/plugins/examples/scriptlets/custom-actions/main.actions.md — companion Actions Menu definitions using {{content}}
  • Flat mirror: ~/.scriptkit/plugins/examples/scriptlets/custom-actions.md
  • Flat mirror: ~/.scriptkit/plugins/examples/scriptlets/custom-actions.actions.md

Related Skills