@windyroad/connect 0.3.0-preview.41 → 0.3.1-preview.43

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 (2) hide show
  1. package/package.json +1 -1
  2. package/skills/setup/SKILL.md +204 -139
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/connect",
3
- "version": "0.3.0-preview.41",
3
+ "version": "0.3.1-preview.43",
4
4
  "description": "Connect Claude Code sessions across repos via Discord (experimental)",
5
5
  "bin": {
6
6
  "windyroad-connect": "./bin/install.mjs"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wr-connect:setup
3
- description: Set up cross-repo collaboration via Discord. Interactive walkthrough with explicit opt-out before any configuration.
3
+ description: Set up cross-repo collaboration via Discord. Step-by-step interactive walkthrough with explicit opt-out before any configuration.
4
4
  allowed-tools: Read, Bash, Glob, Grep, AskUserQuestion
5
5
  ---
6
6
 
@@ -12,225 +12,290 @@ allowed-tools: Read, Bash, Glob, Grep, AskUserQuestion
12
12
  This skill configures Discord as a collaboration channel so Claude Code sessions
13
13
  across different repos can communicate with zero idle token cost.
14
14
 
15
- **This is an interactive walkthrough.** Use AskUserQuestion at each step to confirm
16
- progress and gather details. Do NOT skip ahead wait for the user at each checkpoint.
15
+ **CRITICAL: Walk the user through ONE action at a time.** Never give a list of
16
+ multiple actions and ask "done?" at the end. After EACH action, pause with
17
+ AskUserQuestion (or plain prompt if unavailable) and wait for confirmation before
18
+ giving the next instruction. If any step has sub-steps, treat each sub-step as
19
+ its own checkpoint.
17
20
 
18
- **Important:** Each repo should have its own Discord bot so sessions are
19
- distinguishable in Discord. The bot name defaults to the org/repo from git remote.
21
+ **Each repo should have its own Discord bot** so sessions are distinguishable
22
+ in Discord. The bot name defaults to the org/repo from git remote.
20
23
 
21
- ## Steps
24
+ ## Walkthrough
22
25
 
23
- ### 1. Explain and opt-in
26
+ ### Stage 1: Opt-in
24
27
 
25
28
  Tell the user:
26
29
 
27
30
  > This plugin connects your Claude Code sessions across repos so they can
28
- > collaborate. For example, if Session A discovers a bug in a package from repo-b,
29
- > it can notify Session B (which is working on repo-b) without Session B polling or
30
- > wasting tokens. Sessions can hand off findings, ask questions, share context, or
31
- > coordinate work.
31
+ > collaborate. Sessions can hand off findings, ask questions, share context,
32
+ > or coordinate work all via a shared Discord channel with zero idle token cost.
32
33
  >
33
34
  > Each repo gets its own Discord bot (so you can tell sessions apart in Discord).
34
- > You will need:
35
- > - A Discord account
36
- > - A Discord server with a channel for agent collaboration
37
- > - A few minutes to create a bot in the Discord Developer Portal
35
+ > You will need a Discord account, a Discord server, and a few minutes to create
36
+ > a bot in the Discord Developer Portal.
38
37
 
39
- Use AskUserQuestion:
40
- - "Would you like to proceed with setting up cross-repo collaboration via Discord?"
41
- - Options: "Yes, let's set it up" / "No, skip for now"
38
+ **Checkpoint 1a:** Would you like to proceed?
39
+ - yes continue to Stage 2
40
+ - no stop and tell the user: "Setup skipped. Run `/wr-connect:setup` any time to start."
42
41
 
43
- If no:
44
- > Setup skipped. The connect plugin is inactive until configured.
45
- > Run `/wr-connect:setup` any time to start again.
46
-
47
- Stop — do not proceed.
48
-
49
- ### 2. Detect bot name
50
-
51
- Detect the org/repo from git remote to suggest a bot name:
42
+ ### Stage 2: Bot name
52
43
 
44
+ Detect the bot name from git remote:
53
45
  ```bash
54
46
  git remote get-url origin 2>/dev/null | sed 's|.*github.com[:/]||;s|\.git$||' | tr '/' '-'
55
47
  ```
56
48
 
57
- If no remote is found, use the directory name as a fallback.
49
+ If no remote, use the directory name.
50
+
51
+ **Checkpoint 2a:** Confirm the bot name.
52
+ > Detected bot name: `<detected-name>`. This is how the bot will appear in Discord.
53
+ - Use this name → continue
54
+ - Different name → ask what they want, then confirm and continue
55
+
56
+ ### Stage 3: Discord server
57
+
58
+ **Checkpoint 3a:** Do you have a Discord server for agent collaboration?
59
+ - yes → continue to Stage 4
60
+ - no → go to Stage 3b
61
+
62
+ **Stage 3b: Create server** (only if needed)
63
+
64
+ One action at a time:
65
+
66
+ **Checkpoint 3b.1:** Open Discord.
67
+ > Open the Discord desktop or web app.
68
+
69
+ Wait for confirmation.
70
+
71
+ **Checkpoint 3b.2:** Create the server.
72
+ > Click the **+** button in the server list on the left.
73
+
74
+ Wait for confirmation.
75
+
76
+ **Checkpoint 3b.3:** Choose type.
77
+ > Choose **Create My Own** > **For me and my friends**.
78
+
79
+ Wait for confirmation.
80
+
81
+ **Checkpoint 3b.4:** Name it.
82
+ > Name it something like `dev-agents` or whatever you prefer.
83
+
84
+ Wait for confirmation. Then continue to Stage 4.
85
+
86
+ ### Stage 4: Create the Discord application
87
+
88
+ One action at a time. After each instruction, wait for confirmation.
89
+
90
+ **Checkpoint 4a:** Open Developer Portal.
91
+ > Go to https://discord.com/developers/applications in your browser.
92
+
93
+ Wait for confirmation.
94
+
95
+ **Checkpoint 4b:** Create application.
96
+ > Click **New Application**. Name it `<detected-bot-name>`. Accept the terms and click **Create**.
97
+
98
+ Wait for confirmation.
99
+
100
+ **Checkpoint 4c:** Open the Bot section.
101
+ > In the left sidebar, click **Bot**.
102
+
103
+ Wait for confirmation.
104
+
105
+ **Checkpoint 4d:** Set the bot username.
106
+ > Set the bot's username to `<detected-bot-name>` (same as the application name).
107
+ > Save changes.
108
+
109
+ Wait for confirmation.
110
+
111
+ **Checkpoint 4e:** Reset and copy the token.
112
+ > Scroll up to the **Token** section. Click **Reset Token** and confirm.
113
+ > Copy the token that appears — **it's only shown once**. Save it somewhere safe
114
+ > for the next step.
115
+
116
+ Wait for confirmation.
117
+
118
+ **Checkpoint 4f:** Enable Message Content Intent.
119
+ > Scroll down to **Privileged Gateway Intents**. Enable **Message Content Intent**.
120
+ > Save changes.
58
121
 
59
- Use AskUserQuestion:
60
- - "What should the Discord bot be called? This name will appear in Discord when this session sends messages."
61
- - Options: "<detected-name>" (e.g., "windyroad-agent-plugins") / "I want a different name"
122
+ Wait for confirmation.
62
123
 
63
- ### 3. Check for existing Discord server
124
+ ### Stage 5: Invite the bot
64
125
 
65
- Use AskUserQuestion:
66
- - "Do you already have a Discord server for agent collaboration, or do you need to create one?"
67
- - Options: "I have a server" / "I need to create one"
126
+ **Checkpoint 5a:** Open OAuth2 URL Generator.
127
+ > In the left sidebar, click **OAuth2** > **URL Generator**.
68
128
 
69
- If they need to create one, guide them:
70
- 1. Open Discord and click the **+** button in the server list
71
- 2. Choose **Create My Own** > **For me and my friends**
72
- 3. Name it something like `dev-agents`
73
- 4. Create a private channel (e.g., `#agent-collab`)
129
+ Wait for confirmation.
74
130
 
75
- ### 4. Create a Discord bot
131
+ **Checkpoint 5b:** Select scopes.
132
+ > Under **Scopes**, check `bot`.
76
133
 
77
- Tell the user to go to https://discord.com/developers/applications:
134
+ Wait for confirmation.
78
135
 
79
- **Instructions:**
80
- 1. Click **New Application** name it `<detected-bot-name>` from step 2
81
- 2. Go to **Bot** in the sidebar. Give the bot the same username.
82
- 3. Under **Token**, click **Reset Token** and copy the token (shown once).
83
- 4. Under **Privileged Gateway Intents**, enable:
84
- - **Message Content Intent** (to read message text)
85
- 5. Go to **OAuth2 > URL Generator**:
86
- - Scopes: `bot`
87
- - Bot permissions: `View Channels`, `Send Messages`, `Send Messages in Threads`,
88
- `Read Message History`, `Attach Files`, `Add Reactions`
89
- - Integration type: **Guild Install**
90
- 6. Copy the generated URL, open it in a browser, and add the bot to your server
136
+ **Checkpoint 5c:** Select bot permissions.
137
+ > Under **Bot Permissions**, check: `View Channels`, `Send Messages`,
138
+ > `Send Messages in Threads`, `Read Message History`, `Attach Files`, `Add Reactions`.
91
139
 
92
- Use AskUserQuestion:
93
- - "Have you created the bot and copied the token?"
94
- - Options: "Yes, I have the token" / "I need help with a step"
140
+ Wait for confirmation.
95
141
 
96
- If they need help, ask which step is unclear.
142
+ **Checkpoint 5d:** Set integration type.
143
+ > Set **Integration Type** to **Guild Install**.
97
144
 
98
- ### 5. Configure the Discord plugin with the token
145
+ Wait for confirmation.
99
146
 
100
- Tell the user to run the following command. **Do NOT paste the token yourself** —
101
- the user should type it directly to avoid the token appearing in conversation history:
147
+ **Checkpoint 5e:** Copy the URL.
148
+ > Scroll down and copy the **Generated URL** at the bottom.
102
149
 
103
- > Run this command, replacing `<token>` with the bot token you copied:
150
+ Wait for confirmation.
151
+
152
+ **Checkpoint 5f:** Invite the bot.
153
+ > Paste the URL into your browser. Select your server. Click **Authorize**.
154
+
155
+ Wait for confirmation. The bot should now appear in your server's member list.
156
+
157
+ ### Stage 6: Configure the token
158
+
159
+ **Checkpoint 6a:** Run /discord:configure.
160
+
161
+ Tell the user:
162
+ > Now register the token with the Discord plugin. Run this command,
163
+ > replacing `<token>` with the bot token you copied:
104
164
  > ```
105
165
  > /discord:configure <token>
106
166
  > ```
107
- > This saves the token securely at `~/.claude/channels/discord/.env`.
167
+ > **Do NOT paste the token in chat** — type it directly into the slash command.
108
168
 
109
- Use AskUserQuestion:
110
- - "Have you run `/discord:configure` with your token?"
111
- - Options: "Yes, token is configured" / "I need help"
169
+ Wait for confirmation.
112
170
 
113
- ### 6. Restart with channels active
171
+ ### Stage 7: Restart with --channels
114
172
 
115
- Tell the user:
173
+ **Checkpoint 7a:** Restart.
116
174
 
117
- > You need to restart Claude Code with the channels flag to connect to Discord:
175
+ Tell the user:
176
+ > Exit this Claude Code session and restart with the channels flag:
118
177
  > ```
119
178
  > claude --channels plugin:discord@claude-plugins-official
120
179
  > ```
121
- > The Discord plugin won't connect without this flag.
180
+ > The Discord plugin won't connect without this flag. The SessionStart hook
181
+ > will confirm when it's active.
122
182
 
123
- Use AskUserQuestion:
124
- - "Have you restarted with `--channels`? (If we're in a new session, just confirm)"
125
- - Options: "Yes, restarted" / "Not yet — I'll do it after setup"
183
+ Wait for confirmation (or note that the remaining stages must be done in the
184
+ restarted session).
126
185
 
127
- If not yet, note that steps 7-9 must be done in the restarted session.
186
+ ### Stage 8: Pair via DM
128
187
 
129
- ### 7. Pair via DM
188
+ One action at a time.
130
189
 
131
- Tell the user:
190
+ **Checkpoint 8a:** DM the bot.
191
+ > Open Discord. In your server's member list (or server icon dropdown),
192
+ > click on your bot. Send it any DM (e.g., "hello").
193
+
194
+ Wait for confirmation.
195
+
196
+ **Checkpoint 8b:** Get the pairing code.
197
+ > The bot should reply with a 6-character pairing code. If it doesn't respond,
198
+ > the `--channels` flag might not be active — double-check the restart.
132
199
 
133
- > Open Discord and send a DM to your bot. The bot will reply with a 6-character
134
- > pairing code. Then run:
200
+ Wait for confirmation with the code.
201
+
202
+ **Checkpoint 8c:** Approve the pairing.
203
+
204
+ Tell the user:
205
+ > Run this in Claude Code, replacing `<code>` with the 6-character code:
135
206
  > ```
136
207
  > /discord:access pair <code>
137
208
  > ```
138
- > This adds your Discord user ID to the allowlist.
139
209
 
140
- Use AskUserQuestion:
141
- - "Have you paired successfully?"
142
- - Options: "Yes, I'm paired" / "The bot didn't respond" / "I need help"
210
+ Wait for confirmation. Once paired, the bot will send a "you're in" message.
143
211
 
144
- If the bot didn't respond:
145
- - Check that the session is running with `--channels`
146
- - Check that the token was saved correctly (`/discord:configure` with no args shows status)
212
+ ### Stage 9: Lock down access
147
213
 
148
- ### 8. Lock down access
214
+ **Checkpoint 9a:** Add more people?
215
+ > Is there anyone else who needs to reach this session via Discord?
216
+ - yes → tell them to DM the bot, then approve each with `/discord:access pair <code>`
217
+ - no → continue
149
218
 
150
- Tell the user:
219
+ **Checkpoint 9b:** Lock to allowlist.
151
220
 
152
- > Now let's lock down access so only you can reach this session via Discord.
221
+ Tell the user:
153
222
  > Switch from `pairing` mode (which lets anyone trigger pairing codes) to
154
223
  > `allowlist` mode:
155
224
  > ```
156
225
  > /discord:access policy allowlist
157
226
  > ```
158
227
 
159
- Use AskUserQuestion:
160
- - "Have you locked down to allowlist policy?"
161
- - Options: "Yes, locked down" / "I want to add more people first"
228
+ Wait for confirmation.
162
229
 
163
- If they want to add more people, guide them:
164
- > Have them DM the bot to get a pairing code, then approve with
165
- > `/discord:access pair <code>`. Once everyone's in, run
166
- > `/discord:access policy allowlist` to lock it.
230
+ ### Stage 10: Guild channel (optional)
167
231
 
168
- ### 9. Set up guild channel (optional)
232
+ **Checkpoint 10a:** Want a guild channel?
233
+ > For multi-agent collaboration, add a shared Discord channel that all
234
+ > sessions can see.
235
+ - yes → continue to 10b
236
+ - no → skip to Stage 11
169
237
 
170
- Tell the user:
238
+ **Checkpoint 10b:** Enable Developer Mode.
239
+ > In Discord: **User Settings** > **Advanced** > enable **Developer Mode**.
171
240
 
172
- > For multi-agent collaboration, you'll want a shared guild channel that all
173
- > sessions can see. Get the channel ID by right-clicking the channel in Discord
174
- > (with Developer Mode enabled) and clicking **Copy Channel ID**.
175
- >
176
- > Then run:
241
+ Wait for confirmation.
242
+
243
+ **Checkpoint 10c:** Copy channel ID.
244
+ > Right-click the channel you want to use and click **Copy Channel ID**.
245
+
246
+ Wait for confirmation.
247
+
248
+ **Checkpoint 10d:** Add the channel.
249
+
250
+ Tell the user:
251
+ > Run this, replacing `<channel-id>` with what you copied:
177
252
  > ```
178
253
  > /discord:access group add <channel-id>
179
254
  > ```
180
- > Use `--no-mention` if you want the bot to see all messages (not just @mentions).
255
+ > Add `--no-mention` if you want the bot to see all messages (not just @mentions).
181
256
 
182
- Use AskUserQuestion:
183
- - "Would you like to set up a guild channel now?"
184
- - Options: "Yes, I have the channel ID" / "No, DMs are enough for now"
257
+ Wait for confirmation.
185
258
 
186
- If yes, guide them through the command.
259
+ ### Stage 11: Session name (optional)
187
260
 
188
- ### 10. Configure session name (optional)
189
-
190
- The session name is used by the `/wr-connect:send` skill to identify this session
191
- in messages. Detect from git remote:
261
+ **Checkpoint 11a:** Set session name.
192
262
 
263
+ The session name identifies this session in messages. Check if it's already set:
193
264
  ```bash
194
- git remote get-url origin 2>/dev/null | sed 's|.*github.com[:/]||;s|\.git$||'
265
+ echo "${WR_CONNECT_SESSION_NAME:-not set}"
195
266
  ```
196
267
 
197
- If a `.env.tpl` exists in the project, check if `WR_CONNECT_SESSION_NAME` is defined.
198
- If not, suggest adding it:
199
-
268
+ If not set, tell the user to add it to their `.env` or shell profile:
200
269
  ```
201
- WR_CONNECT_SESSION_NAME={{ op://Private/wr-connect/session_name }}
202
- ```
203
-
204
- Or for projects without 1Password, the session name can be set directly:
205
- ```bash
206
- export WR_CONNECT_SESSION_NAME="<org/repo>"
270
+ WR_CONNECT_SESSION_NAME=<org/repo>
207
271
  ```
208
272
 
209
- ### 11. Test the setup
273
+ Wait for confirmation. (Not critical — the send skill falls back to git remote.)
210
274
 
211
- Use AskUserQuestion:
212
- - "Would you like to send a test message to verify everything works?"
213
- - Options: "Yes, send a test" / "No, I'll test later"
275
+ ### Stage 12: Test
214
276
 
215
- If yes and a guild channel is set up, use the reply tool to send a message to
216
- the guild channel. If DM only, tell the user to DM the bot and check if it arrives.
277
+ **Checkpoint 12a:** Send a test message?
278
+ - yes use the Discord reply tool to send a test message to the channel,
279
+ or tell the user to DM the bot
280
+ - no → skip
217
281
 
218
- ### 12. Explain collaboration behaviour
282
+ ### Stage 13: Summary
219
283
 
220
284
  Tell the user:
221
285
 
222
- > Setup complete! Here's how collaboration works:
286
+ > Setup complete! Summary:
223
287
  >
224
- > - **Each repo has its own bot** so you can see which session sent a message.
225
- > - **Multiple sessions and humans** can share the same guild channel.
226
- > - Use `@session-name` in messages to direct them at a specific session
227
- > (e.g. `/wr-connect:send @repo-b please fix Widget.parse()`).
228
- > - Messages without `@` are broadcast — all sessions see them.
229
- > - Each session reads everything for context but only responds when the message
230
- > is relevant to its work.
231
- > - Agents can react to messages for lightweight acknowledgement.
288
+ > - Bot: `<bot-name>` created and added to your server
289
+ > - Token: saved via `/discord:configure`
290
+ > - Access: locked to allowlist (only you can reach this session)
291
+ > - Guild channel: `<configured or skipped>`
232
292
  >
233
- > To set up another repo, install the wr-connect plugin there and run
234
- > `/wr-connect:setup`it will create a new bot for that repo.
293
+ > How collaboration works:
294
+ > - Each repo has its own bot you can see which session sent a message.
295
+ > - Use `@session-name` to direct messages at a specific session.
296
+ > - Messages without `@` are broadcast.
297
+ > - Each session reads everything for context but only responds when relevant.
298
+ > - Always prefix your Discord replies with `**<session-name>:**` so others
299
+ > can tell who you are.
235
300
 
236
301
  $ARGUMENTS