Build agent
Skill nanocodana/nanocodana/packages/cli/example-skills/build-agent
Scaffold, write, and test a brand-new NanoCodana agent (a runnable NodeAgent script, plus a skill if useful) from a plain-language descriptionFrom its SKILL.md
npx -y skills add nanocodana/nanocodana --skill build-agentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.8 KB, 675 tokens by cl100k_base, as published. Nobody here has run it
Build Agent Skill
Turn a description like "an agent that writes commit messages" into a working,
tested NanoCodana agent. NanoCodana is a coding-agent framework on the Vercel AI
SDK: an agent is created with NodeAgent({ ... }) and run with
agent.generate({ prompt }) or agent.stream({ messages }).
Template — a minimal runnable agent
Write a file like this to the current working directory (adapt the name, model, system prompt, and tools to the request). It reads the API key from the environment — no dotenv needed, because it inherits the parent process's env.
import { NodeAgent } from '@nanocodana/nodejs'
import { createAnthropic } from '@ai-sdk/anthropic'
const model = createAnthropic({ apiKey: process.env.ANTHROPIC_API_KEY })(
'claude-sonnet-4-5',
)
const agent = NodeAgent({
model,
workingDirectory: process.cwd(),
systemPrompt: `<one paragraph describing this agent's single job>`,
// Optional: gate or restrict tools for safety, e.g.
// needsApproval: ['Write', 'Edit', 'Delete'],
})
// The task comes in as the first CLI arg (fallback for a quick smoke test).
const task = process.argv[2] ?? '<a representative default task>'
const result = await agent.generate({ prompt: task })
console.log(result.text)
If OPENAI_API_KEY is set instead of ANTHROPIC_API_KEY, use
createOpenAI(...)('gpt-4o') from @ai-sdk/openai.
Steps
- Clarify the agent's single purpose, its model, and which tools it needs. Keep the scope to one clear job.
- Write the agent script to
<name>.mjsin the current working directory. - (Optional) Write a skill at
.agents/skills/<name>/SKILL.mdif the agent needs reusable, loadable instructions — then have the generated agent load it (omitskillsto let it auto-discover from its working dir). - Test it by running it with the host shell and a representative task:
(Use Bash withnode <name>.mjs "a representative task for this agent"host: true— running Node needs the real shell.) - Read the output. If the agent misbehaves, fix the script or its system prompt / skill and run it again. Don't stop until it produces a sensible result.
- Summarize what you built: the file(s) created, the agent's purpose, and the exact command to run it.
Rules
- Keep generated agents minimal — only
@nanocodana/nodejsplus one AI SDK provider. No extra dependencies. - Default to safe tools. Do not enable host Bash or destructive tools in a generated agent unless the user explicitly asks.
- Always test before declaring done.
- Do NOT build an agent whose job is to build other agents (no recursion).
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.