Documentation
¶
Overview ¶
atdd_commands.go wires the `gh optivem atdd …` subcommands into the root Cobra command. Two public commands mirror today's slash commands:
gh optivem atdd implement-ticket --issue N gh optivem atdd manage-project
The handlers are deliberately thin: they translate Cobra flags into internal/atdd/runtime/* calls and surface their errors via exitOnError (defined in runner_commands.go) for consistency with the rest of the `optivem` binary.
Process-flow / agent-prompt / per-node overrides are project-stable values, so they live in `gh-optivem.yaml` (process_flow:, agent_prompts:, node_extras:, node_replacements:) — not on flags. The cobra layer loads the config once per run, reads those fields, and threads them into driver.Options.
atdd_init.go provides the thin wrapper that lets `runInit`'s buildSteps call `atdd.Install` as a phase step. There is no standalone `gh optivem atdd install` subcommand — ATDD assets are installed only as part of `gh optivem init`. To refresh ATDD assets in an existing repo, re-run `gh optivem init` (or copy the assets from a fresh shop checkout by hand).
compile_commands.go wires the bare `gh optivem compile` verb and the tier-level helpers (compileSystem, compileSystemTests, monolithTier, loadProjectConfigOrExit) shared with the noun-scoped forms (`gh optivem system compile` in system_commands.go and `gh optivem test compile` in test_commands.go).
Naming: `compile` is source-level build (dotnet build / gradlew compileJava / npx tsc). `build` is reserved for `docker compose build` (system_commands.go, under the `system` noun). The two are distinct enough to coexist; they must not be conflated.
`compile` stays a bare verb (no parent noun) because it spans tiers — the bare form runs `system compile` then `test compile` in sequence, halting on first failure. This shortcut is the dominant use case (the structural-cycle compile_all action shells out to it as a single command). Same category as `gh browse` / `gh status` in gh's own surface: cross-resource, no single noun to slot under. The noun-scoped forms stay available for scoped local use.
compile_summary.go collects per-tier outcomes during a `gh optivem compile` run and prints a compact tail summary, so the user can scan success/failure without scrolling the (often long) compile output.
One row per `compiler.Compile` call (i.e. per tier). Per-command timing inside the compiler package is deliberately not threaded through — the compile_commands.go level is the right granularity, and keeping the `compiler` package's `error`-only API intact preserves its testable seam.
config_commands.go wires the `gh optivem config …` subcommands into the root Cobra command. The `config` namespace owns operations that read or write gh-optivem.yaml — the central per-project config file produced by `gh optivem init` and consumed by `gh optivem atdd implement-ticket`.
gh optivem config init — write a fresh gh-optivem.yaml from CLI flags gh optivem config validate — parse <CWD>/gh-optivem.yaml and validate it gh optivem config preflight — validate + check on-disk layout exists
`config init` reuses the same render path as `gh optivem init` (steps.WriteOptivemYAMLToPath / config.ValidateAndDeriveForYAML) so a new YAML-affecting flag flows to both surfaces with no per-command duplication.
environment_commands.go wires the `gh optivem environment <verb>` subtree. The `environment` noun owns operations on the real-world environment variables gh-optivem consumes — credentials and other inputs alike (e.g. DOCKERHUB_USERNAME is an account name, not a token, but is still required from the environment). Today the only verb is `verify`; future verbs (e.g. `environment list` to show which env vars are configured) would slot in as siblings.
gh optivem environment verify — live auth-check every credential the CLI
consumes from the environment, returning
non-zero on any missing or rejected value.
Designed to be invoked from a CI preflight job so a single broken input surfaces once, before a scaffolding matrix fans out and burns runner minutes failing the same way N times.
gh-optivem: A gh CLI extension for pipeline project management.
Usage:
Monolith:
gh optivem init --owner acme --system-name "Page Turner" --repo page-turner \
--arch monolith --monolith-lang java
Multitier:
gh optivem init --owner acme --system-name "Page Turner" --repo page-turner \
--arch multitier --backend-lang java --frontend-lang typescript
Dry run:
gh optivem init ... --dry-run
preflight_helpers.go builds the wired-up preflight.Options the cobra layer passes to preflight.Run. Both `gh optivem atdd implement-ticket` and `gh optivem config preflight` go through this helper so the two surfaces share one definition of "what real remote checks does preflight run" — adding or removing a remote check class touches one place, not two.
Token requirements:
- GitHub: relies on whatever auth `gh` CLI is already configured with (`gh auth login` or $GH_TOKEN / $GITHUB_TOKEN). No extra plumbing.
- SonarCloud: requires $SONAR_TOKEN whenever cfg.Sonar.Organization is set. Missing token is a hard error so preflight never silently skips a check class the operator's config implies should run.
runner_helpers.go holds the cross-cutting helpers used by the runner-tier commands. The command wiring itself lives in `system_commands.go` and `test_commands.go` — split per the noun-first surface (`gh optivem system <verb>` / `gh optivem test <verb>`). The runner package is fully agnostic — these helpers translate Cobra flags into runner.* calls and resolve config paths against gh-optivem.yaml.
Working-dir contract: each command operates against the user's current working directory. A gh-optivem.yaml is required; its system.config: / system_test.config: fields drive path resolution. An alternate gh-optivem.yaml can be selected via --config / -c.
system_commands.go wires the `gh optivem system <verb>` subtree. The system noun spans the lifecycle verbs that operate on the scaffolded project's running containers (build, start, stop, clean) plus the source-level system tier compile.
Working-dir contract: every command runs against the user's cwd and reads the systems config path from gh-optivem.yaml's system.config: field (legacy `.json` files still resolve via the loader's extension dispatch). An alternate gh-optivem.yaml can be selected via --config / -c. Missing gh-optivem.yaml or empty system.config: are hard errors. Helpers live in runner_helpers.go.
test_commands.go wires the `gh optivem test <verb>` subtree. The test noun owns the test-tier lifecycle verbs: `run` against an already-running system, `setup` for harness preparation, and `compile` for the test-tier source build.
Working-dir contract: every command runs against the user's cwd and reads the tests config path from gh-optivem.yaml's system_test.config: field (legacy `.json` files still resolve via the loader's extension dispatch). An alternate gh-optivem.yaml can be selected via --config / -c. Missing gh-optivem.yaml or empty system_test.config: are hard errors. Helpers live in runner_helpers.go.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
atdd
Package atdd installs ATDD (Acceptance-Test-Driven Development) Claude assets — agents, commands, and prompt docs — from a shop checkout into a scaffolded project.
|
Package atdd installs ATDD (Acceptance-Test-Driven Development) Claude assets — agents, commands, and prompt docs — from a shop checkout into a scaffolded project. |
|
atdd/runtime/actions
Bindings — Go implementations of every service-task `action:` referenced in docs/atdd/process/process-flow.yaml.
|
Bindings — Go implementations of every service-task `action:` referenced in docs/atdd/process/process-flow.yaml. |
|
atdd/runtime/agents
Package agents holds the user-task agent-dispatch registry.
|
Package agents holds the user-task agent-dispatch registry. |
|
atdd/runtime/board
Package board owns the GitHub Project board interactions for the ATDD pipeline driver.
|
Package board owns the GitHub Project board interactions for the ATDD pipeline driver. |
|
atdd/runtime/classify
Package classify is the fast-path ticket classifier for the ATDD pipeline driver.
|
Package classify is the fast-path ticket classifier for the ATDD pipeline driver. |
|
atdd/runtime/clauderun
Package clauderun shells out to the `claude` CLI to dispatch a named ATDD agent for the current phase, replacing v1's "pause and let the operator launch the agent in a second window" workflow.
|
Package clauderun shells out to the `claude` CLI to dispatch a named ATDD agent for the current phase, replacing v1's "pause and let the operator launch the agent in a second window" workflow. |
|
atdd/runtime/diagram
Package diagram renders the canonical Mermaid markdown for the ATDD process flow.
|
Package diagram renders the canonical Mermaid markdown for the ATDD process flow. |
|
atdd/runtime/driver
Package driver wires together the ATDD pipeline runtime: it loads the process-flow YAML, registers gates / actions / agents, applies override and verify decorators, and walks the named process end to end.
|
Package driver wires together the ATDD pipeline runtime: it loads the process-flow YAML, registers gates / actions / agents, applies override and verify decorators, and walks the named process end to end. |
|
atdd/runtime/gates
Bindings — Go implementations of every gateway `binding:` referenced in docs/atdd/process/process-flow.yaml.
|
Bindings — Go implementations of every gateway `binding:` referenced in docs/atdd/process/process-flow.yaml. |
|
atdd/runtime/intake
Package intake holds the deterministic markdown parser that replaces the four LLM-driven intake agents (atdd-story / atdd-bug / atdd-task / atdd-chore).
|
Package intake holds the deterministic markdown parser that replaces the four LLM-driven intake agents (atdd-story / atdd-bug / atdd-task / atdd-chore). |
|
atdd/runtime/override
Package override implements the per-step override-hook decorator.
|
Package override implements the per-step override-hook decorator. |
|
atdd/runtime/preflight
Package preflight validates that the consumer's gh-optivem.yaml maps onto a real on-disk layout and a real remote setup before any ATDD agent or board work runs.
|
Package preflight validates that the consumer's gh-optivem.yaml maps onto a real on-disk layout and a real remote setup before any ATDD agent or board work runs. |
|
atdd/runtime/release
Package release owns the end-of-cycle release mechanics for the ATDD pipeline driver: regex-remove `@Disabled`-style markers from in-scope test files, commit, and close the GitHub issue.
|
Package release owns the end-of-cycle release mechanics for the ATDD pipeline driver: regex-remove `@Disabled`-style markers from in-scope test files, commit, and close the GitHub issue. |
|
atdd/runtime/repolocator
Package repolocator turns a parsed projectconfig.Config into a map from repo slug → absolute local clone path.
|
Package repolocator turns a parsed projectconfig.Config into a map from repo slug → absolute local clone path. |
|
atdd/runtime/statemachine
Embed binds the canonical process-flow document into the statemachine package binary.
|
Embed binds the canonical process-flow document into the statemachine package binary. |
|
atdd/runtime/testselect
Package testselect computes the minimal-but-safe set of acceptance and contract tests to run after a driver-adapter change.
|
Package testselect computes the minimal-but-safe set of acceptance and contract tests to run after a driver-adapter change. |
|
atdd/runtime/trace
Package trace adds a per-node logging decorator to the engine, producing a chronological audit trail of every step the ATDD pipeline takes:
|
Package trace adds a per-node logging decorator to the engine, producing a chronological audit trail of every step the ATDD pipeline takes: |
|
atdd/runtime/verify
Bindings — per-node pre/post-condition checks.
|
Bindings — per-node pre/post-condition checks. |
|
compiler
Package compiler runs source-level compile sequences for one tier of a scaffolded project, dispatching by language.
|
Package compiler runs source-level compile sequences for one tier of a scaffolded project, dispatching by language. |
|
config
Package config provides CLI parsing, validation, and the Config struct.
|
Package config provides CLI parsing, validation, and the Config struct. |
|
configinit
Package configinit owns the shared "write a fresh gh-optivem.yaml" code path.
|
Package configinit owns the shared "write a fresh gh-optivem.yaml" code path. |
|
files
Package files provides file manipulation helpers: replace, rename, walk.
|
Package files provides file manipulation helpers: replace, rename, walk. |
|
log
Package log provides colored logging helpers.
|
Package log provides colored logging helpers. |
|
pathx
Package pathx contains small cross-platform path helpers shared across packages that exec subprocesses.
|
Package pathx contains small cross-platform path helpers shared across packages that exec subprocesses. |
|
projectconfig
Package projectconfig loads the consumer repo's per-project configuration file at gh-optivem.yaml (project root).
|
Package projectconfig loads the consumer repo's per-project configuration file at gh-optivem.yaml (project root). |
|
promptio
Package promptio centralises every human y/n decision the CLI surfaces.
|
Package promptio centralises every human y/n decision the CLI surfaces. |
|
runner
Package runner orchestrates docker-compose-backed system tests using two YAML config files (with legacy JSON fallback): a systems.yaml (compose + health probes) and a tests.yaml (setup commands + suites).
|
Package runner orchestrates docker-compose-backed system tests using two YAML config files (with legacy JSON fallback): a systems.yaml (compose + health probes) and a tests.yaml (setup commands + suites). |
|
shell
Package shell provides GitHub CLI wrapper and subprocess helpers.
|
Package shell provides GitHub CLI wrapper and subprocess helpers. |
|
spinner
Package spinner shows an animated liveness indicator for long-running waits where the duration is unknown.
|
Package spinner shows an animated liveness indicator for long-running waits where the duration is unknown. |
|
steps
Package steps implements the scaffold pipeline steps.
|
Package steps implements the scaffold pipeline steps. |
|
templates
Package templates provides template helpers: copy workflows, fixups.
|
Package templates provides template helpers: copy workflows, fixups. |
|
version
Package version provides build-time version information.
|
Package version provides build-time version information. |