skills/openspec-workitem-enrichment/SKILL.md
Use this skill when creating a new OpenSpec spec whose name follows `wi-<azure-devops-work-item-id>-<change-name>` so the spec can be enriched from Azure DevOps work item REST API data, including parent hierarchy and comments, instead of manual re-entry.
npx skillsauth add linksofteu/linksoft_skills openspec-workitem-enrichmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when creating a new OpenSpec spec from an Azure DevOps work item and the spec name follows wi-<work-item-id>-<change-name>.
This skill does not use Azure DevOps MCP or the Azure CLI for work item retrieval. It uses the Azure DevOps REST API directly with a local PAT file.
The spec name must match:
wi-<azure-devops-work-item-number>-<name-of-change>
Recommended validation pattern:
^wi-(\d+)-([a-z0-9]+(?:-[a-z0-9]+)*)$
If the name does not match:
AZURE_DEVOPS_PAT=<token>.GET /_apis/wit/workitems/{id}?$expand=relations&api-version=7.1.GET /_apis/wit/workItems/{id}/comments?api-version=7.1-preview.4.Prefer the bundled scripts instead of rebuilding the flow ad hoc:
scripts/infer-azure-devops-context.shscripts/fetch-work-item-context.shscripts/infer-azure-devops-context.ps1scripts/fetch-work-item-context.ps1Use the Bash scripts in Unix-like environments and the PowerShell scripts in PowerShell environments.
Before asking the user for Azure DevOps details, inspect origin.
Accepted remote shapes include:
https://dev.azure.com/org/ProjectName/_git/RepoName[email protected]:v3/org/ProjectName/RepoNamehttps://org.visualstudio.com/ProjectName/_git/RepoNameUse the bundled inference script first. Only ask the user when the remote is missing or ambiguous.
The work item fetch scripts require a local PAT file and do not fall back to Azure CLI authentication.
Unix-like environments must use this exact path:
~/.config/linksoft-skills/azure-devops.env
Windows PowerShell must use this exact path:
%USERPROFILE%\.config\linksoft-skills\azure-devops.env
When giving Windows setup instructions, expand %USERPROFILE% to the user's actual profile directory if known from the environment. Prefer manual, file-explorer-friendly instructions first:
<expanded-user-profile>\.config\linksoft-skillsazure-devops.envAZURE_DEVOPS_PAT=<your Azure DevOps PAT><your Azure DevOps PAT> with the actual token and save the filePowerShell commands may be shown after the manual instructions as an optional shortcut, but they must not be the only Windows guidance.
The file must contain exactly one environment variable assignment, on one line:
AZURE_DEVOPS_PAT=<your Azure DevOps PAT>
Do not add quotes around the token. Do not commit this file to git.
When creating the PAT in Azure DevOps, tell the user to grant the minimum required scope:
Work Items: Read
This corresponds to the Azure DevOps REST API vso.work permission, which allows reading work items, comments, queries, boards, area paths, and iteration paths. The token does not need write permissions, Code permissions, Build permissions, Packaging permissions, or full access for this skill.
If the PAT file is missing or invalid, stop enrichment and emit precise setup instructions that name the exact path for the current OS and show the exact one-line file shape above.
When the work item id is already known from the spec name, use this order:
$expand=relationsSystem.LinkTypes.Hierarchy-Reverse relationsKeep the first fetch light. Do not start with the heaviest possible request shape.
Preferred documented Azure DevOps REST API endpoints for this skill:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?$expand=relations&api-version=7.1GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{workItemId}/comments?api-version=7.1-preview.4The bundled fetch scripts fetch the target work item, its comments, its parent chain, and comments for each parent. Do not combine the fields query parameter with $expand=relations; Azure DevOps rejects that combination. A separate WIQL existence check is intentionally not required because the direct work item GET gives a simpler and more reliable success/failure signal than the previous Azure CLI flow.
Fetch as much relevant work item context as is practical, including when available:
For hierarchy enrichment, fetch these items in the same way for every parent in the chain up to the topmost parent.
If the data is sparse, create a minimal spec shell and list unresolved gaps explicitly.
When drafting the spec:
Defaults:
Preferred structured output shape:
## <Topmost parent type>: <Topmost parent title> (#<id>)
<Only include subsection blocks that have content>
### Description
<description>
### Acceptance Criteria
<acceptance criteria>
### Comments
<comment bullets>
## <Next child type>: <Next child title> (#<id>)
...
If a section has no content, omit that subsection entirely. Keep the work item heading even when an item has no populated subsections.
If REST API-based enrichment cannot be completed, ask for only the minimum details needed to continue:
Before finishing:
testing
Use this skill when the user asks whether LinkSoft Skills are working, including minor wording variations or typos. Reply only with the fixed verification message.
tools
Opens a file or folder in a supported IDE using the nearest workspace or project context when available. Use when the user asks to open code in Rider, WebStorm, VS Code, Cursor, Windsurf, or a generic IDE from the CLI.
data-ai
Use this skill when adding or extending functionality in a DDD project so the implementation fits the intended layers: controllers, application services, mediator-style commands, queries, or events, handlers, domain services, and repositories.
testing
Create or improve Agent Skills that follow the Agent Skills specification and LinkSoft repository conventions. Use this skill when designing a new skill, tightening scope, writing descriptions, structuring references or scripts, adding evals, or reviewing an existing skill for clarity, discoverability, and reuse.