Skip to content

Commit a6b4790

Browse files
jwaldripclaude
andcommitted
feat: add completion announcements, risk descriptions, iteration cap, and bolt terminology
- Add announcements field to intent.md frontmatter and Phase 5.9 prompt to configure changelog, release-notes, social-posts, blog-draft generation - Generate announcement artifacts on intent completion (advance Step 5) - Add risk section to unit template and unit decomposition checklist - Add 50-iteration safety cap in advance Step 3 to prevent infinite loops - Skip integrator for bolt change_strategy (in addition to single-unit) - Add Bolt terminology mapping to ai-dlc-fundamentals skill Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent df3b4c6 commit a6b4790

File tree

4 files changed

+105
-10
lines changed

4 files changed

+105
-10
lines changed

plugin/skills/advance/SKILL.md

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@ READY_COUNT=$(echo "$DAG_SUMMARY" | han parse json readyCount -r)
112112
```javascript
113113
if (dagSummary.allComplete) {
114114
// ALL UNITS COMPLETE - Check if integrator should run
115-
// Skip integrator for single-unit intents (reviewer already validated it)
115+
// Skip integrator for:
116+
// - Single-unit intents (reviewer already validated it)
117+
// - change_strategy "bolt" (single squashed branch, no multi-unit merge)
116118
const unitCount = dagSummary.totalCount;
117-
if (unitCount > 1 && !state.integratorComplete) {
119+
const changeStrategy = config.change_strategy || "unit";
120+
const skipIntegrator = unitCount <= 1 || changeStrategy === "bolt";
121+
if (!skipIntegrator && !state.integratorComplete) {
118122
// Spawn integrator on the intent branch
119123
// See Step 2e below
120124
return spawnIntegrator();
@@ -266,10 +270,28 @@ The re-queued units will be picked up on the next `/construct` cycle through the
266270
### Step 3: Update State
267271

268272
```bash
273+
# Increment iteration counter
274+
ITERATION=$(echo "$STATE" | han parse json iteration -r --default 1)
275+
ITERATION=$((ITERATION + 1))
276+
277+
# Safety cap: prevent infinite loops
278+
MAX_ITERATIONS=50
279+
if [ "$ITERATION" -ge "$MAX_ITERATIONS" ]; then
280+
echo "## Safety Limit Reached"
281+
echo ""
282+
echo "Construction has reached ${MAX_ITERATIONS} iterations without completing."
283+
echo "This likely indicates poorly specified criteria or a systematic issue."
284+
echo ""
285+
echo "**Action required:** Review the intent and unit specs, then run \`/construct\` to resume."
286+
STATE=$(echo "$STATE" | han parse json --set "status=blocked" --set "iteration=$ITERATION")
287+
han keep save iteration.json "$STATE"
288+
exit 0
289+
fi
290+
269291
# Update hat and signal SessionStart to increment iteration
270292
# Intent-level state saved to current branch (intent branch)
271-
# state.hat = nextHat, state.needsAdvance = true
272-
han keep save iteration.json '<updated JSON with hat and needsAdvance>'
293+
# state.hat = nextHat, state.iteration = ITERATION
294+
han keep save iteration.json '<updated JSON with hat and iteration>'
273295
```
274296

275297
### Step 4: Confirm (Normal Advancement)
@@ -316,6 +338,32 @@ Intent branch ready: ai-dlc/{intent-slug}/main → ${DEFAULT_BRANCH}
316338
Create PR: gh pr create --base ${DEFAULT_BRANCH} --head ai-dlc/{intent-slug}/main
317339
```
318340

341+
### Completion Announcements
342+
343+
If the intent has configured `announcements` in its frontmatter, generate each format:
344+
345+
```bash
346+
ANNOUNCEMENTS=$(han parse yaml announcements < "$INTENT_DIR/intent.md" 2>/dev/null || echo "[]")
347+
```
348+
349+
For each configured format, generate the announcement artifact in `.ai-dlc/{intent-slug}/`:
350+
351+
| Format | File | Content |
352+
|--------|------|---------|
353+
| `changelog` | `CHANGELOG-entry.md` | Conventional changelog entry (Added/Changed/Fixed sections) |
354+
| `release-notes` | `release-notes.md` | User-facing feature summary in plain language |
355+
| `social-posts` | `social-posts.md` | Platform-optimized snippets (Twitter/LinkedIn ready) |
356+
| `blog-draft` | `blog-draft.md` | Long-form announcement with context, examples, and impact |
357+
358+
Generate each from the intent's Problem/Solution, completed units, and success criteria. Commit the announcement artifacts:
359+
360+
```bash
361+
git add .ai-dlc/${INTENT_SLUG}/
362+
git commit -m "announce: generate completion announcements for ${INTENT_SLUG}"
363+
```
364+
365+
Skip this step if `announcements` is empty or `[]`.
366+
319367
Then ask the user how to deliver using `AskUserQuestion`:
320368

321369
```json

plugin/skills/ai-dlc-fundamentals/SKILL.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ Each iteration:
138138
3. Makes progress (guided by criteria and backpressure)
139139
4. Saves state (for next iteration)
140140

141-
## Hat-Based Workflows
141+
## Hat-Based Workflows (Bolts)
142142

143-
Different phases of work require different mindsets. AI-DLC uses "hats" to formalize this:
143+
Different phases of work require different mindsets. AI-DLC uses "hats" to formalize this.
144+
145+
**Terminology mapping:** In the AI-DLC paper, a **Bolt** is the smallest iteration cycle — one pass through the hat workflow for a unit. The plugin implements Bolts as hat sequences: each unit progresses through its workflow hats (e.g., planner → builder → reviewer), with reviewer rejection cycling back to the previous hat. One complete pass = one Bolt. Multiple rejections = multiple Bolts for that unit.
144146

145147
### Default Workflow
146148

@@ -152,9 +154,9 @@ planner → builder → reviewer
152154

153155
| Hat | Focus |
154156
|-----|-------|
155-
| Planner | Plan this iteration |
157+
| Planner | Plan this iteration (Bolt) |
156158
| Builder | Implement to spec |
157-
| Reviewer | Verify quality |
159+
| Reviewer | Verify quality — approve completes the Bolt, reject starts a new one |
158160

159161
### Hat Transitions
160162

plugin/skills/construct/SKILL.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,20 @@ INTEGRATOR_COMPLETE=$(echo "$STATE" | han parse json integratorComplete -r --def
554554
UNIT_COUNT=$(ls -1 "$INTENT_DIR"/unit-*.md 2>/dev/null | wc -l)
555555
```
556556

557-
Skip the integrator entirely if there is only one unit (the reviewer already validated it).
557+
Skip the integrator if:
558+
- Only one unit (the reviewer already validated it)
559+
- `change_strategy` is `bolt` (single squashed branch, no multi-unit merge)
558560

559-
If `UNIT_COUNT > 1` and `integratorComplete` is not `true`:
561+
```bash
562+
source "${CLAUDE_PLUGIN_ROOT}/lib/config.sh"
563+
CONFIG=$(get_ai_dlc_config "$INTENT_DIR")
564+
CHANGE_STRATEGY=$(echo "$CONFIG" | jq -r '.change_strategy // "unit"')
565+
SKIP_INTEGRATOR=false
566+
[ "$UNIT_COUNT" -le 1 ] && SKIP_INTEGRATOR=true
567+
[ "$CHANGE_STRATEGY" = "bolt" ] && SKIP_INTEGRATOR=true
568+
```
569+
570+
If `SKIP_INTEGRATOR` is false and `integratorComplete` is not `true`:
560571

561572
1. Load integrator hat instructions:
562573

plugin/skills/elaborate/SKILL.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ If yes, define each unit with **enough detail that a builder with zero prior con
452452
- **Technical specification**: Specific components, views, functions, or modules to create. If it's a UI, describe what the user sees and interacts with. If it's an API, describe the endpoints and their behavior. If it's a data layer, describe the transformations.
453453
- **Success criteria**: Specific, testable criteria that reference domain entities (not generic criteria like "displays data")
454454
- **Dependencies on other units**: What must be built first and why
455+
- **Risks**: What could go wrong? Security concerns, performance risks, integration fragility, data integrity issues. Each risk should note its impact and mitigation.
455456
- **What this unit is NOT**: Explicit boundaries to prevent scope creep. If another unit handles related concerns, say so.
456457

457458
**Bad unit description** (too vague, builder will guess wrong):
@@ -620,6 +621,35 @@ Map user selections to config values:
620621

621622
---
622623

624+
## Phase 5.9: Completion Announcements
625+
626+
Ask the user if they want announcement artifacts generated when the intent completes.
627+
628+
Use `AskUserQuestion`:
629+
```json
630+
{
631+
"questions": [{
632+
"question": "What announcement formats should be generated when this intent completes?",
633+
"header": "Announcements",
634+
"options": [
635+
{"label": "None", "description": "No announcements — just deliver the code"},
636+
{"label": "Changelog", "description": "Conventional changelog entry for developers"},
637+
{"label": "Release notes", "description": "User-facing feature summary"},
638+
{"label": "All formats", "description": "Changelog, release notes, social posts, and blog draft"}
639+
],
640+
"multiSelect": false
641+
}]
642+
}
643+
```
644+
645+
Map selections to the `announcements` array in intent.md frontmatter:
646+
- "None" → `[]`
647+
- "Changelog" → `[changelog]`
648+
- "Release notes" → `[changelog, release-notes]`
649+
- "All formats" → `[changelog, release-notes, social-posts, blog-draft]`
650+
651+
---
652+
623653
## Phase 6: Write AI-DLC Artifacts
624654

625655
Create the intent branch and worktree, then write files in `.ai-dlc/{intent-slug}/`:
@@ -653,6 +683,7 @@ git:
653683
change_strategy: {unit|intent|trunk|bolt}
654684
auto_merge: {true|false}
655685
auto_squash: false
686+
announcements: [] # e.g., [changelog, release-notes, social-posts, blog-draft]
656687
created: {ISO date}
657688
status: active
658689
epic: "" # Ticketing provider epic key (auto-populated if ticketing provider configured)
@@ -729,6 +760,9 @@ misinterpret what to build.}
729760
- [ ] {Criterion referencing specific domain entities, not generic}
730761
- [ ] {Another criterion}
731762

763+
## Risks
764+
- **{Risk}**: {impact}. Mitigation: {how to address it}.
765+
732766
## Boundaries
733767
{What this unit does NOT handle. Reference which other units own related concerns.}
734768

0 commit comments

Comments
 (0)