kushi-agents 3.4.1

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 (111) hide show
  1. package/.github/config/m365-auth.json.example +56 -0
  2. package/.github/config/m365-mutable.json.example +11 -0
  3. package/LICENSE +201 -0
  4. package/README.md +159 -0
  5. package/bin/cli.mjs +75 -0
  6. package/package.json +35 -0
  7. package/plugin/agents/kushi.agent.md +147 -0
  8. package/plugin/instructions/answer-from-evidence.instructions.md +73 -0
  9. package/plugin/instructions/auth-and-retry.instructions.md +116 -0
  10. package/plugin/instructions/az-auth-conditional.instructions.md +39 -0
  11. package/plugin/instructions/azure-auth-patterns.instructions.md +226 -0
  12. package/plugin/instructions/citation-ledger.instructions.md +52 -0
  13. package/plugin/instructions/engagement-root-resolution.instructions.md +82 -0
  14. package/plugin/instructions/evidence-thoroughness.instructions.md +62 -0
  15. package/plugin/instructions/side-by-side-config.instructions.md +56 -0
  16. package/plugin/instructions/snapshot-vs-stream.instructions.md +87 -0
  17. package/plugin/instructions/thoroughness-detector.instructions.md +105 -0
  18. package/plugin/instructions/workiq-first.instructions.md +47 -0
  19. package/plugin/plugin.json +96 -0
  20. package/plugin/prompts/aggregate.prompt.md +24 -0
  21. package/plugin/prompts/ask.prompt.md +16 -0
  22. package/plugin/prompts/bootstrap.prompt.md +23 -0
  23. package/plugin/prompts/consolidate.prompt.md +21 -0
  24. package/plugin/prompts/fde-intake.prompt.md +41 -0
  25. package/plugin/prompts/fde-report.prompt.md +46 -0
  26. package/plugin/prompts/fde-triage.prompt.md +46 -0
  27. package/plugin/prompts/refresh.prompt.md +17 -0
  28. package/plugin/prompts/state.prompt.md +17 -0
  29. package/plugin/prompts/status.prompt.md +17 -0
  30. package/plugin/reference-packs/README.md +74 -0
  31. package/plugin/reference-packs/fde/README.md +62 -0
  32. package/plugin/reference-packs/fde/core-fde-reference.md +427 -0
  33. package/plugin/reference-packs/fde/intake-questions.md +168 -0
  34. package/plugin/reference-packs/fde/report-doctrine.md +189 -0
  35. package/plugin/skills/aggregate-project/SKILL.md +72 -0
  36. package/plugin/skills/ask-project/SKILL.md +162 -0
  37. package/plugin/skills/bootstrap-project/SKILL.md +129 -0
  38. package/plugin/skills/build-state/SKILL.md +69 -0
  39. package/plugin/skills/consolidate-evidence/SKILL.md +47 -0
  40. package/plugin/skills/fde-intake/SKILL.md +147 -0
  41. package/plugin/skills/fde-report/SKILL.md +159 -0
  42. package/plugin/skills/fde-triage/SKILL.md +114 -0
  43. package/plugin/skills/intro/SKILL.md +449 -0
  44. package/plugin/skills/project-status/SKILL.md +61 -0
  45. package/plugin/skills/pull-ado/SKILL.md +77 -0
  46. package/plugin/skills/pull-crm/SKILL.md +75 -0
  47. package/plugin/skills/pull-email/SKILL.md +75 -0
  48. package/plugin/skills/pull-meetings/SKILL.md +77 -0
  49. package/plugin/skills/pull-onenote/SKILL.md +82 -0
  50. package/plugin/skills/pull-sharepoint/SKILL.md +85 -0
  51. package/plugin/skills/pull-teams/SKILL.md +75 -0
  52. package/plugin/skills/refresh-project/SKILL.md +89 -0
  53. package/plugin/skills/self-check/SKILL.md +166 -0
  54. package/plugin/skills/self-check/run.ps1 +517 -0
  55. package/plugin/skills/self-check/run.sh +33 -0
  56. package/plugin/templates/fde/intake.md +114 -0
  57. package/plugin/templates/fde/report-fitness.md +151 -0
  58. package/plugin/templates/fde/report-long.md +109 -0
  59. package/plugin/templates/fde/report-short.md +45 -0
  60. package/plugin/templates/fde/report-stage-readiness.md +70 -0
  61. package/plugin/templates/fde/report-weekly.md +73 -0
  62. package/plugin/templates/fde/triage-00-fde-analysis.md +78 -0
  63. package/plugin/templates/fde/triage-02-risk-analysis.md +76 -0
  64. package/plugin/templates/fde/triage-03-6Q.md +40 -0
  65. package/plugin/templates/fde/triage-04-readiness-checklist.md +82 -0
  66. package/plugin/templates/fde/triage-05-executive-consolidated.md +78 -0
  67. package/plugin/templates/fde/triage-06-global-opportunity.md +70 -0
  68. package/plugin/templates/fde/triage-07-validation-warnings.md +60 -0
  69. package/plugin/templates/init/ado-config.template.yml +21 -0
  70. package/plugin/templates/init/crm-config.template.yml +16 -0
  71. package/plugin/templates/init/kushi-projects.template.json +14 -0
  72. package/plugin/templates/init/m365-auth.template.json +67 -0
  73. package/plugin/templates/init/m365-mutable.template.json +19 -0
  74. package/plugin/templates/init/project-contributors.template.yml +27 -0
  75. package/plugin/templates/init/project-evidence.template.yml +32 -0
  76. package/plugin/templates/init/project-integrations.template.yml +34 -0
  77. package/plugin/templates/init/project-user-settings.template.yml +71 -0
  78. package/plugin/templates/paste-prompt.md +35 -0
  79. package/plugin/templates/snapshot/ado-item.template.md +45 -0
  80. package/plugin/templates/snapshot/crm-record.template.md +34 -0
  81. package/plugin/templates/snapshot/meetings-series-index.template.md +32 -0
  82. package/plugin/templates/snapshot/onenote-page.template.md +28 -0
  83. package/plugin/templates/snapshot/sharepoint-file.template.md +31 -0
  84. package/plugin/templates/snapshot/sharepoint-tree.template.md +39 -0
  85. package/plugin/templates/snapshot/teams-roster.template.md +27 -0
  86. package/plugin/templates/state/00_overview.template.md +44 -0
  87. package/plugin/templates/state/01_decisions.template.md +41 -0
  88. package/plugin/templates/state/02_stakeholders.template.md +48 -0
  89. package/plugin/templates/state/03_architecture-and-solution.template.md +56 -0
  90. package/plugin/templates/state/04_workshops-and-key-meetings.template.md +43 -0
  91. package/plugin/templates/state/05_action-items.template.md +29 -0
  92. package/plugin/templates/state/06_risks-and-issues.template.md +43 -0
  93. package/plugin/templates/state/07_timeline-and-milestones.template.md +45 -0
  94. package/plugin/templates/state/08_artifacts-and-deliverables.template.md +55 -0
  95. package/plugin/templates/state/09_open-questions.template.md +62 -0
  96. package/plugin/templates/state/README.md +41 -0
  97. package/plugin/templates/weekly/ado-stream.template.md +71 -0
  98. package/plugin/templates/weekly/consolidated.template.md +98 -0
  99. package/plugin/templates/weekly/crm-stream.template.md +74 -0
  100. package/plugin/templates/weekly/email-stream.template.md +103 -0
  101. package/plugin/templates/weekly/meetings-stream.template.md +182 -0
  102. package/plugin/templates/weekly/onenote-stream.template.md +106 -0
  103. package/plugin/templates/weekly/run-log.template.md +88 -0
  104. package/plugin/templates/weekly/sharepoint-stream.template.md +121 -0
  105. package/plugin/templates/weekly/teams-stream.template.md +121 -0
  106. package/src/constants.mjs +49 -0
  107. package/src/copy-assets.mjs +183 -0
  108. package/src/main.mjs +262 -0
  109. package/src/profile-resolver.mjs +168 -0
  110. package/src/prompt.mjs +42 -0
  111. package/src/settings.mjs +77 -0
@@ -0,0 +1,52 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "Citation rule — every assertion in every output must carry an inline source citation. No naked claims."
4
+ ---
5
+
6
+ # Citation Ledger (HARD RULE)
7
+
8
+ Every assertion in EVERY output (Evidence snapshot/stream files, State files 00–09, _Consolidated reports, run-log entries, Open Questions rows, Pending Outbound rows) MUST carry an inline citation. No naked claims. If you cannot cite it, do not write it — write the question into `09_open-questions.md` instead.
9
+
10
+ ## Citation formats
11
+
12
+ Pick the format that fits the source:
13
+
14
+ | Source | Format |
15
+ |---|---|
16
+ | M365 stream evidence | `[source: <alias>/<source>/stream/YYYY-MM-DD_<source>-stream.md · YYYY-MM-DD]` |
17
+ | M365 snapshot evidence | `[source: <alias>/<source>/snapshot/<entity>.md as of YYYY-MM-DD]` |
18
+ | CRM field | `[source: CRM <RecordId> field <fieldDisplayName> · YYYY-MM-DD]` |
19
+ | CRM annotation | `[source: CRM <RecordId> annotation by <author> · YYYY-MM-DD]` |
20
+ | ADO field | `[source: ADO #NNNNN field <fieldName> · YYYY-MM-DD]` |
21
+ | ADO comment | `[source: ADO #NNNNN comment by <author> · YYYY-MM-DD]` |
22
+ | SharePoint | `[source: SharePoint <relative/path/file.ext> · YYYY-MM-DD]` |
23
+ | OneNote | `[source: OneNote <Notebook>/<Section>/<Page> · YYYY-MM-DD]` |
24
+ | Meeting | `[source: Meeting "<subject>" transcript · YYYY-MM-DD]` |
25
+ | Email | `[source: Email "<subject>" from <sender> · YYYY-MM-DD]` |
26
+ | Derived/inferred | NEVER acceptable as a final fact. Either cite the underlying source, or move it to `09_open-questions.md` with Fidelity=Low. |
27
+
28
+ ## Where the rule applies
29
+
30
+ Every single one of:
31
+
32
+ - **Evidence snapshot/stream files** — every entry has a per-event citation back to the source system.
33
+ - **State/00_overview.md** — every fact in headline, phase, owner, dates, risks block.
34
+ - **State/01_decisions.md** — every decision row + every superseded entry.
35
+ - **State/02_stakeholders.md** — every person, role, contact attribution, and Conflicts row.
36
+ - **State/03_architecture-and-solution.md** — every component, dependency, constraint.
37
+ - **State/04_workshops-and-key-meetings.md** — every meeting entry.
38
+ - **State/05_action-items.md** — Source column populated always.
39
+ - **State/06_risks-and-issues.md** — every risk, mitigation, status update.
40
+ - **State/07_timeline-and-milestones.md** — every milestone date + status.
41
+ - **State/08_artifacts-and-deliverables.md** — every artifact link + author.
42
+ - **State/09_open-questions.md** — every Q-row source + every Resolved row.
43
+ - **_Consolidated/** — provenance tag on every merged claim showing which contributor's evidence file it came from.
44
+ - **run-log.yml** — every history entry references the run that touched it.
45
+ - **Pending Outbound rows** — citation for "why this person should be contacted".
46
+
47
+ ## Snapshot vs stream citation distinction
48
+
49
+ - Snapshot citations indicate "current truth" — use `as of YYYY-MM-DD`.
50
+ - Stream citations indicate "historical event" — use `· YYYY-MM-DD` (event date).
51
+
52
+ State files SHOULD cite both where appropriate (e.g. "the architecture is X [snapshot citation] as decided on date Y [stream citation]").
@@ -0,0 +1,82 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "How to resolve <engagement-root> — where the user's engagement folders live, and where per-user live configs sit beside them."
4
+ ---
5
+
6
+ # Engagement-root resolution
7
+
8
+ The **engagement-root** is the parent folder that contains all of the user's engagement subfolders. It is NOT inside the kushi repo and NOT inside `.kushi/`. It is the user's actual work area.
9
+
10
+ ## Resolution order
11
+
12
+ Resolve `<engagement-root>` in this order — first match wins:
13
+
14
+ 1. **`<USER_HOME>/.copilot/project-evidence.yml`** — read `engagement_root:` field (preferred).
15
+ 2. **`customer_workspace/FDEDocs/`** — if the user's workspace has this symlink, follow it. Common in NOVA-style installs.
16
+ 3. **Ask the user** once and persist the answer to `<USER_HOME>/.copilot/project-evidence.yml engagement_root`.
17
+
18
+ ## Live config location
19
+
20
+ Once `<engagement-root>` is known, live filled configs live at:
21
+
22
+ ```
23
+ <engagement-root>/.project-evidence/
24
+ m365/m365-auth.json
25
+ m365/m365-mutable.json
26
+ crm/config.yml
27
+ ado/config.yml
28
+ project-evidence.yml ← optional per-engagement override
29
+ ```
30
+
31
+ This folder is OneDrive-synced (typically) and follows the user across machines.
32
+
33
+ ## Project resolution
34
+
35
+ Once `<engagement-root>` is known, individual projects are subfolders:
36
+
37
+ ```
38
+ <engagement-root>/<project-1>/
39
+ <engagement-root>/<project-2>/
40
+ <engagement-root>/<project-3>/
41
+ ```
42
+
43
+ Project name resolution (always fuzzy):
44
+
45
+ 1. Match against keys in `<engagement-root>/.project-evidence/m365/m365-mutable.json m365Mutable.knownSections`.
46
+ 2. Match against `active_projects:` in `<USER_HOME>/.copilot/project-evidence.yml`.
47
+ 3. Match against actual subfolder names under `<engagement-root>`.
48
+
49
+ Case-insensitive; ranking `exact > prefix > contains`. Multiple plausible candidates → ask user to pick. Zero candidates AND verb is `bootstrap` → create the folder. Zero candidates AND verb is anything else → ask user.
50
+
51
+ ## Project structure (created on bootstrap)
52
+
53
+ ```
54
+ <engagement-root>/<project>/
55
+ integrations.yml ← project-shared config (CRM record id, ADO area, SP site)
56
+ Evidence/
57
+ run-log.yml ← per-source watermarks + weekly_files index
58
+ contributors.yml ← list of aliases who contribute evidence
59
+ <alias>/
60
+ .settings.yml ← per-(project x user) — search keywords, chat ids, etc.
61
+ email/{snapshot,stream}/
62
+ teams/{snapshot,stream}/
63
+ meetings/{snapshot,stream}/
64
+ onenote/{snapshot,stream}/
65
+ sharepoint/{snapshot,stream}/
66
+ crm/{snapshot,stream}/
67
+ ado/{snapshot,stream}/
68
+ _Consolidated/ ← multi-user merge output
69
+ State/
70
+ 00_overview.md
71
+ 01_decisions.md
72
+ 02_stakeholders.md
73
+ 03_architecture-and-solution.md
74
+ 04_workshops-and-key-meetings.md
75
+ 05_action-items.md
76
+ 06_risks-and-issues.md
77
+ 07_timeline-and-milestones.md
78
+ 08_artifacts-and-deliverables.md
79
+ 09_open-questions.md
80
+ ```
81
+
82
+ The skill creates missing folders/files on first use; never overwrites existing files without explicit user approval.
@@ -0,0 +1,62 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "Evidence Thoroughness Standard — every per-source skill MUST capture full bodies, full transcripts, full message reproduction. Headlines-only is a defect."
4
+ ---
5
+
6
+ # Evidence Thoroughness Standard (HARD RULE)
7
+
8
+ Evidence files are the **system of record** that State files cite. They MUST be deep enough that a reader can fully reconstruct what happened without going back to Outlook / Teams / OneNote / SharePoint / CRM / ADO. **Headlines-only summaries are a defect.**
9
+
10
+ ## Per-source minimum bar
11
+
12
+ ### Meetings (stream/)
13
+ For every meeting in the window — capture, **as separate named sections under each per-meeting block**:
14
+ - Full attendee list (required + optional + actual + no-shows)
15
+ - Agenda / stated purpose
16
+ - **Detailed Discussion Summary** — multi-paragraph narrative of what was actually discussed end-to-end, not 3 bullet points
17
+ - **Chronological transcript walk-through with verbatim quotes and timestamps** — every substantive exchange, not just 2 highlight quotes
18
+ - **Key Decisions** — every decision with exact wording + who decided + supporting context
19
+ - **Open Questions / Non-Decisions** — questions raised but not resolved, with who raised them and why deferred
20
+ - **Next Steps** — REQUIRED dedicated section. Forward-looking commitments that aren't yet hard action items: "team will gather facts", "Mike will discuss with industry leads", "Microsoft to come back with proposal next week". These are distinct from `Action Items` (which have owner+due) and are critical to State/05_action-items + State/04_workshops-and-key-meetings rendering.
21
+ - **Action Items** — every commitment with owner + due + source-line
22
+ - **Risks, Blockers, Dependencies** — surfaced or escalated in this meeting
23
+ - **Customer Asks** — explicit asks the customer made of Microsoft (resourcing, decisions, timelines, escalations)
24
+ - Every artifact link / shared file / recording / transcript URL
25
+ - **Coverage Notes** — what was retrievable vs what wasn't (transcript missing, chat-only reconstruction, partial recap, etc.)
26
+
27
+ If transcript is unavailable, document why and pull chat transcript + Copilot recap + meeting chat thread to reconstruct. Per-meeting sub-section is mandatory; one block per meeting. **A 30-line meetings file for a week with 2 meetings is a defect — expect 200+ lines, with the structure above repeated per meeting.** A per-meeting block missing the explicit `Next Steps` section is a defect even if Action Items is present — they capture different things.
28
+
29
+ ### Teams chats (stream/)
30
+ For every thread touched in the window — capture **full message-by-message reproduction** (sender · timestamp · verbatim message text or close paraphrase), not just an outcome line. Group by thread, not by day. Include reactions, file attachments, links, replies. If a thread has 30 messages, reproduce all 30 (collapse only routine acks like 👍 / "thanks").
31
+
32
+ ### Emails (stream/)
33
+ For every substantive thread — capture sender, recipients (to + cc), subject, **full body or close paraphrase**, attachments, and the chain of replies in order. Thread-level grouping. A one-line "X sent Y about Z" entry is insufficient — include enough body to convey what was actually said.
34
+
35
+ ### OneNote (snapshot/ + stream/)
36
+ - snapshot/pages/<page>.md — extract **full page bodies**, not just titles. Last-modified timestamp + author at the top.
37
+ - stream/<week>.md — page-edit events with diff summary.
38
+
39
+ If Graph delegated-token isn't available, ask the user to paste page content rather than skip.
40
+
41
+ ### SharePoint (snapshot/ + stream/)
42
+ - snapshot/tree.md — full folder tree (no truncation). Mark each entry `[key]` / `[recent]` / `[pin]` / `[skip]` / `[tree-only]` so readers can see why a file was or wasn't expanded.
43
+ - snapshot/files/<path>.md — body summary for: (a) **curated key files** (architecture, decisions, ADRs, deliverables, proposals, SOWs, business cases, roadmaps, plans), PLUS (b) **top-N most-recently-modified files** where N = `sharepoint.snapshot.recent_n` (default 25), PLUS (c) any user pins from `sharepoint.snapshot.always_include`. Per file: full filename (no truncation), changed-by, change-type, size, last-modified, content summary at the same depth bar as a meeting transcript walk-through (decisions, risks, actions, owners, dates, key context).
44
+ - stream/<week>.md — file change events that week.
45
+
46
+ ### CRM/ADO (snapshot/ + stream/)
47
+ - snapshot/<id>.md — every field the API returns, every value.
48
+ - stream/<id>/<week>.md — every field-level change with old → new + actor + timestamp, every comment/discussion verbatim.
49
+
50
+ ## Volume guidance
51
+
52
+ - Long files are EXPECTED. Compression is the enemy.
53
+ - One file per source per week (stream) — do NOT split into one-file-per-meeting / one-file-per-thread.
54
+ - One file per entity (snapshot) — do NOT consolidate multiple entities into one snapshot.
55
+
56
+ ## Citation density
57
+
58
+ Every paragraph still needs `[source: …]` citations — thoroughness does NOT relax the citation rule, it intensifies it. See `citation-ledger.instructions.md`.
59
+
60
+ ## Fix-up loop
61
+
62
+ If the user reads an evidence file and says "this is too light", the skill MUST re-pull from source with deeper extraction and rewrite the file in the same fix-up turn — never defend a thin summary.
@@ -0,0 +1,56 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "Side-by-side config rule — whenever the skill creates or changes a template, it must also write/update the corresponding live filled config. Skeletons stay generic; live files get the actual fact."
4
+ ---
5
+
6
+ # Side-by-side config rule (HARD RULE)
7
+
8
+ Whenever the skill creates, changes, or extends any template in `<KUSHI_ROOT>/plugin/templates/init/`, it MUST also write the corresponding live file under `<engagement-root>/.project-evidence/`.
9
+
10
+ Templates stay generic; the live file gets the actual filled-in fact. Never leave the user with only the template — that's a half-done config.
11
+
12
+ ## The two layers
13
+
14
+ | Layer | Where | Lifecycle |
15
+ |---|---|---|
16
+ | Template (generic) | `<KUSHI_ROOT>/plugin/templates/init/*.template.{json,yml}` | Ships with kushi, never edited per-user |
17
+ | Live filled | `<engagement-root>/.project-evidence/*.{json,yml}` | Per-user, OneDrive-synced, edited by skill + user |
18
+
19
+ ## Discover → upsert immediately
20
+
21
+ Any time the skill discovers a high-confidence fact about a project (folder id, chat id, OneNote section id, CRM record id, ADO WI id, stakeholder hint, alias) — upsert it into the live mutable file (`<engagement-root>/.project-evidence/m365/m365-mutable.json` under `m365Mutable.knownSections.<project>.<source>`) **in the same turn it was discovered**, with `discoveredOn: <today>` and `confidence: high|medium|low`.
22
+
23
+ Don't wait until the end of the run.
24
+
25
+ ## Fix-ups count
26
+
27
+ When the user pushes back on a scoping miss (e.g. "you missed folder `1. Workstream/104. <project>`"), the corrected value MUST be written to the live mutable file before declaring the fix done. The user should never have to repeat the correction on the next run.
28
+
29
+ ## Bookkeeping
30
+
31
+ - Bump `_meta.last_updated` (and `m365Mutable.metadata.lastUpdated`) on every write.
32
+ - Never write low-confidence guesses. Never overwrite a high-confidence pinned value with a lower-confidence guess.
33
+
34
+ ## Verification
35
+
36
+ End every bootstrap / fix-up turn by listing the live config files (path + size + last-write time) so the user can see the "done-for-you" state — not just the templates.
37
+
38
+ ## Live config locations
39
+
40
+ ```
41
+ <engagement-root>/.project-evidence/
42
+ m365/
43
+ m365-auth.json ← stable (OneDrive-synced, hand-edited mostly)
44
+ m365-mutable.json ← discovered hints, auto-updated by skill
45
+ crm/
46
+ config.yml ← Dataverse env URL, tenant, schema
47
+ ado/
48
+ config.yml ← organization, projects, queries
49
+ project-evidence.yml ← (optional) per-engagement override of personal config
50
+ ```
51
+
52
+ ## Why outside the kushi repo
53
+
54
+ - **Multi-machine portability** — OneDrive-synced beside engagement folders, follows the user wherever they install kushi.
55
+ - **Discoverability** — user can see/edit it next to their engagement work, not buried in `~/.copilot/`.
56
+ - **Repo-safe** — kushi is meant to be GitHub-published; live filled configs MUST never be committed.
@@ -0,0 +1,87 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "Snapshot vs Stream — every source has two evidence shapes. Snapshot = current state of entity (replace on refresh). Stream = timestamped events (append-only, weekly buckets)."
4
+ ---
5
+
6
+ # Snapshot vs Stream (HARD RULE)
7
+
8
+ Every source produces evidence in TWO distinct shapes. Mixing them is a defect.
9
+
10
+ ## The two shapes
11
+
12
+ | Shape | What it is | Refresh behavior | Filename pattern |
13
+ |---|---|---|---|
14
+ | **snapshot/** | Current state of an entity ("what IS true now?") | Always re-pull, **replace in place** | `<entity-id-or-name>.md` (no date) |
15
+ | **stream/** | Timestamped events ("what happened?") | Incremental from watermark, **append-only**, bucketed by ISO week (Mon–Sun) | `YYYY-MM-DD_<source>-stream.md` (date = Monday of week) |
16
+
17
+ ## Per-source breakdown
18
+
19
+ | Source | Snapshot? | Stream? | Snapshot entities | Stream events |
20
+ |---|---|---|---|---|
21
+ | Email | — | ✅ | (none — emails ARE events) | messages |
22
+ | Teams chats | ✅ | ✅ | chat roster, member list | messages, file shares |
23
+ | Teams channels | ✅ | ✅ | channel list, tab config | posts, replies |
24
+ | Meetings | ✅ | ✅ | series metadata, recurrence | instances + transcripts |
25
+ | OneNote | ✅ | ✅ | page bodies (full content) | page-edit events |
26
+ | SharePoint | ✅ | ✅ | folder tree, file metadata, key file bodies | file change events, version history |
27
+ | CRM | ✅ | ✅ | record (engagement fields, owner, status) | notes, activities, status-change history |
28
+ | ADO | ✅ | ✅ | work items (fields, parent, area, iteration) | comments, state changes, attachments |
29
+
30
+ ## Storage layout
31
+
32
+ ```
33
+ <engagement-root>/<project>/Evidence/<alias>/
34
+ email/
35
+ stream/2026-05-04_email-stream.md
36
+ teams/
37
+ snapshot/chat-roster.md
38
+ stream/2026-05-04_teams-stream.md
39
+ meetings/
40
+ snapshot/series-index.md
41
+ stream/2026-05-04_meetings-stream.md
42
+ onenote/
43
+ snapshot/pages/<page-title>.md
44
+ stream/2026-05-04_onenote-stream.md
45
+ sharepoint/
46
+ snapshot/tree.md
47
+ snapshot/files/<relative-path>.md
48
+ stream/2026-05-04_sharepoint-stream.md
49
+ crm/
50
+ snapshot/<record-id>.md
51
+ stream/<record-id>/2026-05-04_crm-stream.md
52
+ ado/
53
+ snapshot/items/<work-item-id>.md
54
+ stream/items/<work-item-id>/2026-05-04_ado-stream.md
55
+ run-log.yml
56
+ ```
57
+
58
+ ## Refresh logic
59
+
60
+ ```
61
+ For each source:
62
+ 1. Snapshot pass: re-fetch known entities, write to snapshot/ (idempotent replace).
63
+ 2. Stream pass: read source.watermark from run-log -> fetch events since -> bucket by ISO week -> append/merge into stream/<monday>.md -> update watermark.
64
+ ```
65
+
66
+ ## Idempotency rules
67
+
68
+ - **snapshot/** is always replace-in-place. Latest fact wins. No history (history lives in stream/).
69
+ - **stream/** is append-only within a week file. When merging new events into an existing week file:
70
+ - dedupe by event ID (message ID, comment ID, transcript timestamp, etc.)
71
+ - never overwrite existing events (an event that "moved" — was deleted, rescoped, edited — leaves the original record alone; the change shows up as a new event).
72
+ - if a week file already exists from a prior partial run, mark it `> ⚠️ Partial week (re-run later for full coverage)` until the week is complete.
73
+
74
+ ## Citation distinction
75
+
76
+ - Snapshot citations indicate "current truth": `[source: <alias>/onenote/snapshot/pages/<page-title>.md as of YYYY-MM-DD]`
77
+ - Stream citations indicate "historical event": `[source: <alias>/onenote/stream/YYYY-MM-DD_onenote-stream.md · message YYYY-MM-DDTHH:MM]`
78
+
79
+ State files SHOULD cite both where appropriate (e.g. "the architecture is X [snapshot] as decided on date Y [stream]").
80
+
81
+ ## Build-state implications
82
+
83
+ `build-state` reads from BOTH snapshot/ and stream/:
84
+ - Current truth (entity fields, page bodies, file content) → snapshot/
85
+ - Provenance, history, when/who/why → stream/
86
+
87
+ `@Kushi state <project>` runs `build-state` ONLY (no source calls), so it can re-render State/ from existing Evidence at any time without hitting M365.
@@ -0,0 +1,105 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "Thoroughness detector — pull-* skills MUST run this check after writing every evidence file and auto-retry or prompt-paste when the file is thin."
4
+ ---
5
+
6
+ # Thoroughness Detector (HARD RULE)
7
+
8
+ Every `pull-*` skill MUST run this check after writing each evidence file. A file that fails the detector is a **defect** — it MUST be re-extracted with a richer query or replaced with pasted source content. The skill MUST NOT silently accept a thin file.
9
+
10
+ This detector enforces `evidence-thoroughness.instructions.md` at runtime. The thoroughness doctrine defines what "full" means; this file defines how to **detect** and **fix** violations.
11
+
12
+ ## Per-source minimum thresholds
13
+
14
+ Apply the threshold for the source the file belongs to. A file fails if **any** check triggers.
15
+
16
+ ### Email stream (`email/stream/*.md`)
17
+
18
+ - Per thread block: body text ≥ **400 characters** (not counting headers / metadata / "see original" stubs).
19
+ - Per thread block contains at least one of: `Body:`, `Reply chain`, or a quoted block.
20
+ - File-level: ≥ 1 thread block per substantive subject mentioned in the windowed search results.
21
+
22
+ ### Teams stream (`teams/stream/*.md`)
23
+
24
+ - Per thread block: reproduces ≥ **5 messages** (or, if thread is shorter, ALL messages — collapse only routine acks 👍 / "thanks").
25
+ - Each reproduced message has `<sender> · <timestamp>` line + verbatim or close-paraphrase text.
26
+ - File-level: rejects "summary-only" files with no message-by-message reproduction.
27
+
28
+ ### OneNote snapshot (`onenote/snapshot/pages/*.md`)
29
+
30
+ - Page body text ≥ **600 characters** OR contains a `## Page Body` section followed by content (not just a link).
31
+ - Page metadata block (last-modified, author) present.
32
+
33
+ ### OneNote stream (`onenote/stream/*.md`)
34
+
35
+ - Each page-edit event includes diff summary (what changed) — not just "page updated".
36
+
37
+ ### SharePoint snapshot tree (`sharepoint/snapshot/tree.md`)
38
+
39
+ - Tree is not truncated (no "…" or "N more" placeholders).
40
+ - Each entry has a status tag: `[key]` / `[recent]` / `[pin]` / `[skip]` / `[tree-only]`.
41
+
42
+ ### SharePoint snapshot file (`sharepoint/snapshot/files/*.md`)
43
+
44
+ - Body summary ≥ **400 characters** OR explicit `[tree-only]` justification.
45
+ - Has changed-by + change-type + last-modified.
46
+
47
+ ### Meetings stream (`meetings/stream/*.md`)
48
+
49
+ - Per meeting block contains ALL of the following named sections:
50
+ - `## Detailed Discussion Summary`
51
+ - `## Transcript Walk-Through` (or `## Chronological Walk-Through`)
52
+ - `## Key Decisions`
53
+ - `## Open Questions` (or `## Open Questions / Non-Decisions`)
54
+ - `## Next Steps` ← **dedicated section, distinct from Action Items**
55
+ - `## Action Items`
56
+ - `## Next Steps` MUST be present even if empty (`_None this meeting._`) — missing the section is a defect.
57
+ - Per meeting block: total length ≥ **800 characters**.
58
+ - Action items: every bullet has owner + due (date OR "TBD" with reason) + `[source: …]` citation.
59
+
60
+ ### CRM/ADO snapshot (`crm/snapshot/*.md`, `ado/snapshot/*.md`)
61
+
62
+ - Snapshot lists ≥ **8 fields** with values (not just an ID + a link).
63
+
64
+ ### CRM/ADO stream (`crm/stream/*.md`, `ado/stream/*.md`)
65
+
66
+ - Each change event has old-value → new-value + actor + timestamp.
67
+
68
+ ## Red-flag patterns (auto-fail)
69
+
70
+ Any file containing these strings outside a `## Coverage Notes` block fails:
71
+
72
+ - `(see original in …)` / `see original email` / `see Teams thread` / `see page` — link-only stubs.
73
+ - `Full body unavailable` / `body not captured` without an accompanying `## Coverage Notes` explaining why.
74
+ - `Summary: …` as the entire body (no detail beneath it).
75
+ - `[redacted]` without justification.
76
+ - `TODO` / `FIXME` left in production evidence.
77
+
78
+ ## Retry policy
79
+
80
+ When a file fails the detector:
81
+
82
+ 1. **Auto-retry once** with a deeper WorkIQ query. Append `"give me full bodies and full reply chain — not just metadata"` (or source-appropriate equivalent) to the query. Re-write the file.
83
+ 2. If the second attempt still fails the detector, emit the **paste-prompt** (see `plugin/templates/paste-prompt.md`) to the user with the specific file path, the failing checks, and ready-to-paste section headers.
84
+ 3. Mark the file with `⚠ thoroughness: pending-paste` at the top under `## Source Basis` and log `thoroughness-pending` in `run-log.yml` for that source. Continue the rest of the run — do NOT block.
85
+
86
+ ## Validation block in every evidence file
87
+
88
+ Every evidence file MUST end with:
89
+
90
+ ```
91
+ ## Validation
92
+
93
+ - [ ] bodies-present
94
+ - [ ] attendees-or-participants-captured <!-- meetings/teams only -->
95
+ - [ ] next-steps-section-present <!-- meetings only -->
96
+ - [ ] action-items-have-owner-and-due <!-- meetings only -->
97
+ - [ ] no-link-only-stubs
98
+ - [ ] coverage-notes-explain-any-gaps
99
+ ```
100
+
101
+ The skill ticks the boxes it can verify automatically; the rest are left for `self-check` and human review.
102
+
103
+ ## Out of scope
104
+
105
+ This detector does NOT enforce citation density (that's `citation-ledger.instructions.md`) or snapshot-vs-stream placement (that's `snapshot-vs-stream.instructions.md`). It enforces depth-of-capture only.
@@ -0,0 +1,47 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "WorkIQ is the required path for all M365 + CRM + ADO source pulls. Graph REST is NOT a routine fallback; ask the user to paste when WorkIQ can't answer."
4
+ ---
5
+
6
+ # WorkIQ-required rule (HARD RULE)
7
+
8
+ WorkIQ is the **required** path for every source pull. Graph REST has known issues in this workspace (token rejection, OneNote 40001, Dataverse 501/415, SharePoint 403, mailbox throttling) and **MUST NOT** be used as a routine fallback — doing so produces thin metadata-only evidence that violates `evidence-thoroughness.instructions.md`. WorkIQ gives richer extraction (full page bodies, full transcript text, message-by-message thread reproduction).
9
+
10
+ ## Resolution order (per source)
11
+
12
+ For every source, try in order:
13
+
14
+ 1. **WorkIQ** — `<workiq.cli_path> ask -q "<question>"` (path resolved from `<USER_HOME>/.copilot/project-evidence.yml workiq.cli_path`, otherwise from PATH).
15
+ 2. **Ask user to paste** — if WorkIQ is missing, unauthenticated, or returns insufficient content, ask the user to paste the data **verbatim** (NOT summarized). This is a first-class path, not an error.
16
+ 3. **Graph REST / `m365_*` host tools** — **last resort only**, used non-blocking with an explicit `➖ partial via Graph REST` marker in the evidence file. Skills MUST NOT silently fall through to Graph when WorkIQ fails; the user must be informed and given a chance to paste.
17
+
18
+ **Always document which path succeeded** in the evidence file under `## Source Basis`.
19
+
20
+ If WorkIQ is not installed or not on PATH, the skill MUST surface this immediately with a link to `docs/getting-started/install-workiq.md` rather than degrading to thin Graph-only evidence.
21
+
22
+ ## Per-source preferred WorkIQ queries
23
+
24
+ | Source | WorkIQ query template |
25
+ |---|---|
26
+ | Email | `Find emails about <project> in folder <folder> between <start> and <end>, give me sender, recipients, full body, and reply chain` |
27
+ | Teams Chats | `Show full message-by-message reproduction of <project> Teams threads between <start> and <end>` |
28
+ | OneNote | `Get full page bodies from OneNote section <section> notebook <notebook> modified between <start> and <end>` |
29
+ | SharePoint | `List SharePoint files for <project> modified between <start> and <end> with author and brief content summary` |
30
+ | Meetings | `Get full transcript and Copilot recap for meeting <subject> on <date>` |
31
+ | CRM | `Get CRM engagement record FE-<id> with all field values, comments, and audit history` |
32
+ | ADO | `Get ADO work items for <project> updated between <start> and <end> with full discussion thread` |
33
+
34
+ ## Pre-flight (every pull-* skill)
35
+
36
+ Before issuing the first WorkIQ query in a run:
37
+
38
+ 1. `Get-Command workiq` (or the configured `cli_path`). If missing → log `workiq-not-on-path` in `run-log.yml`, write a one-line evidence file pointing at `docs/getting-started/install-workiq.md`, and STOP this source.
39
+ 2. Probe `workiq ask -q "ping"`. If EULA prompt → run `workiq accept-eula` once, retry. If auth-failed → log `workiq-auth-failed` and ask user to re-authenticate.
40
+ 3. Only after a successful probe, proceed to per-source queries.
41
+
42
+ ## Graph REST — when explicitly allowed
43
+
44
+ Graph is allowed only as a non-blocking last resort, and only with:
45
+ - An explicit `➖ partial via Graph REST` marker in the evidence file.
46
+ - A `next_step` line telling the user to install/repair WorkIQ for full-fidelity capture next run.
47
+ - Never as a silent default.
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "kushi",
3
+ "description": "Multi-source project evidence + Q&A agent. Snapshot + stream capture across Email, Teams, OneNote, SharePoint, Meetings, CRM, ADO; plus read-only natural-language Q&A over the captured evidence. WorkIQ-first. Host-agnostic. Three install profiles: core (aggregator only), standard (default — adds bootstrap/refresh + FDE authoring), full (adds State/ rollup).",
4
+ "version": "3.3.0",
5
+ "author": "ushakrishnan",
6
+ "repository": "https://github.com/gim-home/kushi",
7
+ "default_profile": "standard",
8
+ "profiles": {
9
+ "core": {
10
+ "description": "Aggregator only — pull-* + consolidate + ask. No opinionated rollup. The Evidence/ folder is the public contract; suitable for standalone use OR as the producer layer behind an external rollup system.",
11
+ "skills": [
12
+ "intro",
13
+ "self-check",
14
+ "pull-email",
15
+ "pull-teams",
16
+ "pull-meetings",
17
+ "pull-onenote",
18
+ "pull-sharepoint",
19
+ "pull-crm",
20
+ "pull-ado",
21
+ "aggregate-project",
22
+ "consolidate-evidence",
23
+ "project-status",
24
+ "ask-project"
25
+ ],
26
+ "prompts": [
27
+ "aggregate",
28
+ "consolidate",
29
+ "status",
30
+ "ask"
31
+ ],
32
+ "instructions": "*",
33
+ "templates": [
34
+ "snapshot",
35
+ "weekly"
36
+ ],
37
+ "reference_packs": [],
38
+ "verbs": [
39
+ "aggregate",
40
+ "consolidate",
41
+ "status",
42
+ "pull",
43
+ "ask"
44
+ ]
45
+ },
46
+ "standard": {
47
+ "extends": "core",
48
+ "description": "Core + bootstrap/refresh orchestrators + FDE authoring (intake, report, triage) and the FDE reference pack. Kushi's default opinion. NO State/ rollup on this profile — Evidence/ is the contract; FDE reports read Evidence/ directly. bootstrap/refresh are profile-aware and skip build-state here.",
49
+ "skills": [
50
+ "bootstrap-project",
51
+ "refresh-project",
52
+ "fde-intake",
53
+ "fde-report",
54
+ "fde-triage"
55
+ ],
56
+ "prompts": [
57
+ "bootstrap",
58
+ "refresh",
59
+ "fde-intake",
60
+ "fde-report",
61
+ "fde-triage"
62
+ ],
63
+ "templates": [
64
+ "init",
65
+ "fde"
66
+ ],
67
+ "reference_packs": [
68
+ "fde"
69
+ ],
70
+ "verbs": [
71
+ "bootstrap",
72
+ "refresh",
73
+ "fde-intake",
74
+ "fde-report",
75
+ "fde-triage"
76
+ ]
77
+ },
78
+ "full": {
79
+ "extends": "standard",
80
+ "description": "Standard + State/ rollup. Adds the opinionated outcome-based State/ files (decisions, stakeholders, architecture, action items, risks, timeline, artifacts, open questions) built on top of Evidence/. On this profile, bootstrap/refresh call build-state at the end.",
81
+ "skills": [
82
+ "build-state"
83
+ ],
84
+ "prompts": [
85
+ "state"
86
+ ],
87
+ "templates": [
88
+ "state"
89
+ ],
90
+ "reference_packs": [],
91
+ "verbs": [
92
+ "state"
93
+ ]
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: "Aggregate (pull + consolidate) without building State/."
3
+ ---
4
+
5
+ # Aggregate
6
+
7
+ Run `aggregate-project` for the named project.
8
+
9
+ This is the **pull-only** verb. Every enabled source is pulled and per-user streams are consolidated, but `build-state` is NOT run. Use this when:
10
+
11
+ - You want Evidence/ on disk and will render reports with an external system.
12
+ - You're installed at the `core` profile (no build-state present).
13
+ - You want frequent pulls but slower State/ rebuilds.
14
+
15
+ ## Syntax
16
+
17
+ ```
18
+ @Kushi aggregate <project>
19
+ @Kushi aggregate <project> last N days
20
+ @Kushi aggregate <project> since <YYYY-MM-DD>
21
+ @Kushi aggregate <project> <YYYY-MM-DD>..<YYYY-MM-DD>
22
+ ```
23
+
24
+ See `skills/aggregate-project/SKILL.md` for the full sequence and output contract.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: ask
3
+ description: Read-only Q&A over a bootstrapped project's State/, Evidence/, and snapshot/ files. Cited; no source pulls; no outbound. Auto-routes when you name a project + ask a question.
4
+ ---
5
+
6
+ # /ask
7
+
8
+ Route to `@Kushi ask <project> <question>`.
9
+
10
+ Loads the cheapest set of files needed to answer (`State/<topic>.md` first, then latest `Evidence/<alias>/_Consolidated/`, then per-source weekly files, then `external-context/`, then `<project>/SharePoint/snapshot/files/`), emits inline `[source: <alias>/<folder>/<file> · YYYY-MM-DD]` citations, warns if the relevant source is older than `chat.freshness_warn_days` (default 14), and ends with a Confidence line.
11
+
12
+ Read-only. NEVER triggers a `pull-*` skill — if evidence is stale or missing, offers `@Kushi refresh <project>` and stops.
13
+
14
+ You don't actually need this prompt — `ask-project` auto-routes whenever your message names a known project and asks a question (what / who / when / status / summarize / etc.). The slash form just provides an explicit handle.
15
+
16
+ Delegates to `ask-project` skill.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: bootstrap
3
+ description: First-time setup for a new project — scaffold folders, lay configs side-by-side, do an initial 30-day pull, build State.
4
+ ---
5
+
6
+ # /bootstrap
7
+
8
+ Route to `@Kushi bootstrap <project>`.
9
+
10
+ Inputs the agent will resolve:
11
+ - `<project>` — the engagement folder name (fuzzy-match under engagement-root if needed).
12
+ - `<window>` — defaults to 30 days. Override with `last 60 days`, `since 2026-04-01`, or `2026-04-01..2026-05-01`.
13
+
14
+ Reads:
15
+ - `<USER_HOME>/.copilot/project-evidence.yml` for alias + engagement-root.
16
+
17
+ Produces:
18
+ - `<engagement-root>/.project-evidence/m365/{m365-auth,m365-mutable}.json` (per-user filled)
19
+ - `<engagement-root>/<project>/integrations.yml`
20
+ - `<engagement-root>/<project>/Evidence/{contributors.yml, run-log.yml, <alias>/.settings.yml, <alias>/{email,teams,meetings,onenote,sharepoint,crm,ado}/{snapshot,stream}/}`
21
+ - `<engagement-root>/<project>/State/{00..09}_*.md`
22
+
23
+ Delegates to `bootstrap-project` skill. After scaffolding, calls each `pull-<source>` skill, then `build-state`.