relay-kit 0.3.0 → 0.3.1
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/CHANGELOG.md +6 -0
- package/README.en.md +247 -0
- package/README.md +202 -190
- package/dist/cli.js +18 -15
- package/dist/cli.js.map +1 -1
- package/docs/CLI_SPEC.md +108 -53
- package/docs/FINAL_DESIGN.md +18 -16
- package/docs/OPENSPEC_INTEGRATION.md +60 -30
- package/docs/SKILLS_INSTALLATION.md +46 -4
- package/docs/USAGE_FLOW.md +47 -58
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
package/README.en.md
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.shields.io/npm/v/relay-kit.svg" alt="npm version">
|
|
3
|
+
<img src="https://img.shields.io/node/v/relay-kit.svg" alt="node version">
|
|
4
|
+
<img src="https://img.shields.io/npm/l/relay-kit.svg" alt="license">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# relay-kit 🔄
|
|
8
|
+
|
|
9
|
+
> **Skills-first, CLI-assisted AI programming relay workflow toolkit**
|
|
10
|
+
>
|
|
11
|
+
> Break AI programming into a relay race: Plan → Delegate → Execute → Escalate → Review.
|
|
12
|
+
> Built-in OpenSpec. Zero external dependencies.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
┌──────────────────────────────────────┐
|
|
16
|
+
│ Human Owner │
|
|
17
|
+
│ Direction · Review · Commit │
|
|
18
|
+
└────┬──────────┬──────────┬───────────┘
|
|
19
|
+
│ Plan │ Escalate │ Review
|
|
20
|
+
▼ ▼ ▼
|
|
21
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
22
|
+
│ relay-kit Workflow │
|
|
23
|
+
│ │
|
|
24
|
+
│ /relay:plan relay ask /relay:review │
|
|
25
|
+
│ Planner ───────────► ASK_ADVISOR ───► Reviewer │
|
|
26
|
+
│ │ ▲ │ │
|
|
27
|
+
│ │ Delegate │ Escalate │ Verdict │
|
|
28
|
+
│ ▼ │ ▼ │
|
|
29
|
+
│ relay start /relay:run ADVISOR_DECISION │
|
|
30
|
+
│ EXECUTOR_TASK ──────► Executor ───────► REPLAN / FIX │
|
|
31
|
+
│ │
|
|
32
|
+
│ Built-in OpenSpec (relay openspec) │
|
|
33
|
+
│ new-change → status → instructions → archive │
|
|
34
|
+
└─────────────────────────────────────────────────────────────┘
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Why relay-kit?
|
|
40
|
+
|
|
41
|
+
| | Raw AI Tools | Multi-Agent Frameworks | **relay-kit** |
|
|
42
|
+
| ------------ | ----------------------------- | ------------------------- | -------------------------------------- |
|
|
43
|
+
| **Approach** | Chat-based coding | Automated agent orchestration | **Human-led relay workflow** |
|
|
44
|
+
| **Roles** | None | Agents self-negotiate | **Owner / Advisor / Executor** |
|
|
45
|
+
| **Handoff** | Copy-paste conversations | Framework internal | **Structured handoff files** |
|
|
46
|
+
| **Blockers** | Manual prompts | Auto-retry or fail | **ASK_ADVISOR escalation → human call**|
|
|
47
|
+
| **Review** | Manual diff review | None | **REVIEW_REQUEST → verdict report** |
|
|
48
|
+
| **Spec-driven** | None | Framework-dependent | **Built-in spec-driven OpenSpec** |
|
|
49
|
+
| **Deps** | Zero | Heavy | **Zero external deps (CLI: commander)**|
|
|
50
|
+
|
|
51
|
+
relay-kit is not an auto-coding tool, nor a multi-agent framework. It's a set of **workflow patterns** that mirror how real teams work: PM plans → engineer builds → escalates when stuck → code review before merging.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
### Install
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install -g relay-kit
|
|
61
|
+
relay --help
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Initialize
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cd your-project
|
|
68
|
+
relay init
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Without an existing `openspec/` directory, an interactive menu appears:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Select initialization mode:
|
|
75
|
+
1. Simple mode — relay-kit standalone (no OpenSpec)
|
|
76
|
+
2. OpenSpec mode — integrated with OpenSpec for spec-driven development (recommended)
|
|
77
|
+
Choose mode (1/2, default 2):
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Choosing OpenSpec mode auto-creates the `openspec/` structure and installs all bundled commands and Skills. If an external `openspec` CLI is detected, you'll be prompted to choose between the built-in or external version.
|
|
81
|
+
|
|
82
|
+
Skip prompts with:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
relay init --mode openspec --yes
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Plan → Execute → Review
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# 1. Create an OpenSpec change
|
|
92
|
+
relay openspec new-change add-login
|
|
93
|
+
|
|
94
|
+
# 2. Have the Advisor plan and generate artifacts (run in your AI tool)
|
|
95
|
+
# /opsx:propose add-login
|
|
96
|
+
|
|
97
|
+
# 3. Generate the executor task
|
|
98
|
+
relay start --change add-login --title "Implement login"
|
|
99
|
+
|
|
100
|
+
# 4. Hand off to the Executor (run in your AI tool)
|
|
101
|
+
# /relay:run
|
|
102
|
+
|
|
103
|
+
# 5. Generate an escalation package when stuck
|
|
104
|
+
relay ask
|
|
105
|
+
|
|
106
|
+
# 6. Advisor reviews the result
|
|
107
|
+
relay review
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Command Reference
|
|
113
|
+
|
|
114
|
+
### Core Commands
|
|
115
|
+
|
|
116
|
+
| Command | Description |
|
|
117
|
+
|---------|-------------|
|
|
118
|
+
| `relay init` | Initialize project (interactive simple / openspec mode selection) |
|
|
119
|
+
| `relay start` | Generate EXECUTOR_TASK.md to begin a handoff run |
|
|
120
|
+
| `relay ask` | Generate ASK_ADVISOR.md escalation package when Executor is stuck |
|
|
121
|
+
| `relay resume` | Read ADVISOR_DECISION.md and generate RESUME_PROMPT.md to continue |
|
|
122
|
+
| `relay review` | Generate REVIEW_REQUEST.md for Advisor code review |
|
|
123
|
+
| `relay doctor` | Diagnose current project integration status |
|
|
124
|
+
| `relay sync` | Sync Skills and OpenSpec files to target tool directories |
|
|
125
|
+
|
|
126
|
+
### relay openspec Subcommands (Built-in OpenSpec CLI)
|
|
127
|
+
|
|
128
|
+
| Command | Description |
|
|
129
|
+
|---------|-------------|
|
|
130
|
+
| `relay openspec new-change <name>` | Create a new OpenSpec change |
|
|
131
|
+
| `relay openspec status --change <name>` | Show artifact completion status |
|
|
132
|
+
| `relay openspec list` | List all active changes |
|
|
133
|
+
| `relay openspec instructions <id> --change <name>` | Get artifact creation guidance (template + rules) |
|
|
134
|
+
| `relay openspec apply-instructions --change <name>` | Get apply instructions and task progress |
|
|
135
|
+
| `relay openspec archive <name>` | Archive a completed change |
|
|
136
|
+
| `relay openspec schemas` | List available workflow schemas |
|
|
137
|
+
|
|
138
|
+
### relay sync Options
|
|
139
|
+
|
|
140
|
+
| Option | Description |
|
|
141
|
+
|--------|-------------|
|
|
142
|
+
| `relay sync --skills` | Sync relay Skills to target tool directories |
|
|
143
|
+
| `relay sync --openspec` | Sync OpenSpec command/skill files |
|
|
144
|
+
| `relay sync --all` | Sync everything (Skills + OpenSpec files) |
|
|
145
|
+
| `--target claude \| codex \| all` | Specify target tool |
|
|
146
|
+
| `--scope project \| user` | Project-level or user-level (default: project) |
|
|
147
|
+
| `--dry-run` | Preview sync plan without writing files |
|
|
148
|
+
| `--force` | Overwrite conflicted target files |
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Workflow
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
/relay:plan /opsx:propose relay start
|
|
156
|
+
Planner ──────► PLAN_REPORT ───► proposal.md ───► EXECUTOR_TASK.md
|
|
157
|
+
(Advisor) design.md (handoff file)
|
|
158
|
+
tasks.md
|
|
159
|
+
│
|
|
160
|
+
┌────────────┘
|
|
161
|
+
▼
|
|
162
|
+
/relay:run
|
|
163
|
+
Executor ───► edit code ───► [x] complete tasks
|
|
164
|
+
│
|
|
165
|
+
┌──────────┴──────────┐
|
|
166
|
+
▼ ▼
|
|
167
|
+
Success Stuck / Failed
|
|
168
|
+
│ │
|
|
169
|
+
▼ ▼
|
|
170
|
+
relay review relay ask
|
|
171
|
+
REVIEW_REQUEST.md ASK_ADVISOR.md
|
|
172
|
+
│ │
|
|
173
|
+
▼ ▼
|
|
174
|
+
/relay:review Advisor Decision
|
|
175
|
+
Reviewer ───► │
|
|
176
|
+
APPROVE / ┌─────┴──────────────┐
|
|
177
|
+
NEEDS_CHANGES / ▼ ▼
|
|
178
|
+
REPLAN_REQUIRED CONTINUE REPLAN / FIX
|
|
179
|
+
│ │
|
|
180
|
+
▼ ▼
|
|
181
|
+
relay resume Re-plan
|
|
182
|
+
RESUME_PROMPT.md or DIRECT_FIX
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Directory Structure
|
|
188
|
+
|
|
189
|
+
After `relay init`:
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
your-project/
|
|
193
|
+
├── .relay/
|
|
194
|
+
│ ├── config.json # Project configuration
|
|
195
|
+
│ ├── state.json # Runtime state
|
|
196
|
+
│ └── skills/ # relay Skills managed copy
|
|
197
|
+
├── .relayignore # Context collection ignore rules
|
|
198
|
+
├── .opencode/ # OpenSpec commands/skills for OpenCode
|
|
199
|
+
├── .claude/
|
|
200
|
+
│ ├── commands/opsx/ # OpenSpec commands for Claude Code
|
|
201
|
+
│ └── skills/ # relay + OpenSpec Skills
|
|
202
|
+
├── .codex/
|
|
203
|
+
│ └── skills/ # OpenSpec Skills for Codex
|
|
204
|
+
├── .agents/
|
|
205
|
+
│ └── skills/ # relay Skills for Codex
|
|
206
|
+
├── openspec/ # OpenSpec specification directory
|
|
207
|
+
│ ├── changes/ # Active changes
|
|
208
|
+
│ ├── specs/ # Global specs
|
|
209
|
+
│ └── changes/archive/ # Archived changes
|
|
210
|
+
├── docs/agent-handoffs/runs/ # Handoff files
|
|
211
|
+
└── AGENTS.md # relay-kit execution rules injection
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Context Safety
|
|
217
|
+
|
|
218
|
+
`relay ask` and `relay review` apply **three layers of protection** when collecting context:
|
|
219
|
+
|
|
220
|
+
1. **Default ignores** — `.env`, `node_modules/`, `dist/`, `build/`, `*.pem`, `*.key`, etc.
|
|
221
|
+
2. **`.relayignore`** — Project-specific ignore rules with sensible defaults for sensitive paths.
|
|
222
|
+
3. **Basic redaction** — API keys, tokens, secrets, passwords, bearer tokens, private key blocks.
|
|
223
|
+
|
|
224
|
+
It's a guard layer against common leaks, not a full security scanner.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Migrating from External OpenSpec
|
|
229
|
+
|
|
230
|
+
If your project was previously initialized with the external `openspec` CLI (`@fission-ai/openspec`):
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
relay init --mode openspec --force # Replace with relay-kit built-in
|
|
234
|
+
relay sync --all # Update all Skills and OpenSpec files
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
relay-kit's OpenSpec implementation is fully format-compatible. Your existing `proposal.md`, `design.md`, `tasks.md`, and delta specs require no changes. Only the command/skill files in `.opencode/`, `.claude/commands/opsx/`, and `.codex/skills/openspec-*/` will be updated to call the built-in `relay openspec`.
|
|
238
|
+
|
|
239
|
+
## Credits
|
|
240
|
+
|
|
241
|
+
OpenSpec specification originated from [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec). relay-kit bundles an independent implementation that maintains format compatibility.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## License
|
|
246
|
+
|
|
247
|
+
[MIT](LICENSE)
|