Skip to content

Add selective npm skill installer and distinguish code review workflows - #25

Merged
waybarrios merged 2 commits into
mainfrom
feat/selective-skill-installer
Aug 13, 2026
Merged

waybarrios merged 2 commits into
mainfrom
feat/selective-skill-installer

Conversation

@waybarrios

@waybarrios waybarrios commented Aug 13, 2026 •

Copy link
Copy Markdown
Owner

Overview

This PR adds a selective npm installer for the 55 bundled skills, introduces curated installation profiles, preserves skill dependencies and provenance, and clarifies the difference between the two existing code review workflows.

The complete plugin remains available. Selective installation is an additional option for users who want a smaller skill set shared across Codex, OpenCode, and Pi.

Why this change

Installing all 55 skills is useful for the full plugin experience, but it is not always ideal:

  • Many users need only code review, feature development, frontend, security, or Hugging Face workflows.
  • Large skill collections consume more of the agent's initial skill-discovery context.
  • Manually copying individual skill directories can omit required companion skills.
  • Manual copies can lose upstream provenance and license information.
  • code-review and code-reviewer looked duplicative because their names were too similar, despite serving different scopes.

This PR addresses those problems without renaming existing skill IDs or breaking current integrations.

Selective npm installer

The package now exposes this executable through package.json:

{
  "bin": {
    "opencode-power-pack": "bin/opencode-power-pack.mjs"
  }
}

It can be executed directly through npm:

npx opencode-power-pack <command>

The implementation is in:

bin/opencode-power-pack.mjs

It uses only Node.js built-in modules and does not add runtime dependencies.

CLI reference

Usage:
  npx opencode-power-pack list
  npx opencode-power-pack install <skill...> [options]
  npx opencode-power-pack install --profile <name> [options]
  npx opencode-power-pack install --all [options]

Options:
  --profile <name>  Install a curated profile. Repeatable.
  --all             Install every bundled skill.
  --project         Install into the current Git repository.
  --global          Install into ~/.agents/skills. This is the default.
  --force           Replace existing skills with rollback on failure.
  --dry-run         Show what would change without writing files.
  -h, --help        Show help.

Listing profiles and skills

npx opencode-power-pack list

The command prints all available profiles followed by every packaged skill and its description:

Profiles:
  recommended      A balanced software-development toolkit...
  review           General code review, focused review...
  feature-dev      The end-to-end feature workflow...
  frontend         Frontend implementation...
  security         Security review, threat modeling...
  huggingface      Hugging Face discovery, training...
  authoring        Create reusable skills and MCP servers...
  project-memory   Audit and update durable project guidance...

Skills:
  agents-md-improver                         ...
  code-review                                ...
  code-reviewer                              ...
  feature-dev                                ...
  security-review                            ...

Installing the recommended profile

npx opencode-power-pack install --profile recommended

This installs a balanced development toolkit into:

~/.agents/skills

The recommended profile includes:

agents-md-improver
agents-md-revise
code-quality
code-review
feature-dev
frontend-design
mcp-builder
skill-creator

Required companion skills are added automatically. For example, selecting feature-dev also installs:

code-architect
code-explorer
code-reviewer

Installing individual skills

One skill:

npx opencode-power-pack install code-review

Multiple skills:

npx opencode-power-pack install code-review security-review frontend-design

Profiles and individual skills can be combined:

npx opencode-power-pack install \
  --profile review \
  security-threat-model \
  supply-chain-risk-auditor

Selections are deduplicated and sorted before installation.

Unknown skills or profiles fail with an explicit error:

Error: Unknown skill: missing-skill

Installing every skill

npx opencode-power-pack install --all

This copies the complete catalog into the shared user-level skill directory.

The full plugin installation remains the preferred option when users want the complete plugin and its host integrations. The npm installer is intended for selective standalone skill discovery.

Repository-local installation

npx opencode-power-pack install --profile review --project

The installer walks upward from the current working directory until it finds the nearest .git file or directory.

This means it works when executed from a nested directory:

my-project/
├── .git/
├── packages/
│   └── api/
└── .agents/
    └── skills/

For example:

cd my-project/packages/api
npx opencode-power-pack install --profile review --project

The result is installed at the Git root:

my-project/.agents/skills

It is not incorrectly installed under:

my-project/packages/api/.agents/skills

Running --project outside a Git repository returns:

Error: --project requires running inside a Git repository.

Previewing an installation

npx opencode-power-pack install --profile review --dry-run

Example output:

Plan for 4 skill(s) in /home/user/.agents/skills
  would-install code-quality
  would-install code-review
  would-install code-reviewer
  would-install differential-review

A project-local preview:

npx opencode-power-pack install --profile feature-dev --project --dry-run

Example output:

Plan for 4 skill(s) in /path/to/repository/.agents/skills
  would-install code-architect
  would-install code-explorer
  would-install code-reviewer
  would-install feature-dev

--dry-run does not create the destination or modify existing skills.

Updating installed skills

Existing skill directories are skipped by default:

npx opencode-power-pack install --profile review

Example result:

Selected 4 skill(s) in /home/user/.agents/skills
  skipped       code-quality
  skipped       code-review
  skipped       code-reviewer
  skipped       differential-review

To update them from the latest npm package:

npx opencode-power-pack@latest install --profile review --force

Example result:

Selected 4 skill(s) in /home/user/.agents/skills
  updated       code-quality
  updated       code-review
  updated       code-reviewer
  updated       differential-review

Curated profiles

Profiles are defined in:

skillsets.json

The catalog currently provides:

Profile Purpose
recommended Balanced development toolkit without specialized security and ML catalogs
review Comprehensive review, focused review, code quality, and differential review
feature-dev Feature workflow with explorer, architect, and reviewer specialists
frontend Frontend implementation and anti-generic design critique
security Security review, threat modeling, static analysis, validation, and reporting
huggingface Model discovery, inference, training, evaluation, Spaces, and AWS deployment
authoring Skill creation, MCP server creation, and paper summarization
project-memory Auditing and maintaining AGENTS.md and CLAUDE.md guidance

The catalog uses an explicit schema version:

{
  "schemaVersion": 1,
  "profiles": {},
  "dependencies": {}
}

Automatic dependency expansion

The installer computes the transitive closure of selected skill dependencies.

For example:

{
  "feature-dev": [
    "code-architect",
    "code-explorer",
    "code-reviewer"
  ]
}

Installing only feature-dev:

npx opencode-power-pack install feature-dev

automatically installs:

code-architect
code-explorer
code-reviewer
feature-dev

Other dependency relationships covered by the catalog include:

Project memory

agents-md-revise requires the rule-resolution resources shipped by agents-md-improver:

{
  "agents-md-revise": [
    "agents-md-improver"
  ]
}

SageMaker deployment

The SageMaker deployment planner coordinates five specialist workflows:

{
  "hf-cloud-sagemaker-deployment-planner": [
    "hf-cloud-aws-context-discovery",
    "hf-cloud-python-env-setup",
    "hf-cloud-sagemaker-iam-preflight",
    "hf-cloud-serving-image-selection",
    "hf-cloud-sagemaker-production-defaults"
  ]
}

Semgrep rule variants

{
  "semgrep-rule-variant-creator": [
    "semgrep-rule-creator"
  ]
}

This prevents selectively installed coordinator skills from being unusable because required companion workflows are missing.

Safe replacement and concurrency handling

Each installation is staged before the destination is changed:

1. Acquire a per-skill destination lock.
2. Copy the new skill into a temporary staging directory.
3. Add provenance, notices, and licenses.
4. Move the existing destination to a recoverable backup.
5. Promote the staged copy.
6. Restore the backup if promotion fails.
7. Remove staging, backup, and lock artifacts.

A per-destination lock prevents two installer processes from replacing the same skill concurrently.

If another installation is already updating the skill, the command reports the exact lock path:

Error: Another installation is updating code-review.
If no installer is running, remove
/home/user/.agents/skills/code-review.opp-lock.

If promotion and rollback both fail, the error includes:

  • The retained backup path.
  • The promotion failure.
  • The rollback failure.

Successful installation is not incorrectly reported as failed merely because cleanup of a backup, staging directory, or lock encounters an error. Instead, installation succeeds with an actionable warning.

Provenance and licenses

A selectively copied skill must remain independently auditable after the npm cache is removed.

Every installed skill therefore includes:

code-review/
├── SKILL.md
├── agents/
│   └── openai.yaml
├── UPSTREAMS.json
├── THIRD_PARTY_NOTICES.md
└── LICENSES/

This preserves:

  • Immutable upstream repository and commit information.
  • Original source paths and Git blob identifiers.
  • Adaptation classifications.
  • Third-party notices.
  • Apache 2.0 and MIT license texts.

This fixes the otherwise broken see UPSTREAMS.json references in selectively copied SKILL.md files.

Distinguishing the review workflows

The technical IDs remain unchanged to preserve compatibility:

code-review
code-reviewer

Codex-facing metadata now gives them distinct names.

Comprehensive review

interface:
  display_name: "Comprehensive Code Review"
  short_description: "Review a PR, branch, range, or complete change set."
  default_prompt: "Use $code-review to review the complete change set."

Use $code-review for:

  • Pull requests.
  • Branches.
  • Commit ranges.
  • Complete pending diffs.
  • Merge decisions.
  • Multi-lens review with candidate validation and confidence filtering.

Focused review

interface:
  display_name: "Focused Code Review"
  short_description: "Review one file, function, or small local change."
  default_prompt: "Use $code-reviewer for a focused review of this change."

Use $code-reviewer for:

  • One file.
  • One function.
  • A small local change.
  • Focused iteration during development.
  • The feature-dev quality-review phase.

The workflows remain complementary:

Situation Use
Complete PR or branch review $code-review
Commit range or complete pending diff $code-review
Merge decision $code-review
One file or function $code-reviewer
Small local iteration $code-reviewer
feature-dev quality phase $code-reviewer

Documentation changes

The README now includes:

  • Selective npm installation.
  • Complete command examples.
  • Profile descriptions.
  • Global and repository-local destinations.
  • Preview and update instructions.
  • Node.js 20 and npm/npx requirements.
  • Full plugin versus selective installation guidance.
  • Pi package filtering guidance.
  • A comparison between comprehensive and focused code review.

Issues found and fixed during review

The implementation went through a complete review before this PR was prepared.

The review found and corrected:

  1. Missing Node.js/npm prerequisites in the documentation.
  2. Missing real-world validation of the packed npm executable.
  3. Missing test coverage for the default global destination.
  4. Missing companion dependency for agents-md-revise.
  5. Missing SageMaker planner companion dependencies.
  6. An overly strong claim that force replacement was fully atomic.
  7. Cleanup errors that could incorrectly report a successful installation as failed.
  8. Repository-local installation using the current directory instead of the Git root.
  9. Concurrent updates being able to interleave destination replacement.
  10. Rollback failures omitting the recoverable backup path.
  11. Selectively installed skills losing provenance and license materials.
  12. Missing regression coverage for concurrent lock handling.

After those corrections, the final review completed all seven review lenses with no unresolved or reportable findings.

Test coverage

New tests cover:

  • Profile and dependency references.
  • Transitive dependency expansion.
  • Individual-skill selection.
  • Profile and individual-skill combinations.
  • Unknown skills and profiles.
  • Initial installation.
  • Existing-skill skipping.
  • Forced replacement.
  • Dry-run behavior.
  • Default global destination.
  • Git-root project destination from nested directories.
  • Coordinator companion skills.
  • Provenance, notices, and license copying.
  • Per-destination concurrency locks.
  • Direct execution through npm bin symlinks.
  • Installation and execution of the real packed npm tarball.
  • Publication of installer, profiles, and Codex metadata.
  • Distinct Codex-facing review identities.

Verification results

Complete test suite

npm test
359 tests
359 passed
0 failed

OpenCode smoke test

npm run smoke:opencode
OpenCode 1.18.7: 11 native commands and 3 agents verified

Node.js 20 compatibility

npx --yes node@20 --test \
  tests/selective-installer.test.mjs \
  tests/codex-plugin.test.mjs \
  tests/package-surface.test.mjs

18 tests
18 passed
0 failed

npm package validation

The test suite creates a real tarball, installs it into a clean temporary project, and executes:

node_modules/.bin/opencode-power-pack list

The executable successfully loads its packaged skillsets.json and skill catalog.

npm publication dry-run

npm publish --dry-run

Package: opencode-power-pack@0.4.0
Package size: 791,742 bytes
Unpacked size: 2,470,569 bytes
Entries: 306

Diff validation

git diff --check
clean

Final review

Convention-compliance roles: complete
Diff-only bug scan: complete
Deep-context bug scan: complete
Concurrency and state scan: complete
Error-handling and edge-case scan: complete
Test-coverage scan: complete
Cross-checking and validation: complete
Unresolved findings: 0
Reportable findings: 0

npm release readiness

The release metadata is prepared for the first public npm publication:

{
  "version": "0.4.0",
  "publishConfig": {
    "access": "public",
    "registry": "https://registry.npmjs.org/"
  },
  "scripts": {
    "prepublishOnly": "npm test"
  }
}

This ensures that:

  • Publication targets the official public npm registry.
  • The complete 359-test suite runs before a real publication.
  • The package and Codex plugin metadata use the same 0.4.0 version.
  • The package name remains unscoped and can be installed as npx opencode-power-pack.

The authenticated npm account was verified through npm whoami, and the package name currently returns E404, so the first successful publication will claim it.

Compatibility

  • Existing skill IDs remain unchanged.
  • Existing $code-review references continue to work.
  • Existing $code-reviewer and feature-dev references continue to work.
  • Full Codex, OpenCode, and Pi package installation remains supported.
  • The selective npm installer is an additional installation path.
  • No new runtime npm dependencies are introduced.
  • This PR does not publish the package to npm.

@waybarrios
waybarrios merged commit 086e9ba into main Aug 13, 2026
2 checks passed
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