@postqode/coding-agent
v0.9.0
Published
Opinionated coding-agent harness on top of @postqode/agent — ships default tools (read/write/edit/bash/grep/list) and a default coding system prompt. Every default is overridable.
Readme
@postqode/coding-agent
Opinionated coding-agent harness on top of @postqode/agent. Ships six sensible defaults (read/write/edit/bash/grep/list) and a concise coding system prompt. Every default is overridable.
Five-line example
import { getProvider } from "@postqode/ai"
import { createCodingAgent } from "@postqode/coding-agent"
const api = getProvider("anthropic")!(
{ apiKey, agentModeApiModelId: "claude-sonnet-4-5-20250929", planModeApiModelId: "claude-sonnet-4-5-20250929" },
"agent",
)
const agent = createCodingAgent({ api })
await agent.run("Fix the bug in src/foo.ts")Default tool pack
| Tool | Purpose |
|---|---|
| read_file | Read a file; optional 1-based line range. |
| write_file | Write content, mkdir parents if needed. |
| edit_file | Exact-match string replacement with uniqueness guard. |
| list_files | Non-recursive directory listing. |
| bash | Shell command via ctx.host.terminal. |
| grep | Regex search via ripgrep (falls back to grep -rn). |
Overrides
createCodingAgent({
api,
extraTools: [myCustomTool], // merge into defaults
dropTools: ["bash"], // remove a default
toolsOverride: [...], // replace entirely
systemPromptOverride: "…", // replace the prompt
systemPromptExtras: "Extra guidance…", // append to default
instructionLoaders: [(ctx) => "Project root: " + ctx.cwd], // dynamic
host, hooks, toolFormat, maxTurns, maxParallelTools, cwd, signal,
})Instruction loaders
Synchronous functions that contribute text to the default system prompt's instructions section. Useful for reading project-specific config, skills, rules, README excerpts.
import { readFileSync } from "node:fs"
createCodingAgent({
api,
instructionLoaders: [
({ cwd }) => readFileSync(`${cwd}/AGENTS.md`, "utf8"),
],
})Loaders are sync by contract — do async work up front and pass the result via systemPromptExtras if needed.
Prompt composition
The default prompt is composed from named sections (role, capabilities, tool summary, workspace, style, instructions, extras). Fine-grained control:
import { composePrompt, defaultCodingPromptSections } from "@postqode/coding-agent"
const sections = defaultCodingPromptSections({ cwd, tools })
const customPrompt = composePrompt([
...sections.filter((s) => s.name !== "style"),
{ name: "house_style", content: "Prefer arrow functions." },
])
createCodingAgent({ api, systemPromptOverride: customPrompt })Sibling packages
@postqode/ai— provider registry.@postqode/agent— the underlyingAgentclass.@postqode/browser— optional browser tool pack.@postqode/evals— real-LLM eval harness targeting this factory.
