Part of making FlowSpec the universal spec substrate for the A(i)-Team execution stage (theaiteam-dev/the-ai-team-plugin#51, PRD 010): one immutable steps/expect grammar, per-surface adapters. Web exists (agent-browser). This issue: CLI surface.
Sketch
name: init-scaffolds-project
description: flowspec init creates config, sample spec, and protection hook
surface: cli
steps:
- run: "flowspec init --dir /tmp/fs-test"
expect:
- exit_code: 0
- stdout_contains: "flowspec.config.yaml"
- file_exists: /tmp/fs-test/flowspec.config.yaml
- file_exists: /tmp/fs-test/specs/example.flow.yaml
- file_contains:
path: /tmp/fs-test/.claude/settings.local.json
text: "PreToolUse"
Proposed verbs / assertions
| Steps |
Assertions |
run: "<cmd>" (cwd from config) |
exit_code: <n> |
stdin: "<text>" |
stdout_contains: / stdout_matches: (regex) |
env: {KEY: val} |
stderr_contains: / stderr_matches: |
timeout: <ms> per step |
file_exists: / file_contains: {path, text} |
|
json_output: {path: "$.foo", equals: ...} (parsed stdout) |
Design notes
surface: cli in the flow file selects the adapter; absent = web (backward compatible).
- Same parser/reporter/immutability hook — only the runner differs. Runner shells out with captured stdio; no browser dependency.
- Assertion retry/timeout semantics:
exit_code is final (no retry); file/output assertions could retry briefly for async writers.
- Sandbox/cwd per flow (tmp dir per run) so specs stay deterministic and parallelizable.
Why
Lets CLI-surface repos (this repo itself, ateam CLI, conduit CLI wrappers) graduate their Definition-of-Done into protected specs the same way web repos do — agents can't "fix" the spec instead of the bug on any surface.
Part of making FlowSpec the universal spec substrate for the A(i)-Team execution stage (theaiteam-dev/the-ai-team-plugin#51, PRD 010): one immutable
steps/expectgrammar, per-surface adapters. Web exists (agent-browser). This issue: CLI surface.Sketch
Proposed verbs / assertions
run: "<cmd>"(cwd from config)exit_code: <n>stdin: "<text>"stdout_contains:/stdout_matches:(regex)env: {KEY: val}stderr_contains:/stderr_matches:timeout: <ms>per stepfile_exists:/file_contains: {path, text}json_output: {path: "$.foo", equals: ...}(parsed stdout)Design notes
surface: cliin the flow file selects the adapter; absent =web(backward compatible).exit_codeis final (no retry); file/output assertions could retry briefly for async writers.Why
Lets CLI-surface repos (this repo itself, ateam CLI, conduit CLI wrappers) graduate their Definition-of-Done into protected specs the same way web repos do — agents can't "fix" the spec instead of the bug on any surface.