aiwcli 0.12.3 → 0.12.6

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.
Files changed (28) hide show
  1. package/dist/templates/_shared/.claude/commands/handoff-resume.md +8 -60
  2. package/dist/templates/_shared/.claude/commands/handoff.md +6 -192
  3. package/dist/templates/_shared/.codex/workflows/handoff.md +1 -1
  4. package/dist/templates/_shared/.windsurf/workflows/handoff.md +1 -1
  5. package/dist/templates/_shared/handoff-system/CLAUDE.md +421 -0
  6. package/dist/templates/_shared/{lib-ts/handoff → handoff-system/lib}/document-generator.ts +10 -11
  7. package/dist/templates/_shared/{lib-ts/handoff → handoff-system/lib}/handoff-reader.ts +5 -6
  8. package/dist/templates/_shared/{scripts → handoff-system/scripts}/resume_handoff.ts +7 -7
  9. package/dist/templates/_shared/{scripts → handoff-system/scripts}/save_handoff.ts +145 -34
  10. package/dist/templates/_shared/handoff-system/workflows/handoff-resume.md +66 -0
  11. package/dist/templates/_shared/{workflows → handoff-system/workflows}/handoff.md +6 -6
  12. package/dist/templates/_shared/hooks-ts/session_end.ts +58 -45
  13. package/dist/templates/_shared/hooks-ts/session_start.ts +62 -50
  14. package/dist/templates/_shared/lib-ts/base/inference.ts +2 -2
  15. package/dist/templates/_shared/lib-ts/base/state-io.ts +76 -4
  16. package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +56 -0
  17. package/dist/templates/_shared/lib-ts/context/context-formatter.ts +8 -2
  18. package/dist/templates/_shared/lib-ts/context/context-selector.ts +79 -70
  19. package/dist/templates/_shared/lib-ts/context/context-store.ts +58 -14
  20. package/dist/templates/_shared/lib-ts/types.ts +9 -3
  21. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/claude-agent.ts +1 -0
  22. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/orchestrator-claude-agent.ts +1 -0
  23. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-indexer.ts +10 -11
  24. package/oclif.manifest.json +1 -1
  25. package/package.json +1 -1
  26. /package/dist/templates/cc-native/.claude/commands/{rlm → cc-native/rlm}/ask.md +0 -0
  27. /package/dist/templates/cc-native/.claude/commands/{rlm → cc-native/rlm}/index.md +0 -0
  28. /package/dist/templates/cc-native/.claude/commands/{rlm → cc-native/rlm}/overview.md +0 -0
@@ -1,64 +1,12 @@
1
- # Resume Handoff
2
-
3
- Restore session context from a handoff document programmatically, then create actionable ISC tasks so work continues without re-discovering what was already learned.
4
-
5
- ## Arguments
6
-
7
- - `$ARGUMENTS` - Optional path to a handoff folder or index.md. If omitted, auto-discovers the most recent handoff from the active context.
8
-
9
- ## Instructions
10
-
11
- ### Step 1: Gather Context via Script
12
-
13
- Run the resume script to collect and format all handoff sections:
14
-
15
- **If `$ARGUMENTS` is provided:**
16
- ```bash
17
- bun .aiwcli/_shared/scripts/resume_handoff.ts "$ARGUMENTS"
18
- ```
19
-
20
- **If `$ARGUMENTS` is empty:**
21
- The script auto-discovers the active context ID programmatically — no manual lookup needed:
22
- ```bash
23
- bun .aiwcli/_shared/scripts/resume_handoff.ts
24
- ```
25
-
26
- Present the script's output to the conversation. The output is already structured in priority order (dead ends first, then pending items, decisions, git delta, completed work, context notes).
1
+ ---
2
+ name: handoff-resume
3
+ description: Resume handoff
4
+ ---
27
5
 
28
- If the script exits with an error, show the error message and stop.
29
-
30
- ### Step 2: Create ISC Tasks
31
-
32
- Convert each actionable item from the script output into a task via `TaskCreate`:
33
- - Each pending issue from the **Pending Items** section
34
- - Each remaining plan item from the **Plan — Remaining Items** section
35
-
36
- Each task follows ISC format — ~8 words, states a desired end-state (not an action), and is binary testable in 2 seconds.
37
-
38
- **Example:**
39
-
40
- | Source | ISC Task |
41
- |--------|----------|
42
- | Pending: "Fix race condition in SessionStore" | "SessionStore handles concurrent access without race conditions" |
43
- | Plan remaining: "Add retry logic to API client" | "API client retries failed requests with exponential backoff" |
44
- | Next step: "Write tests for auth flow" | "Auth flow has passing integration test coverage" |
45
-
46
- ### Step 3: Confirm Ready
47
-
48
- After creating tasks, run `TaskList` and confirm ready to continue.
49
-
50
- ## Constraints
6
+ # Resume Handoff
51
7
 
52
- - Dead ends are presented verbatim from the script output never summarize or omit entries
53
- - ISC tasks use ~8-word end-state format, not action descriptions
54
- - Skip missing files gracefully (the script handles this)
55
- - If the script warns about staleness (>7 days), surface the warning prominently
8
+ Restore context from a handoff document and create ISC tasks. See `.aiwcli/_shared/handoff-system/workflows/handoff-resume.md` for complete process documentation.
56
9
 
57
- ## Success Criteria
10
+ **Quick trigger:** `/handoff-resume` or `/handoff-resume path/to/handoff`
58
11
 
59
- - [ ] Script ran successfully and output the structured briefing
60
- - [ ] Dead ends visible in conversation (not summarized)
61
- - [ ] Pending items converted to ISC tasks via TaskCreate
62
- - [ ] Plan completion percentage visible (if plan exists)
63
- - [ ] Git delta visible
64
- - [ ] Tasks confirmed via TaskList
12
+ The workflow uses the resume script to load handoff sections and convert pending items to tasks.
@@ -1,198 +1,12 @@
1
- # Handoff Workflow
2
-
3
- Generate a handoff document summarizing the current session's work, decisions, and pending items. Optionally update a plan document to track completed vs remaining tasks.
4
-
5
- ## Triggers
6
-
7
- - `/handoff` command
8
- - `/handoff path/to/PLAN.md` - with plan document integration
9
- - Phrases like "write a handoff", "create a session summary", "document what we did", "end session with notes"
10
-
11
- ## Philosophy
12
-
13
- Handoffs exist to minimize the token and time cost of session startup. A precise handoff lets the next session hit the ground running without rediscovering context through Explore agents or file searches.
14
-
15
- **Think: "What would I need to continue this work with zero prior context?"**
16
-
17
- Key principles:
18
- - **Absolute paths over vague references** — `C:\project\src\auth\handler.ts:45` not "handler.ts line 45"
19
- - **Specific locations over general areas** — Name the function/class/section, not just the file
20
- - **Enough detail to skip discovery** — Include enough context that the next session doesn't need to grep or search
21
- - **Self-contained decisions** — Capture the "why" and the "why not" so alternatives aren't re-explored
22
-
23
- A good handoff pays for itself in the first minute of the next session.
24
-
25
- ## Arguments
26
-
27
- - `$ARGUMENTS` - Optional path to a plan document. If provided, the handoff will:
28
- 1. Mark completed items in the plan with `[x]`
29
- 2. Add notes about partial progress
30
- 3. Append a "Session Progress" section to the plan
31
-
32
- ## Process
33
-
34
- ### Step 1: Gather Information
35
-
36
- 1. Review conversation history for:
37
- - Completed tasks and implementations
38
- - Key decisions and their rationale
39
- - Failed approaches (to avoid repeating)
40
- - External context (deadlines, stakeholder requirements)
41
-
42
- 2. Look for TODOs/FIXMEs mentioned in session
43
-
44
- 3. **If plan document provided**: Read the plan and identify:
45
- - Tasks that are now completed
46
- - Tasks that are partially done
47
- - Tasks that were attempted but blocked
48
- - New tasks discovered during implementation
49
-
50
- ### Step 2: Generate Document
51
-
52
- Use this template. The `<!-- SECTION: name -->` markers are required for the save script to parse sections into sharded files.
53
-
54
- ```markdown
55
- ---
56
- title: Session Handoff
57
- date: {ISO timestamp}
58
- session_id: {conversation ID if available}
59
- project: {project name from package.json, Cargo.toml, or directory name}
60
- plan_document: {path to plan if provided, or "none"}
61
- ---
62
-
63
- # Session Handoff — {Date}
64
-
65
- <!-- SECTION: summary -->
66
- ## Summary
67
- {2-3 sentences covering: (1) session goal, (2) what changed technically, (3) current state}
68
-
69
- Example: "Session goal: Implement JWT refresh tokens. Added refresh token generation in `C:\project\src\auth\tokens.ts:145-203` and rotation endpoint. Feature works but needs rate-limiting before production (see Pending Issues)."
70
-
71
- <!-- SECTION: completed -->
72
- ## Work Completed
73
-
74
- **Bad (requires exploration):**
75
- - Fixed auth bug
76
- - Updated tests
77
-
78
- **Good (exploration-free):**
79
- - Auth: Fixed JWT validation race condition in `C:\project\src\auth\handler.ts:67-89`
80
- - Issue: Token validation happened after user session creation → security gap
81
- - Fix: Moved validation to middleware, added async lock
82
- - Tests updated: `C:\project\tests\auth\handler.test.ts:45` now covers concurrent validation
83
-
84
- {Your work completed here, following the "Good" example format with absolute paths}
85
-
86
- <!-- SECTION: dead-ends -->
87
- ## Dead Ends — Do Not Retry
88
-
89
- These approaches were attempted and failed. Do not retry without addressing the root cause.
90
-
91
- | Approach | Why It Failed | Time Spent | Alternative |
92
- |----------|---------------|------------|-------------|
93
- | {What was attempted} | {Specific reason} | {Rough estimate} | {What to try instead} |
94
-
95
- <!-- SECTION: decisions -->
96
- ## Key Decisions
97
- {Technical choices with rationale. Format: **Decision**: Rationale. Trade-off: X.}
98
-
99
- <!-- SECTION: pending -->
100
- ## Pending Issues
101
- - [ ] {Issue} — {severity: HIGH/MED/LOW} {optional workaround note}
102
-
103
- <!-- SECTION: next-steps -->
104
- ## Next Steps
105
- 1. {Actionable item with absolute path and line number, e.g., C:\path\to\file.ts:123}
106
-
107
- <!-- SECTION: files -->
108
- ## Files Modified
109
- {Absolute paths with line numbers for significant changes. Skip formatting-only edits.}
110
-
111
- <!-- SECTION: context -->
112
- ## Context for Future Sessions
113
- {Non-obvious context: env quirks, stakeholder requirements}
114
-
115
- ```
116
-
117
- ### Step 3: Update Plan Document (if provided)
118
-
119
- If a plan document path was provided in `$ARGUMENTS`:
120
-
121
- 1. **Read the plan document**
122
- 2. **Identify completed items**:
123
- - Find checkboxes `- [ ]` that match completed work
124
- - Change them to `- [x]`
125
- 3. **Add progress notes** to items that are partially complete:
126
- - Append `(partial: {brief status})` to the line
127
- 4. **Append Session Progress section** at the bottom:
128
-
129
- ```markdown
130
-
131
1
  ---
132
-
133
- ## Session Progress Log
134
-
135
- ### {Date} — Session {session_id or timestamp}
136
-
137
- **Completed this session:**
138
- - [x] {Task from plan that was completed}
139
- - [x] {Another completed task}
140
-
141
- **Partially completed:**
142
- - {Task} — {current state, what remains}
143
-
144
- **Blocked/Deferred:**
145
- - {Task} — {reason, what's needed}
146
-
147
- **New items discovered:**
148
- - [ ] {New task not in original plan}
149
- - [ ] {Another new task}
150
-
2
+ name: handoff
3
+ description: Create handoff document
151
4
  ---
152
- ```
153
-
154
- 5. **If no plan document was provided**:
155
- - Skip plan creation - the handoff document serves as the session record
156
-
157
- ### Step 4: Save and Update Status
158
5
 
159
- Instead of writing the file directly, pipe your handoff content to the save script:
160
-
161
- ```bash
162
- bun .aiwcli/_shared/scripts/save_handoff.ts <<'EOF'
163
- {Your complete handoff markdown content from Step 2}
164
- EOF
165
- ```
166
-
167
- The script will automatically find the active context and create the handoff folder structure.
168
-
169
- ## Dead Ends Section Guidelines
170
-
171
- This section is critical for preventing context rot across sessions. Be specific:
172
-
173
- **Bad (too vague):**
174
- > - Tried using library X, didn't work
175
-
176
- **Good (actionable):**
177
- > ### Fixing the race condition in SessionStore
178
- > | Approach Tried | Why It Failed |
179
- > |----------------|---------------|
180
- > | `async-mutex` package | Deadlock when nested calls to `getSession()` |
181
- > | Redis WATCH/MULTI | Our Redis 6.x cluster doesn't support WATCH in cluster mode |
182
- > | In-memory lock Map | Works single-node but breaks in horizontal scaling |
183
- >
184
- > **What to try instead**: Upgrade to Redis 7.x which supports WATCH in cluster mode, or use Redlock algorithm
6
+ # Handoff Workflow
185
7
 
186
- **Capture these dead ends:**
187
- - Packages/libraries that had incompatibilities
188
- - Approaches that caused new bugs or regressions
189
- - Solutions that worked locally but failed in CI/staging/prod
190
- - Configurations that conflicted with existing setup
191
- - Rabbit holes that consumed significant time without progress
8
+ Generate a comprehensive handoff document for the next session. See `.aiwcli/_shared/handoff-system/workflows/handoff.md` for complete process documentation.
192
9
 
193
- ## Post-Generation Output
10
+ **Quick trigger:** `/handoff` or `/handoff path/to/PLAN.md`
194
11
 
195
- After saving, confirm:
196
- - Handoff folder location
197
- - Number of dead ends documented (if any)
198
- - Plan update summary (if plan was provided)
12
+ The workflow guides you through gathering session context, generating structured sections, and saving via the handoff system.
@@ -150,7 +150,7 @@ If a plan document path was provided in `$ARGUMENTS`:
150
150
  Instead of writing the file directly, pipe your handoff content to the save script:
151
151
 
152
152
  ```bash
153
- bun .aiwcli/_shared/scripts/save_handoff.ts "{context_id}" <<'EOF'
153
+ bun .aiwcli/_shared/handoff-system/scripts/save_handoff.ts "{context_id}" <<'EOF'
154
154
  {Your complete handoff markdown content from Step 3}
155
155
  EOF
156
156
  ```
@@ -150,7 +150,7 @@ If a plan document path was provided in `$ARGUMENTS`:
150
150
  Instead of writing the file directly, pipe your handoff content to the save script:
151
151
 
152
152
  ```bash
153
- bun .aiwcli/_shared/scripts/save_handoff.ts "{context_id}" <<'EOF'
153
+ bun .aiwcli/_shared/handoff-system/scripts/save_handoff.ts "{context_id}" <<'EOF'
154
154
  {Your complete handoff markdown content from Step 3}
155
155
  EOF
156
156
  ```