feat(cli): --json output + updated skills that use jq - #42
Merged
Merged
Conversation
…phans / validate / show
Adds a global `--json` flag that switches every scan-affecting command to
emit structured JSON on stdout. Skills and any jq-driven consumer can
extract fields directly instead of scraping ASCII tables / bullet lists.
- `amos milestones --json` → `{"focus": ..., "milestones": [{title, open, ready, done, focused}, ...]}`
- `amos next|blocked|orphans --json` → `{"focus": ..., "count": N, "nodes": [{name, issue_number, description, blocked_by, blocks, related_to, milestone, facts, labels_local}, ...]}`
- `amos focus --json` → `{"focus": "<title>" | null}`, optionally with `action: "set"|"cleared"`
- `amos validate --json` → `{"ok": bool, "node_count": N, "issues": [{kind, ...}, ...]}`, non-zero exit if issues
- `amos show <node> --json` → full node including body, facts, relationships
Human-readable output paths are unchanged when `--json` is absent. Status-
mutation commands (done/start/reset) still print their human-readable
confirmation.
Updates the `amos-focus` and `amos-next` skills to consume the JSON
output via jq, and instructs the agent to craft English summaries for the
user rather than echoing raw JSON. The protocol in amos-next still owns
branching, testing, PR creation — it just gets cleaner input now.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a global `--json` flag so skills (and any jq-driven consumer) can extract fields directly instead of parsing ASCII. Also rewrites the two skills that consume output (`amos-focus`, `amos-next`) to use `jq` and craft natural-language summaries rather than piping raw CLI text back to the user.
JSON shapes
Human-readable output paths are unchanged when the flag is absent — existing tooling keeps working.
Why
Skills had to scrape lines like `- @github:org/repo#347 — Research: DMA-BUF...` to find issue numbers and descriptions. Brittle and slow. Now:
```bash
amos next --json | jq -r '.nodes[] | "(.name)\t(.description)"'
```
Skill updates
Test plan
🤖 Generated with Claude Code