Skip to content

feat(skills): install agent skills globally#72

Open
tonychang04 wants to merge 2 commits intomainfrom
feat/install-skills-globally
Open

feat(skills): install agent skills globally#72
tonychang04 wants to merge 2 commits intomainfrom
feat/install-skills-globally

Conversation

@tonychang04
Copy link
Copy Markdown
Contributor

@tonychang04 tonychang04 commented Apr 17, 2026

Summary

  • Pass -g to both npx skills add invocations in installSkills() so InsForge agent skills and find-skills install to the user-level skills store (~/.agents/skills/, with per-agent symlinks into ~/.claude/skills/, ~/.codex/skills/, etc.) instead of project-local.
  • Matches the pattern used by gstack and other agent toolchains: skills are project-agnostic with no per-project state, so one install per machine suffices.
  • Side benefit: cwd no longer matters for the install, which makes the install-before-mkdir ordering issue in the --template flow moot (supersedes fix(link): install agent skills before creating template subdir #70 in spirit).

What still lives in the project

Only ./.insforge/project.json (project_id, appkey, api_key, oss_host). OAuth credentials at ~/.insforge/credentials.json were already global and are untouched.

Test plan

  • npm run build — green
  • npm run lint — green
  • npx vitest run — 69 pass, 13 skipped
  • Verified bundled dist/index.js contains the -g flag
  • Ran the patched npx skills add insforge/agent-skills -g -y -a … (full agent list) in a fresh empty temp dir:
    • cwd stayed empty (no .claude/, .codex/, .insforge/ etc. created)
    • Skills landed in ~/.agents/skills/{insforge, insforge-cli, insforge-debug, insforge-integrations} with symlinks under ~/.claude/skills/
    • ~/.insforge/credentials.json mtime unchanged
  • Smoke-test a real insforge link end-to-end against a project after merge

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Updated package version to 0.1.53
  • Improvements

    • Skills are now installed globally for system-wide accessibility

Pass `-g` to `npx skills add` so InsForge agent skills and find-skills
land in the user-level skills store (~/.agents/skills/, with per-agent
symlinks into ~/.claude/skills/, ~/.codex/skills/, etc.) instead of
inside the project directory.

This matches how gstack and other agent toolchains ship their skills:
the skills themselves are project-agnostic and have no per-project
state, so one install per machine is enough. The only thing `link`
still writes to the project is `./.insforge/project.json` (project_id,
api_key, oss_host).

Side benefit: cwd no longer matters for the install, so the
install-before-mkdir ordering bug in the --template flow is also moot.

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

coderabbitai bot commented Apr 17, 2026

Walkthrough

Version bump to 0.1.53 paired with modifications to installSkills() function to add the -g global flag to both skill installation commands and corresponding log messages reflecting the global installation mode.

Changes

Cohort / File(s) Summary
Version Bump
package.json
Updated @insforge/cli version from 0.1.52 to 0.1.53.
Global Skill Installation
src/lib/skills.ts
Added -g flag to both npx skills add commands for InsForge agent skills and Vercel Labs find-skills; updated corresponding log messages from "Installing ..." to "Installing ... (global)".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • Fermionic-Lyu
  • jwfing
  • CarmenDou

Poem

🐰 A global hop, a flag so small,
-g unlocks the skills for all,
The version climbs, the message bright,
InsForge installs with global might! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding the -g flag to install agent skills globally. It directly relates to the primary objective in src/lib/skills.ts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/install-skills-globally

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

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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/skills.ts`:
- Around line 73-74: The retry/recovery shell commands used in the execAsync
calls that install skills globally are missing the -g flag in their fallback
suggestions; update the recovery/echo strings that accompany the execAsync
invocations (the same command string used in the initial install, e.g., the npx
skills add insforge/agent-skills ... invocation passed to execAsync) so every
recovery or retry example includes -g to match global mode (search for execAsync
calls in src/lib/skills.ts that reference "npx skills add insforge/agent-skills"
and ensure the echoed/recovery commands on the fallback paths include the -g
flag).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d7294884-907a-4df8-83ac-21f9200c7931

📥 Commits

Reviewing files that changed from the base of the PR and between cea7763 and 4de53c5.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • src/lib/skills.ts

Comment thread src/lib/skills.ts
Comment on lines +73 to +74
if (!json) clack.log.info('Installing InsForge agent skills (global)...');
await execAsync('npx skills add insforge/agent-skills -g -y -a antigravity -a augment -a claude-code -a cline -a codex -a cursor -a gemini-cli -a github-copilot -a kilo -a qoder -a qwen-code -a roo -a trae -a windsurf', {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Keep retry guidance consistent with global mode.

Line 74 and Line 89 install globally, but the recovery commands in Line 82 and Line 97 omit -g. That can send users back to local installs.

Suggested fix
-      clack.log.info('Run `npx skills add insforge/agent-skills` once resolved to see the full output.');
+      clack.log.info('Run `npx skills add insforge/agent-skills -g` once resolved to see the full output.');
...
-      clack.log.info('Run `npx skills add https://github.com/vercel-labs/skills --skill find-skills` once resolved.');
+      clack.log.info('Run `npx skills add https://github.com/vercel-labs/skills --skill find-skills -g` once resolved.');

Also applies to: 82-83, 88-89, 97-98

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/skills.ts` around lines 73 - 74, The retry/recovery shell commands
used in the execAsync calls that install skills globally are missing the -g flag
in their fallback suggestions; update the recovery/echo strings that accompany
the execAsync invocations (the same command string used in the initial install,
e.g., the npx skills add insforge/agent-skills ... invocation passed to
execAsync) so every recovery or retry example includes -g to match global mode
(search for execAsync calls in src/lib/skills.ts that reference "npx skills add
insforge/agent-skills" and ensure the echoed/recovery commands on the fallback
paths include the -g flag).

@tonychang04 tonychang04 requested a review from CarmenDou April 17, 2026 23:46
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