Skip to content

feat(cli): plan submit accepts JSON and YAML (D2) - #35

Merged
flg77 merged 1 commit into
mainfrom
feat/cli-plan-yaml
May 7, 2026
Merged

feat(cli): plan submit accepts JSON and YAML (D2)#35
flg77 merged 1 commit into
mainfrom
feat/cli-plan-yaml

Conversation

@flg77

@flg77 flg77 commented May 7, 2026

Copy link
Copy Markdown
Owner

Lets acc-cli plan submit accept both .json and .yaml/.yml plan files. Required for the runnable persona-cluster scenario (examples/coding_split_skills/). 7 tests pin both formats + the malformed-input contract.

acc-cli plan submit previously called json.loads() directly, which
rejected the YAML scenario plans documented under
examples/coding_split_skills/. YAML is the natural pair for the role.md
authoring format (PR #28); plan files should not require an
extra json-conversion step.

acc/cli/plan_cmd.py:
* New _parse_plan_text(raw, path_hint) helper.
* Files ending .yaml / .yml parse via PyYAML; YAML errors are loud
  (a yaml-extension file should always be valid YAML).
* Other paths attempt JSON first and fall back to YAML on
  JSONDecodeError so stdin can carry either dialect.
* PyYAML is already a project dep (used everywhere else in acc/);
  no new requirement.

7 new tests in tests/test_cli_plan_yaml.py:
* JSON plan parses (back-compat).
* YAML plan parses (.yaml + .yml extensions).
* Broken .yaml fails loudly with 'invalid YAML' in stderr.
* Stdin-style YAML body parses via JSON-fallback.
* Malformed input returns None with 'invalid JSON' diagnostic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant