Pr Rework
Reworks a pull request after review: reads review comments, implements the requested fixes, and pushes updates to the PR branch.
Parameters
Configured via customParams in the agent JSON or the project .dmtools/config.js (project values win).
-
autoStartReview— whentrue, automatically trigger the PR review workflow after this agent finishes. -
autoStartReviewConfigFile— agent config file used for the auto-started review workflow. -
branchCreateFnPath— path to a JS hook that creates the feature branch (two-branch flow customization). -
branchSyncFnPath— path to a JS hook that syncs the base branch before rebasing. -
cacheToReleases— when enabled, caches the workspace into a git release so later runs restore instead of re-cloning. -
autoSaveCommitMessage— optional template for the periodic WIP auto-save commit made by the timer (default{ticketKey} WIP auto-save {timestamp}; alsoformats.commitMessage.autoSavein the project config). Use it when the target repo’s commit-msg hook requires a tracker key, e.g.AB#{ticketKey} WIP auto-save {timestamp}. -
squashReworkWip— settrueto fold the timer’sWIP auto-savecommits (and the rework commit) since the rework base into ONE commit with theformats.commitMessage.reworkmessage before the push, using--force-with-lease. Skipped (history untouched) when the base is unknown, a merge or a foreign commit is in the range, or there is only one commit. Default off. -
checkOpenPR— whentrue, skip tickets that already have an open pull request for this work. -
removeLabel— label removed from the ticket after a successful run (idempotency cleanup). -
removeLabels— list of labels removed from the ticket after a successful run. -
scmProvider— SCM provider override (github,gitlab, …) for this run. -
targetRepository— repository override block (owner,repo,baseBranch,workingDir) — run the work against this repository instead of the project default. -
responseTarget:"scm"—outputs/response.mdbecomes the PR body/comment, so the output-format prompt is GitHub-Flavored Markdown even on Jira (conditionsisResponseToScm.js/isResponseToTracker.js).
Human doc: agents/docs/agents/pr_rework.md
Attributes
| Attribute | Value |
|---|---|
| Job | Teammate |
| Config | pr_rework.json |
| ContextId | pr_rework |
| outputType | none |
| skipAIProcessing | true |
Prompt snapshot
Full prompt / instruction set: agents/snapshots/pr_rework.md
Actions
preJSAction: checkWipLabel.js
Check WIP Label Pre-Action
- Source:
agents/js/checkWipLabel.js - Parameters (customParams):
branchCreateFnPathcheckOpenPRdryRun
preCliJSAction: preCliReworkSetup.js
Pre-CLI Rework Setup Action (preCliJSAction for pr_rework agent)
- Source:
agents/js/preCliReworkSetup.js - Writes:
outputs/pr_base_branch.txt
- Side effects:
- post ticket comment (via tracker)
- move ticket to status (via tracker)
- git merge
- Parameters (customParams):
aiRepositoryallowApproveWithSuggestionsartefactRepositorybranchCreateFnPathbranchSyncFnPathchildQuestionscommentMarkupcontextsdryRunfeedbackLoop.qualityGates.gatesfieldsimportantBlocksApprovaljqlmaxReviewThreadsBeforeForceApproveparentContextFetchrestoreFromReleasesscmProvidersetupCommandstargetRepository
postJSAction: pushReworkChanges.js
Push Rework Changes Post-Action
- Source:
agents/js/pushReworkChanges.js - Side effects:
- add label “agent:rework” (via tracker)
- post ticket comment (via tracker)
- move ticket to status (via tracker)
- assign ticket (via tracker)
- git checkout
- git merge
- git push
- Parameters (customParams):
aiRepositoryartefactRepositoryautoStartReviewautoStartReviewConfigFilecacheToReleasescommentMarkupconfigPathcontentOutputcontentOutput.targetdryRunfeedbackLooplocalTeammatemanagedSubmodulesprojectKeyproviderTransientBackoffSecpushSubmodulesremoveLabelremoveLabelsscmProvidersmFallbacksquashReworkWiptargetRepositorytrackerProvider
timerJSAction: timerAutoCommitAndSave.js
Timer JS Action — Auto-commit, push, and save session artefacts
- Source:
agents/js/timerAutoCommitAndSave.js - Side effects:
- git push
- git merge
- Parameters (customParams):
aiRepositoryartefactRepositoryautoSaveCommitMessagecacheToReleasescacheToReleases.releaseNameTemplatecacheToReleases.releaseTagTemplatescmProvidertargetRepository
LLM step
- outputType:
none - Prompt snapshot:
agents/snapshots/pr_rework.md
Custom params
-
responseTarget:"scm" -
removeLabels:[ "sm_story_rework_triggered", "sm_story_review_triggered", "agent:rework" ] -
checkOpenPR:true -
branchCreateFnPath(used by JS action) -
dryRun(used by JS action) -
aiRepository(used by JS action) -
allowApproveWithSuggestions(used by JS action) -
artefactRepository(used by JS action) -
branchSyncFnPath(used by JS action) -
childQuestions(used by JS action) -
commentMarkup(used by JS action) -
contexts(used by JS action) -
feedbackLoop.qualityGates.gates(used by JS action) -
fields(used by JS action) -
importantBlocksApproval(used by JS action) -
jql(used by JS action) -
maxReviewThreadsBeforeForceApprove(used by JS action) -
parentContextFetch(used by JS action) -
restoreFromReleases(used by JS action) -
scmProvider(used by JS action) -
setupCommands(used by JS action) -
targetRepository(used by JS action) -
autoStartReview(used by JS action) -
autoStartReviewConfigFile(used by JS action) -
cacheToReleases(used by JS action) -
configPath(used by JS action) -
contentOutput(used by JS action) -
contentOutput.target(used by JS action) -
feedbackLoop(used by JS action) -
localTeammate(used by JS action) -
managedSubmodules(used by JS action) -
projectKey(used by JS action) -
providerTransientBackoffSec(used by JS action) -
pushSubmodules(used by JS action) -
removeLabel(used by JS action) -
smFallback(used by JS action) -
squashReworkWip(used by JS action) -
trackerProvider(used by JS action) -
autoSaveCommitMessage(used by JS action) -
cacheToReleases.releaseNameTemplate(used by JS action) -
cacheToReleases.releaseTagTemplate(used by JS action)
Generated by js/agentDocGenerator.js