Add --install-skill for agent skills and Cursor rules - #4
Merged
Conversation
Ship packaged SKILL.md and a Cursor always-on rule (graphify-style) so agents know when to query agentmap before grep. Includes tests and docs. Co-authored-by: Cursor <cursoragent@cursor.com>
muhajirdev
marked this pull request as draft
June 14, 2026 15:26
Describe --install-skill on its own merits without comparing to other tools. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
…ot path - test asserts version derived from package.json (was hardcoded 0.6.0 → would go red after merging onto main 0.6.1) - dynamic-import skills/install.mjs inside the --install-skill branch and read VERSION inside installSkill(), so warm --any/--find queries never load it (matches the lazy ts-morph / lazy mcp.mjs discipline)
Owner
|
Thanks @muhajirdev! Solid addition — extends the agent-loop guidance to Cursor / Codex / OpenCode, and the security side is clean (whitelisted platforms, fixed literal path segments, atomic writes, no traversal). I pushed one commit to your branch with two fixes:
Full suite green (127/127). Mark it Ready for review whenever you're happy and I'll merge. 🙏 (Optional, non-blocking follow-ups: a |
# Conflicts: # README.md # agentmap.mjs
raymondchins
marked this pull request as ready for review
June 14, 2026 17:24
raymondchins
added a commit
that referenced
this pull request
Jun 14, 2026
4 tasks
13 tasks
raymondchins
added a commit
that referenced
this pull request
Jul 4, 2026
* Add --install-skill for agent skills and Cursor rules. Ship packaged SKILL.md and a Cursor always-on rule (graphify-style) so agents know when to query agentmap before grep. Includes tests and docs. Co-authored-by: Cursor <cursoragent@cursor.com> * Drop Graphify references from install-skill docs. Describe --install-skill on its own merits without comparing to other tools. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(install-skill): version-agnostic test + lazy-load installer off hot path - test asserts version derived from package.json (was hardcoded 0.6.0 → would go red after merging onto main 0.6.1) - dynamic-import skills/install.mjs inside the --install-skill branch and read VERSION inside installSkill(), so warm --any/--find queries never load it (matches the lazy ts-morph / lazy mcp.mjs discipline) --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: raymondchins <raymondchin.s@gmail.com>
raymondchins
added a commit
that referenced
this pull request
Jul 4, 2026
raymondchins
added a commit
that referenced
this pull request
Jul 26, 2026
The 120s watchdog signalled only $_am_pid. When the runner resolves to fallback #4 (`npx --no-install @raymondchins/agentmap`), that PID is the npx wrapper and the real work is a grandchild `node .../bin/agentmap`, so killing the wrapper left the grandchild reparented to init and still spinning a full core. Observed today: `npm exec @raymondchins/agentmap` (pid 5361) whose child (pid 7386) survived and had to be killed by hand at ~30 W each. `set -m` puts the background job in its own process group (pgid == pid), so `kill -- -$_am_pid` reaches wrapper and grandchildren. SIGTERM first so a healthy run can flush, SIGKILL only if it ignores it; plain-pid fallbacks cover shells that do not honour job control here. Verified: with the old form a spinning grandchild survived at ppid=1, 100% CPU 8s after the watchdog fired; with this change it is reaped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
raymondchins
added a commit
that referenced
this pull request
Jul 27, 2026
The 120s watchdog signalled only $_am_pid. When the runner resolves to fallback #4 (`npx --no-install @raymondchins/agentmap`), that PID is the npx wrapper and the real work is a grandchild `node .../bin/agentmap`, so killing the wrapper left the grandchild reparented to init and still spinning a full core. Observed today: `npm exec @raymondchins/agentmap` (pid 5361) whose child (pid 7386) survived and had to be killed by hand at ~30 W each. `set -m` puts the background job in its own process group (pgid == pid), so `kill -- -$_am_pid` reaches wrapper and grandchildren. SIGTERM first so a healthy run can flush, SIGKILL only if it ignores it; plain-pid fallbacks cover shells that do not honour job control here. Verified: with the old form a spinning grandchild survived at ppid=1, 100% CPU 8s after the watchdog fired; with this change it is reaped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--install-skillso agents get persistent guidance on when and how to use agentmap before falling back to grep.--install-skillCLI flag with--platform(claude,cursor,agents,all),--project/--global, and--dry-runskills/SKILL.md(Claude / agents skill) andskills/cursor-rule.mdc(Cursor always-on rule)skills/install.mjshandles atomic writes and version stampingInstall destinations
claude.claude/skills/agentmap/SKILL.md(or~/.claude/...with--global)agents.agents/skills/agentmap/SKILL.mdcursor.cursor/rules/agentmap.mdc(project only)Usage
Motivation
Without a skill or rule, coding agents default to grep even when
agentmap --findor--relateswould be faster and more precise. This copies packaged agent guidance into the standard skill/rule locations each platform already reads.Test plan
npm test— 127/127 pass (3 new install-skill tests)agentmap --install-skill --dry-runin a sample repoagentmap --install-skill --platform cursorand confirm.cursor/rules/agentmap.mdcis created