Skip to content

Add 5 new platforms via declarative spec registry (#80)#81

Merged
devrimcavusoglu merged 2 commits into
mainfrom
feature/m7-platform-registry
May 7, 2026
Merged

Add 5 new platforms via declarative spec registry (#80)#81
devrimcavusoglu merged 2 commits into
mainfrom
feature/m7-platform-registry

Conversation

@devrimcavusoglu
Copy link
Copy Markdown
Owner

Closes #80.

Summary

  • Replace per-platform Go files (claude.go, codex.go, opencode.go) with a single declarative Spec table in internal/platform/spec.go and one generic Adapter struct in internal/platform/adapter.go. Adding a platform is now a one-line append to Specs plus one Type constant — no new Go file required.
  • Ship 5 new adapters: cursor, gemini-cli, github-copilot, windsurf, continue. Path conventions follow vercel-labs/skills.
  • Detection is per-platform, not per-directory. Several adapters share .agents/skills/ as their project dir; each one's DetectHome keys on a distinct user-level config dir (~/.cursor, ~/.gemini, ~/.copilot, ~/.codex, etc.) so platform list doesn't false-positive for agents whose CLI isn't installed.
  • CLI flag help and the "unknown platform" error text enumerate the spec registry dynamically — adding a platform updates user-facing text without further code changes.
  • Tests are table-driven over Specs: install/list/uninstall round-trips run for every registered platform, plus a dedicated TestAdapter_SharedProjectDir that locks in the shared-.agents/ semantics.

Acceptance criteria (from #80)

  • At least 5 new platforms supported: cursor, gemini-cli, github-copilot, windsurf, continue.
  • Adding a new platform = one PR touching one data file: append to Specs in internal/platform/spec.go plus a Type constant. Documented in docs/concepts/platform-adapters.md.
  • No false positives on shared .agents/skills/: detection uses each platform's own user-level config dir, covered by TestAdapter_Detect_FallbackPaths and the per-platform Detect tests.
  • Capacity behavior in shared-directory case: design is recorded in docs/concepts/platform-adapters.md and the CHANGELOG. Threshold protects the directory, not the logical agent — when two adapters read the same dir, both see the same count.
  • No breaking change for existing claude-code / codex-cli / opencode users — all three keep their original Name() and on-disk paths. codex-cli keeps ~/.agents/skills/ (vercel uses ~/.codex/skills/) so existing installs are untouched; the detector now also checks ~/.codex/ as a positive signal.

Implementation notes

  • internal/platform/spec.goSpec struct + the Specs registry. Source of truth.
  • internal/platform/adapter.go — single generic Adapter implementing the Platform interface from any Spec.
  • internal/platform/detector.goNewDetector builds adapters from Specs; ParsePlatformType validates against the registry; error messages list every registered name.
  • internal/cli/capacity.go — adds platformNamesList() shared by skill install, skill uninstall, and skill diff so flag help and error text stay in sync with the registry.
  • Tests in internal/platform/platform_test.go walk every Spec for install/uninstall/detect — replaces ~250 lines of per-platform duplication.

Test plan

  • make test — full suite passes
  • make lint — golangci-lint reports 0 issues
  • make test-smoke — 57/57 smoke tests pass
  • ./skern platform list on real host — shows all 8 platforms with correct detection state
  • ./skern skill install --help — flag help dynamically lists the 8 platforms

🤖 Generated with Claude Code

devrimcavusoglu and others added 2 commits May 5, 2026 17:43
Replace per-platform Go files (claude.go, codex.go, opencode.go) with a
single declarative `Spec` table in internal/platform/spec.go and one
generic `Adapter` struct that implements the Platform interface from any
spec row. Adding a new platform is now a one-line append to Specs plus
one Type constant — no new Go file.

New adapters: cursor, gemini-cli, github-copilot, windsurf, continue.
Path conventions follow vercel-labs/skills.

Detection is per-platform (each adapter checks its own user-level config
dir like ~/.cursor, ~/.gemini, ~/.copilot) so platforms that share
.agents/skills/ as a project dir are still distinguished. CLI flag help
and "unknown platform" error text now enumerate the registry dynamically.

Tests are table-driven over the spec set: install/uninstall/detect
round-trip and shared-project-dir semantics are covered for every
registered platform.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolves CHANGELOG.md conflict — combines both Unreleased entries (platform
registry + --from-template fix) under a single section. No code conflicts.
@devrimcavusoglu devrimcavusoglu merged commit 4de9178 into main May 7, 2026
4 checks passed
@devrimcavusoglu devrimcavusoglu deleted the feature/m7-platform-registry branch May 7, 2026 06:11
This was referenced May 7, 2026
devrimcavusoglu added a commit that referenced this pull request May 7, 2026
Move the [Unreleased] block to v0.3.0 dated 2026-05-07, with a focused
"Breaking changes" section calling out the --from-template directory
requirement (#84). Cross-link the four PRs that landed since v0.2.1
(#81, #84, #86, #87) and add a Changed entry covering the docs-site
refresh that ships in this branch.

Bump the corresponding version refs in AGENTS.md (current release +
milestone snapshot now covers M0–M7), INSTALL.md (SKERN_VERSION pin
example), docs/guide/installation.md (matching pin example), and
docs/guide/index.md (current-release callout).

Docs build verified.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
devrimcavusoglu added a commit that referenced this pull request May 7, 2026
* Refresh docs site for v0.2.1 (eight platforms, init instructions, skill versioning)

Bring the VitePress site up to date with the v0.2.0 / v0.2.1 surface that has
landed since the last docs refresh:

- Eight platform adapters wherever 3 were listed (index, guide, concepts diagram,
  reference flag enums, platforms index/comparison) and a dedicated page for
  each new adapter (cursor, gemini-cli, github-copilot, windsurf, continue).
- `skern init --instructions` / `--tool-forming-loop` / `--target` /
  `--print-instructions` documented in the quick-start, agent-setup, and command
  reference. Agent-setup now leads with `init --instructions` instead of the
  manual `echo … >> AGENTS.md` recipe.
- Reference reorganized: registry vs. platform command groups, full pages for
  `skill import`, `skill version`, `skill diff`, capacity reporting on
  install/uninstall, `--enforce-budget`, `--with-platforms`, batch
  install/uninstall.
- Validation page split into errors / warnings / hints with the trigger-prefix
  and recommended-section hints.
- Skill format page corrected to the nested `metadata.author` / `metadata.version`
  / `metadata.modified-by` schema and includes the import workflow.
- Installation page covers macOS, Linux, and Windows (PowerShell) one-liners
  plus version pinning, custom install dir, source build, manual install,
  uninstall.
- Contributing/development reflects the declarative platform spec, updated
  Make targets, and the `cli/instructions/` package.
- Sidebar adds the new platform pages and a Writing Skills entry under Guide.

Build verified with `npm run docs:build` (clean).

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

* Cut v0.3.0: stamp CHANGELOG, bump version refs

Move the [Unreleased] block to v0.3.0 dated 2026-05-07, with a focused
"Breaking changes" section calling out the --from-template directory
requirement (#84). Cross-link the four PRs that landed since v0.2.1
(#81, #84, #86, #87) and add a Changed entry covering the docs-site
refresh that ships in this branch.

Bump the corresponding version refs in AGENTS.md (current release +
milestone snapshot now covers M0–M7), INSTALL.md (SKERN_VERSION pin
example), docs/guide/installation.md (matching pin example), and
docs/guide/index.md (current-release callout).

Docs build verified.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.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.

Expand platform support: 50+ agents (cursor, gemini-cli, github-copilot, windsurf, ...)

1 participant