Greenfield Generate
Greenfield Generate
Section titled “Greenfield Generate”Use this workflow when Topogram should realize an app map as generated app or runtime output.
Status: current Audience: developers and agents creating generated apps Use when: you want to start from a template or authored Topogram source and generate app/runtime outputs.
Use this workflow when Topogram should realize an app map as generated app or
runtime output. Generation is one Topogram workflow: the same topo/ map can
also guide maintained code, emit contracts, and give agents focused context.
Start with Init Workspace instead when you want an empty maintained Topogram workspace in an existing repo and do not want to copy a starter template.
1. Create a project
Section titled “1. Create a project”npm install --save-dev @topogram/clinpx topogram doctornpx topogram template listnpx topogram copy hello-web ./my-appcd ./my-appnpm installhello-web is the default small web starter. Other catalog aliases can include
API, database, or native runtimes.
For a blank maintained workspace:
npx topogram init ./existing-or-empty-repo --adopt-sdlccd ./existing-or-empty-repotopogram check --jsoninit writes topo/ and topogram.project.json only. It does not copy a
template, install generators, or generate app code. --adopt-sdlc also writes
topogram.sdlc-policy.json with adopted/enforced defaults.
2. Inspect the project
Section titled “2. Inspect the project”npm run agent:briefnpm run explainnpm run doctornpm run source:statusnpm run template:explainnpm run generator:policy:statusnpm run generator:policy:checknpm run query:listsource:status may report no pure Topogram source provenance for projects
created from templates. For template-created projects, template:explain,
template:status, and trust commands are the relevant template lifecycle
surfaces.
Read:
AGENTS.mdREADME.mdtopogram.project.jsontopo/**
3. Edit the source
Section titled “3. Edit the source”Edit topo/** for the model and topogram.project.json for topology,
ownership, ports, and generator bindings.
Do not treat app/** as durable source unless its output ownership is
maintained. Generated-owned outputs are replaceable.
4. Validate and generate
Section titled “4. Validate and generate”npm run checknpm run generatenpm run verifynpm run verify is the generated project’s strongest standard verification
script. If a generated app exposes lower-level app scripts, they remain useful
for focused debugging:
npm run app:compilenpm run app:runtime5. Inspect contracts when needed
Section titled “5. Inspect contracts when needed”topogram emit ui-widget-contract ./topo --jsontopogram emit widget-conformance-report ./topo --projection proj_web_surface --jsontopogram emit db-schema-snapshot ./topo --projection proj_db --jsonemit is read-only by default. Add --write --out-dir <dir> when you want
artifact files.
- Edit
topo/**ortopogram.project.json. - Run
topogram check. - Run focused widget/query/SDLC checks when relevant.
- Run
topogram generate. - Compile or run the generated output.