Quick Ref / Command

Engineer Kit

/ak:agentize

Wrap existing code as CLI and/or MCP

Converts an existing codebase, feature, or module into an agent-friendly CLI, MCP server, and companion skill with shared core logic, credential handling, tests, docs, CI, and release-ready packaging.

01

Track the plan

02

Scout the target

03

Build the map

04

Decide surfaces

Rule 01

Convert existing capability; do not use this to build a server from scratch or scaffold raw npm packages.

Rule 02

Design workflows for agents, not endpoint mirrors; use --detailed style opt-ins instead of bloated defaults.

Rule 03

One source of truth: shared core first, thin CLI and MCP adapters second.

Rule 04

Credential resolution, redaction, auth tests, docs, and CI are part of done, not polish.

Execution Map

Core lanes from input to output, aligned with the command's real execution path.

01

Start

Input, scope, route

  1. 1 Track the plan Create the dated plan directory, register phase tasks, store invocation mode and target, and resolve blockers before touching code.
  2. 2 Scout the target Use ak:scout to map entry points, capabilities, inputs, outputs, side effects, config, secrets, runtime, dependencies, and reusable tests.
02

Work

Agent / skill execution

  1. 3 Build the map Produce an Agentization Map ranking agent and CLI value for each candidate capability, and avoid wrapping every function just because it exists.
  2. 4 Decide surfaces Resolve --both, --mcp, or --cli, tool names, transports, deployment targets, and package metadata; ask the user only in --ask mode or when credentials are unclear.
03

Verify

Gate, review, validation

  1. 5 Extract shared core Keep core code free of CLI/MCP imports; expose plain functions so thin adapters can reuse one source of truth.
  2. 6 Wrap CLI and MCP Add scriptable CLI commands and MCP tools built on the official SDK with structured schemas, actionable errors, auth boundaries, and stdio/HTTP transport decisions.
04

Close

Report, handoff, artifact

  1. 7 Harden the package Invoke test, CI, docs, companion-skill, dependency audit, secret scan, redaction checks, MCP auth tests, and Docker non-root checks before handoff.
  2. 8 Handoff release Return repo path, package names, deployment docs, staged companion skill, decision record, and release checklist.

Syntax, arguments, subcommands

How to invoke the skill: syntax, positional arguments, shared options, then each subcommand with its own syntax and outcome.

Syntax

/ak:agentize [feature-or-module] [--both|--mcp|--cli] [--auto|--ask] [--ultra] [--advice] [--yagni]

Arguments

[feature-or-module] Required

Feature or module

Existing codebase, feature, module, or subtree to expose. Name the target behavior to wrap; this skill is not for building a brand-new MCP server or raw package scaffold.

/ak:agentize packages/payments --both --auto

Shared options

--both

CLI and MCP

Default output mode. Creates shared core logic plus CLI and MCP adapters from the existing capability.

/ak:agentize src/invoices --both
--mcp

MCP only

Build only the MCP surface while preserving a core boundary for future CLI work.

/ak:agentize "Expose report generation to agents" --mcp --ask
--cli

CLI only

Build only the command-line surface while preserving a core boundary for future MCP work.

/ak:agentize src/exporter --cli
--auto

Decide automatically

Default interaction mode. Analyzes, decides, and implements without routine questions; asks only when a credential choice cannot be inferred safely.

/ak:agentize packages/payments --auto
--ask

Ask before building

After analysis, pauses to challenge v1 scope, mutation boundaries, credentials, deployment target, package metadata, ownership, and any CLI replacement.

/ak:agentize src/invoices --both --ask
--ultra

Five decision candidates

Runs tracking and scouting once, then fans out only the analysis and decision phases to five read-only candidates before one verifier chooses the record to implement.

/ak:agentize src/exporter --cli --ultra
--advice

Advisory supervision

Adds advisory-only kongming checkpoints after scouting and analysis, before the decision record, before package handoff, and when stuck. Advice cannot edit code or skip gates.

/ak:agentize packages/payments --both --advice
--yagni

Cut unnecessary scope

Challenges capabilities that do not serve the stated outcome and passes the literal flag to downstream skills and delegated work.

/ak:agentize "Wrap the billing reconciliation module" --both --yagni

Composable flags

How options work together on one invocation. This does not replace the option cards above.

--auto is the default interaction mode;

--ask blocks for decision questions.

--ultra applies only to analysis/decision after scout.

--advice adds kongming supervision without bypassing gates.

--yagni allows cutting unnecessary scope.

Modes / Routes

--both

CLI + MCP monorepo

Research:
Default output mode
Review:
Shared core prevents drift
Validate:
CLI, MCP, docs, CI, skill all ship
--mcp

MCP only

Research:
Use when agent/tool surface is the value
Review:
Skip needless CLI packaging
Validate:
Tool schemas and transports verified
--cli

CLI only

Research:
Use when scriptable human shell UX is the value
Review:
Skip MCP if no agent value exists
Validate:
Argv, exit codes, JSON output verified
--ask

User-challenged decisions

Research:
After analysis, clarify v1 scope, mutability, credentials, target, package metadata
Review:
Challenges weak answers
Validate:
Decision record reflects explicit answers

Sample Prompt

Concrete invocations for each flag, subcommand, mode, or route available in the live workflow.

Default both surfaces Recommended
/ak:agentize packages/payments --both --auto
Use when:
Use when an existing module should become both an npm CLI and MCP server.
Expected:
Creates tracked work, scouts real behavior, records the selected commands/tools, extracts shared core logic, wraps CLI and MCP adapters, then hardens tests, docs, CI, security checks, and the companion skill before package handoff.
MCP with user decisions
/ak:agentize "Expose report generation to agents" --mcp --ask
Use when:
Use when mutating/read-only scope, deployment target, or credential source needs human choice.
Expected:
Runs the mandatory track and scout phases first, then blocks in Phase 3 for scope, mutation, credential, deployment, package, ownership, and replacement-CLI answers before implementing the MCP surface.
Ultra decision pass
/ak:agentize src/exporter --cli --ultra
Use when:
Use when capability selection and wrapper design deserve five independent decision records.
Expected:
Runs tracking and scouting once, fans only the Agentization Map and decision record to five read-only candidates, lets one verifier select a winning record unchanged, then implements the CLI package from that winner.
YAGNI cut
/ak:agentize "Wrap the billing reconciliation module" --both --yagni
Use when:
Use when the wrapper should challenge unneeded capabilities rather than expose the full requested surface.
Expected:
Scouts the module, builds an Agentization Map, challenges requested capabilities that do not serve the stated outcome, passes the literal --yagni flag downstream, and packages only the justified CLI/MCP surface.

Handled Scope

  • Track the plan
  • Scout the target
  • Build the map
  • Decide surfaces
  • Extract shared core
  • Wrap CLI and MCP

Related skills

Next