Skip to content

Surface adapter: CLI — same grammar, terminal verbs #6

Description

@queso

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions