Azure DevOps Reports
Use this skill for secure, read-focused Azure DevOps reporting.
Configuration
Load credentials from a local .env file stored in this skill directory.
Required variables:
Optional defaults:
- - INLINECODE3
- INLINECODE4
- INLINECODE5
- INLINECODE6
If required values are missing, ask the user to create or update .env in this skill directory.
Runtime requirements
This skill requires:
- - Node.js
- Python 3
- INLINECODE8
- Python package: INLINECODE9
Install Python dependency once:
CODEBLOCK0
Safety guarantees
- - Read-only Azure DevOps access only
- No create, update, or delete operations for Azure DevOps work items
- No secret logging
- No Authorization header logging
- No arbitrary shell execution from user input
- Output restricted to local report files under the skill directory
- INLINECODE10 must resolve inside the skill directory
- Prefer least-privilege PAT scopes:
vso.project and INLINECODE12
Workflow
- 1. Load config from the skill-local
.env file. - Resolve project, team, and query id from explicit arguments or configured defaults.
- Decide whether the request is project-scoped, team-scoped, team-member scoped, saved-query, sprint-scoped, or custom-WIQL.
- Fetch work item ids via WIQL when filtering is needed.
- Fetch detailed work item fields.
- Normalize records for reporting.
- Default to the configured saved query when no explicit command or query id is provided.
- Export to JSON or CSV data bundles.
- Build summary tables for state, assignee, and work item type.
- Build Excel charts from exported JSON when the user asks for workbook generation.
- Use project listing, team listing, team-member listing, sprint listing, and saved-query reporting when the user asks in plain language.
Scripts
- -
scripts/projects.js — list projects - INLINECODE15 — list teams in a project and team members
- INLINECODE16 — list team iterations / current sprint
- INLINECODE17 — list saved queries and inspect a query definition
- INLINECODE18 — run work item queries and normalize results
- INLINECODE19 — export JSON/CSV data bundles
- INLINECODE20 — generate Excel workbooks with charts from exported JSON
Exact script usage
Run all commands from the skill directory:
CODEBLOCK1
1) List projects
CODEBLOCK2
2) List teams in a project
CODEBLOCK3
3) List members in a team
CODEBLOCK4
4) List current sprint
CODEBLOCK5
5) List all iterations / sprints
CODEBLOCK6
6) List saved queries in a project
CODEBLOCK7
7) Get a saved query definition by id
CODEBLOCK8
8) Fetch work items using saved query id
Explicit:
CODEBLOCK9
With defaults from .env:
CODEBLOCK10
9) List work items closed in the last 7 days
Using the default project from .env:
CODEBLOCK11
With an explicit project:
CODEBLOCK12
10) Export report data as JSON
Default saved-query export using .env defaults:
CODEBLOCK13
Explicit saved-query export:
CODEBLOCK14
Explicit sprint summary export:
CODEBLOCK15
11) Build Excel workbook from exported JSON
CODEBLOCK16
Ask ClawBot in plain English
These requests should map to the skill without manual script execution:
- - INLINECODE24
- INLINECODE25
- INLINECODE26
- INLINECODE27
- INLINECODE28
- INLINECODE29
- INLINECODE30
- INLINECODE31
- INLINECODE32
- INLINECODE33
References
Read these only if needed:
- -
references/field-mapping.md for normalized field choices - INLINECODE35 for report presets and chart ideas
- INLINECODE36 for endpoint notes and PAT scope guidance
Azure DevOps 报表
使用此技能进行安全、只读的 Azure DevOps 报表生成。
配置
从此技能目录中存储的本地 .env 文件加载凭据。
必需变量:
- - AZUREDEVOPSORG
- AZUREDEVOPSPAT
可选默认值:
- - AZUREDEVOPSDEFAULTPROJECT
- AZUREDEVOPSDEFAULTTEAM
- AZUREDEVOPSDEFAULTQUERYID
- AZUREDEVOPSOUTPUT_DIR
如果缺少必需值,请要求用户在此技能目录中创建或更新 .env 文件。
运行时要求
此技能需要:
- - Node.js
- Python 3
- pip3
- Python 包:xlsxwriter
一次性安装 Python 依赖:
bash
pip3 install -r requirements.txt
安全保障
- - 仅限 Azure DevOps 只读访问
- 不对 Azure DevOps 工作项执行创建、更新或删除操作
- 不记录密钥
- 不记录 Authorization 头
- 不允许根据用户输入执行任意 shell 命令
- 输出仅限于技能目录下的本地报表文件
- AZUREDEVOPSOUTPUT_DIR 必须解析到技能目录内部
- 优先使用最小权限 PAT 范围:vso.project 和 vso.work
工作流程
- 1. 从技能本地的 .env 文件加载配置。
- 从显式参数或配置的默认值解析项目、团队和查询 ID。
- 判断请求是项目范围、团队范围、团队成员范围、已保存查询、迭代范围还是自定义 WIQL。
- 需要过滤时通过 WIQL 获取工作项 ID。
- 获取详细的工作项字段。
- 规范化记录以用于报表生成。
- 未提供显式命令或查询 ID 时,默认使用配置的已保存查询。
- 导出为 JSON 或 CSV 数据包。
- 构建状态、负责人和工作项类型的汇总表。
- 当用户要求生成工作簿时,从导出的 JSON 构建 Excel 图表。
- 当用户用自然语言提问时,使用项目列表、团队列表、团队成员列表、迭代列表和已保存查询报表。
脚本
- - scripts/projects.js — 列出项目
- scripts/teams.js — 列出项目中的团队及团队成员
- scripts/iterations.js — 列出团队迭代/当前迭代
- scripts/queries.js — 列出已保存查询并检查查询定义
- scripts/workitems.js — 运行工作项查询并规范化结果
- scripts/export-report.js — 导出 JSON/CSV 数据包
- scripts/buildexcelreport.py — 从导出的 JSON 生成带图表的 Excel 工作簿
精确脚本用法
从技能目录运行所有命令:
bash
cd /path/to/azure-devops-reports
1) 列出项目
bash
node scripts/projects.js list
2) 列出项目中的团队
bash
node scripts/teams.js list 项目名称
3) 列出团队成员
bash
node scripts/teams.js members 项目名称 团队名称
4) 列出当前迭代
bash
node scripts/iterations.js current 项目名称 团队名称
5) 列出所有迭代/冲刺
bash
node scripts/iterations.js list 项目名称 团队名称
6) 列出项目中的已保存查询
bash
node scripts/queries.js list --project 项目名称
7) 按 ID 获取已保存查询定义
bash
node scripts/queries.js get --project 项目名称 --id 查询GUID
8) 使用已保存查询 ID 获取工作项
显式指定:
bash
node scripts/workitems.js query-id --project 项目名称 --id 查询GUID
使用 .env 中的默认值:
bash
node scripts/workitems.js query-id
9) 列出过去 7 天内关闭的工作项
使用 .env 中的默认项目:
bash
node scripts/workitems.js closed-last-week
显式指定项目:
bash
node scripts/workitems.js closed-last-week --project 项目名称
10) 将报表数据导出为 JSON
使用 .env 默认值导出已保存查询:
bash
node scripts/export-report.js
显式导出已保存查询:
bash
node scripts/export-report.js query-id \
--project 项目名称 \
--id 查询GUID \
--format json \
--out query-data.json
显式导出迭代摘要:
bash
node scripts/export-report.js sprint-summary \
--project 项目名称 \
--team 团队名称 \
--format json \
--out sprint-summary.json
11) 从导出的 JSON 构建 Excel 工作簿
bash
python3 scripts/buildexcelreport.py \
--input output/query-data.json \
--output output/query-report.xlsx
用自然语言向 ClawBot 提问
以下请求应映射到技能,无需手动执行脚本:
- - 显示我的 Azure DevOps 项目
- 我们有多少个团队?
- 列出 <你的团队名称> 团队中的所有成员
- 能列出迭代吗?
- 生成 Azure DevOps 报表
- 重新生成 Excel
- 列出上周关闭的所有工作项
- 汇总上周关闭的工作项
- 显示迭代 07 的当前进度
- 哪个团队成员有最多的未关闭工作项?
参考资料
仅在需要时阅读:
- - references/field-mapping.md 了解规范化字段选择
- references/report-types.md 了解报表预设和图表思路
- references/api-notes.md 了解端点说明和 PAT 范围指南