You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skills Audit: Worktree Compatibility, Branch Workflow, and MCP Requirements - Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.
Goal: Update the Superpowers skills system to enforce worktree compatibility, establish a 3-branch workflow default, and gate spec/plan creation on MCP availability.
Architecture: Add branch workflow detection and configuration parsing to platform-detection and using-superpowers. Add MCP availability gates to brainstorming and writing-plans skills. Add worktree compatibility filtering to using-git-worktrees. Enforce branch workflow across all git-touching skills. Migrate existing file-based specs/plans to issues.
Goal: Detect production branch from git remote metadata and create integration branch if missing.
Step 1: Add branch detection section to platform-detection.md
Add after the existing "Label Requirements" section (line ~72):
## Branch Workflow Detection**Automatic at session start:**
The plugin detects and configures the branch workflow:
1.**Detect production branch:**```bash# Try origin/HEAD first
PRODUCTION_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD 2>/dev/null | sed 's|origin/||')# Fallback to common namesif [ -z"$PRODUCTION_BRANCH" ];thenforbranchin main master;doif git show-ref --verify --quiet refs/remotes/origin/$branch;then
PRODUCTION_BRANCH=$branchbreakfidonefi
If production branch cannot be detected:
Halt session with error: "Cannot detect production branch. Set origin/HEAD with: git remote set-head origin <your-main-branch>"
Suggest adding branch-workflow: feature|dev|<branch> to CLAUDE.md or AGENTS.md
Read branch-workflow configuration:
Parse CLAUDE.md/AGENTS.md for branch-workflow: <prefix>|<integration>|<production>
Goal: Migrate existing file-based specs and plans to GitHub/GitBucket issues on session start.
Step 1: Add migration section to platform-detection.md
Add after the new "Branch Workflow Detection" section:
## File Migration to Issues**On session start (after platform detected):**
If GitHub or GitBucket MCP available:
1.**Discover existing files:**```bash
find docs/superpowers/specs -name "*.md" -type f 2>/dev/null
find docs/superpowers/plans -name "*.md" -type f 2>/dev/null
For each spec file:
If GIT_PLATFORM=github:
- Parse title from first `# ` header
- Use github_issue_write with:
- title: `[Spec] <parsed-title>`- body: File content + "\n\nMigrated from: `docs/superpowers/specs/<filename>.md`"
- labels: spec
If GIT_PLATFORM=gitbucket:
- Parse title from first `# ` header
- Use gitbucket_create_issue with:
- title: `[Spec] <parsed-title>`- body: File content + "\n\nMigrated from: `docs/superpowers/specs/<filename>.md`"
- labels: spec
For each plan file:
If GIT_PLATFORM=github:
- Parse title from first `# ` header
- Use github_issue_write with:
- title: `[Plan] <parsed-title>`- body: File content + "\n\nMigrated from: `docs/superpowers/plans/<filename>.md`"
- labels: plan
If GIT_PLATFORM=gitbucket:
- Parse title from first `# ` header
- Use gitbucket_create_issue with:
- title: `[Plan] <parsed-title>`- body: File content + "\n\nMigrated from: `docs/superpowers/plans/<filename>.md`"
- labels: plan
On successful issue creation:
# Create archive directory if missing
mkdir -p docs/superpowers/archive
# Move file to archive
mv docs/superpowers/specs/<filename>.md docs/superpowers/archive/<filename>.md
**Three-branch workflow (default):**
- Feature branches branch from integration branch (`dev`)
- Feature branches merge/PR back to integration branch
- Integration branch eventually merges to production branch
**Two-branch workflow (when configured):**
- Feature branches branch from production branch
- Feature branches merge/PR back to production branch
### Overriding Default
Users can override in CLAUDE.md or AGENTS.md:
```markdown
## Superpowers Configuration
branch-workflow: feature|dev|newsrx
Format: <prefix>|<integration>|<production>
Skill Integration Pattern
When creating a feature branch:
1. Read GIT_INTEGRATION_BRANCH from <GIT_CONTEXT>
2. Use it as base: `git worktree add .worktrees/feature-name -b feature-name $INTEGRATION_BRANCH`
When merging/PR:
1. Read GIT_INTEGRATION_BRANCH from <GIT_CONTEXT>
2. Use it as target: `git checkout $INTEGRATION_BRANCH && git merge feature-name`3. Or create PR against $INTEGRATION_BRANCH
When referencing branches in issues:
- Spec: "Feature will integrate into `<integration-branch>` branch"
- PR: Create PR against integration branch (not production)
Skills That Must Enforce
All git-touching skills must read and respect branch workflow:
using-git-worktrees - Creates feature branch from integration branch
finishing-a-development-branch - Merges/PRs to integration branch
brainstorming - References correct base branch in spec
writing-plans - Links plan to spec with correct branches
subagent-driven-development - Reports branch status with workflow context
executing-plans - Merges work to correct integration branch
- [ ] **Step 2: Update existing platform detection reference**
The existing "Platform Detection" section references `../platform-detection.md`. Add a note that this file also configures branch workflow:
```markdown
## Platform Detection
Skills that interact with issue tracking, specs, and plans must detect which platform is available and adapt accordingly.
See `../platform-detection.md` for details on:
- Platform detection (GitHub vs GitBucket)
- Branch workflow detection and configuration
- File migration logic
Goal: Filter incompatible tools when using worktrees.
Step 1: Add worktree compatibility section
Add new section after "Integration" section (line ~209):
## Worktree Compatibility Guard**When using worktrees:**
Some MCP tools expect a single workspace and don't work correctly with worktrees.
### Compatible Tools**These tools work in worktrees:**- Git commands (worktree-aware, operate on `.git` directory)
- File editors (Read, Write, Edit, Bash)
- Language servers (operate per-file)
- GitHub MCP tools (API-based, directory-agnostic)
- GitBucket MCP tools (API-based, directory-agnostic)
### Incompatible Tools (Workspace-Level State)**These tools expect single workspace:**- PyCharm MCP - opens project workspace, expects single `.idea` config
- IDE tools that open projects (VSCode extensions, IntelliJ tools)
- Any tool maintaining workspace-level sessions or caches
### Detection and Filtering**Before creating worktree:**```markdown
Check available MCP tools in session:
- If PyCharm_* tools detected → WARN and SKIP these tools
- If any tool with open_workspace, load_project patterns → WARN and SKIP
**Warning message:**
PyCharm MCP tools detected but incompatible with worktrees.
Continuing with Git/File/GitHub/GitBucket tools only. IDE features will not be available in worktree.
Proceeding with worktree creation...
After worktree created:
Report compatibility status:
Worktree ready at
Using: Git, File, GitHub/GitBucket MCP tools
Skipped: PyCharm MCP (incompatible with worktrees)
For IDE features, use main workspace at
Implementation
In platform-detection.md, inject tool compatibility into <GIT_CONTEXT>:
Skills check this before using worktrees and filter tool usage accordingly.
Why Not Block
Incompatible tools are filtered, not blocked:
Blocking halts work unnecessarily
Many workflows succeed with Git/File tools alone
Dev can still use IDE features in main workspace
Clear messaging informs dev of limitations
Proceed with partial functionality vs. Stop everything.
- [ ] **Step 2: Verify all sections reference the filtering correctly**
Read through the skill to ensure the compatibility guard is mentioned where needed:
"Integration" section should mention this is called by other skills
Creation steps should reference compatibility check
**Create Spec Issue (REQUIRED):**
Specs are stored as GitHub/GitBucket issues. No local file storage.
**MCP Availability Gate (BEFORE creating issue):**
Check `<GIT_CONTEXT>` for MCP availability:
If GIT_PLATFORM=github:
GitHub MCP available → Proceed with github_issue_write
If GIT_PLATFORM=gitbucket:
If GITBUCKET_HAS_CREDENTIALS=false:
STOP. Tell user: "GitBucket credentials required. Set GITBUCKET_URL and GITBUCKET_TOKEN in .env, then restart session."
Do not proceed until credentials configured.
GitBucket MCP available → Proceed with gitbucket_create_issue
If GIT_PLATFORM=unknown:
STOP. Tell user:
FATAL: Cannot create spec - no issue tracking available
Specs and plans must be tracked in GitHub/GitBucket issues for:
- Persistent storage
- Team visibility
- Progress tracking
Options:
1. Add GitHub remote: git remote add origin https://github.com/user/repo.git
2. Add GitBucket credentials to .env (GITBUCKET_URL, GITBUCKET_TOKEN)
3. Restart session to re-detect platform
Cannot proceed without issue tracking.
Do not proceed until platform is configured.
**Create Issue (after gate passes):**
```markdown
If GIT_PLATFORM=github:
Use github_issue_write with:
- method: "create"
- title: [Spec] <topic>
- body: Full design specification (all sections, complete content)
- labels: spec, plus relevant feature labels
If GIT_PLATFORM=gitbucket:
Use gitbucket_create_issue with:
- title: [Spec] <topic>
- body: Full design specification (all sections, complete content)
- labels: spec, plus relevant feature labels
Why Halt Instead of Fallback:
File-based specs are not acceptable because:
No team visibility
No persistent tracking
Lost on developer machine
No integration with workflow
MCP availability is a hard requirement. Halt with clear remediation steps.
- [ ] **Step 2: Verify the gate appears before any spec creation logic**
Read through to ensure the gate check happens before `github_issue_write` or `gitbucket_create_issue`:
The MCP availability check should be the FIRST thing in this section.
Goal: Gate plan creation on MCP availability, halt if unavailable.
Step 1: Update the "After the Plan" section
Replace the existing "Create Plan Issue" subsection (lines ~125-155) with:
## After the Plan**Create Plan Issue (REQUIRED):**
Plans are stored as GitHub/GitBucket issues. No local file storage.
**MCP Availability Gate (BEFORE creating issue):**
Check `GIT_PLATFORM` in your session context (`<GIT_CONTEXT>` block):
- If `GIT_PLATFORM=github`:
- GitHub MCP available → Proceed with github_issue_write
- Else if `GIT_PLATFORM=gitbucket`:
```markdown
Check GITBUCKET_HAS_CREDENTIALS:
- If false: STOP. Tell user "GitBucket credentials required. Set GITBUCKET_URL and GITBUCKET_TOKEN in .env, then restart session."
- If true: Proceed with gitbucket_create_issue
Else (unknown):
STOP. Tell user:
FATAL: Cannot create plan - no issue tracking available
Plans must be tracked in GitHub/GitBucket issues for:
Add GitBucket credentials to .env (GITBUCKET_URL, GITBUCKET_TOKEN)
Restart session to re-detect platform
Cannot proceed without issue tracking.
Create Plan Issue (after gate passes):
The issue body should contain the complete plan with:
All tasks
All steps
Complete code blocks
Use the following:
If GitHub:
Use github_issue_write with:
- method: "create"
- title: [Plan] <feature-name> Implementation
- body: Full implementation plan (all sections, complete content)
- labels: plan
If GitBucket:
Use gitbucket_create_issue with:
- title: [Plan] <feature-name> Implementation
- body: Full implementation plan (all sections, complete content)
- labels: plan
Link to Spec Issue:
Comment on the spec issue to link this plan:
If GitHub: github_add_issue_comment(spec_issue_number, "Implementation plan: #<plan_issue_number>")
If GitBucket: gitbucket_add_issue_comment(spec_issue_number, "Implementation plan: #<plan_issue_number>")
No Local File Storage:
Plans are NOT stored in docs/superpowers/plans/. They live only as issues.
Why Halt Instead of Fallback:
File-based plans are not acceptable because:
No team visibility
No persistent tracking
Lost on developer machine
No integration with workflow
MCP availability is a hard requirement. Halt with clear remediation steps.
- [ ] **Step 2: Verify the gate appears before plan creation**
Read through to ensure:
Gate check before github_issue_write or gitbucket_create_issue
No mention of local file storage (docs/superpowers/plans/)
# Use integration branch as target for feature work
INTEGRATION_BRANCH=$(grep GIT_INTEGRATION_BRANCH <<<"$GIT_CONTEXT"| cut -d= -f2)# Verify branch exists
git show-ref --verify --quiet refs/heads/$INTEGRATION_BRANCH# Or detect from git if not in contextif [ -z"$INTEGRATION_BRANCH" ];then# Check for dev branchif git show-ref --verify --quiet refs/heads/dev;then
INTEGRATION_BRANCH="dev"else# Fallback to production branch
INTEGRATION_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD | sed 's|origin/||')fifi
Ask if unclear:
This branch appears to integrate into '$INTEGRATION_BRANCH'. Is that correct?
1. Yes, merge to $INTEGRATION_BRANCH
2. No, merge to different branch (specify)
Which option?
Step 3: Present Options
Present exactly these 4 options:
Implementation complete. What would you like to do?
1. Merge back to <integration-branch> locally
2. Push and create a Pull Request against <integration-branch>
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?
Don't add explanation - keep options concise.
- [ ] **Step 2: Update "Merge Locally" and "Push and Create PR" sections**
Update line ~70 (Option 1: Merge Locally):
```markdown
#### Option 1: Merge Locally
```bash
# Switch to integration branch
git checkout $INTEGRATION_BRANCH
# Pull latest
git pull
# Merge feature branch
git merge <feature-branch>
# Verify tests on merged result
<test command>
# If tests pass
git branch -d <feature-branch>
Then: Cleanup worktree (Step 5)
Update line ~89 (Option 2: Push and Create PR):
```markdown
#### Option 2: Push and Create PR
```bash
# Push branch
git push -u origin <feature-branch>
# Create PR against integration branch
gh pr create --base $INTEGRATION_BRANCH --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"
Then: Cleanup worktree (Step 5)
- [ ] **Step 3: Verify all git operations use integration branch**
Read through the entire skill to ensure:
Integration branch is used for checkout, merge, and PR base
Production branch is NOT used for feature work
Branch workflow is documented in integration section
Skills Audit: Worktree Compatibility, Branch Workflow, and MCP Requirements - Implementation Plan
Goal: Update the Superpowers skills system to enforce worktree compatibility, establish a 3-branch workflow default, and gate spec/plan creation on MCP availability.
Architecture: Add branch workflow detection and configuration parsing to platform-detection and using-superpowers. Add MCP availability gates to brainstorming and writing-plans skills. Add worktree compatibility filtering to using-git-worktrees. Enforce branch workflow across all git-touching skills. Migrate existing file-based specs/plans to issues.
Tech Stack: Git workflow, GitHub/GitBucket MCP tools, Python session init scripts, Markdown skill documentation
File Structure
Each skill file will be updated with focused changes:
skills/platform-detection.md- Branch workflow detection + production branch detection + file migration logicskills/using-superpowers/SKILL.md- Branch-workflow configuration parsing documentationskills/using-git-worktrees/SKILL.md- Worktree compatibility guard (compatible/incompatible tools)skills/brainstorming/SKILL.md- MCP availability gate before spec creationskills/writing-plans/SKILL.md- MCP availability gate before plan creationskills/finishing-a-development-branch/SKILL.md- Branch workflow enforcement (use integration branch)Task 1: Platform Detection - Branch Workflow Detection
Files:
skills/platform-detection.md:1-114Goal: Detect production branch from git remote metadata and create integration branch if missing.
Add after the existing "Label Requirements" section (line ~72):
If production branch cannot be detected:
git remote set-head origin <your-main-branch>"branch-workflow: feature|dev|<branch>to CLAUDE.md or AGENTS.mdRead branch-workflow configuration:
branch-workflow: <prefix>|<integration>|<production><feature-prefix>|<integration-branch>|<production-branch>branch-workflow: feature|dev|newsrxDefault workflow:
feature|dev|<PRODUCTION_BRANCH>feature(or configured prefix)dev(or configured integration branch)Create integration branch if missing:
Inject into session context:
Examples:
The new section should appear after "Label Requirements" and before "Example: Creating a Spec Issue"
Task 2: Platform Detection - File Migration Logic
Files:
skills/platform-detection.mdGoal: Migrate existing file-based specs and plans to GitHub/GitBucket issues on session start.
Add after the new "Branch Workflow Detection" section:
For each spec file:
For each plan file:
On successful issue creation:
Add archive comment to issue:
Report to dev:
Error handling:
Migration runs once: Only on first session start after MCP available.
Task 3: Branch Workflow Configuration Parsing
Files:
skills/using-superpowers/SKILL.md:40-113Goal: Document how skills should read branch-workflow configuration from GIT_CONTEXT.
Add new section after "Platform Adaptation" (line ~38):
<GIT_CONTEXT>
...
GIT_WORKFLOW_PREFIX=feature
GIT_INTEGRATION_BRANCH=dev
GIT_PRODUCTION_BRANCH=
</GIT_CONTEXT>
Format:
<prefix>|<integration>|<production>Skill Integration Pattern
Skills That Must Enforce
All git-touching skills must read and respect branch workflow:
using-git-worktrees- Creates feature branch from integration branchfinishing-a-development-branch- Merges/PRs to integration branchbrainstorming- References correct base branch in specwriting-plans- Links plan to spec with correct branchessubagent-driven-development- Reports branch status with workflow contextexecuting-plans- Merges work to correct integration branchgit add skills/using-superpowers/SKILL.md git commit -m "feat(using-superpowers): document branch workflow configuration parsing"Task 4: Worktree Compatibility Guard
Files:
skills/using-git-worktrees/SKILL.mdGoal: Filter incompatible tools when using worktrees.
Add new section after "Integration" section (line ~209):
PyCharm MCP tools detected but incompatible with worktrees.
Continuing with Git/File/GitHub/GitBucket tools only. IDE features will not be available in worktree.
Proceeding with worktree creation...
After worktree created:
Worktree ready at
Using: Git, File, GitHub/GitBucket MCP tools
Skipped: PyCharm MCP (incompatible with worktrees)
For IDE features, use main workspace at
Implementation
In
platform-detection.md, inject tool compatibility into<GIT_CONTEXT>:Skills check this before using worktrees and filter tool usage accordingly.
Why Not Block
Incompatible tools are filtered, not blocked:
Proceed with partial functionality vs. Stop everything.
Task 5: Brainstorming MCP Gate
Files:
skills/brainstorming/SKILL.md:109-139Goal: Gate spec creation on MCP availability, halt if unavailable.
Replace the existing "Create Spec Issue (REQUIRED)" section (lines ~109-139) with:
If GIT_PLATFORM=github:
GitHub MCP available → Proceed with github_issue_write
If GIT_PLATFORM=gitbucket:
If GITBUCKET_HAS_CREDENTIALS=false:
STOP. Tell user: "GitBucket credentials required. Set GITBUCKET_URL and GITBUCKET_TOKEN in .env, then restart session."
Do not proceed until credentials configured.
GitBucket MCP available → Proceed with gitbucket_create_issue
If GIT_PLATFORM=unknown:
STOP. Tell user:
Do not proceed until platform is configured.
Why Halt Instead of Fallback:
File-based specs are not acceptable because:
MCP availability is a hard requirement. Halt with clear remediation steps.
The MCP availability check should be the FIRST thing in this section.
Task 6: Writing Plans MCP Gate
Files:
skills/writing-plans/SKILL.md:125-155Goal: Gate plan creation on MCP availability, halt if unavailable.
Replace the existing "Create Plan Issue" subsection (lines ~125-155) with:
Else (unknown):
FATAL: Cannot create plan - no issue tracking available
Plans must be tracked in GitHub/GitBucket issues for:
Options:
Cannot proceed without issue tracking.
Create Plan Issue (after gate passes):
The issue body should contain the complete plan with:
Use the following:
If GitHub:
If GitBucket:
Link to Spec Issue:
Comment on the spec issue to link this plan:
github_add_issue_comment(spec_issue_number, "Implementation plan: #<plan_issue_number>")gitbucket_add_issue_comment(spec_issue_number, "Implementation plan: #<plan_issue_number>")No Local File Storage:
Plans are NOT stored in
docs/superpowers/plans/. They live only as issues.Why Halt Instead of Fallback:
File-based plans are not acceptable because:
MCP availability is a hard requirement. Halt with clear remediation steps.
Task 7: Finishing Branch Workflow Enforcement
Files:
skills/finishing-a-development-branch/SKILL.md:40-50Goal: Enforce branch workflow - use integration branch as base for merge/PR.
Replace lines ~40-50 with:
Ask if unclear:
Step 3: Present Options
Present exactly these 4 options:
Don't add explanation - keep options concise.
Then: Cleanup worktree (Step 5)
Then: Cleanup worktree (Step 5)
Task 8: Test Complete Workflow
Goal: Verify all components work together.
Verify all modified files:
Expected commits:
Check each integration point manually:
Branch Workflow Detection:
Worktree Compatibility:
MCP Gates:
File Migration:
Go through the spec issue #3 success criteria:
All criteria met.
Self-Review Checklist