From agentic-toolkit
Pick up Technical Debt Item work items from Azure DevOps, assign to developer, create git branch, investigate, plan, and implement the fix
npx claudepluginhub corbinatorx/devops-ai-toolkit-claude-plugin --plugin agentic-toolkitThis skill is limited to using the following tools:
Complete workflow for picking up "Technical Debt Item" work items from Azure DevOps. Handles assignment, branch creation, Teams notification, investigation, refactoring plan, implementation, and testing in a 12-step process.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Designs, implements, and audits WCAG 2.2 AA accessible UIs for Web (ARIA/HTML5), iOS (SwiftUI traits), and Android (Compose semantics). Audits code for compliance gaps.
Complete workflow for picking up "Technical Debt Item" work items from Azure DevOps. Handles assignment, branch creation, Teams notification, investigation, refactoring plan, implementation, and testing in a 12-step process.
This Skill integrates with Azure DevOps for work item management and follows {Product} git branching conventions.
This Skill automatically activates when users mention:
"Pick up tech debt 25300"
"Work on tech debt #25400"
"Refactor TD-001"
"I need to work on tech debt 25350"
This Skill uses shared helper modules for common patterns:
Azure DevOps (.claude/shared/azure-devops/):
Git (.claude/shared/git/):
refactor/{id}-{slug}Teams (.claude/shared/teams/):
.claude/techops-config.json (flow_url, team_id, channel_id)TeamsChannelMessageIdSee shared module READMEs for detailed patterns and examples.
First, determine the work item provider:
provider=$(jq -r '.work_items.provider // empty' .claude/techops-config.json 2>/dev/null)
if [ -z "$provider" ]; then
echo "Error: No work item provider configured. Set work_items.provider in .claude/techops-config.json"
exit 1
fi
Use mcp__azure-devops__wit_get_work_item to fetch tech debt item details.
Parameters:
{
"project": "ERM",
"id": work_item_id,
"expand": "relations"
}
Extract:
work_item_id: Use the id field from response (integer)Use mcp__notion__notion-fetch to fetch the page.
Parameters:
{
"pageId": "{user_provided_id}"
}
CRITICAL - Work Item ID Extraction:
# The work_item_id for worktree creation MUST come from the page response:
work_item_id = notion_page.id # Page UUID, unique per work item
# DO NOT use database_id from config - it's the same for ALL work items!
# WRONG: work_item_id = config.work_items.providers.notion.database_id
Extract (using property_mappings from config):
work_item_id: Use the page's id field from response (UUID)Reference: See .claude/shared/work-items/providers/notion/README.md for property mapping patterns.
Present formatted summary:
## Tech Debt #{work_item_id}: {title}
**Current State:** {state}
**Assigned To:** {assignee or "Unassigned"}
**Business Impact:** {business_impact} (High/Medium/Low)
**Technical Risk:** {technical_risk} (High/Medium/Low)
**Story Points:** {story_points}
**Impact Areas:** {impact_areas}
**Reported:** {created_date}
**Last Updated:** {changed_date}
### Description (Issue)
{description}
### Affected Area (Location)
{affected_area}
### Proposed Solution
{proposed_fix}
### Trade-offs / Notes
{trade_offs}
### Related Work Items
- #{id}: {title} ({state})
Engage in natural conversation to gather additional context:
Allow user to provide extra information or say "no"/"none"/"proceed" to continue.
Store any additional context for use in the refactoring plan.
Use mcp__azure-devops__core_get_identity_ids:
Parameters:
{
"searchFilter": "Corbin Taylor"
}
Store the identity ID for assignment update.
Reference: See .claude/shared/azure-devops/README.md for identity resolution patterns.
Use mcp__azure-devops__wit_update_work_item:
Parameters:
{
"id": work_item_id,
"updates": [
{
"op": "add",
"path": "/fields/System.State",
"value": "In Progress"
},
{
"op": "add",
"path": "/fields/System.AssignedTo",
"value": "{identity_id from Step 4}"
}
]
}
IMPORTANT:
Reference: See .claude/shared/azure-devops/README.md for work item update patterns.
Use mcp__azure-devops__wit_add_work_item_comment:
Parameters:
{
"project": "ERM",
"workItemId": work_item_id,
"comment": "{comment_text}",
"format": "html"
}
Comment text:
Tech debt item picked up by Corbin Taylor for refactoring via Claude Code /pickup-tech-debt command
Tech debt item picked up by Corbin Taylor for refactoring via Claude Code /pickup-tech-debt command (previously assigned to {previous_assignee})
If the work item has a Custom.TeamsChannelMessageId field populated, reply to the Teams thread to notify the team.
Prerequisites:
.claude/techops-config.json from the consuming repoteams.flow_url, teams.team_id, teams.channel_idSkip if:
Custom.TeamsChannelMessageId is empty or not setHTTP Request:
curl -X POST "{flow_url}" \
-H "Content-Type: application/json" \
-d '{
"action": "reply",
"teamId": "{team_id}",
"channelId": "{channel_id}",
"messageId": "{TeamsChannelMessageId from Step 1}",
"content": "๐ง **Tech Debt Picked Up**\n\nTech debt #{work_item_id} has been picked up by **Corbin Taylor** for refactoring.\n\n**Branch:** `refactor/{work_item_id}-{slug}`\n\n_via Claude Code /pickup-tech-debt command_"
}'
On Success: Log that Teams thread was notified.
On Failure: Log warning but continue workflow (Teams notification is non-blocking).
Reference: See .claude/shared/teams/README.md for Logic App patterns.
Generate branch name: refactor/{work_item_id}-{title-slug}
Branch slug generation (7-step algorithm from .claude/shared/git/README.md):
' โ remove, /\ โ -, & โ and, + โ plusExamples:
refactor/25300-td-001-sqlalchemy-async-driver-migrationrefactor/25350-td-005-api-response-cachingGit operations:
# Check if branch exists
git rev-parse --verify refactor/{work_item_id}-{slug} 2>/dev/null
If exists: git checkout refactor/{work_item_id}-{slug}
If not: git checkout -b refactor/{work_item_id}-{slug}
Inform user of branch created or checked out.
Reference: See .claude/shared/git/README.md for branch creation patterns.
Create detailed refactoring plan by researching codebase.
Research Phase:
Plan Structure:
# Tech Debt Refactoring Plan: #{work_item_id} - {title}
**Created:** {timestamp}
**State:** {old_state} โ In Progress
**Assigned To:** Corbin Taylor
**Branch:** refactor/{work_item_id}-{slug}
## 1. Tech Debt Summary
{1-2 paragraph summary with business and technical impact}
## 2. Context Analysis
### Impact Areas
{Maintainability, Performance, Process, Scalability, Security}
### Business Impact
{High/Medium/Low with explanation}
### Technical Risk
{High/Medium/Low with explanation}
### Additional Context (from Step 3)
{context provided by user}
## 3. Current State Analysis
**Files Affected:**
{list of files from AffectedArea}
**Code Patterns Observed:**
{analysis of current implementation}
**Pain Points:**
{specific issues identified}
## 4. Proposed Solution
{from Microsoft.VSTS.CMMI.ProposedFix field}
### Implementation Approach
{detailed steps}
### Alternative Approaches Considered
{list alternatives and why not chosen}
## 5. Refactoring Details
### Files to Modify
- `{file1}` - {what changes}
- `{file2}` - {what changes}
### Files to Create
- `{new_file}` - {purpose}
### Files to Delete/Deprecate
- `{old_file}` - {reason}
### Database Changes (if applicable)
- Migration: {description}
## 6. Testing Strategy
### Unit Tests
**Existing Tests to Update:**
- `{test_file}` - {what changes}
**New Tests to Create:**
- Test for {scenario 1}
- Test for {scenario 2}
### Integration Tests
- {integration test plan}
### Manual Testing
1. {step 1}
2. {step 2}
3. **Expected Result:** {what should happen}
### Regression Testing
- {areas to verify no regression}
## 7. Implementation Checklist
- [ ] {task 1}
- [ ] {task 2}
- [ ] Update/create unit tests
- [ ] Update/create integration tests
- [ ] Run full test suite
- [ ] Verify no regressions
- [ ] Update documentation if applicable
## 8. Architecture Compliance
- Follow API/Application layer separation (CLAUDE.md)
- Use Clean Architecture principles
- Feature-based organization
- Constructor injection with protocol-based interfaces
- No breaking changes unless discussed
## 9. Rollback Plan
{steps to rollback if issues arise}
## 10. Trade-offs / Considerations
{from Custom.TradeOffs field}
---
**Ready to implement?** Reply 'yes' or provide feedback.
Present plan and wait for approval.
User responses:
Iterate until user approves.
Once approved, implement the refactoring:
Follow {Product} Architecture:
API Layer (api/):
Application Layer (application/):
Feature Organization:
features/{feature_name}/
โโโ models.py # Pydantic (API) / SQLAlchemy (Application)
โโโ controller.py # HTTP logic (API only)
โโโ router.py # FastAPI routes (API only)
โโโ service.py # Business logic (Application)
โโโ repository.py # Data access (Application)
โโโ __init__.py
Code Quality:
Refactoring Best Practices:
Testing:
After implementation, BLOCK and require manual testing.
## โ
Refactoring Complete - Manual Testing Required
### Changes Made
{summary of modifications}
### Testing Instructions
#### Manual Test Steps
1. {step 1 from plan}
2. {step 2}
3. **Expected Result:** {what should happen}
#### Verification Checklist
- [ ] Refactoring addresses the tech debt issue
- [ ] No regression in related functionality
- [ ] All automated tests pass
- [ ] Performance not degraded (if applicable)
- [ ] Code follows project standards
- [ ] Aligns with {Product} architecture
### Running Tests Locally
**API Tests:**
```bash
cd api/
poetry run pytest
poetry run flake8 .
Application Tests:
cd application/
pytest -v --strict-markers --cov=.
After manual testing, confirm refactoring works before committing.
Wait for user confirmation that manual testing passed before considering tech debt pickup complete.
## Error Handling
### Work Item Not Found
โ Work Item Not Found
Work item #{id} was not found in Azure DevOps project "ERM".
Please verify:
### Wrong Work Item Type
โ Invalid Work Item Type
Work item #{id} is type "{type}", but /pickup-tech-debt requires "Technical Debt Item".
Use instead:
### Identity Resolution Failed
โ User Identity Not Found
Could not find Azure DevOps identity for "Corbin Taylor".
Troubleshooting:
### Git Branch Creation Failed
โ Git Branch Creation Failed
Error: {error_message}
Troubleshooting:
### Work Item Update Failed
โ Work Item Update Failed
Failed to update work item #{id}: {error_message}
Troubleshooting:
### Teams Notification Failed (Non-Blocking)
โ ๏ธ Teams Notification Skipped
Could not notify Teams thread: {error_message}
This is non-blocking. The workflow continues.
Possible causes:
## Integration with Workflow
**Downstream:**
- After refactoring is implemented and tested, use `/commit` command
- Then use `/create-pr` to create pull request
- Link PR back to work item
**Related Skills:**
- `pickup-bug` - Similar workflow for Bug work items
- `pickup-feature` - Similar workflow for User Story work items
- `implement-task` - For implementing tasks from blueprints
**Related Commands:**
- `/create-tech-debt` - Create tech debt items from status files
- `/commit` - Smart commit with conventional message
- `/create-pr` - Create pull request with auto-generated description
## Notes
- This Skill is specific to "Technical Debt Item" work items
- Always reassigns to Corbin Taylor regardless of current assignment
- Branch naming follows {Product} git conventions (`refactor/{id}-{slug}`)
- Refactoring plans are comprehensive and require approval before implementation
- Manual testing is mandatory before considering tech debt resolved
- Follows Clean Architecture and feature-based organization
- References {Product} CLAUDE.md for architecture patterns
- Pre-commit hooks will validate formatting and linting
- Teams notification is optional and non-blocking (requires `TeamsChannelMessageId` field and config)
- Unlike bugs, tech debt often requires more careful planning to avoid regressions