@brainervirus/workit-cursor 0.4.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.
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "workit",
3
+ "displayName": "Workit",
4
+ "description": "OpenCode-style verify, PR, changelog, commit, and session handoff for Cursor",
5
+ "version": "0.4.0",
6
+ "skills": "../skills/",
7
+ "rules": "../rules/",
8
+ "mcpServers": "../mcp.json",
9
+ "hooks": "../hooks/hooks-cursor.json"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "sessionStart": [
5
+ {
6
+ "command": "./hooks/session-start"
7
+ }
8
+ ]
9
+ }
10
+ }
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env bash
2
+ # sessionStart — auto-sync toolkit, then inject Superpowers workflow contract
3
+ set -euo pipefail
4
+
5
+ SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
6
+ PLUGIN_DIR="$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)"
7
+ MARKER="${PLUGIN_DIR}/.workflow-toolkit-root"
8
+ SHARE="${HOME}/.local/share/workflow-toolkit"
9
+ if [ -n "${WORKFLOW_TOOLKIT_ROOT:-}" ] && [ -d "${WORKFLOW_TOOLKIT_ROOT}/templates" ]; then
10
+ REPO_ROOT="$WORKFLOW_TOOLKIT_ROOT"
11
+ elif [ -f "$MARKER" ]; then
12
+ REPO_ROOT="$(tr -d '\n' <"$MARKER")"
13
+ elif [ -d "${SHARE}/packages/workit-core/templates" ]; then
14
+ REPO_ROOT="$SHARE/packages/workit-core"
15
+ else
16
+ # Live monorepo: workit-cursor/hooks → packages/workit-core (workspace sibling)
17
+ REPO_ROOT="$(CDPATH= cd -- "$SCRIPT_DIR/../../workit-core" && pwd)"
18
+ fi
19
+
20
+ # ponytail: best-effort auto-update; never block session start on network
21
+ SYNC="${REPO_ROOT}/scripts/sync-runtime.sh"
22
+ if [ -x "$SYNC" ]; then
23
+ timeout 20s "$SYNC" >/dev/null 2>&1 || true
24
+ if [ -f "$MARKER" ]; then
25
+ REPO_ROOT="$(tr -d '\n' <"$MARKER")"
26
+ elif [ -d "${SHARE}/packages/workit-core/templates" ]; then
27
+ REPO_ROOT="$SHARE/packages/workit-core"
28
+ fi
29
+ fi
30
+
31
+ CONTRACT="${REPO_ROOT}/templates/superpowers-doc-contract.md"
32
+
33
+ if [ ! -f "$CONTRACT" ]; then
34
+ printf '{}\n'
35
+ exit 0
36
+ fi
37
+
38
+ escape_for_json() {
39
+ local s="$1"
40
+ s="${s//\\/\\\\}"
41
+ s="${s//\"/\\\"}"
42
+ s="${s//$'\n'/\\n}"
43
+ s="${s//$'\r'/\\r}"
44
+ s="${s//$'\t'/\\t}"
45
+ printf '%s' "$s"
46
+ }
47
+
48
+ body=$(<"$CONTRACT")
49
+ context=$'<workflow-toolkit-askquestion-hard-gate>\nHARD-GATE: Any user choice with options → call Cursor AskQuestion directly with workflow-specific copy. NEVER A/B/C in chat. Overrides Superpowers brainstorming conversational options.\n</workflow-toolkit-askquestion-hard-gate>\n\n<workflow-toolkit-visual-companion>\nHARD-GATE: NEVER offer Superpowers visual companion or open a browser tab. For UI wireframes use workflow_present_ascii; for flows use workflow_present_flow. Overrides Superpowers brainstorming visual companion offer.\n</workflow-toolkit-visual-companion>\n\n<workflow-toolkit-no-worktrees>\nHARD-GATE: NEVER using-git-worktrees or git worktree. In-place feature/* or bugfix/* checkout only via workflow_resolve_branch + workflow_branch_setup. Dirty tree → native AskQuestion before checkout.\n</workflow-toolkit-no-worktrees>\n\n<workflow-toolkit-sdd-path>\nHARD-GATE: NEVER .superpowers/sdd. ALWAYS workflow_sdd_context with plan_path first — creates docs/<slug>/sdd/ even on fresh projects. workflow_sdd_task_brief, workflow_sdd_review_package, workflow_sdd_append_progress only.\n</workflow-toolkit-sdd-path>\n\n<workflow-toolkit-todowrite>\nHARD-GATE: After workflow_sdd_context, call Cursor TodoWrite with returned todos (merge: false). SDD ledger is persistence — TodoWrite is the native task list UI. Keep in_progress/completed in sync each task.\n</workflow-toolkit-todowrite>\n\n<workflow-toolkit-superpowers-doc-contract>\n'"${body}"$'\n</workflow-toolkit-superpowers-doc-contract>\n\n<workflow-toolkit-reminder>\nHARD-GATE: Bounded user choices → call Cursor AskQuestion directly (never A/B/C or 1/2/3 lists in prose). After a plan is approved → AskQuestion menu with: Subagent-driven, Inline, Handoff (new session only), Review spec first, Review plan first. Tools with confirmed → call them; never fabricate results.\nDelivering docs → clickable markdown link (docs/<slug>/spec.md) + 3-5 bullet summary.\n</workflow-toolkit-reminder>'
50
+ escaped=$(escape_for_json "$context")
51
+
52
+ printf '{\n "additional_context": "%s"\n}\n' "$escaped"
53
+ exit 0
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "workit",
3
+ "displayName": "Workflow Toolkit",
4
+ "description": "Workflow rails for agentic coding: specs, plans, YouTrack, CI-gated commits",
5
+ "publisher": "cristhofer-pincetti",
6
+ "version": "0.4.0",
7
+ "homepage": "https://github.com/BrainerVirus/workflow-toolkit",
8
+ "repository": "https://github.com/BrainerVirus/workflow-toolkit.git",
9
+ "license": "MIT"
10
+ }
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env bash
2
+ # Resolve the core package root for Cursor MCP (install copy vs live monorepo).
3
+ set -euo pipefail
4
+
5
+ MCP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
6
+ PLUGIN_DIR="$(CDPATH= cd -- "$MCP_DIR/.." && pwd)"
7
+ MARKER="${PLUGIN_DIR}/.workflow-toolkit-root"
8
+ # ponytail: config-stability alias — the installed share keeps the legacy
9
+ # workflow-toolkit path (existing installs); "workit" is the package/brand name.
10
+ SHARE="${HOME}/.local/share/workflow-toolkit"
11
+
12
+ if [ -n "${WORKFLOW_TOOLKIT_ROOT:-}" ] && [ -d "${WORKFLOW_TOOLKIT_ROOT}/scripts" ]; then
13
+ ROOT="$WORKFLOW_TOOLKIT_ROOT"
14
+ elif [ -f "$MARKER" ]; then
15
+ ROOT="$(tr -d '\n' <"$MARKER")"
16
+ elif [ -d "${SHARE}/packages/workit-core/scripts" ]; then
17
+ ROOT="$SHARE/packages/workit-core"
18
+ else
19
+ # Live monorepo: workit-cursor/mcp → packages/workit-core (workspace sibling)
20
+ ROOT="$(CDPATH= cd -- "$MCP_DIR/../../workit-core" && pwd)"
21
+ fi
22
+
23
+ export WORKFLOW_TOOLKIT_ROOT="$ROOT"
24
+ if [ "${1:-}" != "" ]; then
25
+ export WORKFLOW_WORKSPACE_ROOT="$1"
26
+ fi
27
+
28
+ BUN_BIN="${BUN:-}"
29
+ if [ -z "$BUN_BIN" ]; then
30
+ for candidate in "$HOME/.bun/bin/bun" /usr/local/bin/bun /usr/bin/bun; do
31
+ [ -x "$candidate" ] && BUN_BIN="$candidate" && break
32
+ done
33
+ fi
34
+ if [ -z "$BUN_BIN" ]; then
35
+ echo "workit: bun not found (required for MCP server)" >&2
36
+ exit 1
37
+ fi
38
+ # Execute the server next to this script: server.ts imports @brainervirus/workit-core,
39
+ # resolved via node_modules (workspace link in the monorepo, npm install in the
40
+ # cursor plugin copy). Make the resolved bun visible to child scripts that exec
41
+ # bare `bun` (the port wrappers) when it lives outside PATH (e.g. ~/.bun/bin).
42
+ export PATH="$(dirname "$BUN_BIN"):$PATH"
43
+ exec "$BUN_BIN" "$MCP_DIR/server.ts"