@codyswann/lisa 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  2. package/dist/core/upstream-evidence-manifest.js +50 -23
  3. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  4. package/expo/copy-overwrite/scripts/bdd/baseline.mjs +211 -121
  5. package/expo/copy-overwrite/scripts/bdd/contract.mjs +10 -2
  6. package/expo/copy-overwrite/scripts/bdd/envelope.mjs +3 -2
  7. package/expo/copy-overwrite/scripts/bdd/render.mjs +2 -2
  8. package/expo/copy-overwrite/scripts/check-bdd-coverage.mjs +45 -8
  9. package/expo/copy-overwrite/scripts/classify-maestro-failures.mjs +775 -0
  10. package/expo/create-only/.github/workflows/nightly-e2e-report.yml +71 -0
  11. package/expo/create-only/.maestro/flake-classification.json +21 -0
  12. package/expo/create-only/bdd/coverage-map.json +1 -2
  13. package/expo/package-lisa/package.lisa.json +1 -0
  14. package/package.json +1 -1
  15. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  16. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  17. package/plugins/lisa/.codex-plugin/skills/lisa-atlassian-access/SKILL.md +75 -64
  18. package/plugins/lisa/.codex-plugin/skills/lisa-jam-access/SKILL.md +13 -5
  19. package/plugins/lisa/.codex-plugin/skills/lisa-linear-access/SKILL.md +30 -10
  20. package/plugins/lisa/.codex-plugin/skills/lisa-notion-access/SKILL.md +36 -23
  21. package/plugins/lisa/.codex-plugin/skills/lisa-posthog-access/SKILL.md +16 -6
  22. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/SKILL.md +8 -0
  23. package/plugins/lisa/.codex-plugin/skills/lisa-sentry-access/SKILL.md +16 -6
  24. package/plugins/lisa/.codex-plugin/skills/lisa-sonarcloud-access/SKILL.md +7 -1
  25. package/plugins/lisa/hooks/threshold-ratchet-families.mjs +24 -0
  26. package/plugins/lisa/rules/eager/credential-substrate-precedence.md +52 -0
  27. package/plugins/lisa/rules/eager/integration-access-layer.md +7 -3
  28. package/plugins/lisa/rules/reference/bdd-e2e-coverage.md +19 -8
  29. package/plugins/lisa/rules/reference/credential-substrate-precedence.md +166 -0
  30. package/plugins/lisa/rules/reference/integration-access-layer.md +27 -15
  31. package/plugins/lisa/skills/lisa-atlassian-access/SKILL.md +76 -65
  32. package/plugins/lisa/skills/lisa-jam-access/SKILL.md +14 -6
  33. package/plugins/lisa/skills/lisa-linear-access/SKILL.md +31 -11
  34. package/plugins/lisa/skills/lisa-notion-access/SKILL.md +37 -24
  35. package/plugins/lisa/skills/lisa-posthog-access/SKILL.md +17 -7
  36. package/plugins/lisa/skills/lisa-secrets-access/SKILL.md +8 -0
  37. package/plugins/lisa/skills/lisa-sentry-access/SKILL.md +17 -7
  38. package/plugins/lisa/skills/lisa-sonarcloud-access/SKILL.md +7 -1
  39. package/plugins/lisa-agy/plugin.json +1 -1
  40. package/plugins/lisa-agy/skills/lisa-atlassian-access/SKILL.md +76 -65
  41. package/plugins/lisa-agy/skills/lisa-jam-access/SKILL.md +14 -6
  42. package/plugins/lisa-agy/skills/lisa-linear-access/SKILL.md +31 -11
  43. package/plugins/lisa-agy/skills/lisa-notion-access/SKILL.md +37 -24
  44. package/plugins/lisa-agy/skills/lisa-posthog-access/SKILL.md +17 -7
  45. package/plugins/lisa-agy/skills/lisa-secrets-access/SKILL.md +8 -0
  46. package/plugins/lisa-agy/skills/lisa-sentry-access/SKILL.md +17 -7
  47. package/plugins/lisa-agy/skills/lisa-sonarcloud-access/SKILL.md +7 -1
  48. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  50. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  51. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-copilot/hooks/threshold-ratchet-families.mjs +24 -0
  55. package/plugins/lisa-copilot/rules/eager/credential-substrate-precedence.md +52 -0
  56. package/plugins/lisa-copilot/rules/eager/integration-access-layer.md +7 -3
  57. package/plugins/lisa-copilot/rules/reference/bdd-e2e-coverage.md +19 -8
  58. package/plugins/lisa-copilot/rules/reference/credential-substrate-precedence.md +166 -0
  59. package/plugins/lisa-copilot/rules/reference/integration-access-layer.md +27 -15
  60. package/plugins/lisa-copilot/skills/lisa-atlassian-access/SKILL.md +76 -65
  61. package/plugins/lisa-copilot/skills/lisa-jam-access/SKILL.md +14 -6
  62. package/plugins/lisa-copilot/skills/lisa-linear-access/SKILL.md +31 -11
  63. package/plugins/lisa-copilot/skills/lisa-notion-access/SKILL.md +37 -24
  64. package/plugins/lisa-copilot/skills/lisa-posthog-access/SKILL.md +17 -7
  65. package/plugins/lisa-copilot/skills/lisa-secrets-access/SKILL.md +8 -0
  66. package/plugins/lisa-copilot/skills/lisa-sentry-access/SKILL.md +17 -7
  67. package/plugins/lisa-copilot/skills/lisa-sonarcloud-access/SKILL.md +7 -1
  68. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-cursor/hooks/threshold-ratchet-families.mjs +24 -0
  70. package/plugins/lisa-cursor/rules/bdd-e2e-coverage-reference.mdc +19 -8
  71. package/plugins/lisa-cursor/rules/credential-substrate-precedence-reference.mdc +171 -0
  72. package/plugins/lisa-cursor/rules/credential-substrate-precedence.mdc +57 -0
  73. package/plugins/lisa-cursor/rules/integration-access-layer-reference.mdc +27 -15
  74. package/plugins/lisa-cursor/rules/integration-access-layer.mdc +7 -3
  75. package/plugins/lisa-cursor/skills/lisa-atlassian-access/SKILL.md +76 -65
  76. package/plugins/lisa-cursor/skills/lisa-jam-access/SKILL.md +14 -6
  77. package/plugins/lisa-cursor/skills/lisa-linear-access/SKILL.md +31 -11
  78. package/plugins/lisa-cursor/skills/lisa-notion-access/SKILL.md +37 -24
  79. package/plugins/lisa-cursor/skills/lisa-posthog-access/SKILL.md +17 -7
  80. package/plugins/lisa-cursor/skills/lisa-secrets-access/SKILL.md +8 -0
  81. package/plugins/lisa-cursor/skills/lisa-sentry-access/SKILL.md +17 -7
  82. package/plugins/lisa-cursor/skills/lisa-sonarcloud-access/SKILL.md +7 -1
  83. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  85. package/plugins/lisa-expo-agy/plugin.json +1 -1
  86. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  90. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  91. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  96. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  100. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  101. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  105. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  106. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  110. package/plugins/lisa-rails-agy/plugin.json +1 -1
  111. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  115. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  116. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  117. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  120. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  121. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  122. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  123. package/plugins/src/base/hooks/threshold-ratchet-families.mjs +24 -0
  124. package/plugins/src/base/rules/eager/credential-substrate-precedence.md +52 -0
  125. package/plugins/src/base/rules/eager/integration-access-layer.md +7 -3
  126. package/plugins/src/base/rules/reference/bdd-e2e-coverage.md +19 -8
  127. package/plugins/src/base/rules/reference/credential-substrate-precedence.md +166 -0
  128. package/plugins/src/base/rules/reference/integration-access-layer.md +27 -15
  129. package/plugins/src/base/skills/lisa-atlassian-access/SKILL.md +76 -65
  130. package/plugins/src/base/skills/lisa-jam-access/SKILL.md +14 -6
  131. package/plugins/src/base/skills/lisa-linear-access/SKILL.md +31 -11
  132. package/plugins/src/base/skills/lisa-notion-access/SKILL.md +37 -24
  133. package/plugins/src/base/skills/lisa-posthog-access/SKILL.md +17 -7
  134. package/plugins/src/base/skills/lisa-secrets-access/SKILL.md +8 -0
  135. package/plugins/src/base/skills/lisa-sentry-access/SKILL.md +17 -7
  136. package/plugins/src/base/skills/lisa-sonarcloud-access/SKILL.md +7 -1
  137. package/rails/copy-overwrite/scripts/threshold-ratchet-families.mjs +24 -0
  138. package/typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs +631 -5
  139. package/typescript/copy-overwrite/scripts/threshold-ratchet-families.mjs +24 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lisa-jam-access
3
- description: "Vendor-neutral access layer for Jam. Jam triage rules and skills MUST delegate through this skill rather than calling Jam MCP tools directly. Resolves Jam MCP first when available, then falls back to the JAM_PAT-authenticated Jam CLI for headless routines."
3
+ description: "Vendor-neutral access layer for Jam. Jam triage rules and skills MUST delegate through this skill rather than calling Jam MCP tools directly. Per the credential-substrate-precedence contract, resolves the JAM_PAT-authenticated Jam CLI first when the PAT is present and identity-matched, then falls back to the Jam MCP."
4
4
  allowed-tools: ["Bash", "Read", "Skill"]
5
5
  ---
6
6
 
@@ -21,13 +21,20 @@ Return parsed JSON or a concise structured summary in a `<result>` block.
21
21
 
22
22
  ## Substrate Selection
23
23
 
24
- Probe in order:
24
+ Probe in order — the ordering is the shared `credential-substrate-precedence`
25
+ contract, not a Jam-local choice. The first tier that is ready **and**
26
+ identity-matches the configured Jam account is used; one authenticated elsewhere
27
+ is skipped, never used.
25
28
 
26
- 1. Jam MCP, if the tool is available and authenticated.
27
- 2. Jam CLI authenticated with `JAM_PAT`.
29
+ 1. **Tier 1 configured-provider substrate: Jam CLI authenticated with `JAM_PAT`**,
30
+ resolved through `lisa-secrets-access`.
31
+ 2. **Tier 2 — interactive MCP fallback: Jam MCP**, if the tool is available and
32
+ authenticated. Used when tier 1 is genuinely unavailable: no `JAM_PAT`, no CLI
33
+ adapter for the operation, or a Jam outage.
28
34
 
29
35
  Jam documents a PAT-authenticated CLI that is cleaner for remote routines than
30
- editing `.mcp.json` headers. The headless tier uses:
36
+ editing `.mcp.json` headers, and it is the same substrate interactively and
37
+ headlessly — which is why it leads. The CLI tier uses:
31
38
 
32
39
  ```bash
33
40
  curl -fsSL https://native.jam.dev/install | bash
@@ -44,7 +51,8 @@ Error: no Jam access substrate available. Authenticate the Jam MCP or set JAM_PA
44
51
 
45
52
  ## Invariants
46
53
 
47
- - Fallback is gated on `JAM_PAT`; do not retry Jam MCP failures blindly.
54
+ - Tier order is `credential-substrate-precedence`: `JAM_PAT` CLI first, Jam MCP as
55
+ a preserved first-class fallback. Do not retry a failed tier blindly.
48
56
  - Never commit a Jam PAT into `.mcp.json` or any generated setup artifact.
49
57
  - Headless Jam access requires `native.jam.dev` for the installer and
50
58
  `api.jam.dev` for CLI/API calls in any custom remote network allowlist.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lisa-linear-access
3
- description: "Vendor-neutral access layer for Linear. Linear skills MUST delegate through this skill rather than calling Linear MCP tools or Linear GraphQL directly. Resolves Linear MCP first when authenticated, then falls back to LINEAR_API_KEY + Linear GraphQL in headless environments."
3
+ description: "Vendor-neutral access layer for Linear. Linear skills MUST delegate through this skill rather than calling Linear MCP tools or Linear GraphQL directly. Per the credential-substrate-precedence contract, resolves LINEAR_API_KEY + Linear GraphQL first ahead of the Linear MCP — whenever the key is present and identity-matches the configured workspace/team, and falls back to the Linear MCP when the token path is unavailable. Identity-match is mandatory on both substrates."
4
4
  allowed-tools: ["Bash", "Read", "Skill"]
5
5
  ---
6
6
 
@@ -46,15 +46,27 @@ WORKSPACE=$(jq -r '.linear.workspace // empty' .lisa.config.json 2>/dev/null)
46
46
  TEAM_KEY=$(jq -r '.linear.teamKey // empty' .lisa.config.json 2>/dev/null)
47
47
  ```
48
48
 
49
- Probe in order:
50
-
51
- 1. Linear MCP, if `mcp__linear-server__list_teams` is available and can list the
52
- configured workspace/team.
53
- 2. `LINEAR_API_KEY` with Linear GraphQL (`https://api.linear.app/graphql`).
49
+ Probe in order — the ordering is the shared `credential-substrate-precedence`
50
+ contract, not a Linear-local choice. The first tier that is ready **and**
51
+ identity-matches wins; a substrate authenticated against a different
52
+ workspace/team is **skipped, never used**, at either tier.
53
+
54
+ 1. **Tier 1 — configured-provider substrate: `LINEAR_API_KEY` with Linear GraphQL**
55
+ (`https://api.linear.app/graphql`), resolved through `lisa-secrets-access`.
56
+ Identity-match by querying `viewer { organization { urlKey } }` (plus
57
+ `teams` when `linear.teamKey` is configured) and comparing to
58
+ `.lisa.config.json`. A key that resolves to a different organization fails the
59
+ gate — warn, skip the tier, and continue down the ladder.
60
+ 2. **Tier 2 — interactive MCP fallback: Linear MCP**, if
61
+ `mcp__linear-server__list_teams` is available and can list the configured
62
+ workspace/team (that listing *is* the identity match). Used when tier 1 is
63
+ genuinely unavailable: no `LINEAR_API_KEY`, no GraphQL adapter for the
64
+ operation, or a Linear API outage.
54
65
 
55
66
  The Linear GraphQL docs support personal API keys for scripts and authenticate
56
- with an `Authorization: <API_KEY>` header. Treat `LINEAR_API_KEY` as the
57
- headless substrate. If neither tier works, fail with:
67
+ with an `Authorization: <API_KEY>` header, so the token tier works identically on
68
+ a developer laptop, in CI, in a cloud routine, and in a subagent — which is why it
69
+ leads. If neither tier works, fail with:
58
70
 
59
71
  ```text
60
72
  Error: no Linear access substrate available. Authenticate the Linear MCP or set LINEAR_API_KEY.
@@ -204,8 +216,16 @@ query($id:String!){
204
216
 
205
217
  ## Invariants
206
218
 
207
- - MCP is preferred when it is present and already authenticated.
208
- - GraphQL fallback runs only when `LINEAR_API_KEY` is present.
209
- - Missing MCP plus missing token is a hard failure naming `LINEAR_API_KEY`.
219
+ - Tier order is the shared `credential-substrate-precedence` contract:
220
+ `LINEAR_API_KEY` + GraphQL first when present and identity-matched, then the
221
+ Linear MCP. Do not restate or locally override the ordering here.
222
+ - The Linear MCP remains a first-class **fallback**, not a removed tier: it stays
223
+ the substrate whenever `LINEAR_API_KEY` is absent, the operation has no GraphQL
224
+ adapter, or the token path is failing.
225
+ - Identity-match is mandatory on **both** substrates. A substrate authenticated
226
+ against a different Linear organization or team is skipped, never used — that
227
+ includes a present-but-wrong `LINEAR_API_KEY`, which fails the gate loudly
228
+ instead of silently deferring to an authenticated MCP.
229
+ - Missing token plus missing MCP is a hard failure naming `LINEAR_API_KEY`.
210
230
  - Mutations send only the fields being changed, matching existing Linear skill
211
231
  guidance that `save_*` style updates should not clobber unrelated fields.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lisa-notion-access
3
- description: "Vendor-neutral access layer for Notion. Every notion-* skill MUST delegate through this skill rather than invoking the Notion REST API or any Notion MCP directly. Resolves a substrate per operation in this order: (1) Notion MCP if authenticated and the configured prdDatabaseId is fetchable through it (identity-match), (2) curl + Bearer auth + internal-integration token. Verifies the active connection matches `.lisa.config.json` before every operation — substrates authenticated as a different Notion workspace are skipped, not used."
3
+ description: "Vendor-neutral access layer for Notion. Every notion-* skill MUST delegate through this skill rather than invoking the Notion REST API or any Notion MCP directly. Per the credential-substrate-precedence contract, resolves a substrate per operation in this order: (1) curl + Bearer auth + internal-integration token when the token is present and identity-matches the configured workspace, (2) Notion MCP as fallback if authenticated and the configured prdDatabaseId is fetchable through it. Verifies the active connection matches `.lisa.config.json` before every operation — substrates authenticated as a different Notion workspace are skipped, not used."
4
4
  allowed-tools: ["Bash", "Read", "Skill"]
5
5
  ---
6
6
 
@@ -38,20 +38,15 @@ DB_ID=$(jq -r '.notion.prdDatabaseId // empty' .lisa.config.json)
38
38
  [ -z "$DB_ID" ] && { echo "Error: notion.prdDatabaseId not set. Run /lisa:setup:notion." >&2; exit 1; }
39
39
  ```
40
40
 
41
- Probe each tier in order; the first that's ready AND identity-matches is the substrate for this operation. Identity-match is verified before any operation; substrates authenticated as a different workspace are skipped, not used.
41
+ Probe each tier in order; the first that's ready AND identity-matches is the substrate for this operation. The ordering is the shared `credential-substrate-precedence` contract — the configured-provider token substrate leads, the interactive MCP is the fallback — not a Notion-local choice. Identity-match is verified before any operation; substrates authenticated as a different workspace are skipped, not used, at **every** tier.
42
42
 
43
43
  ```bash
44
44
  substrate=""
45
45
 
46
- # Tier 1: Notion MCP (identity-matched by fetching the configured PRD database)
47
- # Pseudo-code; actual call is the MCP tool invocation.
48
- # Try to fetch DB_ID through the MCP. Success MCP is authed to the right workspace.
49
- # 404 / object_not_found MCP is authed elsewhere (or unauthenticated). Skip.
50
- if mcp_notion_can_fetch_database "$DB_ID"; then
51
- substrate="mcp"
52
- fi
53
-
54
- # Tier 2: curl + API token
46
+ # Tier 1: curl + API token the configured-provider substrate, resolved through
47
+ # lisa-secrets-access. Leads because it is identical on a laptop, in CI, in a cloud
48
+ # routine, and in a subagent, and because its workspace binding travels with the
49
+ # request instead of coming from ambient browser-session state.
55
50
  read_notion_token() {
56
51
  local workspace="$1"
57
52
  [ -n "$NOTION_API_TOKEN" ] && { echo "$NOTION_API_TOKEN"; return; }
@@ -120,12 +115,28 @@ if [ -n "$TOKEN" ]; then
120
115
  "https://api.notion.com/v1/users/me")
121
116
  me_workspace=$(echo "$me" | jq -r '.bot.workspace_name // .bot.workspace_id // empty')
122
117
  if [ -n "$me_workspace" ] && [ "$me_workspace" = "$WORKSPACE" ]; then
123
- : ${substrate:=curl}
118
+ substrate="curl"
124
119
  elif [ -n "$me_workspace" ]; then
120
+ # A present-but-wrong token fails the gate rather than deferring to the MCP.
121
+ # Silently succeeding through an MCP authenticated elsewhere is the exact bug
122
+ # the precedence contract exists to surface.
125
123
  echo "Warning: Notion token belongs to workspace '$me_workspace' but config declares '$WORKSPACE'. Skipping curl tier." >&2
126
124
  fi
127
125
  fi
128
126
 
127
+ # Tier 2: Notion MCP — first-class fallback, used when tier 1 is genuinely
128
+ # unavailable (no token, no curl adapter for the operation, or Notion API outage).
129
+ # Identity-matched by fetching the configured PRD database.
130
+ # Pseudo-code; actual call is the MCP tool invocation.
131
+ # Try to fetch DB_ID through the MCP. Success → MCP is authed to the right workspace.
132
+ # 404 / object_not_found → MCP is authed elsewhere (or unauthenticated). Skip.
133
+ if mcp_notion_can_fetch_database "$DB_ID"; then
134
+ : ${substrate:=mcp}
135
+ # Mark the MCP available even when curl already won tier 1 — the dispatch table
136
+ # falls through to it for operations curl has no adapter for.
137
+ mcp_available=true
138
+ fi
139
+
129
140
  # Fail loudly with actionable remediation if nothing works.
130
141
  if [ -z "$substrate" ]; then
131
142
  # Detect plugin enablement state for the suggestion.
@@ -136,14 +147,19 @@ if [ -z "$substrate" ]; then
136
147
  cat >&2 <<EOF
137
148
  Error: no Notion access substrate available for workspace '$WORKSPACE'.
138
149
 
139
- Attempted:
140
- MCP — $([ "$plugin_enabled_global" = "true" ] || [ "$plugin_enabled_project" = "true" ] || [ "$plugin_enabled_local" = "true" ] && echo "plugin enabled but not authenticated or cannot fetch configured prdDatabaseId" || echo "plugin not enabled in any settings.json scope")
150
+ Attempted (in credential-substrate-precedence order):
141
151
  curl — no NOTION_API_TOKEN found for $WORKSPACE (env, slug-suffixed env, or keychain) OR token belongs to a different workspace
152
+ MCP — $([ "$plugin_enabled_global" = "true" ] || [ "$plugin_enabled_project" = "true" ] || [ "$plugin_enabled_local" = "true" ] && echo "plugin enabled but not authenticated or cannot fetch configured prdDatabaseId" || echo "plugin not enabled in any settings.json scope")
153
+
154
+ Remediation paths (the first is the contract's primary path):
142
155
 
143
- Remediation paths (pick one):
156
+ 1. Provision an internal-integration API token — works headless, in CI, and in
157
+ multi-workspace setups, and is the substrate this project resolves first.
144
158
 
145
- 1. Install the Notion MCP plugin (local scope — per-developer, gitignored).
146
- This is the simplest path for single-workspace developers.
159
+ Run /lisa:setup:notion guided flow with clipboard-piped keychain store.
160
+
161
+ 2. Install the Notion MCP plugin (local scope — per-developer, gitignored).
162
+ The supported fallback when no credentials provider is configured.
147
163
 
148
164
  Run in your terminal:
149
165
 
@@ -157,10 +173,6 @@ Remediation paths (pick one):
157
173
  Also share the configured prdDatabaseId with the integration via
158
174
  the page's '•••' menu → Connections.
159
175
 
160
- 2. Provision an internal-integration API token (headless / CI / multi-workspace).
161
-
162
- Run /lisa:setup:notion — guided flow with clipboard-piped keychain store.
163
-
164
176
  EOF
165
177
  exit 1
166
178
  fi
@@ -225,14 +237,15 @@ exec_op() {
225
237
  ## Invariants
226
238
 
227
239
  - Caller skills never call `curl https://api.notion.com/...` or any `mcp__*notion*` tool directly. They invoke this skill via the Skill tool with an operation name and arguments.
228
- - Substrate is selected per skill invocation following the tier ladder. The first tier that's available AND identity-matches `notion.workspaceId` wins.
229
- - The connection-match check is mandatory at every tier. Skipping it (because "the user obviously meant this workspace") is forbidden silent cross-workspace operations are exactly the multi-account hazard this design exists to prevent.
240
+ - Substrate is selected per skill invocation following the tier ladder defined by the shared `credential-substrate-precedence` contract — internal-integration token first, Notion MCP as fallback. The first tier that's available AND identity-matches `notion.workspaceId` wins. Do not restate or locally override the ordering here.
241
+ - The Notion MCP stays a first-class fallback, not a removed tier: it is the substrate whenever no token is configured, the operation has no curl adapter, or the Notion API is failing.
242
+ - The connection-match check is mandatory at every tier. Skipping it (because "the user obviously meant this workspace") is forbidden — silent cross-workspace operations are exactly the multi-account hazard this design exists to prevent. A present-but-wrong token fails the gate rather than deferring to an MCP authenticated somewhere else.
230
243
  - API tokens never mutate. If the configured workspace's token is wrong or missing, fail loudly and tell the user to run `/lisa:setup:notion`.
231
244
  - `Notion-Version` is pinned to `2022-06-28` — the version every existing notion-* skill targets. Bumping it is a coordinated change across the access skill and all callers.
232
245
 
233
246
  ## Headless behavior
234
247
 
235
- In a headless / non-interactive context (no TTY, `CI=true`, or `-p` mode), the MCP tier is unavailable (its OAuth flow needs a browser). The ladder collapses to curl + `NOTION_API_TOKEN`. Same skill code runs identically; only the substrate changes.
248
+ In a headless / non-interactive context (no TTY, `CI=true`, or `-p` mode), the MCP tier is unavailable (its OAuth flow needs a browser) and the ladder collapses to curl + `NOTION_API_TOKEN` — which is already tier 1 interactively. That is the point of the ordering: headless and interactive sessions take the **same primary path**, so a credential problem reproduces on a laptop instead of only in cron (`credential-substrate-precedence`, "headless parity"). Same skill code runs identically; only the availability of the fallback changes.
236
249
 
237
250
  ## Per-page sharing prerequisite
238
251
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lisa-posthog-access
3
- description: "Vendor-neutral access layer for PostHog. PostHog skills and observability rules MUST delegate through this skill rather than calling PostHog MCP tools or REST directly. Resolves PostHog MCP first when available, then falls back to POSTHOG_PERSONAL_API_KEY bearer auth."
3
+ description: "Vendor-neutral access layer for PostHog. PostHog skills and observability rules MUST delegate through this skill rather than calling PostHog MCP tools or REST directly. Per the credential-substrate-precedence contract, resolves POSTHOG_PERSONAL_API_KEY bearer auth first when present and identity-matched to the configured project, then falls back to the PostHog MCP."
4
4
  allowed-tools: ["Bash", "Read", "Skill"]
5
5
  ---
6
6
 
@@ -22,13 +22,21 @@ Return parsed JSON in a `<result>` block.
22
22
 
23
23
  ## Substrate Selection
24
24
 
25
- Probe in order:
25
+ Probe in order — the ordering is the shared `credential-substrate-precedence`
26
+ contract, not a PostHog-local choice. The first tier that is ready **and**
27
+ identity-matches the configured project is used; a substrate authenticated against
28
+ a different project is skipped, never used.
26
29
 
27
- 1. PostHog MCP, if available and authenticated.
28
- 2. `POSTHOG_PERSONAL_API_KEY` bearer token against the configured PostHog host.
30
+ 1. **Tier 1 configured-provider substrate: `POSTHOG_PERSONAL_API_KEY`** bearer
31
+ token against the configured PostHog host, resolved through
32
+ `lisa-secrets-access`.
33
+ 2. **Tier 2 — interactive MCP fallback: PostHog MCP**, if available and
34
+ authenticated. Used when tier 1 is genuinely unavailable: no
35
+ `POSTHOG_PERSONAL_API_KEY`, no REST adapter for the operation, or a PostHog
36
+ outage.
29
37
 
30
- PostHog documents personal API keys and bearer authentication. The headless REST
31
- tier uses:
38
+ PostHog documents personal API keys and bearer authentication, and the same key
39
+ works interactively and headlessly — which is why it leads. The REST tier uses:
32
40
 
33
41
  ```bash
34
42
  POSTHOG_HOST=${POSTHOG_HOST:-https://app.posthog.com}
@@ -54,7 +62,9 @@ Error: no PostHog access substrate available. Authenticate the PostHog MCP or se
54
62
 
55
63
  ## Invariants
56
64
 
57
- - Fallback is gated on `POSTHOG_PERSONAL_API_KEY`.
65
+ - Tier order is `credential-substrate-precedence`: `POSTHOG_PERSONAL_API_KEY`
66
+ first, the PostHog MCP as a preserved first-class fallback. Identity-match
67
+ against the configured project is mandatory on every tier.
58
68
  - `POSTHOG_HOST` defaults to PostHog Cloud but can point at a self-hosted
59
69
  deployment.
60
70
  - Consumer skills do not embed PostHog REST paths.
@@ -10,6 +10,14 @@ Single chokepoint for reading credentials. Caller skills MUST go through this
10
10
 
11
11
  The rule this exists to enforce: **a secret lives in exactly one store.** Every local cache is a copy that will eventually drift from its source, and a drifted copy is indistinguishable from a valid one until something fails in production.
12
12
 
13
+ This skill is also the chokepoint that feeds **tier 1** of the shared
14
+ `credential-substrate-precedence` contract: every `*-access` skill resolves its
15
+ configured-provider token or CLI credential here, ahead of any interactive MCP. That
16
+ is what makes "provider-first" actionable rather than aspirational — including the
17
+ `tool:` note line below, which declares which CLI a given credential is expected to
18
+ drive. This skill decides *where a credential comes from*; it never decides substrate
19
+ ordering, which is settled once in that contract.
20
+
13
21
  ## Two axes, not one
14
22
 
15
23
  A **provider** is where secrets live. A **surface** is where the running code lives, and it determines how secrets reach that code. These are independent: the same Bitwarden project serves a laptop, a CI runner, and a remote agent container, but each obtains its values differently.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lisa-sentry-access
3
- description: "Vendor-neutral access layer for Sentry. Sentry-oriented skills MUST delegate through this skill rather than calling Sentry MCP tools, sentry-cli, or REST directly. Resolves Sentry MCP/CLI first when available, then falls back to SENTRY_AUTH_TOKEN + Sentry REST API."
3
+ description: "Vendor-neutral access layer for Sentry. Sentry-oriented skills MUST delegate through this skill rather than calling Sentry MCP tools, sentry-cli, or REST directly. Per the credential-substrate-precedence contract, resolves SENTRY_AUTH_TOKEN (REST, or sentry-cli authenticated from the same token) first when present and identity-matched to the configured org/project, then falls back to the Sentry MCP."
4
4
  allowed-tools: ["Bash", "Read", "Skill"]
5
5
  ---
6
6
 
@@ -22,13 +22,21 @@ Return parsed JSON in a `<result>` block.
22
22
 
23
23
  ## Substrate Selection
24
24
 
25
- Probe in order:
25
+ Probe in order — the ordering is the shared `credential-substrate-precedence`
26
+ contract, not a Sentry-local choice. The first tier that is ready **and**
27
+ identity-matches the configured org/project is used; a substrate authenticated
28
+ against a different org is skipped, never used.
26
29
 
27
- 1. Sentry MCP, if available and authenticated.
28
- 2. `sentry-cli`, if installed and authenticated to the requested org/project.
29
- 3. `SENTRY_AUTH_TOKEN` bearer token against Sentry REST.
30
+ 1. **Tier 1 configured-provider substrate: `SENTRY_AUTH_TOKEN`** bearer token
31
+ against Sentry REST, resolved through `lisa-secrets-access`.
32
+ 2. **Tier 1a — `sentry-cli`**, if installed and authenticated to the requested
33
+ org/project from that same token (the CLI arm of the provider substrate).
34
+ 3. **Tier 2 — interactive MCP fallback: Sentry MCP**, if available and
35
+ authenticated. Used when tier 1 is genuinely unavailable: no
36
+ `SENTRY_AUTH_TOKEN`, no REST/CLI adapter for the operation, or a Sentry outage.
30
37
 
31
- Sentry documents API auth tokens for REST API calls. The headless REST tier uses:
38
+ Sentry documents API auth tokens for REST API calls, and the same token works
39
+ interactively and headlessly — which is why it leads. The REST tier uses:
32
40
 
33
41
  ```bash
34
42
  sentry_api() {
@@ -50,7 +58,9 @@ Error: no Sentry access substrate available. Authenticate Sentry MCP/CLI or set
50
58
 
51
59
  ## Invariants
52
60
 
53
- - Fallback is gated on `SENTRY_AUTH_TOKEN`.
61
+ - Tier order is `credential-substrate-precedence`: `SENTRY_AUTH_TOKEN` first, the
62
+ Sentry MCP as a preserved first-class fallback. Identity-match against the
63
+ configured org/project is mandatory on every tier.
54
64
  - Org/project come from `.sentryclirc`, `.lisa.config.json`, or explicit
55
65
  operation args; never infer by searching all accessible orgs.
56
66
  - Consumer skills do not embed Sentry REST paths.
@@ -15,7 +15,13 @@ this skill owns the tool selection.
15
15
  There is exactly one substrate: the **official SonarQube MCP server**, provided by
16
16
  the `sonarqube` plugin and launched by the `sonar` CLI (`sonar run mcp`). It
17
17
  authenticates headlessly from environment variables — no browser, no OS keychain —
18
- so it is the same substrate on a developer machine and in a headless cloud routine:
18
+ so it is the same substrate on a developer machine and in a headless cloud routine.
19
+
20
+ That makes this skill conformant with `credential-substrate-precedence` as a
21
+ single-substrate access layer: this MCP **is** the configured-provider substrate
22
+ (it is token-authenticated, not browser-OAuth), so there is no interactive tier to
23
+ demote and no second REST tier to add. Identity-match against the configured org
24
+ remains mandatory, as on every substrate.
19
25
 
20
26
  - `SONARQUBE_CLI_TOKEN` — required (Sonar user/analysis token).
21
27
  - `SONARQUBE_CLI_ORG` — required for SonarQube Cloud.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Expo and React Native-specific skills, agents, rules, and MCP servers.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Harper/Fabric-specific Lisa rules for TypeScript component apps.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"