Copy-paste Project Specifications for humans and agents. These fixtures are product surface (not optional docs): use them instead of inventing fields.
Authority: SPEC-FOUNDRY-002 (Sections 14–15 field contract, Appendix B canonical examples, Appendix D error ids). Do not invent product behavior outside that document.
See the User Guide for the full end-user walkthrough. This page is the quick agent/human workflow for these fixture files.
- Scaffold or copy a valid example (do not invent fields from memory):
foundry init --out ./my-cli.toml --name my-cli --module github.com/you/my-cli # or: cp examples/minimal-cli.toml ./my-cli.toml - Edit only what you need:
name,module(final path segment must equalname),description,destination(basename must equalname), and optionallyarchetype(cliortui). - Never invent profiles. Leave the default:
The only profile ID currently selectable is
profiles = []distribution(requiresvisibility = "public"and agithub.com/<owner>/<name>module — seeappendix-b-public-cli.toml).configurationandlocal-persistenceare not profile IDs — they failresolve.unknown_profile. After generate, owners add config or persistence by hand using the Section 21 recipes:docs/recipes/configuration.mdanddocs/recipes/local-persistence.md. - Validate (no project writes):
foundry validate --spec examples/minimal-cli.toml # or: foundry validate --spec path/to/your.toml - Plan — authoritative dry-run (text summary;
--output jsonfor the full plan). There is no separate--dry-runflag:foundry plan --spec examples/minimal-cli.toml foundry plan --spec examples/minimal-cli.toml --verbose foundry plan --spec examples/minimal-cli.toml --verify strict --output json
- Generate only after plan looks right (
git initonly — commit yourself):foundry generate --spec path/to/your.toml # optional: --dest <path> overrides destination (recorded in plan; generate owns project writes)
Build the binary from the repo root first:
CGO_ENABLED=0 go build -o foundry ./cmd/foundry.
| File | Role | Expected result |
|---|---|---|
minimal-cli.toml |
Fully valid private CLI | validate + plan + generate succeed |
minimal-tui.toml |
Fully valid private TUI | validate + plan + generate succeed |
appendix-b-private-cli.toml |
Appendix B private CLI (canonical) | validate + plan + generate succeed |
appendix-b-private-tui.toml |
Appendix B private TUI (canonical) | validate + plan + generate succeed |
appendix-b-public-cli.toml |
Appendix B public CLI + distribution |
validate + plan + generate succeed (visibility = "public", module is github.com/<owner>/<name>) |
invalid-unknown-field.toml |
Negative: unknown key | Exit 2, id spec.unknown_field |
invalid-bad-profile.toml |
Negative: non-profile / unimplemented ID | Exit 2, id resolve.unknown_profile |
invalid-bad-name.toml |
Negative: name rule | Exit 2, id spec.invalid_field |
Full per-id negative matrix for e2e lives under
cmd/foundry/testdata/specs/ (exported by
P1.2.c / go-foundry-cli-d0i).
| Fixture | Injected fault | Expected domain.reason |
|---|---|---|
invalid-unknown-field.toml |
top-level author |
spec.unknown_field |
invalid-bad-profile.toml |
profiles = ["configuration"] |
resolve.unknown_profile |
invalid-bad-name.toml |
name = "bad_name" (underscore) |
spec.invalid_field |
Comments at the top of each invalid file restate the expected id for e2e assertions (bead go-foundry-cli-5an.1 write-free testscripts consume these paths).
Required: schema (exactly 1), name, module, description, archetype,
destination.
Optional: binary (default name), visibility (private|public,
default private), profiles (default []), [git] init (default true),
[git] initial_branch (default "main").
Unknown fields and tables are fatal (spec.unknown_field). No secrets, no
env interpolation, no includes.
| Doc | Role |
|---|---|
| SPEC-FOUNDRY-002 | Implementation authority |
| docs/user-guide.md | End-user guide: install, commands, fields, errors |
| docs/dev/testing.md | Unit vs e2e, step logger, goldens, build tags |
| README.md | Repo quickstart (validate → plan → generate) |
| Configuration recipe | §21.1 post-generation guidance — not a profile ID |
| Local persistence recipe | §21.2 post-generation guidance — not a profile ID |
- go-foundry-cli-5an.1 — write-free e2e testscripts: valid CLI green; invalids assert exact error ids; TUI documents plan-or-exact-error.
- go-foundry-cli-6wj — validate/plan unit path may also load these fixtures.