Skip to content

Integrate upstream patterns and Antigravity support - #10

Merged
henryperkins merged 2 commits into
trunkfrom
agent/integrate-upstream-skills
Jul 18, 2026
Merged

Integrate upstream patterns and Antigravity support#10
henryperkins merged 2 commits into
trunkfrom
agent/integrate-upstream-skills

Conversation

@henryperkins

@henryperkins henryperkins commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • add opt-in Antigravity skillpack build/install targets for project .agents/skills/ and global ~/.gemini/antigravity/skills/
  • add the upstream wp-patterns skill, five references, twelve eval scenarios, README/router discovery, GPL metadata, and the default WordPress 6.9+/PHP 7.2.24+ compatibility floor (matching upstream Update wp-patterns compatibility contract to WP 7.0 / PHP 7.4.0 WordPress/agent-skills#84)
  • document WordPress theme.json preset/custom slug normalization and add the fallback-debugging check
  • correct the WordPress 6.9+ form element key from styles.elements.input to styles.elements.textInput
  • add regression coverage for packaging behavior, docs, skill metadata, and both theme.json corrections

Upstream provenance

Selectively adapted from:

This intentionally excludes unrelated upstream trunk changes. Antigravity remains opt-in; the default build targets remain Codex, VS Code, Claude, and Cursor.

Validation

  • node eval/harness/run.mjs
  • git diff --check
  • built and installed all 21 skills across Codex, VS Code, Claude, Cursor, and Antigravity project layouts
  • verified Antigravity global install dry-run targets ~/.gemini/antigravity/skills/
  • verified packaged installs contain no symlinks
  • clean-context probes confirmed the new pattern workflow and both corrected theme.json answers

Summary by Sourcery

Add an opt-in Antigravity skillpack target and integrate the new wp-patterns skill with documentation, routing, and quality gates.

New Features:

  • Introduce Antigravity build and install targets for project and global skillpack layouts, using the shared .agents/skills/ convention.
  • Add the wp-patterns skill with supporting reference docs, pattern design guidance, and evaluation scenarios for WordPress block patterns.

Enhancements:

  • Extend packaging documentation and README to cover Antigravity targets and layouts, clarifying that they are not part of the default build set.
  • Update the WordPress router decision tree to route block pattern-related requests to the new wp-patterns skill.
  • Refine theme.json guidance to document slug normalisation behavior and correct the WordPress 6.9 form element key from styles.elements.input to styles.elements.textInput.

CI:

  • Update CI to validate the new wp-patterns skill via the skills-ref workflow.

Tests:

  • Add skillpack target contract checks to the eval harness to ensure Antigravity remains opt-in and installs to the correct project and global paths.
  • Expand release conformance checks to cover Antigravity documentation, theme.json slug normalisation and element key corrections, and the new wp-patterns skill metadata and references.
  • Add multiple wp-patterns eval scenarios to exercise the new pattern design workflow.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 80a70f05-8b2e-4ddf-a5fe-04c34ba8edef

📥 Commits

Reviewing files that changed from the base of the PR and between 914be40 and 36db348.

📒 Files selected for processing (29)
  • .github/workflows/ci.yml
  • README.md
  • docs/packaging.md
  • eval/harness/release-conformance.mjs
  • eval/harness/skill-quality.mjs
  • eval/scenarios/skillpack-build-and-install.json
  • eval/scenarios/wp-patterns-album-poster-split.json
  • eval/scenarios/wp-patterns-bold-duotone-cover-cta.json
  • eval/scenarios/wp-patterns-create-hero-pattern.json
  • eval/scenarios/wp-patterns-forest-editorial-cover.json
  • eval/scenarios/wp-patterns-header-hero-image.json
  • eval/scenarios/wp-patterns-image-text-color-field.json
  • eval/scenarios/wp-patterns-large-cover-exhibition.json
  • eval/scenarios/wp-patterns-media-text-case-study.json
  • eval/scenarios/wp-patterns-offset-wordmark-hero.json
  • eval/scenarios/wp-patterns-query-date-title-index.json
  • eval/scenarios/wp-patterns-repeating-display-text-cover.json
  • eval/scenarios/wp-patterns-two-tone-centered-image.json
  • shared/scripts/skillpack-build.mjs
  • shared/scripts/skillpack-install.mjs
  • skills/wordpress-router/references/decision-tree.md
  • skills/wp-block-themes/references/debugging.md
  • skills/wp-block-themes/references/theme-json.md
  • skills/wp-patterns/SKILL.md
  • skills/wp-patterns/references/anti-patterns.md
  • skills/wp-patterns/references/block-markup-reference.md
  • skills/wp-patterns/references/design-with-tokens.md
  • skills/wp-patterns/references/pattern-categories-and-types.md
  • skills/wp-patterns/references/pattern-registration.md

Cache: Disabled due to Reviews > Disable Cache setting


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added support for building and installing skillpacks for Antigravity, including project-level and global installation options.
    • Added the new wp-patterns skill for creating accessible, responsive WordPress block patterns using native blocks and design tokens.
    • Added comprehensive guidance for pattern registration, markup, categories, accessibility, internationalization, and troubleshooting.
    • Added WordPress pattern evaluation scenarios covering diverse layouts and use cases.
  • Documentation

    • Updated installation, packaging, routing, and theme guidance with Antigravity support and slug-normalization details.
  • Tests

    • Expanded validation coverage for Antigravity packaging and WordPress pattern content.

Walkthrough

This PR adds the wp-patterns skill, routing guidance, reference documentation, and evaluation scenarios. It also adds opt-in Antigravity skillpack build/install targets, documentation, CI validation, and harness coverage for project and global installations.

Changes

Patterns and packaging

Layer / File(s) Summary
WordPress pattern skill and guidance
skills/wp-patterns/*, skills/wordpress-router/..., .github/workflows/ci.yml
Adds pattern authoring guidance, block markup and token references, registration rules, anti-patterns, validation steps, and routing plus CI coverage.
Antigravity build and installation targets
shared/scripts/*, README.md, docs/packaging.md
Adds opt-in antigravity and antigravity-global targets with project and global installation paths and documented commands.
Pattern scenarios and release validation
eval/scenarios/*, eval/harness/*
Adds WordPress pattern scenarios and validates Antigravity targets, documentation content, skill content, and generated installation output.
Theme JSON and slug guidance
skills/wp-block-themes/references/*
Documents form-element selectors and slug normalization behavior, with corresponding conformance assertions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant SkillpackBuild
  participant SkillpackInstall
  participant Antigravity
  Developer->>SkillpackBuild: build with --targets=antigravity
  SkillpackBuild->>SkillpackInstall: provide antigravity output
  SkillpackInstall->>Antigravity: install project or global skills
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch agent/integrate-upstream-skills

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The PR successfully integrates upstream patterns and Antigravity support. The implementation is clean, properly tested, and follows existing conventions. The opt-in Antigravity build targets are correctly integrated across build/install scripts, and the wp-patterns skill includes comprehensive documentation with proper PHP 7.4+ compatibility and GPL licensing. Test coverage validates all new functionality including the theme.json corrections.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@sourcery-ai

sourcery-ai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds an opt-in Antigravity skillpack target to the build/install tooling, integrates a new wp-patterns skill (including docs, router wiring, eval scenarios, and CI), and tightens WordPress theme.json guidance with slug normalization and form element key corrections backed by harness contracts.

Flow diagram for Antigravity skillpack build and install targets

flowchart TD
  A[RepoRoot] --> B[skillpack-build.mjs]
  B -->|--targets=antigravity| C[dist/antigravity/.agents/skills]

  C --> D[skillpack-install.mjs --targets=antigravity]
  D --> E[Project .agents/skills/]

  C --> F[skillpack-install.mjs --targets=antigravity-global --dry-run]
  F --> G[~/.gemini/antigravity/skills/]
Loading

Flow diagram for WordPress router decision tree updates for wp-patterns

flowchart TD
  A[User WordPress task] --> B{Content focus}

  B -->|Block patterns / patterns/*.php / register_block_pattern| C[wp-patterns]
  B -->|theme.json / Global Styles / templates / template parts| D[wp-block-themes]
  B -->|Blocks / block.json / registerBlockType| E[wp-block-development]
Loading

File-Level Changes

Change Details Files
Introduce Antigravity skillpack build/install targets and document their usage.
  • Extend skillpack-build script to support an additional antigravity target and emit .agents/skills/ layout while keeping defaults unchanged.
  • Extend skillpack-install script to accept antigravity and antigravity-global targets, map them to .agents/skills/ and ~/.gemini/antigravity/skills/, update validation and destination logic, and include the new target when listing skills.
  • Update README and packaging docs to describe Antigravity as an opt-in build target, add project-level and global install examples, and define the expected dist/antigravity layout.
  • Add release-conformance checks to assert README and packaging docs mention the Antigravity targets and paths, and enhance skill-quality harness with a contract that builds, installs, and dry-runs Antigravity skillpacks without leaving temporary artifacts.
shared/scripts/skillpack-build.mjs
shared/scripts/skillpack-install.mjs
README.md
docs/packaging.md
eval/harness/release-conformance.mjs
eval/harness/skill-quality.mjs
Add the wp-patterns skill with references, routing, CI wiring, and evaluation coverage.
  • Create the wp-patterns SKILL.md with detailed guidance on when to use the skill, guardrails, design and technical procedures, verification steps, and escalation rules, targeting WordPress 6.9+/PHP 7.2.24+ and GPL-2.0-or-later.
  • Add a suite of wp-patterns reference docs covering block markup, pattern registration, design with tokens, anti-patterns, pattern categories/types, and link them from the skill metadata.
  • Wire wp-patterns into the WordPress router decision tree so block pattern work is routed to the new skill instead of wp-block-themes, and include the skill in CI skill validation.
  • Add release-conformance assertions that validate wp-patterns SKILL.md and reference docs contain specific content and function names, and introduce multiple eval scenarios to exercise wp-patterns workflows and design patterns.
skills/wp-patterns/SKILL.md
skills/wp-patterns/references/block-markup-reference.md
skills/wp-patterns/references/pattern-registration.md
skills/wp-patterns/references/design-with-tokens.md
skills/wp-patterns/references/anti-patterns.md
skills/wp-patterns/references/pattern-categories-and-types.md
skills/wordpress-router/references/decision-tree.md
.github/workflows/ci.yml
eval/harness/release-conformance.mjs
eval/scenarios/wp-patterns-*.json
Tighten WordPress theme.json guidance for block themes, including slug normalization and form element styling, and add regression coverage.
  • Update theme-json reference to replace the incorrect styles.elements.input key with styles.elements.textInput, describe supported input types, and explicitly note non-existent element keys like input, checkbox, radio, and label.
  • Document the slug normalisation gotcha for preset/custom slugs, including how _wp_to_kebab_case() transforms slugs and a regex for detecting un-normalised CSS variable references.
  • Extend the debugging reference to point to the new slug normalisation guidance when var() fallbacks silently trigger.
  • Add release-conformance checks ensuring the new guidance strings are present and that the obsolete styles.elements.input wording is absent.
skills/wp-block-themes/references/theme-json.md
skills/wp-block-themes/references/debugging.md
eval/harness/release-conformance.mjs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

- Restore upstream's WordPress 6.9 / PHP 7.2.24 compatibility floor:
  the AI-era 7.0 floor is reserved for 7.0-only features, and upstream
  (WordPress#84) settled on 6.9 wording for this skill
- Reference triage/theme detectors via portable ../<skill>/ paths so the
  commands resolve in installed skillpack layouts, matching the other skills
- Add wp-patterns to the skills-ref CI validation subset

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@henryperkins

Copy link
Copy Markdown
Owner Author

Review

Reviewed all 28 files. The Antigravity packaging changes are correct and well-tested (the new runSkillpackTargetContract in the harness actually builds and installs against a temp dir, including the opt-in default-set assertion), the theme.json corrections check out against core behavior (_wp_to_kebab_case() tokenization; 6.9's styles.elements.textInput element and its input-type list), the 12 new scenarios satisfy the scenario schema, and the five wp-patterns reference docs are byte-identical to upstream trunk.

Issues found → fixed in 36db348

  1. Compatibility floor diverged from upstream and from this repo's policy. Upstream (Update wp-patterns compatibility contract to WP 7.0 / PHP 7.4.0 WordPress/agent-skills#84) settled on WordPress 6.9 with PHP 7.2.24 or later for wp-patterns; the PR changed it to the AI-era WordPress 7.0+ (PHP 7.4.0+) floor, which CLAUDE.md reserves for 7.0-only features (AI Client, Connectors, client-side Abilities) — and nothing in this skill needs 7.0. The compatibility string was also internally inconsistent ("Targets 7.0+ … requires 6.0+/6.7+"). Restored the upstream wording and updated the matching release-conformance.mjs assertion.
  2. Non-portable detector paths. wp-patterns mirrored upstream's node skills/wp-project-triage/scripts/detect_wp_project.mjs form, which only resolves in this authoring repo. Skillpacks install skills as sibling dirs (.claude/skills/, .codex/skills/, .agents/skills/ …), so this fork's convention is node ../wp-project-triage/scripts/detect_wp_project.mjs — now applied to both the triage and detect_block_themes references, with the standard "when installed alongside" fallback phrasing used by the other seven skills.
  3. Missing skills-ref CI coverage. New skills are only validated by the reference validator if added to the subset in .github/workflows/ci.yml; added skills-ref validate skills/wp-patterns.

Verified

  • node eval/harness/run.mjs green before and after the fixes; git diff --check clean; claude plugin validate . --strict passes.
  • PR branch is based on the current trunk tip (merge-base = trunk head), so the merge is conflict-free by construction.

Follow-ups (pre-existing, not this PR)

  • skills/wp-ai-plugin/SKILL.md still uses the non-portable node skills/wp-project-triage/… triage path on trunk.
  • Upstream-inherited reference quirks kept as-is for provenance (e.g. the category table lists pricing/newsletter, which core doesn't register by default; "Default WP 6.7+ Presets" describes default-theme slugs rather than core presets). Worth raising upstream rather than forking the content.
@henryperkins
henryperkins marked this pull request as ready for review July 18, 2026 03:25
@henryperkins
henryperkins merged commit 41c91e0 into trunk Jul 18, 2026
4 checks passed
@henryperkins
henryperkins deleted the agent/integrate-upstream-skills branch July 18, 2026 03:25

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • The target definitions and directory mappings for codex/vscode/claude/cursor/antigravity are duplicated across skillpack-build.mjs and skillpack-install.mjs; consider centralizing these in a shared module to avoid drift when adding or modifying targets.
  • The CLI UX around global targets is slightly asymmetric (e.g., --global only maps to claude-global while antigravity-global must be spelled out); if Antigravity is a first-class target long-term, consider adding a shorthand or clarifying this distinction in the usage text.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The target definitions and directory mappings for codex/vscode/claude/cursor/antigravity are duplicated across `skillpack-build.mjs` and `skillpack-install.mjs`; consider centralizing these in a shared module to avoid drift when adding or modifying targets.
- The CLI UX around global targets is slightly asymmetric (e.g., `--global` only maps to `claude-global` while `antigravity-global` must be spelled out); if Antigravity is a first-class target long-term, consider adding a shorthand or clarifying this distinction in the usage text.

## Individual Comments

### Comment 1
<location path="shared/scripts/skillpack-install.mjs" line_range="237-241" />
<code_context>
 function listAvailableSkills(fromDir) {
   // Check all possible target sources
-  const sources = ["codex", "vscode", "claude", "cursor"]
+  const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
     .map((t) => getSourceDir(fromDir, t))
     .filter((p) => fs.existsSync(p));
</code_context>
<issue_to_address>
**suggestion:** Derive `listAvailableSkills` sources from existing target metadata instead of a hardcoded list.

This list duplicates information already in `VALID_TARGETS`/`getSourceDir`, so every new non‑global target must be updated in multiple places. Instead, derive `sources` from `VALID_TARGETS` by filtering out `*-global` entries and mapping through `getSourceDir`, so `listAvailableSkills` automatically stays in sync with new project‑level targets.

```suggestion
function listAvailableSkills(fromDir) {
  // Derive non-global target sources from VALID_TARGETS so this stays in sync with new targets
  const sources = VALID_TARGETS
    .filter((t) => !t.endsWith("-global"))
    .map((t) => getSourceDir(fromDir, t))
    .filter((p) => fs.existsSync(p));
```
</issue_to_address>

### Comment 2
<location path="shared/scripts/skillpack-install.mjs" line_range="278" />
<code_context>
-  // --dest is required unless only using global targets (claude-global, cursor-global)
-  const needsDest = targets.some((t) => t !== "claude-global" && t !== "cursor-global");
+  // --dest is required unless only global targets are selected.
+  const globalTargets = new Set(["claude-global", "cursor-global", "antigravity-global"]);
+  const needsDest = targets.some((t) => !globalTargets.has(t));
   if (needsDest && !args.dest) {
</code_context>
<issue_to_address>
**suggestion:** Reuse the `globalTargets` knowledge in `getDestDir` to avoid divergent global-target handling.

There are now two separate definitions of which targets are global: the `globalTargets` set here, and the explicit checks in `getDestDir`/`installTarget`. This risks them drifting out of sync. Please centralize the global-target detection (e.g., an `isGlobalTarget()` helper or shared module-level set) and use it in both `getDestDir` and `main()`.

Suggested implementation:

```javascript
  const GLOBAL_TARGETS = new Set(["claude-global", "cursor-global", "antigravity-global"]);

  function isGlobalTarget(target) {
    return GLOBAL_TARGETS.has(target);
  }

  const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
    .map((t) => getSourceDir(fromDir, t))
    .filter((p) => fs.existsSync(p));

    assert(VALID_TARGETS.includes(t), `Invalid target: ${t}. Valid targets: ${VALID_TARGETS.join(", ")}`);
  }

  // --dest is required unless only global targets are selected.
  const needsDest = targets.some((t) => !isGlobalTarget(t));
  if (needsDest && !args.dest) {
    process.stderr.write("Error: --dest is required for non-global targets.\n\n");
    usage();

```

` since they’re not visible in the snippet).

Here are the concrete edits:

```xml
<file_operations>
  <file_operation operation="edit" file_path="shared/scripts/skillpack-install.mjs">
<<<<<<< SEARCH
  const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
    .map((t) => getSourceDir(fromDir, t))
    .filter((p) => fs.existsSync(p));

    assert(VALID_TARGETS.includes(t), `Invalid target: ${t}. Valid targets: ${VALID_TARGETS.join(", ")}`);
  }

  // --dest is required unless only global targets are selected.
  const globalTargets = new Set(["claude-global", "cursor-global", "antigravity-global"]);
  const needsDest = targets.some((t) => !globalTargets.has(t));
  if (needsDest && !args.dest) {
    process.stderr.write("Error: --dest is required for non-global targets.\n\n");
    usage();
=======
  const GLOBAL_TARGETS = new Set(["claude-global", "cursor-global", "antigravity-global"]);

  function isGlobalTarget(target) {
    return GLOBAL_TARGETS.has(target);
  }

  const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
    .map((t) => getSourceDir(fromDir, t))
    .filter((p) => fs.existsSync(p));

    assert(VALID_TARGETS.includes(t), `Invalid target: ${t}. Valid targets: ${VALID_TARGETS.join(", ")}`);
  }

  // --dest is required unless only global targets are selected.
  const needsDest = targets.some((t) => !isGlobalTarget(t));
  if (needsDest && !args.dest) {
    process.stderr.write("Error: --dest is required for non-global targets.\n\n");
    usage();
>>>>>>> REPLACE
  </file_operation>
</file_operations>

<additional_changes>
To fully centralize global-target handling and avoid future drift, update the rest of the file as follows (locations not shown in the snippet):

1. In `getDestDir(target, destDir, ...)`:
   - Replace any explicit checks like:
     - `if (target === "claude-global" || target === "cursor-global" || target === "antigravity-global")`
     - or `if (target.endsWith("-global"))`
   - With:
     - `if (isGlobalTarget(target)) { ... }`
   - Remove any separate, local sets or arrays that enumerate the same global targets.

2. In `installTarget(target, ...)` (or any other helper that branches based on global vs non-global targets):
   - Replace similar explicit checks for `"claude-global"`, `"cursor-global"`, `"antigravity-global"` (or `*-global`) with `isGlobalTarget(target)`.
   - Ensure no other hard-coded global-target lists remain; they should all go through the shared `GLOBAL_TARGETS` / `isGlobalTarget` definitions.

3. If tests exist for global-target behavior (e.g., `skillpack-install` CLI tests):
   - Update or add tests to cover `"antigravity-global"` and confirm `getDestDir` and `installTarget` use the shared logic (e.g., adding/removing from `GLOBAL_TARGETS` changes behavior consistently across both entry points).
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Comment on lines 237 to 241
function listAvailableSkills(fromDir) {
// Check all possible target sources
const sources = ["codex", "vscode", "claude", "cursor"]
const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
.map((t) => getSourceDir(fromDir, t))
.filter((p) => fs.existsSync(p));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Derive listAvailableSkills sources from existing target metadata instead of a hardcoded list.

This list duplicates information already in VALID_TARGETS/getSourceDir, so every new non‑global target must be updated in multiple places. Instead, derive sources from VALID_TARGETS by filtering out *-global entries and mapping through getSourceDir, so listAvailableSkills automatically stays in sync with new project‑level targets.

Suggested change
function listAvailableSkills(fromDir) {
// Check all possible target sources
const sources = ["codex", "vscode", "claude", "cursor"]
const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
.map((t) => getSourceDir(fromDir, t))
.filter((p) => fs.existsSync(p));
function listAvailableSkills(fromDir) {
// Derive non-global target sources from VALID_TARGETS so this stays in sync with new targets
const sources = VALID_TARGETS
.filter((t) => !t.endsWith("-global"))
.map((t) => getSourceDir(fromDir, t))
.filter((p) => fs.existsSync(p));
// --dest is required unless only using global targets (claude-global, cursor-global)
const needsDest = targets.some((t) => t !== "claude-global" && t !== "cursor-global");
// --dest is required unless only global targets are selected.
const globalTargets = new Set(["claude-global", "cursor-global", "antigravity-global"]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Reuse the globalTargets knowledge in getDestDir to avoid divergent global-target handling.

There are now two separate definitions of which targets are global: the globalTargets set here, and the explicit checks in getDestDir/installTarget. This risks them drifting out of sync. Please centralize the global-target detection (e.g., an isGlobalTarget() helper or shared module-level set) and use it in both getDestDir and main().

Suggested implementation:

  const GLOBAL_TARGETS = new Set(["claude-global", "cursor-global", "antigravity-global"]);

  function isGlobalTarget(target) {
    return GLOBAL_TARGETS.has(target);
  }

  const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
    .map((t) => getSourceDir(fromDir, t))
    .filter((p) => fs.existsSync(p));

    assert(VALID_TARGETS.includes(t), `Invalid target: ${t}. Valid targets: ${VALID_TARGETS.join(", ")}`);
  }

  // --dest is required unless only global targets are selected.
  const needsDest = targets.some((t) => !isGlobalTarget(t));
  if (needsDest && !args.dest) {
    process.stderr.write("Error: --dest is required for non-global targets.\n\n");
    usage();

` since they’re not visible in the snippet).

Here are the concrete edits:

<file_operations>
  <file_operation operation="edit" file_path="shared/scripts/skillpack-install.mjs">
<<<<<<< SEARCH
  const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
    .map((t) => getSourceDir(fromDir, t))
    .filter((p) => fs.existsSync(p));

    assert(VALID_TARGETS.includes(t), `Invalid target: ${t}. Valid targets: ${VALID_TARGETS.join(", ")}`);
  }

  // --dest is required unless only global targets are selected.
  const globalTargets = new Set(["claude-global", "cursor-global", "antigravity-global"]);
  const needsDest = targets.some((t) => !globalTargets.has(t));
  if (needsDest && !args.dest) {
    process.stderr.write("Error: --dest is required for non-global targets.\n\n");
    usage();
=======
  const GLOBAL_TARGETS = new Set(["claude-global", "cursor-global", "antigravity-global"]);

  function isGlobalTarget(target) {
    return GLOBAL_TARGETS.has(target);
  }

  const sources = ["codex", "vscode", "claude", "cursor", "antigravity"]
    .map((t) => getSourceDir(fromDir, t))
    .filter((p) => fs.existsSync(p));

    assert(VALID_TARGETS.includes(t), `Invalid target: ${t}. Valid targets: ${VALID_TARGETS.join(", ")}`);
  }

  // --dest is required unless only global targets are selected.
  const needsDest = targets.some((t) => !isGlobalTarget(t));
  if (needsDest && !args.dest) {
    process.stderr.write("Error: --dest is required for non-global targets.\n\n");
    usage();
>>>>>>> REPLACE
  </file_operation>
</file_operations>

<additional_changes>
To fully centralize global-target handling and avoid future drift, update the rest of the file as follows (locations not shown in the snippet):

1. In `getDestDir(target, destDir, ...)`:
   - Replace any explicit checks like:
     - `if (target === "claude-global" || target === "cursor-global" || target === "antigravity-global")`
     - or `if (target.endsWith("-global"))`
   - With:
     - `if (isGlobalTarget(target)) { ... }`
   - Remove any separate, local sets or arrays that enumerate the same global targets.

2. In `installTarget(target, ...)` (or any other helper that branches based on global vs non-global targets):
   - Replace similar explicit checks for `"claude-global"`, `"cursor-global"`, `"antigravity-global"` (or `*-global`) with `isGlobalTarget(target)`.
   - Ensure no other hard-coded global-target lists remain; they should all go through the shared `GLOBAL_TARGETS` / `isGlobalTarget` definitions.

3. If tests exist for global-target behavior (e.g., `skillpack-install` CLI tests):
   - Update or add tests to cover `"antigravity-global"` and confirm `getDestDir` and `installTarget` use the shared logic (e.g., adding/removing from `GLOBAL_TARGETS` changes behavior consistently across both entry points).
henryperkins added a commit that referenced this pull request Jul 18, 2026
…, #13, WordPress#18)

Brings in upstream commits aecc4d6, 20324d2, 8182820, c212346 while
keeping the fork's contracts:

- Kept the two-floor compatibility policy (docs/compatibility-policy.md)
  over upstream WordPress#70's blanket WP 7.0+/PHP 7.4.0+ bump: all SKILL.md
  frontmatter, eval/harness/run.mjs, scaffold-skill.mjs, and docs resolve
  to the fork side; CONTRIBUTING.md and README.md now state the two-floor
  policy explicitly instead of inheriting the flat bump
- Kept the fork's fresher upstream indices (WP 7.0.2 / GB snapshot) over
  upstream WordPress#55's older refresh
- Kept the fork's Antigravity (#13) and wp-patterns (WordPress#18) copies, both
  already adapted in PR #10; upstream's versions differ only in comments,
  usage text, and wp-patterns frontmatter
- Accepted upstream's WP 7.0 example env line in
  wp-abilities-verify/references/runtime-harness.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant