Skip to content

docs: add API response shapes across skills#10

Merged
alexanderatallah merged 4 commits into
mainfrom
alex/26-04-13/response-shapes
Apr 16, 2026
Merged

docs: add API response shapes across skills#10
alexanderatallah merged 4 commits into
mainfrom
alex/26-04-13/response-shapes

Conversation

@alexanderatallah
Copy link
Copy Markdown
Member

  • openrouter-models: document full model object (including canonical_slug, hugging_face_id, default_parameters, knowledge_cutoff, links), server-side query params (?category, ?supported_parameters), and raw endpoints API shape
  • openrouter-images: document Responses API request/response for image generation and editing (modalities, image_config, image_generation_call)
  • openrouter-oauth: add /auth/key and /credits response shapes, switch example from chat/completions to Responses API

- openrouter-models: document full model object (including canonical_slug,
  hugging_face_id, default_parameters, knowledge_cutoff, links), server-side
  query params (?category, ?supported_parameters), and raw endpoints API shape
- openrouter-images: document Responses API request/response for image
  generation and editing (modalities, image_config, image_generation_call)
- openrouter-oauth: add /auth/key and /credits response shapes, switch
  example from chat/completions to Responses API

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@perry-the-pr-reviewer perry-the-pr-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perry's Review

This PR documents raw OpenRouter API response shapes across three skills. The intent is good — agents need to know what fields exist — but the approach creates a structural problem: these skills already include scripts that abstract the API, and adding the raw wire format alongside them works against that design. Two concerns drive this review.

Verdict: 🔁 Needs changes

Comment thread skills/openrouter-models/SKILL.md
Comment thread skills/openrouter-models/SKILL.md Outdated
Comment thread skills/openrouter-oauth/SKILL.md Outdated
Comment thread skills/openrouter-oauth/SKILL.md
Comment thread skills/openrouter-images/SKILL.md
- openrouter-models: replace inline JSON examples with links to API
  reference docs for list-models, get-a-model, get-model-endpoints;
  keep query param table and non-obvious tips
- openrouter-images: remove request examples (script handles that),
  keep only image_generation_call output shape (non-obvious)
- openrouter-oauth: remove inline /auth/key and /credits shapes,
  add link to authentication API reference in Resources

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@perry-the-pr-reviewer perry-the-pr-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perry's Review — Update

This revision addresses the core feedback well. Raw JSON shapes are gone; the approach now links the live docs and keeps only the image_generation_call item shape inline — the right call for something genuinely non-obvious. The /auth/key and /credits shapes are replaced by a link. Good direction.

Two issues remain: several of the newly added doc links are 404s, and one sentence is a stale leftover.

Codex second opinion (openai/gpt-5.4): No additional findings.

Verdict: 🔁 Needs changes (two easy fixes)

Comment thread skills/openrouter-models/SKILL.md Outdated
Comment thread skills/openrouter-images/SKILL.md Outdated
Comment thread skills/openrouter-models/SKILL.md Outdated
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@perry-the-pr-reviewer perry-the-pr-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perry's Review (round 3)

The third commit is a good improvement — all five URLs now return 200 OK, and the previous blocker (broken links) is resolved. However, Codex surfaced a new blocker that's introduced by this exact commit: the ## API Response Shapes section in openrouter-images now documents the wrong API entirely. There are also two carry-over nits worth fixing.

Codex second opinion (openai/gpt-5.4): flagged the images API mismatch as a blocker, confirmed the sessionStorage timing issue (pre-existing, not in this diff), and caught a /auth/key vs /auth/keys description typo introduced in this commit.

Verdict: 🔁 Needs changes — one blocker introduced by this PR, two nits

Comment thread skills/openrouter-images/SKILL.md
Comment thread skills/openrouter-oauth/SKILL.md Outdated
Comment thread skills/openrouter-models/SKILL.md Outdated
- models: point direct API callers to OpenAPI spec instead of guide page
- oauth: fix auth reference description to match what the page covers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@alexanderatallah alexanderatallah merged commit 0ec6975 into main Apr 16, 2026
alexanderatallah added a commit that referenced this pull request Apr 18, 2026
* docs: add API response shapes across skills (#10)

* docs: add API response shapes across skills

- openrouter-models: document full model object (including canonical_slug,
  hugging_face_id, default_parameters, knowledge_cutoff, links), server-side
  query params (?category, ?supported_parameters), and raw endpoints API shape
- openrouter-images: document Responses API request/response for image
  generation and editing (modalities, image_config, image_generation_call)
- openrouter-oauth: add /auth/key and /credits response shapes, switch
  example from chat/completions to Responses API

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: address PR review — link to API docs instead of duplicating shapes

- openrouter-models: replace inline JSON examples with links to API
  reference docs for list-models, get-a-model, get-model-endpoints;
  keep query param table and non-obvious tips
- openrouter-images: remove request examples (script handles that),
  keep only image_generation_call output shape (non-obvious)
- openrouter-oauth: remove inline /auth/key and /credits shapes,
  add link to authentication API reference in Resources

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: use verified working URLs for API reference links

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: correct misleading link descriptions in models and oauth skills

- models: point direct API callers to OpenAPI spec instead of guide page
- oauth: fix auth reference description to match what the page covers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add { data } response wrapper shapes to models skill

Agents calling the API directly need to know the response is wrapped
in { data: ... } — without this, they write data.models instead of
data.data or json.data.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
alexanderatallah added a commit that referenced this pull request Apr 18, 2026
* docs: add API response shapes across skills

- openrouter-models: document full model object (including canonical_slug,
  hugging_face_id, default_parameters, knowledge_cutoff, links), server-side
  query params (?category, ?supported_parameters), and raw endpoints API shape
- openrouter-images: document Responses API request/response for image
  generation and editing (modalities, image_config, image_generation_call)
- openrouter-oauth: add /auth/key and /credits response shapes, switch
  example from chat/completions to Responses API

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: address PR review — link to API docs instead of duplicating shapes

- openrouter-models: replace inline JSON examples with links to API
  reference docs for list-models, get-a-model, get-model-endpoints;
  keep query param table and non-obvious tips
- openrouter-images: remove request examples (script handles that),
  keep only image_generation_call output shape (non-obvious)
- openrouter-oauth: remove inline /auth/key and /credits shapes,
  add link to authentication API reference in Resources

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: use verified working URLs for API reference links

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: correct misleading link descriptions in models and oauth skills

- models: point direct API callers to OpenAPI spec instead of guide page
- oauth: fix auth reference description to match what the page covers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add { data } wrapper shapes and OpenAPI spec link

- Add `{ data: Model[] }` wrapper note for GET /models
- Add `{ data: { id, name, endpoints: Endpoint[] } }` for endpoints
- Point direct API callers to OpenAPI spec for field names
- Note formatModel() drops fields; call API directly if needed

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* response shape wrappers (#26)

* docs: add API response shapes across skills (#10)

* docs: add API response shapes across skills

- openrouter-models: document full model object (including canonical_slug,
  hugging_face_id, default_parameters, knowledge_cutoff, links), server-side
  query params (?category, ?supported_parameters), and raw endpoints API shape
- openrouter-images: document Responses API request/response for image
  generation and editing (modalities, image_config, image_generation_call)
- openrouter-oauth: add /auth/key and /credits response shapes, switch
  example from chat/completions to Responses API

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: address PR review — link to API docs instead of duplicating shapes

- openrouter-models: replace inline JSON examples with links to API
  reference docs for list-models, get-a-model, get-model-endpoints;
  keep query param table and non-obvious tips
- openrouter-images: remove request examples (script handles that),
  keep only image_generation_call output shape (non-obvious)
- openrouter-oauth: remove inline /auth/key and /credits shapes,
  add link to authentication API reference in Resources

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: use verified working URLs for API reference links

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: correct misleading link descriptions in models and oauth skills

- models: point direct API callers to OpenAPI spec instead of guide page
- oauth: fix auth reference description to match what the page covers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add { data } response wrapper shapes to models skill

Agents calling the API directly need to know the response is wrapped
in { data: ... } — without this, they write data.models instead of
data.data or json.data.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add type: message to Responses API example in oauth skill

The Responses API structured array format requires type: "message"
on each input item per the OpenAPI spec.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
alexanderatallah added a commit that referenced this pull request Apr 23, 2026
* Help agents with Response shapes (#24)

* docs: add API response shapes across skills

- openrouter-models: document full model object (including canonical_slug,
  hugging_face_id, default_parameters, knowledge_cutoff, links), server-side
  query params (?category, ?supported_parameters), and raw endpoints API shape
- openrouter-images: document Responses API request/response for image
  generation and editing (modalities, image_config, image_generation_call)
- openrouter-oauth: add /auth/key and /credits response shapes, switch
  example from chat/completions to Responses API

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: address PR review — link to API docs instead of duplicating shapes

- openrouter-models: replace inline JSON examples with links to API
  reference docs for list-models, get-a-model, get-model-endpoints;
  keep query param table and non-obvious tips
- openrouter-images: remove request examples (script handles that),
  keep only image_generation_call output shape (non-obvious)
- openrouter-oauth: remove inline /auth/key and /credits shapes,
  add link to authentication API reference in Resources

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: use verified working URLs for API reference links

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: correct misleading link descriptions in models and oauth skills

- models: point direct API callers to OpenAPI spec instead of guide page
- oauth: fix auth reference description to match what the page covers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add { data } wrapper shapes and OpenAPI spec link

- Add `{ data: Model[] }` wrapper note for GET /models
- Add `{ data: { id, name, endpoints: Endpoint[] } }` for endpoints
- Point direct API callers to OpenAPI spec for field names
- Note formatModel() drops fields; call API directly if needed

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* response shape wrappers (#26)

* docs: add API response shapes across skills (#10)

* docs: add API response shapes across skills

- openrouter-models: document full model object (including canonical_slug,
  hugging_face_id, default_parameters, knowledge_cutoff, links), server-side
  query params (?category, ?supported_parameters), and raw endpoints API shape
- openrouter-images: document Responses API request/response for image
  generation and editing (modalities, image_config, image_generation_call)
- openrouter-oauth: add /auth/key and /credits response shapes, switch
  example from chat/completions to Responses API

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: address PR review — link to API docs instead of duplicating shapes

- openrouter-models: replace inline JSON examples with links to API
  reference docs for list-models, get-a-model, get-model-endpoints;
  keep query param table and non-obvious tips
- openrouter-images: remove request examples (script handles that),
  keep only image_generation_call output shape (non-obvious)
- openrouter-oauth: remove inline /auth/key and /credits shapes,
  add link to authentication API reference in Resources

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: use verified working URLs for API reference links

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: correct misleading link descriptions in models and oauth skills

- models: point direct API callers to OpenAPI spec instead of guide page
- oauth: fix auth reference description to match what the page covers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add { data } response wrapper shapes to models skill

Agents calling the API directly need to know the response is wrapped
in { data: ... } — without this, they write data.models instead of
data.data or json.data.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add type: message to Responses API example in oauth skill

The Responses API structured array format requires type: "message"
on each input item per the OpenAPI spec.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: replace generic system prompt with coding agent prompt

The default system prompt was "You are a helpful assistant with access
to tools" which caused the model to ask clarifying questions instead of
proactively using tools to explore the codebase.

New prompt instructs proactive tool use, injects CWD via {cwd}
placeholder, and sets behavioral guidelines drawn from Codex and Pi.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
alexanderatallah added a commit that referenced this pull request Apr 24, 2026
* feat: add building-agent-harness skill

New skill that generates a working minimal agent harness in TypeScript
using @openrouter/agent. Draws production patterns from pi-mono,
Claude Code, and Codex architectures.

Features an interactive tool checklist (server tools, file ops, shell,
grep, glob + optional modules like session persistence, compaction,
approval flow) and progressive disclosure via reference files to stay
under the 500-line SKILL.md best practice limit.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: address PR review — security, type safety, and integration fixes

- Restrict CORS to configurable origin (was wildcard)
- Add request body size limit (1MB) to prevent OOM
- Wrap JSON.parse calls in try/catch with descriptive errors
- Widen runAgent input type to string | unknown[] for session/compaction
- Fix session resume integration to pass message history to agent
- Fix compaction integration snippet to reference correct variables
- Validate env var numbers (NaN guard on maxSteps/maxCost)
- Fix .env reference in error message (no dotenv loader)
- Use glob npm package instead of Node 22+ fs.glob

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* feat: rename to agent-harness, add README and working sample

- Rename skill from building-agent-harness to agent-harness
- Add README with sections: what/when/customize/SDK coverage
- Add sample/ with complete working harness and clean TUI
- Remove ComeOnOliver/claude-code-analysis repo reference
- Add screenshot of the sample TUI

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* feat(agent-harness): add ASCII logo banner as optional config step

* feat(agent-harness): add showBanner field to AgentConfig

* feat(agent-harness): add src/banner.ts with OpenRouter ASCII logo

* feat(agent-harness): wire showBanner into cli.ts startup

* fix: remove all as any, use serverTool(), styled TUI, PR review fixes

- Use serverTool() for server tools — fully type-safe, no as any
- Use Item[] cast for chat messages — removes last as any
- Replace hardcoded package versions with npm install commands
- Styled TUI in SKILL.md: ANSI colors, banner, spinner, token display
- Customizable ASCII banner (asks for project name, not hardcoded)
- PR review fixes: CORS auth ordering, request validation, session
  error handling, requireApproval for dangerous-only, SSRF warning
- Bump sample to @openrouter/agent v0.4.0

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* feat: update sample banner to "My Harness" with block characters

- Replace OpenRouter ASCII art with "MY HARNESS" block-letter banner
- Enable showBanner by default in sample config
- Update screenshot

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* feat(agent-harness): rich TUI with tool-call display, /model command

- Replace onText callback with onEvent emitting AgentEvent union
  (text, tool_call, tool_result, reasoning) via getItemsStream()
- Show tool calls inline: ⚡ name arg=value / ✓ name (0.3s)
- Add dot spinner between inference rounds (re-enables after tool results)
- Add DisplayConfig (compact/verbose/hidden) for tool calls and results
- Add /model slash command to switch models via OpenRouter API mid-session
- Add TuiRenderer class in references/tui.md with per-tool colors/formatters
- Regenerate sample harness from skill spec with all new features

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* feat(agent-harness): slash commands, input features, styled prompt

- Add slash command registry with /model, /new, /help (ON by default)
  plus /compact, /session, /export (OFF, opt-in)
- Add harness modules: @-file references, ! shell shortcut, multi-line input
- Add styled input prompt with background color (inputStyle: styled|plain)
- Add showPrompt() with cwd display on second line for styled mode
- Refactor sample cli.ts to use command registry instead of inline /model
- Create references/slash-commands.md with registry pattern and command specs

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: replace generic system prompt with coding agent prompt (#27)

* Help agents with Response shapes (#24)

* docs: add API response shapes across skills

- openrouter-models: document full model object (including canonical_slug,
  hugging_face_id, default_parameters, knowledge_cutoff, links), server-side
  query params (?category, ?supported_parameters), and raw endpoints API shape
- openrouter-images: document Responses API request/response for image
  generation and editing (modalities, image_config, image_generation_call)
- openrouter-oauth: add /auth/key and /credits response shapes, switch
  example from chat/completions to Responses API

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: address PR review — link to API docs instead of duplicating shapes

- openrouter-models: replace inline JSON examples with links to API
  reference docs for list-models, get-a-model, get-model-endpoints;
  keep query param table and non-obvious tips
- openrouter-images: remove request examples (script handles that),
  keep only image_generation_call output shape (non-obvious)
- openrouter-oauth: remove inline /auth/key and /credits shapes,
  add link to authentication API reference in Resources

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: use verified working URLs for API reference links

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: correct misleading link descriptions in models and oauth skills

- models: point direct API callers to OpenAPI spec instead of guide page
- oauth: fix auth reference description to match what the page covers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add { data } wrapper shapes and OpenAPI spec link

- Add `{ data: Model[] }` wrapper note for GET /models
- Add `{ data: { id, name, endpoints: Endpoint[] } }` for endpoints
- Point direct API callers to OpenAPI spec for field names
- Note formatModel() drops fields; call API directly if needed

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* response shape wrappers (#26)

* docs: add API response shapes across skills (#10)

* docs: add API response shapes across skills

- openrouter-models: document full model object (including canonical_slug,
  hugging_face_id, default_parameters, knowledge_cutoff, links), server-side
  query params (?category, ?supported_parameters), and raw endpoints API shape
- openrouter-images: document Responses API request/response for image
  generation and editing (modalities, image_config, image_generation_call)
- openrouter-oauth: add /auth/key and /credits response shapes, switch
  example from chat/completions to Responses API

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: address PR review — link to API docs instead of duplicating shapes

- openrouter-models: replace inline JSON examples with links to API
  reference docs for list-models, get-a-model, get-model-endpoints;
  keep query param table and non-obvious tips
- openrouter-images: remove request examples (script handles that),
  keep only image_generation_call output shape (non-obvious)
- openrouter-oauth: remove inline /auth/key and /credits shapes,
  add link to authentication API reference in Resources

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: use verified working URLs for API reference links

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: correct misleading link descriptions in models and oauth skills

- models: point direct API callers to OpenAPI spec instead of guide page
- oauth: fix auth reference description to match what the page covers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add { data } response wrapper shapes to models skill

Agents calling the API directly need to know the response is wrapped
in { data: ... } — without this, they write data.models instead of
data.data or json.data.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: add type: message to Responses API example in oauth skill

The Responses API structured array format requires type: "message"
on each input item per the OpenAPI spec.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix: replace generic system prompt with coding agent prompt

The default system prompt was "You are a helpful assistant with access
to tools" which caused the model to ask clarifying questions instead of
proactively using tools to explore the codebase.

New prompt instructs proactive tool use, injects CWD via {cwd}
placeholder, and sets behavioral guidelines drawn from Codex and Pi.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

* feat(agent-harness): adaptive input box with raw mode, OSC 11 detection

- Replace readline with raw stdin for styled input mode — gives full
  control over the 3-line input box (top pad + prompt + bottom pad)
- Add terminal-bg.ts: detects terminal BG via OSC 11, alpha-blends
  white 12% (dark) or black 4% (light) for adaptive input BG color
- styledReadLine() redraws prompt in-place on each keystroke (no growth)
- Status line renders below input box on default BG after submit
- Remove cyan from assistant text (user messages distinguished by BG box)
- Add TUI test plan (test-tui.md) and Playwright test script
- Update references/tui.md with full styledReadLine and terminal-bg specs

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* chore(agent-harness): gitignore package-lock.json, clean up test artifacts

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix(agent-harness): re-add package-lock.json, remove from gitignore

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* feat(create-agent-tui): rename from agent-harness, add visual customization showcase

Rename skill from agent-harness to create-agent-tui (CAT) for better
discoverability — echoes the create-react-app pattern.

Revamp README to lead with visual showcase: tool display screenshots
(emoji, grouped, minimal), input style descriptions (block, bordered,
plain), and ASCII banner explanation. Move customization options above
the feature tables so the first thing you see is what you get.

Also includes parallel work: input styles reference (block/bordered/plain),
tool display reference (emoji/grouped/minimal/hidden with TuiRenderer),
demo script, Playwright screenshot automation, and trimmed tui.md.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* feat(create-agent-tui): visual customization, bug fixes, loader animations

Visual customization:
- Default toolDisplay changed from emoji to grouped
- Three loader animations: gradient (shimmer, default), spinner (braille),
  minimal (trailing dots) — configurable text and style
- Terminal markdown rendering: bold, inline code, headers, code blocks
- Input style and tool display screenshots (9 total)
- Visual Customization section in SKILL.md with "Other" option for each

CLI improvements:
- --banner, --model, --input, --tool-display flags
- name field in AgentConfig for banner customization
- Deep-merge config.display from file and overrides (fixes partial display bug)
- Default model changed to anthropic/claude-haiku-4.5

Bug fixes:
- /model crash: resume stdin before rl.question
- Block input backspace: redraw bottom padding on every keystroke
- Bordered input submit: keep bottom border visible
- Tool call ordering: emit on first sight, not just completed status

Docs:
- README: Quickstart section at top, all 9 screenshots, CLI usage examples
- references/loader.md: full loader animation reference
- test-tui.md: rewritten as agent-friendly guide with ttyd+Playwright pipeline
- Screenshot pipeline extended for input styles and loader animations

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix(create-agent-tui): retina-quality screenshots via deviceScaleFactor: 2

Screenshots were blurry at 1x resolution. Key changes:
- Set deviceScaleFactor: 2 for crisp retina PNGs
- Use headless: false (required for ttyd WebSocket rendering)
- Shrink viewport to 540x360 so content fills the frame
- Remove CSS injection — ttyd renders natively
- Fresh browser per screenshot to prevent state leaks
- Add demo-input.ts with async sleep delays for ttyd streaming
- Add input style screenshots (block, bordered, plain)

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* refactor(create-agent-tui): use real CLI for screenshots, add --demo flag

Replace 4 separate demo scripts with a --demo flag on the real CLI that
replays scripted events without calling the model. Screenshots now capture
the actual CLI experience — banner, input styles, tool displays, loaders —
all with retina quality (deviceScaleFactor: 2).

- Add --demo mode to cli.ts with scripted tool call + text replay
- Add --loader-style flag for loader customization
- Delete demo-tools.ts, demo-input.ts, demo-banner.ts, demo-loader.ts
- Simplify screenshot-demos.ts to just CLI flag combinations
- Regenerate all 10 screenshots at 2x retina quality
- Add banner.png screenshot to README hero position

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* fix(create-agent-tui): address PR review blockers

- grep.ts: err.status → err.code for ripgrep exit code detection
- grep.ts: add -- before pattern to prevent flag injection (--pre RCE)
- agent.ts: wrap JSON.parse(item.arguments) in try/catch for partial streaming args
- cli.ts: fall back to plain readline when stdin is not a TTY
- config.ts: add skipApiKey option so --demo works without OPENROUTER_API_KEY
- server-entry-points.md + modules.md: fix onText → onEvent callback
- package-lock.json: regenerate clean, remove phantom node-pty dep

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* chore(create-agent-tui): change default loader from gradient to spinner

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
Co-authored-by: perry-the-pr-maintainer[bot] <276291302+perry-the-pr-maintainer[bot]@users.noreply.github.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