npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@backendkit-labs/agent-coding

v0.19.3

Published

Coding agent profiles and tools for @backendkit-labs/agent-core

Readme

@backendkit-labs/agent-coding

A production-ready coding agent engine built on @backendkit-labs/agent-core. Bundles 10 specialized agents, filesystem tools, multi-provider support (DeepSeek, OpenAI, Anthropic, Ollama, Kimi, Grok), automatic stack detection, persistent memory, QA review, reflection, and an orchestration pipeline — all in a single createCodingEngine() call.

npm

Table of contents


Installation

npm install @backendkit-labs/agent-coding

All provider adapters are bundled — no separate packages needed.


Quick start

import { createCodingEngine } from '@backendkit-labs/agent-coding';

const engine = createCodingEngine({
  providers:       { deepseek: { apiKey: process.env.DEEPSEEK_API_KEY! } },
  defaultProvider: 'deepseek',
});

await engine.run('List all TypeScript files in src/ and tell me which ones have no tests');

That single call gives you: 10 specialized agents, filesystem tools (read/write/edit/search), persistent project memory, skill loading, and stack auto-detection.


createCodingEngine

The primary factory. Returns a fully configured AgentEngine.

Options reference

interface CodingEngineOptions {
  // Required
  providers:       ProvidersConfig;
  defaultProvider: string;

  // Agents and engine
  defaultAgent?:          string;       // default: 'general'
  workingDir?:            string;       // default: process.cwd()
  maxIterations?:         number;       // default: 100
  maxParallelAgents?:     number;       // default: 6

  // I/O
  transport?:             Transport;    // default: StdoutTransport

  // App identity
  appName?:               string;       // default: 'bk-agent' — used for ~/.{appName}/

  // Persistence
  disablePersistence?:    boolean;      // skip ProjectStore (useful for testing)

  // MCP servers
  mcpServers?:            MCPServerConfig[];

  // Context sharing
  subAgentContextMessages?: number;    // messages visible to sub-agents (recommend 10-20)

  // Iteration control
  onToolApproval?:   (toolName, agentId, argsPreview) => Promise<ToolApprovalDecision>;
  onIterationLimit?: (stats: IterationStats) => Promise<boolean>;
  onStep?:           (stats: IterationStats) => Promise<boolean>;

  // Orchestration
  orchestration?:    boolean | OrchestrationOptions;
}

Minimal setup

const engine = createCodingEngine({
  providers:       { deepseek: { apiKey: 'sk-...' } },
  defaultProvider: 'deepseek',
});

Multiple providers

const engine = createCodingEngine({
  providers: {
    deepseek:  { apiKey: process.env.DEEPSEEK_API_KEY! },
    anthropic: { apiKey: process.env.ANTHROPIC_API_KEY!, model: 'claude-opus-4-8' },
    ollama:    { host: 'http://localhost:11434', model: 'llama3.2' },
  },
  defaultProvider: 'deepseek',
  // Each agent profile can specify a provider override
});

With full orchestration

const engine = createCodingEngine({
  providers:       { deepseek: { apiKey: '...' } },
  defaultProvider: 'deepseek',
  orchestration:   true,
  // Enables:
  //   intent detection → domain detection → risk scoring
  //   policy engine → agent routing → QA auto-review → reflection
});

With MCP servers

const engine = createCodingEngine({
  providers:       { openai: { apiKey: '...' } },
  defaultProvider: 'openai',
  mcpServers: [
    { name: 'github',   command: 'npx', args: ['-y', '@modelcontextprotocol/server-github'],  env: { GITHUB_TOKEN: '...' } },
    { name: 'postgres', command: 'npx', args: ['-y', '@modelcontextprotocol/server-postgres'], env: { DATABASE_URL: '...' } },
  ],
  subAgentContextMessages: 15,
});

With manual tool approval

const engine = createCodingEngine({
  providers:       { deepseek: { apiKey: '...' } },
  defaultProvider: 'deepseek',
  onToolApproval:  async (toolName, agentId, argsPreview) => {
    const write = ['write_file', 'edit_file', 'run_command'];
    if (!write.includes(toolName)) return 'approve';
    console.log(`\n⚠  [${agentId}] ${toolName}:\n${argsPreview}\n`);
    const a = await prompt('Approve? (y/n/all): ');
    if (a === 'y')   return 'approve';
    if (a === 'all') return 'approve_all';
    return 'reject';
  },
});

createCodingEngineFromConfig

Reads credentials from ~/.{appName}/config.json. No code changes needed to switch providers:

import { createCodingEngineFromConfig } from '@backendkit-labs/agent-coding';

const engine = createCodingEngineFromConfig();

// With overrides
const engine = createCodingEngineFromConfig({
  workingDir:    '/my-project',
  orchestration: true,
});

Providers

DeepSeek

providers: {
  deepseek: {
    apiKey:       process.env.DEEPSEEK_API_KEY!,
    model?:       'deepseek-chat',    // default
    maxTokens?:   8192,
    temperature?: 0.7,
  }
}

OpenAI

providers: {
  openai: {
    apiKey:   process.env.OPENAI_API_KEY!,
    model?:   'gpt-4o',
    baseUrl?: 'https://api.openai.com/v1',
  }
}

Anthropic (Claude)

providers: {
  anthropic: {
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model?: 'claude-sonnet-4-6',    // default
  }
}

Ollama (local — no API key)

# Prerequisites
ollama serve
ollama pull llama3.2
providers: {
  ollama: {
    host?:  'http://localhost:11434',
    model?: 'llama3.2',
  }
}

OpenAI-compatible (Kimi, Grok, any endpoint)

providers: {
  kimi: { apiKey: process.env.KIMI_API_KEY!, model: 'moonshot-v1-8k' },
  grok: { apiKey: process.env.GROK_API_KEY!, model: 'grok-3' },
  // Any OpenAI-compatible endpoint
  vllm: { apiKey: 'local', baseUrl: 'http://localhost:8080/v1', model: 'my-model' },
}

Built-in agents

Ten specialist agents are bundled. Orchestration routes tasks automatically; you can also select explicitly.

| Agent ID | Specialty | |----------|-----------| | general | General-purpose — default starting point | | architect | System design, ADRs, architecture decisions | | backend-agent | APIs, server logic, databases | | frontend-agent | React, CSS, accessibility, UX | | devops-agent | CI/CD, Docker, Kubernetes, infra | | database-agent | SQL, indexes, migrations, query tuning | | security-reviewer | Security audits, OWASP, threat modeling | | qa-engineer | Test strategy, edge cases, QA reviews | | documentation-agent | Docs, READMEs, API docs, changelogs | | refactoring-agent | Code cleanup, technical debt, design patterns |

Selecting an agent

await engine.run('Audit src/ for SQL injection risks', { agentId: 'security-reviewer' });

Adding custom agents

Create ~/.bk-agent/agents/my-agent.json:

{
  "id":           "my-agent",
  "name":         "My Custom Agent",
  "systemPrompt": "You are specialized in ...",
  "tools":        ["read_file", "run_command"],
  "provider":     "anthropic"
}

Loaded automatically — no code changes needed.


Built-in tools

All agents have access to these tools via CODING_TOOLS:

| Tool | Description | |------|-------------| | read_file | Read a file by path | | write_file | Create or overwrite a file | | edit_file | Apply a targeted patch to a file | | list_directory | List files in a directory | | run_command | Execute a shell command | | search_files | Recursive content search | | save_context | Write to session.md (persisted notes) | | save_learning | Append to lecciones-aprendidas.md | | save_audit | Write a structured audit entry | | get_latest_audit | Read the latest audit | | list_audits | List audit entries | | save_user_preference | Persist user preferences | | update_session | Update the in-progress session note |


Skill packs

Built-in packs activate based on detected project stack:

| Pack | Activates for | |------|---------------| | GLOBAL_BUILTIN_SKILLS | All projects | | NODE_PACK_SKILLS | Node.js / TypeScript (package.json) | | GO_PACK_SKILLS | Go (go.mod) | | JAVA_PACK_SKILLS | Java (pom.xml, build.gradle) | | KOTLIN_PACK_SKILLS | Kotlin / Android | | PYTHON_PACK_SKILLS | Python (requirements.txt, pyproject.toml) |


Orchestration pipeline

When orchestration: true, an intelligent routing layer runs before each LLM call:

Input
  → Intent Detection (feature? bug? refactor? question?)
  → Domain Detection (backend? frontend? security? ops?)
  → Risk Scoring (reads only? writes files? runs commands?)
  → Policy Engine (enforce domain-level rules)
  → Agent Selection (best agent for detected domain + risk)
  → LLM Call
  → QA Review (auto-review code-heavy responses)

Custom orchestration

orchestration: {
  capabilityMatrix: {
    'my-specialist': {
      owns:       ['payments', 'billing'],
      skills:     ['typescript', 'stripe'],
      baseWeight: 0.95,
    },
  },
  customRules: [
    {
      if:   { domain: 'security' },
      then: { mustInclude: ['security-reviewer'] },
    },
  ],
  enableQA:   true,
  noQA:       false,
  onQAReview: (review) => logger.info('[QA]', review),
}

Reflection engine

Observes failures across runs, promotes recurring patterns into policy rules:

orchestration: {
  reflection: true,
  // After each sprint:
  // 1. Failures logged to FailureCatalog
  // 2. Patterns with ≥3 occurrences promoted to PolicyRules
  // 3. lecciones-aprendidas.md updated
}

MCP server integration

mcpServers: [
  {
    name:    'code-intelligence',
    command: 'bk-mcp',               // @backendkit-labs/mcp-server
    args:    [],
    env:     { BK_APP_NAME: 'bk-agent', BK_CWD: process.cwd() },
  },
  {
    name:    'github',
    command: 'npx',
    args:    ['-y', '@modelcontextprotocol/server-github'],
    env:     { GITHUB_TOKEN: process.env.GITHUB_TOKEN! },
  },
],
subAgentContextMessages: 20,

Multi-agent examples

Feature implementation

await engine.run(`
  Implement JWT authentication middleware for Express:
  - Validate Bearer token in Authorization header
  - Attach decoded user to req.user
  - Return 401 with clear error messages
  - Include unit tests with valid/expired/malformed token cases
`);
// architect plans → backend-agent implements → qa-engineer writes tests

Security audit

await engine.run(`
  Audit all routes in src/routes/ for:
  1. Missing auth middleware
  2. SQL injection vulnerabilities
  3. Exposed sensitive data
  Output a prioritized fix list.
`, { agentId: 'security-reviewer' });

Database migration

await engine.run(`
  Write a zero-downtime migration: add NOT NULL column 
  'last_login_at TIMESTAMP DEFAULT NOW()' to the users table (50M rows).
  Include rollback script and backfill strategy.
`, { agentId: 'database-agent' });

Full stack refactor

await engine.run(`
  Refactor auth from session cookies to JWT.
  Update both Express middleware and React login flow.
  Keep backward compatibility for 2 more sprints.
`);
// backend-agent + frontend-agent + security-reviewer

Config file

~/.bk-agent/config.json:

{
  "defaultProvider": "deepseek",
  "providers": {
    "deepseek": { "apiKey": "sk-xxxx", "model": "deepseek-chat" },
    "anthropic": { "apiKey": "sk-ant-xxxx", "model": "claude-sonnet-4-6" },
    "ollama":    { "host": "http://localhost:11434", "model": "llama3.2" }
  },
  "mcpServers": [
    {
      "name": "github",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "ghp_xxxx" }
    }
  ]
}