Skip to content

Add using-skill-set plugin with automatic session initialization - #4

Merged
ether-moon merged 2 commits into
mainfrom
using-skill-set-plugin
Nov 11, 2025
Merged

Add using-skill-set plugin with automatic session initialization#4
ether-moon merged 2 commits into
mainfrom
using-skill-set-plugin

Conversation

@ether-moon

@ether-moon ether-moon commented Nov 11, 2025

Copy link
Copy Markdown
Owner

Create new plugin that automatically activates skill-set awareness at session start:

  • Auto-detects installed skill-set plugins from ~/.claude/plugins/
  • Enforces mandatory workflow to check for relevant plugins before tasks
  • Provides plugin descriptions and use case guidelines
  • Uses SessionStart hook to inject plugin list into agent context

Plugin structure:

  • SKILL.md: Main skill file with {{INSTALLED_PLUGINS}} template
  • scripts/session-start.sh: Scans filesystem and generates plugin list
  • .claude-plugin/plugin.json: Plugin metadata with hooks defined inline

Summary by CodeRabbit

  • New Features

    • Introduced a core plugin that automatically detects and initializes installed skill-set plugins at session start
    • Enforced mandatory workflow protocols to ensure plugin usage before task execution
  • Documentation

    • Updated installation guide recommending the core plugin as the foundation for other skill-set plugins
    • Added comprehensive workflow documentation for optimal skill-set plugin utilization

Create new plugin that automatically activates skill-set awareness at session start:
- Auto-detects installed skill-set plugins from ~/.claude/plugins/
- Enforces mandatory workflow to check for relevant plugins before tasks
- Provides plugin descriptions and use case guidelines
- Uses SessionStart hook to inject plugin list into agent context

Plugin structure:
- SKILL.md: Main skill file with {{INSTALLED_PLUGINS}} template
- scripts/session-start.sh: Scans filesystem and generates plugin list
- .claude-plugin/plugin.json: Plugin metadata with hooks defined inline
@coderabbitai

coderabbitai Bot commented Nov 11, 2025

Copy link
Copy Markdown

Walkthrough

This PR introduces a new core plugin framework for "using-skill-set" that establishes mandatory workflows at session start. It includes a plugin manifest, documentation templates, and a shell script to detect and inject installed skill-set plugins into workflow guidance. The README is updated to prioritize this core plugin as a prerequisite.

Changes

Cohort / File(s) Summary
Plugin Framework
using-skill-set/.claude-plugin/plugin.json, using-skill-set/scripts/session-start.sh
Adds plugin manifest defining SessionStart hook and shell script that detects installed plugins and injects them into SKILL.md template
Workflow Documentation
using-skill-set/SKILL.md
Introduces mandatory protocol documentation with pre-task checklist, plugin catalog placeholder, usage rules, plugin descriptions, and standardized announcement procedures
Installation Guide
README.md
Restructures plugin installation to require using-skill-set core plugin first; adds detailed description and updates combined install command

Sequence Diagram

sequenceDiagram
    participant Claude
    participant SessionStart as Session Start Hook
    participant Script as session-start.sh
    participant SKILL as SKILL.md
    participant Claude2 as Claude (Updated)

    Claude->>SessionStart: Session begins (startup/resume/clear/compact)
    SessionStart->>Script: Execute session-start.sh
    Script->>Script: Enumerate plugins in PLUGINS_DIR
    Script->>Script: Filter for installed plugins
    Script->>Script: Format as bolded list
    Script->>SKILL: Replace {{INSTALLED_PLUGINS}} placeholder with list
    Script->>Claude: Output enriched SKILL.md content
    Claude2->>Claude2: Receives mandatory workflow with installed plugins
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Plugin manifest structure: Verify JSON syntax and hook configuration correctness
  • Shell script logic: Review plugin detection algorithm, sed replacement patterns, and edge cases (empty plugin directory, malformed paths)
  • Documentation completeness: Ensure SKILL.md placeholder and workflow rules align with plugin framework
  • README consistency: Confirm install instructions reflect core plugin as prerequisite and match actual file structure

Poem

🐰 A core plugin awakens with each session anew,
Detecting skill companions in directories so true,
The SKILL guide enriched, workflows kept right on track,
With mandatory wisdom, there's no turning back! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: adding a new using-skill-set plugin with automatic session initialization via a SessionStart hook.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch using-skill-set-plugin

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6f9d323 and 75ae2ba.

📒 Files selected for processing (1)
  • README.md (2 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~15-~15: Possible subject-verb agreement error.
Context: ...es Claude agents recognize and properly use all installed skill-set plugins: ```ba...

(IS_AND_ARE)

🔇 Additional comments (3)
README.md (3)

13-26: Strong documentation of core plugin requirement.

The new section clearly establishes using-skill-set as a prerequisite, explains its purpose, and provides good rationale for why it's essential. The features list aligns well with the PR objectives (auto-detection, mandatory workflow enforcement, preventing bypass).

Regarding the LanguageTool grammar flag on line 15: The sentence structure is grammatically correct—"This plugin ensures Claude agents recognize and properly use all installed skill-set plugins" properly uses compound verbs with correct subject-verb agreement. This appears to be a false positive.


40-43: Verify plugin order in combined installation command.

The combined install command now correctly places using-skill-set first to align with the documented prerequisite requirement. However, consider clarifying in the surrounding text that this "install all at once" flow is an alternative to the separate install steps shown above, not a replacement for the core-plugin-first pattern. The current structure could be slightly confusing.


48-59: Plugin documentation is comprehensive and well-positioned.

The using-skill-set (Core) documentation clearly explains:

  • Automatic activation on session start
  • Auto-detection mechanism from ~/.claude/plugins/
  • Mandatory workflow protocol
  • Foundation role relative to feature plugins

This documentation effectively communicates the plugin's purpose and aligns with the PR objectives.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
using-skill-set/scripts/session-start.sh (1)

10-16: Extract hardcoded plugin list to a configuration file or environment variable.

The SKILL_SET_PLUGINS array is hardcoded, requiring manual script updates whenever new plugins are added. This creates a maintenance burden and couples the script to plugin inventory.

Consider externalizing the plugin list to a configuration file or reading it dynamically. For example, scan the PLUGINS_DIR for all directories matching a naming pattern:

# Dynamic plugin discovery (alternative approach)
declare -a SKILL_SET_PLUGINS=()
if [ -d "${PLUGINS_DIR}" ]; then
  while IFS= read -r -d '' plugin_dir; do
    SKILL_SET_PLUGINS+=("$(basename "$plugin_dir")")
  done < <(find "${PLUGINS_DIR}" -maxdepth 1 -type d -printf '%f\0' 2>/dev/null)
fi

Or maintain a separate config file (e.g., .claude-plugin/plugin-list.txt) and source it.

using-skill-set/README.md (1)

85-85: Minor: "Markdown" capitalization.

Static analysis suggests capitalizing "Markdown" as a proper noun (line 85). This is a styling preference—feel free to standardize per project convention, or leave as-is if consistency with other docs requires it.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03630ea and 6f9d323.

📒 Files selected for processing (4)
  • using-skill-set/.claude-plugin/plugin.json (1 hunks)
  • using-skill-set/README.md (1 hunks)
  • using-skill-set/SKILL.md (1 hunks)
  • using-skill-set/scripts/session-start.sh (1 hunks)
🧰 Additional context used
🪛 LanguageTool
using-skill-set/SKILL.md

[uncategorized] ~22-~22: Possible missing comma found.
Context: ...ANY plugin match this request?" 3. ☐ If yes → Use the Skill tool to read and run th...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~57-~57: Use a comma before ‘or’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...in for your task exists, you must use it or you will fail at your task. ## Plugin ...

(COMMA_COMPOUND_SENTENCE)

using-skill-set/README.md

[uncategorized] ~85-~85: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...h skill-set plugin directory - Builds a markdown list of installed plugins - Injects the...

(MARKDOWN_NNP)

🔇 Additional comments (4)
using-skill-set/.claude-plugin/plugin.json (1)

1-22: JSON structure is valid and hook configuration looks sound.

The manifest correctly defines the SessionStart hook with appropriate matcher values and command reference. The use of ${CLAUDE_PLUGIN_ROOT} ensures the script path is resolved correctly at runtime.

using-skill-set/SKILL.md (2)

6-57: Well-structured mandatory protocol with clear guidance and anti-patterns.

The document effectively establishes mandatory workflows with clear section hierarchy, rationale ("Common Rationalizations"), and specific use cases. The tone is deliberately strong to enforce compliance, which aligns with the plugin's purpose. The checklist protocol (lines 16–26) and anti-patterns section (lines 42–57) are particularly effective for guiding agent behavior.

Note: Static analysis flagged potential comma issues (lines 22, 57), but these are false positives—list formatting and single clauses don't require additional punctuation.


59-92: Plugin descriptions are comprehensive with clear activation triggers.

Each plugin includes "Use when" guidance, brief descriptions, and (where applicable) specific command syntax. This makes it straightforward for agents to determine when a plugin is relevant and how to invoke it.

using-skill-set/README.md (1)

1-88: Comprehensive and well-organized documentation.

The README clearly explains the plugin's purpose, workflow, and technical implementation. The "How It Works" section (lines 13–21) provides a clear 4-step overview, and the "Technical Details" section accurately describes the SessionStart hook and plugin detection logic. Installation and usage guidance are straightforward.

The README aligns well with the actual implementation in plugin.json, session-start.sh, and SKILL.md.

Comment thread using-skill-set/scripts/session-start.sh
Comment thread using-skill-set/scripts/session-start.sh
- Remove using-skill-set/README.md (redundant)
- Add using-skill-set to main README as required core plugin
- Emphasize installation order: core plugin first, then feature plugins
- Explain that using-skill-set enables proper recognition of other plugins
- Add using-skill-set to Available Plugins section
@ether-moon

Copy link
Copy Markdown
Owner Author

✅ CodeRabbit Feedback Addressed

All CodeRabbit review comments have been processed and resolved:

Critical Issues Fixed

1. 🔴 CRITICAL - Line 35: sed command unsafe with multiline variable

  • Issue: ${PLUGINS_LIST} contains newlines and special characters that could corrupt sed output
  • Resolution: Added proper escaping using PLUGINS_LIST_ESCAPED variable with sed character escaping
  • Implementation: PLUGINS_LIST_ESCAPED=$(printf '%s\n' "${PLUGINS_LIST}" | sed -e 's/[&/\]/\\&/g')

2. 🟠 MAJOR - Line 39: Missing error handling and cleanup

  • Issue: No validation of SKILL_FILE existence, no trap for temp file cleanup, no error checking
  • Resolution: Added comprehensive error handling:
    • File existence validation with descriptive error message
    • Trap for guaranteed temp file cleanup on EXIT
    • Error checking on mktemp and sed commands with proper exit codes

Changes Made

All fixes have been applied to using-skill-set/scripts/session-start.sh:

  • Added SKILL_FILE existence check (lines 33-37)
  • Added variable escaping for safe sed substitution (lines 39-40)
  • Added mktemp error handling (line 43)
  • Added EXIT trap for cleanup guarantee (line 44)
  • Added sed success validation (lines 46-50)

The script now safely handles multiline content with special characters and provides robust error handling with guaranteed resource cleanup.

@ether-moon

Copy link
Copy Markdown
Owner Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Nov 11, 2025

Copy link
Copy Markdown
✅ Actions performed

Comments resolved.

@ether-moon

Copy link
Copy Markdown
Owner Author

@coderabbitai help

@coderabbitai

coderabbitai Bot commented Nov 11, 2025

Copy link
Copy Markdown

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
    • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
    • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit configuration file (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@ether-moon
ether-moon merged commit 9b7b840 into main Nov 11, 2025
1 check 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