@comfanion/workflow 4.38.1-dev.6 → 4.38.1-dev.8

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfanion/workflow",
3
- "version": "4.38.1-dev.6",
3
+ "version": "4.38.1-dev.8",
4
4
  "description": "Initialize OpenCode Workflow system for AI-assisted development with semantic code search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "4.38.1-dev.6",
3
- "buildDate": "2026-01-27T10:43:41.794Z",
2
+ "version": "4.38.1-dev.8",
3
+ "buildDate": "2026-01-27T11:22:36.149Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",
@@ -911,6 +911,74 @@ This is /dev-epic autopilot mode. Execute stories sequentially until epic done.`
911
911
  4. Update todo/story when task complete`
912
912
  }
913
913
 
914
+ function buildBriefing(agent: string | null, ss: SessionState | null, ctx: SessionContext, readCommands: string): string {
915
+ const lines: string[] = []
916
+
917
+ // 1. WHO you are
918
+ if (agent) {
919
+ lines.push(`You are @${agent} (→ .opencode/agents/${agent}.md).`)
920
+ }
921
+
922
+ // 2. WHAT you are doing
923
+ if (ss) {
924
+ const cmd = ss.command || "unknown command"
925
+ if (ss.epic) {
926
+ lines.push(`You are executing ${cmd} ${ss.epic.id}: ${ss.epic.title}.`)
927
+ } else if (ss.story) {
928
+ lines.push(`You are executing ${cmd} ${ss.story.id}: ${ss.story.title}.`)
929
+ } else {
930
+ lines.push(`You are executing ${cmd}.`)
931
+ }
932
+ } else if (ctx.activeCommand) {
933
+ lines.push(`You are executing ${ctx.activeCommand}.`)
934
+ }
935
+
936
+ // 3. WHERE you stopped
937
+ if (ss?.story) {
938
+ const task = ss.story.current_task || "review"
939
+ lines.push(`You were on story ${ss.story.id}: ${ss.story.title}, task ${task}.`)
940
+ if (ss.story.completed_tasks.length > 0) {
941
+ lines.push(`Completed: ${ss.story.completed_tasks.join(", ")}.`)
942
+ }
943
+ if (ss.story.pending_tasks.length > 0) {
944
+ lines.push(`Remaining: ${ss.story.pending_tasks.join(", ")}.`)
945
+ }
946
+ } else if (ss?.epic) {
947
+ lines.push(`Epic progress: ${ss.epic.progress}.`)
948
+ } else if (ctx.story) {
949
+ lines.push(`You were on story: ${ctx.story.title}, task ${ctx.story.currentTask || "review"}.`)
950
+ }
951
+
952
+ // 4. WHAT to do next
953
+ if (ss?.next_action) {
954
+ lines.push(`\nNext action: ${ss.next_action}`)
955
+ }
956
+
957
+ // 5. READ these files
958
+ lines.push(`\n${readCommands}`)
959
+
960
+ // 6. KEY DECISIONS (if any)
961
+ if (ss?.key_decisions && ss.key_decisions.length > 0) {
962
+ lines.push(`\nKey decisions from your session:`)
963
+ for (const d of ss.key_decisions) {
964
+ lines.push(`- ${d}`)
965
+ }
966
+ }
967
+
968
+ // 7. TODO status (brief)
969
+ if (ctx.todos.length > 0) {
970
+ const inProgress = ctx.todos.filter(t => t.status === "in_progress")
971
+ const pending = ctx.todos.filter(t => t.status === "pending")
972
+ const completed = ctx.todos.filter(t => t.status === "completed")
973
+ lines.push(`\nTODO: ${completed.length} done, ${inProgress.length} in progress, ${pending.length} pending.`)
974
+ }
975
+
976
+ // 8. RULES
977
+ lines.push(`\nDO NOT ask user what to do. Read files above, then resume automatically.`)
978
+
979
+ return lines.join("\n")
980
+ }
981
+
914
982
  return {
915
983
  // Track active agent from chat messages
916
984
  "chat.message": async (input, output) => {
@@ -967,24 +1035,10 @@ This is /dev-epic autopilot mode. Execute stories sequentially until epic done.`
967
1035
  const instructions = await formatInstructions(ctx)
968
1036
  const readCommands = await generateReadCommands(agent, ctx.story, ctx.activeCommand, ctx.sessionState)
969
1037
 
970
- // Agent identity reminder
971
- const agentIdentity = agent
972
- ? `You are @${agent} (.opencode/agents/${agent}.md). Load your persona and continue.`
973
- : "You are an AI assistant helping with this project."
974
-
975
- output.context.push(`# Session Continuation
976
-
977
- ${agentIdentity}
978
-
979
- ${readCommands}
980
-
981
- ---
982
-
983
- ${context}
984
-
985
- ---
986
-
987
- ${instructions}`)
1038
+ // Build agentic briefing
1039
+ const ss = ctx.sessionState
1040
+ const briefing = buildBriefing(agent, ss, ctx, readCommands)
1041
+ output.context.push(briefing)
988
1042
 
989
1043
  await log(directory, ` -> output.context pushed (${output.context.length} items)`)
990
1044
  await log(directory, `=== COMPACTION DONE ===`)
@@ -40,7 +40,7 @@ metadata:
40
40
  </phase>
41
41
 
42
42
  <phase name="2-init" title="Initialize Epic">
43
- <step n="1">Parse epic file → extract story list</step>
43
+ <step n="1">Parse epic file → "Story Tasks" section has all stories + tasks (no need to read story files yet)</step>
44
44
  <step n="2">Create epic state: docs/sprint-artifacts/sprint-N/.sprint-state/epic-XX-state.yaml</step>
45
45
  <step n="3">Create TODO list with IDs — stories, their tasks, and reviews:
46
46
  ```
@@ -79,10 +79,10 @@ Epic is complete when:
79
79
 
80
80
  ## Stories
81
81
 
82
- | ID | Title | Size | Focus | Status |
83
- |----|-------|------|-------|--------|
84
- | S{{E}}-01 | {{title}} | S/M/L | → Unit: `{{unit}}` | ⬜ |
85
- | S{{E}}-02 | {{title}} | S/M/L | → Unit: `{{unit}}` | ⬜ |
82
+ | ID | Title | Size | File | Status |
83
+ |----|-------|------|------|--------|
84
+ | E{{E}}-S01 | {{title}} | S/M/L | `story-{{E}}-01-{{slug}}.md` | ⬜ |
85
+ | E{{E}}-S02 | {{title}} | S/M/L | `story-{{E}}-02-{{slug}}.md` | ⬜ |
86
86
 
87
87
  **Dependency Flow:**
88
88
  ```
@@ -91,8 +91,32 @@ S01 ──► S02 ──► S03
91
91
  └──► S04
92
92
  ```
93
93
 
94
- **Notes:**
95
- - {{implementation_note}}
94
+ ---
95
+
96
+ ## Story Tasks
97
+
98
+ <!-- This section is populated by /stories command.
99
+ Used by /dev-epic to build TODO without reading all story files. -->
100
+
101
+ ### E{{E}}-S01: {{story title}}
102
+ - E{{E}}-S01-T01: {{task title}}
103
+ - E{{E}}-S01-T02: {{task title}}
104
+
105
+ ### E{{E}}-S02: {{story title}}
106
+ - E{{E}}-S02-T01: {{task title}}
107
+ - E{{E}}-S02-T02: {{task title}}
108
+
109
+ <!-- Example:
110
+ ### E04-S01: Merge Domain Logic
111
+ - E04-S01-T01: MergeResult value object
112
+ - E04-S01-T02: Merge service — primary selection
113
+ - E04-S01-T03: Unit tests
114
+
115
+ ### E04-S02: Auto Merge on Link
116
+ - E04-S02-T01: Event handler for link
117
+ - E04-S02-T02: Best-effort merge logic
118
+ - E04-S02-T03: Integration tests
119
+ -->
96
120
 
97
121
  ---
98
122
 
@@ -233,6 +233,26 @@ T1 ──► T2 ──► T3
233
233
 
234
234
  Save to: `docs/sprint-artifacts/sprint-[N]/stories/story-[EPIC]-[NN]-[description].md`
235
235
 
236
+ ## MANDATORY: Update Epic File
237
+
238
+ After creating stories, update the parent epic's **Story Tasks** section.
239
+ This lets `/dev-epic` build TODO from epic file alone — no need to read all stories.
240
+
241
+ ```markdown
242
+ ## Story Tasks
243
+
244
+ ### E04-S01: Merge Domain Logic
245
+ - E04-S01-T01: MergeResult value object
246
+ - E04-S01-T02: Merge service — primary selection
247
+ - E04-S01-T03: Unit tests
248
+
249
+ ### E04-S02: Auto Merge on Link
250
+ - E04-S02-T01: Event handler for link
251
+ - E04-S02-T02: Best-effort merge logic
252
+ ```
253
+
254
+ **Format:** `E{NN}-S{NN}-T{NN}: {task title}` — one line per task.
255
+
236
256
  ## Related Skills
237
257
 
238
258
  - `acceptance-criteria` - For detailed AC