From 9071eeb87accfde6cf561716e9ec0115c2346ae4 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Tue, 15 Sep 2026 20:55:17 +0200 Subject: [PATCH] fix: inverser la convention AGENTS.md/CLAUDE.md CLAUDE.md devient le fichier source, AGENTS.md le symlink dessus. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01HuBu7oZp3ckBBrfa6nsrmf --- AGENTS.md | 57 +------------------------------------------------------ CLAUDE.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 57 deletions(-) mode change 100644 => 120000 AGENTS.md mode change 120000 => 100644 CLAUDE.md diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index 218aeec..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,56 +0,0 @@ -# cplugins - -`CLAUDE.md` is a symlink to this file. - -Go CLI for managing Claude Code's plugin cache. - -## Build & test - -```bash -make build # build binary, version stamped from git describe -make test # unit and E2E tests -make e2e-tests # E2E tests (require claude in PATH, no auth needed) -golangci-lint run # lint -``` - -CI runs build, vet, gofmt, lint, `govulncheck` and the tests, minus the `e2e` package — no runner has the `claude` binary. Anything the E2E suite alone covers is unguarded there. - -## Project structure - -``` -cmd/ # cobra commands (root, dev, undev, status, prune, clean, helpers) -internal/ - claude/ # parsers for installed_plugins.json, known_marketplaces.json, plugin.json; PatchInstallPaths/PatchInstalls/RemoveInstalls writers - cache/ # orphan detection, entry removal, recache from marketplace source -e2e/ - claude-home/ # template HOME for E2E tests (credentials gitignored) - *_test.go # E2E test suite, no auth required -``` - -## Commands - -- `dev ` — patch `installPath` to a local source dir -- `undev ` — re-cache the plugin from its marketplace source and point `installPath` back at the cache -- `status [plugin@marketplace]` (aliases `ls`, `list`) — list plugins and their health; user-scope always visible, project-scope filtered by CWD -- `repair [plugin@marketplace]` — re-cache plugins whose `installPath` no longer exists -- `prune` — remove project-scope installs whose `projectPath` no longer exists, dropping the plugin's key entirely once none are left -- `clean` — remove orphaned cache entries - -## Release process - -- `release-please` (release-type `go`) runs on every push to `main`, maintaining a Release PR with `CHANGELOG.md` and the next version bump computed from commit history -- Commits and PR titles must follow Conventional Commits (`feat:`, `fix:`, `chore:`, …) — release-please can't decide a bump or write the changelog otherwise -- Merging the Release PR tags the release and creates the GitHub Release; a second job in the same workflow (`.github/workflows/release-please.yaml`), gated on `release_created`, then builds and attaches binaries via `goreleaser` (`.goreleaser.yaml`) — a tag-push-triggered workflow wouldn't fire here, since GitHub doesn't cascade a new run from a ref created by the workflow's own `GITHUB_TOKEN` -- FYI: this release pipeline is incompatible with GitHub's "immutable releases" setting — keep it disabled - -## Key conventions - -- `dev` resolves symlinks at write time (`filepath.EvalSymlinks`) to store canonical paths; `undev` re-caches from the marketplace source -- `installed_plugins.json` installPath patches are via `claude.PatchInstallPaths`/`claude.PatchInstalls`; install removal is via `claude.RemoveInstalls` -- Never modify `known_marketplaces.json` — delegate to `claude plugin marketplace add/remove` -- `claude-plugins-official` plugins are always skipped (managed by Claude Code) -- `claudeDir()` (`cmd/helpers.go`) resolves `$CLAUDE_CONFIG_DIR` when non-empty, else `~/.claude` — every path helper (`installedPluginsPath`, `marketplacesPath`, `cacheBaseDir`, `settingsPaths`) goes through it -- `status`'s `ENABLED` column reads `enabledPlugins` from the settings chain (`claude.MergeEnabledPlugins`/`claude.IsPluginEnabled`) — `claude plugin list --json` exposes the same field but costs ~1s per call, prohibitive for `status` and for shell completion; a key absent from every settings file is enabled -- `claude.Marketplace.SupportsSourceVersion()` gates source-version resolution in `resolveHealth` (`cmd/status.go`) — only `directory`, `github`, `url`, and `git-subdir` are resolvable; other source types (`npm`, `archive`, `command`, or anything unrecognized) report `SOURCE -` without attempting resolution -- Tests use stdlib `testing` only (no external test frameworks) -- Any behavior change (addition, modification, removal) must come with the corresponding E2E test diff --git a/AGENTS.md b/AGENTS.md new file mode 120000 index 0000000..681311e --- /dev/null +++ b/AGENTS.md @@ -0,0 +1 @@ +CLAUDE.md \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 120000 index 47dc3e3..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -AGENTS.md \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..13a58c5 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,56 @@ +# cplugins + +`AGENTS.md` is a symlink to this file. + +Go CLI for managing Claude Code's plugin cache. + +## Build & test + +```bash +make build # build binary, version stamped from git describe +make test # unit and E2E tests +make e2e-tests # E2E tests (require claude in PATH, no auth needed) +golangci-lint run # lint +``` + +CI runs build, vet, gofmt, lint, `govulncheck` and the tests, minus the `e2e` package — no runner has the `claude` binary. Anything the E2E suite alone covers is unguarded there. + +## Project structure + +``` +cmd/ # cobra commands (root, dev, undev, status, prune, clean, helpers) +internal/ + claude/ # parsers for installed_plugins.json, known_marketplaces.json, plugin.json; PatchInstallPaths/PatchInstalls/RemoveInstalls writers + cache/ # orphan detection, entry removal, recache from marketplace source +e2e/ + claude-home/ # template HOME for E2E tests (credentials gitignored) + *_test.go # E2E test suite, no auth required +``` + +## Commands + +- `dev ` — patch `installPath` to a local source dir +- `undev ` — re-cache the plugin from its marketplace source and point `installPath` back at the cache +- `status [plugin@marketplace]` (aliases `ls`, `list`) — list plugins and their health; user-scope always visible, project-scope filtered by CWD +- `repair [plugin@marketplace]` — re-cache plugins whose `installPath` no longer exists +- `prune` — remove project-scope installs whose `projectPath` no longer exists, dropping the plugin's key entirely once none are left +- `clean` — remove orphaned cache entries + +## Release process + +- `release-please` (release-type `go`) runs on every push to `main`, maintaining a Release PR with `CHANGELOG.md` and the next version bump computed from commit history +- Commits and PR titles must follow Conventional Commits (`feat:`, `fix:`, `chore:`, …) — release-please can't decide a bump or write the changelog otherwise +- Merging the Release PR tags the release and creates the GitHub Release; a second job in the same workflow (`.github/workflows/release-please.yaml`), gated on `release_created`, then builds and attaches binaries via `goreleaser` (`.goreleaser.yaml`) — a tag-push-triggered workflow wouldn't fire here, since GitHub doesn't cascade a new run from a ref created by the workflow's own `GITHUB_TOKEN` +- FYI: this release pipeline is incompatible with GitHub's "immutable releases" setting — keep it disabled + +## Key conventions + +- `dev` resolves symlinks at write time (`filepath.EvalSymlinks`) to store canonical paths; `undev` re-caches from the marketplace source +- `installed_plugins.json` installPath patches are via `claude.PatchInstallPaths`/`claude.PatchInstalls`; install removal is via `claude.RemoveInstalls` +- Never modify `known_marketplaces.json` — delegate to `claude plugin marketplace add/remove` +- `claude-plugins-official` plugins are always skipped (managed by Claude Code) +- `claudeDir()` (`cmd/helpers.go`) resolves `$CLAUDE_CONFIG_DIR` when non-empty, else `~/.claude` — every path helper (`installedPluginsPath`, `marketplacesPath`, `cacheBaseDir`, `settingsPaths`) goes through it +- `status`'s `ENABLED` column reads `enabledPlugins` from the settings chain (`claude.MergeEnabledPlugins`/`claude.IsPluginEnabled`) — `claude plugin list --json` exposes the same field but costs ~1s per call, prohibitive for `status` and for shell completion; a key absent from every settings file is enabled +- `claude.Marketplace.SupportsSourceVersion()` gates source-version resolution in `resolveHealth` (`cmd/status.go`) — only `directory`, `github`, `url`, and `git-subdir` are resolvable; other source types (`npm`, `archive`, `command`, or anything unrecognized) report `SOURCE -` without attempting resolution +- Tests use stdlib `testing` only (no external test frameworks) +- Any behavior change (addition, modification, removal) must come with the corresponding E2E test