Skip to content

Agent-first discovery: self-describing API for the agentic era#75

Merged
HamptonMakes merged 4 commits intomainfrom
agent-first-discovery
Apr 3, 2026
Merged

Agent-first discovery: self-describing API for the agentic era#75
HamptonMakes merged 4 commits intomainfrom
agent-first-discovery

Conversation

@HamptonMakes
Copy link
Copy Markdown
Collaborator

What

Make CoPlan self-describing so agents can discover and use the API without installing skills or reading static docs.

Features

  • /agent-instructions — live API reference served as markdown, always current, with configurable auth section and curl prefix per host app
  • /llms.txt — standard discovery endpoint
  • User-agent detection — non-browser clients hitting any web URL get helpful markdown pointing to the API instead of a login redirect
  • X-Agent-Instructions header — on every response (web + API)
  • Onboarding banner — thin full-width bar for new users: "Give your agent these instructions"
  • Thin skillEXAMPLE_SKILL.md reduced from 317 lines to a 10-line pointer

How host apps customize

CoPlan.configure do |c|
  c.agent_curl_prefix = 'sq curl -s'  # default: 'curl -s -H "Authorization: Bearer $TOKEN"'
  c.agent_auth_instructions = <<~MD
    ## Authentication
    All requests use \`sq curl\` which handles BeyondCorp auth automatically.
  MD
  c.onboarding_banner = 'Custom banner HTML or nil to disable'
end

The idea

Any URL an agent touches should guide it to the right interface. No SDK installs, no stale docs, no setup. See the full plan.

Tests

All 508 non-system tests pass. 4 new tests for onboarding banner behavior.

HamptonMakes and others added 3 commits April 2, 2026 13:15
- Remove 'Plans' and 'Settings' text links from header nav (logo
  already navigates to plans list)
- Add gear icon next to notification bell for settings access
- Auto-detect whether to show API tokens UI based on whether
  api_authenticate is configured (host apps with custom API auth
  don't need the built-in token management)
- Guard token create/destroy actions when API tokens are hidden
- Settings page always accessible via gear icon for future settings

Amp-Thread-ID: https://ampcode.com/threads/T-019d4f5f-cf0c-71f3-bf4a-9506350ad128
Co-authored-by: Amp <amp@ampcode.com>
- Add Settings::SettingsController with index action and view
- Extract API tokens into a _tokens partial rendered on settings index
- Gear icon links to /settings instead of /settings/tokens
- Fix gear/bell vertical alignment (add inline-flex to inbox-dropdown,
  line-height: normal to icon-link)

Amp-Thread-ID: https://ampcode.com/threads/T-019d4f5f-cf0c-71f3-bf4a-9506350ad128
Co-authored-by: Amp <amp@ampcode.com>
Make CoPlan self-describing so agents can discover and use the API
without installing skills or reading static docs.

Features:
- /agent-instructions endpoint serving live API docs as markdown,
  with configurable auth section (agent_auth_instructions) and
  curl prefix (agent_curl_prefix) per host app
- /llms.txt endpoint following the llms.txt standard
- User-agent detection: non-browser clients hitting web UI URLs get
  helpful markdown pointing to /agent-instructions instead of a
  login redirect
- X-Agent-Instructions response header on all responses (web + API)
- Onboarding banner for new users linking to agent instructions
- Plan status lifecycle documentation in agent instructions
- EXAMPLE_SKILL.md reduced to a thin pointer to /agent-instructions

Configuration (host app initializer):
  config.agent_curl_prefix = 'sq curl -s'
  config.agent_auth_instructions = '## Auth\n\nUse sq curl...'
  config.onboarding_banner = 'Custom banner HTML'

Amp-Thread-ID: https://ampcode.com/threads/T-019d4ffd-9cbb-7626-aeba-9e03685aa4dc
Co-authored-by: Amp <amp@ampcode.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 287eb20deb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Fixes mount-prefix issue: when engine is mounted at /coplan,
the header and agent redirect now correctly resolve to
/coplan/agent-instructions instead of /agent-instructions.

Amp-Thread-ID: https://ampcode.com/threads/T-019d4ffd-9cbb-7626-aeba-9e03685aa4dc
Co-authored-by: Amp <amp@ampcode.com>
@HamptonMakes HamptonMakes merged commit 230d8c9 into main Apr 3, 2026
3 of 4 checks passed
@HamptonMakes HamptonMakes deleted the agent-first-discovery branch April 3, 2026 17:37
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