Skip to content

coop: bundle a version-locked stripe-coop Agent Skill - #1902

Open
tomelm wants to merge 2 commits into
stripe:coopfrom
tomelm:tomer/coop-agent-skill-bundling-aa35a4
Open

coop: bundle a version-locked stripe-coop Agent Skill#1902
tomelm wants to merge 2 commits into
stripe:coopfrom
tomelm:tomer/coop-agent-skill-bundling-aa35a4

Conversation

@tomelm

@tomelm tomelm commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What

Bundles a version-locked stripe-coop Agent Skill inside the CLI binary and installs it into the selected coding harness before stripe coop start launches an agent. The skill carries Co-op's stable lifecycle and safety contract, so launch prompts shrink to skill activation plus the dynamic session context.

Why

The lifecycle contract was re-sent in full on every launch prompt and every command response. Moving it into a skill that the agent loads on demand keeps the prompt focused on the user's project and integration intent, and gives us one portable place to teach agents the protocol.

The skill is embedded (go:embed) rather than downloaded: it is part of the Co-op protocol and must stay compatible with the exact CLI version, so it deliberately does not reuse the network-backed pkg/agentskills installer.

How it works

  • Skillpkg/coop/skill/stripe-coop/: SKILL.md plus references/{command-api,node-contracts,recovery}.md. The frontmatter description scopes activation to Co-op sessions and away from ordinary Stripe development.
  • Install — atomic (staged directory + rename) and idempotent (sha256 content hash in a .stripe-cli-skill.json manifest). A same-name skill directory without that manifest is treated as user-authored and never overwritten; the launch falls back to the previous self-contained prompt. Abandoned staging/retired directories older than an hour are swept.
  • Harness adapterspkg/cmd/coop/coop_harness.go replaces the old name/path switch. Each adapter declares executables, skill directory, activation syntax, launch arguments, approval flags, and capability limits.
  • Scope — only stripe coop start installs. join, status, stop, and recommend do not. coop run and command responses stay self-contained for agents invoked directly.

Harness support

Verified against current official harness docs (July 2026):

Harness Skill directory Activation Notes
Claude Code ~/.claude/skills /stripe-coop --dangerously-skip-permissions bypass
Codex ~/.agents/skills $stripe-coop --dangerously-bypass-approvals-and-sandbox bypass
OpenCode ~/.agents/skills description match opencode --prompt, --auto
Cline ~/.cline/skills /stripe-coop one-shot launch; no conversational discovery
Roo Code ~/.agents/skills description match auto-approves by default; discontinued May 2026
OpenHands ~/.agents/skills description match openhands -t, --always-approve
Goose ~/.agents/skills description match goose run -t, GOOSE_MODE env; no conversational discovery

Harnesses that cannot hold an interactive conversation from a prompt-seeded launch are rejected for no-blueprint discovery with an actionable message rather than silently launching into a broken flow. Unknown --agent values get a generic positional-prompt launcher, no skill install, and the full fallback prompt.

Protocol

Adds protocol_version to rendered agent responses so agents can detect contract drift. recommend now emits ok/protocol_version and structured recovery errors instead of plain text. start-work notes strip angle brackets so node titles like <PaymentElement> cannot trip the placeholder validator.

Testing

  • go test ./pkg/coop/... ./pkg/cmd/coop -count=1 — green
  • golangci-lint run — 0 issues; go build ./...; git diff --check clean
  • skill-creator quick_validate.py — valid
  • New coverage: embed layout/frontmatter/reference integrity, install atomicity/idempotence/upgrade/unmanaged-refusal/debris-sweep, per-harness skill dirs and activation tokens, launch-arg construction, compact-prompt content and size caps, protocol-version stamping, and a lockstep test that every registered stripe coop agent subcommand is documented in the bundled command-api.md
  • The Goose launcher test executes the generated script against a fake binary rather than asserting on substrings

An adversarial multi-agent review of this branch surfaced 8 confirmed findings, all fixed in the second commit — most notably that the Goose launcher placed the env assignment after exec, so bash tried to run a program literally named GOOSE_MODE=auto and the harness could never start.

Follow-ups (not in this PR)

  • Give ${node...} outputs a typed schema in blueprints instead of free-form field=value JSON
  • Real-agent end-to-end pass of the skill (this branch has a doc-comprehension forward-test only)
  • Cline's docs disagree on --yolo vs --auto-approve; worth re-verifying before release

🤖 Generated with Claude Code

tomelm and others added 2 commits August 13, 2026 16:12
…pters

Embed a portable stripe-coop skill (SKILL.md + references) in the binary,
install it atomically and idempotently into the selected harness's skill
directory before launch, and shrink launch prompts to skill activation plus
dynamic session context. Refactor the launcher into a harness adapter
registry covering Claude Code, Codex, OpenCode, Cline, Roo Code, OpenHands,
and Goose, and stamp protocol_version on agent-facing responses.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- goose launcher: put GOOSE_MODE before exec (bash only honors env
  assignments before the command word); add a test that executes the script
- drop the all: embed prefix so build-machine dotfiles never ship
- sweep abandoned staging/retired install debris older than an hour
- sanitize angle brackets out of start-work notes so node titles like
  <PaymentElement> can't trip the placeholder validator
- recommend now emits ok/protocol_version and structured recovery errors
- correct skill docs: status --json shape, follow-up flow (start-followup is
  deploy-only; other next-action selections run from agent_prompt), and the
  dot-separated node-reference grammar

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomelm
tomelm requested review from a team as code owners August 13, 2026 23:17
Comment on lines +56 to +58
func agentsSkillsDir(home string) string {
return filepath.Join(home, ".agents", "skills")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

2 participants