Skip to content

feat(skill): add OAuth-first setup, slim SKILL.md via progressive disclosure#62

Merged
lxcong merged 4 commits into
mainfrom
refactor/slim-agentkey-skill
Jun 29, 2026
Merged

feat(skill): add OAuth-first setup, slim SKILL.md via progressive disclosure#62
lxcong merged 4 commits into
mainfrom
refactor/slim-agentkey-skill

Conversation

@lxcong

@lxcong lxcong commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What

Two changes to the AgentKey skill, on top of one another:

1. Slim SKILL.md via progressive disclosure

The high-frequency Query path stays in SKILL.md; the rarely-executed upgrade machinery moves to references that load only when needed.

  • SKILL.md: 317 → ~127 lines. Step 0 collapses from ~165 lines of inline version-check / upgrade / telemetry logic to a ~12-line preflight stub.
  • New references/maintenance.md — the full upgrade flow: beacon protocol contract, 4-option upgrade prompt (With-Bash / No-Bash branches), snooze + auto-upgrade persistence, error_class mapping, and all upgrade_decision / upgrade_result telemetry. Loads only on a version-mismatch signal.

2. OAuth-first Setup flow

Now that the hosted MCP server supports native MCP OAuth, the Setup flow prefers OAuth and only falls back to an API key when needed:

  • SKILL.md Setup section rewritten — try OAuth first (register the remote URL https://api.agentkey.app/v1/mcp with no key and let the client run its own browser OAuth), API key as fallback (Console-minted key + Authorization: Bearer). Written client-agnostically: no longer hard-codes the @agentkey/cli --auth-login one-liner or singles out one agent.
  • references/setup.md restructured into "OAuth registration" (per-client examples) + "API-key fallback" sections.
  • SECURITY.md posture aligned — dropped the stale --auth-login references; MCP config is written by the client/agent on registration, and the only remaining npm egress is the npx skills update agentkey update command.

Why

Per Anthropic's skill-creator guidance, the SKILL.md body is loaded on every skill trigger. Previously ~53% of that body was upgrade/telemetry plumbing that fires <1% of the time. Moving that machinery behind a reference cuts ~60% of per-query context while keeping the upgrade flow 100% intact.

The Setup rework lets OAuth-capable clients connect without minting or pasting an API key — fewer steps, no long-lived secret to store — while keeping the API-key path for clients that can't do MCP OAuth.

Behavior

  • Slim part: pure reorganization — frontmatter description (the triggering mechanism) is byte-for-byte identical; protocol rules, upgrade options, persistence files, and telemetry shapes are preserved verbatim in references/maintenance.md.
  • Setup part: new preferred OAuth path; the previous API-key registration is preserved as the documented fallback.

Verification

  • verify-version-sync logic: all versions consistent at 1.9.1.
  • bats tests/: pass (update script untouched).
  • npx skills add . --list: skill discoverable, frontmatter parses.
  • ✅ No --auth-login references remain in SKILL.md / references/setup.md / SECURITY.md.

Note on release type

This branch now carries a feat(skill): commit (OAuth-first setup), so the PR title has been retitled to feat(skill): — squash-merging will cut a release via release-please.

🤖 Generated with Claude Code

lxcong and others added 4 commits June 25, 2026 17:29
… SKILL.md body

Move the Step 0 version-check / upgrade / telemetry machinery (~165 lines, ~53% of the body) out of SKILL.md into references/maintenance.md, and the non-auto-list manual-install fallback into references/setup.md. SKILL.md drops from 317 to 127 lines and is now optimized for the high-frequency Query path; the upgrade flow loads only when a version mismatch actually fires, per progressive-disclosure guidance.

Behavior unchanged: all protocol-version rules, the 4-option upgrade prompt, snooze/auto-upgrade persistence, error_class mapping, and every telemetry dispatch are preserved verbatim in references/maintenance.md. Frontmatter description (the triggering mechanism) and the release-please version line are untouched; version-sync (4 files) and bats (10/10) pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rework the Setup flow now that the hosted MCP server supports native MCP
OAuth. Prefer registering the remote URL with no key and letting the
client run its own browser OAuth; fall back to a Console-minted API key
(Bearer header) only when the client cannot do MCP OAuth or it fails.

Written client-agnostically — no longer hard-codes the @agentkey/cli
--auth-login one-liner or singles out one agent. references/setup.md
restructured into "OAuth registration" + "API-key fallback" sections.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the stale @agentkey/cli --auth-login references now that Setup
prefers native MCP OAuth. MCP config is written by the client/agent on
registration, and the remaining npm egress is the skill-update command.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lxcong lxcong changed the title refactor(skill): extract upgrade/telemetry flow into references, slim SKILL.md body feat(skill): OAuth-first setup + slim SKILL.md via progressive disclosure Jun 29, 2026
@lxcong lxcong changed the title feat(skill): OAuth-first setup + slim SKILL.md via progressive disclosure feat(skill): add OAuth-first setup, slim SKILL.md via progressive disclosure Jun 29, 2026
@lxcong
lxcong merged commit 8bc275a into main Jun 29, 2026
3 of 4 checks passed
@lxcong
lxcong deleted the refactor/slim-agentkey-skill branch June 29, 2026 08:54
lxcong added a commit that referenced this pull request Jun 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.10.0](v1.9.1...v1.10.0)
(2026-06-29)


### Features

* **skill:** add OAuth-first setup, slim SKILL.md via progressive
disclosure ([#62](#62))
([8bc275a](8bc275a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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