Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 61907b78db | |||
| c4037f505c | |||
| dbf3fa7e0d | |||
| 6d093e83b6 | |||
| 13de992638 | |||
| ef28f172d6 | |||
| 39556dbb59 | |||
| c9e054e013 | |||
| db8fec42f2 | |||
| ba1dee4553 | |||
| 01e184b68f | |||
| c0d62f4957 | |||
| 5b1dde694c | |||
| eafcfe5bd1 | |||
| dc113d8b09 | |||
| aca5c6e5b1 | |||
| 120f00ece6 | |||
| 3012a7af68 | |||
| d12d9b4962 | |||
| b302a4237d |
@@ -6,7 +6,7 @@
|
|||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": "Project management plugins with Gitea and NetBox integrations",
|
"description": "Project management plugins with Gitea and NetBox integrations",
|
||||||
"version": "5.8.0"
|
"version": "5.9.0"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
@@ -91,8 +91,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "claude-config-maintainer",
|
"name": "claude-config-maintainer",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "CLAUDE.md optimization and maintenance for Claude Code projects",
|
"description": "CLAUDE.md and settings.local.json optimization for Claude Code projects",
|
||||||
"source": "./plugins/claude-config-maintainer",
|
"source": "./plugins/claude-config-maintainer",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
100
CHANGELOG.md
100
CHANGELOG.md
@@ -4,10 +4,110 @@ All notable changes to the Leo Claude Marketplace will be documented in this fil
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [5.9.0] - 2026-02-03
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
#### Plugin Installation Scripts
|
||||||
|
New scripts for installing marketplace plugins into consumer projects:
|
||||||
|
|
||||||
|
- **`scripts/install-plugin.sh`** — Install a plugin to a consumer project
|
||||||
|
- Adds MCP server entry to target's `.mcp.json` (if plugin has MCP server)
|
||||||
|
- Appends integration snippet to target's `CLAUDE.md`
|
||||||
|
- Idempotent: safe to run multiple times
|
||||||
|
- Validates plugin exists and target path is valid
|
||||||
|
|
||||||
|
- **`scripts/uninstall-plugin.sh`** — Remove a plugin from a consumer project
|
||||||
|
- Removes MCP server entry from `.mcp.json`
|
||||||
|
- Removes integration section from `CLAUDE.md`
|
||||||
|
|
||||||
|
- **`scripts/list-installed.sh`** — Show installed plugins in a project
|
||||||
|
- Lists fully installed, partially installed, and available plugins
|
||||||
|
- Shows plugin versions and descriptions
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
```bash
|
||||||
|
./scripts/install-plugin.sh data-platform ~/projects/personal-portfolio
|
||||||
|
./scripts/list-installed.sh ~/projects/personal-portfolio
|
||||||
|
./scripts/uninstall-plugin.sh data-platform ~/projects/personal-portfolio
|
||||||
|
```
|
||||||
|
|
||||||
|
**Documentation:** `docs/CONFIGURATION.md` updated with "Installing Plugins to Consumer Projects" section.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
#### Plugin Installation Scripts — MCP Mapping & Section Markers
|
||||||
|
|
||||||
|
**MCP Server Mapping:**
|
||||||
|
- Added `mcp_servers` field to plugin.json for plugins that use shared MCP servers
|
||||||
|
- `projman` and `pr-review` now correctly install `gitea` MCP server
|
||||||
|
- `cmdb-assistant` now correctly installs `netbox` MCP server
|
||||||
|
- Scripts read MCP server names from plugin.json instead of assuming plugin name = server name
|
||||||
|
|
||||||
|
**CLAUDE.md Section Markers:**
|
||||||
|
- Install script now wraps integration content with HTML comment markers:
|
||||||
|
`<!-- BEGIN marketplace-plugin: {name} -->` and `<!-- END marketplace-plugin: {name} -->`
|
||||||
|
- Uninstall script uses markers for precise section removal (no more code block false positives)
|
||||||
|
- Backward compatible: falls back to legacy header detection for pre-marker installations
|
||||||
|
|
||||||
|
**Plugins updated with `mcp_servers` field:**
|
||||||
|
- `projman` → `["gitea"]`
|
||||||
|
- `pr-review` → `["gitea"]`
|
||||||
|
- `cmdb-assistant` → `["netbox"]`
|
||||||
|
- `data-platform` → `["data-platform"]`
|
||||||
|
- `viz-platform` → `["viz-platform"]`
|
||||||
|
- `contract-validator` → `["contract-validator"]`
|
||||||
|
|
||||||
|
#### Agent Model Selection
|
||||||
|
|
||||||
|
Per-agent model selection using Claude Code's now-supported `model` frontmatter field.
|
||||||
|
|
||||||
|
- All 25 marketplace agents assigned appropriate model (`sonnet`, `haiku`, or `inherit`)
|
||||||
|
- Model assignment based on reasoning depth, tool complexity, and latency requirements
|
||||||
|
- Documentation added to `CLAUDE.md` and `docs/CONFIGURATION.md`
|
||||||
|
|
||||||
|
**Supported values:** `sonnet` (default), `opus`, `haiku`, `inherit`
|
||||||
|
|
||||||
|
**Model assignments:**
|
||||||
|
| Model | Agent Types |
|
||||||
|
|-------|-------------|
|
||||||
|
| sonnet | Planner, Orchestrator, Executor, Code Reviewer, Coordinator, Security Reviewers, Data Advisor, Design Reviewer, etc. |
|
||||||
|
| haiku | Maintainability Auditor, Test Validator, Component Check, Theme Setup, Git Assistant, Data Ingestion, Agent Check |
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
#### Agent Frontmatter Standardization
|
||||||
|
|
||||||
|
- Fixed viz-platform and data-platform agents using non-standard `agent:` field (now `name:`)
|
||||||
|
- Removed non-standard `triggers:` field from domain agents (trigger info already in agent body)
|
||||||
|
- Added missing frontmatter to 13 agents across pr-review, viz-platform, contract-validator, clarity-assist, git-flow, doc-guardian, code-sentinel, cmdb-assistant, and data-platform
|
||||||
|
- All 25 agents now have consistent `name`, `description`, and `model` fields
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [5.8.0] - 2026-02-02
|
## [5.8.0] - 2026-02-02
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
#### claude-config-maintainer v1.2.0 - Settings Audit Feature
|
||||||
|
|
||||||
|
New commands for auditing and optimizing `settings.local.json` permission configurations:
|
||||||
|
|
||||||
|
- **`/config-audit-settings`** — Audit `settings.local.json` permissions with 100-point scoring across redundancy, coverage, safety alignment, and profile fit
|
||||||
|
- **`/config-optimize-settings`** — Apply permission optimizations with dry-run, named profiles (`conservative`, `reviewed`, `autonomous`), and consolidation modes
|
||||||
|
- **`/config-permissions-map`** — Generate Mermaid diagram of review layer coverage and permission gaps
|
||||||
|
- **`skills/settings-optimization.md`** — Comprehensive skill for permission pattern analysis, consolidation rules, review-layer-aware recommendations, and named profiles
|
||||||
|
|
||||||
|
**Key Features:**
|
||||||
|
- Settings Efficiency Score (100 points) alongside existing CLAUDE.md score
|
||||||
|
- Review layer verification — agent reads `hooks/hooks.json` from installed plugins before recommending auto-allow patterns
|
||||||
|
- Three named profiles: `conservative` (prompts for most writes), `reviewed` (for projects with ≥2 review layers), `autonomous` (sandboxed environments)
|
||||||
|
- Pattern consolidation detection: duplicates, subsets, merge candidates, stale entries, conflicts
|
||||||
|
|
||||||
#### Projman Hardening Sprint
|
#### Projman Hardening Sprint
|
||||||
Targeted improvements to safety gates, command structure, lifecycle tracking, and cross-plugin contracts.
|
Targeted improvements to safety gates, command structure, lifecycle tracking, and cross-plugin contracts.
|
||||||
|
|
||||||
|
|||||||
40
CLAUDE.md
40
CLAUDE.md
@@ -146,7 +146,7 @@ When user says "fix the sprint-plan command", edit the SOURCE code.
|
|||||||
## Project Overview
|
## Project Overview
|
||||||
|
|
||||||
**Repository:** leo-claude-mktplace
|
**Repository:** leo-claude-mktplace
|
||||||
**Version:** 5.4.0
|
**Version:** 5.9.0
|
||||||
**Status:** Production Ready
|
**Status:** Production Ready
|
||||||
|
|
||||||
A plugin marketplace for Claude Code containing:
|
A plugin marketplace for Claude Code containing:
|
||||||
@@ -161,7 +161,7 @@ A plugin marketplace for Claude Code containing:
|
|||||||
| `code-sentinel` | Security scanning and code refactoring tools | 1.0.1 |
|
| `code-sentinel` | Security scanning and code refactoring tools | 1.0.1 |
|
||||||
| `claude-config-maintainer` | CLAUDE.md optimization and maintenance | 1.0.0 |
|
| `claude-config-maintainer` | CLAUDE.md optimization and maintenance | 1.0.0 |
|
||||||
| `cmdb-assistant` | NetBox CMDB integration for infrastructure management | 1.2.0 |
|
| `cmdb-assistant` | NetBox CMDB integration for infrastructure management | 1.2.0 |
|
||||||
| `data-platform` | pandas, PostgreSQL, and dbt integration for data engineering | 1.1.0 |
|
| `data-platform` | pandas, PostgreSQL, and dbt integration for data engineering | 1.3.0 |
|
||||||
| `viz-platform` | DMC validation, Plotly charts, and theming for dashboards | 1.1.0 |
|
| `viz-platform` | DMC validation, Plotly charts, and theming for dashboards | 1.1.0 |
|
||||||
| `contract-validator` | Cross-plugin compatibility validation and agent verification | 1.1.0 |
|
| `contract-validator` | Cross-plugin compatibility validation and agent verification | 1.1.0 |
|
||||||
| `project-hygiene` | Post-task cleanup automation via hooks | 0.1.0 |
|
| `project-hygiene` | Post-task cleanup automation via hooks | 0.1.0 |
|
||||||
@@ -271,6 +271,40 @@ leo-claude-mktplace/
|
|||||||
| **Executor** | Implementation-focused | Code implementation, branch management, MR creation |
|
| **Executor** | Implementation-focused | Code implementation, branch management, MR creation |
|
||||||
| **Code Reviewer** | Thorough, practical | Pre-close quality review, security scan, test verification |
|
| **Code Reviewer** | Thorough, practical | Pre-close quality review, security scan, test verification |
|
||||||
|
|
||||||
|
### Agent Model Selection
|
||||||
|
|
||||||
|
Agents specify their model in frontmatter using Claude Code's `model` field. Supported values: `sonnet` (default), `opus`, `haiku`, `inherit`.
|
||||||
|
|
||||||
|
| Plugin | Agent | Model | Rationale |
|
||||||
|
|--------|-------|-------|-----------|
|
||||||
|
| projman | Planner | sonnet | Architectural analysis, sprint planning |
|
||||||
|
| projman | Orchestrator | sonnet | Coordination and tool dispatch |
|
||||||
|
| projman | Executor | sonnet | Code generation and implementation |
|
||||||
|
| projman | Code Reviewer | sonnet | Quality gate, pattern detection |
|
||||||
|
| pr-review | Coordinator | sonnet | Orchestrates sub-agents, aggregates findings |
|
||||||
|
| pr-review | Security Reviewer | sonnet | Security analysis |
|
||||||
|
| pr-review | Performance Analyst | sonnet | Performance pattern detection |
|
||||||
|
| pr-review | Maintainability Auditor | haiku | Pattern matching (complexity, duplication) |
|
||||||
|
| pr-review | Test Validator | haiku | Coverage gap detection |
|
||||||
|
| data-platform | Data Advisor | sonnet | Schema validation, dbt orchestration |
|
||||||
|
| data-platform | Data Analysis | sonnet | Data exploration and profiling |
|
||||||
|
| data-platform | Data Ingestion | haiku | Data loading operations |
|
||||||
|
| viz-platform | Design Reviewer | sonnet | DMC validation + accessibility |
|
||||||
|
| viz-platform | Layout Builder | sonnet | Dashboard design guidance |
|
||||||
|
| viz-platform | Component Check | haiku | Quick component validation |
|
||||||
|
| viz-platform | Theme Setup | haiku | Theme configuration |
|
||||||
|
| contract-validator | Agent Check | haiku | Reference checking |
|
||||||
|
| contract-validator | Full Validation | sonnet | Marketplace sweep |
|
||||||
|
| code-sentinel | Security Reviewer | sonnet | Security analysis |
|
||||||
|
| code-sentinel | Refactor Advisor | sonnet | Code refactoring advice |
|
||||||
|
| doc-guardian | Doc Analyzer | sonnet | Documentation drift detection |
|
||||||
|
| clarity-assist | Clarity Coach | sonnet | Conversational coaching |
|
||||||
|
| git-flow | Git Assistant | haiku | Git operations |
|
||||||
|
| claude-config-maintainer | Maintainer | sonnet | CLAUDE.md optimization |
|
||||||
|
| cmdb-assistant | CMDB Assistant | sonnet | NetBox operations |
|
||||||
|
|
||||||
|
Override by editing the `model:` field in `plugins/{plugin}/agents/{agent}.md`.
|
||||||
|
|
||||||
### MCP Server Tools (Gitea)
|
### MCP Server Tools (Gitea)
|
||||||
|
|
||||||
| Category | Tools |
|
| Category | Tools |
|
||||||
@@ -453,4 +487,4 @@ The script will:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Last Updated:** 2026-01-30
|
**Last Updated:** 2026-02-02
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -1,4 +1,4 @@
|
|||||||
# Leo Claude Marketplace - v5.8.0
|
# Leo Claude Marketplace - v5.9.0
|
||||||
|
|
||||||
A collection of Claude Code plugins for project management, infrastructure automation, and development workflows.
|
A collection of Claude Code plugins for project management, infrastructure automation, and development workflows.
|
||||||
|
|
||||||
@@ -47,11 +47,11 @@ Comprehensive pull request review using specialized agents.
|
|||||||
**Commands:** `/pr-review`, `/pr-summary`, `/pr-findings`, `/pr-diff`, `/initial-setup`, `/project-init`, `/project-sync`
|
**Commands:** `/pr-review`, `/pr-summary`, `/pr-findings`, `/pr-diff`, `/initial-setup`, `/project-init`, `/project-sync`
|
||||||
|
|
||||||
#### [claude-config-maintainer](./plugins/claude-config-maintainer)
|
#### [claude-config-maintainer](./plugins/claude-config-maintainer)
|
||||||
**CLAUDE.md Optimization and Maintenance**
|
**CLAUDE.md and Settings Optimization**
|
||||||
|
|
||||||
Analyze, optimize, and create CLAUDE.md configuration files for Claude Code projects.
|
Analyze, optimize, and create CLAUDE.md configuration files. Audit and optimize settings.local.json permissions.
|
||||||
|
|
||||||
**Commands:** `/config-analyze`, `/config-optimize`, `/config-init`, `/config-diff`, `/config-lint`
|
**Commands:** `/analyze`, `/optimize`, `/init`, `/config-diff`, `/config-lint`, `/config-audit-settings`, `/config-optimize-settings`, `/config-permissions-map`
|
||||||
|
|
||||||
#### [contract-validator](./plugins/contract-validator) *NEW in v5.0.0*
|
#### [contract-validator](./plugins/contract-validator) *NEW in v5.0.0*
|
||||||
**Cross-Plugin Compatibility Validation**
|
**Cross-Plugin Compatibility Validation**
|
||||||
@@ -122,7 +122,7 @@ Comprehensive data engineering toolkit with persistent DataFrame storage.
|
|||||||
- 100k row limit with chunking support
|
- 100k row limit with chunking support
|
||||||
- Auto-detection of dbt projects
|
- Auto-detection of dbt projects
|
||||||
|
|
||||||
**Commands:** `/ingest`, `/profile`, `/schema`, `/explain`, `/lineage`, `/lineage-viz`, `/run`, `/dbt-test`, `/data-quality`, `/initial-setup`
|
**Commands:** `/ingest`, `/profile`, `/schema`, `/explain`, `/lineage`, `/lineage-viz`, `/run`, `/dbt-test`, `/data-quality`, `/data-review`, `/data-gate`, `/initial-setup`
|
||||||
|
|
||||||
### Visualization
|
### Visualization
|
||||||
|
|
||||||
@@ -312,7 +312,7 @@ After installing plugins, the `/plugin` command may show `(no content)` - this i
|
|||||||
| clarity-assist | `/clarity-assist:clarify` |
|
| clarity-assist | `/clarity-assist:clarify` |
|
||||||
| doc-guardian | `/doc-guardian:doc-audit` |
|
| doc-guardian | `/doc-guardian:doc-audit` |
|
||||||
| code-sentinel | `/code-sentinel:security-scan` |
|
| code-sentinel | `/code-sentinel:security-scan` |
|
||||||
| claude-config-maintainer | `/claude-config-maintainer:config-analyze` |
|
| claude-config-maintainer | `/claude-config-maintainer:analyze` |
|
||||||
| cmdb-assistant | `/cmdb-assistant:cmdb-search` |
|
| cmdb-assistant | `/cmdb-assistant:cmdb-search` |
|
||||||
| data-platform | `/data-platform:ingest` |
|
| data-platform | `/data-platform:ingest` |
|
||||||
| viz-platform | `/viz-platform:chart` |
|
| viz-platform | `/viz-platform:chart` |
|
||||||
|
|||||||
@@ -182,10 +182,42 @@ MCP servers are **shared at repository root** and configured in `.mcp.json`.
|
|||||||
| MCP configuration | `.mcp.json` | `.mcp.json` (at repo root) |
|
| MCP configuration | `.mcp.json` | `.mcp.json` (at repo root) |
|
||||||
| Shared MCP server | `mcp-servers/{server}/` | `mcp-servers/gitea/` |
|
| Shared MCP server | `mcp-servers/{server}/` | `mcp-servers/gitea/` |
|
||||||
| MCP server code | `mcp-servers/{server}/mcp_server/` | `mcp-servers/gitea/mcp_server/` |
|
| MCP server code | `mcp-servers/{server}/mcp_server/` | `mcp-servers/gitea/mcp_server/` |
|
||||||
| MCP venv | `mcp-servers/{server}/.venv/` | `mcp-servers/gitea/.venv/` |
|
| MCP venv (local) | `mcp-servers/{server}/.venv/` | `mcp-servers/gitea/.venv/` |
|
||||||
|
|
||||||
**Note:** Plugins do NOT have their own `mcp-servers/` directories. All MCP servers are shared at root and configured via `.mcp.json`.
|
**Note:** Plugins do NOT have their own `mcp-servers/` directories. All MCP servers are shared at root and configured via `.mcp.json`.
|
||||||
|
|
||||||
|
### MCP Venv Paths - CRITICAL
|
||||||
|
|
||||||
|
**Venvs live in a CACHE directory that SURVIVES marketplace updates.**
|
||||||
|
|
||||||
|
When checking for venvs, ALWAYS check in this order:
|
||||||
|
|
||||||
|
| Priority | Path | Survives Updates? |
|
||||||
|
|----------|------|-------------------|
|
||||||
|
| 1 (CHECK FIRST) | `~/.cache/claude-mcp-venvs/leo-claude-mktplace/{server}/.venv/` | YES |
|
||||||
|
| 2 (fallback) | `{marketplace}/mcp-servers/{server}/.venv/` | NO |
|
||||||
|
|
||||||
|
**Why cache first?**
|
||||||
|
- Marketplace directory gets WIPED on every update/reinstall
|
||||||
|
- Cache directory SURVIVES updates
|
||||||
|
- False "venv missing" errors waste hours of debugging
|
||||||
|
|
||||||
|
**Pattern for hooks checking venvs:**
|
||||||
|
```bash
|
||||||
|
CACHE_VENV="$HOME/.cache/claude-mcp-venvs/leo-claude-mktplace/{server}/.venv/bin/python"
|
||||||
|
LOCAL_VENV="$MARKETPLACE_ROOT/mcp-servers/{server}/.venv/bin/python"
|
||||||
|
|
||||||
|
if [[ -f "$CACHE_VENV" ]]; then
|
||||||
|
VENV_PATH="$CACHE_VENV"
|
||||||
|
elif [[ -f "$LOCAL_VENV" ]]; then
|
||||||
|
VENV_PATH="$LOCAL_VENV"
|
||||||
|
else
|
||||||
|
echo "venv missing"
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
**See lesson learned:** [Startup Hooks Must Check Venv Cache Path First](https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/wiki/lessons/patterns/startup-hooks-must-check-venv-cache-path-first)
|
||||||
|
|
||||||
### Documentation Paths
|
### Documentation Paths
|
||||||
|
|
||||||
| Type | Location |
|
| Type | Location |
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ Quick reference for all commands in the Leo Claude Marketplace.
|
|||||||
| **claude-config-maintainer** | `/config-init` | | X | Initialize new CLAUDE.md for a project |
|
| **claude-config-maintainer** | `/config-init` | | X | Initialize new CLAUDE.md for a project |
|
||||||
| **claude-config-maintainer** | `/config-diff` | | X | Track CLAUDE.md changes over time with behavioral impact |
|
| **claude-config-maintainer** | `/config-diff` | | X | Track CLAUDE.md changes over time with behavioral impact |
|
||||||
| **claude-config-maintainer** | `/config-lint` | | X | Lint CLAUDE.md for anti-patterns and best practices |
|
| **claude-config-maintainer** | `/config-lint` | | X | Lint CLAUDE.md for anti-patterns and best practices |
|
||||||
|
| **claude-config-maintainer** | `/config-audit-settings` | | X | Audit settings.local.json permissions (100-point score) |
|
||||||
|
| **claude-config-maintainer** | `/config-optimize-settings` | | X | Optimize permissions (profiles, consolidation, dry-run) |
|
||||||
|
| **claude-config-maintainer** | `/config-permissions-map` | | X | Visual review layer + permission coverage map |
|
||||||
| **cmdb-assistant** | `/initial-setup` | | X | Setup wizard for NetBox MCP server |
|
| **cmdb-assistant** | `/initial-setup` | | X | Setup wizard for NetBox MCP server |
|
||||||
| **cmdb-assistant** | `/cmdb-search` | | X | Search NetBox for devices, IPs, sites |
|
| **cmdb-assistant** | `/cmdb-search` | | X | Search NetBox for devices, IPs, sites |
|
||||||
| **cmdb-assistant** | `/cmdb-device` | | X | Manage network devices (create, view, update, delete) |
|
| **cmdb-assistant** | `/cmdb-device` | | X | Manage network devices (create, view, update, delete) |
|
||||||
|
|||||||
@@ -415,6 +415,144 @@ The command auto-detects that system config exists and runs quick project setup.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Installing Plugins to Consumer Projects
|
||||||
|
|
||||||
|
The marketplace provides scripts to install plugins into consumer projects. This sets up the MCP server connections and adds CLAUDE.md integration snippets.
|
||||||
|
|
||||||
|
### Install a Plugin
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /path/to/leo-claude-mktplace
|
||||||
|
./scripts/install-plugin.sh <plugin-name> <target-project-path>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Examples:**
|
||||||
|
```bash
|
||||||
|
# Install data-platform to a portfolio project
|
||||||
|
./scripts/install-plugin.sh data-platform ~/projects/personal-portfolio
|
||||||
|
|
||||||
|
# Install multiple plugins
|
||||||
|
./scripts/install-plugin.sh viz-platform ~/projects/personal-portfolio
|
||||||
|
./scripts/install-plugin.sh projman ~/projects/personal-portfolio
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
1. Validates the plugin exists in the marketplace
|
||||||
|
2. Adds MCP server entry to target's `.mcp.json` (if plugin has MCP server)
|
||||||
|
3. Appends integration snippet to target's `CLAUDE.md`
|
||||||
|
4. Reports changes and lists available commands
|
||||||
|
|
||||||
|
**After installation:** Restart your Claude Code session for MCP tools to become available.
|
||||||
|
|
||||||
|
### Uninstall a Plugin
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/uninstall-plugin.sh <plugin-name> <target-project-path>
|
||||||
|
```
|
||||||
|
|
||||||
|
Removes the MCP server entry and CLAUDE.md integration section.
|
||||||
|
|
||||||
|
### List Installed Plugins
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/list-installed.sh <target-project-path>
|
||||||
|
```
|
||||||
|
|
||||||
|
Shows which marketplace plugins are installed, partially installed, or available.
|
||||||
|
|
||||||
|
**Output example:**
|
||||||
|
```
|
||||||
|
✓ Fully Installed:
|
||||||
|
PLUGIN VERSION DESCRIPTION
|
||||||
|
------ ------- -----------
|
||||||
|
data-platform 1.3.0 pandas, PostgreSQL, and dbt integration...
|
||||||
|
viz-platform 1.1.0 DMC validation, Plotly charts, and theming...
|
||||||
|
|
||||||
|
○ Available (not installed):
|
||||||
|
projman 3.4.0 Sprint planning and project management...
|
||||||
|
```
|
||||||
|
|
||||||
|
### Plugins with MCP Servers
|
||||||
|
|
||||||
|
Not all plugins have MCP servers. The install script handles this automatically:
|
||||||
|
|
||||||
|
| Plugin | Has MCP Server | Notes |
|
||||||
|
|--------|---------------|-------|
|
||||||
|
| data-platform | ✓ | pandas, PostgreSQL, dbt tools |
|
||||||
|
| viz-platform | ✓ | DMC validation, chart, theme tools |
|
||||||
|
| contract-validator | ✓ | Plugin compatibility validation |
|
||||||
|
| cmdb-assistant | ✓ (via netbox) | NetBox CMDB tools |
|
||||||
|
| projman | ✓ (via gitea) | Issue, wiki, PR tools |
|
||||||
|
| pr-review | ✓ (via gitea) | PR review tools |
|
||||||
|
| git-flow | ✗ | Commands only |
|
||||||
|
| doc-guardian | ✗ | Commands and hooks only |
|
||||||
|
| code-sentinel | ✗ | Commands and hooks only |
|
||||||
|
| clarity-assist | ✗ | Commands only |
|
||||||
|
|
||||||
|
### Script Requirements
|
||||||
|
|
||||||
|
- **jq** must be installed (`sudo apt install jq`)
|
||||||
|
- Scripts are idempotent (safe to run multiple times)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Agent Model Selection
|
||||||
|
|
||||||
|
Marketplace agents specify their preferred model using Claude Code's `model` frontmatter field. This allows cost/performance optimization per agent.
|
||||||
|
|
||||||
|
### Supported Values
|
||||||
|
|
||||||
|
| Value | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| `sonnet` | Default. Balanced performance and cost. |
|
||||||
|
| `opus` | Higher reasoning depth. Use for complex analysis. |
|
||||||
|
| `haiku` | Faster, lower cost. Use for mechanical tasks. |
|
||||||
|
| `inherit` | Use session's current model setting. |
|
||||||
|
|
||||||
|
### How It Works
|
||||||
|
|
||||||
|
Each agent in `plugins/{plugin}/agents/{agent}.md` has frontmatter like:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
name: planner
|
||||||
|
description: Sprint planning agent - thoughtful architecture analysis
|
||||||
|
model: sonnet
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
Claude Code reads this field when invoking the agent as a subagent.
|
||||||
|
|
||||||
|
### Model Assignments
|
||||||
|
|
||||||
|
Agents are assigned models based on their task complexity:
|
||||||
|
|
||||||
|
| Model | Agents | Rationale |
|
||||||
|
|-------|--------|-----------|
|
||||||
|
| **sonnet** | Planner, Orchestrator, Executor, Code Reviewer, Coordinator, Security Reviewers, Performance Analyst, Data Advisor, Data Analysis, Design Reviewer, Layout Builder, Full Validation, Doc Analyzer, Clarity Coach, Maintainer, CMDB Assistant, Refactor Advisor | Standard reasoning, tool orchestration, code generation |
|
||||||
|
| **haiku** | Maintainability Auditor, Test Validator, Component Check, Theme Setup, Agent Check, Data Ingestion, Git Assistant | Pattern matching, quick validation, mechanical tasks |
|
||||||
|
|
||||||
|
### Overriding Model Selection
|
||||||
|
|
||||||
|
**Per-agent override:** Edit the `model:` field in the agent file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Change executor to use opus for heavy implementation work
|
||||||
|
nano plugins/projman/agents/executor.md
|
||||||
|
# Change model: sonnet to model: opus
|
||||||
|
```
|
||||||
|
|
||||||
|
**Session-level:** Users on Opus subscription can change the agent's model to `inherit` to use whatever model the session is using.
|
||||||
|
|
||||||
|
### Best Practices
|
||||||
|
|
||||||
|
1. **Default to sonnet** - Good balance for most tasks
|
||||||
|
2. **Use haiku for speed-sensitive agents** - Sub-agents dispatched in parallel, read-only tasks
|
||||||
|
3. **Reserve opus for heavy analysis** - Only when sonnet's reasoning isn't sufficient
|
||||||
|
4. **Use inherit sparingly** - Only when you want session-level control
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Automatic Validation Features
|
## Automatic Validation Features
|
||||||
|
|
||||||
### API Validation
|
### API Validation
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "clarity-assist",
|
"name": "clarity-assist",
|
||||||
"version": "1.0.0",
|
"version": "1.2.0",
|
||||||
"description": "Prompt optimization and requirement clarification with ND-friendly accommodations",
|
"description": "Prompt optimization and requirement clarification with ND-friendly accommodations",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: clarity-coach
|
||||||
|
description: Patient, structured coach helping users articulate requirements clearly. Uses neurodivergent-friendly communication patterns.
|
||||||
|
model: sonnet
|
||||||
|
---
|
||||||
|
|
||||||
# Clarity Coach Agent
|
# Clarity Coach Agent
|
||||||
|
|
||||||
## Visual Output Requirements
|
## Visual Output Requirements
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-config-maintainer",
|
"name": "claude-config-maintainer",
|
||||||
"version": "1.0.0",
|
"version": "1.2.0",
|
||||||
"description": "Maintains and optimizes CLAUDE.md configuration files for Claude Code projects",
|
"description": "Maintains and optimizes CLAUDE.md and settings.local.json configuration files for Claude Code projects",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
"email": "leobmiranda@gmail.com"
|
"email": "leobmiranda@gmail.com"
|
||||||
@@ -14,7 +14,9 @@
|
|||||||
"configuration",
|
"configuration",
|
||||||
"optimization",
|
"optimization",
|
||||||
"claude-md",
|
"claude-md",
|
||||||
"developer-tools"
|
"developer-tools",
|
||||||
|
"settings",
|
||||||
|
"permissions"
|
||||||
],
|
],
|
||||||
"commands": ["./commands/"]
|
"commands": ["./commands/"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: maintainer
|
name: maintainer
|
||||||
description: CLAUDE.md optimization and maintenance agent
|
description: CLAUDE.md optimization and maintenance agent
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# CLAUDE.md Maintainer Agent
|
# CLAUDE.md Maintainer Agent
|
||||||
@@ -114,7 +115,54 @@ Report plugin coverage percentage and offer to add missing integrations:
|
|||||||
- Display the integration content that would be added
|
- Display the integration content that would be added
|
||||||
- Ask user for confirmation before modifying CLAUDE.md
|
- Ask user for confirmation before modifying CLAUDE.md
|
||||||
|
|
||||||
### 2. Optimize CLAUDE.md Structure
|
### 2. Audit Settings Files
|
||||||
|
|
||||||
|
When auditing settings files, perform:
|
||||||
|
|
||||||
|
#### A. Permission Analysis
|
||||||
|
|
||||||
|
Read `.claude/settings.local.json` (primary) and check `.claude/settings.json` and `~/.claude.json` project entries (secondary).
|
||||||
|
|
||||||
|
Evaluate using `skills/settings-optimization.md`:
|
||||||
|
|
||||||
|
**Redundancy:**
|
||||||
|
- Duplicate entries in allow/deny arrays
|
||||||
|
- Subset patterns covered by broader patterns
|
||||||
|
- Patterns that could be merged
|
||||||
|
|
||||||
|
**Coverage:**
|
||||||
|
- Common safe tools missing from allow list
|
||||||
|
- MCP server tools not covered
|
||||||
|
- Directory scopes with no matching permission
|
||||||
|
|
||||||
|
**Safety Alignment:**
|
||||||
|
- Deny rules cover secrets and destructive commands
|
||||||
|
- Allow rules don't bypass active review layers
|
||||||
|
- No overly broad patterns without justification
|
||||||
|
|
||||||
|
**Profile Fit:**
|
||||||
|
- Compare against recommended profile for the project's review architecture
|
||||||
|
- Identify specific additions/removals to reach target profile
|
||||||
|
|
||||||
|
#### B. Review Layer Verification
|
||||||
|
|
||||||
|
Before recommending auto-allow patterns, verify active review layers:
|
||||||
|
|
||||||
|
1. Read `plugins/*/hooks/hooks.json` for each installed plugin
|
||||||
|
2. Map hook types (PreToolUse, PostToolUse) to tool matchers (Write, Edit, Bash)
|
||||||
|
3. Confirm plugins are listed in `.claude-plugin/marketplace.json`
|
||||||
|
4. Only recommend auto-allow for scopes covered by ≥2 verified review layers
|
||||||
|
|
||||||
|
#### C. Settings Efficiency Score (100 points)
|
||||||
|
|
||||||
|
| Category | Points |
|
||||||
|
|----------|--------|
|
||||||
|
| Redundancy | 25 |
|
||||||
|
| Coverage | 25 |
|
||||||
|
| Safety Alignment | 25 |
|
||||||
|
| Profile Fit | 25 |
|
||||||
|
|
||||||
|
### 3. Optimize CLAUDE.md Structure
|
||||||
|
|
||||||
**Recommended Structure:**
|
**Recommended Structure:**
|
||||||
|
|
||||||
@@ -149,7 +197,7 @@ Common issues and solutions.
|
|||||||
- Use headers that scan easily
|
- Use headers that scan easily
|
||||||
- Include examples where they add clarity
|
- Include examples where they add clarity
|
||||||
|
|
||||||
### 3. Apply Best Practices
|
### 4. Apply Best Practices
|
||||||
|
|
||||||
**DO:**
|
**DO:**
|
||||||
- Use clear, direct language
|
- Use clear, direct language
|
||||||
@@ -166,7 +214,7 @@ Common issues and solutions.
|
|||||||
- Add generic advice that applies to all projects
|
- Add generic advice that applies to all projects
|
||||||
- Use emojis unless project requires them
|
- Use emojis unless project requires them
|
||||||
|
|
||||||
### 4. Generate Improvement Reports
|
### 5. Generate Improvement Reports
|
||||||
|
|
||||||
After analyzing a CLAUDE.md, provide:
|
After analyzing a CLAUDE.md, provide:
|
||||||
|
|
||||||
@@ -202,7 +250,7 @@ Suggested Actions:
|
|||||||
Would you like me to implement these improvements?
|
Would you like me to implement these improvements?
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5. Insert Plugin Integrations
|
### 6. Insert Plugin Integrations
|
||||||
|
|
||||||
When adding plugin integration content to CLAUDE.md:
|
When adding plugin integration content to CLAUDE.md:
|
||||||
|
|
||||||
@@ -237,7 +285,7 @@ Add this integration to CLAUDE.md?
|
|||||||
- Allow users to skip specific plugins they don't want documented
|
- Allow users to skip specific plugins they don't want documented
|
||||||
- Preserve existing CLAUDE.md structure and content
|
- Preserve existing CLAUDE.md structure and content
|
||||||
|
|
||||||
### 6. Create New CLAUDE.md Files
|
### 7. Create New CLAUDE.md Files
|
||||||
|
|
||||||
When creating a new CLAUDE.md:
|
When creating a new CLAUDE.md:
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## CLAUDE.md Maintenance (claude-config-maintainer)
|
## CLAUDE.md Maintenance (claude-config-maintainer)
|
||||||
|
|
||||||
This project uses the **claude-config-maintainer** plugin to analyze and optimize CLAUDE.md configuration files.
|
This project uses the **claude-config-maintainer** plugin to analyze and optimize CLAUDE.md and settings.local.json configuration files.
|
||||||
|
|
||||||
### Available Commands
|
### Available Commands
|
||||||
|
|
||||||
@@ -9,8 +9,13 @@ This project uses the **claude-config-maintainer** plugin to analyze and optimiz
|
|||||||
| `/config-analyze` | Analyze CLAUDE.md for optimization opportunities with 100-point scoring |
|
| `/config-analyze` | Analyze CLAUDE.md for optimization opportunities with 100-point scoring |
|
||||||
| `/config-optimize` | Automatically optimize CLAUDE.md structure and content |
|
| `/config-optimize` | Automatically optimize CLAUDE.md structure and content |
|
||||||
| `/config-init` | Initialize a new CLAUDE.md file for a project |
|
| `/config-init` | Initialize a new CLAUDE.md file for a project |
|
||||||
|
| `/config-diff` | Track CLAUDE.md changes over time with behavioral impact analysis |
|
||||||
|
| `/config-lint` | Lint CLAUDE.md for anti-patterns and best practices (31 rules) |
|
||||||
|
| `/config-audit-settings` | Audit settings.local.json permissions with 100-point scoring |
|
||||||
|
| `/config-optimize-settings` | Optimize permission patterns and apply named profiles |
|
||||||
|
| `/config-permissions-map` | Visual map of review layers and permission coverage |
|
||||||
|
|
||||||
### Scoring System
|
### CLAUDE.md Scoring System
|
||||||
|
|
||||||
The analysis uses a 100-point scoring system across four categories:
|
The analysis uses a 100-point scoring system across four categories:
|
||||||
|
|
||||||
@@ -21,10 +26,31 @@ The analysis uses a 100-point scoring system across four categories:
|
|||||||
| Completeness | 25 | Overview, quick start, critical rules, workflows |
|
| Completeness | 25 | Overview, quick start, critical rules, workflows |
|
||||||
| Conciseness | 25 | Efficiency, no repetition, appropriate length |
|
| Conciseness | 25 | Efficiency, no repetition, appropriate length |
|
||||||
|
|
||||||
|
### Settings Scoring System
|
||||||
|
|
||||||
|
The settings audit uses a 100-point scoring system across four categories:
|
||||||
|
|
||||||
|
| Category | Points | What It Measures |
|
||||||
|
|----------|--------|------------------|
|
||||||
|
| Redundancy | 25 | No duplicates, no subset patterns, efficient rules |
|
||||||
|
| Coverage | 25 | Common tools allowed, MCP servers covered |
|
||||||
|
| Safety Alignment | 25 | Deny rules for secrets/destructive ops, review layers verified |
|
||||||
|
| Profile Fit | 25 | Alignment with recommended profile for review layer count |
|
||||||
|
|
||||||
|
### Permission Profiles
|
||||||
|
|
||||||
|
| Profile | Use Case |
|
||||||
|
|---------|----------|
|
||||||
|
| `conservative` | New users, minimal auto-allow, prompts for most writes |
|
||||||
|
| `reviewed` | Projects with 2+ review layers (code-sentinel, doc-guardian, PR review) |
|
||||||
|
| `autonomous` | Trusted CI/sandboxed environments only |
|
||||||
|
|
||||||
### Usage Guidelines
|
### Usage Guidelines
|
||||||
|
|
||||||
- Run `/config-analyze` periodically to assess CLAUDE.md quality
|
- Run `/config-analyze` periodically to assess CLAUDE.md quality
|
||||||
|
- Run `/config-audit-settings` to check permission efficiency
|
||||||
- Target a score of **70+/100** for effective Claude Code operation
|
- Target a score of **70+/100** for effective Claude Code operation
|
||||||
- Address HIGH priority issues first when optimizing
|
- Address HIGH priority issues first when optimizing
|
||||||
- Use `/config-init` when setting up new projects to start with best practices
|
- Use `/config-init` when setting up new projects to start with best practices
|
||||||
|
- Use `/config-permissions-map` to visualize review layer coverage
|
||||||
- Re-analyze after making changes to verify improvements
|
- Re-analyze after making changes to verify improvements
|
||||||
|
|||||||
@@ -0,0 +1,204 @@
|
|||||||
|
---
|
||||||
|
name: config-audit-settings
|
||||||
|
description: Audit settings.local.json for permission optimization opportunities
|
||||||
|
---
|
||||||
|
|
||||||
|
# /config-audit-settings
|
||||||
|
|
||||||
|
Audit Claude Code `settings.local.json` permissions with 100-point scoring across redundancy, coverage, safety alignment, and profile fit.
|
||||||
|
|
||||||
|
## Skills to Load
|
||||||
|
|
||||||
|
Before executing, load:
|
||||||
|
- `skills/visual-header.md`
|
||||||
|
- `skills/settings-optimization.md`
|
||||||
|
|
||||||
|
## Visual Output
|
||||||
|
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Settings Audit |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
/config-audit-settings # Full audit with recommendations
|
||||||
|
/config-audit-settings --diagram # Include Mermaid diagram of review layer coverage
|
||||||
|
```
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
### Step 1: Locate Settings Files
|
||||||
|
|
||||||
|
Search in order:
|
||||||
|
1. `.claude/settings.local.json` (primary target)
|
||||||
|
2. `.claude/settings.json` (shared config)
|
||||||
|
3. `~/.claude.json` project entry (legacy)
|
||||||
|
|
||||||
|
Report which format is in use.
|
||||||
|
|
||||||
|
### Step 2: Parse Permission Arrays
|
||||||
|
|
||||||
|
Extract and analyze:
|
||||||
|
- `permissions.allow` array
|
||||||
|
- `permissions.deny` array
|
||||||
|
- `permissions.ask` array (if present)
|
||||||
|
- Legacy `allowedTools` array (if legacy format)
|
||||||
|
|
||||||
|
### Step 3: Run Pattern Consolidation Analysis
|
||||||
|
|
||||||
|
Using `settings-optimization.md` Section 3, detect:
|
||||||
|
|
||||||
|
| Check | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| Duplicates | Exact same pattern appearing multiple times |
|
||||||
|
| Subsets | Narrower patterns covered by broader ones |
|
||||||
|
| Merge candidates | 4+ similar patterns that could be consolidated |
|
||||||
|
| Overly broad | Unscoped tool permissions (e.g., `Bash` without pattern) |
|
||||||
|
| Stale entries | Patterns referencing non-existent paths |
|
||||||
|
| Conflicts | Same pattern in both allow and deny |
|
||||||
|
|
||||||
|
### Step 4: Detect Active Marketplace Hooks
|
||||||
|
|
||||||
|
Read `plugins/*/hooks/hooks.json` files:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check each plugin's hooks
|
||||||
|
plugins/code-sentinel/hooks/hooks.json # PreToolUse security
|
||||||
|
plugins/doc-guardian/hooks/hooks.json # PostToolUse drift detection
|
||||||
|
plugins/project-hygiene/hooks/hooks.json # PostToolUse cleanup
|
||||||
|
plugins/data-platform/hooks/hooks.json # PostToolUse schema diff
|
||||||
|
plugins/contract-validator/hooks/hooks.json # Plugin validation
|
||||||
|
```
|
||||||
|
|
||||||
|
Parse each to identify:
|
||||||
|
- Hook event type (PreToolUse, PostToolUse)
|
||||||
|
- Tool matchers (Write, Edit, MultiEdit, Bash)
|
||||||
|
- Whether hook is command type (reliable) or prompt type (unreliable)
|
||||||
|
|
||||||
|
### Step 5: Map Review Layers to Directory Scopes
|
||||||
|
|
||||||
|
For each directory scope in `settings-optimization.md` Section 4:
|
||||||
|
1. Count how many review layers are verified active
|
||||||
|
2. Determine if auto-allow is justified (≥2 layers required)
|
||||||
|
3. Note any scopes that lack coverage
|
||||||
|
|
||||||
|
### Step 6: Compare Against Recommended Profile
|
||||||
|
|
||||||
|
Based on review layer count:
|
||||||
|
- 0-1 layers: Recommend `conservative` profile
|
||||||
|
- 2+ layers: Recommend `reviewed` profile
|
||||||
|
- CI/sandboxed: May recommend `autonomous` profile
|
||||||
|
|
||||||
|
Calculate profile fit percentage.
|
||||||
|
|
||||||
|
### Step 7: Generate Scored Report
|
||||||
|
|
||||||
|
Calculate scores using `settings-optimization.md` Section 6.
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
|
||||||
|
```
|
||||||
|
Settings Efficiency Score: XX/100
|
||||||
|
Redundancy: XX/25
|
||||||
|
Coverage: XX/25
|
||||||
|
Safety Alignment: XX/25
|
||||||
|
Profile Fit: XX/25
|
||||||
|
|
||||||
|
Current Profile: [closest match or "custom"]
|
||||||
|
Recommended Profile: [target based on review layers]
|
||||||
|
|
||||||
|
Issues Found:
|
||||||
|
🔴 CRITICAL: [description]
|
||||||
|
🟠 HIGH: [description]
|
||||||
|
🟡 MEDIUM: [description]
|
||||||
|
🔵 LOW: [description]
|
||||||
|
|
||||||
|
Active Review Layers Detected:
|
||||||
|
✓ code-sentinel (PreToolUse: Write|Edit|MultiEdit)
|
||||||
|
✓ doc-guardian (PostToolUse: Write|Edit|MultiEdit)
|
||||||
|
✓ project-hygiene (PostToolUse: Write|Edit)
|
||||||
|
✗ data-platform schema-diff (not detected)
|
||||||
|
|
||||||
|
Recommendations:
|
||||||
|
1. [specific action with pattern]
|
||||||
|
2. [specific action with pattern]
|
||||||
|
...
|
||||||
|
|
||||||
|
Follow-Up Actions:
|
||||||
|
1. Run /config-optimize-settings to apply recommendations
|
||||||
|
2. Run /config-optimize-settings --dry-run to preview first
|
||||||
|
3. Run /config-optimize-settings --profile=reviewed to apply profile
|
||||||
|
```
|
||||||
|
|
||||||
|
## Diagram Output (--diagram flag)
|
||||||
|
|
||||||
|
When `--diagram` is specified, generate a Mermaid flowchart showing:
|
||||||
|
|
||||||
|
**Before generating:** Read `/mnt/skills/user/mermaid-diagrams/SKILL.md` for diagram requirements.
|
||||||
|
|
||||||
|
**Diagram structure:**
|
||||||
|
- Left column: File operation types (Write, Edit, Bash)
|
||||||
|
- Middle: Review layers that intercept each operation
|
||||||
|
- Right column: Current permission status (auto-allowed, prompted, denied)
|
||||||
|
|
||||||
|
**Color coding:**
|
||||||
|
- PreToolUse hooks: Blue
|
||||||
|
- PostToolUse hooks: Green
|
||||||
|
- Sprint Approval: Amber
|
||||||
|
- PR Review: Purple
|
||||||
|
|
||||||
|
Example structure:
|
||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
subgraph Operations
|
||||||
|
W[Write]
|
||||||
|
E[Edit]
|
||||||
|
B[Bash]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Review Layers
|
||||||
|
CS[code-sentinel]
|
||||||
|
DG[doc-guardian]
|
||||||
|
PR[pr-review]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Permission
|
||||||
|
A[Auto-allowed]
|
||||||
|
P[Prompted]
|
||||||
|
D[Denied]
|
||||||
|
end
|
||||||
|
|
||||||
|
W --> CS
|
||||||
|
W --> DG
|
||||||
|
E --> CS
|
||||||
|
E --> DG
|
||||||
|
CS --> A
|
||||||
|
DG --> A
|
||||||
|
B --> P
|
||||||
|
|
||||||
|
classDef preHook fill:#e3f2fd
|
||||||
|
classDef postHook fill:#e8f5e9
|
||||||
|
classDef prReview fill:#f3e5f5
|
||||||
|
class CS preHook
|
||||||
|
class DG postHook
|
||||||
|
class PR prReview
|
||||||
|
```
|
||||||
|
|
||||||
|
## Issue Severity Levels
|
||||||
|
|
||||||
|
| Severity | Icon | Examples |
|
||||||
|
|----------|------|----------|
|
||||||
|
| CRITICAL | 🔴 | Unscoped `Bash` in allow, missing deny for secrets |
|
||||||
|
| HIGH | 🟠 | Overly broad patterns, missing MCP coverage |
|
||||||
|
| MEDIUM | 🟡 | Subset redundancy, merge candidates |
|
||||||
|
| LOW | 🔵 | Exact duplicates, minor optimizations |
|
||||||
|
|
||||||
|
## DO NOT
|
||||||
|
|
||||||
|
- Modify any files (this is audit only)
|
||||||
|
- Recommend `autonomous` profile unless explicitly sandboxed environment
|
||||||
|
- Recommend auto-allow for scopes with <2 verified review layers
|
||||||
|
- Skip hook verification before making recommendations
|
||||||
@@ -0,0 +1,243 @@
|
|||||||
|
---
|
||||||
|
name: config-optimize-settings
|
||||||
|
description: Optimize settings.local.json permissions based on audit recommendations
|
||||||
|
---
|
||||||
|
|
||||||
|
# /config-optimize-settings
|
||||||
|
|
||||||
|
Optimize Claude Code `settings.local.json` permission patterns and apply named profiles.
|
||||||
|
|
||||||
|
## Skills to Load
|
||||||
|
|
||||||
|
Before executing, load:
|
||||||
|
- `skills/visual-header.md`
|
||||||
|
- `skills/settings-optimization.md`
|
||||||
|
- `skills/pre-change-protocol.md`
|
||||||
|
|
||||||
|
## Visual Output
|
||||||
|
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Settings Optimization |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
/config-optimize-settings # Apply audit recommendations
|
||||||
|
/config-optimize-settings --dry-run # Preview only, no changes
|
||||||
|
/config-optimize-settings --profile=reviewed # Apply named profile
|
||||||
|
/config-optimize-settings --consolidate-only # Only merge/dedupe, no new rules
|
||||||
|
```
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
| Option | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
| `--dry-run` | Preview changes without applying |
|
||||||
|
| `--profile=NAME` | Apply named profile (`conservative`, `reviewed`, `autonomous`) |
|
||||||
|
| `--consolidate-only` | Only deduplicate and merge patterns, don't add new rules |
|
||||||
|
| `--no-backup` | Skip backup (not recommended) |
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
### Step 1: Run Audit Analysis
|
||||||
|
|
||||||
|
Execute the same analysis as `/config-audit-settings`:
|
||||||
|
1. Locate settings file
|
||||||
|
2. Parse permission arrays
|
||||||
|
3. Detect issues (duplicates, subsets, merge candidates, etc.)
|
||||||
|
4. Verify active review layers
|
||||||
|
5. Calculate current score
|
||||||
|
|
||||||
|
### Step 2: Generate Optimization Plan
|
||||||
|
|
||||||
|
Based on audit results, create a change plan:
|
||||||
|
|
||||||
|
**For `--consolidate-only`:**
|
||||||
|
- Remove exact duplicates
|
||||||
|
- Remove subset patterns covered by broader patterns
|
||||||
|
- Merge similar patterns (4+ threshold)
|
||||||
|
- Remove stale patterns for non-existent paths
|
||||||
|
- Remove conflicting allow entries that are already denied
|
||||||
|
|
||||||
|
**For `--profile=NAME`:**
|
||||||
|
- Calculate diff between current permissions and target profile
|
||||||
|
- Show additions and removals
|
||||||
|
- Preserve any custom deny rules not in profile
|
||||||
|
|
||||||
|
**For default (full optimization):**
|
||||||
|
- Apply all consolidation changes
|
||||||
|
- Add recommended patterns based on verified review layers
|
||||||
|
- Suggest profile alignment if appropriate
|
||||||
|
|
||||||
|
### Step 3: Show Before/After Preview
|
||||||
|
|
||||||
|
**MANDATORY:** Always show preview before applying changes.
|
||||||
|
|
||||||
|
```
|
||||||
|
Current Settings:
|
||||||
|
allow: [12 patterns]
|
||||||
|
deny: [4 patterns]
|
||||||
|
|
||||||
|
Proposed Changes:
|
||||||
|
|
||||||
|
REMOVE from allow (redundant):
|
||||||
|
- Write(plugins/projman/*) [covered by Write(plugins/**)]
|
||||||
|
- Write(plugins/git-flow/*) [covered by Write(plugins/**)]
|
||||||
|
- Bash(git status) [covered by Bash(git *)]
|
||||||
|
|
||||||
|
ADD to allow (recommended):
|
||||||
|
+ Bash(npm *) [2 review layers active]
|
||||||
|
+ Bash(pytest *) [2 review layers active]
|
||||||
|
|
||||||
|
ADD to deny (security):
|
||||||
|
+ Bash(curl * | bash*) [missing safety rule]
|
||||||
|
|
||||||
|
After Optimization:
|
||||||
|
allow: [10 patterns]
|
||||||
|
deny: [5 patterns]
|
||||||
|
|
||||||
|
Score Impact: 67/100 → 85/100 (+18 points)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 4: Request User Approval
|
||||||
|
|
||||||
|
Ask for confirmation before proceeding:
|
||||||
|
|
||||||
|
```
|
||||||
|
Apply these changes to .claude/settings.local.json?
|
||||||
|
[1] Yes, apply changes
|
||||||
|
[2] No, cancel
|
||||||
|
[3] Apply partial (select which changes)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 5: Create Backup
|
||||||
|
|
||||||
|
**Before any write operation:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Backup location
|
||||||
|
.claude/backups/settings.local.json.{YYYYMMDD-HHMMSS}
|
||||||
|
```
|
||||||
|
|
||||||
|
Create the `.claude/backups/` directory if it doesn't exist.
|
||||||
|
|
||||||
|
### Step 6: Apply Changes
|
||||||
|
|
||||||
|
Write the optimized `settings.local.json` file.
|
||||||
|
|
||||||
|
### Step 7: Verify
|
||||||
|
|
||||||
|
Re-read the file and re-calculate the score to confirm improvement.
|
||||||
|
|
||||||
|
```
|
||||||
|
Optimization Complete!
|
||||||
|
|
||||||
|
Backup saved: .claude/backups/settings.local.json.20260202-143022
|
||||||
|
|
||||||
|
Settings Efficiency Score: 85/100 (+18 from 67)
|
||||||
|
Redundancy: 25/25 (+8)
|
||||||
|
Coverage: 22/25 (+5)
|
||||||
|
Safety Alignment: 23/25 (+3)
|
||||||
|
Profile Fit: 15/25 (+2)
|
||||||
|
|
||||||
|
Changes applied:
|
||||||
|
- Removed 3 redundant patterns
|
||||||
|
- Added 2 recommended patterns
|
||||||
|
- Added 1 safety deny rule
|
||||||
|
```
|
||||||
|
|
||||||
|
## Profile Application
|
||||||
|
|
||||||
|
When using `--profile=NAME`:
|
||||||
|
|
||||||
|
### `conservative`
|
||||||
|
```
|
||||||
|
Switching to conservative profile...
|
||||||
|
|
||||||
|
This profile:
|
||||||
|
- Allows: Read, Glob, Grep, LS, basic Bash commands
|
||||||
|
- Allows: Write/Edit only for docs/
|
||||||
|
- Denies: .env*, secrets/, rm -rf, sudo
|
||||||
|
|
||||||
|
All other Write/Edit operations will prompt for approval.
|
||||||
|
```
|
||||||
|
|
||||||
|
### `reviewed`
|
||||||
|
```
|
||||||
|
Switching to reviewed profile...
|
||||||
|
|
||||||
|
Prerequisites verified:
|
||||||
|
✓ code-sentinel hook active (PreToolUse)
|
||||||
|
✓ doc-guardian hook active (PostToolUse)
|
||||||
|
✓ 2+ review layers detected
|
||||||
|
|
||||||
|
This profile:
|
||||||
|
- Allows: All file operations (Edit, Write, MultiEdit)
|
||||||
|
- Allows: Scoped Bash commands (git, npm, python, etc.)
|
||||||
|
- Denies: .env*, secrets/, rm -rf, sudo, curl|bash
|
||||||
|
```
|
||||||
|
|
||||||
|
### `autonomous`
|
||||||
|
```
|
||||||
|
⚠️ WARNING: Autonomous profile requested
|
||||||
|
|
||||||
|
This profile allows unscoped Bash execution.
|
||||||
|
Only use in fully sandboxed environments (CI, containers).
|
||||||
|
|
||||||
|
Confirm this is a sandboxed environment?
|
||||||
|
[1] Yes, this is sandboxed - apply autonomous profile
|
||||||
|
[2] No, cancel
|
||||||
|
```
|
||||||
|
|
||||||
|
## Safety Rules
|
||||||
|
|
||||||
|
1. **ALWAYS backup before writing** (unless `--no-backup`)
|
||||||
|
2. **NEVER remove deny rules without explicit confirmation**
|
||||||
|
3. **NEVER add unscoped `Bash` to allow** — always use scoped patterns
|
||||||
|
4. **Preview is MANDATORY** before applying changes
|
||||||
|
5. **Verify review layers** before recommending broad permissions
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
|
||||||
|
### Dry Run Output
|
||||||
|
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Settings Optimization |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
DRY RUN - No changes will be made
|
||||||
|
|
||||||
|
[... preview content ...]
|
||||||
|
|
||||||
|
To apply these changes, run:
|
||||||
|
/config-optimize-settings
|
||||||
|
```
|
||||||
|
|
||||||
|
### Applied Output
|
||||||
|
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Settings Optimization |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
Optimization Applied Successfully
|
||||||
|
|
||||||
|
Backup: .claude/backups/settings.local.json.20260202-143022
|
||||||
|
|
||||||
|
[... summary of changes ...]
|
||||||
|
|
||||||
|
Score: 67/100 → 85/100
|
||||||
|
```
|
||||||
|
|
||||||
|
## DO NOT
|
||||||
|
|
||||||
|
- Apply changes without showing preview
|
||||||
|
- Remove deny rules silently
|
||||||
|
- Add unscoped `Bash` permission
|
||||||
|
- Skip backup without explicit `--no-backup` flag
|
||||||
|
- Apply `autonomous` profile without sandbox confirmation
|
||||||
|
- Recommend broad permissions without verifying review layers
|
||||||
@@ -0,0 +1,256 @@
|
|||||||
|
---
|
||||||
|
name: config-permissions-map
|
||||||
|
description: Generate visual map of review layers and permission coverage
|
||||||
|
---
|
||||||
|
|
||||||
|
# /config-permissions-map
|
||||||
|
|
||||||
|
Generate a Mermaid diagram showing the relationship between file operations, review layers, and permission status.
|
||||||
|
|
||||||
|
## Skills to Load
|
||||||
|
|
||||||
|
Before executing, load:
|
||||||
|
- `skills/visual-header.md`
|
||||||
|
- `skills/settings-optimization.md`
|
||||||
|
|
||||||
|
Also read: `/mnt/skills/user/mermaid-diagrams/SKILL.md` (for diagram requirements)
|
||||||
|
|
||||||
|
## Visual Output
|
||||||
|
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Permissions Map |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
/config-permissions-map # Generate and display diagram
|
||||||
|
/config-permissions-map --save # Save diagram to .mermaid file
|
||||||
|
```
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
### Step 1: Detect Active Hooks
|
||||||
|
|
||||||
|
Read all plugin hooks from the marketplace:
|
||||||
|
|
||||||
|
```
|
||||||
|
plugins/code-sentinel/hooks/hooks.json
|
||||||
|
plugins/doc-guardian/hooks/hooks.json
|
||||||
|
plugins/project-hygiene/hooks/hooks.json
|
||||||
|
plugins/data-platform/hooks/hooks.json
|
||||||
|
plugins/contract-validator/hooks/hooks.json
|
||||||
|
plugins/cmdb-assistant/hooks/hooks.json
|
||||||
|
```
|
||||||
|
|
||||||
|
For each hook, extract:
|
||||||
|
- Event type (PreToolUse, PostToolUse, SessionStart, etc.)
|
||||||
|
- Tool matchers (Write, Edit, MultiEdit, Bash patterns)
|
||||||
|
- Hook command/script
|
||||||
|
|
||||||
|
### Step 2: Map Hooks to File Scopes
|
||||||
|
|
||||||
|
Create a mapping of which review layers cover which operations:
|
||||||
|
|
||||||
|
| Operation | PreToolUse Hooks | PostToolUse Hooks | Other Gates |
|
||||||
|
|-----------|------------------|-------------------|-------------|
|
||||||
|
| Write | code-sentinel | doc-guardian, project-hygiene | PR review |
|
||||||
|
| Edit | code-sentinel | doc-guardian, project-hygiene | PR review |
|
||||||
|
| MultiEdit | code-sentinel | doc-guardian | PR review |
|
||||||
|
| Bash(git *) | git-flow | — | — |
|
||||||
|
|
||||||
|
### Step 3: Read Current Permissions
|
||||||
|
|
||||||
|
Load `.claude/settings.local.json` and parse:
|
||||||
|
- `allow` array → auto-allowed operations
|
||||||
|
- `deny` array → blocked operations
|
||||||
|
- `ask` array → always-prompted operations
|
||||||
|
|
||||||
|
### Step 4: Generate Mermaid Flowchart
|
||||||
|
|
||||||
|
**Diagram requirements (from mermaid-diagrams skill):**
|
||||||
|
- Use `classDef` for styling
|
||||||
|
- Maximum 3 colors (blue, green, amber/purple)
|
||||||
|
- Semantic arrow labels
|
||||||
|
- Left-to-right flow
|
||||||
|
|
||||||
|
**Structure:**
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
subgraph ops[File Operations]
|
||||||
|
direction TB
|
||||||
|
W[Write]
|
||||||
|
E[Edit]
|
||||||
|
ME[MultiEdit]
|
||||||
|
BG[Bash git]
|
||||||
|
BN[Bash npm]
|
||||||
|
BO[Bash other]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph pre[PreToolUse Hooks]
|
||||||
|
direction TB
|
||||||
|
CS[code-sentinel<br/>Security Scan]
|
||||||
|
GF[git-flow<br/>Branch Check]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph post[PostToolUse Hooks]
|
||||||
|
direction TB
|
||||||
|
DG[doc-guardian<br/>Drift Detection]
|
||||||
|
PH[project-hygiene<br/>Cleanup]
|
||||||
|
DP[data-platform<br/>Schema Diff]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph perm[Permission Status]
|
||||||
|
direction TB
|
||||||
|
AA[Auto-Allowed]
|
||||||
|
PR[Prompted]
|
||||||
|
DN[Denied]
|
||||||
|
end
|
||||||
|
|
||||||
|
W -->|intercepted| CS
|
||||||
|
W -->|tracked| DG
|
||||||
|
E -->|intercepted| CS
|
||||||
|
E -->|tracked| DG
|
||||||
|
BG -->|checked| GF
|
||||||
|
|
||||||
|
CS -->|passed| AA
|
||||||
|
DG -->|logged| AA
|
||||||
|
GF -->|valid| AA
|
||||||
|
BO -->|no hook| PR
|
||||||
|
|
||||||
|
classDef preHook fill:#e3f2fd,stroke:#1976d2
|
||||||
|
classDef postHook fill:#e8f5e9,stroke:#388e3c
|
||||||
|
classDef sprint fill:#fff3e0,stroke:#f57c00
|
||||||
|
classDef prReview fill:#f3e5f5,stroke:#7b1fa2
|
||||||
|
classDef allowed fill:#c8e6c9,stroke:#2e7d32
|
||||||
|
classDef prompted fill:#fff9c4,stroke:#f9a825
|
||||||
|
classDef denied fill:#ffcdd2,stroke:#c62828
|
||||||
|
|
||||||
|
class CS,GF preHook
|
||||||
|
class DG,PH,DP postHook
|
||||||
|
class AA allowed
|
||||||
|
class PR prompted
|
||||||
|
class DN denied
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 5: Generate Coverage Summary Table
|
||||||
|
|
||||||
|
```
|
||||||
|
Review Layer Coverage Summary
|
||||||
|
=============================
|
||||||
|
|
||||||
|
| Directory Scope | Layers | Status | Recommendation |
|
||||||
|
|--------------------------|--------|-----------------|----------------|
|
||||||
|
| plugins/*/commands/*.md | 3 | ✓ Auto-allowed | — |
|
||||||
|
| plugins/*/skills/*.md | 2 | ✓ Auto-allowed | — |
|
||||||
|
| mcp-servers/**/*.py | 3 | ✓ Auto-allowed | — |
|
||||||
|
| docs/** | 2 | ✓ Auto-allowed | — |
|
||||||
|
| scripts/*.sh | 2 | ⚠ Prompted | Consider auto-allow |
|
||||||
|
| .env* | 0 | ✗ Denied | Correct - secrets |
|
||||||
|
| Root directory | 1 | ⚠ Prompted | Keep prompted |
|
||||||
|
|
||||||
|
Legend:
|
||||||
|
✓ = Covered by ≥2 review layers, auto-allowed
|
||||||
|
⚠ = Fewer than 2 layers or not allowed
|
||||||
|
✗ = Explicitly denied
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 6: Identify Gaps
|
||||||
|
|
||||||
|
Report any gaps in coverage:
|
||||||
|
|
||||||
|
```
|
||||||
|
Coverage Gaps Detected:
|
||||||
|
1. Bash(npm *) — not in allow list, but npm operations are common
|
||||||
|
→ 2 review layers active, could be auto-allowed
|
||||||
|
|
||||||
|
2. mcp__data-platform__* — MCP server configured but tools not allowed
|
||||||
|
→ Add to allow list to avoid prompts
|
||||||
|
|
||||||
|
3. scripts/*.sh — 2 review layers but still prompted
|
||||||
|
→ Consider adding Write(scripts/**) to allow
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 7: Output Diagram
|
||||||
|
|
||||||
|
Display the Mermaid diagram inline.
|
||||||
|
|
||||||
|
If `--save` flag is used:
|
||||||
|
- Save to `.claude/permissions-map.mermaid`
|
||||||
|
- Report the file path
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Permissions Map |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
Review Layer Status
|
||||||
|
===================
|
||||||
|
|
||||||
|
PreToolUse Hooks (intercept before operation):
|
||||||
|
✓ code-sentinel — Write, Edit, MultiEdit
|
||||||
|
✓ git-flow — Bash(git checkout *), Bash(git commit *)
|
||||||
|
|
||||||
|
PostToolUse Hooks (track after operation):
|
||||||
|
✓ doc-guardian — Write, Edit, MultiEdit
|
||||||
|
✓ project-hygiene — Write, Edit
|
||||||
|
✗ data-platform — not detected
|
||||||
|
|
||||||
|
Other Review Gates:
|
||||||
|
✓ Sprint Approval (projman milestone workflow)
|
||||||
|
✓ PR Review (pr-review multi-agent)
|
||||||
|
|
||||||
|
Permissions Flow Diagram
|
||||||
|
========================
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
[diagram here]
|
||||||
|
```
|
||||||
|
|
||||||
|
Coverage Summary
|
||||||
|
================
|
||||||
|
|
||||||
|
[table here]
|
||||||
|
|
||||||
|
Gaps & Recommendations
|
||||||
|
======================
|
||||||
|
|
||||||
|
[gaps list here]
|
||||||
|
```
|
||||||
|
|
||||||
|
## File Output (--save flag)
|
||||||
|
|
||||||
|
When `--save` is specified:
|
||||||
|
|
||||||
|
```
|
||||||
|
Diagram saved to: .claude/permissions-map.mermaid
|
||||||
|
|
||||||
|
To view:
|
||||||
|
- Open in VS Code with Mermaid extension
|
||||||
|
- Paste into https://mermaid.live
|
||||||
|
- Include in documentation with ```mermaid code fence
|
||||||
|
```
|
||||||
|
|
||||||
|
## Color Scheme
|
||||||
|
|
||||||
|
| Element | Color | Hex |
|
||||||
|
|---------|-------|-----|
|
||||||
|
| PreToolUse hooks | Blue | #e3f2fd |
|
||||||
|
| PostToolUse hooks | Green | #e8f5e9 |
|
||||||
|
| Sprint/Planning gates | Amber | #fff3e0 |
|
||||||
|
| PR Review | Purple | #f3e5f5 |
|
||||||
|
| Auto-allowed | Light green | #c8e6c9 |
|
||||||
|
| Prompted | Light yellow | #fff9c4 |
|
||||||
|
| Denied | Light red | #ffcdd2 |
|
||||||
|
|
||||||
|
## DO NOT
|
||||||
|
|
||||||
|
- Generate diagrams without reading the mermaid-diagrams skill
|
||||||
|
- Use more than 3 primary colors in the diagram
|
||||||
|
- Skip the coverage summary table
|
||||||
|
- Fail to identify coverage gaps
|
||||||
377
plugins/claude-config-maintainer/skills/settings-optimization.md
Normal file
377
plugins/claude-config-maintainer/skills/settings-optimization.md
Normal file
@@ -0,0 +1,377 @@
|
|||||||
|
# Settings Optimization Skill
|
||||||
|
|
||||||
|
This skill provides comprehensive knowledge for auditing and optimizing Claude Code `settings.local.json` permission configurations.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Section 1: Settings File Locations & Format
|
||||||
|
|
||||||
|
Claude Code uses two configuration formats for permissions:
|
||||||
|
|
||||||
|
### Newer Format (Recommended)
|
||||||
|
|
||||||
|
**Primary target:** `.claude/settings.local.json` (project-local, gitignored)
|
||||||
|
|
||||||
|
**Secondary locations:**
|
||||||
|
- `.claude/settings.json` (shared, committed)
|
||||||
|
- `~/.claude.json` (legacy global config)
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": ["Edit", "Write(plugins/**)", "Bash(git *)"],
|
||||||
|
"deny": ["Read(.env*)", "Bash(rm *)"],
|
||||||
|
"ask": ["Bash(pip install *)"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Field meanings:**
|
||||||
|
- `allow`: Operations auto-approved without prompting
|
||||||
|
- `deny`: Operations blocked entirely
|
||||||
|
- `ask`: Operations that always prompt (overrides allow)
|
||||||
|
|
||||||
|
### Legacy Format
|
||||||
|
|
||||||
|
Found in `~/.claude.json` with per-project entries:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"projects": {
|
||||||
|
"/path/to/project": {
|
||||||
|
"allowedTools": ["Read", "Write", "Bash(git *)"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Detection strategy:**
|
||||||
|
1. Check `.claude/settings.local.json` first (primary)
|
||||||
|
2. Check `.claude/settings.json` (shared)
|
||||||
|
3. Check `~/.claude.json` for project entry (legacy)
|
||||||
|
4. Report which format is in use
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Section 2: Permission Rule Syntax Reference
|
||||||
|
|
||||||
|
| Pattern | Meaning |
|
||||||
|
|---------|---------|
|
||||||
|
| `Tool` or `Tool(*)` | Allow all uses of that tool |
|
||||||
|
| `Bash(npm run build)` | Exact command match |
|
||||||
|
| `Bash(npm run test *)` | Prefix match (space+asterisk = word boundary) |
|
||||||
|
| `Bash(npm*)` | Prefix match without word boundary |
|
||||||
|
| `Write(plugins/**)` | Glob — all files recursively under `plugins/` |
|
||||||
|
| `Write(plugins/projman/*)` | Glob — direct children only |
|
||||||
|
| `Read(.env*)` | Pattern matching `.env`, `.env.local`, etc. |
|
||||||
|
| `mcp__gitea__*` | All tools from the gitea MCP server |
|
||||||
|
| `mcp__netbox__list_*` | Specific MCP tool pattern |
|
||||||
|
| `WebFetch(domain:github.com)` | Domain-restricted web fetch |
|
||||||
|
|
||||||
|
### Important Nuances
|
||||||
|
|
||||||
|
**Word boundary matching:**
|
||||||
|
- `Bash(ls *)` (with space) matches `ls -la` but NOT `lsof`
|
||||||
|
- `Bash(ls*)` (no space) matches both `ls -la` AND `lsof`
|
||||||
|
|
||||||
|
**Precedence rules:**
|
||||||
|
- `deny` rules take precedence over `allow` rules
|
||||||
|
- `ask` rules override both (always prompts even if allowed)
|
||||||
|
- More specific patterns do NOT override broader patterns
|
||||||
|
|
||||||
|
**Command operators:**
|
||||||
|
- Piped commands (`cmd1 | cmd2`) may not match individual command rules (known Claude Code limitation)
|
||||||
|
- Shell operators (`&&`, `||`) — Claude Code is aware of these and won't let prefix rules bypass them
|
||||||
|
- Commands with redirects (`>`, `>>`, `<`) are evaluated as complete strings
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Section 3: Pattern Consolidation Rules
|
||||||
|
|
||||||
|
The audit detects these optimization opportunities:
|
||||||
|
|
||||||
|
| Issue | Example | Recommendation |
|
||||||
|
|-------|---------|----------------|
|
||||||
|
| **Exact duplicates** | `Write(plugins/**)` listed twice | Remove duplicate |
|
||||||
|
| **Subset redundancy** | `Write(plugins/projman/*)` when `Write(plugins/**)` exists | Remove the narrower pattern — already covered |
|
||||||
|
| **Merge candidates** | `Write(plugins/projman/*)`, `Write(plugins/git-flow/*)`, `Write(plugins/pr-review/*)` ... (4+ similar patterns) | Merge to `Write(plugins/**)` |
|
||||||
|
| **Overly broad** | `Bash` (no specifier = allows ALL bash) | Flag as security concern, suggest scoped patterns |
|
||||||
|
| **Stale patterns** | `Write(plugins/old-plugin/**)` for a plugin that no longer exists | Remove stale entry |
|
||||||
|
| **Missing MCP permissions** | MCP servers in `.mcp.json` but no `mcp__servername__*` in allow | Suggest adding if server is trusted |
|
||||||
|
| **Conflicting rules** | Same pattern in both `allow` and `deny` | Flag conflict — deny wins, but allow is dead weight |
|
||||||
|
|
||||||
|
### Consolidation Algorithm
|
||||||
|
|
||||||
|
1. **Deduplicate:** Remove exact duplicates from each array
|
||||||
|
2. **Subset elimination:** For each pattern, check if a broader pattern exists
|
||||||
|
- `Write(plugins/projman/*)` is subset of `Write(plugins/**)`
|
||||||
|
- `Bash(git status)` is subset of `Bash(git *)`
|
||||||
|
3. **Merge detection:** If 4+ patterns share a common prefix, suggest merge
|
||||||
|
- Threshold: 4 patterns minimum before suggesting consolidation
|
||||||
|
4. **Stale detection:** Cross-reference file patterns against actual filesystem
|
||||||
|
5. **Conflict detection:** Check for patterns appearing in multiple arrays
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Section 4: Review-Layer-Aware Recommendations
|
||||||
|
|
||||||
|
This is the key section. Map upstream review processes to directory scopes:
|
||||||
|
|
||||||
|
| Directory Scope | Active Review Layers | Auto-Allow Recommendation |
|
||||||
|
|----------------|---------------------|---------------------------|
|
||||||
|
| `plugins/*/commands/*.md` | Sprint approval, PR review, doc-guardian PostToolUse | `Write(plugins/*/commands/**)` — 3 layers cover this |
|
||||||
|
| `plugins/*/skills/*.md` | Sprint approval, PR review | `Write(plugins/*/skills/**)` — 2 layers |
|
||||||
|
| `plugins/*/agents/*.md` | Sprint approval, PR review, contract-validator | `Write(plugins/*/agents/**)` — 3 layers |
|
||||||
|
| `mcp-servers/*/mcp_server/*.py` | Code-sentinel PreToolUse, sprint approval, PR review | `Write(mcp-servers/**)` + `Edit(mcp-servers/**)` — sentinel catches secrets |
|
||||||
|
| `docs/*.md` | Doc-guardian PostToolUse, PR review | `Write(docs/**)` + `Edit(docs/**)` |
|
||||||
|
| `.claude-plugin/*.json` | validate-marketplace.sh, PR review | `Write(.claude-plugin/**)` |
|
||||||
|
| `scripts/*.sh` | Code-sentinel, PR review | `Write(scripts/**)` — with caution flag |
|
||||||
|
| `CLAUDE.md`, `CHANGELOG.md`, `README.md` | Doc-guardian, PR review | `Write(CLAUDE.md)`, `Write(CHANGELOG.md)`, `Write(README.md)` |
|
||||||
|
|
||||||
|
### Critical Rule: Hook Verification
|
||||||
|
|
||||||
|
**Before recommending auto-allow for a scope, the agent MUST verify the hook is actually configured.**
|
||||||
|
|
||||||
|
Read the relevant `plugins/*/hooks/hooks.json` file:
|
||||||
|
- If code-sentinel's hook is missing or disabled, do NOT recommend auto-allowing `mcp-servers/**` writes
|
||||||
|
- If doc-guardian's hook is missing, do NOT recommend auto-allowing `docs/**` without caution
|
||||||
|
- Count the number of verified review layers before making recommendations
|
||||||
|
|
||||||
|
**Minimum threshold:** Recommend auto-allow only for scopes covered by ≥2 verified review layers.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Section 5: Permission Profiles
|
||||||
|
|
||||||
|
Three named profiles for different project contexts:
|
||||||
|
|
||||||
|
### `conservative` (Default for New Users)
|
||||||
|
|
||||||
|
Minimal permissions, prompts for most write operations:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Read",
|
||||||
|
"Glob",
|
||||||
|
"Grep",
|
||||||
|
"LS",
|
||||||
|
"Write(docs/**)",
|
||||||
|
"Edit(docs/**)",
|
||||||
|
"Bash(git status *)",
|
||||||
|
"Bash(git diff *)",
|
||||||
|
"Bash(git log *)",
|
||||||
|
"Bash(cat *)",
|
||||||
|
"Bash(ls *)",
|
||||||
|
"Bash(head *)",
|
||||||
|
"Bash(tail *)",
|
||||||
|
"Bash(wc *)",
|
||||||
|
"Bash(grep *)"
|
||||||
|
],
|
||||||
|
"deny": [
|
||||||
|
"Read(.env*)",
|
||||||
|
"Read(./secrets/**)",
|
||||||
|
"Bash(rm -rf *)",
|
||||||
|
"Bash(sudo *)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `reviewed` (Projects with ≥2 Upstream Review Layers)
|
||||||
|
|
||||||
|
This is the target profile for projects using the marketplace's multi-layer review architecture:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Read",
|
||||||
|
"Glob",
|
||||||
|
"Grep",
|
||||||
|
"LS",
|
||||||
|
"Edit",
|
||||||
|
"Write",
|
||||||
|
"MultiEdit",
|
||||||
|
"Bash(git *)",
|
||||||
|
"Bash(python *)",
|
||||||
|
"Bash(pip install *)",
|
||||||
|
"Bash(cd *)",
|
||||||
|
"Bash(cat *)",
|
||||||
|
"Bash(ls *)",
|
||||||
|
"Bash(head *)",
|
||||||
|
"Bash(tail *)",
|
||||||
|
"Bash(wc *)",
|
||||||
|
"Bash(grep *)",
|
||||||
|
"Bash(find *)",
|
||||||
|
"Bash(mkdir *)",
|
||||||
|
"Bash(cp *)",
|
||||||
|
"Bash(mv *)",
|
||||||
|
"Bash(touch *)",
|
||||||
|
"Bash(chmod *)",
|
||||||
|
"Bash(source *)",
|
||||||
|
"Bash(echo *)",
|
||||||
|
"Bash(sed *)",
|
||||||
|
"Bash(awk *)",
|
||||||
|
"Bash(sort *)",
|
||||||
|
"Bash(uniq *)",
|
||||||
|
"Bash(diff *)",
|
||||||
|
"Bash(jq *)",
|
||||||
|
"Bash(npm *)",
|
||||||
|
"Bash(npx *)",
|
||||||
|
"Bash(node *)",
|
||||||
|
"Bash(pytest *)",
|
||||||
|
"Bash(python -m *)",
|
||||||
|
"Bash(./scripts/*)",
|
||||||
|
"WebFetch",
|
||||||
|
"WebSearch"
|
||||||
|
],
|
||||||
|
"deny": [
|
||||||
|
"Read(.env*)",
|
||||||
|
"Read(./secrets/**)",
|
||||||
|
"Bash(rm -rf *)",
|
||||||
|
"Bash(sudo *)",
|
||||||
|
"Bash(curl * | bash*)",
|
||||||
|
"Bash(wget * | bash*)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `autonomous` (Trusted CI/Sandboxed Environments Only)
|
||||||
|
|
||||||
|
Maximum permissions for automated environments:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Read",
|
||||||
|
"Glob",
|
||||||
|
"Grep",
|
||||||
|
"LS",
|
||||||
|
"Edit",
|
||||||
|
"Write",
|
||||||
|
"MultiEdit",
|
||||||
|
"Bash",
|
||||||
|
"WebFetch",
|
||||||
|
"WebSearch"
|
||||||
|
],
|
||||||
|
"deny": [
|
||||||
|
"Read(.env*)",
|
||||||
|
"Read(./secrets/**)",
|
||||||
|
"Bash(rm -rf /)",
|
||||||
|
"Bash(sudo *)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Warning:** The `autonomous` profile allows unscoped `Bash` — only use in fully sandboxed environments.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Section 6: Scoring Criteria (Settings Efficiency Score — 100 points)
|
||||||
|
|
||||||
|
| Category | Points | What It Measures |
|
||||||
|
|----------|--------|------------------|
|
||||||
|
| **Redundancy** | 25 | No duplicates, no subset patterns, merged where possible |
|
||||||
|
| **Coverage** | 25 | Common tools allowed, MCP servers covered, no unnecessary gaps |
|
||||||
|
| **Safety Alignment** | 25 | Deny rules cover secrets, destructive commands; review layers verified |
|
||||||
|
| **Profile Fit** | 25 | How close to recommended profile for the project's review layer count |
|
||||||
|
|
||||||
|
### Scoring Breakdown
|
||||||
|
|
||||||
|
**Redundancy (25 points):**
|
||||||
|
- 25: No duplicates, no subsets, patterns are consolidated
|
||||||
|
- 20: 1-2 minor redundancies
|
||||||
|
- 15: 3-5 redundancies or 1 merge candidate group
|
||||||
|
- 10: 6+ redundancies or 2+ merge candidate groups
|
||||||
|
- 5: Significant redundancy (10+ issues)
|
||||||
|
- 0: Severe redundancy (20+ issues)
|
||||||
|
|
||||||
|
**Coverage (25 points):**
|
||||||
|
- 25: All common tools allowed, MCP servers covered
|
||||||
|
- 20: Missing 1-2 common tool patterns
|
||||||
|
- 15: Missing 3-5 patterns or 1 MCP server
|
||||||
|
- 10: Missing 6+ patterns or 2+ MCP servers
|
||||||
|
- 5: Significant gaps causing frequent prompts
|
||||||
|
- 0: Minimal coverage (prompts on most operations)
|
||||||
|
|
||||||
|
**Safety Alignment (25 points):**
|
||||||
|
- 25: Deny rules cover secrets + destructive ops, review layers verified
|
||||||
|
- 20: Minor gaps (e.g., missing one secret pattern)
|
||||||
|
- 15: Overly broad allow without review layer coverage
|
||||||
|
- 10: Missing deny rules for secrets or destructive commands
|
||||||
|
- 5: Unsafe patterns without review layer justification
|
||||||
|
- 0: Security concerns (e.g., unscoped `Bash` without review layers)
|
||||||
|
|
||||||
|
**Profile Fit (25 points):**
|
||||||
|
- 25: Matches recommended profile exactly
|
||||||
|
- 20: Within 90% of recommended profile
|
||||||
|
- 15: Within 80% of recommended profile
|
||||||
|
- 10: Within 70% of recommended profile
|
||||||
|
- 5: Significant deviation from recommended profile
|
||||||
|
- 0: No alignment with any named profile
|
||||||
|
|
||||||
|
### Score Interpretation
|
||||||
|
|
||||||
|
| Score Range | Status | Meaning |
|
||||||
|
|-------------|--------|---------|
|
||||||
|
| 90-100 | Optimized | Minimal prompt interruptions, safety maintained |
|
||||||
|
| 70-89 | Good | Minor consolidation opportunities |
|
||||||
|
| 50-69 | Needs Work | Significant redundancy or missing permissions |
|
||||||
|
| Below 50 | Poor | Likely getting constant approval prompts unnecessarily |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Section 7: Hook Detection Method
|
||||||
|
|
||||||
|
To verify which review layers are active, read these files:
|
||||||
|
|
||||||
|
| File | Hook Type | Tool Matcher | Purpose |
|
||||||
|
|------|-----------|--------------|---------|
|
||||||
|
| `plugins/code-sentinel/hooks/hooks.json` | PreToolUse | Write\|Edit\|MultiEdit | Blocks hardcoded secrets |
|
||||||
|
| `plugins/doc-guardian/hooks/hooks.json` | PostToolUse | Write\|Edit\|MultiEdit | Tracks documentation drift |
|
||||||
|
| `plugins/project-hygiene/hooks/hooks.json` | PostToolUse | Write\|Edit | Cleanup tracking |
|
||||||
|
| `plugins/data-platform/hooks/hooks.json` | PostToolUse | Edit\|Write | Schema diff detection |
|
||||||
|
| `plugins/cmdb-assistant/hooks/hooks.json` | PreToolUse | (if exists) | Input validation |
|
||||||
|
|
||||||
|
### Verification Process
|
||||||
|
|
||||||
|
1. **Read each hooks.json file**
|
||||||
|
2. **Parse the JSON to find hook configurations**
|
||||||
|
3. **Check the `type` field** — must be `"command"` (not `"prompt"`)
|
||||||
|
4. **Check the `event` field** — maps to when hook runs
|
||||||
|
5. **Check the `tools` array** — which operations are intercepted
|
||||||
|
6. **Verify plugin is in marketplace** — check `.claude-plugin/marketplace.json`
|
||||||
|
|
||||||
|
### Example Hook Structure
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"event": "PreToolUse",
|
||||||
|
"type": "command",
|
||||||
|
"command": "./hooks/security-check.sh",
|
||||||
|
"tools": ["Write", "Edit", "MultiEdit"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Review Layer Count
|
||||||
|
|
||||||
|
Count verified review layers for each scope:
|
||||||
|
|
||||||
|
| Layer | Verification |
|
||||||
|
|-------|-------------|
|
||||||
|
| Sprint approval | Check if projman plugin is installed (milestone workflow) |
|
||||||
|
| PR review | Check if pr-review plugin is installed |
|
||||||
|
| code-sentinel PreToolUse | hooks.json exists with PreToolUse on Write/Edit |
|
||||||
|
| doc-guardian PostToolUse | hooks.json exists with PostToolUse on Write/Edit |
|
||||||
|
| contract-validator | Plugin installed + hooks present |
|
||||||
|
|
||||||
|
**Recommendation threshold:** Only recommend auto-allow for scopes with ≥2 verified layers.
|
||||||
@@ -47,6 +47,27 @@ This skill defines the standard visual header for claude-config-maintainer comma
|
|||||||
+-----------------------------------------------------------------+
|
+-----------------------------------------------------------------+
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### /config-audit-settings
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Settings Audit |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
### /config-optimize-settings
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Settings Optimization |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
### /config-permissions-map
|
||||||
|
```
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
| CONFIG-MAINTAINER - Permissions Map |
|
||||||
|
+-----------------------------------------------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Display the header at the start of command execution, before any analysis or output.
|
Display the header at the start of command execution, before any analysis or output.
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: cmdb-assistant
|
||||||
|
description: Infrastructure management assistant specialized in NetBox CMDB operations. Use for device management, IP addressing, and infrastructure queries.
|
||||||
|
model: sonnet
|
||||||
|
---
|
||||||
|
|
||||||
# CMDB Assistant Agent
|
# CMDB Assistant Agent
|
||||||
|
|
||||||
You are an infrastructure management assistant specialized in NetBox CMDB operations.
|
You are an infrastructure management assistant specialized in NetBox CMDB operations.
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
description: Code structure and refactoring specialist
|
name: refactor-advisor
|
||||||
|
description: Code structure and refactoring specialist. Use when analyzing code quality, design patterns, or planning refactoring work.
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Refactor Advisor Agent
|
# Refactor Advisor Agent
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: security-reviewer
|
name: security-reviewer
|
||||||
description: Security-focused code review agent
|
description: Security-focused code review agent
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Security Reviewer Agent
|
# Security Reviewer Agent
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "contract-validator",
|
"name": "contract-validator",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "Cross-plugin compatibility validation and Claude.md agent verification",
|
"description": "Cross-plugin compatibility validation and Claude.md agent verification",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: agent-check
|
name: agent-check
|
||||||
description: Agent definition validator for quick verification
|
description: Agent definition validator for quick verification
|
||||||
|
model: haiku
|
||||||
---
|
---
|
||||||
|
|
||||||
# Agent Check Agent
|
# Agent Check Agent
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: full-validation
|
||||||
|
description: Contract validation specialist for comprehensive cross-plugin compatibility validation of the entire marketplace.
|
||||||
|
model: sonnet
|
||||||
|
---
|
||||||
|
|
||||||
# Full Validation Agent
|
# Full Validation Agent
|
||||||
|
|
||||||
You are a contract validation specialist. Your role is to perform comprehensive cross-plugin compatibility validation for the entire marketplace.
|
You are a contract validation specialist. Your role is to perform comprehensive cross-plugin compatibility validation for the entire marketplace.
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
---
|
---
|
||||||
agent: data-advisor
|
name: data-advisor
|
||||||
description: Reviews code for data integrity, schema validity, and dbt compliance using data-platform MCP tools
|
description: Reviews code for data integrity, schema validity, and dbt compliance using data-platform MCP tools. Use when validating database operations or data pipelines.
|
||||||
triggers:
|
model: sonnet
|
||||||
- /data-review command
|
|
||||||
- /data-gate command
|
|
||||||
- projman orchestrator domain gate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Data Advisor Agent
|
# Data Advisor Agent
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: data-analysis
|
name: data-analysis
|
||||||
description: Data analysis specialist for exploration and profiling
|
description: Data analysis specialist for exploration and profiling
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Data Analysis Agent
|
# Data Analysis Agent
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: data-ingestion
|
||||||
|
description: Data ingestion specialist for loading, transforming, and preparing data for analysis.
|
||||||
|
model: haiku
|
||||||
|
---
|
||||||
|
|
||||||
# Data Ingestion Agent
|
# Data Ingestion Agent
|
||||||
|
|
||||||
You are a data ingestion specialist. Your role is to help users load, transform, and prepare data for analysis.
|
You are a data ingestion specialist. Your role is to help users load, transform, and prepare data for analysis.
|
||||||
|
|||||||
@@ -5,11 +5,26 @@
|
|||||||
|
|
||||||
PREFIX="[data-platform]"
|
PREFIX="[data-platform]"
|
||||||
|
|
||||||
# Check if MCP venv exists
|
# Check if MCP venv exists - check cache first, then local
|
||||||
|
CACHE_VENV="$HOME/.cache/claude-mcp-venvs/leo-claude-mktplace/data-platform/.venv/bin/python"
|
||||||
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "$(realpath "$0")")")}"
|
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "$(realpath "$0")")")}"
|
||||||
VENV_PATH="$PLUGIN_ROOT/mcp-servers/data-platform/.venv/bin/python"
|
MARKETPLACE_ROOT="$(dirname "$(dirname "$PLUGIN_ROOT")")"
|
||||||
|
LOCAL_VENV="$MARKETPLACE_ROOT/mcp-servers/data-platform/.venv/bin/python"
|
||||||
|
|
||||||
if [[ ! -f "$VENV_PATH" ]]; then
|
# Check cache first (preferred), then local symlink
|
||||||
|
CACHE_VENV_DIR="$HOME/.cache/claude-mcp-venvs/leo-claude-mktplace/data-platform/.venv"
|
||||||
|
LOCAL_VENV_DIR="$MARKETPLACE_ROOT/mcp-servers/data-platform/.venv"
|
||||||
|
|
||||||
|
if [[ -f "$CACHE_VENV" ]]; then
|
||||||
|
VENV_PATH="$CACHE_VENV"
|
||||||
|
# Auto-create symlink in installed marketplace if missing
|
||||||
|
if [[ ! -e "$LOCAL_VENV_DIR" && -d "$CACHE_VENV_DIR" ]]; then
|
||||||
|
mkdir -p "$(dirname "$LOCAL_VENV_DIR")" 2>/dev/null
|
||||||
|
ln -sf "$CACHE_VENV_DIR" "$LOCAL_VENV_DIR" 2>/dev/null
|
||||||
|
fi
|
||||||
|
elif [[ -f "$LOCAL_VENV" ]]; then
|
||||||
|
VENV_PATH="$LOCAL_VENV"
|
||||||
|
else
|
||||||
echo "$PREFIX MCP venv missing - run /initial-setup or setup.sh"
|
echo "$PREFIX MCP venv missing - run /initial-setup or setup.sh"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "doc-guardian",
|
"name": "doc-guardian",
|
||||||
"description": "Automatic documentation drift detection and synchronization",
|
"description": "Automatic documentation drift detection and synchronization",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
"email": "leobmiranda@gmail.com"
|
"email": "leobmiranda@gmail.com"
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
description: Specialized agent for documentation analysis and drift detection
|
name: doc-analyzer
|
||||||
|
description: Specialized agent for documentation analysis and drift detection. Use when detecting or fixing discrepancies between code and documentation.
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Documentation Analyzer Agent
|
# Documentation Analyzer Agent
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "git-flow",
|
"name": "git-flow",
|
||||||
"version": "1.0.0",
|
"version": "1.2.0",
|
||||||
"description": "Git workflow automation with intelligent commit messages and branch management",
|
"description": "Git workflow automation with intelligent commit messages and branch management",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: git-assistant
|
||||||
|
description: Git workflow assistant for complex git operations, conflict resolution, and repository history management.
|
||||||
|
model: haiku
|
||||||
|
---
|
||||||
|
|
||||||
# Git Assistant Agent
|
# Git Assistant Agent
|
||||||
|
|
||||||
## Visual Output Requirements
|
## Visual Output Requirements
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: coordinator
|
||||||
|
description: Review coordinator that orchestrates the multi-agent PR review process. Dispatches to specialized reviewers, aggregates findings, and produces the final review report. Use proactively after code changes.
|
||||||
|
model: sonnet
|
||||||
|
---
|
||||||
|
|
||||||
# Coordinator Agent
|
# Coordinator Agent
|
||||||
|
|
||||||
## Visual Output Requirements
|
## Visual Output Requirements
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: maintainability-auditor
|
||||||
|
description: Identifies code complexity, duplication, naming issues, and architecture concerns in PR changes.
|
||||||
|
model: haiku
|
||||||
|
---
|
||||||
|
|
||||||
# Maintainability Auditor Agent
|
# Maintainability Auditor Agent
|
||||||
|
|
||||||
## Visual Output Requirements
|
## Visual Output Requirements
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: performance-analyst
|
||||||
|
description: Performance-focused code reviewer that identifies performance issues, inefficiencies, and optimization opportunities.
|
||||||
|
model: sonnet
|
||||||
|
---
|
||||||
|
|
||||||
# Performance Analyst Agent
|
# Performance Analyst Agent
|
||||||
|
|
||||||
## Visual Output Requirements
|
## Visual Output Requirements
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: security-reviewer
|
name: security-reviewer
|
||||||
description: Security-focused code reviewer for PR analysis
|
description: Security-focused code reviewer for PR analysis
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Security Reviewer Agent
|
# Security Reviewer Agent
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: test-validator
|
||||||
|
description: Test quality reviewer that validates test coverage, test quality, and testing practices in PR changes.
|
||||||
|
model: haiku
|
||||||
|
---
|
||||||
|
|
||||||
# Test Validator Agent
|
# Test Validator Agent
|
||||||
|
|
||||||
## Visual Output Requirements
|
## Visual Output Requirements
|
||||||
|
|||||||
@@ -5,11 +5,18 @@
|
|||||||
|
|
||||||
PREFIX="[pr-review]"
|
PREFIX="[pr-review]"
|
||||||
|
|
||||||
# Check if MCP venv exists
|
# Check if MCP venv exists - check cache first, then local
|
||||||
|
CACHE_VENV="$HOME/.cache/claude-mcp-venvs/leo-claude-mktplace/gitea/.venv/bin/python"
|
||||||
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "$(realpath "$0")")")}"
|
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "$(realpath "$0")")")}"
|
||||||
VENV_PATH="$PLUGIN_ROOT/mcp-servers/gitea/.venv/bin/python"
|
MARKETPLACE_ROOT="$(dirname "$(dirname "$PLUGIN_ROOT")")"
|
||||||
|
LOCAL_VENV="$MARKETPLACE_ROOT/mcp-servers/gitea/.venv/bin/python"
|
||||||
|
|
||||||
if [[ ! -f "$VENV_PATH" ]]; then
|
# Check cache first (preferred), then local
|
||||||
|
if [[ -f "$CACHE_VENV" ]]; then
|
||||||
|
VENV_PATH="$CACHE_VENV"
|
||||||
|
elif [[ -f "$LOCAL_VENV" ]]; then
|
||||||
|
VENV_PATH="$LOCAL_VENV"
|
||||||
|
else
|
||||||
echo "$PREFIX MCP venvs missing - run setup.sh from installed marketplace"
|
echo "$PREFIX MCP venvs missing - run setup.sh from installed marketplace"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "projman",
|
"name": "projman",
|
||||||
"version": "3.3.0",
|
"version": "3.4.0",
|
||||||
"description": "Sprint planning and project management with Gitea integration",
|
"description": "Sprint planning and project management with Gitea integration",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Leo Miranda",
|
"name": "Leo Miranda",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: code-reviewer
|
name: code-reviewer
|
||||||
description: Pre-sprint code quality review agent
|
description: Pre-sprint code quality review agent
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Code Reviewer Agent
|
# Code Reviewer Agent
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: executor
|
name: executor
|
||||||
description: Implementation executor agent - precise implementation guidance and code quality
|
description: Implementation executor agent - precise implementation guidance and code quality
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Implementation Executor Agent
|
# Implementation Executor Agent
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: orchestrator
|
name: orchestrator
|
||||||
description: Sprint orchestration agent - coordinates execution and tracks progress
|
description: Sprint orchestration agent - coordinates execution and tracks progress
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Sprint Orchestration Agent
|
# Sprint Orchestration Agent
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: planner
|
name: planner
|
||||||
description: Sprint planning agent - thoughtful architecture analysis and issue creation
|
description: Sprint planning agent - thoughtful architecture analysis and issue creation
|
||||||
|
model: sonnet
|
||||||
---
|
---
|
||||||
|
|
||||||
# Sprint Planning Agent
|
# Sprint Planning Agent
|
||||||
|
|||||||
@@ -44,10 +44,7 @@ See `skills/review-checklist.md` for complete patterns:
|
|||||||
|
|
||||||
## Visual Output
|
## Visual Output
|
||||||
|
|
||||||
```
|
See `skills/visual-output.md`. This command invokes the **Code Reviewer** agent:
|
||||||
╔══════════════════════════════════════════════════════════════════╗
|
- Phase Emoji: 🔍
|
||||||
║ 📋 PROJMAN ║
|
- Phase Name: REVIEW
|
||||||
║ 🏁 CLOSING ║
|
- Context: Sprint Name
|
||||||
║ Code Review ║
|
|
||||||
╚══════════════════════════════════════════════════════════════════╝
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -29,17 +29,19 @@ if [[ -f ".env" ]]; then
|
|||||||
|
|
||||||
if [[ -n "$GITEA_API_URL" && -n "$GITEA_API_TOKEN" && -n "$GITEA_REPO" ]]; then
|
if [[ -n "$GITEA_API_URL" && -n "$GITEA_API_TOKEN" && -n "$GITEA_REPO" ]]; then
|
||||||
# Quick check for open issues without milestone (unplanned work)
|
# Quick check for open issues without milestone (unplanned work)
|
||||||
|
# Note: grep -c returns 0 on no match but exits non-zero, causing || to also fire
|
||||||
|
# Use subshell to ensure single value
|
||||||
OPEN_ISSUES=$(curl -s -m 5 \
|
OPEN_ISSUES=$(curl -s -m 5 \
|
||||||
-H "Authorization: token $GITEA_API_TOKEN" \
|
-H "Authorization: token $GITEA_API_TOKEN" \
|
||||||
"${GITEA_API_URL}/repos/${GITEA_REPO}/issues?state=open&milestone=none&limit=1" 2>/dev/null | \
|
"${GITEA_API_URL}/repos/${GITEA_REPO}/issues?state=open&milestone=none&limit=1" 2>/dev/null | \
|
||||||
grep -c '"number"' || echo "0")
|
grep -c '"number"' 2>/dev/null) || OPEN_ISSUES=0
|
||||||
|
|
||||||
if [[ "$OPEN_ISSUES" -gt 0 ]]; then
|
if [[ "$OPEN_ISSUES" -gt 0 ]]; then
|
||||||
# Count total unplanned issues
|
# Count total unplanned issues
|
||||||
TOTAL_UNPLANNED=$(curl -s -m 5 \
|
TOTAL_UNPLANNED=$(curl -s -m 5 \
|
||||||
-H "Authorization: token $GITEA_API_TOKEN" \
|
-H "Authorization: token $GITEA_API_TOKEN" \
|
||||||
"${GITEA_API_URL}/repos/${GITEA_REPO}/issues?state=open&milestone=none" 2>/dev/null | \
|
"${GITEA_API_URL}/repos/${GITEA_REPO}/issues?state=open&milestone=none" 2>/dev/null | \
|
||||||
grep -c '"number"' || echo "?")
|
grep -c '"number"' 2>/dev/null) || TOTAL_UNPLANNED="?"
|
||||||
echo "$PREFIX ${TOTAL_UNPLANNED} open issues without milestone - consider /sprint-plan"
|
echo "$PREFIX ${TOTAL_UNPLANNED} open issues without milestone - consider /sprint-plan"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ Projman uses the double-line box drawing header style with emoji phase indicator
|
|||||||
|
|
||||||
| Agent | Phase Emoji | Phase Name | Context |
|
| Agent | Phase Emoji | Phase Name | Context |
|
||||||
|-------|-------------|------------|---------|
|
|-------|-------------|------------|---------|
|
||||||
| Planner | Target | PLANNING | Sprint Name or Goal |
|
| Planner | 🎯 Target | PLANNING | Sprint Name or Goal |
|
||||||
| Orchestrator | Lightning | EXECUTION | Sprint Name |
|
| Orchestrator | ⚡ Lightning | EXECUTION | Sprint Name |
|
||||||
| Executor | Wrench | IMPLEMENTING | Issue Title |
|
| Executor | 🔧 Wrench | IMPLEMENTING | Issue Title |
|
||||||
| Code Reviewer | Magnifier | REVIEW | Sprint Name |
|
| Code Reviewer | 🔍 Magnifier | REVIEW | Sprint Name |
|
||||||
|
|
||||||
### Command Headers (Non-Agent)
|
### Command Headers (Non-Agent)
|
||||||
|
|
||||||
@@ -40,14 +40,14 @@ For commands that don't invoke a specific agent phase:
|
|||||||
|
|
||||||
| Command | Phase Emoji | Phase Name |
|
| Command | Phase Emoji | Phase Name |
|
||||||
|---------|-------------|------------|
|
|---------|-------------|------------|
|
||||||
| `/sprint-status` | Chart | STATUS |
|
| `/sprint-status` | 📊 Chart | STATUS |
|
||||||
| `/setup` | Gear | SETUP |
|
| `/setup` | ⚙️ Gear | SETUP |
|
||||||
| `/debug` | Bug | DEBUG |
|
| `/debug` | 🐛 Bug | DEBUG |
|
||||||
| `/labels-sync` | Label | LABELS |
|
| `/labels-sync` | 🏷️ Label | LABELS |
|
||||||
| `/suggest-version` | Package | VERSION |
|
| `/suggest-version` | 📦 Package | VERSION |
|
||||||
| `/proposal-status` | Clipboard | PROPOSALS |
|
| `/proposal-status` | 📋 Clipboard | PROPOSALS |
|
||||||
| `/test` | Flask | TEST |
|
| `/test` | 🧪 Flask | TEST |
|
||||||
| `/rfc` | Document | RFC [Sub-Command] |
|
| `/rfc` | 📄 Document | RFC [Sub-Command] |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: component-check
|
name: component-check
|
||||||
description: DMC component validation specialist
|
description: DMC component validation specialist
|
||||||
|
model: haiku
|
||||||
---
|
---
|
||||||
|
|
||||||
# Component Check Agent
|
# Component Check Agent
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
---
|
---
|
||||||
agent: design-reviewer
|
name: design-reviewer
|
||||||
description: Reviews code for design system compliance using viz-platform MCP tools
|
description: Reviews code for design system compliance using viz-platform MCP tools. Use when validating DMC components, theme tokens, or accessibility standards.
|
||||||
triggers:
|
model: sonnet
|
||||||
- /design-review command
|
|
||||||
- /design-gate command
|
|
||||||
- projman orchestrator domain gate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Design Reviewer Agent
|
# Design Reviewer Agent
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: layout-builder
|
||||||
|
description: Practical dashboard layout specialist for creating well-structured layouts with filtering, grid systems, and responsive design.
|
||||||
|
model: sonnet
|
||||||
|
---
|
||||||
|
|
||||||
# Layout Builder Agent
|
# Layout Builder Agent
|
||||||
|
|
||||||
You are a practical dashboard layout specialist. Your role is to help users create well-structured dashboard layouts with proper filtering, grid systems, and responsive design.
|
You are a practical dashboard layout specialist. Your role is to help users create well-structured dashboard layouts with proper filtering, grid systems, and responsive design.
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: theme-setup
|
||||||
|
description: Design-focused theme setup specialist for creating consistent, brand-aligned themes for Dash Mantine Components applications.
|
||||||
|
model: haiku
|
||||||
|
---
|
||||||
|
|
||||||
# Theme Setup Agent
|
# Theme Setup Agent
|
||||||
|
|
||||||
You are a design-focused theme setup specialist. Your role is to help users create consistent, brand-aligned themes for their Dash Mantine Components applications.
|
You are a design-focused theme setup specialist. Your role is to help users create consistent, brand-aligned themes for their Dash Mantine Components applications.
|
||||||
|
|||||||
384
scripts/install-plugin.sh
Executable file
384
scripts/install-plugin.sh
Executable file
@@ -0,0 +1,384 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# =============================================================================
|
||||||
|
# install-plugin.sh - Install marketplace plugin to a consumer project
|
||||||
|
# =============================================================================
|
||||||
|
#
|
||||||
|
# Usage: ./scripts/install-plugin.sh <plugin-name> <target-project-path>
|
||||||
|
#
|
||||||
|
# This script:
|
||||||
|
# 1. Validates plugin exists in the marketplace
|
||||||
|
# 2. Updates target project's .mcp.json with MCP server entries (if applicable)
|
||||||
|
# 3. Appends CLAUDE.md integration snippet to target project
|
||||||
|
# 4. Is idempotent (safe to run multiple times)
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
# ./scripts/install-plugin.sh data-platform ~/projects/personal-portfolio
|
||||||
|
# ./scripts/install-plugin.sh projman /home/user/my-project
|
||||||
|
#
|
||||||
|
# =============================================================================
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||||
|
|
||||||
|
# --- Color Definitions ---
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
BLUE='\033[0;34m'
|
||||||
|
CYAN='\033[0;36m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# --- Logging Functions ---
|
||||||
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
||||||
|
log_success() { echo -e "${GREEN}[OK]${NC} $1"; }
|
||||||
|
log_skip() { echo -e "${YELLOW}[SKIP]${NC} $1"; }
|
||||||
|
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
||||||
|
log_warning() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
||||||
|
|
||||||
|
# --- Track Changes ---
|
||||||
|
CHANGES_MADE=()
|
||||||
|
SKIPPED=()
|
||||||
|
MCP_SERVERS_INSTALLED=()
|
||||||
|
|
||||||
|
# --- Usage ---
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 <plugin-name> <target-project-path>"
|
||||||
|
echo ""
|
||||||
|
echo "Install a marketplace plugin to a consumer project."
|
||||||
|
echo ""
|
||||||
|
echo "Arguments:"
|
||||||
|
echo " plugin-name Name of the plugin (e.g., data-platform, viz-platform, projman)"
|
||||||
|
echo " target-project-path Path to the target project (absolute or relative)"
|
||||||
|
echo ""
|
||||||
|
echo "Available plugins:"
|
||||||
|
for dir in "$REPO_ROOT"/plugins/*/; do
|
||||||
|
if [[ -d "$dir" ]]; then
|
||||||
|
basename "$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " $0 data-platform ~/projects/personal-portfolio"
|
||||||
|
echo " $0 projman /home/user/my-project"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Prerequisite Check ---
|
||||||
|
check_prerequisites() {
|
||||||
|
if ! command -v jq &> /dev/null; then
|
||||||
|
log_error "jq is required but not installed."
|
||||||
|
echo "Install with: sudo apt install jq"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Validate Plugin Exists ---
|
||||||
|
validate_plugin() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local plugin_dir="$REPO_ROOT/plugins/$plugin_name"
|
||||||
|
|
||||||
|
if [[ ! -d "$plugin_dir" ]]; then
|
||||||
|
log_error "Plugin '$plugin_name' not found in $REPO_ROOT/plugins/"
|
||||||
|
echo ""
|
||||||
|
echo "Available plugins:"
|
||||||
|
for dir in "$REPO_ROOT"/plugins/*/; do
|
||||||
|
if [[ -d "$dir" ]]; then
|
||||||
|
echo " - $(basename "$dir")"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "$plugin_dir/.claude-plugin/plugin.json" ]]; then
|
||||||
|
log_error "Plugin '$plugin_name' missing .claude-plugin/plugin.json"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_success "Plugin '$plugin_name' found"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Validate Target Project ---
|
||||||
|
validate_target() {
|
||||||
|
local target_path="$1"
|
||||||
|
|
||||||
|
if [[ ! -d "$target_path" ]]; then
|
||||||
|
log_error "Target project path does not exist: $target_path"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_success "Target project found: $target_path"
|
||||||
|
|
||||||
|
# Warn if no CLAUDE.md
|
||||||
|
if [[ ! -f "$target_path/CLAUDE.md" ]]; then
|
||||||
|
log_warning "Target project has no CLAUDE.md - will create one"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Get MCP Servers for Plugin ---
|
||||||
|
# Reads the mcp_servers array from plugin.json
|
||||||
|
# Returns newline-separated list of MCP server names, or empty if none
|
||||||
|
get_mcp_servers() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local plugin_json="$REPO_ROOT/plugins/$plugin_name/.claude-plugin/plugin.json"
|
||||||
|
|
||||||
|
if [[ ! -f "$plugin_json" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read mcp_servers array from plugin.json
|
||||||
|
# Returns empty if field doesn't exist or is empty
|
||||||
|
jq -r '.mcp_servers // [] | .[]' "$plugin_json" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Check if plugin has any MCP servers ---
|
||||||
|
has_mcp_servers() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local servers
|
||||||
|
servers=$(get_mcp_servers "$plugin_name")
|
||||||
|
[[ -n "$servers" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Update .mcp.json ---
|
||||||
|
update_mcp_json() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local target_path="$2"
|
||||||
|
local mcp_json="$target_path/.mcp.json"
|
||||||
|
|
||||||
|
# Get MCP servers for this plugin
|
||||||
|
local mcp_servers
|
||||||
|
mcp_servers=$(get_mcp_servers "$plugin_name")
|
||||||
|
|
||||||
|
if [[ -z "$mcp_servers" ]]; then
|
||||||
|
log_skip "Plugin '$plugin_name' has no MCP servers - skipping .mcp.json update"
|
||||||
|
SKIPPED+=(".mcp.json: No MCP servers for $plugin_name")
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create .mcp.json if it doesn't exist
|
||||||
|
if [[ ! -f "$mcp_json" ]]; then
|
||||||
|
log_info "Creating new .mcp.json"
|
||||||
|
echo '{"mcpServers":{}}' > "$mcp_json"
|
||||||
|
CHANGES_MADE+=("Created .mcp.json")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add each MCP server
|
||||||
|
local servers_added=0
|
||||||
|
while IFS= read -r server_name; do
|
||||||
|
[[ -z "$server_name" ]] && continue
|
||||||
|
|
||||||
|
local mcp_server_path="$REPO_ROOT/mcp-servers/$server_name/run.sh"
|
||||||
|
|
||||||
|
# Verify server exists
|
||||||
|
if [[ ! -f "$mcp_server_path" ]]; then
|
||||||
|
log_warning "MCP server '$server_name' not found at $mcp_server_path"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if entry already exists
|
||||||
|
if jq -e ".mcpServers[\"$server_name\"]" "$mcp_json" > /dev/null 2>&1; then
|
||||||
|
log_skip "MCP server '$server_name' already in .mcp.json"
|
||||||
|
SKIPPED+=(".mcp.json: $server_name already present")
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add MCP server entry
|
||||||
|
log_info "Adding MCP server '$server_name' to .mcp.json"
|
||||||
|
local tmp_file=$(mktemp)
|
||||||
|
jq ".mcpServers[\"$server_name\"] = {\"command\": \"$mcp_server_path\", \"args\": []}" "$mcp_json" > "$tmp_file"
|
||||||
|
mv "$tmp_file" "$mcp_json"
|
||||||
|
|
||||||
|
CHANGES_MADE+=("Added $server_name to .mcp.json")
|
||||||
|
MCP_SERVERS_INSTALLED+=("$server_name")
|
||||||
|
log_success "Added MCP server entry for '$server_name'"
|
||||||
|
((++servers_added))
|
||||||
|
done <<< "$mcp_servers"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Update CLAUDE.md ---
|
||||||
|
update_claude_md() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local target_path="$2"
|
||||||
|
local target_claude_md="$target_path/CLAUDE.md"
|
||||||
|
local integration_file="$REPO_ROOT/plugins/$plugin_name/claude-md-integration.md"
|
||||||
|
|
||||||
|
# Check if integration file exists
|
||||||
|
if [[ ! -f "$integration_file" ]]; then
|
||||||
|
log_skip "No claude-md-integration.md for plugin '$plugin_name'"
|
||||||
|
SKIPPED+=("CLAUDE.md: No integration snippet for $plugin_name")
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create CLAUDE.md if it doesn't exist
|
||||||
|
if [[ ! -f "$target_claude_md" ]]; then
|
||||||
|
log_info "Creating new CLAUDE.md"
|
||||||
|
cat > "$target_claude_md" << 'EOF'
|
||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code when working with code in this repository.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
CHANGES_MADE+=("Created CLAUDE.md")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if already integrated using HTML comment marker (preferred)
|
||||||
|
local begin_marker="<!-- BEGIN marketplace-plugin: $plugin_name -->"
|
||||||
|
if grep -qF "$begin_marker" "$target_claude_md" 2>/dev/null; then
|
||||||
|
log_skip "Plugin '$plugin_name' integration already in CLAUDE.md"
|
||||||
|
SKIPPED+=("CLAUDE.md: $plugin_name already present")
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fallback: check for legacy header format (backward compatibility)
|
||||||
|
if grep -qE "^# ${plugin_name}( Plugin)? -? ?CLAUDE\.md Integration" "$target_claude_md" 2>/dev/null; then
|
||||||
|
log_skip "Plugin '$plugin_name' integration already in CLAUDE.md (legacy format)"
|
||||||
|
SKIPPED+=("CLAUDE.md: $plugin_name already present")
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read integration content
|
||||||
|
local integration_content
|
||||||
|
integration_content=$(cat "$integration_file")
|
||||||
|
|
||||||
|
# Check for or create Marketplace Plugin Integration section
|
||||||
|
local section_header="## Marketplace Plugin Integration"
|
||||||
|
|
||||||
|
if ! grep -qF "$section_header" "$target_claude_md"; then
|
||||||
|
log_info "Creating '$section_header' section"
|
||||||
|
echo "" >> "$target_claude_md"
|
||||||
|
echo "$section_header" >> "$target_claude_md"
|
||||||
|
echo "" >> "$target_claude_md"
|
||||||
|
echo "The following plugins are installed from the leo-claude-mktplace:" >> "$target_claude_md"
|
||||||
|
echo "" >> "$target_claude_md"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Append integration content with HTML comment markers
|
||||||
|
log_info "Adding '$plugin_name' integration to CLAUDE.md"
|
||||||
|
local end_marker="<!-- END marketplace-plugin: $plugin_name -->"
|
||||||
|
|
||||||
|
echo "" >> "$target_claude_md"
|
||||||
|
echo "---" >> "$target_claude_md"
|
||||||
|
echo "" >> "$target_claude_md"
|
||||||
|
echo "$begin_marker" >> "$target_claude_md"
|
||||||
|
echo "" >> "$target_claude_md"
|
||||||
|
echo "$integration_content" >> "$target_claude_md"
|
||||||
|
echo "" >> "$target_claude_md"
|
||||||
|
echo "$end_marker" >> "$target_claude_md"
|
||||||
|
|
||||||
|
CHANGES_MADE+=("Added $plugin_name integration to CLAUDE.md")
|
||||||
|
log_success "Added CLAUDE.md integration for '$plugin_name'"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Get Commands for Plugin ---
|
||||||
|
get_plugin_commands() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local commands_dir="$REPO_ROOT/plugins/$plugin_name/commands"
|
||||||
|
|
||||||
|
if [[ ! -d "$commands_dir" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
for cmd_file in "$commands_dir"/*.md; do
|
||||||
|
if [[ -f "$cmd_file" ]]; then
|
||||||
|
local cmd_name
|
||||||
|
cmd_name=$(basename "$cmd_file" .md)
|
||||||
|
echo " /$cmd_name"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Print Summary ---
|
||||||
|
print_summary() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local target_path="$2"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=============================================="
|
||||||
|
echo -e "${GREEN}Installation Summary${NC}"
|
||||||
|
echo "=============================================="
|
||||||
|
echo ""
|
||||||
|
echo -e "${CYAN}Plugin:${NC} $plugin_name"
|
||||||
|
echo -e "${CYAN}Target:${NC} $target_path"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [[ ${#CHANGES_MADE[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${GREEN}Changes Made:${NC}"
|
||||||
|
for change in "${CHANGES_MADE[@]}"; do
|
||||||
|
echo " ✓ $change"
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${#SKIPPED[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${YELLOW}Skipped (already present or N/A):${NC}"
|
||||||
|
for skip in "${SKIPPED[@]}"; do
|
||||||
|
echo " - $skip"
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Show available commands
|
||||||
|
echo -e "${CYAN}Commands Now Available:${NC}"
|
||||||
|
local commands
|
||||||
|
commands=$(get_plugin_commands "$plugin_name")
|
||||||
|
if [[ -n "$commands" ]]; then
|
||||||
|
echo "$commands"
|
||||||
|
else
|
||||||
|
echo " (No commands - this plugin may be hooks-only)"
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# MCP servers info
|
||||||
|
if [[ ${#MCP_SERVERS_INSTALLED[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${CYAN}MCP Servers Installed:${NC}"
|
||||||
|
for server in "${MCP_SERVERS_INSTALLED[@]}"; do
|
||||||
|
echo " - $server"
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
elif has_mcp_servers "$plugin_name"; then
|
||||||
|
echo -e "${CYAN}MCP Tools:${NC}"
|
||||||
|
echo " This plugin includes MCP server tools. Use ToolSearch to discover them."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Important reminder
|
||||||
|
echo -e "${YELLOW}⚠️ IMPORTANT:${NC}"
|
||||||
|
echo " Restart your Claude Code session for changes to take effect."
|
||||||
|
echo " The .mcp.json changes require a session restart to load MCP servers."
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Main Execution
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
# Check arguments
|
||||||
|
if [[ $# -lt 2 ]]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
PLUGIN_NAME="$1"
|
||||||
|
TARGET_PATH="$2"
|
||||||
|
|
||||||
|
# Resolve target path to absolute
|
||||||
|
TARGET_PATH=$(cd "$TARGET_PATH" 2>/dev/null && pwd || echo "$TARGET_PATH")
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=============================================="
|
||||||
|
echo -e "${BLUE}Installing Plugin: $PLUGIN_NAME${NC}"
|
||||||
|
echo "=============================================="
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Run checks
|
||||||
|
check_prerequisites
|
||||||
|
validate_plugin "$PLUGIN_NAME"
|
||||||
|
validate_target "$TARGET_PATH"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Perform installation
|
||||||
|
update_mcp_json "$PLUGIN_NAME" "$TARGET_PATH"
|
||||||
|
update_claude_md "$PLUGIN_NAME" "$TARGET_PATH"
|
||||||
|
|
||||||
|
# Print summary
|
||||||
|
print_summary "$PLUGIN_NAME" "$TARGET_PATH"
|
||||||
322
scripts/list-installed.sh
Executable file
322
scripts/list-installed.sh
Executable file
@@ -0,0 +1,322 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# =============================================================================
|
||||||
|
# list-installed.sh - Show installed marketplace plugins in a project
|
||||||
|
# =============================================================================
|
||||||
|
#
|
||||||
|
# Usage: ./scripts/list-installed.sh <target-project-path>
|
||||||
|
#
|
||||||
|
# This script:
|
||||||
|
# 1. Checks .mcp.json for MCP server entries from this marketplace
|
||||||
|
# 2. Checks CLAUDE.md for plugin integration sections
|
||||||
|
# 3. Reports which plugins are installed
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
# ./scripts/list-installed.sh ~/projects/personal-portfolio
|
||||||
|
# ./scripts/list-installed.sh .
|
||||||
|
#
|
||||||
|
# =============================================================================
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||||
|
|
||||||
|
# --- Color Definitions ---
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
BLUE='\033[0;34m'
|
||||||
|
CYAN='\033[0;36m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# --- Logging Functions ---
|
||||||
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
||||||
|
log_success() { echo -e "${GREEN}[OK]${NC} $1"; }
|
||||||
|
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
||||||
|
log_warning() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
||||||
|
|
||||||
|
# --- Usage ---
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 <target-project-path>"
|
||||||
|
echo ""
|
||||||
|
echo "Show which marketplace plugins are installed in a project."
|
||||||
|
echo ""
|
||||||
|
echo "Arguments:"
|
||||||
|
echo " target-project-path Path to the target project (absolute or relative)"
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " $0 ~/projects/personal-portfolio"
|
||||||
|
echo " $0 ."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Prerequisite Check ---
|
||||||
|
check_prerequisites() {
|
||||||
|
if ! command -v jq &> /dev/null; then
|
||||||
|
log_error "jq is required but not installed."
|
||||||
|
echo "Install with: sudo apt install jq"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Get Available Plugins ---
|
||||||
|
get_available_plugins() {
|
||||||
|
for dir in "$REPO_ROOT"/plugins/*/; do
|
||||||
|
if [[ -d "$dir" ]]; then
|
||||||
|
basename "$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Get MCP Servers for Plugin ---
|
||||||
|
# Reads the mcp_servers array from plugin.json
|
||||||
|
get_mcp_servers() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local plugin_json="$REPO_ROOT/plugins/$plugin_name/.claude-plugin/plugin.json"
|
||||||
|
|
||||||
|
if [[ ! -f "$plugin_json" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
jq -r '.mcp_servers // [] | .[]' "$plugin_json" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Check if plugin has any MCP servers defined ---
|
||||||
|
has_mcp_servers() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local servers
|
||||||
|
servers=$(get_mcp_servers "$plugin_name")
|
||||||
|
[[ -n "$servers" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Check MCP Installation ---
|
||||||
|
check_mcp_installed() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local target_path="$2"
|
||||||
|
local mcp_json="$target_path/.mcp.json"
|
||||||
|
|
||||||
|
if [[ ! -f "$mcp_json" ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get MCP servers for this plugin from plugin.json
|
||||||
|
local mcp_servers
|
||||||
|
mcp_servers=$(get_mcp_servers "$plugin_name")
|
||||||
|
|
||||||
|
if [[ -z "$mcp_servers" ]]; then
|
||||||
|
# Plugin has no MCP servers defined, so MCP check passes
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if ALL required MCP servers are present
|
||||||
|
while IFS= read -r server_name; do
|
||||||
|
[[ -z "$server_name" ]] && continue
|
||||||
|
|
||||||
|
if ! jq -e ".mcpServers[\"$server_name\"]" "$mcp_json" > /dev/null 2>&1; then
|
||||||
|
# Also check if any entry points to this marketplace's mcp-servers
|
||||||
|
if ! grep -q "mcp-servers/$server_name" "$mcp_json" 2>/dev/null; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done <<< "$mcp_servers"
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Check CLAUDE.md Integration ---
|
||||||
|
check_claude_md_installed() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local target_path="$2"
|
||||||
|
local target_claude_md="$target_path/CLAUDE.md"
|
||||||
|
|
||||||
|
if [[ ! -f "$target_claude_md" ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for HTML comment marker (preferred, new format)
|
||||||
|
local begin_marker="<!-- BEGIN marketplace-plugin: $plugin_name -->"
|
||||||
|
if grep -qF "$begin_marker" "$target_claude_md" 2>/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fallback: check for legacy header format
|
||||||
|
if grep -qE "^# ${plugin_name}( Plugin)? -? ?CLAUDE\.md Integration" "$target_claude_md" 2>/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Get Plugin Version ---
|
||||||
|
get_plugin_version() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local plugin_json="$REPO_ROOT/plugins/$plugin_name/.claude-plugin/plugin.json"
|
||||||
|
|
||||||
|
if [[ -f "$plugin_json" ]]; then
|
||||||
|
jq -r '.version // "unknown"' "$plugin_json"
|
||||||
|
else
|
||||||
|
echo "unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Get Plugin Description ---
|
||||||
|
get_plugin_description() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local plugin_json="$REPO_ROOT/plugins/$plugin_name/.claude-plugin/plugin.json"
|
||||||
|
|
||||||
|
if [[ -f "$plugin_json" ]]; then
|
||||||
|
jq -r '.description // "No description"' "$plugin_json" | cut -c1-60
|
||||||
|
else
|
||||||
|
echo "No description"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Main Execution
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
# Check arguments
|
||||||
|
if [[ $# -lt 1 ]]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGET_PATH="$1"
|
||||||
|
|
||||||
|
# Resolve target path to absolute
|
||||||
|
if [[ -d "$TARGET_PATH" ]]; then
|
||||||
|
TARGET_PATH=$(cd "$TARGET_PATH" && pwd)
|
||||||
|
else
|
||||||
|
log_error "Target project path does not exist: $TARGET_PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_prerequisites
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=============================================="
|
||||||
|
echo -e "${BLUE}Installed Plugins: $(basename "$TARGET_PATH")${NC}"
|
||||||
|
echo "=============================================="
|
||||||
|
echo -e "${CYAN}Target:${NC} $TARGET_PATH"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Collect results
|
||||||
|
declare -A INSTALLED_MCP
|
||||||
|
declare -A INSTALLED_CLAUDE_MD
|
||||||
|
INSTALLED_PLUGINS=()
|
||||||
|
PARTIAL_PLUGINS=()
|
||||||
|
NOT_INSTALLED=()
|
||||||
|
|
||||||
|
# Check each available plugin
|
||||||
|
for plugin in $(get_available_plugins); do
|
||||||
|
mcp_installed=false
|
||||||
|
claude_installed=false
|
||||||
|
needs_mcp=false
|
||||||
|
|
||||||
|
# Check if plugin has MCP servers defined
|
||||||
|
if has_mcp_servers "$plugin"; then
|
||||||
|
needs_mcp=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check MCP installation
|
||||||
|
if check_mcp_installed "$plugin" "$TARGET_PATH"; then
|
||||||
|
mcp_installed=true
|
||||||
|
INSTALLED_MCP[$plugin]=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check CLAUDE.md integration
|
||||||
|
if check_claude_md_installed "$plugin" "$TARGET_PATH"; then
|
||||||
|
claude_installed=true
|
||||||
|
INSTALLED_CLAUDE_MD[$plugin]=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Categorize
|
||||||
|
if $claude_installed; then
|
||||||
|
if $needs_mcp; then
|
||||||
|
if $mcp_installed; then
|
||||||
|
INSTALLED_PLUGINS+=("$plugin")
|
||||||
|
else
|
||||||
|
PARTIAL_PLUGINS+=("$plugin")
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Plugins without MCP servers just need CLAUDE.md
|
||||||
|
INSTALLED_PLUGINS+=("$plugin")
|
||||||
|
fi
|
||||||
|
elif $mcp_installed && $needs_mcp; then
|
||||||
|
# Has MCP but missing CLAUDE.md
|
||||||
|
PARTIAL_PLUGINS+=("$plugin")
|
||||||
|
else
|
||||||
|
NOT_INSTALLED+=("$plugin")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Print fully installed plugins
|
||||||
|
if [[ ${#INSTALLED_PLUGINS[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${GREEN}✓ Fully Installed:${NC}"
|
||||||
|
echo ""
|
||||||
|
printf " %-24s %-10s %s\n" "PLUGIN" "VERSION" "DESCRIPTION"
|
||||||
|
printf " %-24s %-10s %s\n" "------" "-------" "-----------"
|
||||||
|
for plugin in "${INSTALLED_PLUGINS[@]}"; do
|
||||||
|
version=$(get_plugin_version "$plugin")
|
||||||
|
desc=$(get_plugin_description "$plugin")
|
||||||
|
printf " %-24s %-10s %s\n" "$plugin" "$version" "$desc"
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Print partially installed plugins
|
||||||
|
if [[ ${#PARTIAL_PLUGINS[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${YELLOW}⚠ Partially Installed:${NC}"
|
||||||
|
echo ""
|
||||||
|
for plugin in "${PARTIAL_PLUGINS[@]}"; do
|
||||||
|
version=$(get_plugin_version "$plugin")
|
||||||
|
echo " $plugin (v$version)"
|
||||||
|
if [[ -v INSTALLED_MCP[$plugin] ]]; then
|
||||||
|
echo " ✓ MCP server configured in .mcp.json"
|
||||||
|
else
|
||||||
|
# Show which MCP servers are missing
|
||||||
|
mcp_servers=$(get_mcp_servers "$plugin")
|
||||||
|
if [[ -n "$mcp_servers" ]]; then
|
||||||
|
echo " ✗ MCP server(s) NOT in .mcp.json: $mcp_servers"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ -v INSTALLED_CLAUDE_MD[$plugin] ]]; then
|
||||||
|
echo " ✓ Integration in CLAUDE.md"
|
||||||
|
else
|
||||||
|
echo " ✗ Integration NOT in CLAUDE.md"
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
echo " Run install-plugin.sh to complete installation."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Print available but not installed
|
||||||
|
if [[ ${#NOT_INSTALLED[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${BLUE}○ Available (not installed):${NC}"
|
||||||
|
echo ""
|
||||||
|
for plugin in "${NOT_INSTALLED[@]}"; do
|
||||||
|
version=$(get_plugin_version "$plugin")
|
||||||
|
desc=$(get_plugin_description "$plugin")
|
||||||
|
printf " %-24s %-10s %s\n" "$plugin" "$version" "$desc"
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
echo "----------------------------------------------"
|
||||||
|
total_available=$(get_available_plugins | wc -l)
|
||||||
|
total_installed=${#INSTALLED_PLUGINS[@]}
|
||||||
|
total_partial=${#PARTIAL_PLUGINS[@]}
|
||||||
|
|
||||||
|
echo -e "Total: ${GREEN}$total_installed installed${NC}"
|
||||||
|
if [[ $total_partial -gt 0 ]]; then
|
||||||
|
echo -e " ${YELLOW}$total_partial partial${NC}"
|
||||||
|
fi
|
||||||
|
echo " $((total_available - total_installed - total_partial)) available"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Install hint
|
||||||
|
if [[ ${#NOT_INSTALLED[@]} -gt 0 ]]; then
|
||||||
|
echo "To install a plugin:"
|
||||||
|
echo " $SCRIPT_DIR/install-plugin.sh <plugin-name> $TARGET_PATH"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
363
scripts/uninstall-plugin.sh
Executable file
363
scripts/uninstall-plugin.sh
Executable file
@@ -0,0 +1,363 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# =============================================================================
|
||||||
|
# uninstall-plugin.sh - Remove marketplace plugin from a consumer project
|
||||||
|
# =============================================================================
|
||||||
|
#
|
||||||
|
# Usage: ./scripts/uninstall-plugin.sh <plugin-name> <target-project-path>
|
||||||
|
#
|
||||||
|
# This script:
|
||||||
|
# 1. Removes MCP server entries from target project's .mcp.json
|
||||||
|
# 2. Removes CLAUDE.md integration section for the plugin
|
||||||
|
# 3. Is idempotent (safe to run multiple times)
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
# ./scripts/uninstall-plugin.sh data-platform ~/projects/personal-portfolio
|
||||||
|
# ./scripts/uninstall-plugin.sh projman /home/user/my-project
|
||||||
|
#
|
||||||
|
# =============================================================================
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||||
|
|
||||||
|
# --- Color Definitions ---
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
BLUE='\033[0;34m'
|
||||||
|
CYAN='\033[0;36m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# --- Logging Functions ---
|
||||||
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
||||||
|
log_success() { echo -e "${GREEN}[OK]${NC} $1"; }
|
||||||
|
log_skip() { echo -e "${YELLOW}[SKIP]${NC} $1"; }
|
||||||
|
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
||||||
|
log_warning() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
||||||
|
|
||||||
|
# --- Track Changes ---
|
||||||
|
CHANGES_MADE=()
|
||||||
|
SKIPPED=()
|
||||||
|
|
||||||
|
# --- Usage ---
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 <plugin-name> <target-project-path>"
|
||||||
|
echo ""
|
||||||
|
echo "Remove a marketplace plugin from a consumer project."
|
||||||
|
echo ""
|
||||||
|
echo "Arguments:"
|
||||||
|
echo " plugin-name Name of the plugin (e.g., data-platform, viz-platform, projman)"
|
||||||
|
echo " target-project-path Path to the target project (absolute or relative)"
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " $0 data-platform ~/projects/personal-portfolio"
|
||||||
|
echo " $0 projman /home/user/my-project"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Prerequisite Check ---
|
||||||
|
check_prerequisites() {
|
||||||
|
if ! command -v jq &> /dev/null; then
|
||||||
|
log_error "jq is required but not installed."
|
||||||
|
echo "Install with: sudo apt install jq"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Validate Target Project ---
|
||||||
|
validate_target() {
|
||||||
|
local target_path="$1"
|
||||||
|
|
||||||
|
if [[ ! -d "$target_path" ]]; then
|
||||||
|
log_error "Target project path does not exist: $target_path"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_success "Target project found: $target_path"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Get MCP Servers for Plugin ---
|
||||||
|
# Reads the mcp_servers array from plugin.json
|
||||||
|
# Returns newline-separated list of MCP server names, or empty if none
|
||||||
|
get_mcp_servers() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local plugin_json="$REPO_ROOT/plugins/$plugin_name/.claude-plugin/plugin.json"
|
||||||
|
|
||||||
|
if [[ ! -f "$plugin_json" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read mcp_servers array from plugin.json
|
||||||
|
# Returns empty if field doesn't exist or is empty
|
||||||
|
jq -r '.mcp_servers // [] | .[]' "$plugin_json" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Remove from .mcp.json ---
|
||||||
|
remove_from_mcp_json() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local target_path="$2"
|
||||||
|
local mcp_json="$target_path/.mcp.json"
|
||||||
|
|
||||||
|
# Check if .mcp.json exists
|
||||||
|
if [[ ! -f "$mcp_json" ]]; then
|
||||||
|
log_skip "No .mcp.json found - nothing to remove"
|
||||||
|
SKIPPED+=(".mcp.json: File does not exist")
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get MCP servers for this plugin
|
||||||
|
local mcp_servers
|
||||||
|
mcp_servers=$(get_mcp_servers "$plugin_name")
|
||||||
|
|
||||||
|
if [[ -z "$mcp_servers" ]]; then
|
||||||
|
# Fallback: try to remove entry with plugin name (backward compatibility)
|
||||||
|
if jq -e ".mcpServers[\"$plugin_name\"]" "$mcp_json" > /dev/null 2>&1; then
|
||||||
|
log_info "Removing MCP server '$plugin_name' from .mcp.json"
|
||||||
|
local tmp_file=$(mktemp)
|
||||||
|
jq "del(.mcpServers[\"$plugin_name\"])" "$mcp_json" > "$tmp_file"
|
||||||
|
mv "$tmp_file" "$mcp_json"
|
||||||
|
CHANGES_MADE+=("Removed $plugin_name from .mcp.json")
|
||||||
|
log_success "Removed MCP server entry for '$plugin_name'"
|
||||||
|
else
|
||||||
|
log_skip "Plugin '$plugin_name' has no MCP servers configured"
|
||||||
|
SKIPPED+=(".mcp.json: No MCP servers for $plugin_name")
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove each MCP server
|
||||||
|
local servers_removed=0
|
||||||
|
while IFS= read -r server_name; do
|
||||||
|
[[ -z "$server_name" ]] && continue
|
||||||
|
|
||||||
|
# Check if entry exists
|
||||||
|
if ! jq -e ".mcpServers[\"$server_name\"]" "$mcp_json" > /dev/null 2>&1; then
|
||||||
|
log_skip "MCP server '$server_name' not in .mcp.json"
|
||||||
|
SKIPPED+=(".mcp.json: $server_name not present")
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove MCP server entry
|
||||||
|
log_info "Removing MCP server '$server_name' from .mcp.json"
|
||||||
|
local tmp_file=$(mktemp)
|
||||||
|
jq "del(.mcpServers[\"$server_name\"])" "$mcp_json" > "$tmp_file"
|
||||||
|
mv "$tmp_file" "$mcp_json"
|
||||||
|
|
||||||
|
CHANGES_MADE+=("Removed $server_name from .mcp.json")
|
||||||
|
log_success "Removed MCP server entry for '$server_name'"
|
||||||
|
((++servers_removed))
|
||||||
|
done <<< "$mcp_servers"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Remove from CLAUDE.md ---
|
||||||
|
remove_from_claude_md() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local target_path="$2"
|
||||||
|
local target_claude_md="$target_path/CLAUDE.md"
|
||||||
|
|
||||||
|
# Check if CLAUDE.md exists
|
||||||
|
if [[ ! -f "$target_claude_md" ]]; then
|
||||||
|
log_skip "No CLAUDE.md found - nothing to remove"
|
||||||
|
SKIPPED+=("CLAUDE.md: File does not exist")
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Try HTML comment markers first (preferred method)
|
||||||
|
local begin_marker="<!-- BEGIN marketplace-plugin: $plugin_name -->"
|
||||||
|
local end_marker="<!-- END marketplace-plugin: $plugin_name -->"
|
||||||
|
|
||||||
|
if grep -qF "$begin_marker" "$target_claude_md" 2>/dev/null; then
|
||||||
|
log_info "Removing '$plugin_name' section from CLAUDE.md (using markers)"
|
||||||
|
|
||||||
|
# Remove everything between markers (inclusive) and preceding ---
|
||||||
|
local tmp_file=$(mktemp)
|
||||||
|
awk -v begin="$begin_marker" -v end="$end_marker" '
|
||||||
|
BEGIN { skip = 0; prev_hr = 0; buffer = "" }
|
||||||
|
{
|
||||||
|
is_hr = /^---[[:space:]]*$/
|
||||||
|
|
||||||
|
if ($0 == begin) {
|
||||||
|
skip = 1
|
||||||
|
# If previous line was ---, dont print it
|
||||||
|
if (prev_hr) {
|
||||||
|
buffer = ""
|
||||||
|
}
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
|
if (skip) {
|
||||||
|
if ($0 == end) {
|
||||||
|
skip = 0
|
||||||
|
}
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
|
# Print buffered content
|
||||||
|
if (buffer != "") {
|
||||||
|
print buffer
|
||||||
|
}
|
||||||
|
|
||||||
|
# Buffer current line (in case its --- before a marker)
|
||||||
|
buffer = $0
|
||||||
|
prev_hr = is_hr
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
# Print final buffered content
|
||||||
|
if (buffer != "") {
|
||||||
|
print buffer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
' "$target_claude_md" > "$tmp_file"
|
||||||
|
|
||||||
|
# Clean up multiple consecutive blank lines
|
||||||
|
awk 'NF{blank=0} !NF{blank++} blank<=2' "$tmp_file" > "${tmp_file}.clean"
|
||||||
|
mv "${tmp_file}.clean" "$target_claude_md"
|
||||||
|
rm -f "$tmp_file"
|
||||||
|
|
||||||
|
CHANGES_MADE+=("Removed $plugin_name section from CLAUDE.md")
|
||||||
|
log_success "Removed CLAUDE.md section for '$plugin_name'"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fallback: try legacy header-based detection
|
||||||
|
local section_header
|
||||||
|
section_header=$(grep -E "^# ${plugin_name}( Plugin)? -? ?CLAUDE\.md Integration" "$target_claude_md" 2>/dev/null | head -1)
|
||||||
|
|
||||||
|
if [[ -z "$section_header" ]]; then
|
||||||
|
log_skip "Plugin '$plugin_name' section not found in CLAUDE.md"
|
||||||
|
SKIPPED+=("CLAUDE.md: $plugin_name section not found")
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Removing '$plugin_name' section from CLAUDE.md (legacy format)"
|
||||||
|
|
||||||
|
# Create temp file and use awk to remove section
|
||||||
|
local tmp_file=$(mktemp)
|
||||||
|
|
||||||
|
awk -v header="$section_header" '
|
||||||
|
BEGIN { skip = 0; found = 0; in_code_block = 0 }
|
||||||
|
{
|
||||||
|
# Track code blocks (``` markers)
|
||||||
|
if (/^```/) {
|
||||||
|
in_code_block = !in_code_block
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if this is the section header we want to remove
|
||||||
|
if ($0 == header) {
|
||||||
|
skip = 1
|
||||||
|
found = 1
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if this is a horizontal rule (---) - only count if not in code block
|
||||||
|
is_hr = /^---[[:space:]]*$/ && !in_code_block
|
||||||
|
|
||||||
|
# Check if this is a new plugin section header (only outside code blocks)
|
||||||
|
is_new_plugin_section = /^# [a-z-]+( Plugin)? -? ?CLAUDE\.md Integration/ && !in_code_block && $0 != header
|
||||||
|
|
||||||
|
# Check for HTML marker (new format)
|
||||||
|
is_begin_marker = /^<!-- BEGIN marketplace-plugin:/ && !in_code_block
|
||||||
|
|
||||||
|
if (skip) {
|
||||||
|
# Stop skipping when we hit --- or a new section
|
||||||
|
if (is_hr) {
|
||||||
|
skip = 0
|
||||||
|
next
|
||||||
|
}
|
||||||
|
if (is_new_plugin_section || is_begin_marker) {
|
||||||
|
skip = 0
|
||||||
|
print
|
||||||
|
}
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
|
print
|
||||||
|
}
|
||||||
|
END { if (!found) exit 1 }
|
||||||
|
' "$target_claude_md" > "$tmp_file" 2>/dev/null
|
||||||
|
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
# Clean up multiple consecutive blank lines
|
||||||
|
awk 'NF{blank=0} !NF{blank++} blank<=2' "$tmp_file" > "${tmp_file}.clean"
|
||||||
|
mv "${tmp_file}.clean" "$target_claude_md"
|
||||||
|
rm -f "$tmp_file"
|
||||||
|
CHANGES_MADE+=("Removed $plugin_name section from CLAUDE.md")
|
||||||
|
log_success "Removed CLAUDE.md section for '$plugin_name'"
|
||||||
|
else
|
||||||
|
rm -f "$tmp_file"
|
||||||
|
log_skip "Could not locate exact section boundaries in CLAUDE.md"
|
||||||
|
log_warning "You may need to manually remove the $plugin_name section"
|
||||||
|
SKIPPED+=("CLAUDE.md: Manual removal may be needed")
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Print Summary ---
|
||||||
|
print_summary() {
|
||||||
|
local plugin_name="$1"
|
||||||
|
local target_path="$2"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=============================================="
|
||||||
|
echo -e "${GREEN}Uninstallation Summary${NC}"
|
||||||
|
echo "=============================================="
|
||||||
|
echo ""
|
||||||
|
echo -e "${CYAN}Plugin:${NC} $plugin_name"
|
||||||
|
echo -e "${CYAN}Target:${NC} $target_path"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [[ ${#CHANGES_MADE[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${GREEN}Changes Made:${NC}"
|
||||||
|
for change in "${CHANGES_MADE[@]}"; do
|
||||||
|
echo " ✓ $change"
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${#SKIPPED[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${YELLOW}Skipped (not present or N/A):${NC}"
|
||||||
|
for skip in "${SKIPPED[@]}"; do
|
||||||
|
echo " - $skip"
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${#CHANGES_MADE[@]} -gt 0 ]]; then
|
||||||
|
echo -e "${YELLOW}⚠️ IMPORTANT:${NC}"
|
||||||
|
echo " Restart your Claude Code session for changes to take effect."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Main Execution
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
# Check arguments
|
||||||
|
if [[ $# -lt 2 ]]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
PLUGIN_NAME="$1"
|
||||||
|
TARGET_PATH="$2"
|
||||||
|
|
||||||
|
# Resolve target path to absolute
|
||||||
|
TARGET_PATH=$(cd "$TARGET_PATH" 2>/dev/null && pwd || echo "$TARGET_PATH")
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=============================================="
|
||||||
|
echo -e "${BLUE}Uninstalling Plugin: $PLUGIN_NAME${NC}"
|
||||||
|
echo "=============================================="
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Run checks
|
||||||
|
check_prerequisites
|
||||||
|
validate_target "$TARGET_PATH"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Perform uninstallation
|
||||||
|
remove_from_mcp_json "$PLUGIN_NAME" "$TARGET_PATH"
|
||||||
|
remove_from_claude_md "$PLUGIN_NAME" "$TARGET_PATH"
|
||||||
|
|
||||||
|
# Print summary
|
||||||
|
print_summary "$PLUGIN_NAME" "$TARGET_PATH"
|
||||||
Reference in New Issue
Block a user