setup-cc-room 0.2.1 → 0.2.2

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,149 @@
1
+ ---
2
+ name: show
3
+ description: Explicit whiteboard posts and sharing of skills, commands, or CLAUDE.md. Use /private for local/public toggle.
4
+ ---
5
+
6
+ Write explicitly to the room whiteboard. **Use `/private` to toggle local/public** (the old `/show` toggle is removed).
7
+
8
+ ## Resolve the port
9
+
10
+ Before every HTTP request, resolve the port:
11
+
12
+ ```bash
13
+ CC_ROOM_HOME="${CC_ROOM_HOME:-$HOME/.cc-room}"
14
+ HTTP_PORT=$(grep 'http_port:' "$CC_ROOM_HOME/config.yaml" 2>/dev/null | awk '{print $2}' | tr -d '[:space:]')
15
+ HTTP_PORT="${HTTP_PORT:-7332}"
16
+ BASE_URL="http://127.0.0.1:$HTTP_PORT"
17
+ ```
18
+
19
+ ## Subcommands
20
+
21
+ ### `/show` (no args) — deprecated
22
+
23
+ The old toggle is removed. Guide the user:
24
+
25
+ ```
26
+ Use /private to toggle local/public:
27
+ /private on — local mode (hide work)
28
+ /private off — back to public (choose share/drop for pending work)
29
+ To post a message, use /show "message".
30
+ ```
31
+
32
+ ### `/show <message>` — post a message
33
+
34
+ Post to the **Primary** room whiteboard.
35
+
36
+ 1. Check `private` via `GET $BASE_URL/status`.
37
+ 2. If Private ON, always confirm with the user:
38
+ "You are in local mode. This message will be posted to Primary (<primary_room_name>). Send it?"
39
+ → Continue only if they accept.
40
+ 3. `POST $BASE_URL/share` with:
41
+ ```json
42
+ { "message": "<message>" }
43
+ ```
44
+ (Posted to Primary only.)
45
+ 4. On success:
46
+ ```
47
+ 📡 [<room_name>] <message>
48
+ ```
49
+
50
+ ### `/show skill <name>` — share a skill
51
+
52
+ Share your skill file with everyone in the room (recipients must accept).
53
+
54
+ 1. Resolve the port (above).
55
+ 2. Load the skill file:
56
+ ```bash
57
+ SKILL_NAME="<name>"
58
+ SKILL_BASE="${SKILL_NAME%.md}"
59
+ SKILL_FILE=""
60
+ CC_CLAUDE_HOME="${CC_CLAUDE_HOME:-$HOME/.claude}"
61
+ for dir in "$CC_CLAUDE_HOME/skills" "$CC_CLAUDE_HOME/commands"; do
62
+ if [ -f "$dir/$SKILL_BASE.md" ]; then
63
+ SKILL_FILE="$dir/$SKILL_BASE.md"
64
+ break
65
+ elif [ -f "$dir/$SKILL_BASE" ]; then
66
+ SKILL_FILE="$dir/$SKILL_BASE"
67
+ break
68
+ fi
69
+ done
70
+ if [ -z "$SKILL_FILE" ]; then
71
+ echo "Error: skill '$SKILL_NAME' not found"
72
+ exit 1
73
+ fi
74
+ SKILL_CONTENT=$(cat "$SKILL_FILE")
75
+ ```
76
+ 3. `POST $BASE_URL/show/file` with:
77
+ ```json
78
+ { "share_type": "skill", "filename": "<name>.md", "content": "<file_content>" }
79
+ ```
80
+ 4. On success:
81
+ ```
82
+ 📤 Shared skill '<name>' (recipients must approve with /room accept)
83
+ ```
84
+
85
+ ### `/show command <name>` — share a command
86
+
87
+ Share your command file with everyone in the room (recipients must accept).
88
+
89
+ 1. Resolve the port (above).
90
+ 2. Load the command file:
91
+ ```bash
92
+ CMD_NAME="<name>"
93
+ CMD_BASE="${CMD_NAME%.md}"
94
+ CMD_FILE=""
95
+ for dir in "$HOME/.claude/commands"; do
96
+ if [ -f "$dir/$CMD_BASE.md" ]; then CMD_FILE="$dir/$CMD_BASE.md"; break; fi
97
+ done
98
+ if [ -z "$CMD_FILE" ]; then
99
+ echo "Error: command '$CMD_NAME' not found"
100
+ exit 1
101
+ fi
102
+ CMD_CONTENT=$(cat "$CMD_FILE")
103
+ ```
104
+ 3. `POST $BASE_URL/show/file` with:
105
+ ```json
106
+ { "share_type": "command", "filename": "<name>.md", "content": "<file_content>" }
107
+ ```
108
+ 4. On success:
109
+ ```
110
+ 📤 Shared command '<name>' (recipients must approve with /room accept)
111
+ ```
112
+
113
+ ### `/show claude-md` — share CLAUDE.md
114
+
115
+ Share this project's CLAUDE.md with the room (after accept it is saved room-scoped; promote globally with `/room adopt`).
116
+
117
+ 1. Resolve the port (above).
118
+ 2. Load CLAUDE.md from the current directory:
119
+ ```bash
120
+ CLAUDE_MD_FILE="$(pwd)/CLAUDE.md"
121
+ if [ ! -f "$CLAUDE_MD_FILE" ]; then
122
+ GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
123
+ if [ -n "$GIT_ROOT" ] && [ -f "$GIT_ROOT/CLAUDE.md" ]; then
124
+ CLAUDE_MD_FILE="$GIT_ROOT/CLAUDE.md"
125
+ else
126
+ echo "Error: CLAUDE.md not found"
127
+ exit 1
128
+ fi
129
+ fi
130
+ CLAUDE_MD_CONTENT=$(cat "$CLAUDE_MD_FILE")
131
+ ```
132
+ 3. `POST $BASE_URL/show/file` with:
133
+ ```json
134
+ { "share_type": "claude_md", "filename": "CLAUDE.md", "content": "<file_content>" }
135
+ ```
136
+ 4. On success:
137
+ ```
138
+ 📤 Shared CLAUDE.md (recipients approve with /room accept; saved room-scoped)
139
+ Use /room adopt to promote to ~/.claude/CLAUDE.md
140
+ ```
141
+
142
+ ## Errors
143
+
144
+ - If the daemon is not running:
145
+ "cc-room daemon is not running."
146
+ - If not in a room:
147
+ "You are not in a room. Use `/room open` or `/room join` first."
148
+ - If there is no Primary room:
149
+ "Pick a room to write with `/room switch <name>`."
File without changes
File without changes