kushi-agents 4.8.3 → 5.0.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 (59) hide show
  1. package/README.md +18 -1
  2. package/package.json +2 -2
  3. package/plugin/agents/kushi.agent.md +8 -2
  4. package/plugin/instructions/comprehensive-structured-capture.instructions.md +250 -0
  5. package/plugin/instructions/dashboard-artifact.instructions.md +132 -0
  6. package/plugin/instructions/entity-graph.instructions.md +160 -0
  7. package/plugin/instructions/evidence-layout-canonical.instructions.md +20 -12
  8. package/plugin/instructions/evidence-thoroughness.instructions.md +119 -225
  9. package/plugin/instructions/guided-tour.instructions.md +100 -0
  10. package/plugin/instructions/host-portability.instructions.md +77 -0
  11. package/plugin/instructions/identity-resolution.instructions.md +1 -1
  12. package/plugin/instructions/karpathy-state-layout.instructions.md +124 -0
  13. package/plugin/instructions/meetings-verbatim-required.instructions.md +6 -4
  14. package/plugin/instructions/scope-boundaries.instructions.md +1 -1
  15. package/plugin/instructions/snapshot-vs-stream.instructions.md +25 -1
  16. package/plugin/instructions/verbatim-by-default.instructions.md +21 -1
  17. package/plugin/instructions/weekly-csc.instructions.md +335 -0
  18. package/plugin/instructions/workiq-only.instructions.md +140 -1
  19. package/plugin/plugin.json +17 -6
  20. package/plugin/prompts/dashboard.prompt.md +29 -0
  21. package/plugin/prompts/link-entities.prompt.md +30 -0
  22. package/plugin/prompts/tour.prompt.md +30 -0
  23. package/plugin/skills/ask-project/SKILL.md +37 -6
  24. package/plugin/skills/bootstrap-project/SKILL.md +33 -5
  25. package/plugin/skills/build-state/SKILL.md +70 -8
  26. package/plugin/skills/consolidate-evidence/SKILL.md +27 -4
  27. package/plugin/skills/dashboard/SKILL.md +113 -0
  28. package/plugin/skills/link-entities/SKILL.md +216 -0
  29. package/plugin/skills/link-entities/build-graph.ps1 +483 -0
  30. package/plugin/skills/pull-ado/SKILL.md +85 -9
  31. package/plugin/skills/pull-crm/SKILL.md +87 -10
  32. package/plugin/skills/pull-email/SKILL.md +75 -11
  33. package/plugin/skills/pull-meetings/SKILL.md +83 -8
  34. package/plugin/skills/pull-onenote/SKILL.md +86 -9
  35. package/plugin/skills/pull-sharepoint/SKILL.md +73 -10
  36. package/plugin/skills/pull-teams/SKILL.md +78 -9
  37. package/plugin/skills/refresh-project/SKILL.md +37 -5
  38. package/plugin/skills/self-check/SKILL.md +16 -0
  39. package/plugin/skills/self-check/run.ps1 +328 -0
  40. package/plugin/skills/setup/SKILL.md +1 -1
  41. package/plugin/skills/tour/SKILL.md +68 -0
  42. package/plugin/skills/tour/build-tour.ps1 +185 -0
  43. package/plugin/templates/dashboard/dashboard.template.html +431 -0
  44. package/plugin/templates/dashboard/embedder.ps1 +56 -0
  45. package/plugin/templates/init/integrations.template.yml +38 -24
  46. package/plugin/templates/snapshot/DEPRECATED-v4.9.0.md +37 -0
  47. package/plugin/templates/state/AGENTS.template.md +33 -0
  48. package/plugin/templates/state/CLAUDE.template.md +33 -0
  49. package/plugin/templates/state/index.template.md +41 -0
  50. package/plugin/templates/state/log.template.md +14 -0
  51. package/plugin/templates/state/page.template.md +22 -0
  52. package/plugin/templates/weekly/_index_entities.template.yml +26 -0
  53. package/plugin/templates/weekly/ado-csc.template.md +113 -0
  54. package/plugin/templates/weekly/crm-csc.template.md +103 -0
  55. package/plugin/templates/weekly/email-csc.template.md +114 -0
  56. package/plugin/templates/weekly/meetings-csc.template.md +112 -0
  57. package/plugin/templates/weekly/onenote-csc.template.md +95 -0
  58. package/plugin/templates/weekly/sharepoint-csc.template.md +98 -0
  59. package/plugin/templates/weekly/teams-csc.template.md +100 -0
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  [![npm version](https://img.shields.io/npm/v/kushi-agents.svg)](https://www.npmjs.com/package/kushi-agents)
4
4
  [![npm downloads](https://img.shields.io/npm/dw/kushi-agents.svg)](https://www.npmjs.com/package/kushi-agents)
5
5
  [![license](https://img.shields.io/npm/l/kushi-agents.svg)](LICENSE)
6
+ [![host: Clawpilot](https://img.shields.io/badge/host-Clawpilot-7c9cff)](https://gim-home.github.io/kushi/)
7
+ [![host: VS Code](https://img.shields.io/badge/host-VS%20Code-007acc)](https://gim-home.github.io/kushi/)
6
8
 
7
9
  > A multi-skill GitHub Copilot agent for grounded engagement evidence — across Email, Teams, Meetings, OneNote, SharePoint, Dataverse (CRM), and Azure DevOps.
8
10
 
@@ -30,6 +32,18 @@ The split is deliberate: aggregation is **heavy, scheduled, replayable**; answer
30
32
 
31
33
  See [Concepts → Aggregate, then Answer](https://gim-home.github.io/kushi/concepts/aggregate-and-answer/) for the full pattern.
32
34
 
35
+ ## v5.0.0 — Cross-source graph + Karpathy State + interactive dashboard + auto-tour
36
+
37
+ v5.0.0 builds on the v4.9.0 Comprehensive Structured Capture (CSC) + weekly-only layout to surface cross-source structure:
38
+
39
+ - **Cross-source entity graph** — `link-entities` walks every per-source `_index/entities.yml` + weekly CSC body and emits `<project>/Evidence/_graph/project-graph.json`. Closed edge taxonomy (`references`, `decides`, `action-item-tracks`, `discusses`, `produced-by`, `follow-up-of`, `same-thread`, `participant-of`); deterministic by default; LLM augment is opt-in via `m365Mutable.graph.llm_infer`.
40
+ - **Karpathy-style State layout** — `build-state` now also emits `State/index.md` + `State/log.md` + per-entity pages under closed-set categories (`people/`, `opportunities/`, `adoworkitems/`, `decisions/`, `risks/`, `customerasks/`, `meetings/`, `artifacts/`), plus `State/CLAUDE.md` and `State/AGENTS.md`. Legacy `State/00_…–09_…` files coexist for `full` profile parity.
41
+ - **Interactive HTML dashboard** — `dashboard` writes a single self-contained `<project>/dashboard.html` (Cytoscape.js v3 + cose-bilkent, Clawpilot theme variables, Graph + Timeline tabs, source/alias/date filters, fuzzy search, side panel with cited CSC blocks).
42
+ - **Auto-generated guided tour** — `tour` writes `<project>/State/tour.md`, a top-N walkthrough scored by `recency_weight × cross_ref_count` (14-day half-life × graph degree). Default N=10, configurable via `m365Mutable.tour.topN`.
43
+ - **`refresh` and `bootstrap` chain it all** — at the end of each run, both orchestrators dispatch `link-entities → dashboard → tour`; failures are recorded but never block the next step.
44
+
45
+ No migration required. Run `@Kushi refresh <project>` to produce the graph, regenerate State/, write the dashboard, and write the tour.
46
+
33
47
  ## Two-way sync to ADO — preview shipped
34
48
 
35
49
  Kushi can now **propose updates back to ADO** from the cited evidence it already has. Two skills under the opt-in `preview` profile:
@@ -83,7 +97,10 @@ The Evidence/ folder produced by every profile is a **stable public contract**
83
97
  | `aggregate` | core+ | last watermark → now | Pull every enabled source + consolidate. **No State/ rebuild.** |
84
98
  | `bootstrap` | standard+ | 30 days (default) | First-time setup — scaffold folders, lay configs side-by-side, initial pull. Profile-aware (builds State only on `full`). |
85
99
  | `refresh` | standard+ | last watermark → now | Pull only what changed. Profile-aware (rebuilds State only on `full`). |
86
- | `state` | full | n/a | Render the outcome-based `State/` files from existing evidence. No new pulls. |
100
+ | `state` | full | n/a | Render the outcome-based `State/` files from existing evidence. No new pulls. v5.0.0 also emits Karpathy-style layout (`index.md` + `log.md` + per-entity pages under closed-set categories + `CLAUDE.md`/`AGENTS.md`). |
101
+ | `link-entities` | standard+ | n/a | v5.0.0 — Build the cross-source entity graph (`Evidence/_graph/project-graph.json`). Deterministic; opt-in LLM augment. |
102
+ | `dashboard` | standard+ | n/a | v5.0.0 — Render `<project>/dashboard.html` — single self-contained Cytoscape.js v3 dashboard with Graph + Timeline views, filters, fuzzy search, side panel. |
103
+ | `tour` | standard+ | n/a | v5.0.0 — Render `<project>/State/tour.md`, an auto-generated week-in-review walkthrough scored by `recency_weight × cross_ref_count`. |
87
104
  | `consolidate` | core+ | per week | Merge per-user streams into `_Consolidated/<YYYY-MM-DD>_consolidated.md`. |
88
105
  | `status` | core+ | n/a | Show the run-log for a project. |
89
106
  | `ask` | core+ | n/a | Read-only natural-language Q&A. Always cites. Auto-routes. |
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": "5.0.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"
@@ -35,7 +35,10 @@ The Evidence/ folder produced by `aggregate` is the **public contract** between
35
35
  | `@Kushi bootstrap <project>` | standard+ | last 30 days | `bootstrap-project` → `pull-*` → `consolidate-evidence` → (full only) `build-state` |
36
36
  | `@Kushi refresh <project>` | standard+ | since last watermark (fallback 7d) | `refresh-project` → `pull-*` → `consolidate-evidence` → (full only) `build-state` |
37
37
  | `@Kushi refresh <project> last N days` / `since <date>` / `<from>..<to>` | standard+ | as supplied | same |
38
- | `@Kushi state <project>` | **full** | n/a (no pull) | `build-state` only — re-render State/ from existing Evidence |
38
+ | `@Kushi state <project>` | **full** | n/a (no pull) | `build-state` only — re-render State/ from existing Evidence (v5.0.0: ALSO emits Karpathy `State/` layout — `index.md` + `log.md` + per-entity pages + `CLAUDE.md`/`AGENTS.md` — gated on `m365Mutable.state.layout`, default `karpathy`). |
39
+ | `@Kushi link-entities <project>` | standard+ | n/a (read-only) | v5.0.0 — `link-entities` writes `<project>/Evidence/_graph/project-graph.json` from per-source `_index/entities.yml` + weekly CSC bodies. Deterministic by default; opt-in LLM augment via `m365Mutable.graph.llm_infer`. |
40
+ | `@Kushi dashboard <project>` | standard+ | n/a (read-only) | v5.0.0 — `dashboard` writes `<project>/dashboard.html` (single self-contained file). Cytoscape.js v3 + Clawpilot theme. |
41
+ | `@Kushi tour <project> [--top N]` | standard+ | n/a (read-only) | v5.0.0 — `tour` writes `<project>/State/tour.md`, an auto-generated week-in-review walkthrough scored by `recency_weight × cross_ref_count` (14-day half-life). Default N=10. |
39
42
  | `@Kushi consolidate <project> last N days` | core+ | N days | `consolidate-evidence` only |
40
43
  | `@Kushi status <project>` | core+ | n/a | `project-status` — show run-log |
41
44
  | `@Kushi ask <project> <question>` | core+ | n/a (read-only) | `ask-project` — cited Q&A over Evidence/ (+ State/ on full) |
@@ -145,7 +148,10 @@ Top-level orchestrator skills (called directly by verbs):
145
148
  | `aggregate-project` | core+ | Pull-only orchestrator. Runs every enabled `pull-*` + `consolidate-evidence`. **Does NOT run `build-state`.** |
146
149
  | `bootstrap-project` | standard+ | First-time setup; lays configs side-by-side, scaffolds folders, runs initial 30d pull. Profile-aware: calls `build-state` only on `full`. |
147
150
  | `refresh-project` | standard+ | Watermark-driven incremental orchestrator. Profile-aware: calls `build-state` only on `full`. |
148
- | `build-state` | **full** | Renders `State/` from existing `Evidence/` (no source pulls). |
151
+ | `build-state` | **full** | Renders `State/` from existing `Evidence/` (no source pulls). v5.0.0: also emits Karpathy layout (`index.md` + `log.md` + per-entity pages + `CLAUDE.md`/`AGENTS.md`) when `m365Mutable.state.layout: karpathy` (default). |
152
+ | `link-entities` | standard+ | v5.0.0 — cross-source entity graph builder. Walks `Evidence/<alias>/<source>/_index/entities.yml` + weekly CSC bodies and emits `Evidence/_graph/project-graph.json` (nodes per canonical entity id, edges by closed taxonomy). LLM augment is opt-in via `m365Mutable.graph.llm_infer`. |
153
+ | `dashboard` | standard+ | v5.0.0 — renders `<project>/dashboard.html` (single self-contained file) from the entity graph + per-source `_index/entities.yml` + `State/index.md`. Cytoscape.js v3 + Clawpilot theme variables. |
154
+ | `tour` | standard+ | v5.0.0 — emits `<project>/State/tour.md`, an auto-generated week-in-review walkthrough scored by `recency_weight × cross_ref_count` (14-day half-life). |
149
155
  | `consolidate-evidence` | core+ | Merges per-user streams into `_Consolidated/`. |
150
156
  | `project-status` | core+ | Read-only run-log inspector. |
151
157
  | `ask-project` | core+ | Read-only natural-language Q&A over Evidence/ (+ State/ on full). Cited; no source pulls; no outbound. Auto-dispatches when a project name + question are detected. |
@@ -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.
@@ -0,0 +1,132 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "v5.0.0 — Interactive HTML dashboard. Single self-contained `<project>/dashboard.html` rendered from `_graph/project-graph.json` + `_index/entities.yml` (per source) + `State/index.md`. Uses Cytoscape.js v3 + cose-bilkent layout, two-view tabs (Graph + Timeline), source/alias/date filters, fuzzy search, and a side panel that surfaces weekly CSC blocks on node click. Theming follows the Clawpilot `web-artifacts-builder` skill (CSS variables). Idempotent — regenerated every run."
4
+ ---
5
+
6
+ # Dashboard Artifact — HARD RULE (kushi v5.0.0+)
7
+
8
+ ## Why
9
+
10
+ Stakeholders ask "what happened on this engagement?" and we hand them
11
+ markdown nobody reads. v5.0.0 ships a single HTML file that visualizes the
12
+ project graph and lets the reader click any node to surface the cited CSC
13
+ block. No server, no build, no install — just open the file.
14
+
15
+ ## Output
16
+
17
+ - **Path:** `<engagement-root>/<project>/dashboard.html`
18
+ - **Producer:** `dashboard` skill.
19
+ - **Idempotency:** the file is **fully regenerated** every run. The producer
20
+ embeds the latest graph + indices + state catalog inline. There is no
21
+ external fetch at view time; the file opens from any path on any browser.
22
+
23
+ ## Input contract
24
+
25
+ The dashboard reads three things (all OPTIONAL; missing inputs gracefully
26
+ degrade the view):
27
+
28
+ 1. `<project>/Evidence/_graph/project-graph.json` — nodes + edges.
29
+ 2. `<project>/Evidence/<alias>/<source>/_index/entities.yml` for every
30
+ contributor / source — surfaces `latest_csc_file` + per-entity weekly
31
+ pointers used by the side panel.
32
+ 3. `<project>/State/index.md` — list of v5 State pages, used to populate the
33
+ side panel's "State pages" section.
34
+
35
+ If `_graph/project-graph.json` is missing, the dashboard is not produced.
36
+ (Self-check D22.dashboard enforces this.)
37
+
38
+ ## Output contract
39
+
40
+ A **single self-contained HTML file** with:
41
+
42
+ - All JS libraries inlined (no CDN at view time).
43
+ - All graph + index + state data inlined via
44
+ `<script id="graph-data" type="application/json">...</script>`
45
+ (and sibling `index-data` / `state-data` scripts).
46
+ - All CSS inlined using Clawpilot theme variables (per the
47
+ `web-artifacts-builder` skill).
48
+
49
+ ## Rendering stack
50
+
51
+ - **Cytoscape.js v3.x** for graph rendering (Q2 = B locked in the v5 plan).
52
+ v3.x because it is the current major; v3 ships an ES5-friendly minified
53
+ build that inlines cleanly into a single HTML file.
54
+ - **cytoscape-cose-bilkent** layout for force-directed node placement.
55
+ - **Optional fuzzy search:** inline `fuse.js` (≈ 9 KB minified) OR a 30-line
56
+ bespoke fuzzy matcher in the template — producer's choice based on the
57
+ final inline size budget.
58
+
59
+ CDN URLs are referenced at template **author time** for traceability, but
60
+ the bytes themselves are **embedded inline** in
61
+ `plugin/templates/dashboard/dashboard.template.html`. The shipped file does
62
+ NOT fetch from any CDN at view time.
63
+
64
+ ## Theming
65
+
66
+ Follows the Clawpilot `web-artifacts-builder` skill. The template MUST use
67
+ CSS variables (`--bg`, `--fg`, `--accent`, `--surface`, `--border`, etc.)
68
+ defined by that skill so the dashboard adopts the user's Clawpilot theme when
69
+ opened inside Clawpilot, and falls back to a Clawpilot-default light/dark
70
+ scheme when opened in a vanilla browser.
71
+
72
+ ## Views
73
+
74
+ The dashboard exposes two views via top-level tabs:
75
+
76
+ 1. **Graph view** — Cytoscape canvas. Nodes colored by `source`. Edge style
77
+ varies by `kind`. Default layout: `cose-bilkent`. Pan + zoom +
78
+ click-to-select.
79
+ 2. **Timeline view** — CSS-grid layout with one column per ISO week (computed
80
+ from `last_touched_iso` across all nodes). Within each column, nodes are
81
+ stacked + grouped by source. Click selects same as Graph view.
82
+
83
+ ## Side panel
84
+
85
+ Clicking a node opens a side panel showing:
86
+
87
+ - Title + source pill + last_touched date.
88
+ - `weekly_refs` — each rendered as a collapsible block. When expanded, the
89
+ block loads the cited CSC anchor inline (HTML-rendered markdown extracted
90
+ client-side from the embedded weekly file text, or — if the file body is
91
+ too large to inline — a click-through link to the file path).
92
+ - Incoming + outgoing edges with their evidence snippets + kind pill.
93
+ - Related State pages (resolved via `State/index.md`) as `[[wikilink]]`
94
+ click-throughs that open `State/<category>/<slug>.md`.
95
+
96
+ ## Filters
97
+
98
+ A header strip exposes:
99
+
100
+ - **Source** — multi-select pill list of the seven source families.
101
+ - **Alias** — multi-select of contributors who touched the project.
102
+ - **Date range** — slider over ISO-week buckets between
103
+ `min(first_seen_iso)` and `max(last_touched_iso)` across all nodes.
104
+
105
+ Filter application is client-side; no re-fetch.
106
+
107
+ ## Search
108
+
109
+ A search box (top-right of header) does fuzzy match on node `title`.
110
+ Selecting a hit pans the Graph view to the node and opens the side panel.
111
+
112
+ ## Configuration
113
+
114
+ Producer reads from the user's `m365-mutable.json` /
115
+ `integrations.yml#dashboard.*` (no required keys today; reserved for future
116
+ options like `dashboard.layout` override or `dashboard.maxNodes`).
117
+
118
+ ## Self-check
119
+
120
+ `D22.dashboard` enforces:
121
+
122
+ - If `_graph/project-graph.json` exists, `<project>/dashboard.html` exists.
123
+ - WARN (not fail) if `dashboard.html` is older than the graph file (suggests
124
+ the user ran `link-entities` standalone without `dashboard`).
125
+
126
+ ## Cross-references
127
+
128
+ - `entity-graph.instructions.md` — input schema (source of truth).
129
+ - `karpathy-state-layout.instructions.md` — `State/index.md` is one of the
130
+ inputs.
131
+ - `web-artifacts-builder` (Clawpilot user skill) — theming + single-HTML
132
+ packaging contract.
@@ -0,0 +1,160 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "v5.0.0 — Cross-source entity graph. One JSON artifact per project: `Evidence/_graph/project-graph.json`. Nodes are source entities (email threads, teams chats, meetings, OneNote pages, SharePoint sites, CRM records, ADO work items) keyed by canonical entity-id URIs from weekly-csc.instructions.md. Edges are typed (closed taxonomy) and carry weekly/+anchor evidence. Deterministic-first; LLM-inferred edges are opt-in. Multi-user safe: merge by node-id + (from,to,kind)."
4
+ ---
5
+
6
+ # Entity Graph — HARD RULE (kushi v5.0.0+)
7
+
8
+ ## Why
9
+
10
+ After v4.9.0 every entity across every source is captured as a structured CSC
11
+ block with a canonical entity-id. That makes one new artifact possible:
12
+ a project-scoped, cross-source graph that says **which entities relate to
13
+ which** — meeting decisions to ADO work items, customer asks to CRM
14
+ opportunities, email threads to meetings.
15
+
16
+ This doctrine defines the graph schema, the closed edge taxonomy, the
17
+ producer/reader contract, and the multi-user merge rules. The graph is
18
+ consumed by `dashboard`, `tour`, `build-state`, and `ask-project`.
19
+
20
+ ## Output
21
+
22
+ - **Path:** `<engagement-root>/<project>/Evidence/_graph/project-graph.json`
23
+ - **Producer:** `link-entities` skill (see `plugin/skills/link-entities/`).
24
+ - **Idempotency:** the file is **fully regenerated** on every `link-entities`
25
+ run. There is no append/merge across runs — the producer always rewalks
26
+ `_index/` + `weekly/` and rebuilds from scratch.
27
+
28
+ ## Schema
29
+
30
+ ```jsonc
31
+ {
32
+ "kushi_version": "5.0.0",
33
+ "project": "<project-name>",
34
+ "generated_at": "<ISO-8601 UTC>",
35
+ "generated_by_alias": "<alias>",
36
+ "nodes": [
37
+ {
38
+ "id": "<canonical-entity-id>", // see weekly-csc.instructions.md
39
+ "source": "email|teams|meetings|onenote|sharepoint|crm|ado",
40
+ "title": "<display title>",
41
+ "first_seen_iso": "YYYY-MM-DD",
42
+ "last_touched_iso": "YYYY-MM-DD",
43
+ "weekly_refs": [
44
+ "<alias>/<source>/weekly/YYYY-MM-DD_<source>-csc.md#<entity-anchor>"
45
+ ]
46
+ }
47
+ ],
48
+ "edges": [
49
+ {
50
+ "from": "<node-id>",
51
+ "to": "<node-id>",
52
+ "kind": "<one of the closed edge taxonomy values>",
53
+ "owner": "<optional — action-item-tracks only>",
54
+ "due": "<optional ISO date or 'unspecified' — action-item-tracks only>",
55
+ "evidence": {
56
+ "weekly_file": "<alias>/<source>/weekly/YYYY-MM-DD_<source>-csc.md",
57
+ "anchor": "<entity-anchor>",
58
+ "bullet_snippet": "<≥20 chars verbatim from the source bullet>"
59
+ },
60
+ "confidence": "explicit | inferred-llm"
61
+ }
62
+ ]
63
+ }
64
+ ```
65
+
66
+ ## Canonical entity-id formats
67
+
68
+ Identical to `weekly-csc.instructions.md` — the graph never invents IDs.
69
+
70
+ | Source | Canonical id |
71
+ |------------|--------------|
72
+ | email | `email://conversation_id=<id>` |
73
+ | teams | `teams://chat_id=<id>` OR `teams://channel=<teamId>/<channelId>/<rootMessageId>` |
74
+ | meetings | `meetings://joinurl=<urlencoded>&start=<iso>` |
75
+ | onenote | `onenote://page/wdpartid=<id>` |
76
+ | sharepoint | `sharepoint://siteurl=<url>` |
77
+ | crm | `crm://entity=<logicalName>/id=<guid>` |
78
+ | ado | `ado://org=<org>/project=<project>/workitemid=<int>` |
79
+
80
+ ## Closed edge taxonomy
81
+
82
+ Edges MUST use one of these `kind` values. Producers that need a new kind
83
+ update this doctrine first.
84
+
85
+ | `kind` | Meaning |
86
+ |---|---|
87
+ | `references` | X cites/links Y (URL reference in a bullet). |
88
+ | `decides` | X makes a decision that affects Y (bullet appears under Decisions). |
89
+ | `action-item-tracks` | An action item in X is tracked in Y (typically ADO/CRM). Bullet appears under Action Items. `owner` + `due` MAY be populated. |
90
+ | `discusses` | X (meeting/chat/email) discusses Y (CRM/ADO/OneNote/SharePoint). Bullet appears under Topics Discussed or Q & A. |
91
+ | `produced-by` | Artifact Y was produced from discussion X. |
92
+ | `follow-up-of` | Y is chronologically a follow-up to X. |
93
+ | `same-thread` | X and Y are part of the same conversation thread. |
94
+ | `participant-of` | Person Y is a participant in X. (Reserved — person nodes ship in a later release.) |
95
+
96
+ ## Evidence + citation requirements
97
+
98
+ - Every node has ≥ 1 `weekly_refs` entry that resolves to an existing
99
+ `<alias>/<source>/weekly/<file>` + `#<anchor>` on disk.
100
+ - Every edge carries `evidence.weekly_file` + `evidence.anchor` that resolve
101
+ on disk. `evidence.bullet_snippet` is the verbatim bullet text (or a leading
102
+ prefix ≥ 20 chars) that justified the edge.
103
+ - Edges with `confidence: inferred-llm` MUST include `bullet_snippet` ≥ 20
104
+ chars — empty inferences are forbidden.
105
+
106
+ ## Confidence
107
+
108
+ | Value | Meaning |
109
+ |---|---|
110
+ | `explicit` | Produced by the deterministic extractor (URL match, ID token match, conversation-id correlation). The default and the only confidence written when `m365Auth.linkEntities.llmInfer` is false (default). |
111
+ | `inferred-llm` | Produced by an LLM augment pass (WorkIQ call given the project entity inventory). Only emitted when `m365Auth.linkEntities.llmInfer: true` is set in the user's `m365-auth.yml`. |
112
+
113
+ When the flag is false, the graph contains **only** explicit edges. Toggling
114
+ the flag does not invalidate existing graphs — it just changes what the next
115
+ `link-entities` run will emit.
116
+
117
+ ## Multi-user merge rules
118
+
119
+ `link-entities` walks **all** contributors under `Evidence/<alias>/<source>/`
120
+ and produces a single project-scoped graph:
121
+
122
+ 1. **Nodes:** dedupe by `id`. If two contributors saw the same entity,
123
+ merge: `first_seen_iso = min`, `last_touched_iso = max`, `title` from the
124
+ most-recent contributor, `weekly_refs` is the **union** across contributors
125
+ (preserves per-contributor citations).
126
+ 2. **Edges:** dedupe by `(from, to, kind)`. When duplicates exist, keep the
127
+ one with the strongest confidence (`explicit > inferred-llm`); ties keep
128
+ the most-recent weekly_file. `weekly_refs` are not stored on edges —
129
+ evidence is the single bullet that justified the edge.
130
+ 3. **No contributor isolation.** The graph is a project artifact. Contributors
131
+ never own slices of it; `_graph/` lives outside any `<alias>/` folder.
132
+
133
+ ## Reader contract
134
+
135
+ Readers (dashboard, tour, build-state, ask-project) MUST treat the graph as
136
+ authoritative for "what relates to what" within a project, and MUST follow
137
+ edges back to `evidence.weekly_file#anchor` to cite their answers.
138
+
139
+ If `_graph/project-graph.json` is missing, readers fall back to the v4.9.0
140
+ behavior (walk `weekly/` + `_index/` per source).
141
+
142
+ ## Self-check
143
+
144
+ `D20.graph` enforces the schema:
145
+
146
+ - Every node has ≥ 1 `weekly_refs` entry that resolves on disk.
147
+ - Every edge has `evidence.weekly_file` + `anchor` that resolve on disk.
148
+ - Every edge `kind` is in the closed taxonomy above.
149
+ - Inferred-llm edges have `bullet_snippet` ≥ 20 chars.
150
+
151
+ ## Cross-references
152
+
153
+ - `weekly-csc.instructions.md` — canonical entity-id formats (source of truth).
154
+ - `comprehensive-structured-capture.instructions.md` — section taxonomy that
155
+ drives edge-kind inference (Decisions → `decides`, Action Items →
156
+ `action-item-tracks`, Topics/Q&A → `discusses`, else → `references`).
157
+ - `karpathy-state-layout.instructions.md` — consumer (writes one State page
158
+ per cross-source entity in the graph).
159
+ - `dashboard-artifact.instructions.md` — consumer (visualizes the graph).
160
+ - `guided-tour.instructions.md` — consumer (scores + walks the graph).