relay-cc 2.0.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.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +428 -0
  3. package/agents/relay-codebase-mapper.md +761 -0
  4. package/agents/relay-debugger.md +1203 -0
  5. package/agents/relay-estimator.md +257 -0
  6. package/agents/relay-executor.md +823 -0
  7. package/agents/relay-plan-checker.md +812 -0
  8. package/agents/relay-planner.md +1418 -0
  9. package/agents/relay-reviewer.md +279 -0
  10. package/agents/relay-ticket-researcher.md +287 -0
  11. package/agents/relay-verifier.md +778 -0
  12. package/bin/install.js +1667 -0
  13. package/commands/relay/add-todo.md +193 -0
  14. package/commands/relay/check-todos.md +200 -0
  15. package/commands/relay/debug.md +169 -0
  16. package/commands/relay/estimate.md +182 -0
  17. package/commands/relay/help.md +328 -0
  18. package/commands/relay/history.md +203 -0
  19. package/commands/relay/map-codebase.md +71 -0
  20. package/commands/relay/pause-work.md +128 -0
  21. package/commands/relay/pr.md +223 -0
  22. package/commands/relay/quick.md +307 -0
  23. package/commands/relay/resume-work.md +40 -0
  24. package/commands/relay/resume.md +181 -0
  25. package/commands/relay/review.md +322 -0
  26. package/commands/relay/rollback.md +248 -0
  27. package/commands/relay/set-profile.md +116 -0
  28. package/commands/relay/settings.md +165 -0
  29. package/commands/relay/setup.md +247 -0
  30. package/commands/relay/status.md +131 -0
  31. package/commands/relay/tickets.md +106 -0
  32. package/commands/relay/update.md +200 -0
  33. package/commands/relay/work.md +398 -0
  34. package/hooks/dist/relay-check-update.js +61 -0
  35. package/hooks/dist/relay-statusline.js +91 -0
  36. package/package.json +47 -0
  37. package/relay/references/checkpoints.md +1078 -0
  38. package/relay/references/continuation-format.md +249 -0
  39. package/relay/references/git-integration.md +209 -0
  40. package/relay/references/model-profiles.md +57 -0
  41. package/relay/references/planning-config.md +189 -0
  42. package/relay/references/questioning.md +141 -0
  43. package/relay/references/tdd.md +263 -0
  44. package/relay/references/ui-brand.md +162 -0
  45. package/relay/references/verification-patterns.md +612 -0
  46. package/relay/templates/DEBUG.md +159 -0
  47. package/relay/templates/UAT.md +247 -0
  48. package/relay/templates/analysis.md +101 -0
  49. package/relay/templates/codebase/architecture.md +255 -0
  50. package/relay/templates/codebase/concerns.md +310 -0
  51. package/relay/templates/codebase/conventions.md +307 -0
  52. package/relay/templates/codebase/integrations.md +280 -0
  53. package/relay/templates/codebase/stack.md +186 -0
  54. package/relay/templates/codebase/structure.md +285 -0
  55. package/relay/templates/codebase/testing.md +480 -0
  56. package/relay/templates/config.json +40 -0
  57. package/relay/templates/context.md +283 -0
  58. package/relay/templates/continue-here.md +78 -0
  59. package/relay/templates/debug-subagent-prompt.md +91 -0
  60. package/relay/templates/estimate.md +108 -0
  61. package/relay/templates/phase-prompt.md +567 -0
  62. package/relay/templates/planner-subagent-prompt.md +117 -0
  63. package/relay/templates/research.md +552 -0
  64. package/relay/templates/state.md +127 -0
  65. package/relay/templates/summary.md +246 -0
  66. package/relay/templates/verification-report.md +322 -0
  67. package/relay/workflows/analyze-ticket.md +42 -0
  68. package/relay/workflows/diagnose-issues.md +231 -0
  69. package/relay/workflows/execute-phase.md +700 -0
  70. package/relay/workflows/execute-plan.md +1851 -0
  71. package/relay/workflows/map-codebase.md +357 -0
  72. package/relay/workflows/resume-project.md +307 -0
  73. package/relay/workflows/sync-ticket.md +58 -0
  74. package/relay/workflows/verify-phase.md +628 -0
  75. package/relay/workflows/verify-ticket.md +596 -0
  76. package/scripts/build-hooks.js +42 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Lex Christopherson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,428 @@
1
+ <div align="center">
2
+
3
+ # RELAY
4
+
5
+ **Your AI dev agent, connected to your team's workflow.**
6
+
7
+ **Fetch tickets from Jira, GitHub Issues, or Azure DevOps — analyze, plan, execute, and sync results back.**
8
+
9
+ [![npm version](https://img.shields.io/npm/v/relay-cc?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/relay-cc)
10
+ [![npm downloads](https://img.shields.io/npm/dm/relay-cc?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/relay-cc)
11
+ [![GitHub stars](https://img.shields.io/github/stars/ibnyusrat/relay?style=for-the-badge&logo=github&color=181717)](https://github.com/ibnyusrat/relay)
12
+ [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
13
+
14
+ <br>
15
+
16
+ ```bash
17
+ npx relay-cc
18
+ ```
19
+
20
+ **Works on Mac, Windows, and Linux.**
21
+
22
+ <br>
23
+
24
+ ![Relay Install](assets/terminal.svg)
25
+
26
+ <br>
27
+
28
+ [How It Works](#how-it-works) · [Getting Started](#getting-started) · [Commands](#commands) · [Configuration](#configuration)
29
+
30
+ > Fork of [Get Shit Done (GSD)](https://github.com/glittercowboy/get-shit-done) by [glittercowboy](https://github.com/glittercowboy). All credit for the core architecture goes to the original project.
31
+
32
+ </div>
33
+
34
+ ---
35
+
36
+ ## How It Works
37
+
38
+ Relay connects Claude Code to your team's ticket system. One command takes a ticket from assignment to completion:
39
+
40
+ ```
41
+ /relay:work PROJ-123
42
+ ```
43
+
44
+ Six stages, fully orchestrated:
45
+
46
+ 1. **Fetch** — Pull ticket details from Jira/GitHub/Azure DevOps, create a git branch
47
+ 2. **Analyze** — Spawn a researcher agent to map ticket requirements against your codebase
48
+ 3. **Plan** — Create an executable plan with atomic tasks, verified against acceptance criteria
49
+ 4. **Confirm** — Present analysis + plan for your approval before any code is written
50
+ 5. **Execute** — Spawn executor agents with fresh 200k context per task, atomic commits
51
+ 6. **Verify & Sync** — Check acceptance criteria, post results back to your ticket system
52
+
53
+ The complexity is in the system, not in your workflow. Behind the scenes: context engineering, XML prompt formatting, subagent orchestration, state management. What you see: a few commands that just work.
54
+
55
+ ### Why Subagents?
56
+
57
+ Every stage spawns specialized agents in fresh context windows. Your main session stays lean while agents burn through investigation, planning, and implementation in their own 200k-token contexts.
58
+
59
+ | Stage | Orchestrator does | Agents do |
60
+ |-------|------------------|-----------|
61
+ | Analyze | Collects ticket + codebase context | Researcher maps requirements to code |
62
+ | Plan | Validates, manages iteration | Planner creates tasks, checker verifies |
63
+ | Execute | Groups into waves, tracks progress | Executors implement with fresh context |
64
+ | Verify | Presents results, routes next | Verifier checks against acceptance criteria |
65
+
66
+ ### Atomic Git Commits
67
+
68
+ Each task gets its own commit with ticket ID:
69
+
70
+ ```
71
+ feat(PROJ-123): create user registration endpoint
72
+ feat(PROJ-123): add email confirmation flow
73
+ fix(PROJ-123): handle duplicate email edge case
74
+ docs(PROJ-123): complete user registration
75
+ ```
76
+
77
+ Git bisect finds exact failing task. Each commit independently revertable. Clean history for future sessions.
78
+
79
+ ---
80
+
81
+ ## Getting Started
82
+
83
+ ### Install
84
+
85
+ ```bash
86
+ npx relay-cc
87
+ ```
88
+
89
+ The installer prompts you to choose:
90
+ 1. **Runtime** — Claude Code, OpenCode, Gemini, or all
91
+ 2. **Location** — Global (all projects) or local (current project only)
92
+
93
+ Verify with `/relay:help` inside your chosen runtime.
94
+
95
+ ### Connect Your Ticket System
96
+
97
+ ```
98
+ /relay:setup
99
+ ```
100
+
101
+ Relay detects available MCP integrations (Jira, GitHub Issues, Azure DevOps) and configures your project. Optionally maps your existing codebase for better ticket analysis.
102
+
103
+ ### Start Working
104
+
105
+ ```
106
+ /relay:tickets # Browse available tickets
107
+ /relay:work PROJ-123 # Fetch, analyze, plan, execute, verify, sync
108
+ ```
109
+
110
+ ### Staying Updated
111
+
112
+ ```bash
113
+ npx relay-cc@latest
114
+ ```
115
+
116
+ <details>
117
+ <summary><strong>Non-interactive Install (Docker, CI, Scripts)</strong></summary>
118
+
119
+ ```bash
120
+ # Claude Code
121
+ npx relay-cc --claude --global # Install to ~/.claude/
122
+ npx relay-cc --claude --local # Install to ./.claude/
123
+
124
+ # OpenCode (open source, free models)
125
+ npx relay-cc --opencode --global # Install to ~/.config/opencode/
126
+
127
+ # Gemini CLI
128
+ npx relay-cc --gemini --global # Install to ~/.gemini/
129
+
130
+ # All runtimes
131
+ npx relay-cc --all --global # Install to all directories
132
+ ```
133
+
134
+ Use `--global` (`-g`) or `--local` (`-l`) to skip the location prompt.
135
+ Use `--claude`, `--opencode`, `--gemini`, or `--all` to skip the runtime prompt.
136
+
137
+ </details>
138
+
139
+ <details>
140
+ <summary><strong>Development Installation</strong></summary>
141
+
142
+ Clone the repository and run the installer locally:
143
+
144
+ ```bash
145
+ git clone https://github.com/ibnyusrat/relay.git
146
+ cd relay
147
+ node bin/install.js --claude --local
148
+ ```
149
+
150
+ Installs to `./.claude/` for testing modifications before contributing.
151
+
152
+ </details>
153
+
154
+ ### Recommended: Skip Permissions Mode
155
+
156
+ Relay is designed for frictionless automation. Run Claude Code with:
157
+
158
+ ```bash
159
+ claude --dangerously-skip-permissions
160
+ ```
161
+
162
+ > [!TIP]
163
+ > This is how Relay is intended to be used — stopping to approve `date` and `git commit` 50 times defeats the purpose.
164
+
165
+ <details>
166
+ <summary><strong>Alternative: Granular Permissions</strong></summary>
167
+
168
+ If you prefer not to use that flag, add this to your project's `.claude/settings.json`:
169
+
170
+ ```json
171
+ {
172
+ "permissions": {
173
+ "allow": [
174
+ "Bash(date:*)",
175
+ "Bash(echo:*)",
176
+ "Bash(cat:*)",
177
+ "Bash(ls:*)",
178
+ "Bash(mkdir:*)",
179
+ "Bash(wc:*)",
180
+ "Bash(head:*)",
181
+ "Bash(tail:*)",
182
+ "Bash(sort:*)",
183
+ "Bash(grep:*)",
184
+ "Bash(tr:*)",
185
+ "Bash(git add:*)",
186
+ "Bash(git commit:*)",
187
+ "Bash(git status:*)",
188
+ "Bash(git log:*)",
189
+ "Bash(git diff:*)",
190
+ "Bash(git tag:*)"
191
+ ]
192
+ }
193
+ }
194
+ ```
195
+
196
+ </details>
197
+
198
+ ---
199
+
200
+ ## Supported Integrations
201
+
202
+ Relay connects to your ticket system via MCP (Model Context Protocol) servers:
203
+
204
+ | System | MCP Server | Detection |
205
+ |--------|-----------|-----------|
206
+ | **Jira** | Any Jira MCP server | `mcp__jira__*` tools |
207
+ | **GitHub Issues** | GitHub MCP server | `mcp__github__*` tools |
208
+ | **Azure DevOps** | Azure DevOps MCP server | `mcp__azure_devops__*` tools |
209
+
210
+ Configure your MCP server in Claude Code settings, then run `/relay:setup` to connect.
211
+
212
+ ---
213
+
214
+ ## Commands
215
+
216
+ ### Core Workflow
217
+
218
+ | Command | What it does |
219
+ |---------|--------------|
220
+ | `/relay:setup` | Connect to Jira/GitHub Issues/Azure DevOps |
221
+ | `/relay:tickets` | Browse available tickets |
222
+ | `/relay:work <id>` | Fetch → analyze → plan → confirm → execute → verify → sync |
223
+ | `/relay:estimate <id>` | Estimate effort before committing (complexity, time, impact) |
224
+ | `/relay:resume <id>` | Resume a specific ticket by ID (detects stage, switches branch) |
225
+
226
+ ### Quick Tasks
227
+
228
+ | Command | What it does |
229
+ |---------|--------------|
230
+ | `/relay:quick` | Execute ad-hoc task with Relay guarantees (skip analysis) |
231
+
232
+ ### Code Review & PRs
233
+
234
+ | Command | What it does |
235
+ |---------|--------------|
236
+ | `/relay:pr [id]` | Create PR from ticket work (auto-generates title/description) |
237
+ | `/relay:review` | Review a PR or address review comments on your own PR |
238
+ | `/relay:rollback <id>` | Safely revert ticket work via `git revert` |
239
+
240
+ ### Status & Navigation
241
+
242
+ | Command | What it does |
243
+ |---------|--------------|
244
+ | `/relay:status` | Check current state and route to next action |
245
+ | `/relay:history [filter]` | Show completed ticket history with outcomes |
246
+ | `/relay:help` | Show all commands and usage guide |
247
+ | `/relay:update` | Update Relay with changelog preview |
248
+
249
+ ### Session Management
250
+
251
+ | Command | What it does |
252
+ |---------|--------------|
253
+ | `/relay:pause-work` | Create context handoff when stopping mid-ticket |
254
+ | `/relay:resume-work` | Restore from last session |
255
+
256
+ ### Utilities
257
+
258
+ | Command | What it does |
259
+ |---------|--------------|
260
+ | `/relay:map-codebase` | Analyze existing codebase (7 focused documents) |
261
+ | `/relay:debug [desc]` | Systematic debugging with persistent state |
262
+ | `/relay:add-todo [desc]` | Capture idea for later |
263
+ | `/relay:check-todos` | List pending todos |
264
+ | `/relay:settings` | Configure model profile and workflow agents |
265
+ | `/relay:set-profile <profile>` | Switch model profile (quality/balanced/budget) |
266
+
267
+ ---
268
+
269
+ ## Configuration
270
+
271
+ Relay stores project settings in `.relay/config.json`. Configure during `/relay:setup` or update later with `/relay:settings`.
272
+
273
+ ### Model Profiles
274
+
275
+ Control which Claude model each agent uses. Balance quality vs token spend.
276
+
277
+ | Profile | Planning | Execution | Verification |
278
+ |---------|----------|-----------|--------------|
279
+ | `quality` | Opus | Opus | Sonnet |
280
+ | `balanced` (default) | Opus | Sonnet | Sonnet |
281
+ | `budget` | Sonnet | Sonnet | Haiku |
282
+
283
+ Switch profiles:
284
+ ```
285
+ /relay:set-profile budget
286
+ ```
287
+
288
+ ### Workflow Agents
289
+
290
+ Optional agents that improve quality but add tokens and time.
291
+
292
+ | Setting | Default | What it does |
293
+ |---------|---------|--------------|
294
+ | `workflow.research` | `true` | Research codebase before planning |
295
+ | `workflow.plan_check` | `true` | Verify plans achieve ticket goals |
296
+ | `workflow.verifier` | `true` | Confirm acceptance criteria met |
297
+
298
+ ### Git Branching
299
+
300
+ | Setting | Default | What it does |
301
+ |---------|---------|--------------|
302
+ | `git.branching_strategy` | `ticket` | Branch per ticket |
303
+ | `git.ticket_branch_template` | `{ticket_id}/{slug}` | Branch name format |
304
+
305
+ ### Planning
306
+
307
+ | Setting | Default | What it does |
308
+ |---------|---------|--------------|
309
+ | `planning.commit_docs` | `true` | Track `.relay/` artifacts in git |
310
+
311
+ ---
312
+
313
+ ## File Structure
314
+
315
+ ```
316
+ .relay/
317
+ ├── config.json # Integration config, workflow settings
318
+ ├── STATE.md # Active ticket, recent history, velocity
319
+ ├── codebase/ # Codebase map (7 documents)
320
+ ├── tickets/
321
+ │ └── PROJ-123/
322
+ │ ├── ESTIMATE.md # Pre-work effort estimate
323
+ │ ├── ANALYSIS.md # Codebase-aware ticket analysis
324
+ │ ├── PLAN.md # Executable plan
325
+ │ ├── SUMMARY.md # Execution results
326
+ │ └── VERIFICATION.md # Acceptance criteria check
327
+ ├── reviews/ # PR review documents
328
+ ├── debug/ # Debug sessions
329
+ ├── quick/ # Quick task artifacts
330
+ └── todos/ # Captured ideas
331
+ ├── pending/
332
+ └── done/
333
+ ```
334
+
335
+ ---
336
+
337
+ ## Security
338
+
339
+ ### Protecting Sensitive Files
340
+
341
+ Relay's codebase mapping and analysis commands read files to understand your project. **Protect files containing secrets** by adding them to Claude Code's deny list:
342
+
343
+ 1. Open Claude Code settings (`.claude/settings.json` or global)
344
+ 2. Add sensitive file patterns to the deny list:
345
+
346
+ ```json
347
+ {
348
+ "permissions": {
349
+ "deny": [
350
+ "Read(.env)",
351
+ "Read(.env.*)",
352
+ "Read(**/secrets/*)",
353
+ "Read(**/*credential*)",
354
+ "Read(**/*.pem)",
355
+ "Read(**/*.key)"
356
+ ]
357
+ }
358
+ }
359
+ ```
360
+
361
+ This prevents Claude from reading these files entirely, regardless of what commands you run.
362
+
363
+ > [!IMPORTANT]
364
+ > Relay includes built-in protections against committing secrets, but defense-in-depth is best practice. Deny read access to sensitive files as a first line of defense.
365
+
366
+ ---
367
+
368
+ ## Troubleshooting
369
+
370
+ **Commands not found after install?**
371
+ - Restart Claude Code to reload slash commands
372
+ - Verify files exist in `~/.claude/commands/relay/` (global) or `./.claude/commands/relay/` (local)
373
+
374
+ **Commands not working as expected?**
375
+ - Run `/relay:help` to verify installation
376
+ - Re-run `npx relay-cc` to reinstall
377
+
378
+ **Updating to the latest version?**
379
+ ```bash
380
+ npx relay-cc@latest
381
+ ```
382
+
383
+ **Using Docker or containerized environments?**
384
+
385
+ If file reads fail with tilde paths (`~/.claude/...`), set `CLAUDE_CONFIG_DIR` before installing:
386
+ ```bash
387
+ CLAUDE_CONFIG_DIR=/home/youruser/.claude npx relay-cc --global
388
+ ```
389
+ This ensures absolute paths are used instead of `~` which may not expand correctly in containers.
390
+
391
+ ### Upgrading from GSD
392
+
393
+ If you previously used Get Shit Done (GSD), the installer automatically:
394
+ - Removes old `commands/gsd/` and agent files
395
+ - Updates hooks and settings references
396
+ - Cleans up old cache files
397
+
398
+ Your existing `.planning/` project data is not modified. Relay uses `.relay/` for new projects.
399
+
400
+ ### Uninstalling
401
+
402
+ To remove Relay completely:
403
+
404
+ ```bash
405
+ # Global installs
406
+ npx relay-cc --claude --global --uninstall
407
+ npx relay-cc --opencode --global --uninstall
408
+
409
+ # Local installs (current project)
410
+ npx relay-cc --claude --local --uninstall
411
+ npx relay-cc --opencode --local --uninstall
412
+ ```
413
+
414
+ This removes all Relay commands, agents, hooks, and settings while preserving your other configurations.
415
+
416
+ ---
417
+
418
+ ## License
419
+
420
+ MIT License. See [LICENSE](LICENSE) for details.
421
+
422
+ ---
423
+
424
+ <div align="center">
425
+
426
+ **Claude Code is powerful. Relay makes it reliable.**
427
+
428
+ </div>