@stigmer/plugin-package 3.35.0 → 3.37.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 (148) hide show
  1. package/client/archive.d.ts.map +1 -1
  2. package/client/archive.js.map +1 -1
  3. package/client/builtin.d.ts.map +1 -1
  4. package/client/builtin.js.map +1 -1
  5. package/client/ignore/defaults.d.ts.map +1 -1
  6. package/client/ignore/defaults.js.map +1 -1
  7. package/client/ignore/match.d.ts.map +1 -1
  8. package/client/ignore/match.js.map +1 -1
  9. package/client/ignore/matcher.d.ts.map +1 -1
  10. package/client/ignore/matcher.js.map +1 -1
  11. package/client/ignore/pattern.d.ts.map +1 -1
  12. package/client/ignore/pattern.js.map +1 -1
  13. package/client/prepare.d.ts.map +1 -1
  14. package/client/prepare.js.map +1 -1
  15. package/client/presentation.d.ts.map +1 -1
  16. package/client/presentation.js.map +1 -1
  17. package/client/refs.d.ts.map +1 -1
  18. package/client/refs.js.map +1 -1
  19. package/client/release.d.ts.map +1 -1
  20. package/client/release.js.map +1 -1
  21. package/client/reroot.d.ts.map +1 -1
  22. package/client/reroot.js.map +1 -1
  23. package/client/select.d.ts.map +1 -1
  24. package/client/select.js.map +1 -1
  25. package/client/vocabulary.d.ts.map +1 -1
  26. package/client/vocabulary.js.map +1 -1
  27. package/client.d.ts.map +1 -1
  28. package/client.js.map +1 -1
  29. package/detect.d.ts.map +1 -1
  30. package/detect.js.map +1 -1
  31. package/dialects/claude.d.ts.map +1 -1
  32. package/dialects/claude.js.map +1 -1
  33. package/dialects/codex.d.ts.map +1 -1
  34. package/dialects/codex.js.map +1 -1
  35. package/dialects/cursor.d.ts.map +1 -1
  36. package/dialects/cursor.js.map +1 -1
  37. package/dialects/manifest.d.ts.map +1 -1
  38. package/dialects/manifest.js.map +1 -1
  39. package/dialects/open.d.ts.map +1 -1
  40. package/dialects/open.js.map +1 -1
  41. package/documents.d.ts.map +1 -1
  42. package/documents.js.map +1 -1
  43. package/files.d.ts.map +1 -1
  44. package/files.js.map +1 -1
  45. package/frontmatter.d.ts.map +1 -1
  46. package/frontmatter.js.map +1 -1
  47. package/index.d.ts.map +1 -1
  48. package/index.js.map +1 -1
  49. package/marketplace/messages.d.ts.map +1 -1
  50. package/marketplace/messages.js.map +1 -1
  51. package/marketplace/outcome.d.ts.map +1 -1
  52. package/marketplace/outcome.js.map +1 -1
  53. package/marketplace/read-marketplace.d.ts.map +1 -1
  54. package/marketplace/read-marketplace.js.map +1 -1
  55. package/messages.d.ts.map +1 -1
  56. package/messages.js.map +1 -1
  57. package/normalise/ignored.d.ts.map +1 -1
  58. package/normalise/ignored.js.map +1 -1
  59. package/normalise/mcp-servers.d.ts.map +1 -1
  60. package/normalise/mcp-servers.js.map +1 -1
  61. package/normalise/overlay.d.ts.map +1 -1
  62. package/normalise/overlay.js.map +1 -1
  63. package/normalise/skills.d.ts.map +1 -1
  64. package/normalise/skills.js.map +1 -1
  65. package/normalise/sub-agents.d.ts.map +1 -1
  66. package/normalise/sub-agents.js.map +1 -1
  67. package/normalise/variables.d.ts.map +1 -1
  68. package/normalise/variables.js.map +1 -1
  69. package/outcome.d.ts.map +1 -1
  70. package/outcome.js.map +1 -1
  71. package/package.json +1 -1
  72. package/placeholders.d.ts.map +1 -1
  73. package/placeholders.js.map +1 -1
  74. package/presentation.d.ts.map +1 -1
  75. package/presentation.js.map +1 -1
  76. package/read-plugin-package.d.ts.map +1 -1
  77. package/read-plugin-package.js.map +1 -1
  78. package/testing.d.ts.map +1 -1
  79. package/testing.js.map +1 -1
  80. package/types.d.ts.map +1 -1
  81. package/types.js.map +1 -1
  82. package/src/__test-utils__/directory-files.ts +0 -29
  83. package/src/__test-utils__/read.ts +0 -55
  84. package/src/__tests__/adversarial.test.ts +0 -434
  85. package/src/__tests__/client-ignore.test.ts +0 -133
  86. package/src/__tests__/client-prepare.test.ts +0 -163
  87. package/src/__tests__/client-refs.test.ts +0 -101
  88. package/src/__tests__/client-select-archive.test.ts +0 -150
  89. package/src/__tests__/detect.test.ts +0 -144
  90. package/src/__tests__/files.test.ts +0 -119
  91. package/src/__tests__/fixtures/cursor-plugins/.cursor-plugin/marketplace.json +0 -412
  92. package/src/__tests__/fixtures/cursor-plugins/NOTICE +0 -27
  93. package/src/__tests__/fixtures/cursor-plugins/advisor/.cursor-plugin/plugin.json +0 -33
  94. package/src/__tests__/fixtures/cursor-plugins/advisor/CHANGELOG.md +0 -8
  95. package/src/__tests__/fixtures/cursor-plugins/advisor/LICENSE +0 -21
  96. package/src/__tests__/fixtures/cursor-plugins/advisor/README.md +0 -87
  97. package/src/__tests__/fixtures/cursor-plugins/advisor/agents/advisor-subagent.md +0 -48
  98. package/src/__tests__/fixtures/cursor-plugins/advisor/assets/avatar.png +0 -0
  99. package/src/__tests__/fixtures/cursor-plugins/advisor/hooks/capture-response.sh +0 -20
  100. package/src/__tests__/fixtures/cursor-plugins/advisor/hooks/hooks.json +0 -27
  101. package/src/__tests__/fixtures/cursor-plugins/advisor/hooks/lib.sh +0 -61
  102. package/src/__tests__/fixtures/cursor-plugins/advisor/hooks/mark-pending.sh +0 -27
  103. package/src/__tests__/fixtures/cursor-plugins/advisor/hooks/record-consult.sh +0 -41
  104. package/src/__tests__/fixtures/cursor-plugins/advisor/hooks/stop-hook.sh +0 -48
  105. package/src/__tests__/fixtures/cursor-plugins/advisor/skills/advisor/SKILL.md +0 -123
  106. package/src/__tests__/fixtures/cursor-plugins/advisor/skills/advisor/references/briefing-template.md +0 -44
  107. package/src/__tests__/fixtures/cursor-plugins/github/.cursor-plugin/plugin.json +0 -45
  108. package/src/__tests__/fixtures/cursor-plugins/github/CHANGELOG.md +0 -9
  109. package/src/__tests__/fixtures/cursor-plugins/github/LICENSE +0 -21
  110. package/src/__tests__/fixtures/cursor-plugins/github/README.md +0 -64
  111. package/src/__tests__/fixtures/cursor-plugins/github/assets/logo.svg +0 -0
  112. package/src/__tests__/fixtures/cursor-plugins/github/mcp.json +0 -11
  113. package/src/__tests__/fixtures/cursor-plugins/playwright/.cursor-plugin/plugin.json +0 -35
  114. package/src/__tests__/fixtures/cursor-plugins/playwright/CHANGELOG.md +0 -8
  115. package/src/__tests__/fixtures/cursor-plugins/playwright/LICENSE +0 -21
  116. package/src/__tests__/fixtures/cursor-plugins/playwright/README.md +0 -46
  117. package/src/__tests__/fixtures/cursor-plugins/playwright/assets/logo.svg +0 -0
  118. package/src/__tests__/fixtures/cursor-plugins/playwright/mcp.json +0 -8
  119. package/src/__tests__/fixtures/cursor-plugins/salesforce/.cursor-plugin/plugin.json +0 -48
  120. package/src/__tests__/fixtures/cursor-plugins/salesforce/CHANGELOG.md +0 -10
  121. package/src/__tests__/fixtures/cursor-plugins/salesforce/LICENSE +0 -21
  122. package/src/__tests__/fixtures/cursor-plugins/salesforce/README.md +0 -95
  123. package/src/__tests__/fixtures/cursor-plugins/salesforce/assets/logo.svg +0 -0
  124. package/src/__tests__/fixtures/cursor-plugins/salesforce/mcp.json +0 -12
  125. package/src/__tests__/fixtures/cursor-plugins/thermos/.cursor-plugin/plugin.json +0 -32
  126. package/src/__tests__/fixtures/cursor-plugins/thermos/CHANGELOG.md +0 -8
  127. package/src/__tests__/fixtures/cursor-plugins/thermos/LICENSE +0 -21
  128. package/src/__tests__/fixtures/cursor-plugins/thermos/README.md +0 -70
  129. package/src/__tests__/fixtures/cursor-plugins/thermos/agents/thermo-nuclear-code-quality-review-subagent.md +0 -23
  130. package/src/__tests__/fixtures/cursor-plugins/thermos/agents/thermo-nuclear-review-subagent.md +0 -28
  131. package/src/__tests__/fixtures/cursor-plugins/thermos/assets/logo.png +0 -0
  132. package/src/__tests__/fixtures/cursor-plugins/thermos/skills/thermo-nuclear-code-quality-review/SKILL.md +0 -192
  133. package/src/__tests__/fixtures/cursor-plugins/thermos/skills/thermo-nuclear-review/SKILL.md +0 -51
  134. package/src/__tests__/fixtures/cursor-plugins/thermos/skills/thermos/SKILL.md +0 -21
  135. package/src/__tests__/fixtures/cursor-plugins/xero/.cursor-plugin/plugin.json +0 -53
  136. package/src/__tests__/fixtures/cursor-plugins/xero/CHANGELOG.md +0 -9
  137. package/src/__tests__/fixtures/cursor-plugins/xero/LICENSE +0 -21
  138. package/src/__tests__/fixtures/cursor-plugins/xero/README.md +0 -79
  139. package/src/__tests__/fixtures/cursor-plugins/xero/assets/logo.png +0 -0
  140. package/src/__tests__/fixtures/cursor-plugins/xero/mcp.json +0 -16
  141. package/src/__tests__/fixtures.test.ts +0 -198
  142. package/src/__tests__/marketplace.test.ts +0 -378
  143. package/src/__tests__/mcp-servers.test.ts +0 -120
  144. package/src/__tests__/overlay-and-ignored.test.ts +0 -65
  145. package/src/__tests__/presentation.test.ts +0 -186
  146. package/src/__tests__/skills.test.ts +0 -89
  147. package/src/__tests__/sub-agents.test.ts +0 -111
  148. package/src/__tests__/variables.test.ts +0 -94
@@ -1,87 +0,0 @@
1
- # Advisor
2
-
3
- Advisor gives Cursor's agent a stronger second model to consult at key points: before a major decision, when it is stuck on an error, and before it declares a task done. The main model keeps doing the work; the advisor reads a full briefing (and the conversation transcript when available), thinks hard, and returns a verdict with concrete guidance. You get higher quality on complex tasks while paying for the strong model only where it matters.
4
-
5
- The default advisor is the latest Grok (Grok 4.6) at its highest reasoning effort. Because the advisor is a subagent with its own model, it does not have to be the model you are chatting with: any model available to subagents works, so a second opinion can come from a different model family.
6
-
7
- ## Installation
8
-
9
- ```bash
10
- /add-plugin advisor
11
- ```
12
-
13
- ## Quick start
14
-
15
- ```text
16
- /advisor turn on with the default advisor (Grok 4.6, xhigh effort)
17
- /advisor composer-2.5 turn on with a different model (any subagent model slug)
18
- /advisor ask is this migration safe to run twice?
19
- /advisor status
20
- /advisor off
21
- ```
22
-
23
- Then work as usual. When the agent hits a checkpoint it consults the advisor and reports back in a line or two:
24
-
25
- ```text
26
- Advisor (cursor-grok-4.6-xhigh): proceed with changes. The retry wrapper hides the real
27
- failure; the 401 comes from a stale token cache. Dropped the retry, fixed the cache key.
28
- ```
29
-
30
- To keep the skill in context for a whole session, invoke `/advisor` with Option+Enter (macOS) or Alt+Enter (Windows/Linux) to run it as a Custom Mode. The state file works either way.
31
-
32
- ## How it works
33
-
34
- ```mermaid
35
- flowchart LR
36
- U[User] -->|/advisor| M[Main model]
37
- M -->|writes| S[.cursor/advisor/state.json]
38
- M -->|briefing + transcript path| A[advisor-subagent<br/>strong model, read-only]
39
- A -->|verdict + guidance| M
40
- H[hooks] -->|track edits, log consults,<br/>nudge before done| M
41
- ```
42
-
43
- - **Skill `advisor`** implements the `/advisor` command and the checkpoint protocol: when to consult, how to write the briefing, how to act on the verdict, and how to report it. See [skills/advisor/SKILL.md](skills/advisor/SKILL.md) and the [briefing template](skills/advisor/references/briefing-template.md).
44
- - **Agent `advisor-subagent`** is a read-only subagent pinned to a strong model (`grok-4.6[effort=xhigh]` by default, overridden per session by `/advisor <model>`). It verifies the briefing against the repository, reads the transcript when a path is available, and answers with `Verdict / Why / Recommendations / Risks / Answers / Confidence`.
45
- - **Hooks** keep the mode honest without adding chatter: `afterFileEdit` records that files changed since the last consult, `subagentStop` counts each consult and appends the advice to `.cursor/advisor/log.md`, and `stop` posts a one-line `[Advisor]` follow-up when a turn ends with unreviewed edits so the pre-completion consult is not skipped. The nudge fires at most once per batch of edits, stays quiet when the agent ended its turn with a question for you, and can be disabled with `/advisor nudge off`.
46
-
47
- ## Checkpoints
48
-
49
- | Checkpoint | Trigger |
50
- | --- | --- |
51
- | Major decision | Choosing between approaches; migrations, deletions, public API or config changes, dependency swaps, auth or payment code; requests ambiguous enough to change the work. |
52
- | Stuck | Same error or failing test after two real attempts; unexplained behavior; about to add a workaround (retry loop, `sleep`, broad `try/except`, skipped test, disabled check). |
53
- | Before declaring done | Any task that changed logic or touched more than a couple of files. Trivial edits are skipped and said so. |
54
- | On request | `/advisor ask ...`, or asking what the advisor thinks. |
55
-
56
- The skill caps this at roughly four consults per task and never consults for routine steps or things the agent can verify itself.
57
-
58
- ## Models
59
-
60
- The default is the latest Grok model at its highest reasoning effort (currently `cursor-grok-4.6-xhigh`). `/advisor <model>` accepts any model slug available to subagents; a family name such as `grok fast` or `composer` resolves to that family's latest model at its highest reasoning tier. If Cursor rejects a slug, the skill picks the closest valid one from the error, saves it, and tells you. Team model restrictions and plan limits apply to the advisor like any subagent.
61
-
62
- ## State
63
-
64
- Everything lives in `.cursor/advisor/` at the project root and is safe to delete at any time:
65
-
66
- | File | Purpose |
67
- | --- | --- |
68
- | `state.json` | Mode, model, nudge setting, consult count, bound conversation, transcript path. |
69
- | `log.md` | Every completed consult with its verdict, for later review. |
70
- | `pending` | Marker: files changed since the last consult. |
71
- | `last-response.txt` | Tail of the latest reply, used to avoid nudging over a question to you. |
72
-
73
- Add `.cursor/advisor/` to your `.gitignore` if you do not want it in the repository; the skill never stages it.
74
-
75
- ## Cost
76
-
77
- Each consult is one call to the advisor model with a briefing of a few thousand tokens plus whatever the advisor chooses to read. Selective use is the point: a typical feature takes one to three consults. The default advisor, Grok 4.6, draws from the Cursor Models usage pool, so it is the cheapest of the strong options; switch models when you want a different family's perspective.
78
-
79
- ## Limitations
80
-
81
- - State is per project, bound to the conversation that enabled it. Running `/advisor` in a second conversation on the same project re-binds the mode there (model and nudge settings carry over; the consult history and advisor context start fresh). Use `/advisor status` to look without re-binding.
82
- - The transcript path is recorded by hooks, so the advisor only reads the full transcript when hooks run and transcripts are enabled. It always receives the briefing.
83
- - The end-of-turn nudge relies on the plugin's hooks; where hooks do not run, the skill still performs the pre-completion consult on its own.
84
-
85
- ## License
86
-
87
- MIT
@@ -1,48 +0,0 @@
1
- ---
2
- name: advisor-subagent
3
- description: Stronger-model advisor for the Advisor plugin. Consulted by the main agent at key checkpoints (before a major decision, when stuck on an error, before declaring a task done) with a briefing and, when available, the conversation transcript. Read-only. Returns a verdict and concrete guidance, not edits.
4
- model: grok-4.6[effort=xhigh]
5
- readonly: true
6
- ---
7
-
8
- # Advisor
9
-
10
- You are the senior engineer a working agent consults at key points. Your prompt is a briefing: the user's request, what has happened so far, verbatim evidence, the current state, and specific questions. It may also name a transcript file. The parent does the work; you supply judgment.
11
-
12
- ## Method
13
-
14
- 1. Read the whole briefing before forming a view. Separate evidence (tool output, diffs) from the parent's interpretation of it.
15
- 2. Verify what matters. You can read the repository and run read-only commands (`git diff`, `git log`, `grep`, viewing files). Open the files the briefing names and read the actual diff rather than the description of it. For a "stuck" checkpoint, read the failing code path yourself before proposing a cause.
16
- 3. If a transcript path is given and the file exists, use it to recover what the briefing left out: the user's exact words, earlier decisions, tool results that were summarized away. Check the file size first. For a large transcript, read the most recent portion and search for the user's messages instead of reading everything.
17
- 4. Look for what the parent most likely missed: an assumption it never tested, a simpler approach, a hidden coupling, a production failure mode, part of the request that quietly dropped out of scope, verification that was claimed but not actually run.
18
- 5. Decide. Prefer one clear recommendation over a menu. If two options are genuinely close, say so and give the tie-breaker.
19
-
20
- ## Response
21
-
22
- The parent has to act on this, not read an essay. Stay under about 400 words unless the situation truly needs more.
23
-
24
- ```text
25
- Verdict: proceed | proceed with changes | stop
26
- Why: <two or three sentences>
27
-
28
- Recommendations:
29
- 1. <specific action, with file:line or the exact command where relevant>
30
- 2. ...
31
-
32
- Risks / verify before done:
33
- - <what could still be wrong, and how to check it>
34
-
35
- Answers:
36
- <numbered, matching the briefing's questions>
37
-
38
- Confidence: high | medium | low — <what would change your mind>
39
- ```
40
-
41
- ## Rules
42
-
43
- - Do not edit files, run state-changing commands, or do the task yourself. You advise.
44
- - Be direct. Disagree when the evidence warrants it, including with the parent's stated leaning. Do not pad agreement with caveats.
45
- - Say what you verified and what you infer. Never present a guess about the codebase as fact.
46
- - If the briefing lacks something you need, ask for exactly that in a short numbered list and still give your best provisional read. One round only.
47
- - Do not spawn subagents.
48
- - When resumed, treat the new message as the next checkpoint of the same task. Reuse what you already know and do not re-verify what has not changed.
@@ -1,20 +0,0 @@
1
- #!/bin/bash
2
-
3
- # afterAgentResponse hook for Advisor.
4
- # Keeps the tail of the latest assistant message so the stop hook can tell
5
- # whether the agent ended its turn with a question for the user.
6
- #
7
- # Input: { "text": "<assistant response text>", ...common }
8
- # Output: none
9
-
10
- set -euo pipefail
11
-
12
- source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
13
-
14
- HOOK_INPUT=$(cat)
15
-
16
- advisor_require_enabled
17
- advisor_bind_conversation "$HOOK_INPUT" || exit 0
18
-
19
- jq -r '.text // empty' <<< "$HOOK_INPUT" | tail -c 400 > "$LAST_RESPONSE_FILE"
20
- exit 0
@@ -1,27 +0,0 @@
1
- {
2
- "version": 1,
3
- "hooks": {
4
- "afterFileEdit": [
5
- {
6
- "command": "bash \"${CURSOR_PLUGIN_ROOT}/hooks/mark-pending.sh\""
7
- }
8
- ],
9
- "afterAgentResponse": [
10
- {
11
- "command": "bash \"${CURSOR_PLUGIN_ROOT}/hooks/capture-response.sh\""
12
- }
13
- ],
14
- "subagentStop": [
15
- {
16
- "command": "bash \"${CURSOR_PLUGIN_ROOT}/hooks/record-consult.sh\"",
17
- "matcher": "^advisor-subagent$"
18
- }
19
- ],
20
- "stop": [
21
- {
22
- "command": "bash \"${CURSOR_PLUGIN_ROOT}/hooks/stop-hook.sh\"",
23
- "loop_limit": 3
24
- }
25
- ]
26
- }
27
- }
@@ -1,61 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Shared helpers for the Advisor hooks. Source this file; do not run it.
4
- #
5
- # State lives in $CURSOR_PROJECT_DIR/.cursor/advisor/:
6
- # state.json written by the advisor skill, kept current here
7
- # pending marker: files were edited since the last consult
8
- # last-response.txt tail of the latest assistant message
9
- # log.md one entry per completed consult
10
-
11
- ADVISOR_DIR="${CURSOR_PROJECT_DIR:-.}/.cursor/advisor"
12
- STATE_FILE="$ADVISOR_DIR/state.json"
13
- PENDING_FILE="$ADVISOR_DIR/pending"
14
- LAST_RESPONSE_FILE="$ADVISOR_DIR/last-response.txt"
15
- LOG_FILE="$ADVISOR_DIR/log.md"
16
-
17
- # Exit quietly unless advisor mode is on and jq is available.
18
- advisor_require_enabled() {
19
- command -v jq >/dev/null 2>&1 || exit 0
20
- [[ -f "$STATE_FILE" ]] || exit 0
21
- [[ "$(jq -r '.enabled // false' "$STATE_FILE" 2>/dev/null)" == "true" ]] || exit 0
22
- }
23
-
24
- # Atomically apply a jq filter to state.json.
25
- # Usage: advisor_state_update '<filter>' [jq args...]
26
- advisor_state_update() {
27
- local filter="$1"
28
- shift
29
- local tmp="${STATE_FILE}.tmp.$$"
30
- if jq "$@" "$filter" "$STATE_FILE" > "$tmp" 2>/dev/null; then
31
- mv "$tmp" "$STATE_FILE"
32
- else
33
- rm -f "$tmp"
34
- fi
35
- }
36
-
37
- # Bind the state to the first conversation that touches it and keep transcript_path
38
- # current. Returns 1 when the hook input belongs to a different conversation, so
39
- # callers can stay out of conversations that did not enable the advisor.
40
- # A fresh bind also drops per-conversation markers so a re-bind cannot inherit
41
- # the previous conversation's pending edits.
42
- advisor_bind_conversation() {
43
- local input="$1"
44
- local conv bound transcript current
45
- conv=$(jq -r '.conversation_id // empty' <<< "$input")
46
- bound=$(jq -r '.conversation_id // empty' "$STATE_FILE")
47
- if [[ -n "$conv" ]]; then
48
- if [[ -z "$bound" ]]; then
49
- advisor_state_update '.conversation_id = $conv' --arg conv "$conv"
50
- rm -f "$PENDING_FILE" "$LAST_RESPONSE_FILE"
51
- elif [[ "$bound" != "$conv" ]]; then
52
- return 1
53
- fi
54
- fi
55
- transcript=$(jq -r '.transcript_path // empty' <<< "$input")
56
- current=$(jq -r '.transcript_path // empty' "$STATE_FILE")
57
- if [[ -n "$transcript" && "$transcript" != "$current" ]]; then
58
- advisor_state_update '.transcript_path = $path' --arg path "$transcript"
59
- fi
60
- return 0
61
- }
@@ -1,27 +0,0 @@
1
- #!/bin/bash
2
-
3
- # afterFileEdit hook for Advisor.
4
- # Remembers that files changed since the last advisor consult, so the stop hook
5
- # can ask for a pre-completion review if the turn ends without one.
6
- #
7
- # Input: { "file_path": "<absolute path>", "edits": [...], ...common }
8
- # Output: none
9
-
10
- set -euo pipefail
11
-
12
- source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
13
-
14
- HOOK_INPUT=$(cat)
15
-
16
- advisor_require_enabled
17
- advisor_bind_conversation "$HOOK_INPUT" || exit 0
18
-
19
- FILE_PATH=$(jq -r '.file_path // empty' <<< "$HOOK_INPUT")
20
-
21
- # The plugin's own state is not work product.
22
- case "$FILE_PATH" in
23
- */.cursor/advisor/*) exit 0 ;;
24
- esac
25
-
26
- touch "$PENDING_FILE"
27
- exit 0
@@ -1,41 +0,0 @@
1
- #!/bin/bash
2
-
3
- # subagentStop hook for Advisor (matcher: the `advisor-subagent` subagent).
4
- # Counts the consult, clears the pending-edits marker, and appends the advice
5
- # to .cursor/advisor/log.md so the user can review it later.
6
- #
7
- # Input: { "subagent_type": "advisor-subagent", "status": "completed"|"error"|"aborted",
8
- # "description": "...", "summary": "...", ...common }
9
- # Output: none
10
-
11
- set -euo pipefail
12
-
13
- source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
14
-
15
- HOOK_INPUT=$(cat)
16
-
17
- advisor_require_enabled
18
- advisor_bind_conversation "$HOOK_INPUT" || exit 0
19
-
20
- SUBAGENT_TYPE=$(jq -r '.subagent_type // empty' <<< "$HOOK_INPUT")
21
- STATUS=$(jq -r '.status // empty' <<< "$HOOK_INPUT")
22
- if [[ "$SUBAGENT_TYPE" != "advisor-subagent" || "$STATUS" != "completed" ]]; then
23
- exit 0
24
- fi
25
-
26
- NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
27
- advisor_state_update '.consults = ((.consults // 0) + 1) | .last_consult_at = $now' --arg now "$NOW"
28
- rm -f "$PENDING_FILE"
29
-
30
- DESCRIPTION=$(jq -r '.description // "Advisor consult"' <<< "$HOOK_INPUT")
31
- SUMMARY=$(jq -r '.summary // empty' <<< "$HOOK_INPUT" | head -c 6000)
32
- {
33
- printf '## %s — %s\n\n' "$NOW" "$DESCRIPTION"
34
- if [[ -n "$SUMMARY" ]]; then
35
- printf '%s\n\n' "$SUMMARY"
36
- else
37
- printf '_No summary captured._\n\n'
38
- fi
39
- } >> "$LOG_FILE"
40
-
41
- exit 0
@@ -1,48 +0,0 @@
1
- #!/bin/bash
2
-
3
- # stop hook for Advisor.
4
- # If files changed since the last advisor consult and the turn ended without one,
5
- # ask the agent (once per batch of edits) to run the pre-completion consult.
6
- #
7
- # Input: { "status": "completed"|"aborted"|"error", "loop_count": N, ...common }
8
- # Output: { "followup_message": "<text>" } to continue, or exit 0 with no output
9
-
10
- set -euo pipefail
11
-
12
- source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
13
-
14
- HOOK_INPUT=$(cat)
15
-
16
- advisor_require_enabled
17
- advisor_bind_conversation "$HOOK_INPUT" || exit 0
18
-
19
- STATUS=$(jq -r '.status // empty' <<< "$HOOK_INPUT")
20
- if [[ "$STATUS" != "completed" ]]; then
21
- exit 0
22
- fi
23
-
24
- NUDGE=$(jq -r 'if .nudge == false then "false" else "true" end' "$STATE_FILE")
25
- if [[ "$NUDGE" != "true" ]]; then
26
- exit 0
27
- fi
28
-
29
- if [[ ! -f "$PENDING_FILE" ]]; then
30
- exit 0
31
- fi
32
-
33
- # The agent stopped to ask the user something. Stay quiet and leave the marker
34
- # armed so the reminder fires after the user answers and the work resumes.
35
- if [[ -f "$LAST_RESPONSE_FILE" ]]; then
36
- LAST_CHAR=$(tr -d '[:space:]' < "$LAST_RESPONSE_FILE" | tail -c 1)
37
- if [[ "$LAST_CHAR" == "?" ]]; then
38
- exit 0
39
- fi
40
- fi
41
-
42
- rm -f "$PENDING_FILE"
43
-
44
- MODEL=$(jq -r '.model // "the configured advisor model"' "$STATE_FILE")
45
- MESSAGE="[Advisor] Files changed since the last advisor consult and the turn ended without one. If this work is done, or you were about to declare it done, run the pre-completion consult now per the advisor skill: build the briefing, spawn the \`advisor-subagent\` subagent (model: $MODEL), act on the verdict, and report it in one line. If the change was trivial, or you are waiting on the user, say so in one line and stop."
46
-
47
- jq -n --arg msg "$MESSAGE" '{"followup_message": $msg}'
48
- exit 0
@@ -1,123 +0,0 @@
1
- ---
2
- name: advisor
3
- description: >-
4
- Advisor mode. Consult a stronger (or different) model at key checkpoints:
5
- before major decisions, when stuck on an error, and before declaring a task
6
- done. Use when the user types /advisor, asks to turn the advisor on or off,
7
- picks an advisor model, or explicitly asks for a second opinion from a
8
- stronger or different model. Never enable it on your own.
9
- icon: lightbulb
10
- color: purple
11
- ---
12
-
13
- # Advisor
14
-
15
- You are the main model. Advisor mode adds a second, stronger model that you consult at a few key points. The advisor gets your briefing (and the full transcript when available), thinks hard, and returns a verdict with guidance. It does not edit files. You still do the work and make the final call.
16
-
17
- State lives in `.cursor/advisor/state.json` at the project root. When that file exists with `"enabled": true`, advisor mode is on for this project.
18
-
19
- ## Commands
20
-
21
- The text after `/advisor` selects the action.
22
-
23
- | Input | Action |
24
- | --- | --- |
25
- | `/advisor` | Enable for this conversation with the default advisor: the latest Grok at its highest reasoning effort. If a state file already exists, from this or another conversation, re-bind it here, keeping its `model` and `nudge` settings. |
26
- | `/advisor <model>` | Same, with the given model. Any model available to subagents works: `/advisor cursor-grok-4.6-xhigh-fast`, `/advisor composer-2.5`. |
27
- | `/advisor off` | Disable: delete `.cursor/advisor/`. |
28
- | `/advisor status` | Report model, consult count, and whether the end-of-turn nudge is on. Changes nothing. |
29
- | `/advisor ask <question>` | Consult now about the current work, regardless of checkpoint. |
30
- | `/advisor nudge on` / `off` | Toggle the end-of-turn reminder posted by the plugin's stop hook (default on). |
31
-
32
- If the message also contains a task (`/advisor, then refactor the cache layer`), enable first, then do the task under advisor mode.
33
-
34
- ### Choosing the model
35
-
36
- The default is the latest Grok model at its highest reasoning effort, currently `cursor-grok-4.6-xhigh`. If a newer Grok or a higher effort tier appears in the subagent model list available to you, prefer it and say so.
37
-
38
- For `/advisor <model>`, resolve the request against the subagent model slugs available to you:
39
-
40
- - An exact slug: use it as is.
41
- - A family or version name (`grok fast`, `composer`): that family's latest model at its highest reasoning tier.
42
- - No match: say so, name two or three close options, and keep the current model.
43
-
44
- If the Task tool rejects a slug, read the valid slugs from its error message, pick the closest one (same family, highest reasoning tier), save it to `state.json`, and tell the user in one line. Do not block the consult on the slug.
45
-
46
- ## Enabling
47
-
48
- 1. Resolve the model as described above.
49
- 2. Write `.cursor/advisor/state.json` with the file-writing tool (not a shell redirect), creating the directory if needed. If a state file already exists, carry over its `model` (unless this command names one) and `nudge`, and reset every other field to the values below. You cannot see which conversation an existing file belongs to, so always rewrite it: that re-binds the mode to this conversation, the hooks re-fill `conversation_id` and `transcript_path`, and the next consult starts a fresh advisor instead of resuming another chat's. Also delete `.cursor/advisor/pending` and `.cursor/advisor/last-response.txt` if they exist, so a marker left by another conversation cannot trigger the end-of-turn nudge here. Keep `log.md`.
50
-
51
- ```json
52
- {
53
- "enabled": true,
54
- "model": "cursor-grok-4.6-xhigh",
55
- "nudge": true,
56
- "advisor_agent_id": null,
57
- "conversation_id": null,
58
- "transcript_path": null,
59
- "consults": 0,
60
- "last_consult_at": null,
61
- "enabled_at": "<current UTC time, ISO 8601>"
62
- }
63
- ```
64
-
65
- The plugin's hooks fill in `conversation_id`, `transcript_path`, `consults`, and `last_consult_at`. Leave them alone.
66
- 3. Confirm in one line: `Advisor on: <slug>. I'll consult it before major decisions, when I'm stuck, and before I call the task done.` Then continue with any task in the same message.
67
-
68
- Never stage or commit `.cursor/advisor/`.
69
-
70
- ## Checkpoints
71
-
72
- Consult at these points and nowhere else. Each consult is a strong-model call; the value comes from using it selectively.
73
-
74
- 1. **Before a major decision.** Choosing between architectures or approaches; changes that are hard to reverse or have a wide blast radius (schema or data migrations, deleting or rewriting a module, public API or config format changes, dependency swaps, auth, payments, or other security-sensitive code); or a request that is ambiguous in a way that would change the work materially. Consult once you have a concrete plan and the options in hand, not before you understand the problem. One consult covers the plan; do not re-consult per file.
75
- 2. **When stuck.** The same error or failing test after two genuine fix attempts; behavior you cannot explain from the code; or when you are about to reach for a workaround: a retry loop, a `sleep`, a broad `try/except`, skipping a test, or disabling a check to get past something.
76
- 3. **Before declaring done.** Any task that changed logic or touched more than a couple of files: consult once before writing the final summary, and include what you verified and how. Skip for trivial edits (typos, comments, a one-line config change) and say so in one line.
77
- 4. **On request.** `/advisor ask ...`, or the user asks what the advisor thinks.
78
-
79
- Do not consult for routine steps, for things you can verify yourself (run the test, read the code), or more than once per checkpoint. If you would consult more than about four times in one task, the task should probably be split, or you should ask the user.
80
-
81
- ## How to consult
82
-
83
- 1. Read `.cursor/advisor/state.json` and decide which situation you are in:
84
- - **Mode on here**: the file exists with `enabled: true` and you ran the Enabling steps in this conversation. Checkpoint consults and `/advisor ask` both follow the steps below in full, including `resume` and state writes.
85
- - **Not on here**: the file is missing, `enabled` is false, or you did not write it. A file you did not write belongs to another chat; only `/advisor` re-binds it, so leave it alone and never `resume` an `advisor_agent_id` you did not save yourself. Do not consult at checkpoints. If the user explicitly asks for a consult in this message (`/advisor ask ...`, or a request for a second opinion), run it as a one-off: a fresh spawn on the file's `model` if there is one, otherwise the default; no `resume`, no state writes, and no `transcript_path` (another chat's transcript is not yours to share; write "not available"). Mention that `/advisor` turns the mode on for this conversation.
86
- 2. Build the briefing from `references/briefing-template.md`. Give the advisor everything it needs to disagree with you:
87
- - The user's request verbatim, plus constraints or corrections they added later.
88
- - What has happened so far, in order: what you investigated, decided, changed, tried, and ruled out.
89
- - Relevant tool results verbatim: error messages, stack traces, test output, diffs. Trim unrelated noise and mark trims with `[...]`, but never paraphrase evidence.
90
- - Current state: `git status --short`, `git diff --stat`, files you touched, anything half-done.
91
- - Your specific questions, the options you see, and your current leaning with reasons.
92
- - The `transcript_path` from `state.json` when set and the mode is on in this conversation, so the advisor can read the full conversation itself.
93
- - No secrets. Redact tokens, keys, and `.env` values.
94
- 3. Spawn the advisor in the foreground and wait for it:
95
- - `subagent_type: "advisor-subagent"`
96
- - `model: <state.model>`
97
- - `description: "Advisor: <checkpoint>"`, for example `Advisor: pre-completion review`
98
- - `run_in_background: false`
99
- - When `state.advisor_agent_id` is set, pass it as `resume` and omit `model`; the advisor keeps its model and the context of earlier consults, so the briefing can be a delta: what changed since last time plus the new questions. If the resume fails, spawn fresh.
100
- - Save the returned agent id to `advisor_agent_id` in `state.json`. Clear it when the model changes.
101
- 4. Act on the verdict:
102
- - `proceed`: go.
103
- - `proceed with changes`: make the recommended changes unless they conflict with the user's instructions or facts you have verified. Say which you skipped and why.
104
- - `stop`: do not continue with the plan. Rethink, or bring the disagreement to the user if it is a product or scope question.
105
- - If the advisor asks for something it needs, provide it via `resume`, once. Do not ping-pong.
106
- - You are accountable for the result. The advisor is a strong second opinion, not an authority. If it is wrong about the codebase, show it the evidence once, or overrule it and tell the user why.
107
- 5. Report each consult to the user in one or two lines: `Advisor (<model>): <verdict>. <One-line summary>. <What you did about it.>` Keep the advisor's full response out of the chat unless the user asks; the hooks also append it to `.cursor/advisor/log.md`.
108
-
109
- ## End-of-turn nudge
110
-
111
- When files changed since the last consult and a turn ends without one, the plugin's `stop` hook posts a follow-up that starts with `[Advisor]`. Treat it as the "before declaring done" checkpoint: run the pre-completion consult, or answer in one line that the change was trivial, or that you are waiting on the user, and stop. It fires at most once per batch of edits. `/advisor nudge off` disables it.
112
-
113
- ## Disabling
114
-
115
- `/advisor off`: delete `.cursor/advisor/` and confirm in one line. Do not consult again in this conversation unless the user re-enables the mode or explicitly asks for a one-off consult.
116
-
117
- ## Guardrails
118
-
119
- - Never enable advisor mode unasked. "Get a second opinion on this" is a one-off consult, not a mode change.
120
- - The advisor is read-only. Never ask it to edit files or do the task.
121
- - Never loop on the advisor: at most one follow-up per checkpoint.
122
- - If the `advisor-subagent` subagent is unavailable (no Task tool, or a hook denies it), tell the user once and continue without it.
123
- - To keep this skill in context for a whole session rather than one message, the user can invoke `/advisor` as a Custom Mode (Option+Enter / Alt+Enter). The state file works either way.
@@ -1,44 +0,0 @@
1
- # Advisor briefing
2
-
3
- Fill every section. Quote evidence verbatim; summarize only narrative. Redact secrets. When resuming an earlier advisor, keep the headings but write only what changed since the last consult, plus the new questions.
4
-
5
- ```markdown
6
- ## Checkpoint
7
-
8
- <major decision | stuck | pre-completion | on request> — <one line on why now>
9
-
10
- ## User's request
11
-
12
- <the original request, verbatim>
13
-
14
- <later constraints or corrections from the user, verbatim, in order>
15
-
16
- ## What has happened so far
17
-
18
- <chronological and compact: what you investigated, decided, changed, tried, and ruled out, with the reason for each>
19
-
20
- ## Evidence
21
-
22
- <verbatim tool output relevant to this checkpoint: errors, stack traces, test output, command output, the relevant diff hunks. Trim unrelated noise and mark trims with [...]>
23
-
24
- ## Current state
25
-
26
- <`git status --short` and `git diff --stat` output; files touched; anything half-done>
27
-
28
- ## Questions for the advisor
29
-
30
- 1. <specific question>
31
- 2. ...
32
-
33
- <For a decision: the options with the tradeoffs as you see them, and your current leaning with reasons.
34
- For stuck: what you expected vs. what you observed, and the hypotheses you have ruled out.
35
- For pre-completion: what you verified and how, and what you did not verify.>
36
-
37
- ## What I need back
38
-
39
- <for example: "a verdict and the single best next step", "confirm or refute hypothesis 2", "anything I missed before I call this done">
40
-
41
- ## Full transcript
42
-
43
- <`transcript_path` from `.cursor/advisor/state.json` when advisor mode is on in this conversation; otherwise "not available">
44
- ```
@@ -1,45 +0,0 @@
1
- {
2
- "name": "github",
3
- "displayName": "GitHub",
4
- "version": "1.0.0",
5
- "minClientVersions": {
6
- "cursor": "3.13.0"
7
- },
8
- "description": "Manage repos, issues, pull requests, and Actions.",
9
- "author": {
10
- "name": "Cursor",
11
- "email": "plugins@cursor.com"
12
- },
13
- "homepage": "https://docs.github.com/en/copilot/how-tos/context/use-mcp/use-the-github-mcp-server",
14
- "repository": "https://github.com/cursor/plugins",
15
- "license": "MIT",
16
- "logo": "assets/logo.svg",
17
- "keywords": [
18
- "github",
19
- "git",
20
- "repositories",
21
- "pull-requests",
22
- "issues",
23
- "actions",
24
- "mcp"
25
- ],
26
- "category": "integrations",
27
- "tags": [
28
- "github",
29
- "git",
30
- "mcp",
31
- "repositories"
32
- ],
33
- "variables": {
34
- "type": "object",
35
- "properties": {
36
- "GITHUB_PERSONAL_ACCESS_TOKEN": {
37
- "type": "string",
38
- "title": "GitHub personal access token",
39
- "description": "Fine-grained or classic PAT from https://github.com/settings/tokens with the repo scopes you want the agent to use."
40
- }
41
- },
42
- "required": ["GITHUB_PERSONAL_ACCESS_TOKEN"]
43
- },
44
- "mcpServers": "./mcp.json"
45
- }
@@ -1,9 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this plugin will be documented here.
4
-
5
- ## 1.0.0 — initial release
6
-
7
- - Logo: GitHub's official Octocat mark, on a padded white tile.
8
- - Added the `github` MCP server pointing at `https://api.githubcopilot.com/mcp/`.
9
- - Declared `GITHUB_PERSONAL_ACCESS_TOKEN` plugin variable and forwarded it through the Authorization header.
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Cursor
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.