caruso 0.7.6 → 0.7.7
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.
- checksums.yaml +4 -4
- data/AGENTS.md +8 -12
- data/lib/caruso/adapters/command_adapter.rb +5 -10
- data/lib/caruso/scripts/cc_stop_wrapper.sh +25 -10
- data/lib/caruso/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af75d0db21770fa0559c36964cbca4cd51e80f8c96eb8097a1d41f0281ce70e3
|
|
4
|
+
data.tar.gz: 12bff57c9d9891b5abc54d2d2dd4a854ceb34faf8e3c5ad026ac3c51a0705944
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cadbe6b5022e9ae58c79d8cf3fdc9750e71f10f3d6c90f920fbb3e2be18da127977e14d725a4b36ec629cfc69008cd4c8a58203492f6748185557bf0f3567fe3
|
|
7
|
+
data.tar.gz: 616a955c75e3c1e4aff04a18f282248dbf677d01ce85be4f224db2e6b08418e59fcd4b1ba9db0dda8f485e8f9684b127153f0df44c917571683c782cb45f697b
|
data/AGENTS.md
CHANGED
|
@@ -6,21 +6,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
6
6
|
|
|
7
7
|
Caruso is a Ruby gem CLI that bridges the gap between AI coding assistants. It fetches "steering documentation" (commands, agents, skills) from Claude Code Marketplaces and converts them to formats compatible with other IDEs, currently Cursor.
|
|
8
8
|
|
|
9
|
-
## Source of Truth:
|
|
9
|
+
## Source of Truth: Official Documentation
|
|
10
10
|
|
|
11
|
-
**IMPORTANT:** The
|
|
11
|
+
**IMPORTANT:** The authoritative sources for Claude Code and Cursor specifications are the official docs. Reference links are in `/Users/philipp/code/caruso/reference/`:
|
|
12
12
|
|
|
13
|
-
- `
|
|
14
|
-
- `
|
|
15
|
-
- `plugins_reference.md` - Component configuration fields and metadata
|
|
13
|
+
- `claude_code.md` - Links to official Claude Code docs (hooks, plugins, marketplaces, skills)
|
|
14
|
+
- `cursor.md` - Links to official Cursor docs (hooks, modes, rules, commands)
|
|
16
15
|
|
|
17
|
-
**
|
|
18
|
-
- Marketplace.json schema and plugin metadata format
|
|
19
|
-
- Component configuration fields (`commands`, `agents`, `skills`, `hooks`, `mcpServers`)
|
|
20
|
-
- Expected directory structures and file patterns
|
|
21
|
-
- Metadata requirements and validation rules
|
|
22
|
-
|
|
23
|
-
When implementing features or fixing bugs related to marketplace compatibility, **always consult these reference files first**. If the implementation conflicts with the reference docs, the reference docs are correct and the code should be updated to match.
|
|
16
|
+
When implementing features or fixing bugs, **always fetch the latest docs from these official URLs**. If the implementation conflicts with the official docs, the docs are correct and the code should be updated to match.
|
|
24
17
|
|
|
25
18
|
## Development Commands
|
|
26
19
|
|
|
@@ -271,6 +264,9 @@ Results are deduplicated with `.uniq`.
|
|
|
271
264
|
|
|
272
265
|
Version is managed in `lib/caruso/version.rb`.
|
|
273
266
|
|
|
267
|
+
# Rules
|
|
268
|
+
- **NEVER force-push.** No `git push --force`, `git push --force-with-lease`, or `git push origin <tag> --force`. If a tag or commit was pushed wrong, fix forward with a new version.
|
|
269
|
+
|
|
274
270
|
# Memory
|
|
275
271
|
- The goal is a clean, correct, consistent implementation. Never implement fallbacks that hide errors or engage in defensive programming.
|
|
276
272
|
- **Idempotency**: Removal commands (`marketplace remove`, `plugin uninstall`) are designed to be idempotent. They exit successfully (0) if the target does not exist. This is intentional for automation friendliness and is NOT considered "hiding errors".
|
|
@@ -40,9 +40,9 @@ module Caruso
|
|
|
40
40
|
# We don't need globs or alwaysApply (those are for rules)
|
|
41
41
|
# Just return content as-is, Claude Code commands are already compatible
|
|
42
42
|
|
|
43
|
-
#
|
|
43
|
+
# Convert ```! auto-execute blocks to ```bash with run instruction
|
|
44
44
|
if content.include?("`!")
|
|
45
|
-
|
|
45
|
+
convert_auto_execute_blocks(content)
|
|
46
46
|
else
|
|
47
47
|
content
|
|
48
48
|
end
|
|
@@ -57,14 +57,9 @@ module Caruso
|
|
|
57
57
|
YAML
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
def
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
note = "\n**Note:** This command originally used Claude Code's `!` prefix for bash execution. " \
|
|
65
|
-
"Cursor does not support this feature. The bash commands are documented below for reference.\n"
|
|
66
|
-
|
|
67
|
-
"---\n#{match[1]}\n---\n#{note}#{match.post_match}"
|
|
60
|
+
def convert_auto_execute_blocks(content)
|
|
61
|
+
# Replace ```! with ```bash and add instruction to run
|
|
62
|
+
content.gsub("```!\n", "```bash\n")
|
|
68
63
|
end
|
|
69
64
|
|
|
70
65
|
def save_command_file(relative_path, content)
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Translates Claude Code stop hook
|
|
2
|
+
# Translates Claude Code stop hook I/O to Cursor format.
|
|
3
3
|
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
4
|
+
# INPUT translation (stdin):
|
|
5
|
+
# Cursor may pass transcript_path: null. CC hooks that read the transcript
|
|
6
|
+
# would bail out. We provide a minimal dummy transcript so the hook can
|
|
7
|
+
# proceed past transcript gates (completion promise won't match, but the
|
|
8
|
+
# core loop/block logic still works).
|
|
8
9
|
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
10
|
+
# OUTPUT translation (stdout):
|
|
11
|
+
# CC: exit 2 + stderr reason -> block
|
|
12
|
+
# CC: exit 0 + {"decision":"block","reason":"..."} -> block
|
|
13
|
+
# Cursor: exit 0 + {"followup_message":"..."} -> continue with message
|
|
14
|
+
# Cursor: exit 0 + no output -> allow stop
|
|
12
15
|
#
|
|
13
16
|
# Usage: cc_stop_wrapper.sh <original-script> [args...]
|
|
14
17
|
|
|
@@ -18,9 +21,21 @@ SCRIPT="$1"
|
|
|
18
21
|
shift
|
|
19
22
|
|
|
20
23
|
STDERR_TMP=$(mktemp) || exit 1
|
|
21
|
-
|
|
24
|
+
FAKE_TRANSCRIPT=""
|
|
25
|
+
trap 'rm -f "$STDERR_TMP" "$FAKE_TRANSCRIPT"' EXIT
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
# Read and patch stdin: ensure transcript_path points to a readable file
|
|
28
|
+
INPUT=$(cat)
|
|
29
|
+
if [ -n "$INPUT" ] && command -v jq >/dev/null 2>&1; then
|
|
30
|
+
TP=$(echo "$INPUT" | jq -r '.transcript_path // empty' 2>/dev/null)
|
|
31
|
+
if [ -z "$TP" ] || [ "$TP" = "null" ] || [ ! -f "$TP" ]; then
|
|
32
|
+
FAKE_TRANSCRIPT=$(mktemp) || exit 1
|
|
33
|
+
echo '{"role":"assistant","message":{"content":[{"type":"text","text":""}]}}' > "$FAKE_TRANSCRIPT"
|
|
34
|
+
INPUT=$(echo "$INPUT" | jq --arg tp "$FAKE_TRANSCRIPT" '.transcript_path = $tp')
|
|
35
|
+
fi
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
OUTPUT=$(echo "$INPUT" | "$SCRIPT" "$@" 2>"$STDERR_TMP")
|
|
24
39
|
EXIT_CODE=$?
|
|
25
40
|
|
|
26
41
|
# CC exit 2 = block with stderr reason
|
data/lib/caruso/version.rb
CHANGED