kushi-agents 4.8.2 → 4.9.0

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 (38) hide show
  1. package/package.json +2 -2
  2. package/plugin/instructions/comprehensive-structured-capture.instructions.md +250 -0
  3. package/plugin/instructions/evidence-layout-canonical.instructions.md +20 -12
  4. package/plugin/instructions/evidence-thoroughness.instructions.md +119 -225
  5. package/plugin/instructions/identity-resolution.instructions.md +11 -8
  6. package/plugin/instructions/meetings-verbatim-required.instructions.md +6 -4
  7. package/plugin/instructions/scope-boundaries.instructions.md +1 -1
  8. package/plugin/instructions/snapshot-vs-stream.instructions.md +25 -1
  9. package/plugin/instructions/verbatim-by-default.instructions.md +21 -1
  10. package/plugin/instructions/weekly-csc.instructions.md +335 -0
  11. package/plugin/instructions/workiq-only.instructions.md +140 -1
  12. package/plugin/skills/ask-project/SKILL.md +26 -6
  13. package/plugin/skills/bootstrap-project/SKILL.md +17 -5
  14. package/plugin/skills/build-state/SKILL.md +30 -7
  15. package/plugin/skills/consolidate-evidence/SKILL.md +27 -4
  16. package/plugin/skills/pull-ado/SKILL.md +85 -9
  17. package/plugin/skills/pull-crm/SKILL.md +87 -10
  18. package/plugin/skills/pull-email/SKILL.md +75 -11
  19. package/plugin/skills/pull-meetings/SKILL.md +83 -8
  20. package/plugin/skills/pull-onenote/SKILL.md +86 -9
  21. package/plugin/skills/pull-sharepoint/SKILL.md +73 -10
  22. package/plugin/skills/pull-teams/SKILL.md +78 -9
  23. package/plugin/skills/refresh-project/SKILL.md +16 -5
  24. package/plugin/skills/self-check/SKILL.md +11 -0
  25. package/plugin/skills/self-check/run.ps1 +208 -0
  26. package/plugin/skills/setup/SKILL.md +16 -15
  27. package/plugin/templates/init/integrations.template.yml +38 -24
  28. package/plugin/templates/init/m365-auth.template.json +3 -3
  29. package/plugin/templates/init/project-evidence.template.yml +5 -5
  30. package/plugin/templates/snapshot/DEPRECATED-v4.9.0.md +37 -0
  31. package/plugin/templates/weekly/_index_entities.template.yml +26 -0
  32. package/plugin/templates/weekly/ado-csc.template.md +113 -0
  33. package/plugin/templates/weekly/crm-csc.template.md +103 -0
  34. package/plugin/templates/weekly/email-csc.template.md +114 -0
  35. package/plugin/templates/weekly/meetings-csc.template.md +112 -0
  36. package/plugin/templates/weekly/onenote-csc.template.md +95 -0
  37. package/plugin/templates/weekly/sharepoint-csc.template.md +98 -0
  38. package/plugin/templates/weekly/teams-csc.template.md +100 -0
@@ -0,0 +1,335 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "Weekly CSC layout (kushi v4.9.0+) — every source produces ONE weekly CSC file per ISO-week containing one block per entity touched that week, plus a per-source _index/entities.yml for current-state lookup. Replaces the snapshot/ + stream/ folder split."
4
+ ---
5
+
6
+ # Weekly CSC Layout — HARD RULE (kushi v4.9.0+)
7
+
8
+ ## Why this replaces snapshot/ + stream/
9
+
10
+ The old `snapshot-vs-stream.instructions.md` model split every source into two shapes:
11
+ - `snapshot/` — current state of entities (replace on refresh)
12
+ - `stream/` — timestamped events (append, weekly buckets)
13
+
14
+ In practice this caused two problems:
15
+ 1. **Empty snapshot folders.** Sources without retrievable bodies (OneNote payload-too-large,
16
+ m365_get_email failures, no SharePoint site discovery) ended up with no `snapshot/`
17
+ content. Users perceived empty folders as "kushi didn't pull anything".
18
+ 2. **Awkward queries.** Answering "what happened on HCA last week?" required reading
19
+ `stream/<week>.md` per source AND walking `snapshot/` to know current state of entities
20
+ touched that week. Six sources × two folder reads per query.
21
+
22
+ The CSC model (`comprehensive-structured-capture.instructions.md`) makes every per-entity
23
+ block self-contained — it carries current state at end-of-week + everything that happened to
24
+ the entity that week. So one folder is enough: organize by week.
25
+
26
+ ## The layout
27
+
28
+ ```
29
+ <engagement-root>/<project>/Evidence/<alias>/
30
+ email/
31
+ weekly/2026-05-25_email-csc.md
32
+ weekly/2026-05-18_email-csc.md
33
+ _index/entities.yml
34
+ teams/
35
+ weekly/2026-05-25_teams-csc.md
36
+ _index/entities.yml
37
+ meetings/
38
+ weekly/2026-05-25_meetings-csc.md
39
+ verbatim/2026-05-21-1400_hca-weekly-sync/
40
+ captured-at.txt
41
+ chat-messages.json
42
+ chat-messages.md
43
+ transcript.txt (or transcript.vtt, or transcript-source.md)
44
+ recording-url.txt
45
+ recap-card.md
46
+ attachments/
47
+ coverage.md
48
+ _index/entities.yml
49
+ onenote/
50
+ weekly/2026-05-25_onenote-csc.md
51
+ _index/entities.yml
52
+ sharepoint/
53
+ weekly/2026-05-25_sharepoint-csc.md
54
+ _index/entities.yml
55
+ crm/
56
+ weekly/2026-05-25_crm-csc.md
57
+ _index/entities.yml
58
+ ado/
59
+ weekly/2026-05-25_ado-csc.md
60
+ _index/entities.yml
61
+ run-log.yml
62
+ refresh-reports/
63
+ 2026-05-26-1830_bootstrap.md
64
+ ...
65
+ ```
66
+
67
+ Notes:
68
+ - **One weekly file per source per ISO-week.** Filename = `YYYY-MM-DD_<source>-csc.md` where
69
+ the date is the **Monday** of the ISO-week the entries cover (Mon–Sun).
70
+ - **Empty weeks produce no file.** If a source had no activity in a week, no file is written.
71
+ - **`meetings/verbatim/<dir>/` is the only sub-folder besides weekly/ + _index/.** It is the
72
+ raw audit folder per `meetings-verbatim-required.instructions.md` (meetings are the only
73
+ source whose raw evidence expires; tenant retention purges Teams recordings, often within
74
+ 60 days).
75
+ - **No `snapshot/` and no `stream/` folders are written by v4.9.0+ skills.** Legacy folders
76
+ from prior kushi versions are left in place (no migration); readers fall back to them when
77
+ `weekly/` is empty (see Reader contract below).
78
+
79
+ ## Weekly file structure
80
+
81
+ ```markdown
82
+ # <Source> CSC — Week of 2026-05-25 (Mon–Sun)
83
+
84
+ - **Project**: <project>
85
+ - **Alias**: <alias>
86
+ - **Source**: <email | teams | meetings | onenote | sharepoint | crm | ado>
87
+ - **Week**: 2026-05-25 → 2026-05-31 (ISO)
88
+ - **Generated**: <ISO timestamp>
89
+ - **Kushi version**: <version>
90
+ - **WorkIQ calls**: <count> (request-ids listed under each entity)
91
+
92
+ ## Source Basis (week-level)
93
+
94
+ - <one paragraph describing what WorkIQ probes / host probes ran this week,
95
+ what scope was applied (boundaries), what failed, what was deferred>
96
+ - See per-entity Source basis lines for granular provenance.
97
+
98
+ ## Entities
99
+
100
+ <one CSC block per entity touched this week, in chronological order of last_touched>
101
+
102
+ ## <entity-1-name> {#<entity-1-anchor>}
103
+ ...CSC block per `comprehensive-structured-capture.instructions.md`...
104
+
105
+ ## <entity-2-name> {#<entity-2-anchor>}
106
+ ...
107
+
108
+ ## Week-level Coverage Notes
109
+
110
+ - <anything that affects the whole week, not specific to one entity>
111
+ - <deferred-retry markers written this week (cite the marker paths)>
112
+
113
+ ## Validation
114
+
115
+ - [ ] every entity block has the canonical section order
116
+ - [ ] no prose paragraphs anywhere
117
+ - [ ] no truncation markers ("and N more", etc.)
118
+ - [ ] every fact-bearing bullet has a citation
119
+ - [ ] `_index/entities.yml` updated for every entity in this file
120
+ ```
121
+
122
+ ## `_index/entities.yml` shape
123
+
124
+ One per source per contributor. Maps entity-id → location of latest CSC mention. Used by
125
+ `build-state`, `ask-project`, and `consolidate-evidence` for current-state lookup without
126
+ walking every weekly file.
127
+
128
+ ```yaml
129
+ # Auto-generated. Updated by pull-<source> on every write.
130
+ # Per-contributor (under Evidence/<alias>/<source>/_index/). Multi-user safe.
131
+ schema_version: 1
132
+ source: onenote # one of: email|teams|meetings|onenote|sharepoint|crm|ado
133
+ generated_at: 2026-05-26T18:00:00Z
134
+ kushi_version: 4.9.0
135
+ entities:
136
+ # Stable entity-id chosen per source (see "Entity identity" below).
137
+ - id: 'onenote://page/wdpartid=abc123'
138
+ display_name: 'HCA Architecture Overview'
139
+ entity_anchor: 'hca-architecture-overview'
140
+ latest_csc_file: 'weekly/2026-05-25_onenote-csc.md'
141
+ latest_csc_block_offset: 412 # line number of the entity heading
142
+ last_touched: 2026-05-23T14:30:00Z
143
+ first_seen: 2026-05-06T09:12:00Z
144
+ weeks_touched:
145
+ - 2026-05-25
146
+ - 2026-05-18
147
+ - 2026-05-04
148
+ status: captured # captured | body-not-exposed | unavailable | deferred
149
+ - id: 'meetings://joinurl=https%3A%2F%2Fteams.microsoft.com%2F...'
150
+ display_name: 'HCA Weekly Sync'
151
+ entity_anchor: 'hca-weekly-sync-2026-05-21-1400'
152
+ latest_csc_file: 'weekly/2026-05-25_meetings-csc.md'
153
+ latest_csc_block_offset: 95
154
+ last_touched: 2026-05-21T14:00:00Z
155
+ first_seen: 2026-04-23T14:00:00Z
156
+ weeks_touched: [2026-05-18, 2026-05-04, 2026-04-27, 2026-04-20]
157
+ verbatim_folder: 'meetings/verbatim/2026-05-21-1400_hca-weekly-sync'
158
+ status: captured
159
+ ```
160
+
161
+ ### Entity identity per source (canonical id format)
162
+
163
+ | Source | Entity | id format |
164
+ |---|---|---|
165
+ | email | thread | `email://conversation_id=<conversationId>` |
166
+ | teams | chat thread | `teams://chat_id=<chatId>` |
167
+ | teams | channel thread | `teams://channel=<teamId>/<channelId>/<rootMessageId>` |
168
+ | meetings | series instance | `meetings://joinurl=<urlencoded>` + `&start=<iso>` |
169
+ | onenote | page | `onenote://page/wdpartid=<id>` (preferred) or `onenote://page/webPageId=<id>` |
170
+ | sharepoint | file | `sharepoint://siteurl=<urlencoded>/path=<urlencoded>` or `sharepoint://driveitemid=<id>` |
171
+ | crm | record | `crm://entity=<logicalName>/id=<guid>` |
172
+ | ado | work item | `ado://org=<org>/project=<project>/workitemid=<int>` |
173
+
174
+ These ids are stable across runs and contributors. Multi-user safety: every contributor writes
175
+ their own `_index/entities.yml` under their own `<alias>/` folder; no shared file.
176
+
177
+ ## Reader contract (build-state, ask-project, consolidate-evidence)
178
+
179
+ Readers MUST follow this fallback chain to support graceful migration from pre-v4.9.0
180
+ evidence:
181
+
182
+ 1. **Primary**: read `Evidence/<alias>/<source>/_index/entities.yml`. Pull `latest_csc_file`
183
+ for each entity needed. Read the CSC block by anchor.
184
+ 2. **Secondary (no _index/)**: walk `Evidence/<alias>/<source>/weekly/*.md` newest-first;
185
+ parse entity headings; build an in-memory index for this query.
186
+ 3. **Legacy fallback (pre-v4.9.0)**: if `weekly/` is empty BUT `snapshot/` or `stream/` exist,
187
+ read those instead. Cite as legacy: `[source: <alias>/<source>/snapshot/<file>.md (legacy
188
+ pre-v4.9.0 layout)]`. Do not refuse to read legacy.
189
+ 4. Mark the answer with `Source-layout: weekly-csc` / `weekly-csc-plus-legacy` /
190
+ `legacy-only` in the answer footer so the user knows if a refresh would update the layout.
191
+
192
+ Readers MUST NOT delete or modify legacy folders. Migration is opt-in via a future migrate
193
+ skill (out of scope for v4.9.0).
194
+
195
+ ## Writer contract (every pull-* skill)
196
+
197
+ When writing weekly CSC:
198
+
199
+ 1. Compute the ISO-week Monday for each entity touched (entity may span weeks — assign each
200
+ touch to its own week's file).
201
+ 2. For each week-bucket:
202
+ - Open `Evidence/<alias>/<source>/weekly/<monday>_<source>-csc.md`. Create if absent.
203
+ - For each entity in this week-bucket:
204
+ - If entity heading `## <name> {#<anchor>}` exists → **merge** the CSC block:
205
+ - Replace the existing block in place (current week's CSC always reflects end-of-week
206
+ state).
207
+ - Else → **append** a new CSC block at end of `## Entities` section.
208
+ - Update week-level Source Basis + Coverage Notes.
209
+ 3. Update `Evidence/<alias>/<source>/_index/entities.yml`:
210
+ - For each entity written: upsert the row; bump `last_touched`; add this week's Monday to
211
+ `weeks_touched`; set `latest_csc_file` + `latest_csc_block_offset`.
212
+ 4. Append a `runs:` entry to `Evidence/run-log.yml` per `auth-and-retry.instructions.md`.
213
+
214
+ ### Idempotency rules
215
+
216
+ - Same entity, same week, two runs → second run **replaces** the block in place. (The CSC
217
+ block always reflects end-of-week state; intra-week reruns refresh the same block.)
218
+ - Same entity, different weeks → each week's file gets its own block.
219
+ - Deletion of a previously-captured entity → leave prior weeks' blocks alone (history is
220
+ preserved by the weekly partition). Mark `status: deleted-from-source` in `_index/` and
221
+ do NOT write a block in the current week.
222
+
223
+ ### Multi-user safety
224
+
225
+ `Evidence/<alias>/...` is per-contributor. The `<alias>/_index/entities.yml` is
226
+ **not shared** across contributors. Cross-contributor consolidation is the job of
227
+ `consolidate-evidence` (which reads each contributor's `_index/` independently). No merge
228
+ conflicts possible at the writer level.
229
+
230
+ ## Examples
231
+
232
+ ### Email weekly file (excerpt)
233
+
234
+ ```markdown
235
+ # Email CSC — Week of 2026-05-25 (Mon–Sun)
236
+
237
+ - Project: HCA
238
+ - Alias: ushak
239
+ - Source: email
240
+ - Week: 2026-05-25 → 2026-05-31
241
+ - Generated: 2026-05-26T18:45:00Z
242
+ - Kushi version: 4.9.0
243
+ - WorkIQ calls: 1 enumeration + 6 thread CSC
244
+
245
+ ## Source Basis
246
+
247
+ - WorkIQ enumeration call request-id abc123 returned 6 in-scope threads in folder
248
+ "Customers/HCA" between 2026-05-25 and 2026-05-31.
249
+ - 6 thread-level WorkIQ CSC calls returned full bulleted capture; no deferrals.
250
+
251
+ ## Entities
252
+
253
+ ## HCA Compute Architecture Discussion {#hca-compute-arch-thread}
254
+
255
+ - Source basis: WorkIQ request-id def456, fidelity csc-full
256
+ - Coverage window: 2026-05-25 → 2026-05-30
257
+ - Last touched: 2026-05-30T09:12:00Z
258
+
259
+ ### Participants / Present
260
+ - John Doe <john@hca.com> — sender (initiated thread)
261
+ - Sample Name <you@example.com> — recipient + responder
262
+ - ...
263
+
264
+ ### Topics Discussed
265
+ - Migration strategy for legacy compute workloads
266
+ - Current state: 200 VMs on-prem, Hyper-V
267
+ - Discussed: lift-and-shift vs refactor-to-AKS trade-offs
268
+ - ...
269
+
270
+ ### Decisions
271
+ - Decided: pilot lift-and-shift for non-critical 30-VM workload first — by John Doe + Usha
272
+ K — rationale: lower risk for first migration; refactor decision deferred until pilot
273
+ results — rejected: full refactor in first wave [source: WorkIQ req def456 · 2026-05-28]
274
+
275
+ ### Dates & Numbers Shared
276
+ - Pilot start date: 2026-06-15 — context: 30-VM lift-and-shift kickoff — shared by John Doe
277
+ [source: WorkIQ req def456 · 2026-05-28]
278
+ - Budget cap: $250K — context: pilot phase only — shared by Mike Smith [source: WorkIQ req
279
+ def456 · 2026-05-29]
280
+
281
+ ### Action Items
282
+ - [ ] John Doe — confirm pilot VM list with infrastructure team — due: 2026-06-05 [source:
283
+ WorkIQ req def456 · 2026-05-29]
284
+ - [ ] Usha Krishnan — share migration playbook deck — due: 2026-05-31 [source: WorkIQ req
285
+ def456 · 2026-05-30]
286
+
287
+ ...
288
+ ```
289
+
290
+ ### `_index/entities.yml` after that write
291
+
292
+ ```yaml
293
+ schema_version: 1
294
+ source: email
295
+ generated_at: 2026-05-26T18:45:00Z
296
+ kushi_version: 4.9.0
297
+ entities:
298
+ - id: 'email://conversation_id=AAQkAGI...'
299
+ display_name: 'HCA Compute Architecture Discussion'
300
+ entity_anchor: 'hca-compute-arch-thread'
301
+ latest_csc_file: 'weekly/2026-05-25_email-csc.md'
302
+ latest_csc_block_offset: 28
303
+ last_touched: 2026-05-30T09:12:00Z
304
+ first_seen: 2026-05-25T11:00:00Z
305
+ weeks_touched: [2026-05-25]
306
+ status: captured
307
+ - id: 'email://conversation_id=AAQkAGI...other...'
308
+ ...
309
+ ```
310
+
311
+ ## Self-check enforcement
312
+
313
+ `plugin/skills/self-check/run.ps1` deep checks added in v4.9.0:
314
+ - **D16**: `_index/entities.yml` exists when `weekly/` is non-empty.
315
+ - **D17**: every entity heading in a weekly file has a matching `_index/` row, and vice versa.
316
+ - **D18**: entity ids in `_index/` follow the canonical format for the source.
317
+ - **D19**: warn (not fail) on `snapshot/` or `stream/` folders inside `Evidence/<alias>/<source>/`
318
+ written by kushi ≥ v4.9.0 (i.e., mtime after the v4.9.0 release date). One-release grace
319
+ period.
320
+
321
+ ## Migration / coexistence
322
+
323
+ - Old `snapshot/<entity>.md` files remain readable by readers per the Reader contract step 3.
324
+ - Old `stream/<week>-stream.md` files remain readable similarly.
325
+ - A future v4.10.x `migrate-evidence` skill will optionally rewrite legacy into weekly/ + _index/.
326
+ Out of scope for v4.9.0.
327
+ - No automatic deletion of legacy folders.
328
+
329
+ ## Cross-references
330
+
331
+ - `comprehensive-structured-capture.instructions.md` — block shape inside weekly/ files.
332
+ - `meetings-verbatim-required.instructions.md` — raw verbatim/ folder for meetings only.
333
+ - `evidence-layout-canonical.instructions.md` — updated in v4.9.0 to allow weekly/ + _index/.
334
+ - `snapshot-vs-stream.instructions.md` — DEPRECATED in v4.9.0; redirects here.
335
+ - `multi-user-shared-files.instructions.md` — `_index/` is per-contributor; not shared.
@@ -46,6 +46,143 @@ For every M365 source in scope:
46
46
  4. **DO NOT attempt** `m365_get_transcript`, `m365_get_facilitator_notes`, `m365_list_meetings`, `m365_list_events`, `m365_search_files` (for content), `m365_download_file` (for transcript/notes), or any Graph REST URL for the in-scope sources above. These are FORBIDDEN — **including as a "last-resort" fallback after WorkIQ fails** (kushi v4.4.1+). Calling them is a defect; coverage.md must NOT show them in the attempt trail. The deferred-retry marker IS the audit trail for WorkIQ failures.
47
47
  5. **Allowed alongside WorkIQ** (structured-data dumps only): `m365_list_chat_messages` for chat-id'd threads → `chat-messages.json`. These run in parallel with the WorkIQ pull, not as a substitute.
48
48
 
49
+ ## v4.9.0 — Comprehensive Structured Capture (CSC) prompts supersede verbatim prompts
50
+
51
+ > **v4.9.0:** With the move to Comprehensive Structured Capture (CSC) — see
52
+ > [`comprehensive-structured-capture.instructions.md`](./comprehensive-structured-capture.instructions.md)
53
+ > — pull-* skills now ask WorkIQ for **structured bullet output** instead of raw verbatim bodies.
54
+ > CSC prompts are below in `## CSC canonical prompts (kushi v4.9.0+)`.
55
+ >
56
+ > The **verbatim prompts** in the historical "Canonical WorkIQ commands" section
57
+ > remain valid for exactly one use case: **meetings raw audit folder**
58
+ > (`Evidence/<alias>/meetings/verbatim/<dir>/transcript.txt`) per
59
+ > [`meetings-verbatim-required.instructions.md`](./meetings-verbatim-required.instructions.md).
60
+ > All other sources stop using verbatim prompts as of v4.9.0.
61
+
62
+ ## CSC canonical prompts (kushi v4.9.0+)
63
+
64
+ Every CSC prompt asks WorkIQ to return one block per entity in CSC shape:
65
+ bulleted sections in canonical order, no prose paragraphs, no omission. Skills
66
+ parse this directly into the `weekly/YYYY-MM-DD_<source>-csc.md` artifact.
67
+
68
+ The shared closing clause appended to every CSC prompt:
69
+
70
+ ```text
71
+ Return as a Comprehensive Structured Capture (CSC) block per kushi doctrine:
72
+ - Bulleted sections in this exact order: Participants; Topics Discussed; Q&A;
73
+ Who Said What (material statements only); Decisions; Dates & Numbers Shared;
74
+ Action Items (with owner and due, mark "owner: unassigned" / "due: unspecified"
75
+ when not stated); Next Steps; Open Questions; Risks/Blockers/Dependencies;
76
+ Customer Asks; Artifacts/Links; Coverage Notes.
77
+ - Bullets only, no prose paragraphs anywhere.
78
+ - No omission: do NOT write "and N more", "key highlights only", "sample of",
79
+ "N of M shown", or "truncated" anywhere outside Coverage Notes.
80
+ - Empty applicable sections explicit as "_None surfaced._".
81
+ - Inapplicable sections OMITTED entirely.
82
+ - Every fact-bearing bullet inline-cites its source (sender, timestamp, message-id,
83
+ page wdpartid, file URL, work-item id, etc.).
84
+ - Do NOT fabricate from adjacent evidence. If a section's basis is unavailable,
85
+ write "Source basis: unavailable" in Coverage Notes.
86
+ ```
87
+
88
+ ### Meeting CSC block (per meeting)
89
+
90
+ ```text
91
+ For the Teams meeting titled "<subject>" that occurred on <YYYY-MM-DD>, produce
92
+ a Comprehensive Structured Capture block covering the whole meeting. Use the
93
+ transcript and the Copilot recap as the source. Include every distinct topic
94
+ discussed, every question asked AND answered (in Q&A), every commitment made
95
+ (in Action Items with owner+due), every number/date/dollar/percentage stated
96
+ (in Dates & Numbers Shared), and every customer ask. Curate Who Said What to
97
+ material statements only (positions stated, commitments made, disagreements
98
+ voiced) — NOT an utterance log.
99
+
100
+ <shared closing clause>
101
+ ```
102
+
103
+ ### Email thread CSC block (per conversation)
104
+
105
+ ```text
106
+ For the email thread with conversationId <id> (subject "<subject>") between
107
+ <YYYY-MM-DD> and <YYYY-MM-DD>, produce one Comprehensive Structured Capture
108
+ block covering the entire thread. Topics, Q&A, and Action Items must cover
109
+ every reply in the chain. Participants must list all senders and recipients
110
+ across the thread.
111
+
112
+ <shared closing clause>
113
+ ```
114
+
115
+ ### Teams chat thread CSC block (per chat)
116
+
117
+ ```text
118
+ For the Teams chat with chatId <id> ("<topic>") between <YYYY-MM-DD> and
119
+ <YYYY-MM-DD>, produce one Comprehensive Structured Capture block covering the
120
+ full message-by-message thread. Participants must list every poster.
121
+ Q&A captures every question asked AND answered. Who Said What is curated to
122
+ material statements only (3–10 entries typical per 50-message thread).
123
+
124
+ <shared closing clause>
125
+ ```
126
+
127
+ (Run `m365_list_chat_messages(chatId)` in parallel for the structured JSON
128
+ dump → `chat-messages.json` companion artifact.)
129
+
130
+ ### Teams channel post CSC block (per root message)
131
+
132
+ ```text
133
+ For the Teams channel post in team <teamId> / channel <channelId> with root
134
+ message id <messageId>, produce a Comprehensive Structured Capture block
135
+ covering the post and all replies in the thread.
136
+
137
+ <shared closing clause>
138
+ ```
139
+
140
+ ### OneNote page CSC block (per page — ONE page per call)
141
+
142
+ ```text
143
+ For OneNote page "<title>" (wdpartid <id>) in section "<section>.one", produce
144
+ one Comprehensive Structured Capture block covering the entire page body.
145
+ Topics must cover every heading and section of the page. Dates & Numbers Shared
146
+ must include every number, date, dollar amount, percentage, version, SKU, and
147
+ deadline written on the page. Action Items must list every task/checkbox.
148
+ Artifacts must list every link and embedded file on the page.
149
+
150
+ If you cannot read the page body, write exactly one line: "body-unavailable"
151
+ and nothing else.
152
+
153
+ <shared closing clause>
154
+ ```
155
+
156
+ > Tier A (enumeration) and Tier B (search snippets) prompts in the historical
157
+ > section below remain valid — they're used at discovery to enumerate which
158
+ > pages exist. Tier C (per-page) is now this CSC prompt, replacing the
159
+ > v4.8.x "full verbatim body" Tier C prompt.
160
+
161
+ ### SharePoint file CSC block (per file)
162
+
163
+ ```text
164
+ For the SharePoint file at <web URL> (last modified <YYYY-MM-DD>), produce one
165
+ Comprehensive Structured Capture block covering the document. Topics must cover
166
+ every section heading. Dates & Numbers Shared must include every number, date,
167
+ dollar amount, version, deadline. Customer Asks must list every explicit
168
+ customer request in the document. Artifacts must list every link and embedded
169
+ file referenced.
170
+
171
+ <shared closing clause>
172
+ ```
173
+
174
+ ### CRM record CSC block (per opportunity/account/contact)
175
+
176
+ > CRM is OUT of WorkIQ scope (uses Dataverse REST per `crm-bootstrap-discovery`).
177
+ > But the CSC block shape applies — `pull-crm` constructs the block from REST
178
+ > field reads, not WorkIQ. No WorkIQ prompt needed here; the block schema is in
179
+ > [`comprehensive-structured-capture.instructions.md`](./comprehensive-structured-capture.instructions.md).
180
+
181
+ ### ADO work item CSC block (per work item)
182
+
183
+ > ADO is OUT of WorkIQ scope (uses ADO REST). Same as CRM: `pull-ado` constructs
184
+ > the CSC block from REST field reads. No WorkIQ prompt needed.
185
+
49
186
  ## Canonical WorkIQ commands (CODIFIED — do not re-discover)
50
187
 
51
188
  The CLI is resolved in this order: `<workspace>/.kushi/config/user/project-evidence.yml workiq.cli_path` → `Get-Command workiq` (PATH) → `~/.copilot/bin/workiq[.cmd]` (Clawpilot-managed convenience fallback, probed only if it already exists). The legacy `~/.kushi/bin/workiq.cmd` path was removed in v4.4.4 — see the `setup` skill for the functional verification flow.
@@ -198,5 +335,7 @@ If `Result: SUMMARY-ONLY` after doubled-strict retry: the artifact is acceptable
198
335
  - `plugin/instructions/crm-bootstrap-discovery.instructions.md` — CRM is OUT of WorkIQ scope; it uses Dataverse REST.
199
336
  - `plugin/instructions/ado-bootstrap-discovery.instructions.md` — ADO is OUT of WorkIQ scope; it uses ADO REST.
200
337
  - `plugin/instructions/scope-boundaries.instructions.md` — every pull-* still respects integrations.yml#boundaries.
201
- - `plugin/instructions/evidence-thoroughness.instructions.md` — verbatim is the bar; this rule operationalizes how to hit it.
338
+ - `plugin/instructions/evidence-thoroughness.instructions.md` — CSC bullet thresholds are the depth bar (v4.9.0); this rule operationalizes how to source the bullets.
339
+ - `plugin/instructions/comprehensive-structured-capture.instructions.md` (v4.9.0+) — CSC block schema.
340
+ - `plugin/instructions/weekly-csc.instructions.md` (v4.9.0+) — weekly/ layout + `_index/`.
202
341
  - `plugin/instructions/deferred-retry-on-workiq-fail.instructions.md` (kushi v4.4.1+) — defines exactly what happens when WorkIQ fails. NO Graph fallback. Marker + continue + inform.
@@ -1,11 +1,27 @@
1
1
  ---
2
2
  name: "ask-project"
3
- version: "2.0.0"
4
- description: "Read-only Q&A over an already-bootstrapped project. Answers natural-language questions about a project (status, decisions, MACC, stakeholders, risks, action items, timeline, specific docs/meetings) using only the project's State/, Evidence/, and snapshot/ files. Cited; no source pulls; no outbound."
3
+ version: "3.0.0"
4
+ description: "Read-only Q&A over an already-bootstrapped project (v4.9.0+). Answers natural-language questions using State/, Evidence/, and weekly CSC files via 3-step reader fallback (_index/entities.yml weekly/*.md legacy snapshot/ + stream/). Cited; no source pulls; no outbound."
5
5
  ---
6
6
 
7
7
  # Skill: ask-project
8
8
 
9
+ ## v4.9.0 — Reader fallback chain (HARD RULE; per `weekly-csc.instructions.md`)
10
+
11
+ For every `<alias>/<source>/` accessed:
12
+
13
+ 1. **Primary**: read `Evidence/<alias>/<source>/_index/entities.yml`. For each entity needed, pull `latest_csc_file` + `latest_csc_block_offset`; open the weekly file and read the CSC block by entity anchor.
14
+ 2. **Secondary (no _index/, but weekly/ exists)**: walk `Evidence/<alias>/<source>/weekly/*.md` newest-first; parse `## <name> {#<anchor>}` headings; build an in-memory entity index for this query.
15
+ 3. **Legacy fallback (pre-v4.9.0)**: if `weekly/` is empty BUT `snapshot/` or `stream/` exist, read those. Cite as legacy.
16
+
17
+ Citation form in this skill's output:
18
+ - **New (v4.9.0)**: `[source: <alias>/<source>/weekly/<YYYY-MM-DD>_<source>-csc.md#<entity-anchor> · <iso-ts>]`
19
+ - **Legacy (reading from snapshot/+stream/)**: append ` (legacy pre-v4.9.0 layout)` after the citation.
20
+
21
+ Mark the answer / output footer with `Source-layout: weekly-csc | weekly-csc-plus-legacy | legacy-only` so the user knows whether a refresh would update the layout.
22
+
23
+ Readers MUST NOT delete or modify legacy folders. Migration is out of scope for v4.9.0.
24
+
9
25
  Run this whenever the user asks a question about a known project — even without an explicit verb.
10
26
 
11
27
  The user does NOT need to type `/ask-project` or `@Kushi ask`. If the message:
@@ -59,7 +75,7 @@ Map the question to one or more **answer kinds**, which determines which files t
59
75
  | "what risks / blockers / dependencies …" | `State/06_risks-and-issues.md` |
60
76
  | "what's the timeline / when is …", "milestone for …" | `State/07_timeline-and-milestones.md` |
61
77
  | "what's the MACC / ECIF / commercials / $ size for …" | grep `MACC`, `ECIF`, `\$[0-9]`, `consumption commitment` across `State/` + `Evidence/<alias>/_Consolidated/` |
62
- | "what does the deck / SOW / doc say about …" | `<project>/SharePoint/snapshot/files/*.md` matching the doc name; fallback to `tree.md` to locate |
78
+ | "what does the deck / SOW / doc say about …" | `Evidence/<alias>/sharepoint/weekly/<YYYY-MM-DD>_sharepoint-csc.md#<entity-anchor>` (v4.9.0); fallback: `<project>/SharePoint/snapshot/files/*.md (legacy pre-v4.9.0 layout)` matching the doc name; fallback to `tree.md` to locate |
63
79
  | "what was in the email from X about Y" | grep across `Evidence/<alias>/Email/` |
64
80
  | "what's in OneNote about …" | `Evidence/<alias>/OneNote/` + `external-context/*onenote*.md` |
65
81
  | "summary of the project" | `State/00_overview.md` (this file IS the answer) |
@@ -163,6 +179,10 @@ Explicit triggers also accepted:
163
179
  > User: "what did Mark say in last week's call about pricing?"
164
180
  > → If no Meetings file for that week: "I don't have a meetings transcript for week of YYYY-MM-DD. Want me to pull meetings for AGCO since YYYY-MM-DD?"
165
181
 
166
- ## References (v4.4.7)
167
-
168
- - Name → ID resolution (any source) follows `..\..\instructions\fuzzy-disambiguation.instructions.md`.
182
+ ## References (v4.4.7)
183
+
184
+ - Name → ID resolution (any source) follows `..\..\instructions\fuzzy-disambiguation.instructions.md`.
185
+
186
+ ## Changelog
187
+
188
+ - **v3.0.0 (kushi v4.9.0, 2026-05-26)**: 3-step reader fallback chain (`_index/entities.yml` → `weekly/*.md` → legacy `snapshot/` + `stream/`). New citation form `weekly/<YYYY-MM-DD>_<source>-csc.md#<anchor>`. Legacy citations suffixed `(legacy pre-v4.9.0 layout)`. Output marked with `Source-layout:` footer.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "bootstrap-project"
3
- version: "2.4.0"
4
- description: "First-time setup for a project: machine preflight, side-by-side config, engagement-root + project resolution, customer-hint discovery sweep across all WorkIQ-driven sources (kushi v4.8.0+, per customer-hint-discovery.instructions.md), initial 30d snapshot+stream pull across all enabled sources. Verbatim-by-default per `verbatim-by-default.instructions.md` — every enabled source dispatched, no silent skips. Discovery sweep MANDATORY before declaring blocked-config for email/teams/meetings/sharepoint per customer-hint-discovery.instructions.md. CRM bootstrap discovery REQUIRED per `crm-bootstrap-discovery.instructions.md` (v2.3.0). Writes per-user refresh report per `run-reports.instructions.md`. Cleans stale no-match notes on resolution per `cleanup-on-resolution.instructions.md`. Builds State/ only on `full` profile. Idempotent."
3
+ version: "3.0.0"
4
+ description: "First-time setup for a project (kushi v4.9.0+): machine preflight, side-by-side config, engagement-root + project resolution, customer-hint discovery sweep across all WorkIQ-driven sources, initial full-window CSC pull across all enabled sources writing weekly/ + _index/ per source. All pull-* skills write CSC blocks per comprehensive-structured-capture.instructions.md. Verbatim-by-default — every enabled source dispatched, no silent skips. Discovery sweep MANDATORY before declaring blocked-config. CRM bootstrap discovery REQUIRED per `crm-bootstrap-discovery.instructions.md`. Writes per-user refresh report per `run-reports.instructions.md`. Cleans stale no-match notes on resolution per `cleanup-on-resolution.instructions.md`. Builds State/ only on `full` profile. Idempotent."
5
5
  ---
6
6
 
7
7
  # Skill: bootstrap-project
@@ -18,6 +18,12 @@ description: "First-time setup for a project: machine preflight, side-by-side co
18
18
  >
19
19
  > **Canonical evidence layout** (HARD, kushi v3.12.1+): every per-source artifact lands under `<project>/Evidence/<alias>/<source>/{snapshot,stream,...}/` and **nowhere else** under `<project>/`. Sibling folders like `<project>/email-context/`, `<project>/notes/`, `<project>/_Weekly Summaries/` are FORBIDDEN. Bootstrap MUST (a) scaffold the canonical tree, and (b) before pulling, scan `<project>/` for non-canonical source-output folders and migrate each to `Evidence/<alias>/<source>/_legacy_<original-name>_pre-bootstrap/` (move, do not delete; log under `## Layout migrations` in the bootstrap report; add a `runs:` entry with `type: layout-migration`). See `evidence-layout-canonical.instructions.md`.
20
20
 
21
+ > **v4.9.0 update — CSC + weekly/ layout**:
22
+ > - Drop the v4.8 "1 verbatim transcript per source per bootstrap" carve-out. Bootstrap now walks the FULL boundary window (`boundaries.<source>.date_window_days` or default lookback_days from config) and writes one `weekly/<YYYY-MM-DD>_<source>-csc.md` file per ISO week with activity.
23
+ > - Preflight per source: ensure `<engagement-root>/<project>/Evidence/<alias>/<source>/{weekly,_index}/` directories exist. (`verbatim/` is created ONLY for meetings, by pull-meetings Half A.)
24
+ > - Bootstrap-status.md template language MUST mention `weekly/` + CSC, not snapshot/+stream/.
25
+ > - All pull-* skills invoked by bootstrap now write CSC blocks per `comprehensive-structured-capture.instructions.md`. No AI Narrative Summary section is required.
26
+
21
27
  Run this when the user says any of: "bootstrap a new project", "set up project evidence for `<X>`", "add me to project `<X>`", "I'm new to `<X>`", "do it all for `<X>`" (and the project has no Evidence/ folder yet).
22
28
 
23
29
  ## Profile-aware behavior
@@ -86,7 +92,7 @@ Optional (only if user enables CRM/ADO — both go into `<workspace>/.kushi/conf
86
92
 
87
93
  | Live destination | Source |
88
94
  |---|---|
89
- | `<workspace>/.kushi/config/shared/integrations.yml` `crm:` block | already seeded by `templates/init/integrations.template.yml` — fill in `crm.environmentUrl` + `crm.tenantId` |
95
+ | `<workspace>/.kushi/config/shared/integrations.yml` `crm:` block | seeded **PRE-FILLED with Microsoft IS defaults (kushi v4.8.4+)** via `templates/init/integrations.template.yml` — `environment_url: https://iscrm.crm.dynamics.com`, `tenant_id: 72f988bf-...`, `default_entity_set: new_frontierengineeringtriages`. Override only if you work in a non-Microsoft tenant. |
90
96
  | `<workspace>/.kushi/config/shared/integrations.yml` `ado:` block | already seeded by `templates/init/integrations.template.yml` — fill in `ado.organization` + `ado.project` |
91
97
 
92
98
  **Boundaries upgrade for existing projects (v3.7.0+):** If `<engagement-root>/<project>/integrations.yml` already exists but has no top-level `boundaries:` key, append the scaffolded `boundaries:` block from `templates/init/project-integrations.template.yml` (preserving every existing key). Then proceed to Step 4 to populate it.
@@ -155,7 +161,7 @@ After all sweeps complete, write the `## Discovery Sweep Results` table to `<pro
155
161
 
156
162
  **Boundaries gate** (kushi v3.7.0+, per `scope-boundaries.instructions.md`): before dispatching any `pull-*`, read `<engagement-root>/<project>/integrations.yml#boundaries` and verify each enabled source has its required boundary key populated. After Step 3.5, many of these should now contain discovered rows (annotated `needs_review: true` in their sidecars). For sources where the sweep ran but returned 0 candidates, the status is `unresolved` (not `blocked-config`) — add a one-liner to `<project>/OPEN-QUESTIONS-DRAFT.md` asking the user to widen the hint or manually seed the boundary. For sources where the sweep COULD NOT run because a prerequisite is genuinely missing (CRM/ADO shared connection block empty; SharePoint local-folder discovery), `blocked-config` is correct and the `next_step` MUST cite the specific missing field.
157
163
 
158
- For CRM and ADO additionally verify the shared connection block exists in `<workspace>/.kushi/config/shared/integrations.yml` (`crm:` block with `environmentUrl` + `tenantId`, OR `ado:` block with `organization` + `project`) with non-placeholder values; if missing, prompt the user to fill those two/four fields directly (no separate template files they live in `templates/init/integrations.template.yml`) and park in Open Questions with the path. **Do NOT auto-improvise** by inferring a tenant/org or by narrating CRM evidence from email — both are explicit anti-patterns in v3.7.0.
164
+ For CRM and ADO additionally verify the shared connection block exists in `<workspace>/.kushi/config/shared/integrations.yml` (`crm:` block with `environment_url` + `tenant_id`, OR `ado:` block with `organization` + `project`) with non-placeholder values. **As of kushi v4.8.4, these blocks ship PRE-FILLED with the canonical Microsoft Industry Solutions defaults** (iscrm.crm.dynamics.com / Microsoft tenant / IndustrySolutions ADO org / IS Engagements project), so on a fresh install this preflight passes by default. Only if a contributor has hand-edited the file to empty values or works in a non-Microsoft tenant will this preflight fail — in that case, prompt the user to fix the affected field directly and park in Open Questions with the path. **Do NOT auto-improvise** by inferring a tenant/org or by narrating CRM evidence from email — both are explicit anti-patterns in v3.7.0.
159
165
 
160
166
  **CRM discovery is REQUIRED before declaring `disabled` (kushi v3.11.0+, per `crm-bootstrap-discovery.instructions.md`).** If `<workspace>/.kushi/config/shared/integrations.yml` exists and `az` auth succeeds, bootstrap MUST run the full 4-step Dataverse REST resolution sequence from `pull-crm/SKILL.md#resolution-order-when-crmrecordid-is-unset` (title-first → all matching accounts → wide-text → recent-slice → ask user) against the live endpoint before writing `boundaries.crm.disabled: true`. Any other path that sets `disabled: true` is a defect. If steps 1–4 all return 0, present the top 5 candidates from step 4 to the user before final disposition. Log the full attempt trail (queries + counts + outcome) to the bootstrap refresh-report under `## CRM resolution attempts`. If auth fails or Dataverse is unreachable, leave the boundary empty with `reason: 'crm-auth-unavailable-<date>'` — NOT `disabled: true` — so the next refresh retries.
161
167
 
@@ -242,7 +248,9 @@ Source order (deterministic, do not reshuffle):
242
248
  8. `pull-ado` (if enabled)
243
249
  9. `pull-misc` (if `<project>/external-links.txt` exists with ≥ 1 non-placeholder, non-delegated link)
244
250
 
245
- Each produces snapshot/ + stream/ output per `snapshot-vs-stream.instructions.md`. The gate enforces: shape (snapshot/ + stream/ + verbatim/ where applicable) per-source extras (transcript-class file for meetings, sectionId for onenote, siteId for sharepoint, chatId for teams, folders for email, engagementRecordId for crm, areaPath for ado) → process-compliance (workiq-first / verbatim-by-default / capture-learnings / run-report mention / fuzzy-disambiguation cited / cleanup-on-resolution / citation-ledger).
251
+ > **v4.9.0 SUPERSEDED.** Bootstrap walks the full window now; pull-* write `weekly/<YYYY-MM-DD>_<source>-csc.md` + `_index/entities.yml` per source (not snapshot/ + stream/). See `weekly-csc.instructions.md` and `comprehensive-structured-capture.instructions.md`.
252
+
253
+ Each produces CSC weekly output per `weekly-csc.instructions.md` + `comprehensive-structured-capture.instructions.md`. The gate enforces: shape (weekly/ + _index/ + verbatim/ for meetings) → per-source extras (transcript-class file for meetings, sectionId for onenote, siteId for sharepoint, chatId for teams, folders for email, engagementRecordId for crm, areaPath for ado) → process-compliance (workiq-first / verbatim-by-default / capture-learnings / run-report mention / fuzzy-disambiguation cited / cleanup-on-resolution / citation-ledger).
246
254
 
247
255
  **pull-misc bootstrap note:** if `<project>/external-links.txt` does NOT exist, scaffold it from `templates/init/external-links.template.txt` so the user has a place to paste links. Mark the source as `enabled: true, links: 0` in `integrations.yml#boundaries.misc` and skip the dispatch (nothing to fetch yet).
248
256
 
@@ -286,3 +294,7 @@ End with a one-liner pointing at Q&A:
286
294
  ## Issue Recovery
287
295
 
288
296
  When this skill exposes a reusable defect (auth pattern, doctrine gap, layout mismatch), apply the [Issue Recovery Rule](../../instructions/issue-recovery.instructions.md): fix the smallest correct repo-owned artifact first, prefer durable fixes over per-run workarounds, then re-run the narrowest failed check. Do NOT use memory as a substitute for correcting the workflow surface.
297
+
298
+ ## Changelog
299
+
300
+ - **v3.0.0 (kushi v4.9.0, 2026-05-26)**: Drops "1 verbatim per source per bootstrap" carve-out. Walks the full boundary window per source. Preflight ensures `weekly/` + `_index/` exist per source. All pull-* invoked write CSC blocks per comprehensive-structured-capture.instructions.md.