Step 08 · Scope layer · Scope layer · Forge and planf3: from prompt to scope ENPT
Alembic Complete Visual Course

Forge and planf3: from prompt to scope

Materialize a runnable scope from a vague idea using the 7-step Forge front-end.

Read the plain version, or open the technical layer on any section.
1

Rough idea → executable scope


@alembic/forge implements the 7-step Forge front-end: grill, research, prototype, PRD, issues, goal, review. Each step writes an artifact under the scope directory, culminating in GOAL.md, validation-contract.md, and alembic.plan.ts.

@alembic/planf3 turns a prompt into an HTML plan. It can use an LLM or fall back to a deterministic template. Forge can consume a planf3 artifact as its starting point.

Think of it like… an architect's sketch phase: interview the client, research precedents, build a foam model, write specs, list permits, finalize the contract, then review before breaking ground.

Under the hood

runForgeFrontEnd takes a prompt, scope directory, and offline/online flag. In online mode it routes prompts through a T2 adapter; in offline mode it uses deterministic templates. loadScope creates the durable run directory with a content-addressed runId derived from goal + contract + plan.

2

In one picture


prompt grill research prototype prd issues goal review scope dir
Forge walks a prompt through seven steps and writes a runnable scope directory.
3

In the code


# generate a plan
alembic plan "Add OAuth to the API"

# run the full Forge front-end
alembic forge "Add OAuth to the API" --offline

Implementation notes

runForgeFrontEnd delegates each step to a function in src/front-end/steps.ts. The default step registry is exported as DEFAULT_FORGE_STEPS, so advanced users can inject custom steps. Each step receives the scope directory and writes exactly one artifact.

4

Try it


Run alembic forge "Build a CLI command that lists files" --offline and inspect every file written to the scope directory.

Map: Which Forge artifact becomes the input to alembic run --goal ... --plan ...?
5

Quick check


How many steps are in the default Forge front-end?