@windyroad/connect 0.2.0 → 0.2.1-preview.38

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.
package/README.md CHANGED
@@ -37,9 +37,9 @@ Run the interactive setup skill:
37
37
  /wr-connect:setup
38
38
  ```
39
39
 
40
- This walks you through:
41
- 1. Creating a Discord bot
42
- 2. Configuring environment variables (bot token, channel ID, session name)
40
+ This is an interactive walkthrough that guides you through:
41
+ 1. Creating a Discord bot (`wr-connect`)
42
+ 2. Storing credentials (`.env` file, 1Password, or shell profile)
43
43
  3. Installing the Discord channel plugin
44
44
  4. Configuring the security allowlist
45
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/connect",
3
- "version": "0.2.0",
3
+ "version": "0.2.1-preview.38",
4
4
  "description": "Connect Claude Code sessions across repos via Discord (experimental)",
5
5
  "bin": {
6
6
  "windyroad-connect": "./bin/install.mjs"
@@ -12,9 +12,12 @@ 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.
17
+
15
18
  ## Steps
16
19
 
17
- ### 1. Explain what this does
20
+ ### 1. Explain and opt-in
18
21
 
19
22
  Tell the user:
20
23
 
@@ -29,65 +32,121 @@ Tell the user:
29
32
  > - A Discord bot (created in the next step)
30
33
  > - A private Discord server or channel
31
34
 
32
- ### 2. Opt-out checkpoint
35
+ Use AskUserQuestion:
36
+ - "Would you like to proceed with setting up cross-repo collaboration via Discord?"
37
+ - Options: "Yes, let's set it up" / "No, skip for now"
33
38
 
34
- Use AskUserQuestion to ask the user:
39
+ If no:
40
+ > Setup skipped. The connect plugin is inactive until configured.
41
+ > Run `/wr-connect:setup` any time to start again.
35
42
 
36
- > Would you like to proceed with setting up cross-repo collaboration via Discord?
37
- > This will require creating a Discord bot and configuring environment variables.
38
- > No files will be written to your project.
39
- >
40
- > Reply **yes** to continue or **no** to skip.
43
+ Stop do not proceed.
41
44
 
42
- If the user says no, respond with:
45
+ ### 2. Check for existing Discord server
43
46
 
44
- > Setup skipped. The connect plugin is inactive until configured.
45
- > Run `/wr-connect:setup` any time to start again.
47
+ Use AskUserQuestion:
48
+ - "Do you already have a Discord server you'd like to use, or do you need to create one?"
49
+ - Options: "I have a server" / "I need to create one"
46
50
 
47
- Then stop do not proceed to any further steps.
51
+ If they need to create one, guide them:
52
+ 1. Open Discord and click the **+** button in the server list
53
+ 2. Choose **Create My Own** > **For me and my friends**
54
+ 3. Name it something like `dev-agents` or `wr-connect`
48
55
 
49
56
  ### 3. Create a Discord bot
50
57
 
51
- Guide the user through these steps:
52
-
53
- 1. Go to https://discord.com/developers/applications
54
- 2. Click **New Application** — name it something like `claude-connect`
55
- 3. Go to **Bot** > click **Add Bot** > confirm
56
- 4. Under **Token**, click **Reset Token** and copy it — they will need it in step 5
57
- 5. Under **Privileged Gateway Intents**, enable **Message Content Intent**
58
- 6. Go to **OAuth2 > URL Generator**:
58
+ Tell the user to go to https://discord.com/developers/applications, then guide
59
+ them step by step. Use AskUserQuestion after giving the instructions:
60
+
61
+ **Instructions:**
62
+ 1. Click **New Application** name it `wr-connect`
63
+ 2. Go to **Bot** > click **Add Bot** > confirm
64
+ 3. Under **Token**, click **Reset Token** and copy the token
65
+ 4. Under **Privileged Gateway Intents**, enable:
66
+ - **Message Content Intent** (to read message text)
67
+ - **Server Members Intent** (optional — for member awareness)
68
+ 5. Go to **OAuth2 > URL Generator**:
59
69
  - Scopes: `bot`
60
- - Bot permissions: `Send Messages`, `Read Messages/View Channels`
61
- 7. Copy the generated URL, open it in a browser, and add the bot to their server
70
+ - Bot permissions: `Send Messages`, `Read Messages/View Channels`, `Add Reactions`, `Read Message History`
71
+ 6. Copy the generated URL, open it in a browser, and add the bot to your server
62
72
 
63
- ### 4. Get the channel ID
73
+ Use AskUserQuestion:
74
+ - "Have you created the bot and copied the token?"
75
+ - Options: "Yes, I have the token" / "I need help with a step"
76
+
77
+ If they need help, ask which step is unclear and provide more detail.
64
78
 
65
- Guide the user:
79
+ ### 4. Get the channel ID
66
80
 
81
+ Tell the user:
67
82
  1. In Discord, go to **User Settings > Advanced** and enable **Developer Mode**
68
- 2. Right-click the channel to use for collaboration and click **Copy Channel ID**
83
+ 2. Create a channel (e.g., `#agent-collab`) or pick an existing one
84
+ 3. Right-click the channel and click **Copy Channel ID**
85
+
86
+ Use AskUserQuestion:
87
+ - "Have you copied the channel ID?"
88
+ - Options: "Yes, I have the channel ID" / "I need help"
69
89
 
70
- ### 5. Configure environment variables
90
+ ### 5. Store credentials
71
91
 
72
- Guide the user to add these to their shell profile (`~/.zshrc`, `~/.bashrc`) or a
73
- `.env` file that is already in `.gitignore`:
92
+ Use AskUserQuestion:
93
+ - "Where would you like to store the bot token and channel ID?"
94
+ - Options:
95
+ - ".env file (recommended)" — "Store in a .env file in the project root. The file must be in .gitignore."
96
+ - "1Password CLI" — "Use `op` CLI to store secrets in 1Password and reference them via `op://`"
97
+ - "Shell profile" — "Add exports to ~/.zshrc or ~/.bashrc"
74
98
 
99
+ **If .env file:**
100
+
101
+ Check that `.env` is in `.gitignore`:
75
102
  ```bash
76
- export WR_CONNECT_BOT_TOKEN="<the bot token from step 3>"
77
- export WR_CONNECT_CHANNEL_ID="<the channel ID from step 4>"
78
- export WR_CONNECT_SESSION_NAME="<a name for this session, e.g. repo-b>"
103
+ grep -q '\.env' .gitignore 2>/dev/null && echo ".env is in .gitignore" || echo "WARNING: .env is NOT in .gitignore"
79
104
  ```
80
105
 
81
- **Security warning:** The bot token gives anyone who has it the ability to send
82
- messages to your Claude Code session. Never commit it to source control. Use
83
- environment variables or a `.env` file that is in `.gitignore`.
106
+ If not in `.gitignore`, warn the user and offer to add it.
107
+
108
+ Use AskUserQuestion to get the values:
109
+ - "Paste your bot token (from step 3):"
110
+ - "Paste your channel ID (from step 4):"
111
+ - "What should this session be called? (e.g., `windyroad-plugins`, `repo-a`)"
112
+
113
+ Write the `.env` file (or append to it if it exists):
114
+ ```
115
+ WR_CONNECT_BOT_TOKEN=<token>
116
+ WR_CONNECT_CHANNEL_ID=<channel-id>
117
+ WR_CONNECT_SESSION_NAME=<session-name>
118
+ ```
84
119
 
85
- If the user chooses a `.env` file, verify `.env` is in `.gitignore`:
120
+ **If 1Password CLI:**
121
+
122
+ Check if `op` is available:
123
+ ```bash
124
+ command -v op && echo "1Password CLI available" || echo "1Password CLI not found"
125
+ ```
126
+
127
+ Guide the user to create a vault item and reference it:
128
+ ```bash
129
+ op item create --category=API\ Credential --title="wr-connect" \
130
+ 'bot_token=<token>' \
131
+ 'channel_id=<channel-id>' \
132
+ 'session_name=<session-name>'
133
+ ```
86
134
 
135
+ Then add to shell profile:
87
136
  ```bash
88
- grep -q '\.env' .gitignore 2>/dev/null && echo ".env is in .gitignore" || echo "WARNING: .env is NOT in .gitignore — add it now"
137
+ export WR_CONNECT_BOT_TOKEN="$(op read 'op://Private/wr-connect/bot_token')"
138
+ export WR_CONNECT_CHANNEL_ID="$(op read 'op://Private/wr-connect/channel_id')"
139
+ export WR_CONNECT_SESSION_NAME="$(op read 'op://Private/wr-connect/session_name')"
89
140
  ```
90
141
 
142
+ **If shell profile:**
143
+
144
+ Use AskUserQuestion to get the values (same as .env), then tell the user to add
145
+ the exports to their `~/.zshrc` or `~/.bashrc` and run `source ~/.zshrc`.
146
+
147
+ **Security warning:** The bot token gives anyone who has it the ability to send
148
+ messages to your Claude Code session. Never commit it to source control.
149
+
91
150
  ### 6. Verify environment variables
92
151
 
93
152
  Check the env vars are set in the current shell:
@@ -98,42 +157,58 @@ Check the env vars are set in the current shell:
98
157
  [ -n "$WR_CONNECT_SESSION_NAME" ] && echo "SESSION_NAME: set" || echo "SESSION_NAME: NOT SET"
99
158
  ```
100
159
 
101
- If any are not set, remind the user to `source ~/.zshrc` (or their profile) or
102
- restart their terminal before continuing.
103
-
104
- ### 7. Install the Discord channel plugin
160
+ If any are not set:
161
+ - For .env: remind the user to run `source .env` or check the file
162
+ - For 1Password: remind the user to run `eval $(op signin)` first
163
+ - For shell profile: remind the user to `source ~/.zshrc`
105
164
 
106
- ```bash
107
- claude plugin install discord@claude-plugins-official
108
- ```
165
+ Use AskUserQuestion:
166
+ - "Are all three variables showing as set?"
167
+ - Options: "Yes, all set" / "No, some are missing"
109
168
 
110
- ### 8. Restart with channels active
169
+ If missing, help troubleshoot.
111
170
 
112
- Tell the user to restart Claude Code with:
171
+ ### 7. Install the Discord channel plugin
113
172
 
114
173
  ```bash
115
- claude --channels plugin:discord@claude-plugins-official
174
+ claude plugin install discord@claude-plugins-official
116
175
  ```
117
176
 
118
- Claude will send a pairing code. Follow the prompts to pair the Discord account.
119
-
120
- ### 9. Configure the Discord allowlist (security)
177
+ ### 8. Configure the Discord allowlist (security)
121
178
 
122
179
  This is critical. Without the allowlist, anyone who can message the bot can send
123
180
  instructions to the Claude Code session.
124
181
 
182
+ Tell the user:
183
+
184
+ > To find your Discord user ID: In Discord with Developer Mode enabled,
185
+ > click your username at the bottom left, then click **Copy User ID**.
186
+
125
187
  Guide the user to configure the allowlist so only their own Discord user ID can
126
188
  send messages. The exact command depends on the Discord channel plugin's interface —
127
189
  check its documentation for the allowlist or access policy setting.
128
190
 
191
+ Use AskUserQuestion:
192
+ - "Have you configured the Discord allowlist with your user ID?"
193
+ - Options: "Yes, allowlist configured" / "I need help finding my user ID" / "I'll do this later"
194
+
195
+ ### 9. Restart with channels active
196
+
129
197
  Tell the user:
130
198
 
131
- > To find your Discord user ID: In Discord with Developer Mode enabled,
132
- > click your username at the bottom left, then click **Copy User ID**.
199
+ > To activate, restart Claude Code with:
200
+ > ```
201
+ > claude --channels plugin:discord@claude-plugins-official
202
+ > ```
203
+ > Claude will send a pairing code. Follow the prompts to pair your Discord account.
133
204
 
134
205
  ### 10. Test the setup
135
206
 
136
- Ask the user if they would like to send a test message. If yes, tell them to use:
207
+ Use AskUserQuestion:
208
+ - "Would you like to send a test message to verify the setup?"
209
+ - Options: "Yes, send a test" / "No, I'll test later"
210
+
211
+ If yes, tell them to use:
137
212
 
138
213
  ```
139
214
  /wr-connect:send test message from setup
@@ -148,8 +223,6 @@ curl -s -X POST "https://discord.com/api/v10/channels/$WR_CONNECT_CHANNEL_ID/mes
148
223
  -d '{"content": "[wr-connect] from: test | setup verification"}'
149
224
  ```
150
225
 
151
- If the session with `--channels` active receives the message, setup is complete.
152
-
153
226
  ### 11. Explain collaboration behaviour
154
227
 
155
228
  Tell the user:
@@ -164,5 +237,6 @@ Tell the user:
164
237
  > is relevant to its work.
165
238
  > - Your session name is whatever you set in `WR_CONNECT_SESSION_NAME`. Other
166
239
  > sessions will use `@your-name` to get your attention.
240
+ > - Agents can react to messages for lightweight acknowledgement.
167
241
 
168
242
  $ARGUMENTS