-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add selective skill installation to reduce context token usage #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,7 +24,6 @@ DOTDIRS := .agent .agents .amazonq .augment .claude .cursor .gemini .idx .junie | |||||||||||||||||
| DOTDIRS_SRC_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) | ||||||||||||||||||
|
|
||||||||||||||||||
| SKILLS_FILE := $(dir $(lastword $(MAKEFILE_LIST)))SKILLS.txt | ||||||||||||||||||
| SKILL_REPOS := $(shell cat $(SKILLS_FILE) 2>/dev/null) | ||||||||||||||||||
|
|
||||||||||||||||||
| # ==================================================================================== | ||||||||||||||||||
| # ROOT TARGETS | ||||||||||||||||||
|
|
@@ -34,6 +33,7 @@ SKILL_REPOS := $(shell cat $(SKILLS_FILE) 2>/dev/null) | |||||||||||||||||
| sync: ruler-prepare ## Sync project commands, skills, and MCP configuration to assistant-specific directories. | ||||||||||||||||||
| @make ruler-apply-global | ||||||||||||||||||
| @make commands-sync | ||||||||||||||||||
| @make skills-clean | ||||||||||||||||||
| @make skills-install | ||||||||||||||||||
| @make skills-sync | ||||||||||||||||||
| @make mcp-sync | ||||||||||||||||||
|
|
@@ -78,27 +78,53 @@ ruler-rules-copy: ## Copy rules to .ruler directory. | |||||||||||||||||
| # SKILLS | ||||||||||||||||||
| # ==================================================================================== | ||||||||||||||||||
|
|
||||||||||||||||||
| .PHONY: skills-clean | ||||||||||||||||||
| skills-clean: ## Remove all globally installed skills for a clean reinstall. | ||||||||||||||||||
| @for target in $(SKILLS_TARGET_DIRS); do \ | ||||||||||||||||||
| if [ -d "$$target" ]; then \ | ||||||||||||||||||
| rm -rf "$$target"/*; \ | ||||||||||||||||||
|
||||||||||||||||||
| rm -rf "$$target"/*; \ | |
| find "$$target" -mindepth 1 -maxdepth 1 -exec rm -rf {} +; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, find and examine the Makefile
fd -t f "Makefile$" --maxdepth 2Repository: shunkakinoki/dotagents
Length of output: 74
🏁 Script executed:
# Look for the Makefile and examine the context around lines 83-86
if [ -f "Makefile" ]; then
echo "=== Makefile found ==="
sed -n '75,95p' Makefile
fiRepository: shunkakinoki/dotagents
Length of output: 895
🏁 Script executed:
# Test rm -rf behavior with hidden files to verify the claim
# Create a test directory structure to validate the issue
mkdir -p /tmp/test_cleanup/testdir
cd /tmp/test_cleanup/testdir
# Add visible and hidden files
touch visible_file.txt .hidden_file .another_hidden
mkdir visible_dir .hidden_dir
# Test 1: rm -rf testdir/*
echo "Before rm -rf testdir/*:"
ls -la testdir/
# Clone the directory for testing
cp -r testdir testdir_copy1
rm -rf testdir_copy1/*
echo "After rm -rf testdir_copy1/*:"
ls -la testdir_copy1/
echo "Hidden files remain: $(ls -la testdir_copy1/ | grep -c '^\.')"
# Test 2: The proposed fix pattern
cp -r testdir testdir_copy2
rm -rf testdir_copy2/* testdir_copy2/.[!.]* testdir_copy2/..?*
echo "After proposed fix (rm -rf testdir_copy2/* testdir_copy2/.[!.]* testdir_copy2/..?*):"
ls -la testdir_copy2/
echo "Remaining items: $(ls -la testdir_copy2/ | wc -l)"Repository: shunkakinoki/dotagents
Length of output: 674
🏁 Script executed:
# Test rm -rf behavior with hidden files
mkdir -p /tmp/rm_test/target
cd /tmp/rm_test
# Create test files and directories
touch target/visible_file.txt
touch target/.hidden_file
touch target/.bashrc
mkdir target/.hidden_dir
mkdir target/visible_dir
echo "=== Before rm -rf target/* ==="
ls -la target/ | tail -n +4
# Test the current approach
rm -rf target/*
echo ""
echo "=== After rm -rf target/* ==="
ls -la target/ | tail -n +4
if [ -f target/.hidden_file ] || [ -d target/.hidden_dir ]; then
echo "CONFIRMED: Hidden files/dirs remain after rm -rf target/*"
else
echo "Hidden files were removed"
fiRepository: shunkakinoki/dotagents
Length of output: 664
🏁 Script executed:
# Now test the proposed fix
mkdir -p /tmp/rm_test2/target
cd /tmp/rm_test2
# Create test files
touch target/visible_file.txt
touch target/.hidden_file
touch target/.bashrc
mkdir target/.hidden_dir
echo "=== Before proposed fix ==="
ls -la target/ | tail -n +4
# Test the proposed fix: rm -rf target/* target/.[!.]* target/..?*
rm -rf target/* target/.[!.]* target/..?*
echo ""
echo "=== After proposed fix (rm -rf target/* target/.[!.]* target/..?*) ==="
ls -la target/ | tail -n +4
remaining=$(ls -la target/ | wc -l)
if [ "$remaining" -le 3 ]; then
echo "SUCCESS: All files removed (only . and .. remain)"
else
echo "Some files remain"
fiRepository: shunkakinoki/dotagents
Length of output: 457
skills-clean does not remove hidden files, leaving partial cleanup that can affect reinstall behavior.
Line 85 only deletes *, which excludes dotfiles and dotdirectories. These remnants can interfere with a clean reinstall.
Proposed fix
- rm -rf "$$target"/*; \
+ rm -rf "$$target"/* "$$target"/.[!.]* "$$target"/..?*; \📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @for target in $(SKILLS_TARGET_DIRS); do \ | |
| if [ -d "$$target" ]; then \ | |
| rm -rf "$$target"/*; \ | |
| echo "Cleaned $$target"; \ | |
| `@for` target in $(SKILLS_TARGET_DIRS); do \ | |
| if [ -d "$$target" ]; then \ | |
| rm -rf "$$target"/* "$$target"/.[!.]* "$$target"/..?*; \ | |
| echo "Cleaned $$target"; \ |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Makefile` around lines 83 - 86, The cleanup loop over SKILLS_TARGET_DIRS
currently only removes non-hidden entries via rm -rf "$$target"/*; update the
loop that iterates over $(SKILLS_TARGET_DIRS) (the shell variable target) to
remove all entries including dotfiles safely—for example replace the rm line
with a safe command that removes every child entry without touching the parent
directory such as using find: find "$$target" -mindepth 1 -maxdepth 1 -exec rm
-rf -- {} + so hidden files and dirs are also removed while avoiding removing
"." or "..".
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grep filters use \s (e.g., grep -v '^\s*#'), but standard grep (BRE) doesn’t recognize \s as whitespace. This will fail to strip comments/blank lines and can result in trying to install a repo named # or an empty repo. Use POSIX character classes like ^[[:space:]]*# / ^[[:space:]]*$, or replace the whole pipeline with a single awk that skips comment/empty lines.
| @grep -v '^\s*#' $(SKILLS_FILE) | grep -v '^\s*$$' | while IFS= read -r line; do \ | |
| @awk '!/^[[:space:]]*#/ && NF' $(SKILLS_FILE) | while IFS= read -r line; do \ |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skills-install will report success even if $(SKILLS_FILE) is missing/unreadable: in a pipeline, the exit code is taken from the final while ...; do ...; done, which will exit 0 if it reads no lines, masking grep errors. Add an explicit existence/readability check for $(SKILLS_FILE) (and ideally fail if it contains no valid entries) before starting the install loop.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,101 @@ | ||
| antfu/skills | ||
| anthropics/claude-plugins-official | ||
| anthropics/knowledge-work-plugins | ||
| # Format: repo [skill1,skill2,...] (omit skills list to install all from repo) | ||
| # Lines starting with # are comments | ||
|
|
||
| # antfu/skills (17 total) - keep tooling, drop vue ecosystem | ||
| antfu/skills antfu,pnpm,slidev,tsdown,turborepo,vite,vitest | ||
|
|
||
| # anthropics/claude-plugins-official (19 total) - keep Claude/MCP dev skills | ||
| anthropics/claude-plugins-official claude-automation-recommender,claude-md-improver,frontend-design,writing-hookify-rules,build-mcp-app,build-mcp-server,build-mcpb,playground,agent-development,command-development,hook-development,mcp-integration,plugin-settings,plugin-structure,skill-development,skill-creator | ||
|
|
||
| # anthropics/knowledge-work-plugins (114 total) - keep dev/planning/search | ||
| anthropics/knowledge-work-plugins memory-management,start,task-management,update,knowledge-synthesis,search,search-strategy,source-management,architecture,code-review,debug,deploy-checklist,documentation,incident-response,standup,system-design,tech-debt,testing-strategy,analyze,build-dashboard,create-viz,data-visualization,explore-data,view-pdf | ||
|
|
||
| # austintgriffith/ethskills (1 total) - keep all | ||
| austintgriffith/ethskills | ||
|
|
||
| # better-auth/skills (6 total) - keep all | ||
| better-auth/skills | ||
|
|
||
| # blader/humanizer (1 total) - keep all | ||
| blader/humanizer | ||
|
|
||
| # cloudflare/skills (9 total) - keep all | ||
| cloudflare/skills | ||
| coreyhaines31/marketingskills | ||
|
|
||
| # coreyhaines31/marketingskills (34 total) - keep analytics only | ||
| coreyhaines31/marketingskills analytics-tracking | ||
|
|
||
| # garrytan/gstack (1 total) - keep all | ||
| garrytan/gstack | ||
| getsentry/skills | ||
| github/awesome-copilot | ||
| googleworkspace/cli | ||
| inference-sh/skills | ||
| obra/superpowers | ||
| PaulRBerg/agent-skills | ||
| mattpocock/skills | ||
|
|
||
| # getsentry/skills (24 total) - keep dev workflow skills | ||
| getsentry/skills agents-md,claude-settings-audit,code-review,code-simplifier,commit,create-branch,create-pr,find-bugs,gh-review-requests,gha-security-review,iterate-pr,pr-writer,security-review | ||
|
|
||
| # github/awesome-copilot (257 total) - keep essential dev/infra skills | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use official platform casing in comment text. Please change 🧰 Tools🪛 LanguageTool[uncategorized] ~34-~34: The official name of this software platform is spelled with a capital “H”. (GITHUB) [uncategorized] ~34-~34: The official name of this software platform is spelled with a capital “H”. (GITHUB) 🤖 Prompt for AI Agents |
||
| github/awesome-copilot chrome-devtools,conventional-commit,create-implementation-plan,create-readme,create-specification,dependabot,doublecheck,editorconfig,eval-driven-dev,git-commit,github-issues,make-repo-contribution,multi-stage-dockerfile,my-issues,my-pull-requests,playwright-generate-test,prd,pytest-coverage,refactor,refactor-plan,secret-scanning,security-review,typescript-mcp-server-generator,update-implementation-plan,webapp-testing | ||
|
|
||
| # googleworkspace/cli (93 total) - keep core gmail/calendar/drive | ||
| googleworkspace/cli gws-calendar,gws-calendar-agenda,gws-calendar-insert,gws-docs,gws-docs-write,gws-drive,gws-drive-upload,gws-gmail,gws-gmail-read,gws-gmail-send,gws-sheets,gws-sheets-read,gws-tasks | ||
|
|
||
| # inference-sh/skills (78 total) - keep core tools | ||
| inference-sh/skills web-search,web-research,ai-sdk,agent-browser,agent-ui | ||
|
|
||
| # obra/superpowers (14 total) - keep dev workflow | ||
| obra/superpowers dispatching-parallel-agents,executing-plans,finishing-a-development-branch,receiving-code-review,requesting-code-review,systematic-debugging,test-driven-development,using-git-worktrees,verification-before-completion,writing-plans,writing-skills | ||
|
|
||
| # PaulRBerg/agent-skills (23 total) - keep dev tools | ||
| PaulRBerg/agent-skills biome-js,bump-deps,bump-release,cli-gh,code-polish,code-review,code-simplify,effect-ts,md-docs,tailwind-css,yeet | ||
|
|
||
| # mattpocock/skills (18 total) - keep dev workflow | ||
| mattpocock/skills improve-codebase-architecture,prd-to-issues,prd-to-plan,qa,request-refactor-plan,tdd,triage-issue,write-a-prd | ||
|
|
||
| # max-sixty/worktrunk (1 total) - keep all | ||
| max-sixty/worktrunk | ||
| Merit-Systems/agentcash-skills | ||
| nextlevelbuilder/ui-ux-pro-max-skill | ||
|
|
||
| # Merit-Systems/agentcash-skills (13 total) - keep core | ||
| Merit-Systems/agentcash-skills agentcash,web-research | ||
|
|
||
| # nextlevelbuilder/ui-ux-pro-max-skill (7 total) - keep design only | ||
| nextlevelbuilder/ui-ux-pro-max-skill ui-ux-pro-max | ||
|
|
||
| # remotion-dev/skills (1 total) - keep all | ||
| remotion-dev/skills | ||
|
|
||
| # schpet/linear-cli (2 total) - keep all | ||
| schpet/linear-cli | ||
|
|
||
| # subsy/ralph-tui (4 total) - keep all | ||
| subsy/ralph-tui | ||
|
|
||
| # tobi/qmd (2 total) - keep all | ||
| tobi/qmd | ||
| trailofbits/skills | ||
|
|
||
| # trailofbits/skills (61 total) - keep security essentials | ||
| trailofbits/skills gh-cli,ask-questions-if-underspecified,code-maturity-assessor,secure-workflow-guide,semgrep,codeql,modern-python,insecure-defaults,supply-chain-risk-auditor,agentic-actions-auditor,fp-check | ||
|
|
||
| # vercel/ai (1 total) - keep all | ||
| vercel/ai | ||
|
|
||
| # vercel/ai-elements (1 total) - keep all | ||
| vercel/ai-elements | ||
|
|
||
| # vercel/chat (1 total) - keep all | ||
| vercel/chat | ||
|
|
||
| # vercel/turborepo (1 total) - keep all | ||
| vercel/turborepo | ||
| vercel-labs/agent-browser | ||
| vercel-labs/agent-skills | ||
|
|
||
| # vercel-labs/agent-browser (5 total) - keep core | ||
| vercel-labs/agent-browser agent-browser,vercel-sandbox | ||
|
|
||
| # vercel-labs/agent-skills (6 total) - keep core | ||
| vercel-labs/agent-skills vercel-composition-patterns,deploy-to-vercel,vercel-react-best-practices,vercel-cli-with-tokens | ||
|
|
||
| # vercel-labs/next-browser (1 total) - keep all | ||
| vercel-labs/next-browser | ||
|
|
||
| # vercel-labs/next-skills (3 total) - keep all | ||
| vercel-labs/next-skills | ||
|
|
||
| # vercel-labs/portless (3 total) - keep all | ||
| vercel-labs/portless | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syncalready hasruler-prepareas a prerequisite, and the recipe also callsmake ruler-apply-globalwhich itself depends onruler-prepare. Because these are.PHONY, this runs the prepare steps twice on everymake sync. Consider makingsyncdepend onruler-apply-global(instead ofruler-prepare) and removing the explicitmake ruler-apply-globalline, or otherwise restructuring soruler-prepareonly runs once per sync.