Compare commits
8 Commits
3227d2d618
...
bcde33c7d0
| Author | SHA1 | Date | |
|---|---|---|---|
| bcde33c7d0 | |||
| ee3268fbe0 | |||
| f6a38ffaa8 | |||
| b13ffce0a0 | |||
| b39e01efd7 | |||
| 98eea5b6f9 | |||
| fe36ed91f2 | |||
| 8c85f9ca5f |
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Project management plugins with Gitea and NetBox integrations",
|
||||
"version": "3.1.0"
|
||||
"version": "3.2.0"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
|
||||
31
CHANGELOG.md
31
CHANGELOG.md
@@ -4,14 +4,23 @@ 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/).
|
||||
|
||||
## [3.1.2] - 2026-01-23
|
||||
## [Unreleased]
|
||||
|
||||
*Changes staged for the next release*
|
||||
|
||||
---
|
||||
|
||||
## [3.2.0] - 2026-01-24
|
||||
|
||||
### Added
|
||||
- **git-flow:** `/commit` now detects protected branches before committing
|
||||
- Warns when on protected branch (main, master, development, staging, production)
|
||||
- Offers to create feature branch automatically instead of committing directly
|
||||
- Configurable via `GIT_PROTECTED_BRANCHES` environment variable
|
||||
- Resolves issue where commits to protected branches would fail on push
|
||||
- **netbox:** Platform and primary_ip parameters added to device update tools
|
||||
- **claude-config-maintainer:** Auto-enforce mandatory behavior rules via SessionStart hook
|
||||
- **scripts:** `release.sh` - Versioning workflow script for consistent releases
|
||||
- **scripts:** `verify-hooks.sh` - Verify all hooks are command type
|
||||
|
||||
### Changed
|
||||
- **doc-guardian:** Hook switched from `prompt` type to `command` type
|
||||
@@ -19,14 +28,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- New `notify.sh` bash script guarantees exact output behavior
|
||||
- Only notifies for config file changes (commands/, agents/, skills/, hooks/)
|
||||
- Silent exit for all other files - no blocking possible
|
||||
- **All hooks:** Stricter plugin prefix enforcement
|
||||
- All prompts now mandate `[plugin-name]` prefix with "NO EXCEPTIONS" rule
|
||||
- **All hooks:** Converted to command type with stricter plugin prefix enforcement
|
||||
- All hooks now mandate `[plugin-name]` prefix with "NO EXCEPTIONS" rule
|
||||
- Simplified output formats with word limits
|
||||
- Consistent structure across projman, pr-review, code-sentinel, doc-guardian
|
||||
- **CLAUDE.md:** Replaced destructive "ALWAYS CLEAR CACHE" rule with "VERIFY AND RESTART"
|
||||
- Cache clearing mid-session breaks MCP tools
|
||||
- Added guidance for proper plugin development workflow
|
||||
|
||||
### Fixed
|
||||
- Protected branch workflow: Claude no longer commits directly to protected branches and then fails on push (fixes #109)
|
||||
- doc-guardian hook no longer blocks workflow - switched to command hook that can't be overridden by model (fixes #110)
|
||||
- **cmdb-assistant:** Complete MCP tool schemas for update operations (#138)
|
||||
- **netbox:** Shorten tool names to meet 64-char API limit (#134)
|
||||
- **cmdb-assistant:** Correct NetBox API URL format in setup wizard (#132)
|
||||
- **gitea/projman:** Type safety for `create_label_smart`, curl-based debug-report (#124)
|
||||
- **netbox:** Add diagnostic logging for JSON parse errors (#121)
|
||||
- **labels:** Add duplicate check before creating labels (#116)
|
||||
- **hooks:** Convert ALL hooks to command type with proper prefixes (#114)
|
||||
- Protected branch workflow: Claude no longer commits directly to protected branches (fixes #109)
|
||||
- doc-guardian hook no longer blocks workflow (fixes #110)
|
||||
|
||||
---
|
||||
|
||||
|
||||
86
CLAUDE.md
86
CLAUDE.md
@@ -31,11 +31,16 @@ This file provides guidance to Claude Code when working with code in this reposi
|
||||
- If user asks for output, show the OUTPUT
|
||||
- **Don't interpret or summarize unless asked**
|
||||
|
||||
### 5. AFTER PLUGIN UPDATES - ALWAYS CLEAR CACHE
|
||||
```bash
|
||||
rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/
|
||||
./scripts/verify-hooks.sh
|
||||
```
|
||||
### 5. AFTER PLUGIN UPDATES - VERIFY AND RESTART
|
||||
|
||||
**⚠️ DO NOT clear cache mid-session** - this breaks MCP tools that are already loaded.
|
||||
|
||||
1. Run `./scripts/verify-hooks.sh` to check hook types
|
||||
2. If changes affect MCP servers or hooks, inform the user:
|
||||
> "Plugin changes require a session restart to take effect. Please restart Claude Code."
|
||||
3. Cache clearing is ONLY safe **before** starting a new session (not during)
|
||||
|
||||
See `docs/DEBUGGING-CHECKLIST.md` for details on cache timing.
|
||||
|
||||
**FAILURE TO FOLLOW THESE RULES = WASTED USER TIME = UNACCEPTABLE**
|
||||
|
||||
@@ -125,7 +130,9 @@ leo-claude-mktplace/
|
||||
│ └── project-hygiene/
|
||||
├── scripts/
|
||||
│ ├── setup.sh, post-update.sh
|
||||
│ └── validate-marketplace.sh # Marketplace compliance validation
|
||||
│ ├── validate-marketplace.sh # Marketplace compliance validation
|
||||
│ ├── verify-hooks.sh # Verify all hooks are command type
|
||||
│ └── check-venv.sh # Check MCP server venvs exist
|
||||
└── docs/
|
||||
├── CANONICAL-PATHS.md # Single source of truth for paths
|
||||
└── CONFIGURATION.md # Centralized configuration guide
|
||||
@@ -172,12 +179,12 @@ leo-claude-mktplace/
|
||||
|
||||
| Category | Tools |
|
||||
|----------|-------|
|
||||
| Issues | `list_issues`, `get_issue`, `create_issue`, `update_issue`, `add_comment` |
|
||||
| Labels | `get_labels`, `suggest_labels`, `create_label` |
|
||||
| Milestones | `list_milestones`, `get_milestone`, `create_milestone`, `update_milestone` |
|
||||
| Dependencies | `list_issue_dependencies`, `create_issue_dependency`, `get_execution_order` |
|
||||
| Wiki | `list_wiki_pages`, `get_wiki_page`, `create_wiki_page`, `create_lesson`, `search_lessons` |
|
||||
| **Pull Requests** | `list_pull_requests`, `get_pull_request`, `get_pr_diff`, `get_pr_comments`, `create_pr_review`, `add_pr_comment` *(NEW v3.0.0)* |
|
||||
| Issues | `list_issues`, `get_issue`, `create_issue`, `update_issue`, `add_comment`, `aggregate_issues` |
|
||||
| Labels | `get_labels`, `suggest_labels`, `create_label`, `create_label_smart` |
|
||||
| Milestones | `list_milestones`, `get_milestone`, `create_milestone`, `update_milestone`, `delete_milestone` |
|
||||
| Dependencies | `list_issue_dependencies`, `create_issue_dependency`, `remove_issue_dependency`, `get_execution_order` |
|
||||
| Wiki | `list_wiki_pages`, `get_wiki_page`, `create_wiki_page`, `update_wiki_page`, `create_lesson`, `search_lessons` |
|
||||
| **Pull Requests** | `list_pull_requests`, `get_pull_request`, `get_pr_diff`, `get_pr_comments`, `create_pr_review`, `add_pr_comment` |
|
||||
| Validation | `validate_repo_org`, `get_branch_protection` |
|
||||
|
||||
### Hybrid Configuration
|
||||
@@ -286,13 +293,56 @@ See `docs/DEBUGGING-CHECKLIST.md` for systematic troubleshooting.
|
||||
- `/debug-report` - Run full diagnostics, create issue if needed
|
||||
- `/debug-review` - Investigate and propose fixes
|
||||
|
||||
## Versioning Rules
|
||||
## Versioning Workflow
|
||||
|
||||
- Version displayed ONLY in main `README.md` title: `# Leo Claude Marketplace - vX.Y.Z`
|
||||
- `CHANGELOG.md` is authoritative for version history
|
||||
- Follow [SemVer](https://semver.org/): MAJOR.MINOR.PATCH
|
||||
- On release: Update README title → CHANGELOG → marketplace.json → plugin.json files
|
||||
This project follows [SemVer](https://semver.org/) and [Keep a Changelog](https://keepachangelog.com).
|
||||
|
||||
### Version Locations (must stay in sync)
|
||||
|
||||
| Location | Format | Example |
|
||||
|----------|--------|---------|
|
||||
| Git tags | `vX.Y.Z` | `v3.2.0` |
|
||||
| README.md title | `# Leo Claude Marketplace - vX.Y.Z` | `v3.2.0` |
|
||||
| marketplace.json | `"version": "X.Y.Z"` | `3.2.0` |
|
||||
| CHANGELOG.md | `## [X.Y.Z] - YYYY-MM-DD` | `[3.2.0] - 2026-01-24` |
|
||||
|
||||
### During Development
|
||||
|
||||
**All changes go under `[Unreleased]` in CHANGELOG.md.** Never create a versioned section until release time.
|
||||
|
||||
```markdown
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- New feature description
|
||||
|
||||
### Fixed
|
||||
- Bug fix description
|
||||
```
|
||||
|
||||
### Creating a Release
|
||||
|
||||
Use the release script to ensure consistency:
|
||||
|
||||
```bash
|
||||
./scripts/release.sh 3.2.0
|
||||
```
|
||||
|
||||
The script will:
|
||||
1. Validate `[Unreleased]` section has content
|
||||
2. Replace `[Unreleased]` with `[3.2.0] - YYYY-MM-DD`
|
||||
3. Update README.md title
|
||||
4. Update marketplace.json version
|
||||
5. Commit and create git tag
|
||||
|
||||
### SemVer Guidelines
|
||||
|
||||
| Change Type | Version Bump | Example |
|
||||
|-------------|--------------|---------|
|
||||
| Bug fixes only | PATCH (x.y.**Z**) | 3.1.1 → 3.1.2 |
|
||||
| New features (backwards compatible) | MINOR (x.**Y**.0) | 3.1.2 → 3.2.0 |
|
||||
| Breaking changes | MAJOR (**X**.0.0) | 3.2.0 → 4.0.0 |
|
||||
|
||||
---
|
||||
|
||||
**Last Updated:** 2026-01-23
|
||||
**Last Updated:** 2026-01-24
|
||||
|
||||
15
README.md
15
README.md
@@ -1,4 +1,4 @@
|
||||
# Leo Claude Marketplace - v3.1.1
|
||||
# Leo Claude Marketplace - v3.2.0
|
||||
|
||||
A collection of Claude Code plugins for project management, infrastructure automation, and development workflows.
|
||||
|
||||
@@ -106,11 +106,11 @@ Full Gitea API integration for project management.
|
||||
|
||||
| Category | Tools |
|
||||
|----------|-------|
|
||||
| Issues | `list_issues`, `get_issue`, `create_issue`, `update_issue`, `add_comment` |
|
||||
| Labels | `get_labels`, `suggest_labels`, `create_label` |
|
||||
| Wiki | `list_wiki_pages`, `get_wiki_page`, `create_wiki_page`, `create_lesson`, `search_lessons` |
|
||||
| Milestones | `list_milestones`, `get_milestone`, `create_milestone`, `update_milestone` |
|
||||
| Dependencies | `list_issue_dependencies`, `create_issue_dependency`, `get_execution_order` |
|
||||
| Issues | `list_issues`, `get_issue`, `create_issue`, `update_issue`, `add_comment`, `aggregate_issues` |
|
||||
| Labels | `get_labels`, `suggest_labels`, `create_label`, `create_label_smart` |
|
||||
| Wiki | `list_wiki_pages`, `get_wiki_page`, `create_wiki_page`, `update_wiki_page`, `create_lesson`, `search_lessons` |
|
||||
| Milestones | `list_milestones`, `get_milestone`, `create_milestone`, `update_milestone`, `delete_milestone` |
|
||||
| Dependencies | `list_issue_dependencies`, `create_issue_dependency`, `remove_issue_dependency`, `get_execution_order` |
|
||||
| **Pull Requests** | `list_pull_requests`, `get_pull_request`, `get_pr_diff`, `get_pr_comments`, `create_pr_review`, `add_pr_comment` *(NEW in v3.0.0)* |
|
||||
| Validation | `validate_repo_org`, `get_branch_protection` |
|
||||
|
||||
@@ -245,7 +245,8 @@ leo-claude-mktplace/
|
||||
├── docs/ # Documentation
|
||||
│ ├── CANONICAL-PATHS.md # Path reference
|
||||
│ └── CONFIGURATION.md # Setup guide
|
||||
└── scripts/ # Setup scripts
|
||||
├── scripts/ # Setup scripts
|
||||
└── CHANGELOG.md # Version history
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -197,6 +197,51 @@ echo -e "\n=== Config Files ==="
|
||||
|
||||
---
|
||||
|
||||
## Cache Clearing: When It's Safe vs Destructive
|
||||
|
||||
**⚠️ CRITICAL: Never clear plugin cache mid-session.**
|
||||
|
||||
### Why Cache Clearing Breaks MCP Tools
|
||||
|
||||
When Claude Code starts a session:
|
||||
1. MCP tools are loaded from the cache directory
|
||||
2. Tool definitions include **absolute paths** to the venv (e.g., `~/.claude/plugins/cache/.../venv/`)
|
||||
3. These paths are cached in the session memory
|
||||
4. Deleting the cache removes the venv, but the session still references the old paths
|
||||
5. Any MCP tool making HTTP requests fails with TLS certificate errors
|
||||
|
||||
### When Cache Clearing is SAFE
|
||||
|
||||
| Scenario | Safe? | Action |
|
||||
|----------|-------|--------|
|
||||
| Before starting Claude Code | ✅ Yes | Clear cache, then start session |
|
||||
| Between sessions | ✅ Yes | Clear cache after `/exit`, before next session |
|
||||
| During a session | ❌ NO | Never - will break MCP tools |
|
||||
| After plugin source edits | ❌ NO | Restart session instead |
|
||||
|
||||
### Recovery: MCP Tools Broken Mid-Session
|
||||
|
||||
If you accidentally cleared cache during a session and MCP tools fail:
|
||||
|
||||
```
|
||||
Error: Could not find a suitable TLS CA certificate bundle, invalid path:
|
||||
/home/.../.claude/plugins/cache/.../certifi/cacert.pem
|
||||
```
|
||||
|
||||
**Fix:**
|
||||
1. Exit the current session (`/exit` or Ctrl+C)
|
||||
2. Start a new Claude Code session
|
||||
3. MCP tools will reload from the reinstalled cache
|
||||
|
||||
### Correct Workflow for Plugin Development
|
||||
|
||||
1. Make changes to plugin source files
|
||||
2. Run `./scripts/verify-hooks.sh` (verifies hook types)
|
||||
3. Tell user: "Please restart Claude Code for changes to take effect"
|
||||
4. **Do NOT clear cache** - session restart handles reloading
|
||||
|
||||
---
|
||||
|
||||
## Automated Diagnostics
|
||||
|
||||
Use these commands for automated checking:
|
||||
|
||||
@@ -4,7 +4,7 @@ description: Run diagnostics and create structured issue in marketplace reposito
|
||||
|
||||
# Debug Report
|
||||
|
||||
Run diagnostic checks on projman MCP tools and create a structured issue in the marketplace repository for investigation.
|
||||
Create structured issues in the marketplace repository - either from automated diagnostic tests OR from user-reported problems.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -20,6 +20,101 @@ If not configured, ask the user for the marketplace repository path.
|
||||
|
||||
You MUST follow these steps in order. Do NOT skip any step.
|
||||
|
||||
### Step 0: Select Report Mode
|
||||
|
||||
Use AskUserQuestion to determine what the user wants to report:
|
||||
|
||||
```
|
||||
What would you like to report?
|
||||
|
||||
[ ] Run automated diagnostics - Test MCP tools and report failures
|
||||
[ ] Report an issue I experienced - Describe a problem with any plugin command
|
||||
```
|
||||
|
||||
Store the selection as `REPORT_MODE`:
|
||||
- "automated" → Continue to Step 1
|
||||
- "user-reported" → Skip to Step 0.1
|
||||
|
||||
---
|
||||
|
||||
### Step 0.1: Gather User Feedback (User-Reported Mode Only)
|
||||
|
||||
If `REPORT_MODE` is "user-reported", gather structured feedback.
|
||||
|
||||
**Question 1: What were you trying to do?**
|
||||
|
||||
Use AskUserQuestion:
|
||||
```
|
||||
Which plugin/command were you using?
|
||||
|
||||
[ ] projman (sprint planning, issues, labels)
|
||||
[ ] git-flow (commits, branches)
|
||||
[ ] pr-review (pull request review)
|
||||
[ ] cmdb-assistant (NetBox integration)
|
||||
[ ] doc-guardian (documentation)
|
||||
[ ] code-sentinel (security, refactoring)
|
||||
[ ] Other - I'll describe it
|
||||
```
|
||||
|
||||
Store as `AFFECTED_PLUGIN`.
|
||||
|
||||
Then ask for the specific command (free text):
|
||||
```
|
||||
What command or tool were you using? (e.g., /sprint-plan, virt_update_vm)
|
||||
```
|
||||
|
||||
Store as `AFFECTED_COMMAND`.
|
||||
|
||||
**Question 2: What was your goal?**
|
||||
|
||||
```
|
||||
Briefly describe what you were trying to accomplish:
|
||||
```
|
||||
|
||||
Store as `USER_GOAL`.
|
||||
|
||||
**Question 3: What went wrong?**
|
||||
|
||||
Use AskUserQuestion:
|
||||
```
|
||||
What type of problem did you encounter?
|
||||
|
||||
[ ] Error message - Command failed with an error
|
||||
[ ] Missing feature - Tool doesn't support what I need
|
||||
[ ] Unexpected behavior - It worked but did the wrong thing
|
||||
[ ] Documentation issue - Instructions were unclear or wrong
|
||||
[ ] Other - I'll describe it
|
||||
```
|
||||
|
||||
Store as `PROBLEM_TYPE`.
|
||||
|
||||
Then ask for details (free text):
|
||||
```
|
||||
Describe what happened. Include any error messages if applicable:
|
||||
```
|
||||
|
||||
Store as `PROBLEM_DESCRIPTION`.
|
||||
|
||||
**Question 4: Expected vs Actual**
|
||||
|
||||
```
|
||||
What did you expect to happen?
|
||||
```
|
||||
|
||||
Store as `EXPECTED_BEHAVIOR`.
|
||||
|
||||
**Question 5: Workaround (optional)**
|
||||
|
||||
```
|
||||
Did you find a workaround? If so, describe it (or skip):
|
||||
```
|
||||
|
||||
Store as `WORKAROUND` (may be empty).
|
||||
|
||||
After gathering feedback, continue to Step 1 for context gathering, then skip to Step 5.1.
|
||||
|
||||
---
|
||||
|
||||
### Step 1: Gather Project Context
|
||||
|
||||
Run these Bash commands to capture project information:
|
||||
@@ -91,7 +186,9 @@ grep PROJMAN_MARKETPLACE_REPO .env
|
||||
|
||||
Store as `MARKETPLACE_REPO`. If not found, ask the user.
|
||||
|
||||
### Step 3: Run Diagnostic Suite
|
||||
### Step 3: Run Diagnostic Suite (Automated Mode Only)
|
||||
|
||||
**Skip this step if `REPORT_MODE` is "user-reported"** → Go to Step 5.1
|
||||
|
||||
Run each MCP tool with explicit `repo` parameter. Record success/failure and full response.
|
||||
|
||||
@@ -131,7 +228,9 @@ For each test, record:
|
||||
- Status: PASS or FAIL
|
||||
- Response or error message
|
||||
|
||||
### Step 4: Analyze Results
|
||||
### Step 4: Analyze Results (Automated Mode Only)
|
||||
|
||||
**Skip this step if `REPORT_MODE` is "user-reported"** → Go to Step 5.1
|
||||
|
||||
Count failures and categorize errors:
|
||||
|
||||
@@ -145,7 +244,9 @@ Count failures and categorize errors:
|
||||
|
||||
For each failure, write a hypothesis about the likely cause.
|
||||
|
||||
### Step 5: Generate Smart Labels
|
||||
### Step 5: Generate Smart Labels (Automated Mode Only)
|
||||
|
||||
**Skip this step if `REPORT_MODE` is "user-reported"** → Go to Step 5.1
|
||||
|
||||
Generate appropriate labels based on the diagnostic results.
|
||||
|
||||
@@ -180,7 +281,53 @@ The final label set should include:
|
||||
- **Always**: `Type: Bug`, `Source: Diagnostic`, `Agent: Claude`
|
||||
- **If detected**: `Component: *`, `Complexity: *`, `Risk: *`, `Priority: *`
|
||||
|
||||
### Step 6: Generate Issue Content
|
||||
After generating labels, continue to Step 6.
|
||||
|
||||
---
|
||||
|
||||
### Step 5.1: Generate Labels (User-Reported Mode Only)
|
||||
|
||||
**Only execute this step if `REPORT_MODE` is "user-reported"**
|
||||
|
||||
**1. Map problem type to labels:**
|
||||
|
||||
| PROBLEM_TYPE | Labels |
|
||||
|--------------|--------|
|
||||
| Error message | `Type: Bug` |
|
||||
| Missing feature | `Type: Enhancement` |
|
||||
| Unexpected behavior | `Type: Bug` |
|
||||
| Documentation issue | `Type: Documentation` |
|
||||
| Other | `Type: Bug` (default) |
|
||||
|
||||
**2. Map plugin to component:**
|
||||
|
||||
| AFFECTED_PLUGIN | Component Label |
|
||||
|-----------------|-----------------|
|
||||
| projman | `Component: Commands` |
|
||||
| git-flow | `Component: Commands` |
|
||||
| pr-review | `Component: Commands` |
|
||||
| cmdb-assistant | `Component: API` |
|
||||
| doc-guardian | `Component: Commands` |
|
||||
| code-sentinel | `Component: Commands` |
|
||||
| Other | *(no component label)* |
|
||||
|
||||
**3. Build final labels:**
|
||||
|
||||
```
|
||||
BASE_LABELS = ["Source: User-Reported", "Agent: Claude"]
|
||||
TYPE_LABEL = [mapped from PROBLEM_TYPE]
|
||||
COMPONENT_LABEL = [mapped from AFFECTED_PLUGIN, if any]
|
||||
|
||||
FINAL_LABELS = BASE_LABELS + TYPE_LABEL + COMPONENT_LABEL
|
||||
```
|
||||
|
||||
After generating labels, continue to Step 6.1.
|
||||
|
||||
---
|
||||
|
||||
### Step 6: Generate Issue Content (Automated Mode Only)
|
||||
|
||||
**Skip this step if `REPORT_MODE` is "user-reported"** → Go to Step 6.1
|
||||
|
||||
Use this exact template:
|
||||
|
||||
@@ -254,9 +401,86 @@ Use this exact template:
|
||||
|
||||
---
|
||||
|
||||
*Generated by /debug-report - Labels: Type: Bug, Source: Diagnostic, Agent: Claude*
|
||||
*Generated by /debug-report (automated) - Labels: Type: Bug, Source: Diagnostic, Agent: Claude*
|
||||
```
|
||||
|
||||
After generating content, continue to Step 7.
|
||||
|
||||
---
|
||||
|
||||
### Step 6.1: Generate Issue Content (User-Reported Mode Only)
|
||||
|
||||
**Only execute this step if `REPORT_MODE` is "user-reported"**
|
||||
|
||||
Use this template for user-reported issues:
|
||||
|
||||
```markdown
|
||||
## User-Reported Issue
|
||||
|
||||
**Reported**: [ISO timestamp]
|
||||
**Reporter**: Claude Code via /debug-report (user feedback)
|
||||
|
||||
## Context
|
||||
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
| Plugin | `[AFFECTED_PLUGIN]` |
|
||||
| Command/Tool | `[AFFECTED_COMMAND]` |
|
||||
| Repository | `[PROJECT_REPO]` |
|
||||
| Working Directory | `[WORKING_DIR]` |
|
||||
| Branch | `[CURRENT_BRANCH]` |
|
||||
|
||||
## Problem Description
|
||||
|
||||
### Goal
|
||||
[USER_GOAL]
|
||||
|
||||
### What Happened
|
||||
**Problem Type**: [PROBLEM_TYPE]
|
||||
|
||||
[PROBLEM_DESCRIPTION]
|
||||
|
||||
### Expected Behavior
|
||||
[EXPECTED_BEHAVIOR]
|
||||
|
||||
## Workaround
|
||||
[WORKAROUND if provided, otherwise "None identified"]
|
||||
|
||||
## Investigation Hints
|
||||
|
||||
Based on the affected plugin/command, relevant files to check:
|
||||
|
||||
[Generate based on AFFECTED_PLUGIN:]
|
||||
|
||||
**projman:**
|
||||
- `plugins/projman/commands/[AFFECTED_COMMAND].md`
|
||||
- `mcp-servers/gitea/mcp_server/tools/*.py`
|
||||
|
||||
**git-flow:**
|
||||
- `plugins/git-flow/commands/[AFFECTED_COMMAND].md`
|
||||
|
||||
**pr-review:**
|
||||
- `plugins/pr-review/commands/[AFFECTED_COMMAND].md`
|
||||
- `mcp-servers/gitea/mcp_server/tools/pull_requests.py`
|
||||
|
||||
**cmdb-assistant:**
|
||||
- `plugins/cmdb-assistant/commands/[AFFECTED_COMMAND].md`
|
||||
- `mcp-servers/netbox/mcp_server/tools/*.py`
|
||||
- `mcp-servers/netbox/mcp_server/server.py` (tool schemas)
|
||||
|
||||
**doc-guardian / code-sentinel:**
|
||||
- `plugins/[plugin]/commands/[AFFECTED_COMMAND].md`
|
||||
- `plugins/[plugin]/hooks/*.md`
|
||||
|
||||
---
|
||||
|
||||
*Generated by /debug-report (user feedback) - Labels: [FINAL_LABELS]*
|
||||
```
|
||||
|
||||
After generating content, continue to Step 7.
|
||||
|
||||
---
|
||||
|
||||
### Step 7: Create Issue in Marketplace
|
||||
|
||||
**IMPORTANT:** Always use curl to create issues in the marketplace repo. This avoids branch protection restrictions and MCP context issues that can block issue creation when working on protected branches.
|
||||
@@ -274,46 +498,57 @@ fi
|
||||
|
||||
**2. Fetch label IDs from marketplace repo:**
|
||||
|
||||
The diagnostic labels to apply are:
|
||||
Labels depend on `REPORT_MODE`:
|
||||
|
||||
**Automated mode:**
|
||||
- `Source/Diagnostic` (always)
|
||||
- `Type/Bug` (always)
|
||||
|
||||
**User-reported mode:**
|
||||
- `Source/User-Reported` (always)
|
||||
- Type label from Step 5.1 (Bug, Enhancement, or Documentation)
|
||||
- Component label from Step 5.1 (if applicable)
|
||||
|
||||
```bash
|
||||
# Fetch all labels and extract IDs for our target labels
|
||||
# Fetch all labels from marketplace repo
|
||||
LABELS_JSON=$(curl -s "${GITEA_API_URL}/repos/${MARKETPLACE_REPO}/labels" \
|
||||
-H "Authorization: token ${GITEA_API_TOKEN}")
|
||||
|
||||
# Extract label IDs (handles both org and repo labels)
|
||||
SOURCE_DIAG_ID=$(echo "$LABELS_JSON" | jq -r '.[] | select(.name == "Source/Diagnostic") | .id')
|
||||
TYPE_BUG_ID=$(echo "$LABELS_JSON" | jq -r '.[] | select(.name == "Type/Bug") | .id')
|
||||
# Extract label IDs based on FINAL_LABELS from Step 5 or 5.1
|
||||
# Build LABEL_IDS array with IDs of labels that exist in the repo
|
||||
# Example for automated mode:
|
||||
SOURCE_ID=$(echo "$LABELS_JSON" | jq -r '.[] | select(.name == "Source/Diagnostic") | .id')
|
||||
TYPE_ID=$(echo "$LABELS_JSON" | jq -r '.[] | select(.name == "Type/Bug") | .id')
|
||||
|
||||
# Build label array (only include IDs that were found)
|
||||
LABEL_IDS="[]"
|
||||
if [[ -n "$SOURCE_DIAG_ID" && -n "$TYPE_BUG_ID" ]]; then
|
||||
LABEL_IDS="[$SOURCE_DIAG_ID, $TYPE_BUG_ID]"
|
||||
elif [[ -n "$SOURCE_DIAG_ID" ]]; then
|
||||
LABEL_IDS="[$SOURCE_DIAG_ID]"
|
||||
elif [[ -n "$TYPE_BUG_ID" ]]; then
|
||||
LABEL_IDS="[$TYPE_BUG_ID]"
|
||||
fi
|
||||
# Example for user-reported mode (adjust based on FINAL_LABELS):
|
||||
# SOURCE_ID=$(echo "$LABELS_JSON" | jq -r '.[] | select(.name == "Source/User-Reported") | .id')
|
||||
# TYPE_ID=$(echo "$LABELS_JSON" | jq -r '.[] | select(.name == "[TYPE_LABEL]") | .id')
|
||||
|
||||
# Build label array from found IDs
|
||||
LABEL_IDS="[$(echo "$SOURCE_ID,$TYPE_ID" | sed 's/,,*/,/g; s/^,//; s/,$//')]"
|
||||
echo "Label IDs to apply: $LABEL_IDS"
|
||||
```
|
||||
|
||||
**3. Create issue with labels via curl:**
|
||||
|
||||
**Title format depends on `REPORT_MODE`:**
|
||||
- Automated: `[Diagnostic] [summary of main failure]`
|
||||
- User-reported: `[AFFECTED_PLUGIN] [brief summary of PROBLEM_DESCRIPTION]`
|
||||
|
||||
```bash
|
||||
# Create temp files with restrictive permissions
|
||||
DIAG_TITLE=$(mktemp -t diag-title.XXXXXX)
|
||||
DIAG_BODY=$(mktemp -t diag-body.XXXXXX)
|
||||
DIAG_PAYLOAD=$(mktemp -t diag-payload.XXXXXX)
|
||||
|
||||
# Save title
|
||||
echo "[Diagnostic] [summary of main failure]" > "$DIAG_TITLE"
|
||||
# Save title (format depends on REPORT_MODE)
|
||||
# Automated: "[Diagnostic] [summary of main failure]"
|
||||
# User-reported: "[AFFECTED_PLUGIN] [brief summary]"
|
||||
echo "[Title based on REPORT_MODE]" > "$DIAG_TITLE"
|
||||
|
||||
# Save body (paste Step 6 content) - heredoc delimiter prevents shell expansion
|
||||
# Save body (paste Step 6 or 6.1 content) - heredoc delimiter prevents shell expansion
|
||||
cat > "$DIAG_BODY" << 'DIAGNOSTIC_EOF'
|
||||
[Paste the full issue content from Step 6 here]
|
||||
[Paste the full issue content from Step 6 or 6.1 here]
|
||||
DIAGNOSTIC_EOF
|
||||
|
||||
# Build JSON payload with labels using jq
|
||||
@@ -360,8 +595,9 @@ To create the issue manually:
|
||||
|
||||
### Step 8: Report to User
|
||||
|
||||
Display summary:
|
||||
Display summary based on `REPORT_MODE`:
|
||||
|
||||
**Automated Mode:**
|
||||
```
|
||||
Debug Report Complete
|
||||
=====================
|
||||
@@ -383,18 +619,38 @@ Next Steps:
|
||||
3. Select issue #[N] to investigate
|
||||
```
|
||||
|
||||
**User-Reported Mode:**
|
||||
```
|
||||
Issue Report Complete
|
||||
=====================
|
||||
|
||||
Plugin: [AFFECTED_PLUGIN]
|
||||
Command: [AFFECTED_COMMAND]
|
||||
Problem: [PROBLEM_TYPE]
|
||||
|
||||
Issue Created: [issue URL]
|
||||
|
||||
Your feedback has been captured. The development team will
|
||||
investigate and may follow up with questions.
|
||||
|
||||
Next Steps:
|
||||
1. Switch to marketplace repo: cd [marketplace path]
|
||||
2. Run: /debug-review
|
||||
3. Select issue #[N] to investigate
|
||||
```
|
||||
|
||||
## DO NOT
|
||||
|
||||
- **DO NOT** attempt to fix anything - only report
|
||||
- **DO NOT** create issues if all tests pass (just report success)
|
||||
- **DO NOT** skip any diagnostic test
|
||||
- **DO NOT** create issues if all automated tests pass (unless in user-reported mode)
|
||||
- **DO NOT** skip any diagnostic test in automated mode
|
||||
- **DO NOT** call MCP tools without the `repo` parameter
|
||||
- **DO NOT** ask user questions during execution - run autonomously
|
||||
- **DO NOT** skip user questions in user-reported mode - gather complete feedback
|
||||
- **DO NOT** use MCP tools to create issues in the marketplace - always use curl (avoids branch restrictions)
|
||||
|
||||
## If All Tests Pass
|
||||
## If All Tests Pass (Automated Mode Only)
|
||||
|
||||
If all 5 tests pass, report success without creating an issue:
|
||||
If all 5 tests pass in automated mode, report success without creating an issue:
|
||||
|
||||
```
|
||||
Debug Report Complete
|
||||
@@ -407,8 +663,8 @@ Failed: 0
|
||||
|
||||
All diagnostics passed. No issues to report.
|
||||
|
||||
If you're experiencing a specific problem, please describe it
|
||||
and I can create a manual bug report.
|
||||
If you're experiencing a specific problem, run /debug-report again
|
||||
and select "Report an issue I experienced" to describe it.
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
172
scripts/release.sh
Executable file
172
scripts/release.sh
Executable file
@@ -0,0 +1,172 @@
|
||||
#!/bin/bash
|
||||
# release.sh - Create a new release with version consistency
|
||||
#
|
||||
# Usage: ./scripts/release.sh X.Y.Z
|
||||
#
|
||||
# This script ensures all version references are updated consistently:
|
||||
# 1. CHANGELOG.md - [Unreleased] becomes [X.Y.Z] - YYYY-MM-DD
|
||||
# 2. README.md - Title updated to vX.Y.Z
|
||||
# 3. marketplace.json - version field updated
|
||||
# 4. Git commit and tag created
|
||||
#
|
||||
# Prerequisites:
|
||||
# - Clean working directory (no uncommitted changes)
|
||||
# - [Unreleased] section in CHANGELOG.md with content
|
||||
# - On development branch
|
||||
|
||||
set -e
|
||||
|
||||
VERSION=$1
|
||||
DATE=$(date +%Y-%m-%d)
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
error() { echo -e "${RED}ERROR: $1${NC}" >&2; exit 1; }
|
||||
warn() { echo -e "${YELLOW}WARNING: $1${NC}"; }
|
||||
success() { echo -e "${GREEN}$1${NC}"; }
|
||||
info() { echo -e "$1"; }
|
||||
|
||||
# Validate arguments
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Usage: ./scripts/release.sh X.Y.Z"
|
||||
echo ""
|
||||
echo "Example: ./scripts/release.sh 3.2.0"
|
||||
echo ""
|
||||
echo "This will:"
|
||||
echo " 1. Update CHANGELOG.md [Unreleased] -> [X.Y.Z] - $(date +%Y-%m-%d)"
|
||||
echo " 2. Update README.md title to vX.Y.Z"
|
||||
echo " 3. Update marketplace.json version to X.Y.Z"
|
||||
echo " 4. Commit with message 'chore: release vX.Y.Z'"
|
||||
echo " 5. Create git tag vX.Y.Z"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate version format
|
||||
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
error "Invalid version format. Use X.Y.Z (e.g., 3.2.0)"
|
||||
fi
|
||||
|
||||
# Check we're in the right directory
|
||||
if [ ! -f "CHANGELOG.md" ] || [ ! -f "README.md" ] || [ ! -f ".claude-plugin/marketplace.json" ]; then
|
||||
error "Must run from repository root (CHANGELOG.md, README.md, .claude-plugin/marketplace.json must exist)"
|
||||
fi
|
||||
|
||||
# Check for clean working directory
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
warn "Working directory has uncommitted changes"
|
||||
echo ""
|
||||
git status --short
|
||||
echo ""
|
||||
read -p "Continue anyway? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check current branch
|
||||
BRANCH=$(git branch --show-current)
|
||||
if [ "$BRANCH" != "development" ] && [ "$BRANCH" != "main" ]; then
|
||||
warn "Not on development or main branch (current: $BRANCH)"
|
||||
read -p "Continue anyway? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check [Unreleased] section has content
|
||||
if ! grep -q "## \[Unreleased\]" CHANGELOG.md; then
|
||||
error "CHANGELOG.md missing [Unreleased] section"
|
||||
fi
|
||||
|
||||
# Check if tag already exists
|
||||
if git tag -l | grep -q "^v$VERSION$"; then
|
||||
error "Tag v$VERSION already exists"
|
||||
fi
|
||||
|
||||
info ""
|
||||
info "=== Release v$VERSION ==="
|
||||
info ""
|
||||
|
||||
# Show what will change
|
||||
info "Changes to be made:"
|
||||
info " CHANGELOG.md: [Unreleased] -> [$VERSION] - $DATE"
|
||||
info " README.md: title -> v$VERSION"
|
||||
info " marketplace.json: version -> $VERSION"
|
||||
info " Git: commit + tag v$VERSION"
|
||||
info ""
|
||||
|
||||
# Preview CHANGELOG [Unreleased] content
|
||||
info "Current [Unreleased] content:"
|
||||
info "---"
|
||||
sed -n '/^## \[Unreleased\]/,/^## \[/p' CHANGELOG.md | head -30
|
||||
info "---"
|
||||
info ""
|
||||
|
||||
read -p "Proceed with release? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
info "Aborted"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
info ""
|
||||
info "Updating files..."
|
||||
|
||||
# 1. Update CHANGELOG.md
|
||||
# Replace [Unreleased] with [X.Y.Z] - DATE and add new [Unreleased] section
|
||||
sed -i "s/^## \[Unreleased\]$/## [Unreleased]\n\n*Changes staged for the next release*\n\n---\n\n## [$VERSION] - $DATE/" CHANGELOG.md
|
||||
|
||||
# Remove the placeholder text if it exists after the new [Unreleased]
|
||||
sed -i '/^\*Changes staged for the next release\*$/d' CHANGELOG.md
|
||||
|
||||
# Clean up any double blank lines
|
||||
sed -i '/^$/N;/^\n$/d' CHANGELOG.md
|
||||
|
||||
success " CHANGELOG.md updated"
|
||||
|
||||
# 2. Update README.md title
|
||||
sed -i "s/^# Leo Claude Marketplace - v[0-9]\+\.[0-9]\+\.[0-9]\+$/# Leo Claude Marketplace - v$VERSION/" README.md
|
||||
success " README.md updated"
|
||||
|
||||
# 3. Update marketplace.json version
|
||||
sed -i "s/\"version\": \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\": \"$VERSION\"/" .claude-plugin/marketplace.json
|
||||
success " marketplace.json updated"
|
||||
|
||||
info ""
|
||||
info "Files updated. Review changes:"
|
||||
info ""
|
||||
git diff --stat
|
||||
info ""
|
||||
git diff CHANGELOG.md | head -40
|
||||
info ""
|
||||
|
||||
read -p "Commit and tag? [y/N] " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
warn "Changes made but not committed. Run 'git checkout -- .' to revert."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Commit
|
||||
git add CHANGELOG.md README.md .claude-plugin/marketplace.json
|
||||
git commit -m "chore: release v$VERSION"
|
||||
success " Committed"
|
||||
|
||||
# Tag
|
||||
git tag "v$VERSION"
|
||||
success " Tagged v$VERSION"
|
||||
|
||||
info ""
|
||||
success "=== Release v$VERSION created ==="
|
||||
info ""
|
||||
info "Next steps:"
|
||||
info " 1. Review the commit: git show HEAD"
|
||||
info " 2. Push to remote: git push && git push --tags"
|
||||
info " 3. Merge to main if on development branch"
|
||||
info ""
|
||||
@@ -15,11 +15,11 @@ for f in $(find ~/.claude -name "hooks.json" 2>/dev/null); do
|
||||
fi
|
||||
done
|
||||
|
||||
# Check cache specifically
|
||||
# Note about cache (informational only - do NOT clear mid-session)
|
||||
if [ -d ~/.claude/plugins/cache/leo-claude-mktplace ]; then
|
||||
echo "❌ CACHE EXISTS: ~/.claude/plugins/cache/leo-claude-mktplace"
|
||||
echo " Run: rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/"
|
||||
FAILED=1
|
||||
echo "ℹ️ Cache exists: ~/.claude/plugins/cache/leo-claude-mktplace"
|
||||
echo " (This is normal - do NOT clear mid-session or MCP tools will break)"
|
||||
echo " To apply plugin changes: restart Claude Code session"
|
||||
fi
|
||||
|
||||
# Verify installed hooks are command type
|
||||
|
||||
Reference in New Issue
Block a user