fantasy-cli 1.2.6
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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +456 -0
- data/bin/gsd +8 -0
- data/bin/gsd-core-darwin-amd64 +0 -0
- data/bin/gsd-core-darwin-arm64 +0 -0
- data/bin/gsd-core-linux-amd64 +0 -0
- data/bin/gsd-core-linux-arm64 +0 -0
- data/bin/gsd-core-windows-amd64.exe +0 -0
- data/bin/gsd-core-windows-arm64.exe +0 -0
- data/bin/gsd-core.exe +0 -0
- data/lib/gsd/agents/coordinator.rb +195 -0
- data/lib/gsd/agents/task_manager.rb +158 -0
- data/lib/gsd/agents/worker.rb +162 -0
- data/lib/gsd/agents.rb +30 -0
- data/lib/gsd/ai/chat.rb +486 -0
- data/lib/gsd/ai/cli.rb +248 -0
- data/lib/gsd/ai/command_parser.rb +97 -0
- data/lib/gsd/ai/commands/base.rb +42 -0
- data/lib/gsd/ai/commands/clear.rb +20 -0
- data/lib/gsd/ai/commands/context.rb +30 -0
- data/lib/gsd/ai/commands/cost.rb +30 -0
- data/lib/gsd/ai/commands/export.rb +42 -0
- data/lib/gsd/ai/commands/help.rb +61 -0
- data/lib/gsd/ai/commands/model.rb +67 -0
- data/lib/gsd/ai/commands/reset.rb +22 -0
- data/lib/gsd/ai/config.rb +256 -0
- data/lib/gsd/ai/context.rb +324 -0
- data/lib/gsd/ai/cost_tracker.rb +361 -0
- data/lib/gsd/ai/git_context.rb +169 -0
- data/lib/gsd/ai/history.rb +384 -0
- data/lib/gsd/ai/providers/anthropic.rb +429 -0
- data/lib/gsd/ai/providers/base.rb +282 -0
- data/lib/gsd/ai/providers/lmstudio.rb +279 -0
- data/lib/gsd/ai/providers/ollama.rb +336 -0
- data/lib/gsd/ai/providers/openai.rb +396 -0
- data/lib/gsd/ai/providers/openrouter.rb +429 -0
- data/lib/gsd/ai/reference_resolver.rb +225 -0
- data/lib/gsd/ai/repl.rb +349 -0
- data/lib/gsd/ai/streaming.rb +438 -0
- data/lib/gsd/ai/ui.rb +429 -0
- data/lib/gsd/buddy/cli.rb +284 -0
- data/lib/gsd/buddy/gacha.rb +148 -0
- data/lib/gsd/buddy/renderer.rb +108 -0
- data/lib/gsd/buddy/species.rb +190 -0
- data/lib/gsd/buddy/stats.rb +156 -0
- data/lib/gsd/buddy.rb +28 -0
- data/lib/gsd/cli.rb +455 -0
- data/lib/gsd/commands.rb +198 -0
- data/lib/gsd/config.rb +183 -0
- data/lib/gsd/error.rb +188 -0
- data/lib/gsd/frontmatter.rb +123 -0
- data/lib/gsd/go/bridge.rb +173 -0
- data/lib/gsd/history.rb +76 -0
- data/lib/gsd/milestone.rb +75 -0
- data/lib/gsd/output.rb +184 -0
- data/lib/gsd/phase.rb +102 -0
- data/lib/gsd/plugins/base.rb +92 -0
- data/lib/gsd/plugins/cli.rb +330 -0
- data/lib/gsd/plugins/config.rb +164 -0
- data/lib/gsd/plugins/hooks.rb +132 -0
- data/lib/gsd/plugins/installer.rb +158 -0
- data/lib/gsd/plugins/loader.rb +122 -0
- data/lib/gsd/plugins/manager.rb +187 -0
- data/lib/gsd/plugins/marketplace.rb +142 -0
- data/lib/gsd/plugins/sandbox.rb +114 -0
- data/lib/gsd/plugins/search.rb +131 -0
- data/lib/gsd/plugins/validator.rb +157 -0
- data/lib/gsd/plugins.rb +48 -0
- data/lib/gsd/profile.rb +127 -0
- data/lib/gsd/research.rb +85 -0
- data/lib/gsd/roadmap.rb +90 -0
- data/lib/gsd/skills/bundled/commit.md +58 -0
- data/lib/gsd/skills/bundled/debug.md +28 -0
- data/lib/gsd/skills/bundled/explain.md +41 -0
- data/lib/gsd/skills/bundled/plan.md +42 -0
- data/lib/gsd/skills/bundled/verify.md +26 -0
- data/lib/gsd/skills/loader.rb +189 -0
- data/lib/gsd/state.rb +102 -0
- data/lib/gsd/template.rb +106 -0
- data/lib/gsd/tools/ask_user_question.rb +179 -0
- data/lib/gsd/tools/base.rb +204 -0
- data/lib/gsd/tools/bash.rb +246 -0
- data/lib/gsd/tools/file_edit.rb +297 -0
- data/lib/gsd/tools/file_read.rb +199 -0
- data/lib/gsd/tools/file_write.rb +153 -0
- data/lib/gsd/tools/glob.rb +202 -0
- data/lib/gsd/tools/grep.rb +227 -0
- data/lib/gsd/tools/gsd_frontmatter.rb +165 -0
- data/lib/gsd/tools/gsd_phase.rb +140 -0
- data/lib/gsd/tools/gsd_roadmap.rb +108 -0
- data/lib/gsd/tools/gsd_state.rb +143 -0
- data/lib/gsd/tools/gsd_template.rb +157 -0
- data/lib/gsd/tools/gsd_verify.rb +159 -0
- data/lib/gsd/tools/registry.rb +103 -0
- data/lib/gsd/tools/task.rb +235 -0
- data/lib/gsd/tools/todo_write.rb +290 -0
- data/lib/gsd/tools/web.rb +260 -0
- data/lib/gsd/tui/app.rb +366 -0
- data/lib/gsd/tui/auto_complete.rb +79 -0
- data/lib/gsd/tui/colors.rb +111 -0
- data/lib/gsd/tui/command_palette.rb +126 -0
- data/lib/gsd/tui/header.rb +38 -0
- data/lib/gsd/tui/input_box.rb +199 -0
- data/lib/gsd/tui/spinner.rb +40 -0
- data/lib/gsd/tui/status_bar.rb +51 -0
- data/lib/gsd/tui.rb +17 -0
- data/lib/gsd/validator.rb +216 -0
- data/lib/gsd/verify.rb +175 -0
- data/lib/gsd/version.rb +5 -0
- data/lib/gsd/workstream.rb +91 -0
- metadata +231 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 217a9baa9cd20147e0ee9eda4ea6dfa60e588497016e980ce0a166cbba9e1fb4
|
|
4
|
+
data.tar.gz: 4d5a0a2166132b1813cf22ccdcc8863cb9953181fab491ecd50e53269905d8bc
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 47e8ac63cb4e13310b49e3a45d45c197ebe256225535bcaeda6adcac9f6b7c8f6478a88c840b6154df97e9d4eed816c92c2ca0142c22cad29f92c5512a2f1bfb
|
|
7
|
+
data.tar.gz: 7506df3654df13a2e36dca7acb9cd8a61b877025446454df95eab31339f057633b1515e1a00fa6ab419dcfe6d3f96efee9a2b36fabcfb22c56640ca488258e1e
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GSD Team
|
|
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.
|
data/README.md
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
# GSD Tools - Ruby/Go CLI
|
|
2
|
+
|
|
3
|
+
[](https://github.com/claude-ruby/gsd/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.fury.io/rb/gsd)
|
|
5
|
+
[](https://go.dev/)
|
|
6
|
+
|
|
7
|
+
CLI de alta performance para gerenciamento de projetos GSD (Get Shit Done).
|
|
8
|
+
|
|
9
|
+
## 🚀 Features
|
|
10
|
+
|
|
11
|
+
- **Startup rápido**: ~23ms (vs ~100-500ms do Node.js) — **95% mais rápido**
|
|
12
|
+
- **Baixo uso de memória**: ~15MB (vs ~50-150MB do Node.js) — **90% menos**
|
|
13
|
+
- **Binários nativos**: Sem necessidade de runtime
|
|
14
|
+
- **Cross-platform**: Windows, Linux, macOS (amd64 + arm64)
|
|
15
|
+
- **Compatível**: Mesma interface CLI da versão anterior
|
|
16
|
+
|
|
17
|
+
## 📦 Instalação
|
|
18
|
+
|
|
19
|
+
### Opção 1: Ruby Gem (Recomendado)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Instalar gem
|
|
23
|
+
gem install gsd
|
|
24
|
+
|
|
25
|
+
# Verificar instalação
|
|
26
|
+
gsd version
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Opção 2: Binário Direto
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Download do binário para sua plataforma
|
|
33
|
+
# Windows amd64
|
|
34
|
+
curl -LO https://github.com/claude-ruby/gsd/releases/download/v1.0.0/gsd-core-windows-amd64.exe
|
|
35
|
+
mv gsd-core-windows-amd64.exe gsd-core.exe
|
|
36
|
+
|
|
37
|
+
# Linux amd64
|
|
38
|
+
curl -LO https://github.com/claude-ruby/gsd/releases/download/v1.0.0/gsd-core-linux-amd64
|
|
39
|
+
chmod +x gsd-core-linux-amd64
|
|
40
|
+
mv gsd-core-linux-amd64 gsd-core
|
|
41
|
+
|
|
42
|
+
# macOS Intel
|
|
43
|
+
curl -LO https://github.com/claude-ruby/gsd/releases/download/v1.0.0/gsd-core-darwin-amd64
|
|
44
|
+
chmod +x gsd-core-darwin-amd64
|
|
45
|
+
mv gsd-core-darwin-amd64 gsd-core
|
|
46
|
+
|
|
47
|
+
# macOS M1/M2
|
|
48
|
+
curl -LO https://github.com/claude-ruby/gsd/releases/download/v1.0.0/gsd-core-darwin-arm64
|
|
49
|
+
chmod +x gsd-core-darwin-arm64
|
|
50
|
+
mv gsd-core-darwin-arm64 gsd-core
|
|
51
|
+
|
|
52
|
+
# Adicionar ao PATH
|
|
53
|
+
mv gsd-core /usr/local/bin/
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Opção 3: Build from Source
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Pré-requisitos
|
|
60
|
+
# - Go 1.21+
|
|
61
|
+
# - Ruby 3.0+
|
|
62
|
+
|
|
63
|
+
# Clonar repositório
|
|
64
|
+
git clone https://github.com/claude-ruby/gsd.git
|
|
65
|
+
cd gsd
|
|
66
|
+
|
|
67
|
+
# Build completo
|
|
68
|
+
make build
|
|
69
|
+
|
|
70
|
+
# Ou apenas Go
|
|
71
|
+
make build-go
|
|
72
|
+
|
|
73
|
+
# Ou apenas Ruby
|
|
74
|
+
make build-ruby
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Pré-requisitos
|
|
78
|
+
|
|
79
|
+
| Componente | Versão Mínima | Opcional |
|
|
80
|
+
|------------|---------------|----------|
|
|
81
|
+
| Go | 1.21+ | Apenas para build from source |
|
|
82
|
+
| Ruby | 3.0+ | Apenas para gem installation |
|
|
83
|
+
| Bundler | 2.0+ | Apenas para desenvolvimento |
|
|
84
|
+
|
|
85
|
+
## 💻 Uso
|
|
86
|
+
|
|
87
|
+
### Comandos Básicos
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Help
|
|
91
|
+
gsd help
|
|
92
|
+
|
|
93
|
+
# Version
|
|
94
|
+
gsd version
|
|
95
|
+
|
|
96
|
+
# Hello (teste)
|
|
97
|
+
gsd hello
|
|
98
|
+
gsd hello --name=World
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### State Commands
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Carregar STATE.md
|
|
105
|
+
gsd state load
|
|
106
|
+
|
|
107
|
+
# Output como JSON
|
|
108
|
+
gsd state json
|
|
109
|
+
|
|
110
|
+
# Atualizar campo
|
|
111
|
+
gsd state update --field current_phase --value 2
|
|
112
|
+
|
|
113
|
+
# Batch update
|
|
114
|
+
gsd state patch --field plans_of 1 --field progress 33%
|
|
115
|
+
|
|
116
|
+
# Obter conteúdo ou seção
|
|
117
|
+
gsd state get
|
|
118
|
+
gsd state get Notes
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Phase Commands
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Encontrar phase
|
|
125
|
+
gsd phase find 1
|
|
126
|
+
|
|
127
|
+
# Listar todas phases
|
|
128
|
+
gsd phase list
|
|
129
|
+
|
|
130
|
+
# Calcular próxima decimal
|
|
131
|
+
gsd phase next-decimal 1
|
|
132
|
+
|
|
133
|
+
# Adicionar nova phase
|
|
134
|
+
gsd phase add "New Phase"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Roadmap Commands
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Extrair phase do ROADMAP.md
|
|
141
|
+
gsd roadmap get-phase 1
|
|
142
|
+
|
|
143
|
+
# Análise completa
|
|
144
|
+
gsd roadmap analyze
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Verify Commands
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Verificar estrutura do PLAN.md
|
|
151
|
+
gsd verify plan-structure .planning/phases/01-phase/PLAN.md
|
|
152
|
+
|
|
153
|
+
# Verificar completude da phase
|
|
154
|
+
gsd verify phase-completeness 1
|
|
155
|
+
|
|
156
|
+
# Verificar referências
|
|
157
|
+
gsd verify references .planning/phases/01-phase/PLAN.md
|
|
158
|
+
|
|
159
|
+
# Verificar commits
|
|
160
|
+
gsd verify commits abc123 def456
|
|
161
|
+
|
|
162
|
+
# Verificar artefatos
|
|
163
|
+
gsd verify artifacts .planning/phases/01-phase/PLAN.md
|
|
164
|
+
|
|
165
|
+
# Verificar key links
|
|
166
|
+
gsd verify key-links .planning/phases/01-phase/PLAN.md
|
|
167
|
+
|
|
168
|
+
# Verificar tasks
|
|
169
|
+
gsd verify tasks .planning/phases/01-phase/PLAN.md
|
|
170
|
+
|
|
171
|
+
# Verificar summary
|
|
172
|
+
gsd verify summary .planning/phases/01-phase/SUMMARY.md
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Template Commands
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Preencher SUMMARY.md
|
|
179
|
+
gsd template fill summary --phase 1 --plan 1 --name "Summary"
|
|
180
|
+
|
|
181
|
+
# Preencher PLAN.md
|
|
182
|
+
gsd template fill plan --phase 1 --plan 1 --type execute
|
|
183
|
+
|
|
184
|
+
# Preencher VERIFICATION.md
|
|
185
|
+
gsd template fill verification --phase 1
|
|
186
|
+
|
|
187
|
+
# Preencher CONTEXT.md
|
|
188
|
+
gsd template fill context --phase 1
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Frontmatter Commands
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Extrair frontmatter
|
|
195
|
+
gsd frontmatter get .planning/STATE.md
|
|
196
|
+
gsd frontmatter get .planning/STATE.md --field model_profile
|
|
197
|
+
|
|
198
|
+
# Atualizar campo
|
|
199
|
+
gsd frontmatter set .planning/STATE.md --field status --value complete
|
|
200
|
+
|
|
201
|
+
# Merge JSON
|
|
202
|
+
gsd frontmatter merge .planning/STATE.md --data '{"status":"done"}'
|
|
203
|
+
|
|
204
|
+
# Validar schema
|
|
205
|
+
gsd frontmatter validate .planning/STATE.md --schema plan
|
|
206
|
+
|
|
207
|
+
# Extrair campos específicos
|
|
208
|
+
gsd frontmatter extract .planning/STATE.md --fields phase,plan,status
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Milestone Commands
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Completar milestone
|
|
215
|
+
gsd milestone complete v1.0.0 --name "Version 1"
|
|
216
|
+
|
|
217
|
+
# Arquivar milestone
|
|
218
|
+
gsd milestone archive v1.0.0
|
|
219
|
+
|
|
220
|
+
# Marcar requirements como completos
|
|
221
|
+
gsd milestone requirements mark-complete REQ-01,REQ-02
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Workstream Commands
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Obter workstream atual
|
|
228
|
+
gsd workstream get
|
|
229
|
+
|
|
230
|
+
# Definir workstream
|
|
231
|
+
gsd workstream set my-workstream
|
|
232
|
+
|
|
233
|
+
# Listar workstreams
|
|
234
|
+
gsd workstream list
|
|
235
|
+
|
|
236
|
+
# Limpar workstream
|
|
237
|
+
gsd workstream clear
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### History Commands
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# History digest
|
|
244
|
+
gsd history digest
|
|
245
|
+
|
|
246
|
+
# Extrair summary
|
|
247
|
+
gsd history summary-extract .planning/phases/01-phase/SUMMARY.md
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Profile Commands
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# Obter profile
|
|
254
|
+
gsd profile get default
|
|
255
|
+
|
|
256
|
+
# Definir profile
|
|
257
|
+
gsd profile set my-profile --model claude-sonnet-4-5-20250929
|
|
258
|
+
|
|
259
|
+
# Listar profiles
|
|
260
|
+
gsd profile list
|
|
261
|
+
|
|
262
|
+
# Definir profile padrão
|
|
263
|
+
gsd profile set-default default
|
|
264
|
+
|
|
265
|
+
# Obter profile para agent
|
|
266
|
+
gsd profile get-agent researcher
|
|
267
|
+
|
|
268
|
+
# Definir profile para agent
|
|
269
|
+
gsd profile set-agent researcher my-profile
|
|
270
|
+
|
|
271
|
+
# Obter pipeline config
|
|
272
|
+
gsd profile pipeline
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Research Commands
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Web search (requer BRAVE_API_KEY)
|
|
279
|
+
gsd research websearch "query" --limit 10 --freshness week
|
|
280
|
+
|
|
281
|
+
# Iniciar research
|
|
282
|
+
gsd research start 1
|
|
283
|
+
|
|
284
|
+
# Completar research
|
|
285
|
+
gsd research complete 1
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### UAT Commands
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Audit UAT
|
|
292
|
+
gsd uat audit-uat
|
|
293
|
+
|
|
294
|
+
# Render checkpoint
|
|
295
|
+
gsd uat render-checkpoint --file .planning/phases/01-phase/UAT.md
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Progress Commands
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Output JSON
|
|
302
|
+
gsd progress json
|
|
303
|
+
|
|
304
|
+
# Output table
|
|
305
|
+
gsd progress table
|
|
306
|
+
|
|
307
|
+
# Output bar
|
|
308
|
+
gsd progress bar
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Scaffold Commands
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
# Criar CONTEXT.md
|
|
315
|
+
gsd scaffold context --phase 1 --name "Context"
|
|
316
|
+
|
|
317
|
+
# Criar UAT.md
|
|
318
|
+
gsd scaffold uat --phase 1 --name "UAT"
|
|
319
|
+
|
|
320
|
+
# Criar VERIFICATION.md
|
|
321
|
+
gsd scaffold verification --phase 1 --name "Verification"
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Init Commands
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
# Iniciar execute-phase workflow
|
|
328
|
+
gsd init execute-phase --phase 1
|
|
329
|
+
|
|
330
|
+
# Iniciar plan-phase workflow
|
|
331
|
+
gsd init plan-phase --phase 1
|
|
332
|
+
|
|
333
|
+
# Iniciar new-project workflow
|
|
334
|
+
gsd init new-project
|
|
335
|
+
|
|
336
|
+
# Iniciar new-milestone workflow
|
|
337
|
+
gsd init new-milestone
|
|
338
|
+
|
|
339
|
+
# Iniciar quick workflow
|
|
340
|
+
gsd init quick "description"
|
|
341
|
+
|
|
342
|
+
# Iniciar resume workflow
|
|
343
|
+
gsd init resume
|
|
344
|
+
|
|
345
|
+
# Iniciar verify-work workflow
|
|
346
|
+
gsd init verify-work --phase 1
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
## 🏗️ Arquitetura
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
gsd (Ruby CLI)
|
|
353
|
+
└── gsd-core (Go binary)
|
|
354
|
+
├── pkg/state — State operations (STATE.md)
|
|
355
|
+
├── pkg/phase — Phase operations (directories)
|
|
356
|
+
├── pkg/roadmap — Roadmap operations (ROADMAP.md)
|
|
357
|
+
├── pkg/verify — Verification operations
|
|
358
|
+
├── pkg/template — Template filling
|
|
359
|
+
├── pkg/frontmatter — Frontmatter CRUD
|
|
360
|
+
├── pkg/milestone — Milestone operations
|
|
361
|
+
├── pkg/workstream — Workstream management
|
|
362
|
+
├── pkg/history — History digest
|
|
363
|
+
├── pkg/profile — Model profiles
|
|
364
|
+
├── pkg/research — Web research
|
|
365
|
+
├── pkg/uat — UAT audit
|
|
366
|
+
├── pkg/progress — Progress tracking
|
|
367
|
+
├── pkg/scaffold — Scaffolding
|
|
368
|
+
└── pkg/init — Init workflows
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### Bridge Ruby ↔ Go
|
|
372
|
+
|
|
373
|
+
A comunicação é feita via subprocess:
|
|
374
|
+
|
|
375
|
+
```ruby
|
|
376
|
+
require 'gsd/go/bridge'
|
|
377
|
+
|
|
378
|
+
result = Gsd::Go::Bridge.call('state', { 'json' => true }, cwd: '/path')
|
|
379
|
+
puts result['data']['model_profile']
|
|
380
|
+
# => "default"
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
## 🧪 Tests
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
# Todos os tests
|
|
387
|
+
make test
|
|
388
|
+
|
|
389
|
+
# Apenas Go
|
|
390
|
+
make test-go
|
|
391
|
+
|
|
392
|
+
# Apenas Ruby
|
|
393
|
+
make test-ruby
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
## 📊 Performance
|
|
397
|
+
|
|
398
|
+
| Metric | Node.js | Ruby/Go | Improvement |
|
|
399
|
+
|--------|---------|---------|-------------|
|
|
400
|
+
| Startup | ~100-500ms | ~23ms | **95% mais rápido** |
|
|
401
|
+
| Memory | ~50-150MB | ~15MB | **90% menos** |
|
|
402
|
+
| Binary Size | N/A | ~11MB | **Native binary** |
|
|
403
|
+
|
|
404
|
+
## 📋 Comandos Disponíveis
|
|
405
|
+
|
|
406
|
+
| Categoria | Commands |
|
|
407
|
+
|-----------|----------|
|
|
408
|
+
| **Base** | hello, version, help |
|
|
409
|
+
| **State** | load, json, update, patch, get |
|
|
410
|
+
| **Phase** | find, list, next-decimal, add |
|
|
411
|
+
| **Roadmap** | get-phase, analyze |
|
|
412
|
+
| **Verify** | plan-structure, phase-completeness, references, commits, artifacts, key-links, tasks, summary |
|
|
413
|
+
| **Template** | fill summary, fill plan, fill verification, fill context |
|
|
414
|
+
| **Frontmatter** | get, set, merge, validate, extract |
|
|
415
|
+
| **Milestone** | complete, archive, requirements mark-complete |
|
|
416
|
+
| **Workstream** | get, set, list, clear |
|
|
417
|
+
| **History** | digest, summary-extract |
|
|
418
|
+
| **Profile** | get, set, list, set-default, get-agent, set-agent, pipeline |
|
|
419
|
+
| **Research** | websearch, start, complete |
|
|
420
|
+
| **UAT** | audit-uat, render-checkpoint |
|
|
421
|
+
| **Progress** | json, table, bar |
|
|
422
|
+
| **Scaffold** | context, uat, verification |
|
|
423
|
+
| **Init** | execute-phase, plan-phase, new-project, new-milestone, quick, resume, verify-work |
|
|
424
|
+
|
|
425
|
+
**Total:** 70+ commands
|
|
426
|
+
|
|
427
|
+
## 🗺️ Roadmap
|
|
428
|
+
|
|
429
|
+
- [x] Fase 1: Fundação (setup, build, CI/CD)
|
|
430
|
+
- [x] Fase 2: Core Go (state, phase, roadmap)
|
|
431
|
+
- [x] Fase 3: Ruby Bridge (integração completa)
|
|
432
|
+
- [x] Fase 4: Features (verify, template, frontmatter, etc.)
|
|
433
|
+
- [x] Fase 5: Polimento (cross-compilation, performance, docs)
|
|
434
|
+
- [x] Semana 1: Windows Cross-Compilation
|
|
435
|
+
- [x] Semana 2: Linux Cross-Compilation
|
|
436
|
+
- [x] Semana 3: macOS Cross-Compilation
|
|
437
|
+
- [x] Semana 4: Startup Time <50ms
|
|
438
|
+
- [x] Semana 5: Memory <50MB
|
|
439
|
+
- [x] Semana 6: Core Documentation
|
|
440
|
+
- [x] Semana 7: Migration Docs
|
|
441
|
+
- [x] Semana 8: CI/CD
|
|
442
|
+
- [x] Semana 9: Security
|
|
443
|
+
- [x] Semana 10: Testing
|
|
444
|
+
- [x] Semana 11: Beta
|
|
445
|
+
- [x] Semana 12: Release v1.0.0
|
|
446
|
+
|
|
447
|
+
## 📄 Licença
|
|
448
|
+
|
|
449
|
+
MIT - veja [LICENSE](LICENSE) para detalhes.
|
|
450
|
+
|
|
451
|
+
## 🔗 Links
|
|
452
|
+
|
|
453
|
+
- [Repositório](https://github.com/claude-ruby/gsd)
|
|
454
|
+
- [Issues](https://github.com/claude-ruby/gsd/issues)
|
|
455
|
+
- [Documentação Completa](docs/)
|
|
456
|
+
- [Migration Guide](docs/MIGRATION.md)
|
data/bin/gsd
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/bin/gsd-core.exe
ADDED
|
Binary file
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'securerandom'
|
|
4
|
+
|
|
5
|
+
module Gsd
|
|
6
|
+
module Agents
|
|
7
|
+
# Coordinator - Core orchestrator de agentes
|
|
8
|
+
#
|
|
9
|
+
# Responsável por:
|
|
10
|
+
# - Spawn de workers
|
|
11
|
+
# - Gerenciamento de tarefas
|
|
12
|
+
# - Comunicação com agentes
|
|
13
|
+
# - Agregação de resultados
|
|
14
|
+
class Coordinator
|
|
15
|
+
attr_reader :workers, :tasks
|
|
16
|
+
|
|
17
|
+
# Inicializa o Coordinator
|
|
18
|
+
#
|
|
19
|
+
# @param options [Hash] Opções
|
|
20
|
+
def initialize(options = {})
|
|
21
|
+
@workers = {}
|
|
22
|
+
@tasks = {}
|
|
23
|
+
@max_concurrent = options[:max_concurrent] || 5
|
|
24
|
+
@timeout = options[:timeout] || 300
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Spawn de worker
|
|
28
|
+
#
|
|
29
|
+
# @param type [Symbol] Tipo do agente
|
|
30
|
+
# @param prompt [String] Prompt para o agente
|
|
31
|
+
# @param options [Hash] Opções adicionais
|
|
32
|
+
# @return [Worker] Worker criado
|
|
33
|
+
def spawn(type: :worker, prompt:, **options)
|
|
34
|
+
worker_id = "worker-#{SecureRandom.uuid[0..8]}"
|
|
35
|
+
|
|
36
|
+
worker = Worker.new(
|
|
37
|
+
id: worker_id,
|
|
38
|
+
type: type,
|
|
39
|
+
prompt: prompt,
|
|
40
|
+
timeout: @timeout,
|
|
41
|
+
**options
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
@workers[worker_id] = worker
|
|
45
|
+
|
|
46
|
+
worker
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Envia mensagem para worker
|
|
50
|
+
#
|
|
51
|
+
# @param worker_id [String] ID do worker
|
|
52
|
+
# @param message [String] Mensagem
|
|
53
|
+
# @return [void]
|
|
54
|
+
def send_message(worker_id, message)
|
|
55
|
+
worker = @workers[worker_id]
|
|
56
|
+
raise ArgumentError, "Worker not found: #{worker_id}" unless worker
|
|
57
|
+
|
|
58
|
+
worker.continue(message)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Para worker
|
|
62
|
+
#
|
|
63
|
+
# @param worker_id [String] ID do worker
|
|
64
|
+
# @return [void]
|
|
65
|
+
def stop(worker_id)
|
|
66
|
+
worker = @workers[worker_id]
|
|
67
|
+
raise ArgumentError, "Worker not found: #{worker_id}" unless worker
|
|
68
|
+
|
|
69
|
+
worker.stop
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Obtém status do worker
|
|
73
|
+
#
|
|
74
|
+
# @param worker_id [String] ID do worker
|
|
75
|
+
# @return [Hash] Status
|
|
76
|
+
def status(worker_id)
|
|
77
|
+
worker = @workers[worker_id]
|
|
78
|
+
return nil unless worker
|
|
79
|
+
|
|
80
|
+
worker.status
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Obtém resultados do worker
|
|
84
|
+
#
|
|
85
|
+
# @param worker_id [String] ID do worker
|
|
86
|
+
# @return [Hash, nil] Resultados
|
|
87
|
+
def get_results(worker_id)
|
|
88
|
+
worker = @workers[worker_id]
|
|
89
|
+
return nil unless worker
|
|
90
|
+
|
|
91
|
+
worker.results
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Lista workers
|
|
95
|
+
#
|
|
96
|
+
# @return [Array<Hash>] Lista de workers
|
|
97
|
+
def list_workers
|
|
98
|
+
@workers.values.map(&:status)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Lista workers ativos
|
|
102
|
+
#
|
|
103
|
+
# @return [Array<Hash>] Workers ativos
|
|
104
|
+
def list_active
|
|
105
|
+
@workers.values.select { |w| w.active? }.map(&:status)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Aguarda todos workers completarem
|
|
109
|
+
#
|
|
110
|
+
# @param timeout [Integer] Timeout em segundos
|
|
111
|
+
# @return [void]
|
|
112
|
+
def wait_all(timeout: nil)
|
|
113
|
+
timeout ||= @timeout
|
|
114
|
+
start = Time.now
|
|
115
|
+
|
|
116
|
+
@workers.values.each do |worker|
|
|
117
|
+
remaining = timeout - (Time.now - start)
|
|
118
|
+
break if remaining <= 0
|
|
119
|
+
|
|
120
|
+
worker.wait(timeout: remaining)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Cria tarefa
|
|
125
|
+
#
|
|
126
|
+
# @param description [String] Descrição
|
|
127
|
+
# @param worker_id [String] ID do worker
|
|
128
|
+
# @return [Hash] Tarefa criada
|
|
129
|
+
def create_task(description, worker_id: nil)
|
|
130
|
+
task_id = "task-#{SecureRandom.uuid[0..8]}"
|
|
131
|
+
|
|
132
|
+
task = {
|
|
133
|
+
id: task_id,
|
|
134
|
+
description: description,
|
|
135
|
+
worker_id: worker_id,
|
|
136
|
+
status: :pending,
|
|
137
|
+
created_at: Time.now
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@tasks[task_id] = task
|
|
141
|
+
task
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Atualiza tarefa
|
|
145
|
+
#
|
|
146
|
+
# @param task_id [String] ID da tarefa
|
|
147
|
+
# @param updates [Hash] Atualizações
|
|
148
|
+
# @return [Hash] Tarefa atualizada
|
|
149
|
+
def update_task(task_id, updates)
|
|
150
|
+
task = @tasks[task_id]
|
|
151
|
+
return nil unless task
|
|
152
|
+
|
|
153
|
+
task.merge!(updates)
|
|
154
|
+
task
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Obtém tarefa
|
|
158
|
+
#
|
|
159
|
+
# @param task_id [String] ID da tarefa
|
|
160
|
+
# @return [Hash, nil] Tarefa
|
|
161
|
+
def get_task(task_id)
|
|
162
|
+
@tasks[task_id]
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Lista tarefas
|
|
166
|
+
#
|
|
167
|
+
# @return [Array<Hash>] Lista de tarefas
|
|
168
|
+
def list_tasks
|
|
169
|
+
@tasks.values
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Limpa workers completados
|
|
173
|
+
#
|
|
174
|
+
# @return [Integer] Número de workers limpos
|
|
175
|
+
def cleanup
|
|
176
|
+
completed = @workers.select { |_, w| w.completed? || w.failed? }
|
|
177
|
+
completed.each_key { |id| @workers.delete(id) }
|
|
178
|
+
completed.count
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Estatísticas
|
|
182
|
+
#
|
|
183
|
+
# @return [Hash] Estatísticas
|
|
184
|
+
def stats
|
|
185
|
+
{
|
|
186
|
+
total_workers: @workers.count,
|
|
187
|
+
active_workers: list_active.count,
|
|
188
|
+
total_tasks: @tasks.count,
|
|
189
|
+
pending_tasks: @tasks.count { |_, t| t[:status] == :pending },
|
|
190
|
+
completed_tasks: @tasks.count { |_, t| t[:status] == :completed }
|
|
191
|
+
}
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
end
|