Scaffold AGENTS.md, .codex/skills/, and an optional .codex/config.toml MCP snippet for a new or existing project. Use at the start of a Codex CLI engagement to give the agent durable project memory.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-builder-codex:codex-initThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are scaffolding agent infrastructure for a Codex CLI project.
You are scaffolding agent infrastructure for a Codex CLI project.
Ask the user (one at a time) for:
Run the project-detection helper to fill in stack, runtime, services:
import { detectProject } from "./lib/detect-stack.mjs";
const detected = detectProject(process.cwd()); // { stack, runtime, services }
Build the discovery context:
import { render } from "./lib/render.mjs";
const ctx = {
purpose,
size,
qa_personas,
deploy_targets,
constraints,
...detected,
services_str: detected.services.join(", "),
agents: [
{ name: "planner", when: "all planning" },
{ name: "dev", when: "implementation" },
{ name: "reviewer", when: "final review" },
],
};
Render and write each template:
templates/AGENTS.md.hbs → AGENTS.md (project root)templates/skills/<role>/SKILL.md.hbs → .codex/skills/<role>/SKILL.md for each agent roleUse apply_patch for every file write. Refuse to overwrite existing files
unless the user passes --force.
Print a 3-line summary: detected stack, runtime (if any), and the roles scaffolded. Note that hooks/MCP wiring is out of scope for this MVP.
Ask the user (via ask_user or equivalent) whether to also emit
.codex/config.toml with hook and MCP stubs. If yes:
Prompt for MCP servers (optional, empty list OK). For each, capture
either { name, command, args } (stdio) or { name, url } (HTTP).
Build the mcp_servers_block as a TOML string:
const lines = [];
for (const s of mcp_servers) {
lines.push(`[mcp_servers.${s.name}]`);
if (s.command) {
lines.push(`command = ${JSON.stringify(s.command)}`);
lines.push(`args = ${JSON.stringify(s.args ?? [])}`);
} else if (s.url) {
lines.push(`url = ${JSON.stringify(s.url)}`);
}
lines.push("");
}
const mcp_servers_block = lines.join("\n");
Extend the ctx with defaults:
ctx.hook_command_pretool = "echo 'pre apply_patch'";
ctx.hook_command_sessionstart = "echo 'session start'";
ctx.mcp_servers_block = mcp_servers_block;
Render templates/codex-config.toml.hbs and write to .codex/config.toml
in the project root. Refuse to overwrite unless --force.
The hook commands are no-ops by default; users edit them.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub kim-song-jun/agent-skill --plugin harness-builder-codex