Skip to content

feat(antigravity-plugin): create a missing plugin.json manifest on generate - #3326

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2666
Oct 8, 2026
Merged

dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2666

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Antigravity loads a directory as a plugin only when it has a plugin.json at its root. The antigravity-plugin target never wrote that file, so a plugin tree that rulesync generated from scratch was not discovered at all. Gap 3 of #2666.

When antigravity-plugin is a target in project scope, generate now writes {"name": "<plugin directory name>"} to each output root that has no plugin.json. This happens whatever features are selected.

  • Name check: the name is the output root's directory name and must match ^[a-zA-Z0-9-_]+$. If it doesn't, rulesync warns once and writes nothing, so the user has to write the manifest by hand.
  • Existing manifests: an existing plugin.json is never read, rewritten or deleted, including under --delete. Import does not read it.
  • Preview modes: --dry-run reports the file it would write. --check reports a missing manifest as a diff.
  • Output: the manifest is reported in its own result slot (pluginManifestCount / pluginManifestPaths, labelled "plugin manifests" in the CLI summary and pluginManifest in the --json feature results and plan). It is not folded into the Hermes activation slot.

Design decisions

  • This changes documented policy. docs/guide/plugin-packaging.md used to say rulesync never creates plugin metadata for any *-plugin target. Antigravity is now the one exception, and the guide and README say so. The exception is narrow for three reasons:

    • Antigravity's manifest schema has only two properties (name, description) and sets additionalProperties: false.
    • The only required field, name, can be derived from the directory name.
    • rulesync writes the file only when it is missing, so nothing hand-authored is ever overwritten.

    The Claude Code, Kimi and Vibe manifests are different: they declare components rulesync cannot infer, so they stay hand-authored.

  • The manifest has only name. The published schema puts additionalProperties: false beside the name and description properties. A $schema key in the file itself would therefore be an extra property under strict validation; the docs present it only as an editor-validation aid.

  • No error on an invalid directory name. rulesync warns instead of failing, because the generated component files are still useful.

  • When it runs: after the --delete sweep, so the sweep can never remove a manifest this run creates. No feature claims the file, so it is never swept.

Not in this PR

Sources

Tests

  • New unit tests in src/features/shared/antigravity-plugin-manifest.test.ts cover four cases: the file is created, an existing file is left untouched, preview mode writes nothing, and an invalid name produces a warning.
  • src/lib/generate.test.ts covers the wiring for three cases: project-scope roots, a non-target run, and global mode.
  • src/e2e/e2e-plugins.spec.ts:
    • A new e2e test covers a fresh plugin root: a dry run writes nothing, --delete creates the manifest, and a following --check passes.
    • The existing Antigravity plugin e2e test now checks that a hand-authored manifest with a description comes through byte-for-byte.
  • pnpm cicheck passes.

Refs #2666

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj

dyoshikawa and others added 2 commits October 7, 2026 21:10
…nerate

Antigravity loads a directory as a plugin only when it has a plugin.json at
its root, so a plugin tree generated from scratch was never discovered. When
antigravity-plugin is a target in project scope, generate now writes
{"name": "<plugin directory name>"} to each output root that has no
manifest. The name must match ^[a-zA-Z0-9-_]+$; otherwise rulesync warns and
writes nothing. An existing manifest is never read, rewritten or deleted.

Refs #2666

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
…fest tests

Strip control characters from the directory name and path in the manifest
warning and dry-run log, cover mixed output roots and a failing --check on
a missing manifest, and document that antigravity-plugin and vibe-plugin
need separate output roots.

Refs #2666

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
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