You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add proactive skill catalogs to installed Intent hooks.
6
+
7
+
`intent hooks install` now installs session-start catalog hooks for supported agents alongside the existing edit gate. Agents see the allowed local Intent skills at session start, resume, clear, and compact where the agent supports those lifecycle events, then still need to run `intent load` before editing.
8
+
9
+
The generated hook loads the catalog through the Intent CLI with agent audience redaction instead of importing package code from the target repository.
Copy file name to clipboardExpand all lines: docs/cli/intent-hooks.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: intent hooks
3
3
id: intent-hooks
4
4
---
5
5
6
-
`intent hooks install` installs lifecycle hooks that enforce loading matching guidance before edits in supported agents.
6
+
`intent hooks install` installs lifecycle hooks that surface available Intent skills and enforce loading matching guidance before edits in supported agents.
- Installs hook enforcement without writing an `intent-skills` guidance block.
19
+
- Installs hook behavior without writing an `intent-skills` guidance block.
20
+
- Adds a session-start skill catalog for supported agents so the agent sees available `skill-id: description` entries before it starts work.
21
+
- Keeps edit enforcement in place: supported edit tools are blocked until the agent runs `intent load <skill-id>` for matching guidance.
20
22
-`--scope project` writes project-local hook config for agents that support it.
21
23
-`--scope user` writes user-level agent config and stores runner scripts under `~/.tanstack/intent/hooks`.
22
24
-`--agents all` is the default. In project scope, Copilot is skipped because the supported Copilot CLI hook location is user-scoped.
23
25
- Run `intent install` separately when you also want to write project guidance.
26
+
- Use `package.json#intent.skills` and `package.json#intent.exclude` to control which skills are surfaced in the session catalog.
24
27
25
28
## Hook support
26
29
27
-
| Agent | Project scope | User scope |Enforcement|
30
+
| Agent | Project scope | User scope |Hooks installed|
28
31
| --- | --- | --- | --- |
29
-
| Claude Code |`.claude/settings.json`|`~/.claude/settings.json`|Blocks configured edit tools with `PreToolUse`|
30
-
| Codex |`.codex/hooks.json`|`~/.codex/hooks.json`|Blocks supported `Bash`, `apply_patch`, and MCP tool calls; Codex hook interception is not a complete security boundary |
31
-
| GitHub Copilot CLI | Guidance via `.github/copilot-instructions.md`; blocking hooks are not project-scoped |`$COPILOT_HOME/hooks/hooks.json` or `~/.copilot/hooks/hooks.json`|Blocks supported edit tools with `PreToolUse`|
32
+
| Claude Code |`.claude/settings.json`|`~/.claude/settings.json`|`SessionStart` skill catalog plus `PreToolUse` edit gate|
33
+
| Codex |`.codex/hooks.json`|`~/.codex/hooks.json`|`SessionStart` skill catalog plus `PreToolUse` edit gate; Codex hook interception is not a complete security boundary |
34
+
| GitHub Copilot CLI | Guidance via `.github/copilot-instructions.md`; blocking hooks are not project-scoped |`$COPILOT_HOME/hooks/hooks.json` or `~/.copilot/hooks/hooks.json`|`SessionStart` skill catalog plus `PreToolUse` edit gate in user scope|
32
35
| Cursor | Guidance only | Guidance only | Use `AGENTS.md` or Cursor rules; no blocking hook is installed |
33
36
| Generic `AGENTS.md` agents | Guidance only | Guidance only | Use the `intent-skills` guidance block; no blocking hook is installed |
Cursor and generic `AGENTS.md` agents use the guidance block only.
58
58
59
+
Hooks add the available Intent skill catalog to supported agent sessions and keep the edit gate active until the agent loads matching full guidance. To tailor what appears in the session catalog, configure `intent.skills` and `intent.exclude` in `package.json`.
60
+
59
61
## 2. Choose which packages' skills to use
60
62
61
63
`package.json#intent.skills` is an allowlist of the packages whose skills you want surfaced.
async function createSessionCatalogContext(root) {
133
+
try {
134
+
const start = performance.now()
135
+
const result = readIntentList(root)
136
+
const durationMs = performance.now() - start
137
+
console.error(
138
+
\`[intent-\${AGENT}-session-catalog] listIntentSkills found \${result.skills.length} skills from \${result.packages.length} packages in \${formatDuration(durationMs)} (packageJsonReadCount=\${result.debug?.scan.packageJsonReadCount ?? 'unknown'})\`,
if (!Array.isArray(result.skills) || result.skills.length === 0) return ''
165
+
166
+
return [
167
+
'TanStack Intent skills are available in this repository.',
168
+
'',
169
+
'Before substantial work, check whether one listed skill clearly matches the user task. If one clearly matches, load that full skill guidance with the Intent CLI before proceeding.',
170
+
'',
171
+
'If no skill clearly matches, continue normally. Do not load a skill just to improve phrasing or gather nonessential context.',
0 commit comments