Docs
Set up popcorn in a project, write the workflow it enforces, and look up any key of the workflow file.
Quick start
You need Claude Code and Node.js 20 or later.
Install the plugin
/plugin marketplace add l0ger/popcorn /plugin install popcorn@popcornTo install it for your whole team, add the marketplace and the plugin to your project's
.claude/settings.json, underextraKnownMarketplacesandenabledPlugins.Create the workflow file
/popcorn:initClaude copies the starter workflow to
.popcorn/workflow.yaml, finds your real test, lint and build commands, and suggests putting them in place of the placeholdernpm testgates.Start a run
/popcorn:start p1-user-login Users can sign in with email and passwordClaude gets a brief for the first phase. When a phase needs you, popcorn stops and says so:
popcorn approve # accept and continue popcorn reject cover password reset # send it back with feedback popcorn status # where is the run? popcorn retry [hint] # a phase ran out of attempts popcorn abort # end the runType these as your own prompt.
/popcorn:approve,/popcorn:rejectand the rest work too.
The workflow file
popcorn reads one file: .popcorn/workflow.yaml.
- It lives at the project root, the folder you open Claude Code in. The path is fixed: popcorn doesn't look anywhere else, and you can't rename it.
- You can write it yourself.
/popcorn:initis a shortcut, not a requirement. Create.popcorn/workflow.yamlby hand, or copy one from another repository. - Commit it. It's your team's process, reviewed and versioned like your code. Keep
.popcorn/runs/and.popcorn/outputs/out of git; init writes a.popcorn/.gitignorethat does this. - It's locked during a run. The agent can't edit it, and init refuses to replace it. Change it between runs.
- No folder, no popcorn. In a project without
.popcorn/, the hooks exit immediately and change nothing.
After every change, ask Claude to check the file. It lists every problem, not just the first:
popcorn validateThe plugin puts the popcorn command on Claude's shell path, so Claude can run it for you.
A full example
Five phases: a plan you approve, a test-first build, a test pass, two reviewers, and a deploy that waits for you. Copy it to .popcorn/workflow.yaml and change the gates to your own commands.
version: 1
name: my-team
description: Plan → Build → Test → Review → Deploy
policy:
# Never allowed, in any phase.
deny_shell: ["git push --force*", "git reset --hard*"]
# Allowed only in a phase that unlocks them (deploy, below).
guarded_shell: ["git push*", "git merge*"]
max_attempts_per_phase: 3
blocking_severities: [BLOCKER, CRITICAL, HIGH]
phases:
# 1. A user story you sign off before any code is written.
- id: plan
agent: product-manager
goal: Turn the request into a user story with acceptance criteria.
artifacts: ["docs/plans/{task}.md"] # must exist to finish the phase
approval: after # you approve the plan
allow: { edit: ["docs/**"] } # only docs can change here
# 2. Test-first implementation; the phase ends only when the tests pass.
- id: build
agent: implementer
goal: Implement the plan test-first, one commit per step.
gates: ["npm test"]
deny: { edit: ["docs/plans/**"] }
# 3. Edge cases and every check your CI runs.
- id: test
agent: test-engineer
goal: Add edge-case and error-path tests.
gates: ["npm test", "npm run lint"]
# 4. Two reviewers each file a JSON verdict; a HIGH finding goes back to build.
- id: review
goal: Get the change reviewed.
outputs: { schema: review, required: [code-reviewer, security-reviewer] }
on_fail: build
# 5. Push and merge, only after you approve.
- id: deploy
goal: Merge the branch and push it.
approval: before
allow: { guarded: ["git push*", "git merge*"] }
schemas:
review: { type: object, required: [verdict, findings] }What happens in a run:
- Plan. Only
docs/is editable. The phase ends whendocs/plans/p1-user-login.mdexists, then waits forpopcorn approve. - Build. The agent can't end its turn until
npm testpasses, and it can't rewrite the approved plan. - Test. The same, with lint added.
- Review. Both reviewers must file a verdict. A HIGH finding sends the run back to Build, findings attached.
- Deploy.
git pushandgit mergeare refused in every other phase. Here they unlock after you approve.
The starter workflow that init copies has seven phases and runs every change through a GitHub pull request.
Reference
At the top level: version: 1, a name, an optional description, apolicy, the ordered list of phases, and the schemas that outputs are checked against.
Phase keys
| Key | Meaning |
|---|---|
id, title, goal, instructions | What the phase is for. id and goal are required. {task} is replaced with the run's name. |
agent | The subagent that does the work. Leave it out and the main session does the phase. |
artifacts | Files that must exist before the phase is complete. |
gates | Shell commands that must exit 0 before the phase is complete. |
outputs | JSON results each listed agent must write, checked against schemas.<schema>. |
on_fail | The phase to go back to when an output has a blocking finding or verdict. |
approval | before: you approve the start. after: you approve the result. |
allow.edit, deny.edit | Globs of the paths the agent may, or may not, edit in this phase. |
allow.shell, deny.shell | Shell command patterns for this phase. |
allow.mcp | MCP servers this phase may use. Default: all of them. |
allow.guarded | Guarded commands and MCP tools this phase unlocks, after its before approval and/or its unlock_after phase. |
unlock_after | An earlier phase that must have passed first. If it has outputs, every reviewer must have said "verdict": "approve". |
next | Jump to a phase other than the next one in the list. |
Policy keys
| Key | Meaning |
|---|---|
deny_shell | Shell patterns that are never allowed, in any phase. |
guarded_shell | Shell patterns allowed only in a phase that lists them in allow.guarded. |
guarded_mcp | MCP tools, as <server>:<tool>, allowed only in a phase that unlocks them. |
protect_paths | Paths the agent may never edit during a run. |
max_attempts_per_phase | How often the agent may try to finish an incomplete phase before the run waits for you. |
blocking_severities | Finding severities that send the run back to on_fail. |
blocking_verdicts | Reviewer verdicts that send the run back, for example changes_requested. |
gate_timeout_seconds | How long one gate command may run. |
Agents
popcorn ships seven agents: product-manager, architect, implementer,test-engineer, code-reviewer, quality-reviewer andsecurity-reviewer.
An agent name in the workflow resolves to your project's .claude/agents/<name>.md if it exists, and to the plugin's agent otherwise. To use your own reviewer, add.claude/agents/code-reviewer.md. To add a new agent, create its file and name it in a phase.
MCP servers come from your project's normal .mcp.json; a phase can limit them withallow.mcp. For the pull request flow, seeGitHub pull requests in the README.
Files popcorn keeps
| Path | What it holds |
|---|---|
.popcorn/workflow.yaml | Your workflow. Commit it. |
.popcorn/.gitignore | Written by init. Keeps the run state below out of commits. |
.popcorn/runs/<task>/state.json | Where a run is: phase, round, attempts, approvals. |
.popcorn/outputs/<task>/ | The agents' JSON results, one folder per phase and round. |
.claude/agents/<name>.md | Optional. Your version of an agent, used instead of the plugin's. |