@windyroad/itil 0.10.0 → 0.10.1-preview.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wr-itil:work-problems
|
|
3
3
|
description: Batch-work ITIL problem tickets while the user is AFK. Loops through the problem backlog by WSJF priority, delegating each problem to wr-itil:manage-problem, and stops when nothing is left to progress. Use this skill whenever the user says things like "work through my problems", "grind problems", "work the backlog", "work problems while I'm away", "process problems AFK", or any request to autonomously work through multiple problem tickets without interactive input. Also trigger when the user asks to "loop" or "batch" problem work, or says they'll be away and wants problems handled.
|
|
4
|
-
allowed-tools: Skill, Bash, Glob, Grep, Read
|
|
4
|
+
allowed-tools: Agent, Skill, Bash, Glob, Grep, Read
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Work Problems — AFK Batch Orchestrator
|
|
@@ -116,19 +116,47 @@ Record the category alongside the skip reason in the iteration report so Step 2.
|
|
|
116
116
|
|
|
117
117
|
If a problem is skipped by this step, add it to a "skipped" list with the reason and loop back to step 3 for the next one.
|
|
118
118
|
|
|
119
|
-
### Step 5: Work the problem
|
|
119
|
+
### Step 5: Work the problem (delegate via Agent tool, per P077)
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
**Delegate each iteration to a subagent via the Agent tool** — do NOT invoke `/wr-itil:manage-problem` inline via the Skill tool. Inline Skill-tool invocation expands manage-problem's SKILL.md (500+ lines) into the main orchestrator's context every iteration, accumulates across the AFK loop, and causes silent early-stop (`ALL_DONE` without a documented stop condition firing). This delegation is the AFK iteration-isolation wrapper sub-pattern under ADR-032.
|
|
122
|
+
|
|
123
|
+
**Agent call shape:**
|
|
124
|
+
|
|
125
|
+
- `subagent_type`: `general-purpose` — Option B pinned in P077. Iteration work is general engineering, not specialised domain expertise, and `general-purpose` has `Tools: *` so the subagent can recursively invoke architect / jtbd / risk-scorer subagents for its own gate reviews. Promotion to a typed `wr-itil:work-problems-iteration-worker` subagent remains available if a specialised constraint ever emerges; until then, typing it would just duplicate manage-problem's "always do X" preamble.
|
|
126
|
+
- `description`: `Work P<NNN> (<title>)` — one iteration, identified by the highest-WSJF ticket selected in Steps 3–4.
|
|
127
|
+
- `prompt` (self-contained — the subagent has no prior conversation context):
|
|
128
|
+
1. **Context**: this is one iteration of the AFK work-problems loop. The user is AFK. The orchestrator selected `P<NNN> (<title>)` as the highest-WSJF actionable ticket.
|
|
129
|
+
2. **Task**: apply the `/wr-itil:manage-problem` workflow for `work highest WSJF problem that can be progressed non-interactively as the user is AFK`. Follow manage-problem SKILL.md verbatim, including architect / jtbd / style-guide / voice-tone gate reviews and the commit gate (manage-problem Step 11).
|
|
130
|
+
3. **Constraints**: commit the completed work per ADR-014. Do NOT push, do NOT run `push:watch`, do NOT run `release:watch` — the orchestrator's Step 6.5 owns release cadence. Do NOT invoke `capture-*` background skills (AFK carve-out — ADR-032). Non-interactive defaults apply per ADR-013 Rule 6.
|
|
131
|
+
4. **Return the iteration summary** (see contract below).
|
|
132
|
+
|
|
133
|
+
**Return-summary contract.** The subagent's final message MUST end with a structured summary block the orchestrator parses without re-reading tool calls. Required fields:
|
|
122
134
|
|
|
123
135
|
```
|
|
124
|
-
|
|
136
|
+
ITERATION_SUMMARY
|
|
137
|
+
ticket_id: P<NNN>
|
|
138
|
+
ticket_title: <title>
|
|
139
|
+
action: worked | skipped
|
|
140
|
+
outcome: closed | verifying | known-error | investigated | scope-expanded | partial-progress | skipped
|
|
141
|
+
committed: true | false | skipped
|
|
142
|
+
commit_sha: <sha> # required when committed=true
|
|
143
|
+
reason: <one-line> # required when committed=false or action=skipped
|
|
144
|
+
skip_reason_category: user-answerable | architect-design | upstream-blocked # required when action=skipped
|
|
145
|
+
outstanding_questions: [<one-line each>] # optional; drives Step 2.5 when skip_reason_category=user-answerable
|
|
146
|
+
remaining_backlog_count: <N>
|
|
147
|
+
notes: <one-line>
|
|
125
148
|
```
|
|
126
149
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
-
|
|
150
|
+
Architect review (R2) requires the commit state fields (`committed` / `commit_sha` / `reason`) so **Step 6.75's Dirty-for-known-reason branch stays evaluable** from the summary alone. JTBD review requires `ticket_id` / `action` / `skip_reason_category` / `outstanding_questions` so Step 2.5 and the Output Format's Completed / Skipped / Outstanding Design Questions tables can be populated deterministically without the orchestrator having to re-parse ticket files.
|
|
151
|
+
|
|
152
|
+
**Inter-iteration continuity.** Step 6.5 (release-cadence check) and Step 6.75 (inter-iteration verification) stay in the **main orchestrator's turn**, NOT the iteration subagent. Rationale: release-cadence and `git status --porcelain` are orchestration-level concerns; `push:watch`/`release:watch` are long-running waits that would waste iteration-subagent context; the orchestrator needs to see the summary from one iteration before deciding whether to drain before the next.
|
|
153
|
+
|
|
154
|
+
The manage-problem skill (running inside the iteration subagent) will:
|
|
155
|
+
|
|
156
|
+
- Run a review if the cache is stale.
|
|
157
|
+
- Select and work the highest-WSJF problem.
|
|
158
|
+
- Use its built-in non-interactive fallbacks (auto-split multi-concern problems, auto-commit when risk is within appetite).
|
|
159
|
+
- Commit completed work per ADR-014 (the iteration subagent's commit — the orchestrator does NOT commit from its main turn).
|
|
132
160
|
|
|
133
161
|
### Step 6: Report progress
|
|
134
162
|
|
|
@@ -198,6 +226,7 @@ When `AskUserQuestion` is unavailable or the user is AFK, the skill (and the del
|
|
|
198
226
|
|
|
199
227
|
| Decision Point | Non-Interactive Default |
|
|
200
228
|
|---|---|
|
|
229
|
+
| How each iteration runs (iteration delegation) | Delegate to `subagent_type: general-purpose` via the Agent tool per Step 5 — NOT inline Skill-tool invocation. This is the AFK iteration-isolation wrapper sub-pattern under ADR-032; the main orchestrator consumes the iteration subagent's return-summary contract and does not re-read the subagent's tool calls. Per P077 + ADR-032. |
|
|
201
230
|
| Which problem to work | Highest WSJF, no prompt needed |
|
|
202
231
|
| Multi-concern split | Auto-split (manage-problem step 4b fallback) |
|
|
203
232
|
| Scope expansion during work | Update problem file, re-score WSJF, move to next problem instead of continuing |
|
|
@@ -256,3 +285,20 @@ ALL_DONE
|
|
|
256
285
|
```
|
|
257
286
|
|
|
258
287
|
When every skipped ticket is in the `upstream-blocked` category (stop-condition #3) or there are no skipped tickets (stop-condition #1), omit the Outstanding Design Questions section entirely rather than rendering an empty heading.
|
|
288
|
+
|
|
289
|
+
## Related
|
|
290
|
+
|
|
291
|
+
- **P077** (`docs/problems/077-work-problems-step-5-does-not-delegate-to-subagent.verifying.md`) — driver for Step 5's Agent-tool delegation and the return-summary contract.
|
|
292
|
+
- **P036** — inter-iteration verification (Step 6.75); remains in the orchestrator's main turn.
|
|
293
|
+
- **P040** — origin-fetch preflight (Step 0); unchanged.
|
|
294
|
+
- **P041** — release-cadence drain (Step 6.5); remains in the orchestrator's main turn.
|
|
295
|
+
- **P053** — Outstanding Design Questions surfacing at stop-condition #2 (Step 2.5); fed by the iteration subagent's `outstanding_questions` field.
|
|
296
|
+
- **ADR-013** (`docs/decisions/013-structured-user-interaction-for-governance-decisions.proposed.md`) — Rule 6 non-interactive fail-safe applies to every iteration-subagent decision surface.
|
|
297
|
+
- **ADR-014** (`docs/decisions/014-governance-skills-commit-their-own-work.proposed.md`) — preserved under the iteration subagent; the subagent commits its own work.
|
|
298
|
+
- **ADR-015** (`docs/decisions/015-on-demand-assessment-skills.proposed.md`) — Agent-tool-vs-Skill-tool delegation precedent (Step 6.5's wording mirror).
|
|
299
|
+
- **ADR-018** (`docs/decisions/018-release-cadence.proposed.md`) — release cadence stays in the orchestrator's main turn, not the iteration subagent.
|
|
300
|
+
- **ADR-019** (`docs/decisions/019-afk-orchestrator-preflight.proposed.md`) — preflight stays in the orchestrator's main turn.
|
|
301
|
+
- **ADR-022** (`docs/decisions/022-problem-verification-pending.proposed.md`) — iteration outcomes map into the return-summary's `outcome` field (`verifying` for a released fix, `known-error` for a root-cause-confirmed ticket awaiting release, etc.).
|
|
302
|
+
- **ADR-032** (`docs/decisions/032-governance-skill-invocation-patterns.proposed.md`) — pattern taxonomy parent; Step 5 is the canonical AFK iteration-isolation wrapper sub-pattern per the ADR-032 amendment that lands with P077.
|
|
303
|
+
- **ADR-037** (`docs/decisions/037-skill-testing-strategy.proposed.md`) — doc-lint bats contract-assertion pattern used by `test/work-problems-step-5-delegation.bats`.
|
|
304
|
+
- **JTBD-001**, **JTBD-006**, **JTBD-101**, **JTBD-201** — personas whose reliability expectations the iteration-isolation wrapper restores.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env bats
|
|
2
|
+
# Doc-lint guard: work-problems SKILL.md Step 5 must delegate each iteration
|
|
3
|
+
# to a subagent via the Agent tool. Option B is pinned — reuse subagent_type
|
|
4
|
+
# `general-purpose`; no typed iteration-worker.
|
|
5
|
+
#
|
|
6
|
+
# Structural assertion — Permitted Exception to the source-grep ban (ADR-005
|
|
7
|
+
# / P011). These tests assert that the skill specification document encodes
|
|
8
|
+
# the delegation contract so context does not accumulate across iterations
|
|
9
|
+
# in the main orchestrator's turn.
|
|
10
|
+
#
|
|
11
|
+
# @problem P077
|
|
12
|
+
# @jtbd JTBD-006
|
|
13
|
+
#
|
|
14
|
+
# Cross-reference:
|
|
15
|
+
# P077 (work-problems Step 5 does not delegate to subagent)
|
|
16
|
+
# ADR-015 (on-demand assessment skills — Agent-vs-Skill tool precedent)
|
|
17
|
+
# ADR-032 (governance skill invocation patterns — AFK iteration-isolation
|
|
18
|
+
# wrapper sub-pattern)
|
|
19
|
+
# ADR-037 (skill testing strategy — contract-assertion pattern)
|
|
20
|
+
# JTBD-006 (Progress the Backlog While I'm Away)
|
|
21
|
+
|
|
22
|
+
setup() {
|
|
23
|
+
SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
24
|
+
SKILL_FILE="${SKILL_DIR}/SKILL.md"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@test "SKILL.md cites P077 (Step 5 delegation)" {
|
|
28
|
+
run grep -n "P077" "$SKILL_FILE"
|
|
29
|
+
[ "$status" -eq 0 ]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@test "SKILL.md Step 5 names the Agent tool explicitly" {
|
|
33
|
+
# Bare 'Invoke the manage-problem skill' would read as a Skill-tool
|
|
34
|
+
# invocation (in-process expansion). Step 5 must name the Agent tool
|
|
35
|
+
# the same way Step 6.5 does (per ADR-015).
|
|
36
|
+
run grep -niE "Step 5.{0,160}Agent tool|delegate.{0,60}Agent tool|via the Agent tool" "$SKILL_FILE"
|
|
37
|
+
[ "$status" -eq 0 ]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@test "SKILL.md Step 5 cites subagent_type general-purpose" {
|
|
41
|
+
# Option B pinned (per ticket 2026-04-21). The subagent_type must be
|
|
42
|
+
# explicit so a future refactor cannot silently drop back to Skill-tool.
|
|
43
|
+
run grep -nE "subagent_type.{0,20}general-purpose|general-purpose.{0,40}subagent" "$SKILL_FILE"
|
|
44
|
+
[ "$status" -eq 0 ]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@test "SKILL.md Step 5 specifies a return-summary contract" {
|
|
48
|
+
# The orchestrator must consume a structured summary from the subagent
|
|
49
|
+
# (not re-read the subagent's tool calls). Contract fields required by
|
|
50
|
+
# architect review (R2) and JTBD review extension.
|
|
51
|
+
run grep -niE "return.{0,30}summary|iteration summary|summary shape|summary contract" "$SKILL_FILE"
|
|
52
|
+
[ "$status" -eq 0 ]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@test "SKILL.md Step 5 return-summary contract carries commit state (R2)" {
|
|
56
|
+
# Architect R2: Step 6.75 inter-iteration verification needs the subagent
|
|
57
|
+
# to report committed / commit_sha / reason so the Dirty-for-known-reason
|
|
58
|
+
# branch stays evaluable.
|
|
59
|
+
run grep -niE "commit_sha|committed.*true|committed.*false|commit state" "$SKILL_FILE"
|
|
60
|
+
[ "$status" -eq 0 ]
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@test "SKILL.md Step 5 return-summary contract carries skip-reason category (JTBD extension)" {
|
|
64
|
+
# JTBD review: the summary's skip_reason_category is what Step 2.5 reads
|
|
65
|
+
# deterministically. Without it the Outstanding Design Questions table
|
|
66
|
+
# would have to re-parse ticket files.
|
|
67
|
+
run grep -niE "skip_reason_category|skip-reason category" "$SKILL_FILE"
|
|
68
|
+
[ "$status" -eq 0 ]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@test "SKILL.md allowed-tools frontmatter includes Agent" {
|
|
72
|
+
# P077 pre-existing latent bug (flagged by architect review): the skill
|
|
73
|
+
# already requires the Agent tool at Step 6.5 but allowed-tools omits it.
|
|
74
|
+
# Fixing Step 5 is the right place to close the latent bug.
|
|
75
|
+
run grep -nE "^allowed-tools:.*Agent" "$SKILL_FILE"
|
|
76
|
+
[ "$status" -eq 0 ]
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@test "SKILL.md Non-Interactive Decision Making table covers iteration delegation" {
|
|
80
|
+
# Architect + ticket requirement: the non-interactive defaults table must
|
|
81
|
+
# include a row for 'how each iteration runs' (delegated via Agent tool).
|
|
82
|
+
run grep -niE "iteration delegation|delegate.*iteration|iteration.*subagent|iteration.*general-purpose" "$SKILL_FILE"
|
|
83
|
+
[ "$status" -eq 0 ]
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@test "SKILL.md Related section cites ADR-032 (iteration-isolation wrapper)" {
|
|
87
|
+
# Architect R3: ADR-032 is amended with the AFK iteration-isolation
|
|
88
|
+
# sub-pattern; SKILL.md must cite it so the contract-to-ADR traceability
|
|
89
|
+
# ADR-037 requires is complete.
|
|
90
|
+
run grep -nE "ADR-032" "$SKILL_FILE"
|
|
91
|
+
[ "$status" -eq 0 ]
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@test "SKILL.md Step 5 preserves inter-iteration continuity (Steps 6.5 / 6.75 remain in orchestrator)" {
|
|
95
|
+
# Architect review confirmation: Step 6.5 (release cadence) and Step 6.75
|
|
96
|
+
# (inter-iteration verification) stay in the main orchestrator's turn.
|
|
97
|
+
# The iteration subagent must NOT run push:watch/release:watch.
|
|
98
|
+
run grep -niE "orchestrator.{0,80}Step 6\\.5|Step 6\\.5.{0,80}orchestrator|Step 6\\.75.{0,80}orchestrator|orchestrator.{0,80}Step 6\\.75|main orchestrator|orchestrator.{0,40}main turn|main.turn.{0,40}orchestrator" "$SKILL_FILE"
|
|
99
|
+
[ "$status" -eq 0 ]
|
|
100
|
+
}
|