kushi-agents 4.8.3 → 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 (36) 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 +1 -1
  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 +1 -1
  27. package/plugin/templates/init/integrations.template.yml +38 -24
  28. package/plugin/templates/snapshot/DEPRECATED-v4.9.0.md +37 -0
  29. package/plugin/templates/weekly/_index_entities.template.yml +26 -0
  30. package/plugin/templates/weekly/ado-csc.template.md +113 -0
  31. package/plugin/templates/weekly/crm-csc.template.md +103 -0
  32. package/plugin/templates/weekly/email-csc.template.md +114 -0
  33. package/plugin/templates/weekly/meetings-csc.template.md +112 -0
  34. package/plugin/templates/weekly/onenote-csc.template.md +95 -0
  35. package/plugin/templates/weekly/sharepoint-csc.template.md +98 -0
  36. package/plugin/templates/weekly/teams-csc.template.md +100 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kushi-agents",
3
- "version": "4.8.3",
4
- "description": "Install Kushi — multi-source project evidence agent with snapshot+stream capture across Email, Teams, OneNote, Loop, SharePoint, Meetings, CRM, ADO. WorkIQ-only for M365 sources (Graph / m365_* FORBIDDEN as fallbacks; user-paste is first-class). Host-agnostic.",
3
+ "version": "4.9.0",
4
+ "description": "Install Kushi — multi-source project evidence agent with Comprehensive Structured Capture (CSC) into weekly-only files across Email, Teams, OneNote, Loop, SharePoint, Meetings, CRM, ADO. Meetings retain a sibling verbatim/ audit folder. WorkIQ-only for M365 sources (Graph / m365_* FORBIDDEN as fallbacks; user-paste is first-class). Host-agnostic.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "kushi-agents": "./bin/cli.mjs"
@@ -0,0 +1,250 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "Comprehensive Structured Capture (CSC) — replaces verbatim-by-default (v4.9.0). Every per-entity evidence block is a structured set of bulleted sections capturing every material detail, with no prose paragraphs and no omissions. Readable by humans, parseable by build-state, reliably producible by WorkIQ in one call without payload-too-large failures."
4
+ ---
5
+
6
+ # Comprehensive Structured Capture (CSC) — HARD RULE (kushi v4.9.0+)
7
+
8
+ ## Why CSC replaced verbatim-by-default
9
+
10
+ The old contract (`verbatim-by-default.instructions.md`) required every pull-* skill to capture
11
+ raw verbatim bodies — full email body, full transcript line-by-line, full OneNote page body —
12
+ plus multi-paragraph AI Narrative Summaries. In practice this failed:
13
+
14
+ - WorkIQ refuses bulk verbatim with `payload-too-large` for OneNote pages.
15
+ - `m365_get_email` tool-errors ~100% of the time; bodies degrade to 200-char search previews.
16
+ - Teams meeting transcripts are often not generated (transcription not enabled).
17
+ - Multi-paragraph prose summaries are easy to fabricate from adjacent evidence — citation
18
+ discipline degrades.
19
+
20
+ CSC trades raw verbatim for **structured completeness**: every material fact captured as a
21
+ bullet, organized into named sections, with citations on every bullet. This is what WorkIQ
22
+ returns reliably on the first try, and it is what downstream readers (build-state,
23
+ ask-project, consolidate-evidence) can parse without natural-language understanding.
24
+
25
+ ## What a CSC block looks like (universal shape)
26
+
27
+ Every per-entity block — per meeting, per email thread, per Teams thread, per OneNote page,
28
+ per SharePoint file, per CRM record, per ADO work item — uses this section order. Sections
29
+ that don't apply for a source are omitted (see per-source overrides below); sections that
30
+ apply but had nothing surfaced MUST be present with `_None surfaced._`.
31
+
32
+ ```markdown
33
+ ## <entity-name> {#<entity-anchor>}
34
+
35
+ - **Source basis**: <one-liner — what WorkIQ call + request-id, what host probe, fidelity>
36
+ - **Coverage window**: <ISO range covered by this block>
37
+ - **Last touched**: <ISO timestamp>
38
+
39
+ ### Participants / Present
40
+ - <name or address> — <role: organizer / attendee / sender / recipient / author / commenter>
41
+ - ...
42
+
43
+ ### Topics Discussed
44
+ - <topic 1>
45
+ - <sub-point with detail>
46
+ - <sub-point with detail>
47
+ - <topic 2>
48
+ - ...
49
+ - ...
50
+
51
+ ### Q & A
52
+ - **Q** (asked by <name>): <question text> — **A** (answered by <name>): <answer text> [source: ... · ts]
53
+ - **Q** (asked by <name>): <question> — **A**: _Left open._ [source: ... · ts]
54
+ - ...
55
+
56
+ ### Who Said What (material statements)
57
+ - <name>: "<material statement / position / pushback>" [source: ... · ts]
58
+ - ...
59
+ - _(Only material statements — not every utterance. Routine acknowledgements omitted.)_
60
+
61
+ ### Decisions
62
+ - **Decided**: <exact wording> — **by**: <name(s)> — **rationale**: <why> — **rejected alternatives**: <what was considered and dropped> [source: ... · ts]
63
+ - ...
64
+
65
+ ### Dates & Numbers Shared
66
+ - <date / number / dollar amount / percentage / count>: <exact value> — **context**: <what it refers to> — **shared by**: <name> [source: ... · ts]
67
+ - ...
68
+
69
+ ### Action Items
70
+ - [ ] <owner> — <action> — **due**: <date or TBD with reason> [source: ... · ts]
71
+ - ...
72
+
73
+ ### Next Steps
74
+ - <forward-looking commitment without hard owner+due> — **expected by**: <approximate date or "next sync">
75
+ - ...
76
+ - _(Distinct from Action Items. "Team will look into X", "we'll circle back", soft signals.)_
77
+
78
+ ### Open Questions / Unresolved
79
+ - <question or unresolved item> — **raised by**: <name> — **why deferred**: <reason> [source: ... · ts]
80
+ - ...
81
+
82
+ ### Risks / Blockers / Dependencies
83
+ - **Risk**: <description> — **owner**: <name or unassigned> — **mitigation**: <plan or _None._> [source: ... · ts]
84
+ - **Blocker**: <description> — **blocking**: <what's blocked> — **owner**: <name> [source: ... · ts]
85
+ - **Dependency**: <description> — **on**: <what we depend on> — **owner**: <name> [source: ... · ts]
86
+ - ...
87
+
88
+ ### Customer Asks (engagement sources only)
89
+ - <ask> — **asked by**: <customer name> — **of**: <Microsoft role/person> — **status**: <open / committed / declined> [source: ... · ts]
90
+ - ...
91
+
92
+ ### Artifacts / Links
93
+ - <file name or link title>: <url> — <type: shared in meeting / attached to email / linked from page / etc.>
94
+ - ...
95
+
96
+ ### Coverage Notes
97
+ - <what was retrievable vs what wasn't>
98
+ - <any caveats: WorkIQ summary-only, transcript-not-generated, body-not-extractable, etc.>
99
+ ```
100
+
101
+ ## Hard rules
102
+
103
+ ### 1. Bullets only — no prose paragraphs
104
+
105
+ Every section content is a bulleted list. A paragraph of running prose anywhere in a CSC block
106
+ is a **defect**. The AI Narrative Summary that the old verbatim doctrine required is removed —
107
+ its purpose (give a reader the whole picture) is satisfied by the union of `Topics Discussed` +
108
+ `Decisions` + `Who Said What` + `Dates & Numbers Shared`.
109
+
110
+ Bullets may have nested sub-bullets (2–5 lines of detail per top-level bullet is normal).
111
+ Bullets may span multiple lines using markdown soft-wraps. They must not be paragraphs.
112
+
113
+ ### 2. No omission — "and N more" is a defect
114
+
115
+ If WorkIQ returns `"and 12 more topics..."`, `"key highlights only"`, `"sample of..."`,
116
+ `"10 of 47 shown"`, or any equivalent truncation marker — that is a **defect**. Re-issue with
117
+ the doubled-strict retry from `workiq-only.instructions.md` asking for the full set with no
118
+ truncation. If the second attempt also truncates, write a deferred-retry marker per
119
+ `deferred-retry-on-workiq-fail.instructions.md` and continue.
120
+
121
+ ### 3. Empty sections are explicit
122
+
123
+ A section that applies to a source but had nothing surfaced MUST be present with
124
+ `_None surfaced._` (or `_None this entity._`). Omitting the section is a defect — the reader
125
+ cannot tell "checked and empty" from "skipped".
126
+
127
+ ### 4. Citation per material bullet
128
+
129
+ Every bullet that carries a fact (date, number, decision, statement, action, risk, ask) MUST
130
+ carry an inline citation. Format:
131
+ `[source: <alias>/<source>/weekly/YYYY-MM-DD_<source>-csc.md#<entity-anchor> · <iso-ts>]`
132
+ or
133
+ `[source: WorkIQ request-id <guid> · ts]` when citing the WorkIQ probe directly.
134
+
135
+ Bullets that are organizational ("Participants", "Artifacts / Links") need not be individually
136
+ cited if the Source basis line covers them.
137
+
138
+ ### 5. No fabrication from adjacent evidence
139
+
140
+ If WorkIQ returned `body-unavailable` or the cascade returned nothing for an entity, the
141
+ correct CSC block is the entity header + `Source basis: unavailable` + `Coverage Notes`
142
+ explaining the failure mode + `_None surfaced._` for every other section. **Do NOT** infer
143
+ what the entity "likely contained" from other emails, chat traffic, file names, or page titles
144
+ — that's fabrication and pollutes the citation chain. Empty is the correct state until the
145
+ entity is actually retrieved.
146
+
147
+ ### 6. Who Said What is for material attribution only
148
+
149
+ `Who Said What` is NOT a verbatim transcript reproduction. It is the curated list of
150
+ **material** statements — positions taken, pushbacks raised, key data points stated,
151
+ commitments made — with attribution. Routine acknowledgements (`thanks`, `sounds good`, `+1`)
152
+ are omitted. A 50-message thread typically produces 3–10 entries here, not 50.
153
+
154
+ For meetings, the raw chronological transcript (when retrievable) lives in
155
+ `Evidence/<alias>/meetings/verbatim/<dir>/transcript.txt` per
156
+ `meetings-verbatim-required.instructions.md`. That is the audit artifact; the CSC block in
157
+ the weekly file is the curated, query-able form.
158
+
159
+ ## Per-source section applicability
160
+
161
+ | Section | email | teams | meetings | onenote | sharepoint | crm | ado |
162
+ |---|---|---|---|---|---|---|---|
163
+ | Participants / Present | ✅ sender+recipients | ✅ chat members | ✅ attendees | ✅ author + editors | ✅ author + editors | ✅ owner + contacts | ✅ assignee + commenters |
164
+ | Topics Discussed | ✅ | ✅ | ✅ | ✅ page content topics | ✅ file content topics | ✅ record story | ✅ WI story |
165
+ | Q & A | ✅ | ✅ | ✅ | ➖ omit | ➖ omit | ➖ omit | ✅ from comments |
166
+ | Who Said What | ✅ | ✅ | ✅ | ➖ omit | ➖ omit | ➖ omit | ✅ from comments |
167
+ | Decisions | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
168
+ | Dates & Numbers Shared | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
169
+ | Action Items | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
170
+ | Next Steps | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
171
+ | Open Questions | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
172
+ | Risks / Blockers / Dependencies | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
173
+ | Customer Asks | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
174
+ | Artifacts / Links | ✅ attachments | ✅ shared files | ✅ recording+files | ✅ embedded links | ✅ this file | ✅ related records | ✅ related WIs |
175
+ | Coverage Notes | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
176
+
177
+ Sections marked ➖ MUST be omitted for that source (don't write `_None surfaced._` — omit
178
+ entirely).
179
+
180
+ ## Volume guidance
181
+
182
+ CSC blocks are typically **denser per byte** than the old verbatim shape (no prose padding) but
183
+ LONGER overall (more sections, every fact bulleted). Expect:
184
+
185
+ - 80–200 lines per substantive meeting
186
+ - 40–120 lines per substantive email thread
187
+ - 30–80 lines per Teams chat thread with activity
188
+ - 50–150 lines per OneNote page with substantive edits
189
+ - 30–100 lines per SharePoint file body
190
+ - 50–200 lines per CRM/ADO record update
191
+
192
+ A 10-line CSC block for a 90-minute meeting is a defect. So is a 500-line block for a
193
+ 3-message email thread — the latter signals padding / fabrication.
194
+
195
+ ## Anti-patterns (defects)
196
+
197
+ 1. **Prose paragraph anywhere in a CSC block.** Re-extract as bullets.
198
+ 2. **AI Narrative Summary section.** Removed in v4.9.0 — Topics Discussed + Who Said What
199
+ carry the load. Re-extract.
200
+ 3. **"and N more" / truncation markers.** Doubled-strict retry, then defer.
201
+ 4. **Omitted sections that should be `_None surfaced._`.** Add them back.
202
+ 5. **Section misorder.** Use the canonical order above (Participants → Topics → Q&A →
203
+ Who Said What → Decisions → Dates & Numbers → Action Items → Next Steps → Open Questions →
204
+ Risks → Customer Asks → Artifacts → Coverage Notes).
205
+ 6. **Inferred narrative for missing bodies.** When body is unavailable, write
206
+ `Source basis: unavailable` + `_None surfaced._` for content sections. Don't make it up.
207
+ 7. **Verbatim quote reproduction outside meetings/verbatim/.** Quote in `Who Said What`
208
+ sparingly for material statements only; never copy the full transcript into the weekly
209
+ file — that lives in `meetings/verbatim/<dir>/transcript.txt`.
210
+ 8. **Bullets without citations** on fact-bearing sections.
211
+ 9. **`Who Said What` as 50-row utterance log.** Curate to material only.
212
+
213
+ ## Pre-write checklist (every pull-* skill)
214
+
215
+ Before writing a CSC block, confirm:
216
+
217
+ - [ ] Section order matches the canonical order
218
+ - [ ] Every applicable section is present (empty → `_None surfaced._`)
219
+ - [ ] Inapplicable sections are omitted entirely (not stubbed)
220
+ - [ ] Every fact-bearing bullet has a citation
221
+ - [ ] No prose paragraphs anywhere
222
+ - [ ] No `and N more` / truncation markers
223
+ - [ ] If body was unavailable, `Source basis: unavailable` + content sections are `_None surfaced._`, not inferred
224
+ - [ ] `Who Said What` curated to material statements only
225
+ - [ ] Entity anchor `{#slug}` is set on the heading for citation targeting
226
+
227
+ ## Self-check enforcement
228
+
229
+ `plugin/skills/self-check/run.ps1` deep checks D11–D16 (rewritten in v4.9.0):
230
+ - **D11**: every weekly CSC file has at least one entity block.
231
+ - **D12**: every entity block has the canonical section order.
232
+ - **D13**: meetings stream block has a sibling `verbatim/<dir>/` folder (kept from v3.10.0).
233
+ - **D14**: no prose paragraphs in weekly CSC files (heuristic: lines without leading `-`, `*`,
234
+ `#`, `>`, or empty, longer than 200 chars).
235
+ - **D15**: no `and N more`, `key highlights only`, `sample of`, `N of M shown` markers
236
+ outside coverage notes.
237
+ - **D16**: `_index/entities.yml` exists for every populated weekly/ folder.
238
+
239
+ ## Apply
240
+
241
+ Every `pull-<source>` SKILL.md MUST reference this instruction in its front contracts
242
+ blockquote alongside `weekly-csc.instructions.md`. The two are co-equal.
243
+
244
+ Cross-references:
245
+ - `weekly-csc.instructions.md` — defines the file layout CSC blocks live in.
246
+ - `meetings-verbatim-required.instructions.md` — raw transcript audit folder (meetings-only).
247
+ - `citation-ledger.instructions.md` — citation format.
248
+ - `deferred-retry-on-workiq-fail.instructions.md` — what to do when WorkIQ truncates.
249
+ - `evidence-thoroughness.instructions.md` — rewritten in v4.9.0 to point at this file.
250
+ - `verbatim-by-default.instructions.md` — DEPRECATED in v4.9.0; redirects here.
@@ -30,13 +30,13 @@ For every project under `<engagement-root>/`:
30
30
  .settings.yml
31
31
  refresh-reports/
32
32
  open-questions/
33
- ado/ { snapshot/ , stream/ }
34
- crm/ { snapshot/ , stream/ }
35
- email/ { snapshot/ , stream/ , _index/ , _legacy_*/ }
36
- meetings/ { snapshot/ , stream/ , verbatim/ }
37
- onenote/ { snapshot/ , stream/ , refresh-reports/ }
38
- sharepoint/ { snapshot/ , stream/ }
39
- teams/ { snapshot/ , stream/ }
33
+ ado/ { weekly/ , _index/ } # legacy-read: snapshot/, stream/
34
+ crm/ { weekly/ , _index/ } # legacy-read: snapshot/, stream/
35
+ email/ { weekly/ , _index/ , _legacy_*/ } # legacy-read: snapshot/, stream/
36
+ meetings/ { weekly/ , _index/ , verbatim/ } # verbatim/ is required (expiring source); legacy-read: snapshot/, stream/
37
+ onenote/ { weekly/ , _index/ , refresh-reports/ } # legacy-read: snapshot/, stream/
38
+ sharepoint/ { weekly/ , _index/ } # legacy-read: snapshot/, stream/
39
+ teams/ { weekly/ , _index/ } # legacy-read: snapshot/, stream/
40
40
  State/ # rendered by build-state (read-only outcome)
41
41
  Reports/ # rendered by aggregate / fde-report (read-only)
42
42
  integrations.yml # per-project boundaries (scope-boundaries.instructions.md)
@@ -44,21 +44,27 @@ For every project under `<engagement-root>/`:
44
44
 
45
45
  `Evidence/` and `<alias>/` are the **only** levels a pull skill may create under `<project>/`. Nothing else.
46
46
 
47
+ **v4.9.0 shape change:** pull-* skills now write a single `weekly/` folder per source + a thin
48
+ `_index/entities.yml`, per `weekly-csc.instructions.md`. The old `snapshot/` + `stream/`
49
+ folders are **legacy** — readers may still read them (for graceful migration), but no new
50
+ writes go to them. `meetings/verbatim/<dir>/` is kept (the only expiring source). See
51
+ `weekly-csc.instructions.md` for the writer/reader contracts.
52
+
47
53
  ### Rule 2 — Sibling source-output folders under `<project>/` are FORBIDDEN
48
54
 
49
55
  Concretely, a pull skill MUST NOT create or write to any of these (representative — list is illustrative, not exhaustive):
50
56
 
51
57
  | Forbidden path | Canonical replacement |
52
58
  |---|---|
53
- | `<project>/email-context/` | `<project>/Evidence/<alias>/email/snapshot/` + `stream/` |
59
+ | `<project>/email-context/` | `<project>/Evidence/<alias>/email/weekly/` |
54
60
  | `<project>/email/` (at project root) | `<project>/Evidence/<alias>/email/` |
55
- | `<project>/notes/` | `<project>/Evidence/<alias>/onenote/snapshot/pages/` |
56
- | `<project>/_Weekly Summaries/` | `<project>/Evidence/<alias>/<source>/stream/` |
61
+ | `<project>/notes/` | `<project>/Evidence/<alias>/onenote/weekly/` |
62
+ | `<project>/_Weekly Summaries/` | `<project>/Evidence/<alias>/<source>/weekly/` |
57
63
  | `<project>/Meetings/` (at project root) | `<project>/Evidence/<alias>/meetings/` |
58
64
  | `<project>/Teams/` (at project root) | `<project>/Evidence/<alias>/teams/` |
59
65
  | `<project>/SharePoint/` (at project root) | `<project>/Evidence/<alias>/sharepoint/` |
60
66
  | `<project>/CRM/`, `<project>/ADO/` (at project root) | `<project>/Evidence/<alias>/{crm,ado}/` |
61
- | any `<project>/<source>-context/`, `<project>/<source>-summary/`, etc. | `<project>/Evidence/<alias>/<source>/snapshot/` |
67
+ | any `<project>/<source>-context/`, `<project>/<source>-summary/`, etc. | `<project>/Evidence/<alias>/<source>/weekly/` |
62
68
 
63
69
  `State/`, `Reports/`, `integrations.yml` are the **only** top-level siblings of `Evidence/` that pull/refresh skills are allowed to leave alone (they are written by `build-state`, `aggregate-project`, and bootstrap respectively — not by pull-* skills).
64
70
 
@@ -103,7 +109,9 @@ Together they guarantee that two contributors running the same verb on the same
103
109
 
104
110
  ## Cross-references
105
111
 
106
- - `snapshot-vs-stream.instructions.md` — the two shapes inside each `<source>/` folder.
112
+ - `weekly-csc.instructions.md` — the v4.9.0 layout inside each `<source>/` folder (weekly/ + _index/).
113
+ - `snapshot-vs-stream.instructions.md` — DEPRECATED v4.9.0; legacy two-folder model.
114
+ - `comprehensive-structured-capture.instructions.md` — the v4.9.0 block shape inside weekly/ files.
107
115
  - `scope-boundaries.instructions.md` — what each source is allowed to query (orthogonal: scope vs path).
108
116
  - `side-by-side-config.instructions.md` — config files (mutable hints, integrations.yml) live under `<workspace>/.kushi/config/` (v4.4.0+, was `<engagement-root>/.project-evidence/`).
109
117
  - `run-reports.instructions.md` — every layout-migration MUST appear in the refresh report.