en un clic
agents
This skill should be used when the user asks to 'create an agent', 'add tool calling', 'build workflows', or 'orchestrate AI tasks'. Guides agentic AI patterns and multi-step reasoning.
Menu
This skill should be used when the user asks to 'create an agent', 'add tool calling', 'build workflows', or 'orchestrate AI tasks'. Guides agentic AI patterns and multi-step reasoning.
This skill should be used when the user asks to 'integrate an API', 'handle streaming responses', 'add authentication', or 'manage API calls'. Covers Claude API integration and streaming patterns.
This skill should be used when the user asks to 'add a command', 'parse arguments', 'improve CLI output', or 'add interactive features'. Covers command routing, argument parsing, and stdio handling.
This skill should be used when the user asks to 'scan directories', 'read files', 'parse JSON or Markdown', or 'traverse the file system'. Guides safe file I/O patterns and recursive directory operations.
This skill should be used when the user asks to 'generate Markdown', 'create documentation', 'structure content', or 'format skill definitions'. Covers Markdown generation and structured documentation patterns.
This skill should be used when the user asks to 'create a CLI tool', 'handle file system operations', 'manage processes', or 'configure runtime behavior'. Guides Node.js 20.x patterns and native APIs.
This skill should be used when the user asks to 'add types', 'fix type errors', 'create interfaces', 'improve type safety', or 'configure TypeScript'. Provides TypeScript strict mode patterns and ESM configuration for Node.js projects.
| name | agents |
| description | This skill should be used when the user asks to 'create an agent', 'add tool calling', 'build workflows', or 'orchestrate AI tasks'. Guides agentic AI patterns and multi-step reasoning. |
| version | 1.0.0 |
| metadata | {"internal":false} |
Patterns for building AI agents with tool calling, streaming responses, and multi-step reasoning workflows.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
});
const stream = await client.messages.create({
model: "claude-sonnet-4-5-20250929",
max_tokens: 16000,
system: systemPrompt,
messages: [{ role: "user", content: userContext }],
stream: true,
});
Use Sonnet 4.5 as default. Adjust max_tokens based on expected output length.
// src/utils/claude.ts pattern
export async function callClaude(
systemPrompt: string,
userContext: string,
verbose = false
): Promise<string> {
const stream = await client.messages.create({
model: "claude-sonnet-4-5-20250929",
max_tokens: 16000,
system: systemPrompt,
messages: [{ role: "user", content: userContext }],
stream: true,
});
let fullResponse = "";
for await (const event of stream) {
if (event.type === "content_block_delta" && event.delta.type === "text_delta") {
const text = event.delta.text;
fullResponse += text;
if (verbose) {
process.stderr.write(text); // Real-time feedback
}
}
}
return fullResponse;
}
Verbose mode writes to stderr so stdout remains clean for piping.
// src/prompts/claude-md.ts pattern
export const CLAUDE_MD_PROMPT = `
You are a **Senior Technical Writer** generating a focused skill file.
## OUTPUT FORMAT
\`\`\`markdown
---
name: {skill-name}
description: This skill should be used when the user asks to {actions}.
version: 1.0.0
---
# {Title}
...
\`\`\`
## GUIDELINES
- Be concise, Claude is already smart
- Use trigger phrases in description
- Include copy-paste ready code examples
`;
Structure prompts with:
// src/generators/my-skill.ts
import { callClaude } from "../utils/claude.js";
import { MY_SKILL_PROMPT } from "../prompts/my-skill.js";
import { scanDirectory, readFileContent } from "../utils/file-system.js";
export async function generateMySkill(verbose = false): Promise<string> {
// 1. Gather context from codebase
const files = await scanDirectory(".");
const packageJson = await readFileContent("package.json");
const context = `
## Project Files
${files.map((f) => `- ${f}`).join("\n")}
## Dependencies
${packageJson}
`;
// 2. Call Claude with prompt + context
return await callClaude(MY_SKILL_PROMPT, context, verbose);
}
Generators are pure async functions that return markdown strings.
// src/index.ts - Adding new agent command
const command = process.argv[2];
const isVerbose = process.argv.includes("--verbose");
if (command === "my-skill") {
const result = await generateMySkill(isVerbose);
console.log(result);
process.exit(0);
}
Use direct process.argv parsing. Keep CLI logic minimal.
// src/utils/file-system.ts patterns
import { readdir, readFile } from "fs/promises";
import { join } from "path";
export async function scanDirectory(
dir: string,
ignored = ["node_modules", ".git", "dist"]
): Promise<string[]> {
const entries = await readdir(dir, { withFileTypes: true });
const files: string[] = [];
for (const entry of entries) {
if (ignored.includes(entry.name) || entry.name.startsWith(".")) {
continue;
}
const fullPath = join(dir, entry.name);
if (entry.isDirectory()) {
files.push(...(await scanDirectory(fullPath, ignored)));
} else {
files.push(fullPath);
}
}
return files;
}
Always exclude build artifacts and hidden files.
src/prompts/ and src/generators/ distinct for versioningstream: true for all user-facing outputs to show progress.js extensions in imports, top-level await, and native Node.js APIsThis project doesn't yet implement Claude's tool use API, but the pattern would be:
const response = await client.messages.create({
model: "claude-sonnet-4-5-20250929",
max_tokens: 4096,
tools: [
{
name: "scan_directory",
description: "Recursively scans a directory",
input_schema: {
type: "object",
properties: {
path: { type: "string" },
},
required: ["path"],
},
},
],
messages: [{ role: "user", content: "Analyze the src/ directory" }],
});
// Check for tool_use blocks in response.content
Consider adding tool calling for interactive agents that need file system access.