Skip to content

Conversation

@amondnet
Copy link

@amondnet amondnet commented Oct 16, 2025

Summary

Add Claude Code plugin support with intelligent, skill-based Context7 integration.

Changes

  • Plugin manifest (.claude-plugin/plugin.json): Configure MCP server with npx execution and optional API key support
  • Skill system (skills/context7/SKILL.md): Intelligent, on-demand activation when working with libraries or frameworks
  • Updated README: Add Claude Code plugin installation instructions with skill-based workflow

Architecture Decision: Skill vs SessionStart Hook

This implementation uses Skills instead of SessionStart hooks for better token efficiency and user experience:

Why Skills?

  • Intelligent activation: Claude loads Context7 only when needed (library work, API docs)
  • Token efficient: No constant context overhead every session
  • Clear triggers: Automatic detection of library/framework/documentation needs
  • Simple maintenance: Single markdown file vs shell script + JSON output

Previous Approach (SessionStart Hook)

  • ❌ Loaded on every session start regardless of need
  • ❌ Constant token usage even for non-library tasks
  • ❌ More complex implementation with shell scripts

Benefits

  • Automatic integration: Claude automatically uses Context7 MCP tools when relevant
  • Seamless setup: Users can install with a simple /plugin install command
  • Token efficient: Context7 skill loads only when working with libraries/frameworks
  • API key support: Optional CONTEXT7_API_KEY environment variable for higher rate limits

Usage

https://plugins.pleaseai.dev/?install=context7

claude
/plugin marketplace add pleaseai/claude-code-plugins
/plugin install context7@pleaseai

The skill automatically activates when you:

  • Write code using external libraries
  • Need library documentation or API references
  • Set up or configure frameworks
  • Request code examples with specific packages

Claude intelligently detects these scenarios and fetches up-to-date documentation seamlessly.

Skill Activation Example

When you ask:

"Create a Next.js middleware that checks for JWT in cookies"

Claude automatically:

  1. Detects you're working with Next.js (external library)
  2. Activates the Context7 skill
  3. Uses resolve-library-id to find Next.js docs
  4. Uses get-library-docs to fetch current middleware documentation
  5. Provides accurate, up-to-date code

No need to explicitly say "use context7" - it just works!

References

Add Claude Code plugin support with automatic Context7 integration:
- Plugin manifest (.claude-plugin/plugin.json) with MCP server config
- SessionStart hook to auto-load Context7 usage instructions
- Context file with automatic tool usage guidelines
- Updated README with Claude Code plugin installation

The plugin automatically instructs Claude to use Context7 MCP tools
for code generation, setup, and API documentation without explicit
user prompts.
amondnet added a commit to pleaseai/claude-code-plugins that referenced this pull request Oct 16, 2025
Add Context7 plugin with automatic Claude Code integration:
- MCP server for up-to-date library documentation
- SessionStart hook for automatic Context7 tool usage
- Plugin manifest with npx configuration and API key support
- Updated marketplace.json with context7 entry

Related: upstash/context7#786
Replace SessionStart hook with Claude Code skill for more intelligent
and token-efficient Context7 integration.

Changes:
- Add skills/context7/SKILL.md with intelligent activation patterns
- Remove hooks/ directory (hooks.json, context.sh, CONTEXT7.md)
- Remove hooks reference from plugin.json
- Update README.md with skill-based installation guide

Benefits:
- Claude automatically activates skill only when needed
- Reduces token usage (no constant context loading)
- Clearer trigger patterns (library, framework, API docs)
- Simpler maintenance (single markdown file vs shell script)

The skill triggers automatically when:
- Writing code with external libraries
- Needing library documentation or API references
- Setting up or configuring frameworks
- Requesting code examples with specific packages
@amondnet amondnet changed the title feat: add Claude Code plugin configuration feat: add Claude Code plugin with Skill-based integration Oct 16, 2025
amondnet added a commit to pleaseai/claude-code-plugins that referenced this pull request Oct 16, 2025
Update context7 plugin to use Skill system instead of SessionStart hook.

The new version provides intelligent, on-demand activation:
- Claude loads Context7 only when working with libraries/frameworks
- Significantly reduces token usage
- Simpler maintenance with single SKILL.md file

Upstream PR: upstash/context7#786
Commit: 13f4296
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