Skip to content

feat: add comment-on-work-item safe output tool#80

Open
jamesadevine wants to merge 1 commit intomainfrom
devinejames/comment-wit
Open

feat: add comment-on-work-item safe output tool#80
jamesadevine wants to merge 1 commit intomainfrom
devinejames/comment-wit

Conversation

@jamesadevine
Copy link
Copy Markdown
Collaborator

Summary

Adds a new comment-on-work-item safe output tool — the ADO equivalent of gh-aw's \�dd-comment. Agents can add comments to existing Azure DevOps work items via the safe outputs pipeline.

Changes

  • New file \src/tools/comment_on_work_item.rs\ — full tool implementation with 14 unit tests
  • MCP handler in \src/mcp.rs\ with sanitization and max enforcement
  • Stage 2 dispatch in \src/execute.rs\ with integration tests
  • Compile-time validation — \ arget\ field is required, added to \WRITE_REQUIRING_SAFE_OUTPUTS\
  • Documentation updated in \AGENTS.md\

Design

Agent parameters

  • \work_item_id\ (number, required) — which work item to comment on
  • \�ody\ (string, required) — markdown comment text (≥10 chars)

Frontmatter configuration (aligned with gh-aw's \�dd-comment)

\\yaml
safe-outputs:
comment-on-work-item:
max: 3 # default: 1
target: "area:4x4\QED" # required — see modes below
\\

Target modes (required, no default)

Mode Syntax Behavior
Specific ID \ arget: 12345\ Only this work item
List of IDs \ arget: [12345, 67890]\ Any listed work item
Area path \ arget: "area:4x4\QED"\ Work items under area path prefix (validated via API)
Unrestricted \ arget: "*"\ Any work item (operator must opt in)

ADO API

\POST /_apis/wit/workItems/{id}/comments?api-version=7.1-preview.4\

Testing

All 367 tests pass (334 unit + 19 integration + 5 doc + 9 additional), 0 clippy errors.

Add a new safe output tool that allows agents to comment on existing
Azure DevOps work items. This is the ADO equivalent of gh-aw's
add-comment tool.

Features:
- Agent provides work_item_id and body (markdown comment text)
- Required 'target' field in frontmatter scopes which work items
  can be commented on: wildcard, specific ID(s), or area path prefix
- max field (default: 1) limits comments per run
- Area path targets validated via ADO API at Stage 2
- Compile-time validation ensures target is specified

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant