Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:03:02 +08:00
commit a7979c466d
5 changed files with 445 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
{
"name": "cadrianmae-integration",
"description": "Integrate marketplace plugins into CLAUDE.md with user/project scope selection",
"version": "1.0.0",
"author": "cadrianmae",
"skills": [
"./skills"
],
"commands": [
"./commands"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# cadrianmae-integration
Integrate marketplace plugins into CLAUDE.md with user/project scope selection

104
commands/integrate.md Normal file
View File

@@ -0,0 +1,104 @@
---
description: Integrate marketplace plugins into CLAUDE.md (choose user or project level)
allowed-tools: Bash, Read, Write, Edit, AskUserQuestion
---
# integrate - Add marketplace plugins to CLAUDE.md
Generate documentation for installed cadrianmae marketplace plugins and add to CLAUDE.md.
## Usage
```
/integrate
```
No arguments needed - Claude will ask you where to add the documentation.
## What It Does
1. **Asks for scope** - User-level (~/.claude/CLAUDE.md) or Project-level (./CLAUDE.md)
2. **Scans plugins** - Finds all installed marketplace plugins
3. **Extracts information** - Reads plugin.json, skills, and commands
4. **Generates section** - Creates formatted markdown documentation
5. **Adds to CLAUDE.md** - Appends or updates the plugins section
## What Gets Created
**marketplace-plugins.md:**
```markdown
# Cadrianmae Marketplace Plugins
Available plugins from cadrianmae-claude-marketplace.
## Plugin: semantic-search
**Version:** 1.0.0
**Description:** Semantic search with query inference
**Skills:**
- `semantic-search` - Natural language code search
**Commands:**
- `/semq:search <query>` - Search indexed codebase
- `/semq:here <query>` - Search with traversal
- `/semq:index` - Create index
- `/semq:status` - Show stats
**Usage:** Auto-invokes on "where is..." queries
---
## Plugin: pandoc
**Version:** 1.0.0
**Description:** Document conversion toolkit
**Skills:**
- `pandoc` - Document conversion with templates
**Commands:**
- `/pandoc:help` - Plugin overview
- `/pandoc:convert` - Convert documents
- `/pandoc:validate` - Validate frontmatter
- `/pandoc:restyle` - Transform styles
**Usage:** Auto-invokes for document conversion
---
*Last updated: 2025-11-19*
*Generated by cadrianmae-integration*
```
**Added to CLAUDE.md:**
```markdown
# Marketplace Plugins
@ ~/.claude/marketplace-plugins.md
```
## Scope Selection
**User-level** (`~/.claude/CLAUDE.md`):
- Available in ALL projects
- Use for plugins you use everywhere
- Example: semantic-search, datetime
**Project-level** (`./CLAUDE.md`):
- Only available in THIS project
- Use for project-specific workflows
- Example: Project uses pandoc for reports
## When to Use
Run `/integrate` when you:
- Install new marketplace plugins
- Set up a new project
- Want to document available tools
- Update plugin documentation
## Related Commands
- `/plugin list` - List all installed plugins
- `/skill` - Invoke specific skills
- `/help` - General Claude Code help

49
plugin.lock.json Normal file
View File

@@ -0,0 +1,49 @@
{
"$schema": "internal://schemas/plugin.lock.v1.json",
"pluginId": "gh:cadrianmae/claude-marketplace:plugins/cadrianmae-integration",
"normalized": {
"repo": null,
"ref": "refs/tags/v20251128.0",
"commit": "1dfd36adf7f6e91032f2eeddd0b0bcc711e90031",
"treeHash": "f0a970ea4333457cee6d5abb7272636b7797b2d7eb3a0d65de4a32225f5c3332",
"generatedAt": "2025-11-28T10:14:28.794310Z",
"toolVersion": "publish_plugins.py@0.2.0"
},
"origin": {
"remote": "git@github.com:zhongweili/42plugin-data.git",
"branch": "master",
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
},
"manifest": {
"name": "cadrianmae-integration",
"description": "Integrate marketplace plugins into CLAUDE.md with user/project scope selection",
"version": "1.0.0"
},
"content": {
"files": [
{
"path": "README.md",
"sha256": "cc5567c6464304b49db8011f8bb7dbc416441a2d4abd4916781457fe965a9552"
},
{
"path": ".claude-plugin/plugin.json",
"sha256": "964bed8f4c56f3eb5b2a70cfb6c278b8ba9abb5b262cdae18c53d97eebf1bf3a"
},
{
"path": "commands/integrate.md",
"sha256": "c18babe93920144682880ead68df5e273e13420cd7309941c7574ce097edb932"
},
{
"path": "skills/integration/SKILL.md",
"sha256": "272c85e8566ebf7dc557098bec2e20dde3272a9e07dd8498b988651b79e26c9f"
}
],
"dirSha256": "f0a970ea4333457cee6d5abb7272636b7797b2d7eb3a0d65de4a32225f5c3332"
},
"security": {
"scannedAt": null,
"scannerVersion": null,
"flags": []
}
}

277
skills/integration/SKILL.md Normal file
View File

@@ -0,0 +1,277 @@
---
name: integration
description: Integrate cadrianmae marketplace plugins into CLAUDE.md. Scans installed plugins and generates documentation section listing available skills and commands. User chooses between user-level (global) or project-level (current project only) integration.
allowed-tools: Bash, Read, Write, Edit, AskUserQuestion
---
# Cadrianmae Marketplace Integration
Generate documentation for installed marketplace plugins and add to CLAUDE.md.
## Overview
This skill helps integrate marketplace plugins into your workflow by:
1. Scanning installed plugins from cadrianmae-claude-marketplace
2. Extracting skills and commands from each plugin
3. Generating a structured reference section
4. Adding to user-level or project-level CLAUDE.md
## When to Use
- After installing new marketplace plugins
- Setting up a new project
- Updating documentation of available tools
- Creating project-specific plugin references
## Workflow
### 1. Ask User for Scope
Use AskUserQuestion to determine integration level:
```
Question: "Where should I add the marketplace plugin documentation?"
Options:
- "User-level (~/.claude/CLAUDE.md)" - Available in all projects
- "Project-level (./CLAUDE.md)" - Only this project
```
### 2. Scan Installed Plugins
```bash
MARKETPLACE_DIR=~/.claude/marketplaces/cadrianmae-claude-marketplace/plugins
# List all installed plugins
for plugin in "$MARKETPLACE_DIR"/*/; do
plugin_name=$(basename "$plugin")
echo "Found: $plugin_name"
done
```
### 3. Extract Plugin Information
For each plugin, read:
- `plugin.json` - Plugin metadata (name, version, description)
- `skills/*/SKILL.md` - Skill information
- `commands/*.md` - Slash command list
### 4. Generate Documentation File
Create separate markdown file with plugin documentation:
**File:** `marketplace-plugins.md`
```markdown
# Cadrianmae Marketplace Plugins
Available plugins from cadrianmae-claude-marketplace.
## Plugin: semantic-search
**Version:** 1.0.0
**Description:** Semantic search across codebases using odino
**Skills:**
- `semantic-search` - Natural language code search with query inference
**Commands:**
- `/semq:search <query>` - Search indexed codebase
- `/semq:here <query>` - Search with directory traversal
- `/semq:index [path]` - Create semantic index
- `/semq:status` - Show index stats
**Usage:** Auto-invokes on "where is..." or "find code that..." queries
---
## Plugin: pandoc
**Version:** 1.0.0
**Description:** Document conversion toolkit
**Skills:**
- `pandoc` - Document conversion with templates and validation
**Commands:**
- `/pandoc:help` - Plugin overview
- `/pandoc:template` - Generate templates
- `/pandoc:validate` - Validate frontmatter
- `/pandoc:convert` - Convert documents
- `/pandoc:restyle` - Transform document styles
**Usage:** Auto-invokes for document conversion tasks
---
*Last updated: 2025-11-19*
*Generated by cadrianmae-integration skill*
```
### 5. Add Import to CLAUDE.md
Use import syntax: `@ path/to/file` (no space between @ and path).
Supports up to 5 nesting levels. Imports inside code blocks are ignored.
**User-level:**
```bash
CLAUDE_FILE=~/.claude/CLAUDE.md
PLUGINS_DOC=~/.claude/marketplace-plugins.md
# Write plugin documentation to separate file
cat > "$PLUGINS_DOC" << 'EOF'
# Cadrianmae Marketplace Plugins
...
EOF
# Add import to CLAUDE.md if not already present
IMPORT_LINE="@ ~/.claude/marketplace-plugins.md"
if ! grep -q "@ ~/.claude/marketplace-plugins.md" "$CLAUDE_FILE"; then
echo "" >> "$CLAUDE_FILE"
echo "# Marketplace Plugins" >> "$CLAUDE_FILE"
echo "$IMPORT_LINE" >> "$CLAUDE_FILE"
fi
```
**Project-level:**
```bash
CLAUDE_FILE=./CLAUDE.md
PLUGINS_DOC=./marketplace-plugins.md
# Write plugin documentation
cat > "$PLUGINS_DOC" << 'EOF'
# Project-Specific Plugin Documentation
...
EOF
# Create CLAUDE.md if doesn't exist
if [[ ! -f "$CLAUDE_FILE" ]]; then
echo "# Project CLAUDE.md" > "$CLAUDE_FILE"
echo "" >> "$CLAUDE_FILE"
fi
# Add import
IMPORT_LINE="@ ./marketplace-plugins.md"
if ! grep -q "@ ./marketplace-plugins.md" "$CLAUDE_FILE"; then
echo "" >> "$CLAUDE_FILE"
echo "# Marketplace Plugins" >> "$CLAUDE_FILE"
echo "$IMPORT_LINE" >> "$CLAUDE_FILE"
fi
```
**Import syntax rules:**
- Format: `@ path` (@ immediately followed by path, space for display only)
- Relative: `@ ./file.md` or `@ subdir/file.md`
- Absolute: `@ /absolute/path/file.md`
- Home dir: `@ ~/.claude/file.md`
- Code blocks: Imports in backticks/code blocks are ignored
- Nesting: Max 5 levels deep
- Verify: Use `/memory` command to check loaded imports
**Benefits:**
- Clean separation of concerns
- Update plugin docs without touching CLAUDE.md
- Easier to maintain and regenerate
- Can share plugin docs across multiple CLAUDE.md files
## Output Format
After completion, show:
```
✓ Marketplace integration complete
Files created:
~/.claude/marketplace-plugins.md (plugin documentation)
Import added to:
~/.claude/CLAUDE.md
Added line:
@ ~/.claude/marketplace-plugins.md
Plugins documented:
• semantic-search (1.0.0)
• pandoc (1.0.0)
• cadrianmae-integration (1.0.0)
3 plugins, 3 skills, 11 commands
Plugin docs will be loaded in all Claude Code sessions!
Verify with: /memory
```
## Edge Cases
**No plugins installed:**
```
No marketplace plugins found in:
~/.claude/marketplaces/cadrianmae-claude-marketplace/plugins/
Install plugins first, then run this skill.
```
**Section already exists:**
Ask user:
- Replace existing section
- Append to existing section
- Cancel
**File locations:**
- User-level: `~/.claude/CLAUDE.md` (affects all projects)
- Project-level: `./CLAUDE.md` (workspace root, affects only this project)
## Best Practices
1. **Run after installing plugins** - Keep documentation current
2. **Choose scope wisely:**
- User-level: Plugins you use in all projects
- Project-level: Project-specific plugin workflows
3. **Update regularly** - Re-run when adding/removing plugins
4. **Review generated section** - Verify accuracy before committing
## Example Integration
**User-level CLAUDE.md:**
```markdown
# CLAUDE.md (Global)
## User Context
...
## Coding Preferences
...
## Cadrianmae Marketplace Plugins
Available plugins from cadrianmae-claude-marketplace.
### Plugin: semantic-search
...
### Plugin: pandoc
...
```
**Project-level CLAUDE.md:**
```markdown
# Project: Data Pipeline
## Project Context
This project uses semantic-search for finding algorithm implementations
and pandoc for generating reports.
## Cadrianmae Marketplace Plugins
### Plugin: semantic-search
**Primary use:** Finding ML algorithm implementations in knowledge base
**Commands used:** /semq:search, /semq:here
### Plugin: pandoc
**Primary use:** Converting weekly reports to PDF
**Commands used:** /pandoc:convert, /pandoc:validate
```
## Related
- Global CLAUDE.md: `~/.claude/CLAUDE.md`
- Project CLAUDE.md: `./CLAUDE.md` (workspace root)
- Plugin directory: `~/.claude/marketplaces/cadrianmae-claude-marketplace/plugins/`