peterfei/ai-agent-team / .claude/skills/thread-manager
thread-manager
Flaggedsrc/tools/add-message.ts
View on GitHubimport { ToolDefinition, ToolInvocation } from '../types';
import { ThreadManager } from '../core/thread-manager';
export const toolDefinition: ToolDefinition = {
name: 'add_message',
description: 'Add a message to the current active thread. Use this to record conversation messages.',
inputSchema: {
type: 'object',
properties: {
role: {
type: 'string',
enum: ['user', 'assistant', 'system'],
description: 'The role of the message sender'
},
content: {
type: 'string',
description: 'The content of the message'
},
metadata: {
type: 'object',
description: 'Optional metadata for the message (e.g., timestamp, tags, etc.)'
}
},
required: ['role', 'content']
}
};
export const toolHandler = async (invocation: ToolInvocation, threadManager: ThreadManager) => {
const { role, content, metadata } = invocation.input as any;
const current = await threadManager.getCurrentThread();
if (!current.thread) {
return { success: false, message: "No active thread to add message to." };
}
try {
const message = await threadManager.addMessageToThread(
current.thread.id,
role,
content,
metadata
);
return {
success: true,
message: message,
info: `Message added to thread "${current.thread.title}".`
};
} catch (e: any) {
return { success: false, message: e.message };
}
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |