refactor(projman): extract skills and consolidate commands
Major refactoring of projman plugin architecture: Skills Extraction (17 new files): - Extracted reusable knowledge from commands and agents into skills/ - branch-security, dependency-management, git-workflow, input-detection - issue-conventions, lessons-learned, mcp-tools-reference, planning-workflow - progress-tracking, repo-validation, review-checklist, runaway-detection - setup-workflows, sprint-approval, task-sizing, test-standards, wiki-conventions Command Consolidation (17 → 12 commands): - /setup: consolidates initial-setup, project-init, project-sync (--full/--quick/--sync) - /debug: consolidates debug-report, debug-review (report/review modes) - /test: consolidates test-check, test-gen (run/gen modes) - /sprint-status: absorbs sprint-diagram via --diagram flag Architecture Cleanup: - Remove plugin-level mcp-servers/ symlinks (6 plugins) - Remove plugin README.md files (12 files, ~2000 lines) - Update all documentation to reflect new command structure - Fix documentation drift in CONFIGURATION.md, COMMANDS-CHEATSHEET.md Commands are now thin dispatchers (~20-50 lines) that reference skills. Agents reference skills for domain knowledge instead of inline content. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,179 +2,52 @@
|
||||
description: Fetch and validate label taxonomy from Gitea, create missing required labels
|
||||
---
|
||||
|
||||
# Sync Label Taxonomy from Gitea
|
||||
# Sync Label Taxonomy
|
||||
|
||||
This command fetches the current label taxonomy from Gitea (organization + repository labels), validates that required labels exist, and creates any missing ones.
|
||||
## Skills Required
|
||||
|
||||
## CRITICAL: Execution Steps
|
||||
- skills/mcp-tools-reference.md
|
||||
- skills/repo-validation.md
|
||||
- skills/label-taxonomy/labels-reference.md
|
||||
|
||||
You MUST follow these steps in order. Do NOT skip any step.
|
||||
## Purpose
|
||||
|
||||
### Step 1: Detect Repository from Git Remote
|
||||
Fetch current label taxonomy from Gitea, validate required labels exist, and create any missing ones.
|
||||
|
||||
Run this Bash command to get the git remote URL:
|
||||
## Invocation
|
||||
|
||||
```bash
|
||||
git remote get-url origin
|
||||
```
|
||||
Run `/labels-sync` when setting up the plugin or after taxonomy updates.
|
||||
|
||||
Parse the output to extract `owner/repo`:
|
||||
- SSH format `ssh://git@host:port/owner/repo.git` → extract `owner/repo`
|
||||
- SSH short `git@host:owner/repo.git` → extract `owner/repo`
|
||||
- HTTPS `https://host/owner/repo.git` → extract `owner/repo`
|
||||
## Workflow
|
||||
|
||||
Store this as `REPO_NAME` for all subsequent MCP calls.
|
||||
1. **Detect Repository** - Parse `git remote get-url origin` to get `owner/repo`
|
||||
2. **Validate Repository** - Use `validate_repo_org` to check if org-owned
|
||||
3. **Fetch Labels** - Use `get_labels(repo=...)` to get org + repo labels
|
||||
4. **Display Taxonomy** - Show labels grouped by category
|
||||
5. **Check Required Labels** - Verify Type/*, Priority/*, Complexity/*, Effort/* exist
|
||||
6. **Create Missing** - Use `create_label_smart` which auto-detects org vs repo level
|
||||
7. **Report Results** - Summarize what was found and created
|
||||
|
||||
### Step 2: Validate Repository Organization
|
||||
## Required Label Categories
|
||||
|
||||
Call MCP tool with the detected repo:
|
||||
|
||||
```
|
||||
mcp__plugin_projman_gitea__validate_repo_org(repo=REPO_NAME)
|
||||
```
|
||||
|
||||
This determines if the owner is an organization or user account.
|
||||
|
||||
### Step 3: Fetch Labels from Gitea
|
||||
|
||||
Call MCP tool with the detected repo:
|
||||
|
||||
```
|
||||
mcp__plugin_projman_gitea__get_labels(repo=REPO_NAME)
|
||||
```
|
||||
|
||||
This returns both organization labels (if org-owned) and repository labels.
|
||||
|
||||
### Step 4: Display Current Taxonomy
|
||||
|
||||
Show the user:
|
||||
- Total organization labels count
|
||||
- Total repository labels count
|
||||
- Labels grouped by category (Type/*, Priority/*, etc.)
|
||||
|
||||
### Step 5: Check Required Labels
|
||||
|
||||
Verify these required label categories exist:
|
||||
- **Type/***: Bug, Feature, Refactor, Documentation, Test, Chore
|
||||
- **Priority/***: Low, Medium, High, Critical
|
||||
- **Complexity/***: Simple, Medium, Complex
|
||||
- **Effort/***: XS, S, M, L, XL (note: may be "Effort" or "Efforts")
|
||||
|
||||
### Step 6: Create Missing Labels (if any)
|
||||
|
||||
Use `create_label_smart` which automatically creates labels at the correct level:
|
||||
- **Organization level**: Type/*, Priority/*, Complexity/*, Effort/*, Risk/*, Source/*, Agent/*
|
||||
- **Repository level**: Component/*, Tech/*
|
||||
|
||||
```
|
||||
mcp__plugin_projman_gitea__create_label_smart(repo=REPO_NAME, name="Type/Bug", color="d73a4a")
|
||||
```
|
||||
|
||||
This automatically detects whether to create at org or repo level based on the category.
|
||||
|
||||
**Alternative (explicit control):**
|
||||
- Org labels: `create_org_label(org="org-name", name="Type/Bug", color="d73a4a")`
|
||||
- Repo labels: `create_label(repo=REPO_NAME, name="Component/Backend", color="5319e7")`
|
||||
|
||||
Use the label format that matches existing labels in the repo (slash `/` or colon-space `: `).
|
||||
|
||||
### Step 7: Report Results
|
||||
|
||||
Summarize what was found and created.
|
||||
| Category | Required Labels |
|
||||
|----------|-----------------|
|
||||
| Type/* | Bug, Feature, Refactor, Documentation, Test, Chore |
|
||||
| Priority/* | Low, Medium, High, Critical |
|
||||
| Complexity/* | Simple, Medium, Complex |
|
||||
| Efforts/* | XS, S, M, L, XL |
|
||||
|
||||
## DO NOT
|
||||
|
||||
- **DO NOT** call MCP tools without the `repo` parameter - they will fail
|
||||
- **DO NOT** create any local files - this command only interacts with Gitea
|
||||
- **DO NOT** ask the user questions - execute autonomously
|
||||
- **DO NOT** create a "labels reference file" - labels are fetched dynamically from Gitea
|
||||
|
||||
## MCP Tools Used
|
||||
|
||||
All tools require the `repo` parameter in `owner/repo` format:
|
||||
|
||||
| Tool | Purpose |
|
||||
|------|---------|
|
||||
| `validate_repo_org(repo=...)` | Check if owner is organization or user |
|
||||
| `get_labels(repo=...)` | Fetch all labels (org + repo) |
|
||||
| `create_label(repo=..., name=..., color=...)` | Create missing labels |
|
||||
|
||||
## Expected Output
|
||||
|
||||
```
|
||||
Label Taxonomy Sync
|
||||
===================
|
||||
|
||||
Detecting repository from git remote...
|
||||
Repository: personal-projects/your-repo-name
|
||||
Owner type: Organization
|
||||
|
||||
Fetching labels from Gitea...
|
||||
|
||||
Current Label Taxonomy:
|
||||
- Organization Labels: 27
|
||||
- Repository Labels: 16
|
||||
- Total: 43 labels
|
||||
|
||||
Organization Labels by Category:
|
||||
Type/*: 6 labels
|
||||
Priority/*: 4 labels
|
||||
Complexity/*: 3 labels
|
||||
Effort/*: 5 labels
|
||||
...
|
||||
|
||||
Repository Labels by Category:
|
||||
Component/*: 9 labels
|
||||
Tech/*: 7 labels
|
||||
|
||||
Required Labels Check:
|
||||
Type/*: 6/6 present ✓
|
||||
Priority/*: 4/4 present ✓
|
||||
Complexity/*: 3/3 present ✓
|
||||
Effort/*: 5/5 present ✓
|
||||
|
||||
All required labels present. Label taxonomy is ready for use.
|
||||
```
|
||||
|
||||
## Label Format Detection
|
||||
|
||||
Labels may use different naming conventions:
|
||||
- Slash format: `Type/Bug`, `Priority/High`
|
||||
- Colon-space format: `Type: Bug`, `Priority: High`
|
||||
|
||||
When creating missing labels, match the format used by existing labels in the repository.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Error: Use 'owner/repo' format**
|
||||
- You forgot to pass the `repo` parameter to the MCP tool
|
||||
- Go back to Step 1 and detect the repo from git remote
|
||||
|
||||
**Empty organization labels**
|
||||
- If owner is a user account (not org), organization labels will be empty
|
||||
- This is expected - user accounts only have repository-level labels
|
||||
|
||||
**Git remote not found**
|
||||
- Ensure you're running in a directory with a git repository
|
||||
- Check that the `origin` remote is configured
|
||||
- Call MCP tools without the `repo` parameter
|
||||
- Create local files - this command only interacts with Gitea
|
||||
- Ask user questions - execute autonomously
|
||||
|
||||
## Visual Output
|
||||
|
||||
When executing this command, display the plugin header:
|
||||
|
||||
```
|
||||
╔══════════════════════════════════════════════════════════════════╗
|
||||
║ 📋 PROJMAN ║
|
||||
║ Labels Sync ║
|
||||
╚══════════════════════════════════════════════════════════════════╝
|
||||
```
|
||||
|
||||
Then proceed with the sync workflow.
|
||||
|
||||
## When to Run
|
||||
|
||||
Run `/labels-sync` when:
|
||||
- Setting up the plugin for the first time
|
||||
- You notice missing labels in suggestions
|
||||
- New labels are added to Gitea
|
||||
- After major taxonomy updates
|
||||
|
||||
Reference in New Issue
Block a user