One command, `/wf` (`$wf` under Codex), the single SDLC entry point for Claude Code and Codex from one plugin tree. It drives 9 stages, from intake through…

A plugin that runs software work as a disciplined lifecycle. Every feature, fix, or spike moves through the same sequence of stages. Each stage writes a permanent, machine-readable record under .ai/workflows/<slug>/ in your repository, and the next stage reads it. The records are YAML files that scripts write: a stage agent writes a draft, and a script checks it and writes the record.
Every command, mode and setting is on one page: docs/commands.html. Open it in a browser. This file is the map.
One source tree serves three hosts. The skill prose is written once and is host-neutral; five contract files under skills/wf/reference/ hold everything a host does differently.
| Host | Reads | You type |
|---|---|---|
| Claude Code | .claude-plugin/plugin.json, hooks/hooks.json | /wf … |
| Codex | .codex-plugin/plugin.json, hooks/codex.hooks.json | $wf … |
| pi | pi/package.json, the pi package of this plugin | /skill:wf … |
All three hosts share the hooks and the .ai/ artifacts. A workflow started under one host resumes under another. /wf yolo runs on all three hosts. Codex selects the skills ($wf, $consult, $diataxis, $study-sources) only when you name them. The command page names each host difference.
The plugin needs Node.js 22 or newer and git. On Claude Code and Codex it has no dependencies to install. The pi package needs one npm install.
Claude Code: add the marketplace, then install the plugin, then start a new session.
/plugin marketplace add jayteealao/agent-skills
/plugin install sdlc-workflow@agent-skills-marketplace
Codex: codex features list must show plugins and hooks as true. Add the marketplace and the plugin:
codex plugin marketplace add https://github.com/jayteealao/agent-skills
codex plugin add sdlc-workflow@agent-skills-marketplace
Then open a Codex session and run /hooks. Trust all seven events (SessionStart, SubagentStart, PreToolUse, PermissionRequest, PostToolUse, Stop, SubagentStop). Codex skips an untrusted hook without an error. npm run verify:deployment, run from the installed plugin folder, reports the Codex state.
pi: clone this repo, install the dependencies of the pi package, and install the package from the clone. pi loads it where it is.
git clone https://github.com/jayteealao/agent-skills
cd agent-skills/plugins/sdlc-workflow/pi
npm install
pi install .
When pi still loads pi-unified or pi-sdlc, remove it with pi remove. These older packages register the same tools. npm run doctor, run from plugins/sdlc-workflow/, reports each host.
To confirm the install, type /wf with no arguments. It asks what you want to do.
The lifecycle has nine stages. Each stage writes its part of the workflow's records:
/wf intake <description> → intake.yaml: the brief and the shape
/wf design <slug> → design.yaml and the screens (only when the work changes screens)
/wf slice <slug> → slices.yaml: the slices
/wf plan <slug> [slice] → slice-<slice>.yaml: the plan
/wf implement <slug> → slice-<slice>.yaml: the build
/wf verify <slug> → slice-<slice>.yaml: the checks
/wf review <slug> → review.yaml
/wf ship <slug> → ship.yaml: the PR, the go/no-go gate and the merge
/wf retro <slug> → retro.yaml
state.yaml and meta.yaml hold the index of the workflow.
You can also type plain words: /wf keep going on export or /wf how do I ship a hotfix. /wf shows the command it would run and runs it after your yes. /wf status shows every workflow and the next command for each. /wf yolo <slug> drives the lifecycle on any host and stops before ship. For small work, /wf intake fix <description> runs a compressed entry; the command page lists the lanes.
When a workflow changes screens, /wf design draws each screen as an HTML page in .ai/design/ of your repo, with its five states. It checks the screens in a headless browser and records your approval as a commit. The folder is tracked in git.
scripts/wf.mjs design server start serves a canvas of every screen of every repo on this computer, on 127.0.0.1 and your tailnet. Open it on a phone to review the screens and comment on them. scripts/wf.mjs design migrate <repo> moves the design boards of an older workflow onto the surface, once per repo. skills/wf/reference/design/_surface.md lists every design command.
<!-- generated from skills/wf/keys.json by npm run generate; edit keys.json -->
| Key | Does |
|---|---|
intake | Entry dispatcher. A description starts stage 1: the brief and the shape (acceptance criteria, documentation plan, augmentations) in one run, or the small path that you choose: implement and verify now, one commit on the checked-out branch, one note; a mode (fix, rca, investigate, discover, audit, hotfix, refactor, update-deps, ideate, brainstorm, adopt, optimize, simplify, task) runs an entry flow. A slug plus amend, modernize or close edits, backfills or closes the workflow or one slice. brainstorm thinks an idea through with you until you say done; simplify runs three read-only reviewers; task is work whose deliverable is not a code change. |
shape | Alias of intake for this release: runs the shape phase on an existing workflow. |
design | Human-only design stage between intake and slice: the person approves the screens on the design surface before any driver runs. explore sketches ideas and settles nothing. Also keeps the project's design record (setup, teach, extract, direction, sync). |
slice | Decomposes the shape into shippable slices. |
plan | Per-slice plan with a reuse scan. |
implement | Codes the slice. reviews runs the fix-blockers mode. |
verify | Tests, lints, typecheck, the user-observable AC gate, one user-gated fix loop. |
review | Workflow review over an accumulating ledger; ad-hoc rubric or sweep <aggregate> without a slug. |
handoff | Alias of ship for this release: ship opens the PR first. |
ship | The last mile: the PR and CI, the go/no-go gate, then the merge and release via .ai/ship-plan.md; announce, rollback. |
retro | Post-mortem, per slug or per branch. |
probe | Runtime-truth verification of built work; sweep enumerates the user surface. |
yolo | Autonomous driver. Resolves each gate by written policy. |
campaign | Walks the ordered list of work packets that a brainstorm or an ideate pick wrote, one work packet at a time on one branch: slices and yolo-drives each work packet, reads its decision fidelity, and pauses for a try-out when the work packet can be tried. One PR per list, or stacked PRs per work packet. |
loop | Three loops. loop goal hands a slug to the host goal, and goal.mjs check decides that the goal is met. loop optimize changes the code toward one metric and keeps or reverts each trial. loop prototype proves an idea by running code in its own worktree, one round per request of the person. |
status | Dashboard; per-slug detail with the next command; deep drift check; advise sequencing. status recap is the plain-language catch-up for a slug or a branch. |
project | The project-level contracts: project ship-plan (init, build, edit, audit for .ai/ship-plan.md) and project observability (init, build, audit for .ai/observability.md). |
docs | Documentation router: the orchestrator pipeline, or one Diátaxis primitive. |
loop optimize has a gap on Codex and pi. <!-- end generated -->
Arguments and artifacts for each key are on the command page. The surface is frozen by docs/internal/SURFACE-POLICY.md; npm run verify:surface enforces the pins.
Hooks verify each managed artifact on write, stage it, and record the turn's exact token usage to .ai/workflows/<slug>/cost.jsonl. They never block a valid write. One setting in .ai/sdlc-config.json, checks, sets how the checks act: strict (the default) refuses a write that fails a gate, warn lets it stand with a warning, and off runs no check. The command page lists every setting.
One hook is a Claude Code mod: hooks/mod/register.ts, a function-hooks module with one job. The model cannot type the built-in /goal, so at the end of a /wf loop goal turn the mod puts the /goal line into the prompt box for your Enter; in the Desktop app it sends the line at once. It needs CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1. Without the flag the module does not load, and you paste the /goal line that /wf loop goal prints.
npm test # core tests, under 30 s; CI and the release run them
npm run test:integration # git, CLI and process tests, one file at a time, local only
npm run lint:drift # forms, links, settings and generated files against the source
npm run verify:docs # the command page lists the registry; this file's line and name rules
The hooks and scripts run from the source with Node 22 and no dependencies, so there is no build step and no npm install. When the keys change, update docs/commands.html, and republish its artifact from it.
Release steps are in docs/internal/RELEASE-DISCIPLINE.md. The change log is CHANGELOG.md.
hooks/mod/register.ts 148 lines1/**
2 * The goal arming as a Claude Code mod. It has one job.
3 *
4 * The model cannot type the built-in `/goal`. When the turn of
5 * `/wf loop goal <slug>` ends with an answer, the mod reads the arm request that
6 * `goal.mjs arm` wrote (`hooks/mod/goal.ts`). It puts the `/goal` line into the
7 * prompt box for the person's Enter. Where the surface draws its own prompt box
8 * (the Desktop app), it sends the line as the person's prompt. The request
9 * records how, so it is handed over once.
10 *
11 * Codex arms its goal with `create_goal`, and pi with the way that
12 * `goal.mjs arm` prints; neither runs this module.
13 */
14import type { On, PluginOptions } from 'claude-code'
15
16import { armHowOf, armRequestPathOf, armToastOf, armedRequestOf, findProjectRoot, goalSlugOf, pendingArmOf } from './goal.ts'
17
18/** The names the bare dispatcher command may resolve to at `command.run`. */
19const DISPATCHER_COMMANDS: readonly string[] = ['wf', 'sdlc-workflow:wf']
20/** How long a dispatcher run names the turn that follows it. */
21const LAST_RUN_WINDOW_MS = 10_000
22const FILL_REFUSED_TEXT = 'The prompt box is not free; type the command in full: '
23
24/** Every `$.noun.event` the mod calls after a dispatch is over, bound once at `session.start`. */
25type Host = {
26 exists: (path: string) => Promise<boolean>
27 read: (path: string) => Promise<string>
28 write: (path: string, text: string) => Promise<void>
29 fill: (text: string) => Promise<{ isFilled: boolean; refusal?: string }>
30 /** Queues `text` as the person's own prompt; it runs once the session is idle. */
31 submit: (text: string) => Promise<unknown>
32 toast: (text: string) => void
33 log: (text: string) => void
34 /** Runs `fn` once the current dispatch is over. */
35 later: (fn: () => void) => void
36 now: () => Promise<number>
37}
38
39export function register(on: On, _options: PluginOptions = {}) {
40 let host: Host | null = null
41 /** The directory holding `.ai/workflows`, or null when none. */
42 let root: string | null = null
43 /** The goal slug the dispatcher last ran, for a `turn.start` whose text is the expanded skill. */
44 let lastRun: { slug: string; at: number } | null = null
45 /** The goal slug of the main turn under way, or null. */
46 let turnSlug: string | null = null
47
48 on('session.start', async ($, e, next) => {
49 host = {
50 exists: path => $.fs.exists(path),
51 read: path => $.fs.read(path),
52 write: (path, text) => $.fs.write(path, text),
53 fill: text => $.prompt.fill({ text }),
54 submit: text => $.prompt.submit({ text, asUser: true }),
55 toast: text => $.ui.toast(text),
56 log: text => $.ui.log(text),
57 later: fn => {
58 $.clock.after(0, fn)
59 },
60 now: () => $.clock.now(),
61 }
62 root = null
63 lastRun = null
64 turnSlug = null
65 try {
66 root = await findProjectRoot(e.cwd, { read: path => $.fs.read(path), exists: path => $.fs.exists(path) })
67 } catch {
68 root = null
69 }
70 return next(e)
71 })
72
73 on('command.run', async ($, e, next) => {
74 if (DISPATCHER_COMMANDS.includes(e.command)) {
75 const slug = goalSlugOf(`/wf ${e.args}`)
76 lastRun = slug === null ? null : { slug, at: await $.clock.now() }
77 }
78 return next(e)
79 })
80
81 on('turn.start', async ($, e, next) => {
82 const result = await next(e)
83 const startedAt = await $.clock.now()
84 // The text of a slash-command turn may be the expanded skill; the
85 // dispatcher's own run, seconds before, names the command then.
86 turnSlug = goalSlugOf(e.text) ?? (lastRun !== null && startedAt - lastRun.at < LAST_RUN_WINDOW_MS ? lastRun.slug : null)
87 lastRun = null
88 return result
89 })
90
91 on('turn.complete', async ($, e, next) => {
92 const result = await next(e)
93 // A sub-agent raises `turn.complete` with its `agentId`. It is not the person's turn.
94 if (e.agentId !== undefined) return result
95 const slug = turnSlug
96 turnSlug = null
97 if (host !== null && root !== null && slug !== null && e.reason === 'answer') await armGoal(host, root, slug)
98 return result
99 })
100}
101
102/**
103 * Hands the `/goal` line of a pending arm request over, once the current
104 * dispatch is over, then records how and says it in a toast.
105 */
106async function armGoal(host: Host, root: string, slug: string): Promise<void> {
107 const path = armRequestPathOf(root, slug)
108 let text: string | null = null
109 try {
110 text = (await host.exists(path)) ? await host.read(path) : null
111 } catch (error) {
112 host.log(messageOf(error))
113 return
114 }
115 const request = pendingArmOf(text, slug)
116 if (request === null || request.command === null) return
117 const command = request.command
118 host.later(() => {
119 void (async () => {
120 let isFilled = false
121 let refusal: string | undefined
122 try {
123 const filled = await host.fill(`${command} `)
124 isFilled = filled.isFilled
125 refusal = filled.refusal
126 } catch (error) {
127 host.log(messageOf(error))
128 }
129 const how = armHowOf(isFilled, refusal)
130 if (how === 'submitted') {
131 // Not awaited: the prompt runs once the session is idle.
132 void host.submit(command).catch(error => host.log(`${FILL_REFUSED_TEXT}${command} (${messageOf(error)})`))
133 }
134 if (how === 'refused') host.log(`${FILL_REFUSED_TEXT}${command}`)
135 try {
136 await host.write(path, armedRequestOf(request, how, new Date(await host.now()).toISOString()))
137 } catch (error) {
138 host.log(messageOf(error))
139 }
140 host.toast(armToastOf(how))
141 })()
142 })
143}
144
145function messageOf(error: unknown): string {
146 return error instanceof Error ? error.message : String(error)
147}
148hooks/mod/goal.ts 127 lines1/**
2 * The goal arm action, its pure parts. `register.ts` calls them from its
3 * `turn.complete` hook.
4 *
5 * On Claude Code the model cannot type the built-in `/goal`. `goal.mjs arm` writes
6 * `.ai/workflows/<slug>/goal/arm.json` with the command and `state: pending`. When
7 * the turn of `/wf loop goal <slug>` ends, the mod reads that request and puts the
8 * command into the prompt box. Where the surface draws its own prompt box (the
9 * Desktop app), the fill is refused and the mod submits the command as the
10 * person's prompt instead. The request then records what happened, so a second
11 * turn never arms it twice.
12 */
13
14export type ArmRequest = {
15 slug: string
16 host: string
17 arming: number
18 condition: string
19 command: string | null
20 requestedAt: string
21 state: string
22}
23
24/** How the mod handed the command over: into the box, sent as a prompt, or neither. */
25export type ArmHow = 'filled' | 'submitted' | 'refused'
26
27/** The file reads the mod makes; the hooks module binds `$.fs`, a test binds a tree in memory. */
28export type Reader = {
29 read: (path: string) => Promise<string>
30 exists: (path: string) => Promise<boolean>
31}
32
33/** Claude Code accepts a condition of up to 4,000 characters. */
34export const GOAL_CONDITION_LIMIT = 4000
35
36const SLUG_PATTERN = /^[a-z0-9][a-z0-9-]*$/u
37
38export function joinPath(...parts: string[]): string {
39 return parts
40 .filter(part => part !== '')
41 .map((part, index) => (index === 0 ? part.replace(/[\\/]+$/u, '') : part.replace(/^[\\/]+|[\\/]+$/u, '')))
42 .join('/')
43}
44
45function parentOf(path: string): string | null {
46 const trimmed = path.replace(/[\\/]+$/u, '')
47 const cut = Math.max(trimmed.lastIndexOf('/'), trimmed.lastIndexOf('\\'))
48 if (cut <= 0) return null
49 const parent = trimmed.slice(0, cut)
50 // "C:" alone is not a directory the reader can list; stop at the drive root.
51 if (/^[A-Za-z]:$/u.test(parent)) return `${parent}/`
52 return parent
53}
54
55/**
56 * The nearest directory at or above `cwd` that holds `.ai/workflows`, or
57 * null when none does within 12 levels.
58 */
59export async function findProjectRoot(cwd: string, reader: Reader): Promise<string | null> {
60 let dir: string | null = cwd
61 for (let depth = 0; dir !== null && depth < 12; depth += 1) {
62 if (await reader.exists(joinPath(dir, '.ai', 'workflows'))) return dir
63 const parent = parentOf(dir)
64 if (parent === null || parent === dir) return null
65 dir = parent
66 }
67 return null
68}
69
70/**
71 * The slug of a `/wf loop goal <slug> ...` command, or null. The namespaced
72 * `/sdlc-workflow:wf` form parses the same way. A first word that is no slug
73 * gives null, so no path is built from it.
74 */
75export function goalSlugOf(text: string): string | null {
76 const match = /^\s*\/(?:sdlc-workflow:)?wf\s+loop\s+goal\s+(\S+)/u.exec(text)
77 if (match === null) return null
78 const slug = match[1] as string
79 return SLUG_PATTERN.test(slug) ? slug : null
80}
81
82export function armRequestPathOf(root: string, slug: string): string {
83 return joinPath(root, '.ai', 'workflows', slug, 'goal', 'arm.json')
84}
85
86/**
87 * The request the mod must act on, or null: a pending request of this slug, for
88 * Claude Code, whose command is a `/goal` line within the limit.
89 */
90export function pendingArmOf(text: string | null, slug: string): ArmRequest | null {
91 if (text === null || text.trim() === '') return null
92 let value: unknown
93 try {
94 value = JSON.parse(text)
95 } catch {
96 return null
97 }
98 if (!value || typeof value !== 'object') return null
99 const request = value as Partial<ArmRequest>
100 if (request.state !== 'pending' || request.slug !== slug || request.host !== 'claude-code') return null
101 if (typeof request.command !== 'string' || !request.command.startsWith('/goal ')) return null
102 if (typeof request.condition !== 'string' || request.condition.length > GOAL_CONDITION_LIMIT) return null
103 return request as ArmRequest
104}
105
106/** The request after the mod acted: the new state and when. */
107export function armedRequestOf(request: ArmRequest, how: ArmHow, at: string): string {
108 return `${JSON.stringify({ ...request, state: how, handledAt: at }, null, 2)}\n`
109}
110
111export function armToastOf(how: ArmHow): string {
112 if (how === 'submitted') return 'wf goal: the /goal command is sent. The host goal carries the loop; only goal.mjs check decides that it is met.'
113 if (how === 'filled') return 'wf goal: the /goal command is in the prompt box. Press Enter to arm the goal.'
114 return 'wf goal: the prompt box is not free. Paste the /goal line that /wf loop goal printed.'
115}
116
117/**
118 * How the hand-over goes, from the answer of `$.prompt.fill`. A surface that
119 * draws its own prompt box refuses every fill with `no_composer`; there the
120 * command goes out as the person's prompt.
121 */
122export function armHowOf(isFilled: boolean, refusal: string | undefined): ArmHow {
123 if (isFilled) return 'filled'
124 return refusal === 'no_composer' ? 'submitted' : 'refused'
125}
126
127