From 70d6963d0dfdde912a2d83c56a219f567d47e670 Mon Sep 17 00:00:00 2001 From: lmiranda Date: Sat, 24 Jan 2026 12:18:57 -0500 Subject: [PATCH 1/3] fix(cmdb-assistant): complete MCP tool schemas for update operations Expand parameter schemas for 15 update tools that previously only exposed the 'id' field. The underlying Python implementation already supported all fields via **kwargs, but Claude couldn't discover available parameters. Updated tools: - virtualization: update_virtual_machine, update_cluster - dcim: update_site, update_location, update_rack, update_manufacturer, update_device_type, update_device_role, update_platform, update_interface, update_cable - ipam: update_vrf, update_prefix, update_ip_address, update_vlan Each tool now exposes all commonly-used optional fields matching the NetBox API, following the pattern established by dcim_update_device. Fixes #137 Co-Authored-By: Claude Opus 4.5 --- mcp-servers/netbox/mcp_server/server.py | 174 ++++++++++++++++++++++-- 1 file changed, 159 insertions(+), 15 deletions(-) diff --git a/mcp-servers/netbox/mcp_server/server.py b/mcp-servers/netbox/mcp_server/server.py index 8170cc1..a91109f 100644 --- a/mcp-servers/netbox/mcp_server/server.py +++ b/mcp-servers/netbox/mcp_server/server.py @@ -103,7 +103,19 @@ TOOL_DEFINITIONS = { 'properties': { 'id': {'type': 'integer', 'description': 'Site ID'}, 'name': {'type': 'string', 'description': 'New name'}, - 'status': {'type': 'string', 'description': 'New status'} + 'slug': {'type': 'string', 'description': 'New slug'}, + 'status': {'type': 'string', 'description': 'Status'}, + 'region': {'type': 'integer', 'description': 'Region ID'}, + 'group': {'type': 'integer', 'description': 'Site group ID'}, + 'tenant': {'type': 'integer', 'description': 'Tenant ID'}, + 'facility': {'type': 'string', 'description': 'Facility name'}, + 'time_zone': {'type': 'string', 'description': 'Time zone'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'physical_address': {'type': 'string', 'description': 'Physical address'}, + 'shipping_address': {'type': 'string', 'description': 'Shipping address'}, + 'latitude': {'type': 'number', 'description': 'Latitude'}, + 'longitude': {'type': 'number', 'description': 'Longitude'}, + 'comments': {'type': 'string', 'description': 'Comments'} }, 'required': ['id'] }, @@ -136,7 +148,14 @@ TOOL_DEFINITIONS = { }, 'dcim_update_location': { 'description': 'Update an existing location', - 'properties': {'id': {'type': 'integer', 'description': 'Location ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Location ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'slug': {'type': 'string', 'description': 'New slug'}, + 'site': {'type': 'integer', 'description': 'Site ID'}, + 'parent': {'type': 'integer', 'description': 'Parent location ID'}, + 'description': {'type': 'string', 'description': 'Description'} + }, 'required': ['id'] }, 'dcim_delete_location': { @@ -171,7 +190,18 @@ TOOL_DEFINITIONS = { }, 'dcim_update_rack': { 'description': 'Update an existing rack', - 'properties': {'id': {'type': 'integer', 'description': 'Rack ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Rack ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'site': {'type': 'integer', 'description': 'Site ID'}, + 'location': {'type': 'integer', 'description': 'Location ID'}, + 'status': {'type': 'string', 'description': 'Status'}, + 'role': {'type': 'integer', 'description': 'Role ID'}, + 'tenant': {'type': 'integer', 'description': 'Tenant ID'}, + 'u_height': {'type': 'integer', 'description': 'Rack height in U'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'comments': {'type': 'string', 'description': 'Comments'} + }, 'required': ['id'] }, 'dcim_delete_rack': { @@ -198,7 +228,12 @@ TOOL_DEFINITIONS = { }, 'dcim_update_manufacturer': { 'description': 'Update an existing manufacturer', - 'properties': {'id': {'type': 'integer', 'description': 'Manufacturer ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Manufacturer ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'slug': {'type': 'string', 'description': 'New slug'}, + 'description': {'type': 'string', 'description': 'Description'} + }, 'required': ['id'] }, 'dcim_delete_manufacturer': { @@ -230,7 +265,16 @@ TOOL_DEFINITIONS = { }, 'dcim_update_device_type': { 'description': 'Update an existing device type', - 'properties': {'id': {'type': 'integer', 'description': 'Device type ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Device type ID'}, + 'manufacturer': {'type': 'integer', 'description': 'Manufacturer ID'}, + 'model': {'type': 'string', 'description': 'Model name'}, + 'slug': {'type': 'string', 'description': 'New slug'}, + 'u_height': {'type': 'number', 'description': 'Height in rack units'}, + 'is_full_depth': {'type': 'boolean', 'description': 'Is full depth'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'comments': {'type': 'string', 'description': 'Comments'} + }, 'required': ['id'] }, 'dcim_delete_device_type': { @@ -259,7 +303,14 @@ TOOL_DEFINITIONS = { }, 'dcim_update_device_role': { 'description': 'Update an existing device role', - 'properties': {'id': {'type': 'integer', 'description': 'Device role ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Device role ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'slug': {'type': 'string', 'description': 'New slug'}, + 'color': {'type': 'string', 'description': 'Hex color code'}, + 'vm_role': {'type': 'boolean', 'description': 'Can be assigned to VMs'}, + 'description': {'type': 'string', 'description': 'Description'} + }, 'required': ['id'] }, 'dcim_delete_device_role': { @@ -290,7 +341,13 @@ TOOL_DEFINITIONS = { }, 'dcim_update_platform': { 'description': 'Update an existing platform', - 'properties': {'id': {'type': 'integer', 'description': 'Platform ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Platform ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'slug': {'type': 'string', 'description': 'New slug'}, + 'manufacturer': {'type': 'integer', 'description': 'Manufacturer ID'}, + 'description': {'type': 'string', 'description': 'Description'} + }, 'required': ['id'] }, 'dcim_delete_platform': { @@ -386,7 +443,18 @@ TOOL_DEFINITIONS = { }, 'dcim_update_interface': { 'description': 'Update an existing interface', - 'properties': {'id': {'type': 'integer', 'description': 'Interface ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Interface ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'type': {'type': 'string', 'description': 'Interface type'}, + 'enabled': {'type': 'boolean', 'description': 'Interface enabled'}, + 'mtu': {'type': 'integer', 'description': 'MTU'}, + 'mac_address': {'type': 'string', 'description': 'MAC address'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'mode': {'type': 'string', 'description': 'VLAN mode'}, + 'untagged_vlan': {'type': 'integer', 'description': 'Untagged VLAN ID'}, + 'tagged_vlans': {'type': 'array', 'description': 'Tagged VLAN IDs'} + }, 'required': ['id'] }, 'dcim_delete_interface': { @@ -420,7 +488,15 @@ TOOL_DEFINITIONS = { }, 'dcim_update_cable': { 'description': 'Update an existing cable', - 'properties': {'id': {'type': 'integer', 'description': 'Cable ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Cable ID'}, + 'type': {'type': 'string', 'description': 'Cable type'}, + 'status': {'type': 'string', 'description': 'Cable status'}, + 'label': {'type': 'string', 'description': 'Cable label'}, + 'color': {'type': 'string', 'description': 'Cable color'}, + 'length': {'type': 'number', 'description': 'Cable length'}, + 'length_unit': {'type': 'string', 'description': 'Length unit'} + }, 'required': ['id'] }, 'dcim_delete_cable': { @@ -508,7 +584,15 @@ TOOL_DEFINITIONS = { }, 'ipam_update_vrf': { 'description': 'Update an existing VRF', - 'properties': {'id': {'type': 'integer', 'description': 'VRF ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'VRF ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'rd': {'type': 'string', 'description': 'Route distinguisher'}, + 'tenant': {'type': 'integer', 'description': 'Tenant ID'}, + 'enforce_unique': {'type': 'boolean', 'description': 'Enforce unique IPs'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'comments': {'type': 'string', 'description': 'Comments'} + }, 'required': ['id'] }, 'ipam_delete_vrf': { @@ -547,7 +631,19 @@ TOOL_DEFINITIONS = { }, 'ipam_update_prefix': { 'description': 'Update an existing prefix', - 'properties': {'id': {'type': 'integer', 'description': 'Prefix ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Prefix ID'}, + 'prefix': {'type': 'string', 'description': 'Prefix in CIDR notation'}, + 'status': {'type': 'string', 'description': 'Status'}, + 'site': {'type': 'integer', 'description': 'Site ID'}, + 'vrf': {'type': 'integer', 'description': 'VRF ID'}, + 'vlan': {'type': 'integer', 'description': 'VLAN ID'}, + 'role': {'type': 'integer', 'description': 'Role ID'}, + 'tenant': {'type': 'integer', 'description': 'Tenant ID'}, + 'is_pool': {'type': 'boolean', 'description': 'Is a pool'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'comments': {'type': 'string', 'description': 'Comments'} + }, 'required': ['id'] }, 'ipam_delete_prefix': { @@ -598,7 +694,18 @@ TOOL_DEFINITIONS = { }, 'ipam_update_ip_address': { 'description': 'Update an existing IP address', - 'properties': {'id': {'type': 'integer', 'description': 'IP address ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'IP address ID'}, + 'address': {'type': 'string', 'description': 'IP address with prefix length'}, + 'status': {'type': 'string', 'description': 'Status'}, + 'vrf': {'type': 'integer', 'description': 'VRF ID'}, + 'tenant': {'type': 'integer', 'description': 'Tenant ID'}, + 'dns_name': {'type': 'string', 'description': 'DNS name'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'comments': {'type': 'string', 'description': 'Comments'}, + 'assigned_object_type': {'type': 'string', 'description': 'Object type to assign to'}, + 'assigned_object_id': {'type': 'integer', 'description': 'Object ID to assign to'} + }, 'required': ['id'] }, 'ipam_delete_ip_address': { @@ -663,7 +770,18 @@ TOOL_DEFINITIONS = { }, 'ipam_update_vlan': { 'description': 'Update an existing VLAN', - 'properties': {'id': {'type': 'integer', 'description': 'VLAN ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'VLAN ID'}, + 'vid': {'type': 'integer', 'description': 'VLAN ID number'}, + 'name': {'type': 'string', 'description': 'VLAN name'}, + 'status': {'type': 'string', 'description': 'Status'}, + 'site': {'type': 'integer', 'description': 'Site ID'}, + 'group': {'type': 'integer', 'description': 'VLAN group ID'}, + 'tenant': {'type': 'integer', 'description': 'Tenant ID'}, + 'role': {'type': 'integer', 'description': 'Role ID'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'comments': {'type': 'string', 'description': 'Comments'} + }, 'required': ['id'] }, 'ipam_delete_vlan': { @@ -909,7 +1027,17 @@ TOOL_DEFINITIONS = { }, 'virtualization_update_cluster': { 'description': 'Update an existing cluster', - 'properties': {'id': {'type': 'integer', 'description': 'Cluster ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'Cluster ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'type': {'type': 'integer', 'description': 'Cluster type ID'}, + 'group': {'type': 'integer', 'description': 'Cluster group ID'}, + 'site': {'type': 'integer', 'description': 'Site ID'}, + 'status': {'type': 'string', 'description': 'Status'}, + 'tenant': {'type': 'integer', 'description': 'Tenant ID'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'comments': {'type': 'string', 'description': 'Comments'} + }, 'required': ['id'] }, 'virtualization_delete_cluster': { @@ -946,7 +1074,23 @@ TOOL_DEFINITIONS = { }, 'virtualization_update_virtual_machine': { 'description': 'Update an existing virtual machine', - 'properties': {'id': {'type': 'integer', 'description': 'VM ID'}}, + 'properties': { + 'id': {'type': 'integer', 'description': 'VM ID'}, + 'name': {'type': 'string', 'description': 'New name'}, + 'status': {'type': 'string', 'description': 'Status'}, + 'cluster': {'type': 'integer', 'description': 'Cluster ID'}, + 'site': {'type': 'integer', 'description': 'Site ID'}, + 'role': {'type': 'integer', 'description': 'Role ID'}, + 'tenant': {'type': 'integer', 'description': 'Tenant ID'}, + 'platform': {'type': 'integer', 'description': 'Platform ID'}, + 'vcpus': {'type': 'number', 'description': 'Number of vCPUs'}, + 'memory': {'type': 'integer', 'description': 'Memory in MB'}, + 'disk': {'type': 'integer', 'description': 'Disk in GB'}, + 'primary_ip4': {'type': 'integer', 'description': 'Primary IPv4 address ID'}, + 'primary_ip6': {'type': 'integer', 'description': 'Primary IPv6 address ID'}, + 'description': {'type': 'string', 'description': 'Description'}, + 'comments': {'type': 'string', 'description': 'Comments'} + }, 'required': ['id'] }, 'virtualization_delete_virtual_machine': { From 8c85f9ca5f5418815859a82b6bbe7d7df8001f1b Mon Sep 17 00:00:00 2001 From: lmiranda Date: Sat, 24 Jan 2026 12:26:08 -0500 Subject: [PATCH 2/3] chore: remove unreleased v3.1.2 changelog entry Tag v3.1.2 was never created. Remove the changelog entry to avoid confusion between documented and actual releases. Co-Authored-By: Claude Opus 4.5 --- CHANGELOG.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2d52fa..996f66e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,32 +4,6 @@ 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 - -### 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 - -### Changed -- **doc-guardian:** Hook switched from `prompt` type to `command` type - - Prompt hooks unreliable - Claude ignores explicit instructions - - 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 - - Simplified output formats with word limits - - Consistent structure across projman, pr-review, code-sentinel, doc-guardian - -### 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) - ---- - ## [3.1.1] - 2026-01-22 ### Added From fe36ed91f28b6b4b2380b4fc00c3b8fda803c541 Mon Sep 17 00:00:00 2001 From: lmiranda Date: Sat, 24 Jan 2026 12:30:37 -0500 Subject: [PATCH 3/3] feat(projman): add user-reported issue mode to /debug-report Adds a new "user-reported" mode alongside the existing automated diagnostics mode. Users can now choose to: 1. Run automated diagnostics (existing behavior) 2. Report an issue they experienced while using any plugin command User-reported mode: - Step 0: Mode selection via AskUserQuestion - Step 0.1: Structured feedback gathering - Which plugin/command was affected - What the user was trying to do - What went wrong (error, missing feature, unexpected behavior, docs) - Expected vs actual behavior - Any workarounds found - Step 5.1: Smart label generation based on problem type - Step 6.1: User-friendly issue template with investigation hints This allows capturing UX issues, missing features, and documentation problems that wouldn't be caught by automated MCP tool tests. Fixes #139 Co-Authored-By: Claude Opus 4.5 --- plugins/projman/commands/debug-report.md | 320 ++++++++++++++++++++--- 1 file changed, 288 insertions(+), 32 deletions(-) diff --git a/plugins/projman/commands/debug-report.md b/plugins/projman/commands/debug-report.md index c8146bf..b1297f4 100644 --- a/plugins/projman/commands/debug-report.md +++ b/plugins/projman/commands/debug-report.md @@ -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