Ships in cards-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Type-safe action handlers for the Cards Extension via @cards.management/sdk/config.
Actions and stream renderer www directories are processed at build time. Rebuild after every change.
cards-sdk build -c settings.config.ts -o dist
Parameters:
-c, --config settings.config.ts: Configuration file (TypeScript)-o, --outdir dist: Output directory containing settings.json and bin/ folder--loader .ext=type: Register an esbuild loader for non-code imports (repeatable, e.g. --loader .md=text)// src/actions/launch-claude.ts
import { defineAction } from '@cards.management/sdk/config';
export default defineAction(
{
actionName: 'Launch Claude',
description: 'Start a Claude coding session',
icon: './icons/claude.svg',
supportsBackgroundMode: true
},
async (input, context) => {
const { logger, onCancel, onSwitchToInteractive } = context;
logger.info('Launching Claude', { action: input.actionName, cardId: input.cardId });
onCancel(() => {
logger.info('Action cancelled by user');
});
onSwitchToInteractive(() => {
logger.info('Switching to interactive mode');
return { cardId: input.cardId };
});
}
);
The cards assistant is a single, workspace-scoped handler created with defineCardsAssistant. It has no card context (no cardId, worktree, or socket) and takes an empty {} config.
// src/cards-assistant.ts
import { defineCardsAssistant } from '@cards.management/sdk/config';
export default defineCardsAssistant(
{},
async (input, { logger, cwd }) => {
logger.info('Launching cards assistant', { marketplacePath: input.marketplacePath });
}
);
Define environments, actions, streams, the optional cards assistant and the optional worktree maintenance command in settings.config.ts:
import { defineConfig } from '@cards.management/sdk/config';
import launchClaude from './src/actions/launch-claude.js';
import cardsAssistant from './src/cards-assistant.js';
import worktreeMaintenance from './src/worktree-maintenance.js';
export default defineConfig({
environments: {
default: {
version: 1,
description: 'Default environment',
actions: [launchClaude],
streams: {
'chat-log': {
version: 1,
wwwRoot: './src/streams/chat-log/www',
maxLineLength: 1_048_576
}
}
}
},
cardsAssistant,
worktreeMaintenance
});
| Factory | Purpose | Config Fields |
|---|---|---|
defineAction | Per-card action handler | actionName, id?, description?, icon?, supportsBackgroundMode?, timeout? |
defineCardsAssistant | Workspace-scoped assistant handler | (none — pass an empty {} config) |
defineWorktreeMaintenance | Card-scoped worktreeMaintenance root command | (none — pass an empty {} config) |
worktreeMaintenance compiles to settings.json worktreeMaintenance.command. The server keeps no worktree state; callers run this command through runRootCommand to preview a card's worktree slots, clean them up, or check before deleting the card. The server launches it as a card-scoped execution that sets no card status and writes no note. Its handler receives a mode and a budgetMs to finish within, and must call report() with a WorktreeCleanupPreview ({ cardId, canDeleteCard, decisions, unknownLocks, processesNotInspected, purge, failure? }); see input-types.md.
// src/worktree-maintenance.ts
import { defineWorktreeMaintenance } from '@cards.management/sdk/config';
export default defineWorktreeMaintenance({}, async (input, { report }) => {
// input.mode: 'preview' | 'cleanup' | 'prepare-delete'
// input.budgetMs: stop work and report within this many milliseconds
report({ cardId: input.cardId, canDeleteCard: false, decisions: [] });
});
Without the entry, runRootCommand fails with cause unconfigured. The default configuration's command takes each slot's lock, removes only merged, clean, unused slots, and sets canDeleteCard only when nothing remains.
Before debugging issues, verify:
@cards.management/sdk/config is in package.json dependencies"build": "cards-sdk build -c settings.config.ts -o dist"yarn build)export default factoryFunction(...) patterncreateCardsClient, the CardsClient methods, root commands and card deletionwww/ layout, wwwRoot and stream config fields, the stream-store SDK, and the renderer templateWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub goodfoot-io/cards.management --plugin cards-sdk