| name | gt:azure-devops |
| description | Azure DevOps work items, queries, and dashboards. Use for "get workitem", "fetch task", "show query", "analyze task", or any Azure DevOps URL. For time logging (Timely sync, Clarity fill), invoke the `/gt:timelog` command instead — this skill defers to it. |
Azure DevOps Work Item Tool
Fetch, manage, and analyze Azure DevOps work items using tools azure-devops.
Time logging: If the user wants to log time, sync Timely, or fill Clarity timesheets, stop here and invoke the /gt:timelog command. This skill only covers raw work-item operations.
CLI Reference
tools azure-devops workitem <id|ids>
tools azure-devops query <id|url|name>
tools azure-devops query <id> --download-workitems
tools azure-devops dashboard <id|url>
tools azure-devops list
tools azure-devops workitem-create
tools azure-devops timelog configure
tools azure-devops timelog types
tools azure-devops timelog list -w <id>
tools azure-devops timelog add -w <id> -h <hrs>
tools azure-devops timelog prepare-import add
tools azure-devops timelog prepare-import list
tools azure-devops timelog prepare-import remove
tools azure-devops timelog prepare-import clear
tools azure-devops timelog import <file>
Options
| Option | Description |
|---|
--format ai|md|json | Output format (default: ai) |
--force, --refresh | Bypass cache |
--state <states> | Filter by state (comma-separated) |
--severity <sev> | Filter by severity (comma-separated) |
--download-workitems | Download all items from query |
--category <name> | Save to tasks// |
--task-folders | Save in tasks// subfolder |
--attachments-from <datetime> | Download attachments created after this date |
--attachments-to <datetime> | Download attachments created before this date (default: now) |
--attachments-prefix <prefix> | Only attachments starting with this name |
--attachments-suffix <suffix> | Only attachments ending with this (e.g. .har) |
--output-dir <path> | Custom directory for downloaded attachments |
--images | Download inline images from description/comments |
Output Paths
- Tasks:
.claude/azure/tasks/ → <id>-<Slug-Title>.md
- With
--category react19: .claude/azure/tasks/react19/<id>-<Slug>.md
- With
--task-folders: .claude/azure/tasks/<id>/<id>-<Slug>.md
Attachment Output Paths
Attachments are downloaded when any --attachments-* filter flag is provided. Without filters, attachments are listed in output with a suggested download command.
- Default: Same folder as task file:
.claude/azure/tasks/<taskid>-<attachment-name>
- With
--task-folders: .claude/azure/tasks/<id>/<taskid>-<attachment-name>
- With
--output-dir /custom/path: /custom/path/<taskid>-<attachment-name>
Inline Image Output Paths
Inline images (screenshots embedded in description/comments HTML) are downloaded when --images is provided.
- Default: Same folder as task file:
.claude/azure/tasks/<taskid>-<imagename>.png
- With
--task-folders: .claude/azure/tasks/<id>/<taskid>-<imagename>.png
- Images are referenced in the
.md file with relative paths
Recommended: Use --task-folders --images together to keep each work item's files organized in its own directory.
Operations
Fetch Work Items
tools azure-devops workitem 261575
tools azure-devops workitem 261575,261576,261577
tools azure-devops workitem 261575 --category react19
tools azure-devops workitem 261575 --force
Fetch Query
The --query option supports three input formats:
- Query ID (GUID):
d6e14134-9d22-4cbb-b897-b1514f888667
- Full URL:
https://dev.azure.com/org/project/_queries/query/abc123
- Query Name:
"Otevřené bugy" (fuzzy matching supported)
tools azure-devops query d6e14134-9d22-4cbb-b897-b1514f888667
tools azure-devops query "Open Bugs"
tools azure-devops query "Otevřené bugy"
tools azure-devops query <id> --state Active,Development
tools azure-devops query "Active Tasks" --download-workitems --category react19
Query Name Matching:
- Exact matches are used immediately
- Fuzzy matching finds the closest query name if no exact match
- Shows alternatives if multiple similar queries exist
- Query list is cached for 1 day for fast lookups
Analyze Work Items
When user says "analyze workitem/task X" or "analyze tasks from query Y":
-
Fetch work item(s) with images:
tools azure-devops workitem <ids> --category <cat> --task-folders --images
-
Read the generated .md file for each work item
-
Read inline images - Check for image files next to the work item's .md file:
ls $(dirname <path-to-workitem.md>)/<id>-*.{png,jpg,gif,jpeg} 2>/dev/null
If images exist, use the Read tool to view each image file. This gives visual context for:
- Bug screenshots showing the issue
- Design mockups showing expected behavior
- UI comparisons (current vs expected)
-
Spawn Explore agent (Task tool with subagent_type: "Explore") for each:
Analyze codebase for Azure DevOps work item:
**#{id}: {title}**
State: {state} | Severity: {severity}
**Description:** {description}
**Visual Context:** {describe what the inline images show, if any}
**Comments:** {comments}
Find:
1. Relevant code files/components for this issue
2. Current implementation and data flow
3. Required changes
4. Dependencies and related systems
5. Complexity assessment
Return: files found, current implementation, recommended approach, considerations, complexity (Low/Medium/High)
-
Write .analysis.md next to the work item file:
- Work item:
.claude/azure/tasks/261575-Title.md
- Analysis:
.claude/azure/tasks/261575-Title.analysis.md
Analysis Document Format
# Analysis: #{id} - {title}
**Analyzed**: {timestamp}
**Work Item**: {path to .md file}
## Summary
{1-2 sentence findings summary}
## Relevant Code
- `path/file.ts` - {purpose}
## Current Implementation
{How current code works}
## Recommended Approach
{Step-by-step plan}
## Considerations
- {Risks/considerations}
## Complexity: {Low|Medium|High}
{Reasoning}
Examples
| User Request | Action |
|---|
| "Get workitem 261575" | tools azure-devops workitem 261575 |
| "Show query results for X" | tools azure-devops query X |
| "Show Open Bugs query" | tools azure-devops query "Open Bugs" |
| "Fetch Otevřené bugy" | tools azure-devops query "Otevřené bugy" |
| "Download React19 bugs" | tools azure-devops query "React19 Bugs" --download-workitems --category react19 |
| "Analyze task 261575" | Fetch → Explore agent → Write .analysis.md |
| "Analyze all active bugs" | Fetch query with --download-workitems → Parallel Explore agents → Write .analysis.md files |
| "Download .har files from task 12345" | tools azure-devops workitem 12345 --attachments-suffix .har |
| "Get attachments from last hour for 12345" | Compute datetime 1h ago, then tools azure-devops workitem 12345 --attachments-from "2026-02-12T10:00:00" |
| "Download all attachments for task 12345" | tools azure-devops workitem 12345 --attachments-from 2000-01-01 |
| "Get task 261575 with screenshots" | tools azure-devops workitem 261575 --task-folders --images |
| "Analyze bug with images" | Fetch with --images → Read images → Explore agent with visual context |
Creating Work Items
The --create command supports multiple modes for creating new work items.
CLI Reference
tools azure-devops workitem-create -i
tools azure-devops workitem-create --from-file <path>
tools azure-devops workitem-create <query-url> --type Bug
tools azure-devops workitem-create <workitem-url>
tools azure-devops workitem-create --type Task --title X
Create Options
| Option | Description |
|---|
-i, --interactive | Interactive mode with step-by-step prompts |
--from-file <path> | Create from template JSON file |
--type <type> | Work item type (Bug, Task, User Story, etc.) |
--title <text> | Work item title (required for quick mode) |
--severity <sev> | Severity level |
--tags <tags> | Tags (comma-separated) |
--assignee <email> | Assignee email |
Creation Modes
1. Interactive Mode (-i)
Best for: Manual creation with full control over all fields.
tools azure-devops workitem-create -i
Prompts for: type, title, description (via editor), severity, state, tags, assignee, parent link.
2. Template from Query
Best for: Creating work items that match patterns from existing items.
tools azure-devops workitem-create "https://dev.azure.com/.../_queries/query/abc" --type Bug
This:
- Analyzes work items from the query
- Extracts common patterns (area paths, tags, severities used)
- Generates a template with hints from analyzed items
- Saves to
.claude/azure/tasks/created/template-<timestamp>.json
3. Template from Work Item
Best for: Cloning or creating similar work items.
tools azure-devops workitem-create "https://dev.azure.com/.../_workitems/edit/12345"
This:
- Fetches the source work item
- Generates a template pre-filled with matching values
- Keeps parent reference if source had one
- Saves to
.claude/azure/tasks/created/template-<timestamp>.json
4. From Template File
Best for: LLM workflows where templates are prepared programmatically.
tools azure-devops workitem-create --from-file ".claude/azure/tasks/created/template.json"
Template format:
{
"$schema": "azure-devops-workitem-v1",
"type": "Bug",
"fields": {
"title": "Error in checkout flow",
"description": "<p>Description here</p>",
"severity": "A - critical",
"tags": ["frontend", "checkout"],
"assignedTo": "user@example.com",
"areaPath": "Project\\Area",
"iterationPath": "Project\\Sprint1"
},
"relations": {
"parent": 12345
}
}
5. Quick Non-Interactive
Best for: Simple work items created from command line.
tools azure-devops workitem-create --type Task --title "Fix login bug"
tools azure-devops workitem-create --type Bug --title "Error" --severity "A - critical" --tags "frontend,urgent"
LLM Workflow
When user asks to "create a work item" or "file a bug":
-
Gather information - Ask for: type, title, description, severity (if bug)
-
Choose mode based on context:
- Have a template file? Use
--from-file
- Want to match existing patterns? Generate template from query first
- Simple request? Use quick mode
--type X --title "Y"
- Complex with many fields? Use interactive mode
-
Create the work item:
tools azure-devops workitem-create --type Bug --title "Error in checkout" --severity "B - high"
tools azure-devops workitem-create --from-file template.json
-
Report the result - Include the work item ID and URL in your response.
Examples
| User Request | Action |
|---|
| "Create a bug for the login issue" | --create --type Bug --title "Login issue" --severity "B - high" |
| "File a task to update docs" | --create --type Task --title "Update documentation" |
| "Create a bug like #12345" | --create <workitem-url> then --from-file template.json |
| "Help me create a detailed work item" | --create -i (interactive) |
History Commands
Track work item history: who changed what, when, and how long items spent in each state.
CLI Reference
tools azure-devops history show <id>
tools azure-devops history show <id> -f timeline
tools azure-devops history show <id> -f json
tools azure-devops history show <id> --force
tools azure-devops history show <id> --assigned-to "X"
tools azure-devops history show <id> --state Active
tools azure-devops history search --assigned-to-me --wiql
tools azure-devops history search --assigned-to "Martin" --wiql
tools azure-devops history search --assigned-to "Martin" --wiql --current
tools azure-devops history search --assigned-to "Martin"
tools azure-devops history search --assigned-to "Martin" --min-time 2h
tools azure-devops history search --state Active --since 2024-12-01 --wiql
tools azure-devops history sync
tools azure-devops history sync --force
tools azure-devops history sync --dry-run
tools azure-devops history sync --batch
NL Query Translation
| User says | Command |
|---|
| "tasks assigned to me" | history search --assigned-to-me --wiql |
| "tasks ever assigned to Martin" | history search --assigned-to "Martin" --wiql |
| "how long was #123 in Active" | history show 123 --state Active |
| "time Martin spent on #456" | history show 456 --assigned-to Martin |
| "all work in last 2 months" | history search --assigned-to "Martin" --from 2024-12-01 --wiql |
Features
- @me support:
--assigned-to @me or --assigned-to-me uses WIQL @Me macro (auto-enables WIQL)
- --current flag: Uses
= instead of EVER for current assignment
- Fuzzy user matching: "Martin" matches "Martin Novak (QK)", diacritics normalized
- Cache stats: Local search shows data date range and last sync time
- Per-item sync (default): Targeted API calls per work item, faster for <200 items
- Batch sync (
--batch): Uses reporting API, better for 500+ items
TimeLog Operations
Time logging for Azure DevOps work items using the third-party TimeLog extension.
Setup
tools azure-devops timelog configure
This launches an interactive prompt (using clack) that configures:
functionsKey: TimeLog API key (auto-fetched from Azure DevOps)
defaultUser: Your user email/name for time logging
allowedWorkItemTypes: Work item types that can be logged to (e.g., "Bug,Task")
allowedStatesPerType: Required states per type (e.g., "Task:In Progress")
The configuration is saved to .claude/azure/config.json.
Note for LLM agents: Since configure uses interactive clack prompts, you cannot drive it directly. Use AskUserQuestion to suggest the user run it themselves, or use non-interactive flags:
tools azure-devops timelog configure --allowed-work-item-types "Bug,Task" --allowed-states-for-type "Task:In Progress"
List Time Types
tools azure-devops timelog types
tools azure-devops timelog types --format json
List Time Logs
tools azure-devops timelog list -w <workItemId>
tools azure-devops timelog list -w 268935 --format md
tools azure-devops timelog list --from 2026-02-01 --to 2026-02-08 --format json
tools azure-devops timelog list --from 2026-02-01 --to 2026-02-08 --user @me --format json
The --user @me resolves to the configured default username. Use --from/--to for date ranges (--since/--upto also accepted as aliases).
Add Time Log Entry
tools azure-devops timelog add -w <id> -h <hours> -t <type>
tools azure-devops timelog add -w 268935 -h 2 -t "Development"
tools azure-devops timelog add -w 268935 -h 1 -m 30 -t "Code Review" -c "PR review"
tools azure-devops timelog add -i
tools azure-devops timelog add -w 268935 -i
Before creating the entry, the command runs a workitem type precheck (see Workitem Type Validation below).
Prepare Entries for Import (Recommended for Batch Operations)
The prepare-import workflow allows you to stage, review, and validate entries before committing them to Azure DevOps.
tools azure-devops timelog prepare-import add --from 2026-02-01 --to 2026-02-08 --entry '{
"workItemId": 268935,
"date": "2026-02-04",
"hours": 2,
"timeType": "Development",
"comment": "Implemented feature X"
}'
tools azure-devops timelog prepare-import add --from 2026-02-01 --to 2026-02-08 --entry '{
"workItemId": 262042,
"date": "2026-02-04",
"hours": 0.5,
"timeType": "Ceremonie",
"comment": "Daily standup"
}'
tools azure-devops timelog prepare-import list --name 2026-02-01.2026-02-08 --format table
tools azure-devops timelog prepare-import remove --name 2026-02-01.2026-02-08 --id <uuid>
tools azure-devops timelog prepare-import clear --name 2026-02-01.2026-02-08
The name is auto-generated from --from and --to as <from>.<to> (e.g., 2026-02-01.2026-02-08). Each entry is validated with Zod schema and runs workitem type precheck before being added.
Do not include workItemTitle in staged --entry JSON unless you already have the exact ADO title. Precheck backfills it on prepare-import add; prepare-import list and import --dry-run fill any still-missing titles. Run from the project directory that has .claude/azure/config.json (e.g. col-fe/).
Import Time Logs
tools azure-devops timelog import .genesis-tools/azure-devops/cache/prepare-import/2026-02-01.2026-02-08.json
tools azure-devops timelog import entries.json
tools azure-devops timelog import entries.json --dry-run
Omit workItemTitle when authoring import JSON. Precheck resolves titles (single ADO fetch per work item) and --dry-run writes them back to the source file.
The import command runs workitem type precheck for each entry before creating it. After import, the command shows a precheck summary with counts of passed/redirected/failed entries. The cache is automatically evicted after successful imports.
Workitem Type Validation
Before creating time log entries, the tool validates that the workitem type is configured as allowed in allowedWorkItemTypes. This precheck behavior helps prevent errors:
Automatic Redirect for User Stories:
- If a workitem is a User Story (not typically allowed for time logging), the tool looks for child Tasks/Bugs
- Exactly 1 child of allowed type: Auto-redirect with warning
- 0 children of allowed type: Error
- Multiple children: Error with list for user to choose from
Configuration:
- Run
tools azure-devops timelog configure to set allowedWorkItemTypes
- Common configuration:
"Bug,Task" (excludes User Stories, Features, etc.)
- Can also configure
allowedStatesPerType for additional validation
Where Precheck Applies:
timelog add - Before creating single entry
timelog import - Before importing each entry
prepare-import add - When staging entry for review
TimeLog Examples
| User Request | Action |
|---|
| "Log 2 hours on task 268935" | tools azure-devops timelog add -w 268935 -h 2 -t "Development" |
| "What time types are available?" | tools azure-devops timelog types |
| "Show time logged on 268935" | tools azure-devops timelog list -w 268935 |
| "Help me log time" | tools azure-devops timelog add -i |
| "Stage entries for review" | tools azure-devops timelog prepare-import add --from ... --to ... --entry '{...}' |
| "Review staged entries" | tools azure-devops timelog prepare-import list --name 2026-02-01.2026-02-08 |
| "Import time entries from file" | tools azure-devops timelog import entries.json |
| "Import with validation only" | tools azure-devops timelog import entries.json --dry-run |
Natural Language Time Logging
When user asks to log time in natural language, parse their request and construct the CLI command:
1. Parse Duration Formats:
- "1 hour", "1h", "1hr" →
-h 1
- "30 minutes", "30min", "30m" →
-h 0 -m 30
- "1.5 hours", "1h30m", "90 minutes" →
-h 1 -m 30
- "2 hours 15 minutes" →
-h 2 -m 15
2. Extract Work Item IDs:
- From explicit mention: "on task 268935", "workitem #268935", "WI 268935"
- From git branch:
feature/268935-fix-login → work item 268935
- From recent commits:
feat(#268935): fix login bug → work item 268935
To extract from git context:
git branch --show-current
git log --oneline -5
3. Infer Time Type from Context:
| Context Clues | Time Type |
|---|
| "reviewing PR", "code review", "review" | Code Review |
| "implementing", "coding", "development", "fixing" | Development |
| "testing", "writing tests", "QA" | Test |
| "documentation", "docs", "readme" | Dokumentace |
| "meeting", "standup", "planning", "retro" | Ceremonie |
| "analysis", "analyzing", "design" | IT Analýza |
| "configuring", "setup", "deployment" | Konfigurace |
Default to "Development" if no context clues.
4. Use Git Commit Messages as Notes:
When user says "use commit message" or doesn't provide a note:
git log -1 --pretty=%B
Use the commit subject line as the time log comment.
Natural Language Examples
| User Request | Parsed Command |
|---|
| "log 1h on 268935 for Development" | timelog add -w 268935 -h 1 -t "Development" |
| "spent 30min reviewing PR on task 789" | timelog add -w 789 -h 0 -m 30 -t "Code Review" |
| "log 2 hours, use last commit message" | Get work item from branch/commit, use commit msg as comment |
| "log my work on the current task" | Extract ID from branch, infer type from commits |
| "log 1.5h implementing the fix" | timelog add -w <from-branch> -h 1 -m 30 -t "Development" |
Workflow: Log Time from Git Context
When user says "log time for my work" without explicit details:
-
Get work item ID:
git branch --show-current
Extract number: 268935
-
Get commit messages for note:
git log -1 --pretty=%B
-
Infer time type from commit message keywords
-
Ask user for duration if not specified (use AskUserQuestion)
-
Execute:
tools azure-devops timelog add -w 268935 -h <hours> -t "<inferred-type>" -c "<commit-message>"
Integration with tools git
For gathering commit data to correlate with time entries, use the tools git commits command:
tools git commits --from 2026-02-01 --to 2026-02-08 --format json 2>/dev/null | tools json
This command:
- Extracts workitem IDs from commit messages and branch names via configured patterns
- Returns commit metadata (hash, message, author, date)
- Includes stats (files changed, insertions, deletions)
- Filters by configured authors (see
tools git configure authors)
The extracted workitem IDs can be used to match commits to Azure DevOps work items for time logging purposes.
HAR File Analysis from Work Items
When user explicitly asks to download and analyze HAR attachments from a work item:
tools azure-devops workitem <id> --attachments-suffix .har --output-dir /tmp/har
tools har-analyzer load /tmp/har/<taskid>-capture.har
Do NOT download or analyze HAR files automatically -- only when the user requests it.
Documentation Resources
For deeper API research beyond this skill:
- Local docs:
src/azure-devops/docs/ contains 14 reference files (work items, iterations, PRs, REST API, WIQL syntax, timelog history)
- Context7: Use library ID
/websites/learn_microsoft_en-us_rest_api_azure_devops for detailed REST API specs
- CLAUDE.md: Contains context7 library IDs and batch endpoint quick reference