Skip to content

add skill-auto-installer: intent-based auto-install meta-skill#413

Open
maimai-dot wants to merge 1 commit into
rohitg00:mainfrom
maimai-dot:add/skill-auto-installer
Open

add skill-auto-installer: intent-based auto-install meta-skill#413
maimai-dot wants to merge 1 commit into
rohitg00:mainfrom
maimai-dot:add/skill-auto-installer

Conversation

@maimai-dot
Copy link
Copy Markdown

@maimai-dot maimai-dot commented May 17, 2026

Summary

Add skill-auto-installer, a meta-skill for Claude Code that automatically discovers, installs, and invokes skills based on natural language intent.

What it does

User says: "Generate a PDF report from this data"
→ Intent analysis detects "PDF" → pdf skill auto-installed → report generated. Zero manual steps.

Architecture

  • Dual-layer matching: Hook (regex pre-scan, ~ms) + Skill (semantic analysis, ~s)
  • 17 intent domains: PDF, Excel, PPT, Word, frontend design, Canvas, brand guidelines, MCP builder, Claude API, webapp testing, and more
  • Silent background install: No user prompts during installation
  • Batch support: One sentence can trigger multiple skills

Links

Summary by CodeRabbit

  • New Features
    • Added the skill-auto-installer plugin, enabling natural-language intent analysis with dual-layer matching and automatic installation support for enhanced skill discovery and setup.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

📝 Walkthrough

Walkthrough

This PR introduces the skill-auto-installer plugin, a new feature that performs natural-language intent analysis to automatically discover and install matching skills from local marketplace clones. The plugin registers its specification, metadata manifest, and directory entry.

Changes

Skill Auto-Installer Plugin

Layer / File(s) Summary
Skill Auto-Installer Specification
plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md
Defines the four-phase workflow: intent analysis mapping natural language to task domains, installation-status checking via ~/.claude/skills/, marketplace-based auto-installation from cloned sources, and mandatory post-install skill invocation. Specifies operational rules for silent installation, batch matching, marketplace preference, and activity logging to ~/.claude/skill-auto-installer.log.
Plugin Manifest and Directory Registration
plugins/skill-auto-installer/.claude-plugin/plugin.json, README.md
Plugin manifest sets name, semantic version (1.0.0), author (QM152), license (MIT), and keywords for intent analysis and skill discovery. README entry registers the plugin in the plugin catalog alongside existing entries.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐰 A skill that installs skills—how delightfully recursive!
Intent meets marketplace, no hands required,
Auto-magic wiring, all systems fired! 🔌

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: introducing a new skill-auto-installer meta-skill that performs intent-based automatic installation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

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: 4

🧹 Nitpick comments (1)
plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md (1)

67-67: ⚡ Quick win

Enhance logging format for better auditability.

The current log format captures only the skill name and trigger keyword. This makes it difficult to:

  • Debug installation or invocation failures
  • Track which marketplace version was installed
  • Audit security incidents
  • Correlate user actions with outcomes
📊 Recommended enhanced log format
5. **记录日志**: 每次安装后在 `~/.claude/skill-auto-installer.log` 追加一行:

[YYYY-MM-DD HH:MM:SS] ACTION=install SKILL= TRIGGER=<关键词> SOURCE= STATUS=<success|failure> INVOKED=<yes|no>


每次调用技能后追加:

[YYYY-MM-DD HH:MM:SS] ACTION=invoke SKILL= REQUEST=<用户请求摘要> STATUS=<success|failure> ERROR=<错误信息>

This structured format enables:

  • Easy parsing with grep or log analysis tools
  • Clear audit trail for security review
  • Debugging failed installations or invocations
  • Tracking skill usage patterns over time
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md` at line
67, Update the log format instruction in SKILL.md where it currently specifies
appending `[YYYY-MM-DD HH:MM] <skill-name> — <触发关键词>` to
`~/.claude/skill-auto-installer.log`; replace it with the recommended structured
entries for both install and invoke events such that install lines include
timestamp, ACTION=install, SKILL=<skill-name>, TRIGGER=<关键词>,
SOURCE=<marketplace-path>, STATUS=<success|failure>, INVOKED=<yes|no> and invoke
lines include timestamp, ACTION=invoke, SKILL=<skill-name>, REQUEST=<用户请求摘要>,
STATUS=<success|failure>, ERROR=<错误信息>, so consumers of the log can parse and
audit installations and invocations reliably.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md`:
- Around line 45-55: The auto-install Phase 3 uses unvalidated <skill-name> and
a blind cp -r which risks path traversal, accidental overwrites, and ambiguous
source selection; update the logic in SKILL.md and any related scripts to
validate the skill name (e.g., allow only [A-Za-z0-9_-] in the skill_name
variable), use find to populate a results array, handle zero or multiple matches
(fail or choose explicitly and log which results[0] is used), detect an existing
target directory (target="$HOME/.claude/skills/$skill_name") and abort or prompt
instead of overwriting, and perform a safe copy from the chosen source to the
target rather than an unconditional cp -r.
- Around line 41-42: The shell snippet using the placeholder <skill-name> in
SKILL.md must validate the runtime-substituted skill-name before embedding it in
a shell command to prevent path traversal and command injection; update the code
that constructs the command (the snippet using "ls
~/.claude/skills/<skill-name>/ ...") to first ensure the skill-name matches a
safe pattern (only alphanumeric, hyphen, underscore), reject any values
containing "/", "\" or "..", and/or enforce that the value exists in the
predefined intent-to-skill mapping (the mapping table referenced around lines
17-35) before executing the ls check or echo.
- Around line 63-66: The SKILL.md policy currently enables a critical security
risk by combining "静默安装" (Rule 1) and "安装后立即使用" (Rule 4): silently installing
skills from the cloned marketplace and immediately executing them allows
arbitrary code execution; change the workflow so that before any install
triggered by the auto-installer you require explicit user confirmation showing
skill name, source, author and requested permissions (replace Rule 1 with a
confirmation requirement), do not auto-execute after install (replace Rule 4 to
"提示用户调用" only), and optionally enforce a trusted-marketplace/allow-list and
signature verification for skills (add a mandatory verification step referenced
in the SKILL.md policy) so installs from untrusted marketplaces are blocked or
flagged for manual approval.

In `@README.md`:
- Line 322: The README's "Dual-layer matching (Hook regex pre-scan ~ms + Skill
semantic analysis ~s)" claim is inconsistent with SKILL.md which only documents
a single Phase 1 keyword mapping intent analysis; either update SKILL.md to
describe the hook pre-scan and timing (e.g., add a "Dual-Layer Architecture"
section specifying the Hook pre-scan regex step and the semantic analysis step
and their ~ms/~s expectations), or remove/simplify the dual-layer phrase from
README.md (the table row for plugins/skill-auto-installer) to match the
implemented behavior; locate references to the hook/pre-scan in the plugin code
under plugins/skill-auto-installer/ (search for "hook", "pre-scan", "regex",
"dual-layer") to confirm which fix is appropriate before changing SKILL.md or
README.md.

---

Nitpick comments:
In `@plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md`:
- Line 67: Update the log format instruction in SKILL.md where it currently
specifies appending `[YYYY-MM-DD HH:MM] <skill-name> — <触发关键词>` to
`~/.claude/skill-auto-installer.log`; replace it with the recommended structured
entries for both install and invoke events such that install lines include
timestamp, ACTION=install, SKILL=<skill-name>, TRIGGER=<关键词>,
SOURCE=<marketplace-path>, STATUS=<success|failure>, INVOKED=<yes|no> and invoke
lines include timestamp, ACTION=invoke, SKILL=<skill-name>, REQUEST=<用户请求摘要>,
STATUS=<success|failure>, ERROR=<错误信息>, so consumers of the log can parse and
audit installations and invocations reliably.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9a8b4afe-c75e-494b-9bcd-30ac9b463889

📥 Commits

Reviewing files that changed from the base of the PR and between ebdf1d5 and 3c3e22c.

📒 Files selected for processing (3)
  • README.md
  • plugins/skill-auto-installer/.claude-plugin/plugin.json
  • plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md

Comment on lines +41 to +42
```bash
ls ~/.claude/skills/<skill-name>/ 2>/dev/null && echo "INSTALLED" || echo "MISSING"
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 | 🟠 Major | ⚡ Quick win

Validate skill-name before using in shell commands.

The <skill-name> placeholder will be substituted at runtime with a value derived from intent analysis. Without validation, a malicious or malformed skill name could enable path traversal or command injection.

🛡️ Recommended validation before shell execution

Before constructing the command, validate that skill-name:

  • Contains only allowed characters (alphanumeric, hyphens, underscores)
  • Does not contain path traversal sequences (.., /, \)
  • Matches one of the known skill names from the mapping table

Example validation pattern:

# Ensure skill-name contains only safe characters
if [[ ! "$skill_name" =~ ^[a-zA-Z0-9_-]+$ ]]; then
  echo "Invalid skill name"
  exit 1
fi

Or restrict to the predefined set from the intent table (lines 17-35).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md` around
lines 41 - 42, The shell snippet using the placeholder <skill-name> in SKILL.md
must validate the runtime-substituted skill-name before embedding it in a shell
command to prevent path traversal and command injection; update the code that
constructs the command (the snippet using "ls ~/.claude/skills/<skill-name>/
...") to first ensure the skill-name matches a safe pattern (only alphanumeric,
hyphen, underscore), reject any values containing "/", "\" or "..", and/or
enforce that the value exists in the predefined intent-to-skill mapping (the
mapping table referenced around lines 17-35) before executing the ls check or
echo.

Comment on lines +45 to +55
### Phase 3: 自动安装

如果技能缺失,从 marketplace 复制:

```bash
# 搜索所有 marketplace 中的该技能
find ~/.claude/plugins/marketplaces/ -maxdepth 3 -type d -name "<skill-name>" 2>/dev/null

# 如果找到,复制到 skills 目录
cp -r <source-path> ~/.claude/skills/<skill-name>
```
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 | 🟠 Major | ⚡ Quick win

Add validation and safe copy practices.

The auto-installation phase has several safety concerns:

  1. Path traversal risk: <skill-name> is used in both find and cp without validation (same issue as Phase 2).
  2. Overwrite without confirmation: cp -r will silently overwrite existing skills.
  3. Multiple matches: If find returns multiple results, the workflow doesn't specify which to use.
🛡️ Recommended safety improvements
# 1. Validate skill-name (alphanumeric, hyphens, underscores only)
if [[ ! "$skill_name" =~ ^[a-zA-Z0-9_-]+$ ]]; then
  echo "Invalid skill name: $skill_name"
  exit 1
fi

# 2. Search marketplace with validated name
results=($(find ~/.claude/plugins/marketplaces/ -maxdepth 3 -type d -name "$skill_name" 2>/dev/null))

# 3. Handle multiple or zero results
if [ ${`#results`[@]} -eq 0 ]; then
  echo "Skill not found in marketplace"
  exit 1
elif [ ${`#results`[@]} -gt 1 ]; then
  echo "Multiple versions found, using first: ${results[0]}"
fi

# 4. Check if target already exists
target="$HOME/.claude/skills/$skill_name"
if [ -d "$target" ]; then
  echo "Skill already installed, skipping"
  exit 0
fi

# 5. Safe copy
cp -r "${results[0]}" "$target"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md` around
lines 45 - 55, The auto-install Phase 3 uses unvalidated <skill-name> and a
blind cp -r which risks path traversal, accidental overwrites, and ambiguous
source selection; update the logic in SKILL.md and any related scripts to
validate the skill name (e.g., allow only [A-Za-z0-9_-] in the skill_name
variable), use find to populate a results array, handle zero or multiple matches
(fail or choose explicitly and log which results[0] is used), detect an existing
target directory (target="$HOME/.claude/skills/$skill_name") and abort or prompt
instead of overwriting, and perform a safe copy from the chosen source to the
target rather than an unconditional cp -r.

Comment on lines +63 to +66
1. **静默安装**: 不要在安装过程中询问用户"是否安装",直接安装。只在安装完成后告知用户安装了哪些技能。
2. **批量匹配**: 一个用户请求可能匹配多个技能(如"设计前端页面并导出PDF"),全部安装。
3. **优先 marketplace**: 始终从已克隆的 marketplace 复制,不尝试 `npx skills add`(那需要独立仓库)。
4. **安装后立即使用**: 技能安装完成后,必须调用该技能来完成用户的任务。
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 | 🔴 Critical | 🏗️ Heavy lift

Critical security risk: Silent installation with immediate execution.

Rules 1 and 4 create a dangerous workflow:

  • Rule 1 installs skills silently without user confirmation
  • Rule 4 immediately executes the newly installed skill

This combination enables arbitrary code execution if:

  • A malicious skill exists in any cloned marketplace
  • Intent keywords match the malicious skill
  • The user makes a request containing those keywords

Attack scenario:

  1. User clones a marketplace that includes a malicious pdf skill
  2. User says "Generate a PDF report"
  3. System auto-installs malicious pdf skill silently
  4. System immediately invokes malicious skill with user's request
  5. Malicious code executes with user's permissions

There is no integrity verification, no signature checking, no allow-list, and no user review opportunity.

🔒 Recommended security-first redesign

Option 1: Require explicit confirmation (safest)

3. **需要确认**: 安装前必须获得用户批准,显示技能来源、作者、权限需求。
4. **安装后提示使用**: 安装完成后,建议用户调用,但不自动执行。

Option 2: Trusted marketplace + allow-list

3. **仅信任的市场**: 只从官方认证的 marketplace 安装,维护已验证技能的 allow-list。
3a. **签名验证**: 验证技能的数字签名与已知发布者匹配。
4. **沙盒首次运行**: 首次调用新安装的技能时在受限环境中运行。

Option 3: Dry-run mode

1. **静默发现**: 分析意图、查找匹配技能,但不自动安装。
2. **推荐安装**: 向用户展示推荐的技能列表,附带描述和来源。
3. **用户选择**: 用户选择要安装的技能。
4. **安装后可用**: 技能可用,但用户决定何时调用。

The current "silent + auto-execute" design is fundamentally incompatible with user safety.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/skill-auto-installer/skills/skill-auto-installer/SKILL.md` around
lines 63 - 66, The SKILL.md policy currently enables a critical security risk by
combining "静默安装" (Rule 1) and "安装后立即使用" (Rule 4): silently installing skills
from the cloned marketplace and immediately executing them allows arbitrary code
execution; change the workflow so that before any install triggered by the
auto-installer you require explicit user confirmation showing skill name,
source, author and requested permissions (replace Rule 1 with a confirmation
requirement), do not auto-execute after install (replace Rule 4 to "提示用户调用"
only), and optionally enforce a trusted-marketplace/allow-list and signature
verification for skills (add a mandatory verification step referenced in the
SKILL.md policy) so installs from untrusted marketplaces are blocked or flagged
for manual approval.

Comment thread README.md
| [claude-channel-whatsapp](https://github.com/riasistemas/claude-channel-whatsapp) | Official WhatsApp Business Cloud API bridge for Claude Code -- webhooks, OGG Opus audio, allowlist + permission relay scrubbing secrets. NOT Baileys/scraping -- uses Meta's official API with WABA tokens. Apache-2.0, by RIA Systems (verified Meta Tech Provider). Landing: [claude-plugins.riasistemas.com.br/whatsapp](https://claude-plugins.riasistemas.com.br/whatsapp). Install: `/plugin marketplace add riasistemas/claude-plugins` then `/plugin install whatsapp@riasistemas` |
| [axme-code](https://github.com/AxmeAI/axme-code) | Persistent project memory across sessions, architectural decisions with enforce levels, and pre-execution safety hooks that block dangerous commands at the harness level (not via prompts). Local-only storage, multi-repo workspace support, automatic knowledge extraction via background auditor. 100% on ToolEmu safety, 89% on LongMemEval at ~10x fewer tokens than competitors. |
| [logic-lens](https://github.com/hyhmrright/logic-lens) | Logic-first code review plugin for Claude Code — detects behavioral bugs via semi-formal execution tracing. Finds logic errors linters and type checkers miss. Structured findings: Premises → Trace → Divergence → Remedy with L1–L6 risk codes. Six skills: logic-review, logic-explain, logic-diff, logic-locate, logic-health, logic-fix-all. |
| [skill-auto-installer](plugins/skill-auto-installer/) | Natural language intent analysis → skill recommendation → auto-install. Dual-layer matching (Hook regex pre-scan ~ms + Skill semantic analysis ~s). Supports 17 intent domains (PDF, Excel, PPT, Word, frontend design, MCP builder, Claude API, etc.). Zero config. |
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 | ⚡ Quick win

Verify "Dual-layer matching" claim against SKILL.md.

The README description mentions:

"Dual-layer matching (Hook regex pre-scan ~ms + Skill semantic analysis ~s)"

However, the SKILL.md specification (file 1) only documents a single-layer intent analysis process:

  • Phase 1 (lines 13-36): Intent analysis using a keyword mapping table
  • No mention of "Hook regex pre-scan" or two-layer architecture
  • No performance benchmarks (~ms, ~s) provided

Possible explanations:

  1. The dual-layer architecture exists in the implementation but wasn't documented in SKILL.md
  2. This is a planned feature not yet implemented
  3. The description is inaccurate
🔍 Recommended verification

Option 1: Document the dual-layer architecture in SKILL.md

### Dual-Layer Architecture

1. **Hook Pre-Scan** (~ms): Fast regex-based keyword detection
2. **Semantic Analysis** (~s): Deep intent analysis using the mapping table

Option 2: Simplify the README description to match current spec

| [skill-auto-installer](plugins/skill-auto-installer/) | Natural language intent analysis → skill recommendation → auto-install. Supports 17 intent domains (PDF, Excel, PPT, Word, frontend design, MCP builder, Claude API, etc.). Silent installation, batch matching, zero config. |

Option 3: Verify the implementation actually uses dual-layer matching

#!/bin/bash
# Search for hook regex pre-scan implementation
rg -i "hook.*regex|pre.*scan|dual.*layer" plugins/skill-auto-installer/
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 322, The README's "Dual-layer matching (Hook regex
pre-scan ~ms + Skill semantic analysis ~s)" claim is inconsistent with SKILL.md
which only documents a single Phase 1 keyword mapping intent analysis; either
update SKILL.md to describe the hook pre-scan and timing (e.g., add a
"Dual-Layer Architecture" section specifying the Hook pre-scan regex step and
the semantic analysis step and their ~ms/~s expectations), or remove/simplify
the dual-layer phrase from README.md (the table row for
plugins/skill-auto-installer) to match the implemented behavior; locate
references to the hook/pre-scan in the plugin code under
plugins/skill-auto-installer/ (search for "hook", "pre-scan", "regex",
"dual-layer") to confirm which fix is appropriate before changing SKILL.md or
README.md.

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