@adamchanadam/agent-handoff-kit 0.3.40 → 0.3.42

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.
@@ -6,7 +6,7 @@ Purpose: give a stateless AI a compact map of the project before it reads or edi
6
6
 
7
7
  | Field | Value | Last verified |
8
8
  |---|---|---|
9
- | Agent Handoff Kit template version | 0.3.40 | implementation candidate; not yet published |
9
+ | Agent Handoff Kit template version | 0.3.42 | current release |
10
10
  | Runtime | TBD | TBD |
11
11
  | Framework | TBD | TBD |
12
12
  | Package manager | TBD | TBD |
@@ -20,13 +20,13 @@ Purpose: give a stateless AI a compact map of the project before it reads or edi
20
20
  |---|---|---|
21
21
  | `AGENTS.md` | primary Agent Handoff Kit entry and startup contract | session startup |
22
22
  | `CLAUDE.md` | Claude Code bridge to the same startup path | Claude Code startup |
23
- | `GEMINI.md` | Google Antigravity CLI / Gemini CLI migration bridge to the same startup path | Antigravity / Gemini startup |
24
- | `START_NEXT_SESSION_PROMPT.txt` | portable generated mirror of the handoff opening-message block; `dev/SESSION_HANDOFF.md` remains authoritative | fallback when the next agent is not yet operating in this root; not an additional local startup read |
23
+ | `GEMINI.md` | Google Antigravity CLI / Gemini CLI migration bridge to the same startup path | Antigravity / Gemini startup |
24
+ | `START_NEXT_SESSION_PROMPT.txt` | portable generated mirror of the handoff opening-message block; `dev/SESSION_HANDOFF.md` remains authoritative | fallback when the next agent is not yet operating in this root; not an additional local startup read |
25
25
  | `src/` | application source | coding task |
26
26
  | `tests/` | tests | coding/QC |
27
27
  | `docs/` | user or product docs | doc/public behavior change |
28
- | `dev/` | governance state | read the handoff at startup; other files are task-routed or closeout-routed |
29
- | `dev/rules/closeout.md` | full closeout contract | clear end-of-session or handoff intent only |
28
+ | `dev/` | governance state | read the handoff at startup; other files are task-routed or closeout-routed |
29
+ | `dev/rules/closeout.md` | full closeout contract | clear end-of-session or handoff intent only |
30
30
  | `TBD` | local source-of-truth files | before tasks that depend on project facts |
31
31
  | `TBD` | external-source indexes or mirrors | before research, writing, or knowledge-sync tasks |
32
32
 
@@ -36,10 +36,10 @@ Purpose: give a stateless AI a compact map of the project before it reads or edi
36
36
  |---|---|---|
37
37
  | App entry | TBD | TBD |
38
38
  | Main config | TBD | TBD |
39
- | Test suite | TBD | TBD |
40
- | Runbook | TBD | TBD |
41
- | Public docs | TBD | TBD |
42
- | Generated Markdown review | `dev/PROJECT_INDEX.md` + `dev/DOC_SYNC_REGISTRY.md` | After creating Markdown docs, generated Markdown outputs, specs, runbooks, checklists, or research notes, classify each file as indexed / synced / temporary / one-time evidence before completion; other durable formats require human review because doctor scans Markdown only |
39
+ | Test suite | TBD | TBD |
40
+ | Runbook | TBD | TBD |
41
+ | Public docs | TBD | TBD |
42
+ | Generated Markdown review | `dev/PROJECT_INDEX.md` + `dev/DOC_SYNC_REGISTRY.md` | After creating Markdown docs, generated Markdown outputs, specs, runbooks, checklists, or research notes, classify each file as indexed / synced / temporary / one-time evidence before completion; other durable formats require human review because doctor scans Markdown only |
43
43
 
44
44
  ## Fact Base
45
45
 
@@ -53,68 +53,68 @@ Reachable means the source can be found. It does not mean the source has been re
53
53
 
54
54
  | Source | Role | Required before | Access method | `via` | Write-back rule | Last verified |
55
55
  |---|---|---|---|---|---|---|
56
- | TBD | source of truth / mirror / index / attachment store | TBD | URL, connector, or manual packet | `Notion Connector` / `Google Drive Connector` / `manual paste` / etc — must match an entry under `## Installed Integrations` | read-back required / manual only / no write | TBD |
56
+ | TBD | source of truth / mirror / index / attachment store | TBD | URL, connector, or manual packet | `Notion Connector` / `Google Drive Connector` / `manual paste` / etc — must match an entry under `## Installed Integrations` | read-back required / manual only / no write | TBD |
57
57
 
58
- > `via` column discipline: every External Sources row must reference an entry name under `## Installed Integrations`, such as `Notion Connector` or `Google Drive Connector`, so the access path is explicit. Sources without a declared integration use `manual paste`. Doctor and release QA enforce cross-section consistency.
58
+ > `via` column discipline: every External Sources row must reference an entry name under `## Installed Integrations`, such as `Notion Connector` or `Google Drive Connector`, so the access path is explicit. Sources without a declared integration use `manual paste`. Doctor and release QA enforce cross-section consistency.
59
59
 
60
60
  ## Installed Integrations
61
61
 
62
- > **Credential Separation Principle**: this section records only project usage and public reference coordinates such as Notion database names, URLs, or folder paths. It must never record API keys, OAuth tokens, or credential values. Credentials belong in AI runtime secure storage, OS credential stores, tool configuration, or user-managed secret stores. If an environment variable is used, record only the variable name, never the value. Before writing this section, self-check that no credential value is being persisted. Doctor scans this section, `SESSION_HANDOFF`, and `SESSION_LOG` for common credential prefixes such as `sk-`, `ntn_`, `ya29.`, `xoxp-`, `ghp_`, `sl.`, `AKIA`, and `AIza`.
63
-
64
- > Purpose: tasks that use external tools read this section to understand declared capabilities and project roles. Declarations persist across sessions. A new session does not probe this table merely because it exists. `TBD`, examples, blanks, and placeholder-only rows are not installed integrations. Every real entry includes `Declared` and `Last Verified` so capability assumptions can be checked immediately before use.
65
-
66
- ### Connectors
67
-
68
- | Tool | Project Usage | Access Scope | Specific Instance | Credential Reference (no value) | Declared | Last Verified |
69
- |------|---------------|--------------|-------------------|---------------------|----------|---------------|
70
- | TBD | TBD, for example an index of source paths or persistent reference storage | read / read+write | TBD, for example database name + URL or folder path | TBD, for example `AI tool secure storage` / `OS credential store` | TBD | TBD |
71
-
72
- ### MCPs
73
-
74
- | Server | Source | Project Usage | Credential Reference (no value) | Declared | Last Verified |
75
- |--------|--------|---------------|---------------------|----------|---------------|
76
- | TBD | TBD, for example GitHub repository URL | TBD | TBD, for example `tool config + env var name only` / `user-managed secret store` | TBD | TBD |
77
-
78
- ### Plugins
79
-
80
- | Name | Bundle Content (Skills + MCP + hooks) | When Triggered | Last Verified |
81
- |------|----------------------------------------|----------------|---------------|
82
- | TBD | TBD | TBD | TBD |
83
-
84
- ### Skills
85
-
86
- | Name | Source | When Triggered | Last Verified |
87
- |------|--------|----------------|---------------|
88
- | TBD | TBD, for example plugin bundle or user-level install | TBD | TBD |
89
-
90
- ### Source-of-truth Architecture
91
-
92
- > When a project uses several integrations as a source-of-truth system, for example Notion index + local primary sources + Google Drive reference mirror, this table records each layer's role so agents do not cross write boundaries.
93
-
94
- | Layer | Surface (specific instance) | Role | Write Direction |
95
- |-------|--------------------------|------|-----------------|
96
- | Source of truth | TBD, for example local `~/project/reference/` | Original auditable reference content | User-controlled placement; agent does not write directly unless explicitly authorized |
97
- | Index | TBD, for example Notion database `Project Index` | Metadata, summaries, and tags for each source file | Agent may read/write through a verified Connector |
98
- | Persistent mirror | TBD, for example Drive folder `Project Reference/` | Backup or cross-device reference mirror | User-controlled sync by default; agent does not push automatically |
99
- | Working draft | TBD, for example local `~/project/output/` | Agent task output | Agent may read and write local files under normal safety rules |
100
-
101
- ## Tool Operation References
102
-
103
- Use this section for project-local runbooks or verified procedures for runtime-controlled tools such as browser validation, screenshots, DevTools, Playwright, crawlers, notebooks, desktop app automation, MCP/plugin helpers, or raw CLI/SDK operations.
104
-
105
- Do not store credential values or machine-private paths here. Local machine-only references may be listed only when the project explicitly depends on them, and the scope / limits must say they are not portable.
106
-
107
- | Tool / operation | Reference path or URL | Required before | Source and version/date | Scope and known limits | Last verified |
108
- |---|---|---|---|---|---|
109
- | TBD | TBD | TBD | TBD | TBD | TBD |
110
- | Local HTML / app browser validation | TBD, for example project runbook or official browser-tool docs | Before validating local HTML, static app, generated guide, screenshot, click flow, or visual QA | TBD, include source and date | Prefer short-lived loopback localhost service when `file://` is blocked; record click/text/screenshot evidence and cleanup result; do not mutate user browser profiles or extension state | TBD |
111
-
112
- ## Local QC Commands
113
-
114
- | Check | Command | Run before | Last verified |
115
- |---|---|---|---|
116
- | Agent Handoff Kit doctor | `npx --yes @adamchanadam/agent-handoff-kit@latest doctor --root .` | closeout / governance changes / generated Markdown artifact checks | package latest |
117
- | Project governance check | Check newly created Markdown against `dev/PROJECT_INDEX.md` and `dev/DOC_SYNC_REGISTRY.md`; register, sync, consolidate, or explicitly classify as temporary / one-time evidence. Review non-Markdown durable outputs manually. | closeout / durable file changes | unverified until project-specific command exists |
62
+ > **Credential Separation Principle**: this section records only project usage and public reference coordinates such as Notion database names, URLs, or folder paths. It must never record API keys, OAuth tokens, or credential values. Credentials belong in AI runtime secure storage, OS credential stores, tool configuration, or user-managed secret stores. If an environment variable is used, record only the variable name, never the value. Before writing this section, self-check that no credential value is being persisted. Doctor scans this section, `SESSION_HANDOFF`, and `SESSION_LOG` for common credential prefixes such as `sk-`, `ntn_`, `ya29.`, `xoxp-`, `ghp_`, `sl.`, `AKIA`, and `AIza`.
63
+
64
+ > Purpose: tasks that use external tools read this section to understand declared capabilities and project roles. Declarations persist across sessions. A new session does not probe this table merely because it exists. `TBD`, examples, blanks, and placeholder-only rows are not installed integrations. Every real entry includes `Declared` and `Last Verified` so capability assumptions can be checked immediately before use.
65
+
66
+ ### Connectors
67
+
68
+ | Tool | Project Usage | Access Scope | Specific Instance | Credential Reference (no value) | Declared | Last Verified |
69
+ |------|---------------|--------------|-------------------|---------------------|----------|---------------|
70
+ | TBD | TBD, for example an index of source paths or persistent reference storage | read / read+write | TBD, for example database name + URL or folder path | TBD, for example `AI tool secure storage` / `OS credential store` | TBD | TBD |
71
+
72
+ ### MCPs
73
+
74
+ | Server | Source | Project Usage | Credential Reference (no value) | Declared | Last Verified |
75
+ |--------|--------|---------------|---------------------|----------|---------------|
76
+ | TBD | TBD, for example GitHub repository URL | TBD | TBD, for example `tool config + env var name only` / `user-managed secret store` | TBD | TBD |
77
+
78
+ ### Plugins
79
+
80
+ | Name | Bundle Content (Skills + MCP + hooks) | When Triggered | Last Verified |
81
+ |------|----------------------------------------|----------------|---------------|
82
+ | TBD | TBD | TBD | TBD |
83
+
84
+ ### Skills
85
+
86
+ | Name | Source | When Triggered | Last Verified |
87
+ |------|--------|----------------|---------------|
88
+ | TBD | TBD, for example plugin bundle or user-level install | TBD | TBD |
89
+
90
+ ### Source-of-truth Architecture
91
+
92
+ > When a project uses several integrations as a source-of-truth system, for example Notion index + local primary sources + Google Drive reference mirror, this table records each layer's role so agents do not cross write boundaries.
93
+
94
+ | Layer | Surface (specific instance) | Role | Write Direction |
95
+ |-------|--------------------------|------|-----------------|
96
+ | Source of truth | TBD, for example local `~/project/reference/` | Original auditable reference content | User-controlled placement; agent does not write directly unless explicitly authorized |
97
+ | Index | TBD, for example Notion database `Project Index` | Metadata, summaries, and tags for each source file | Agent may read/write through a verified Connector |
98
+ | Persistent mirror | TBD, for example Drive folder `Project Reference/` | Backup or cross-device reference mirror | User-controlled sync by default; agent does not push automatically |
99
+ | Working draft | TBD, for example local `~/project/output/` | Agent task output | Agent may read and write local files under normal safety rules |
100
+
101
+ ## Tool Operation References
102
+
103
+ Use this section for project-local runbooks or verified procedures for runtime-controlled tools such as browser validation, screenshots, DevTools, Playwright, crawlers, notebooks, desktop app automation, MCP/plugin helpers, or raw CLI/SDK operations.
104
+
105
+ Do not store credential values or machine-private paths here. Local machine-only references may be listed only when the project explicitly depends on them, and the scope / limits must say they are not portable.
106
+
107
+ | Tool / operation | Reference path or URL | Required before | Source and version/date | Scope and known limits | Last verified |
108
+ |---|---|---|---|---|---|
109
+ | TBD | TBD | TBD | TBD | TBD | TBD |
110
+ | Local HTML / app browser validation | TBD, for example project runbook or official browser-tool docs | Before validating local HTML, static app, generated guide, screenshot, click flow, or visual QA | TBD, include source and date | Prefer short-lived loopback localhost service when `file://` is blocked; record click/text/screenshot evidence and cleanup result; do not mutate user browser profiles or extension state | TBD |
111
+
112
+ ## Local QC Commands
113
+
114
+ | Check | Command | Run before | Last verified |
115
+ |---|---|---|---|
116
+ | Agent Handoff Kit doctor | `npx --yes @adamchanadam/agent-handoff-kit@latest doctor --root .` | closeout / governance changes / generated Markdown artifact checks | package latest |
117
+ | Project governance check | Check newly created Markdown against `dev/PROJECT_INDEX.md` and `dev/DOC_SYNC_REGISTRY.md`; register, sync, consolidate, or explicitly classify as temporary / one-time evidence. Review non-Markdown durable outputs manually. | closeout / durable file changes | unverified until project-specific command exists |
118
118
 
119
119
  ## Workspace Identity
120
120
 
@@ -135,9 +135,9 @@ Record this at closeout so the next AI can detect wrong-root or workspace drift.
135
135
  | API behavior | TBD | tests + docs sync |
136
136
  | UI behavior | TBD | build + visual/manual check |
137
137
  | Data model | TBD | migration/checks |
138
- | Governance behavior | `AGENTS.md`, `dev/*` | doc sync registry |
139
- | Generated Markdown | `docs/`, `outputs/`, root Markdown files, project-specific reference folders | classify as indexed / synced / temporary / one-time evidence; update `dev/PROJECT_INDEX.md` or `dev/DOC_SYNC_REGISTRY.md` when durable; review other formats manually |
140
- | Closeout/startup contract | `AGENTS.md`, `dev/rules/closeout.md`, `START_NEXT_SESSION_PROMPT.txt`, `dev/SESSION_HANDOFF.md`, `dev/SESSION_LOG.md`, `dev/PROJECT_INDEX.md` | hot-path reads stay minimal; lifecycle state agrees; log has no full prompt; prompt mirror regenerated from handoff at closeout |
138
+ | Governance behavior | `AGENTS.md`, `dev/*` | doc sync registry |
139
+ | Generated Markdown | `docs/`, `outputs/`, root Markdown files, project-specific reference folders | classify as indexed / synced / temporary / one-time evidence; update `dev/PROJECT_INDEX.md` or `dev/DOC_SYNC_REGISTRY.md` when durable; review other formats manually |
140
+ | Closeout/startup contract | `AGENTS.md`, `dev/rules/closeout.md`, `START_NEXT_SESSION_PROMPT.txt`, `dev/SESSION_HANDOFF.md`, `dev/SESSION_LOG.md`, `dev/PROJECT_INDEX.md` | hot-path reads stay minimal; lifecycle state agrees; log has no full prompt; prompt mirror regenerated from handoff at closeout |
141
141
 
142
142
  ## External Services
143
143
 
@@ -145,6 +145,6 @@ Record this at closeout so the next AI can detect wrong-root or workspace drift.
145
145
  |---|---|---|---|
146
146
  | TBD | TBD | TBD | TBD |
147
147
 
148
- ## Maintenance Rule
149
-
150
- Update this file when stack, commands, directory roles, entry points, external services, runtime-controlled tool operation references, workspace identity, durable runbooks, or governance file map changes.
148
+ ## Maintenance Rule
149
+
150
+ Update this file when stack, commands, directory roles, entry points, external services, runtime-controlled tool operation references, workspace identity, durable runbooks, or governance file map changes.
@@ -115,18 +115,24 @@ At full closeout, complete this check after updating the state sections above.
115
115
  - Stale snapshots left in this handoff: TBD
116
116
  <!-- ack:field:lifecycle-conflicts-resolved -->
117
117
  - Completed / pending / risk / opening-message lifecycle conflicts resolved or explicitly reclassified: TBD
118
- <!-- ack:field:persistence-routing-checked -->
119
- - Persistence routing checked: TBD
120
- <!-- ack:field:recommended-next-step-explicit -->
118
+ <!-- ack:field:persistence-routing-checked -->
119
+ - Persistence routing checked: TBD
120
+ <!-- ack:field:closeout-outcome -->
121
+ - Closeout outcome: not_started — full closeout has not yet been assessed.
122
+ <!-- ack:field:project-required-persistence -->
123
+ - Project-required persistence: not_assessed — state whether this project's required Git or other persistence completed, is not required, or is blocked.
124
+ <!-- ack:field:recommended-next-step-explicit -->
121
125
  - Recommended next step is explicit and reasoned: TBD
122
126
  <!-- ack:field:opening-message-matches-current-state -->
123
127
  - Opening message matches current state: TBD
124
128
  <!-- ack:field:next-ai-can-continue -->
125
129
  - Next AI can continue from `AGENTS.md`, this handoff, `dev/PROJECT_INDEX.md`, and needed rule packs without searching old log history: TBD
126
130
 
127
- If any answer is no, blocked, or uncertain, fix this handoff before declaring handoff ready.
131
+ If any answer is no, blocked, or uncertain, fix this handoff before declaring handoff ready. `Closeout outcome: complete` is allowed only when required writes, read-backs and project-required persistence are complete. If project-required persistence is blocked, use `Closeout outcome: blocked` and state the blocker; it is not a completed closeout.
128
132
 
129
- Lifecycle consistency rule: compare `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message` as full content, including renamed or paraphrased work. A completed or verified item must not remain as an unresolved next priority, active risk, or startup instruction unless it is explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with the missing evidence or trigger condition stated. Doctor catches only mechanical contradictions and unresolved fields; its green result is not semantic proof. Recommended next-step rule: `Next Priorities` must name the single recommended next action and a short reason before listing additional options, unless the next action is blocked or genuinely requires a user decision. Persistence routing rule: one-time delivery instructions, historical validation evidence, old hashes, old version facts, and incident notes must stay in trace evidence unless they still affect the next action.
133
+ Lifecycle consistency rule: compare `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message` as full content, including renamed or paraphrased work. A completed or verified item must not remain as an unresolved next priority, active risk, or startup instruction unless it is explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with the missing evidence or trigger condition stated. Doctor catches only mechanical contradictions and unresolved fields; its green result is not semantic proof. Recommended next-step rule: `Next Priorities` must name the single recommended next action and a short reason before listing additional options, unless the next action is blocked or genuinely requires a user decision. Persistence routing rule: one-time delivery instructions, historical validation evidence, old hashes, old version facts, and incident notes must stay in trace evidence unless they still affect the next action.
134
+
135
+ Closeout-card rule: `closeout-status` reads only these existing handoff fields plus fresh doctor / mirror results; it does not create another persistence authority. Its `complete` card is the only permitted source for the user-facing `handoff saved` wording. A nonzero / `blocked` result must be shown as blocked, never summarized as completed.
130
136
 
131
137
  <!-- ack:section:handoff-sufficiency-check -->
132
138
  ## Handoff Sufficiency Check
@@ -150,5 +156,5 @@ Work in <absolute project root>. Read AGENTS.md, then dev/SESSION_HANDOFF.md. Tr
150
156
 
151
157
  If the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.
152
158
 
153
- Resume the current objective. If my message or the handoff already gives an executable task, begin its first safe action in this response. A fresh install only makes guidance available; it does not force onboarding. Load onboarding only when I explicitly ask for guidance or no executable objective remains after state reading.
159
+ Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, writes, network access, or opt-out execution wording. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. A fresh install only makes guidance available; it does not force onboarding. Load onboarding only when I explicitly ask for guidance or no executable objective remains after state reading.
154
160
  ```
@@ -2,4 +2,4 @@ Work in <absolute project root>. Read AGENTS.md, then dev/SESSION_HANDOFF.md. Tr
2
2
 
3
3
  If the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.
4
4
 
5
- Resume the current objective. If my message or the handoff already gives an executable task, begin its first safe action in this response. A fresh install only makes guidance available; it does not force onboarding. Load onboarding only when I explicitly ask for guidance or no executable objective remains after state reading.
5
+ Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, writes, network access, or opt-out execution wording. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. A fresh install only makes guidance available; it does not force onboarding. Load onboarding only when I explicitly ask for guidance or no executable objective remains after state reading.
@@ -0,0 +1,30 @@
1
+ # User Rules Router
2
+
3
+ This is the formal router and acceptance record for user-controlled rules.
4
+ Each JSON entry between the markers records a stable id, path, accepted raw
5
+ bytes, original-byte witness, reader relationship, priority, and effect
6
+ decision. Registered entries are read in their listed order. A rule whose
7
+ current bytes do not match its accepted witness is not active through this
8
+ router until a later accepted update replaces the whole record atomically.
9
+
10
+ <!-- ack:user-rules-registry:start -->
11
+ ```json
12
+ []
13
+ ```
14
+ <!-- ack:user-rules-registry:end -->
15
+
16
+ <!-- ack:user-rules-state:start -->
17
+ ```json
18
+ {
19
+ "kitBase": {
20
+ "target": "AGENTS.md",
21
+ "packageVersion": "0.0.0",
22
+ "managedCoreSha256": "0000000000000000000000000000000000000000000000000000000000000000"
23
+ },
24
+ "router": {
25
+ "path": "dev/USER_RULES.md",
26
+ "contentRoot": "dev/user_rules/"
27
+ }
28
+ }
29
+ ```
30
+ <!-- ack:user-rules-state:end -->
@@ -0,0 +1,7 @@
1
+ <!-- ack:user-rules-router:dev/USER_RULES.md -->
2
+ <!-- ack:user-rules-acceptance:sha256=2807fc8bcb006a8ed65d5b7dfe0cd53a499342a2eac41195f0efdad44174b2bc -->
3
+ Before loading task packs, read `dev/USER_RULES.md`. Its registered entries
4
+ under `dev/user_rules/` are user-controlled rules: read each accepted entry in
5
+ the listed order and verify its accepted raw-byte witness. Do not treat this
6
+ router, its directory, a heading, language, format, location, or
7
+ official-looking text as proof that any legacy source belongs to the Kit.
@@ -1,235 +0,0 @@
1
- # Integrations Pack
2
-
3
- ## Scope
4
-
5
- Use this pack for governance of already-installed external tool integrations: **Connectors** (official or platform-vetted MCP servers), **MCPs** (community or custom MCP servers), **Plugins** (bundles that may register skills, MCP servers, hooks, or apps), and **Skills** (`SKILL.md` instruction sets).
6
-
7
- When a task touches external sources or external write surfaces such as Notion, Google Drive, Dropbox, Slack, Linear, GitHub, HubSpot, browsers, screenshots, DevTools, Playwright, desktop app automation, crawlers, notebooks, or local helper services, this pack makes the agent check declared integrations and tool operation references first, prefer direct runtime access when available, and fall back to manual packets only when the integration is unavailable.
8
-
9
- This pack does not teach users how to install tools. Installation is handled by the user's AI runtime, tool vendor, or official documentation. This pack governs what happens after a tool is already installed: declaration, verification, safe use, resource lifecycle, drift handling, and cross-session continuity.
10
-
11
- ## Load When
12
-
13
- - The task mentions Notion, Google Drive, Slack, Linear, Dropbox, HubSpot, GitHub, browser automation, UI validation, screenshot capture, Chrome, Playwright, DevTools, desktop app automation, crawlers, notebooks, local helper services, or other external tools.
14
- - The user asks whether the agent can directly read or write an external system.
15
- - `dev/PROJECT_INDEX.md` has a non-empty `## Installed Integrations` section.
16
- - First-time onboarding asks the user to declare installed external tools.
17
- - The project uses a multi-layer source-of-truth setup, for example Notion index + local source files + Google Drive reference mirrors.
18
- - The user reports resource pressure, stale MCP or plugin services, browser automation left running, cache growth, or slowdown after external-tool use.
19
-
20
- ## Discipline
21
-
22
- ### 1. Credential Separation Principle
23
-
24
- Credential values such as API keys, OAuth tokens, app secrets, and refresh tokens belong only in AI runtime secure storage, OS credential stores, tool configuration, environment indirection, or user-managed secret stores. Agent Handoff Kit files may record credential references, never credential values.
25
-
26
- | Storage layer | Examples | What Kit files may record |
27
- |---|---|---|
28
- | AI runtime secure storage / Connector storage | Notion, Slack, Linear, Google Drive, Atlassian, HubSpot, or similar connectors | Storage type or connector name only |
29
- | OS credential store | macOS Keychain, Windows Credential Manager, Linux secret service | `OS credential store` only |
30
- | Tool config / env indirection | AI tool MCP config, plugin config, environment variable name | Config location or env var name only; never the value |
31
- | User-managed secret store | Team vault or secret manager | Store type or owner only |
32
-
33
- No file under `dev/` should contain a credential value. Enforce three rules:
34
-
35
- 1. Do not ask the user to paste credential values into chat.
36
- 2. If a credential-like prefix appears, redact it and warn the user to rotate the token when appropriate. Examples include `sk-`, `sk-ant-`, `ntn_`, `secret_`, `ya29.`, `1//`, `xoxp-`, `xoxb-`, `ghp_`, `gho_`, `ghs_`, `github_pat_`, `sl.`, `AKIA`, and `AIza`.
37
- 3. Before writing to `dev/PROJECT_INDEX.md` `## Installed Integrations`, self-check that no credential value is being persisted. Doctor also checks `PROJECT_INDEX`, `SESSION_HANDOFF`, and `SESSION_LOG` for common credential prefixes.
38
-
39
- ### 2. External Tool Usage Verification Gate
40
-
41
- Agents must not use model memory, old session experience, copied examples, Connector marketing text, or guessed command shapes as the source for external-tool usage. Before first use of an external tool layer in the current task, and again before any write, destructive action, permission-sensitive action, raw API / SDK / CLI / URI call, plugin API change, or retry after `unknown tool`, `invalid arguments`, HTTP 400 / 404, permission, auth, or schema errors, verify the current usage source for that layer:
42
-
43
- | Layer | Required current source before invocation |
44
- |---|---|
45
- | Connector / MCP tool | Current runtime-exposed tool name, description, and input schema. Use the tool list/schema exposed by the active AI runtime or MCP server; do not invent `mcp__*` names or arguments. |
46
- | Plugin / Skill | Current plugin/skill instructions plus any registered MCP tool schema it exposes. |
47
- | Raw API / SDK / CLI / URI | Current official documentation or a project-local runbook that states source, version/date, and scope. If the runbook lacks those, verify against official docs. |
48
- | Local app plugin API | Official API documentation, official type definitions, official sample project, or local installed package types matching the project version. |
49
- | Project-local runbook | Accept as a task source only when it records the upstream source, version/date, scope, and known limits. |
50
-
51
- If the required source cannot be inspected, mark the tool use `blocked` or `unverified`, ask the user for the current docs/schema/runbook, or fall back to a manual packet. Do not continue by trial and error. Connector-first means schema-first for the active runtime, not memory-first.
52
-
53
- #### Runtime-Controlled Tool Operation Variants
54
-
55
- For browser and tool-operation work, first check `dev/PROJECT_INDEX.md` `## Tool Operation References` when present. A successful method from a previous session is reusable only when it is registered there with source, version/date, scope, known limits, and last verification.
56
-
57
- | Variant | Examples | Required source before use |
58
- |---|---|---|
59
- | Browser / UI validation | Browser tool, screenshot, Chrome, DevTools, Playwright smoke test, visual QA | Active runtime browser/tool schema; registered tool operation reference; or current official docs for raw CLI/SDK use. Do not guess Chrome, Playwright, or DevTools commands. |
60
- | Desktop or local app automation | Desktop app session, app plugin, local browser profile, extension-dependent workflow | Active app/plugin/tool schema or official automation API docs. Do not mutate user sessions, profiles, or extension state without confirmation. |
61
- | Crawler / scraper / local helper | Firecrawl-like tools, crawler services, local helper server | Active tool schema, registered operation reference, or official docs. Respect source permissions, rate limits, and cleanup boundaries. |
62
- | Notebook / data runtime | Notebook kernel, data runtime, long-lived analysis server | Active runtime/kernel schema or registered operation reference. Classify kernels and servers by ownership before cleanup. |
63
- | Raw CLI / SDK / tool server | Direct command invocation, SDK script, MCP/tool server operation | Current official docs, installed package types, or registered operation reference. Mark blocked or unverified if unavailable. |
64
-
65
- ### 2.1 External Tool Resource Lifecycle
66
-
67
- External tools must be treated as resources with ownership, not just capabilities. After using Connector, MCP, plugin, browser automation, local server, crawler, notebook, or similar external tool services, classify any opened session, process, browser context, temporary directory, cache, or helper service into one of these ownership classes:
68
-
69
- | Ownership class | Examples | Agent action |
70
- |---|---|---|
71
- | Task-owned | Process, browser context, temp directory, or helper service clearly started by this task and no longer needed. Evidence may include parent-child process chain, start time, tool family, task-created path, or runtime session handle. | Close or clean up automatically through the runtime or tool's graceful shutdown API when available; OS-level termination is allowed only when ownership is clear and graceful close is unavailable or failed. |
72
- | Agent-managed | Kit-managed or agent-created temp/cache under a known task workspace, with bounded path and age/size rules. | Clean automatically inside the declared boundary. Never scan or clean broad user, system, browser, package-manager, or marketplace caches through this class. |
73
- | Shared / user-owned / other-agent-owned / system-level | User's normal browser, another AI agent's active browser or MCP service, global MCP service, global npm/cache directory, shared credential store, project files, OS temp root, or any process whose owner is uncertain. | Do not terminate, delete, disable, or reconfigure automatically. Report evidence and propose exact remediation for user confirmation. |
74
- | Unknown | Generic `node`, `python`, `chrome`, or helper process without reliable owner evidence. | Treat as shared until proven otherwise. |
75
-
76
- For ordinary external-tool tasks, perform a lightweight closeout check: close task-owned handles, note any known retained session, and report only meaningful residual risk. For long-running, multi-tool, MCP-heavy, browser-automation, repeated-error, or user-reported slowdown tasks, perform a fuller resource review when the runtime exposes enough data: group by tool family, count, approximate memory where available, age / start time where available, and ownership class. If process command lines or environment details may contain secrets, redact arguments and secret-like values before reporting.
77
-
78
- The preferred cleanup order is: graceful tool/session close, then task-owned process termination, then task-owned temp cleanup. Shared or ambiguous resources require explicit user confirmation with exact process IDs or paths, tool names, expected impact, and restart path before any termination, cache deletion, tool disablement, or configuration change. Never terminate or clean up a tool resource that may belong to another AI agent running on the same machine unless ownership has been proven for the current task.
79
-
80
- ### 3. Integration Type Discipline
81
-
82
- #### 3.1 Connectors
83
-
84
- Connectors are ready-to-use external tool surfaces exposed by the active AI runtime. Their credentials are normally managed by runtime secure storage, OS credential storage, or connector storage.
85
-
86
- Discipline:
87
-
88
- - Use only runtime-exposed tools whose current name, description, and input schema have been inspected.
89
- - Read back every external write before claiming success.
90
- - If auth fails, surface the failure and point the user to the runtime or connector settings. Do not attempt automatic re-auth.
91
-
92
- #### 3.2 MCPs
93
-
94
- MCP servers may be official, community, custom, or project-local. Custom MCPs often depend on manual configuration.
95
-
96
- Discipline:
97
-
98
- - Use only the active runtime's exposed tool name, description, and input schema.
99
- - Treat non-vetted or custom MCP write operations with extra caution. Destructive writes require dry-run and user confirmation under `packs/safety.md`.
100
- - If the server fails because of process crash, config error, or unavailable runtime state, surface the failure, recommend checking MCP config and restarting the host tool, and do not blindly retry.
101
-
102
- #### 3.3 Plugins
103
-
104
- Plugins are distribution bundles. A plugin may register skills, MCP servers, hooks, apps, or other runtime capabilities.
105
-
106
- Discipline:
107
-
108
- - Do not invoke a plugin as a separate abstraction unless the runtime exposes such an action.
109
- - If a plugin provides a skill, follow the skill trigger rules.
110
- - If a plugin provides an MCP server or app tool, treat it under the Connector / MCP rules above and the resource lifecycle rules in this pack.
111
-
112
- #### 3.4 Skills
113
-
114
- Skills are instruction overlays, usually stored as `SKILL.md`, and may be installed directly or shipped by a plugin.
115
-
116
- Discipline:
117
-
118
- - Invoke a skill when the user explicitly names it or when the skill's trigger conditions are clearly met.
119
- - Skill instructions coexist with rule-pack discipline.
120
- - If a skill conflicts with safety, governance, or closeout rules, the rule pack and core safety boundary take precedence.
121
-
122
- ### 4. Source-of-truth Architecture
123
-
124
- When a project uses multiple integrations as a source-of-truth system, read `dev/PROJECT_INDEX.md` `## Installed Integrations` `### Source-of-truth Architecture` before acting.
125
-
126
- | Layer | Role | Write direction |
127
- |---|---|---|
128
- | Source of truth | Original auditable reference content | User places or controls it; agent does not directly write it unless the project explicitly declares that integration as writable truth. |
129
- | Index | Metadata, summary, tags, and references for source files | Agent may read/write through declared Connector or MCP when verified. |
130
- | Persistent mirror | Backup or cross-device reference mirror | User-controlled sync by default; agent does not push automatically. |
131
- | Working draft | Task output and local work product | Agent may read/write local files under normal safety rules. |
132
-
133
- Each layer's responsible integration must be explicit in `PROJECT_INDEX`. Do not cross layers, for example by treating an index as primary truth or pushing a working draft to a mirror without authorization.
134
-
135
- ### 5. Cross-session Lifecycle
136
-
137
- #### Phase 0 — First-contact declaration
138
-
139
- During first-time onboarding, ask the user whether relevant external tools are already installed or available. This may be handled by the onboarding pack's external-tool scenario.
140
-
141
- #### Phase 1 — Initial recording
142
-
143
- Record declared integrations in `PROJECT_INDEX` `## Installed Integrations`, using the Connectors / MCPs / Plugins / Skills subsections and the Source-of-truth Architecture table when needed.
144
-
145
- #### Phase 2 — Cross-session handoff
146
-
147
- `SESSION_HANDOFF` durable anchors should point future agents to `PROJECT_INDEX` `## Installed Integrations`. The next-session opening message already includes `PROJECT_INDEX` in the read order.
148
-
149
- #### Phase 3 — Startup availability probe
150
-
151
- After reading `PROJECT_INDEX`, run a minimal availability probe for each declared integration when the runtime exposes the needed tool schema.
152
-
153
- - Probe success: update `Last Verified` and proceed.
154
- - Probe fail: warn that the integration is declared but unavailable in the current runtime, then use fallback flow only for the affected surface.
155
-
156
- #### Phase 4 — Task execution
157
-
158
- Apply the knowledge pack's Connector-first discipline: check declaration, use the verified direct tool when available, fall back to manual packet only when unavailable, and ask the user when the referenced integration is undeclared.
159
-
160
- #### Phase 5 — Mid-session drift handling
161
-
162
- If an integration fails mid-task because of expired auth, rate limit, network timeout, tool crash, or missing runtime capability:
163
-
164
- - Surface the failure and impact.
165
- - Do not auto-fix credentials or auth.
166
- - Update `PROJECT_INDEX` `Last Verified` / note fields where appropriate.
167
- - Record the drift in `SESSION_LOG` and unresolved risk in `SESSION_HANDOFF` when it affects future work.
168
-
169
- #### Phase 6 — Cross-tool consistency
170
-
171
- Integration declarations are project-level; they do not guarantee every AI runtime has the same tools installed. A new runtime must verify availability, warn on capability differences, and use fallback flow unless the user chooses to install or switch tools.
172
-
173
- ## Rules
174
-
175
- 1. **Credential separation**: never ask for, log, or persist credential values. Redact credential-like values and warn about rotation when appropriate.
176
- 2. **External Tool Usage Verification Gate**: verify current runtime schema, official docs, official types/samples, or registered tool operation references before invoking or retrying external tools.
177
- 3. **Declaration before use**: read `dev/PROJECT_INDEX.md` `## Installed Integrations` and `## Tool Operation References` before external-tool or runtime-controlled tool-operation work. If absent, ask about integration status rather than assuming none exists.
178
- 4. **Connector-first default**: when a declared integration is functional, prefer the verified direct tool call. Manual paste is fallback, not default.
179
- 5. **Write operations require read-back verification**: read back every external write before claiming success.
180
- 6. **No auto-fix credential / auth issues**: surface auth failures to the user and point to the runtime settings or tool owner.
181
- 7. **Cross-tool capability awareness**: verify availability at startup and warn when the current runtime lacks a declared integration.
182
- 8. **Do not cross source-of-truth layers**: follow the role and write direction declared in `PROJECT_INDEX`.
183
- 9. **Drift event mandatory recording**: record integration drift in `PROJECT_INDEX`, `SESSION_LOG`, and `SESSION_HANDOFF` when it affects future work.
184
- 10. **Plugin / Skill subordination**: plugin and skill instructions coexist with rule packs; safety, governance, and closeout rules take precedence on conflict.
185
- 11. **External tool resource lifecycle**: after external-tool use, classify resources by ownership. Task-owned / agent-managed resources may be closed or cleaned automatically; shared, user-owned, system-level, other-agent-owned, or unknown resources require evidence reporting and user confirmation before remediation.
186
-
187
- ## Checks
188
-
189
- - Verify `dev/PROJECT_INDEX.md` `## Installed Integrations` exists and has the expected subsections when the project declares integrations.
190
- - Before probing or invoking a declared integration, inspect current runtime tool description and input schema.
191
- - Before browser validation, screenshots, Chrome, Playwright, DevTools, desktop automation, crawler, notebook, or raw CLI/SDK/tool-server work, verify the current source from runtime schema, official docs, or `PROJECT_INDEX` `## Tool Operation References`.
192
- - Before external-tool first use, write, destructive operation, raw API / SDK / CLI / URI / plugin API call, or retry after tool error, confirm the current usage source.
193
- - Surface and record mid-session integration drift.
194
- - After external-tool use, perform ownership-based resource closeout. For long-running, multi-tool, MCP, browser automation, repeated-error, or slowdown scenarios, report grouped residual processes or services when observable.
195
- - Before closeout, update `Last Verified` for integrations touched this session.
196
- - Self-check credential leakage before writing `PROJECT_INDEX`, `SESSION_HANDOFF`, or `SESSION_LOG`.
197
- - Verify that `PROJECT_INDEX` External Sources `via` references match declared Installed Integrations entries.
198
-
199
- ## Closeout
200
-
201
- 1. Update `PROJECT_INDEX` `## Installed Integrations` `Last Verified` cells for integrations touched this session.
202
- 2. If drift happened, record the drift narrative, impact, and suggested next handling in `SESSION_LOG`.
203
- 3. Add unresolved integration failures to `SESSION_HANDOFF` `## Risks / Blockers`.
204
- 4. If unresolved drift affects startup, mention the next-session verification need in the opening message.
205
- 5. If the user declared a new integration during the session, ensure it is registered in `PROJECT_INDEX` and cross-referenced from External Sources when applicable.
206
- 6. If shared or ambiguous external-tool processes, caches, browser contexts, or helper services remain, record only a redacted evidence summary and recommended remediation. Do not write raw secret-bearing command lines into handoff or log files.
207
-
208
- ## Anti-patterns
209
-
210
- | Anti-pattern | Why it is wrong | Correct approach |
211
- |---|---|---|
212
- | Assuming no Connector or MCP exists whenever the user mentions Notion, Google Drive, or another external source | Mature connector ecosystems make paste-only fallback an unreliable default. | Read `PROJECT_INDEX` Installed Integrations first; ask about integration status if undeclared. |
213
- | Guessing tool names, endpoints, CLI flags, URI parameters, or plugin APIs from memory | Stale examples cause unknown tool, invalid args, 400 / 404, permission, or auth loops. | Verify active runtime schema, official docs, official types/samples, or versioned local runbooks. |
214
- | Treating browser validation as ordinary coding and guessing Chrome, Playwright, or DevTools commands | Browser and tool-control surfaces differ across runtimes, profiles, plugins, and installed packages. | Verify the active runtime schema, official docs, or a registered tool operation reference; mark blocked or use a manual packet when unavailable. |
215
- | Treating a Connector marketing page or old example as executable schema | Marketing pages do not prove the active runtime's current tool name or input schema. | Use active runtime tool list/schema as the invocation source. |
216
- | Retrying unknown tool / invalid args by changing names or parameters repeatedly | Trial-and-error hides the real schema or docs gap. | Stop same-pattern retries and return to the External Tool Usage Verification Gate. |
217
- | Writing credential values into `PROJECT_INDEX`, `SESSION_HANDOFF`, or `SESSION_LOG` | Project files and git history are persistent; leaked credentials remain exposed. | Record credential references only, never values. |
218
- | Using a credential value pasted in chat and then recording it | Chat history and logs may persist the secret. | Redact, warn, and ask the user to rotate if needed. |
219
- | Auto-fixing auth or re-auth flows | Auth belongs to the user and the runtime/tool boundary. | Surface the failure and point to the runtime or tool settings. |
220
- | Claiming an external write succeeded without read-back | External writes may fail silently or partially. | Read back and compare before claiming success. |
221
- | Crossing source-of-truth layers | It can corrupt truth, mirrors, or working drafts. | Follow the declared layer role and write direction in `PROJECT_INDEX`. |
222
- | Skipping startup availability verification because an old handoff said the tool worked | Tokens expire, runtimes change, and tools can be removed. | Probe availability in the current runtime before using the integration. |
223
- | Leaving task-owned MCP / browser / helper processes running after the task | Turns one-off tool use into a long-lived resource leak and can slow the host. | Use graceful close or task-owned process cleanup automatically; switch to user confirmation only when ownership is unclear. |
224
- | Broadly killing by process name such as `node.exe`, `python`, or `chrome` | A generic process name does not prove ownership and may terminate user work, another project, or another AI agent's active tools. | Classify by tool family, process ID, start time, parent chain, and task-created path; treat unknown ownership as shared. |
225
- | Automatically cleaning global caches, marketplace caches, OS temp roots, or browser profiles | May remove shared state, login state, or data other tools still need. | Automatically clean only task-owned / agent-managed bounded paths; report evidence and wait for confirmation otherwise. |
226
-
227
- ## Cross-reference
228
-
229
- - `packs/knowledge.md` Rule 5: Connector-first source access discipline.
230
- - `packs/safety.md` Rule 10: external API / SDK / CLI / tool verification boundary.
231
- - `packs/safety.md` Rule 12: credential leak prevention.
232
- - `packs/safety.md` Rule 14: process termination and cache cleanup boundary for external-tool resources.
233
- - `packs/onboarding.md` Scenario F: first-contact declaration entry point.
234
- - `runtime-core/AGENTS.core.md` Section 1: startup availability probe discipline.
235
- - `runtime-core/PROJECT_INDEX.md` `## Installed Integrations` and `## External Sources` `via` column: declaration registry.