Agent-first discovery: self-describing API for the agentic era#75
Merged
HamptonMakes merged 4 commits intomainfrom Apr 3, 2026
Merged
Agent-first discovery: self-describing API for the agentic era#75HamptonMakes merged 4 commits intomainfrom
HamptonMakes merged 4 commits intomainfrom
Conversation
- 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>
There was a problem hiding this comment.
💡 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>
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.
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 endpointX-Agent-Instructionsheader — on every response (web + API)EXAMPLE_SKILL.mdreduced from 317 lines to a 10-line pointerHow host apps customize
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.