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.

  1. Install the plugin

    /plugin marketplace add l0ger/popcorn
    /plugin install popcorn@popcorn

    To install it for your whole team, add the marketplace and the plugin to your project's.claude/settings.json, under extraKnownMarketplaces and enabledPlugins.

  2. Create the workflow file

    /popcorn:init

    Claude copies the starter workflow to .popcorn/workflow.yaml, finds your real test, lint and build commands, and suggests putting them in place of the placeholder npm test gates.

  3. Start a run

    /popcorn:start p1-user-login Users can sign in with email and password

    Claude 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 run

    Type these as your own prompt. /popcorn:approve, /popcorn:reject and 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:init is a shortcut, not a requirement. Create .popcorn/workflow.yaml by 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/.gitignore that 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 validate

The 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:

  1. Plan. Only docs/ is editable. The phase ends when docs/plans/p1-user-login.md exists, then waits for popcorn approve.
  2. Build. The agent can't end its turn until npm test passes, and it can't rewrite the approved plan.
  3. Test. The same, with lint added.
  4. Review. Both reviewers must file a verdict. A HIGH finding sends the run back to Build, findings attached.
  5. Deploy. git push and git merge are 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

KeyMeaning
id, title, goal, instructionsWhat the phase is for. id and goal are required. {task} is replaced with the run's name.
agentThe subagent that does the work. Leave it out and the main session does the phase.
artifactsFiles that must exist before the phase is complete.
gatesShell commands that must exit 0 before the phase is complete.
outputsJSON results each listed agent must write, checked against schemas.<schema>.
on_failThe phase to go back to when an output has a blocking finding or verdict.
approvalbefore: you approve the start. after: you approve the result.
allow.edit, deny.editGlobs of the paths the agent may, or may not, edit in this phase.
allow.shell, deny.shellShell command patterns for this phase.
allow.mcpMCP servers this phase may use. Default: all of them.
allow.guardedGuarded commands and MCP tools this phase unlocks, after its before approval and/or its unlock_after phase.
unlock_afterAn earlier phase that must have passed first. If it has outputs, every reviewer must have said "verdict": "approve".
nextJump to a phase other than the next one in the list.

Policy keys

KeyMeaning
deny_shellShell patterns that are never allowed, in any phase.
guarded_shellShell patterns allowed only in a phase that lists them in allow.guarded.
guarded_mcpMCP tools, as <server>:<tool>, allowed only in a phase that unlocks them.
protect_pathsPaths the agent may never edit during a run.
max_attempts_per_phaseHow often the agent may try to finish an incomplete phase before the run waits for you.
blocking_severitiesFinding severities that send the run back to on_fail.
blocking_verdictsReviewer verdicts that send the run back, for example changes_requested.
gate_timeout_secondsHow 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

PathWhat it holds
.popcorn/workflow.yamlYour workflow. Commit it.
.popcorn/.gitignoreWritten by init. Keeps the run state below out of commits.
.popcorn/runs/<task>/state.jsonWhere a run is: phase, round, attempts, approvals.
.popcorn/outputs/<task>/The agents' JSON results, one folder per phase and round.
.claude/agents/<name>.mdOptional. Your version of an agent, used instead of the plugin's.