devflow-agents 0.7.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.
- package/.claude/commands/agents/architect.md +1162 -0
- package/.claude/commands/agents/architect.meta.yaml +124 -0
- package/.claude/commands/agents/builder.md +1432 -0
- package/.claude/commands/agents/builder.meta.yaml +117 -0
- package/.claude/commands/agents/chronicler.md +633 -0
- package/.claude/commands/agents/chronicler.meta.yaml +217 -0
- package/.claude/commands/agents/guardian.md +456 -0
- package/.claude/commands/agents/guardian.meta.yaml +127 -0
- package/.claude/commands/agents/strategist.md +483 -0
- package/.claude/commands/agents/strategist.meta.yaml +158 -0
- package/.claude/commands/agents/system-designer.md +1137 -0
- package/.claude/commands/agents/system-designer.meta.yaml +156 -0
- package/.claude/commands/devflow-help.md +93 -0
- package/.claude/commands/devflow-status.md +60 -0
- package/.claude/commands/quick/create-adr.md +82 -0
- package/.claude/commands/quick/new-feature.md +57 -0
- package/.claude/commands/quick/security-check.md +54 -0
- package/.claude/commands/quick/system-design.md +58 -0
- package/.claude_project +52 -0
- package/.devflow/agents/architect.meta.yaml +122 -0
- package/.devflow/agents/builder.meta.yaml +116 -0
- package/.devflow/agents/chronicler.meta.yaml +222 -0
- package/.devflow/agents/guardian.meta.yaml +127 -0
- package/.devflow/agents/strategist.meta.yaml +158 -0
- package/.devflow/agents/system-designer.meta.yaml +265 -0
- package/.devflow/project.yaml +242 -0
- package/.gitignore-template +83 -0
- package/LICENSE +21 -0
- package/README.md +244 -0
- package/bin/devflow.js +32 -0
- package/lib/constants.js +75 -0
- package/lib/init.js +162 -0
- package/lib/update.js +181 -0
- package/lib/utils.js +157 -0
- package/package.json +46 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# DevFlow .gitignore
|
|
2
|
+
|
|
3
|
+
# Node modules (se usar JavaScript/TypeScript)
|
|
4
|
+
node_modules/
|
|
5
|
+
npm-debug.log*
|
|
6
|
+
yarn-debug.log*
|
|
7
|
+
yarn-error.log*
|
|
8
|
+
|
|
9
|
+
# Environment variables
|
|
10
|
+
.env
|
|
11
|
+
.env.local
|
|
12
|
+
.env.*.local
|
|
13
|
+
|
|
14
|
+
# Local settings (não distribuir)
|
|
15
|
+
*.local.json
|
|
16
|
+
settings.local.json
|
|
17
|
+
|
|
18
|
+
# IDE específicos
|
|
19
|
+
.vscode/*
|
|
20
|
+
!.vscode/settings.json
|
|
21
|
+
!.vscode/tasks.json
|
|
22
|
+
!.vscode/launch.json
|
|
23
|
+
!.vscode/extensions.json
|
|
24
|
+
.idea/
|
|
25
|
+
*.swp
|
|
26
|
+
*.swo
|
|
27
|
+
*~
|
|
28
|
+
|
|
29
|
+
# OS específicos
|
|
30
|
+
.DS_Store
|
|
31
|
+
Thumbs.db
|
|
32
|
+
|
|
33
|
+
# Build outputs
|
|
34
|
+
dist/
|
|
35
|
+
build/
|
|
36
|
+
*.tsbuildinfo
|
|
37
|
+
|
|
38
|
+
# Logs
|
|
39
|
+
logs/
|
|
40
|
+
*.log
|
|
41
|
+
|
|
42
|
+
# Temporary files
|
|
43
|
+
tmp/
|
|
44
|
+
temp/
|
|
45
|
+
*.tmp
|
|
46
|
+
|
|
47
|
+
# Python (se usar)
|
|
48
|
+
__pycache__/
|
|
49
|
+
*.py[cod]
|
|
50
|
+
*$py.class
|
|
51
|
+
.Python
|
|
52
|
+
venv/
|
|
53
|
+
env/
|
|
54
|
+
|
|
55
|
+
# Arquivos grandes ou sensíveis
|
|
56
|
+
*.zip
|
|
57
|
+
*.tar.gz
|
|
58
|
+
*.rar
|
|
59
|
+
|
|
60
|
+
# Mantenha estas pastas (não ignore)
|
|
61
|
+
# Importante: queremos versionar a documentação!
|
|
62
|
+
!.devflow/
|
|
63
|
+
!docs/
|
|
64
|
+
!planning/
|
|
65
|
+
!architecture/
|
|
66
|
+
!CHANGELOG.md
|
|
67
|
+
|
|
68
|
+
# Snapshots podem ser grandes, você decide se quer versionar
|
|
69
|
+
# Descomente a linha abaixo se NÃO quiser versionar snapshots:
|
|
70
|
+
# docs/snapshots/*.json
|
|
71
|
+
|
|
72
|
+
# DevFlow Development (não incluir no release)
|
|
73
|
+
build-release.sh # Script de build fica apenas no dev
|
|
74
|
+
|
|
75
|
+
# Web IDE build artifacts (users run npm install themselves)
|
|
76
|
+
web/.next/
|
|
77
|
+
web/node_modules/
|
|
78
|
+
web/CHANGELOG.md
|
|
79
|
+
web/README.md
|
|
80
|
+
|
|
81
|
+
# Releases geradas (versionadas separadamente)
|
|
82
|
+
# Mantenha release/ versionado para distribuição
|
|
83
|
+
!release/
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Evolve Labs
|
|
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,244 @@
|
|
|
1
|
+
# DevFlow v0.7.0 - Sistema Multi-Agentes + Web IDE
|
|
2
|
+
|
|
3
|
+
Sistema de multi-agentes especializados para desenvolvimento de software, com **6 agentes** e **Web IDE** integrada.
|
|
4
|
+
|
|
5
|
+
[](docs/CHANGELOG.md)
|
|
6
|
+
[](https://www.npmjs.com/package/devflow-agents)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
## Screenshots
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🆕 Novidades v0.5.0 - Terminal como Interface Principal
|
|
24
|
+
|
|
25
|
+
### Web IDE
|
|
26
|
+
Interface visual completa para gerenciar seu projeto DevFlow:
|
|
27
|
+
|
|
28
|
+
- **Terminal Integrado** - Interface principal via xterm.js + node-pty
|
|
29
|
+
- **Dashboard** - Métricas do projeto, health check, status dos agentes
|
|
30
|
+
- **Specs Panel** - Visualize requirements, design decisions e tasks
|
|
31
|
+
- **File Explorer** - Navegue pelo código com preview de markdown/mermaid
|
|
32
|
+
- **Editor Monaco** - Editor profissional com syntax highlighting
|
|
33
|
+
- **Settings** - Configure tema, fonte, terminal
|
|
34
|
+
|
|
35
|
+
### Melhorias v0.5.0
|
|
36
|
+
- Terminal substituiu Chat como interface principal
|
|
37
|
+
- WebGL addon para renderização nítida em displays retina
|
|
38
|
+
- Toast notifications para feedback de operações
|
|
39
|
+
- Skeleton loaders para estados de carregamento
|
|
40
|
+
- Suporte a Windows via WSL
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🚀 Instalacao
|
|
45
|
+
|
|
46
|
+
### Via npm (Recomendado)
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Instala DevFlow no seu projeto (sem instalar nada globalmente)
|
|
50
|
+
npx devflow-agents init
|
|
51
|
+
|
|
52
|
+
# Ou instale globalmente para usar em multiplos projetos
|
|
53
|
+
npm install -g devflow-agents
|
|
54
|
+
devflow init /caminho/para/seu-projeto
|
|
55
|
+
|
|
56
|
+
# Opcoes de instalacao
|
|
57
|
+
devflow init # Agentes + estrutura de docs (padrao)
|
|
58
|
+
devflow init --agents-only # Apenas agentes (minimo)
|
|
59
|
+
devflow init --full # Tudo incluindo .gitignore
|
|
60
|
+
|
|
61
|
+
# Atualizar instalacao existente
|
|
62
|
+
devflow update
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Via bash script (Alternativa)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git clone https://github.com/evolve-labs-cloud/devflow.git
|
|
69
|
+
cd devflow
|
|
70
|
+
./install.sh /caminho/para/seu-projeto
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Requisitos
|
|
74
|
+
|
|
75
|
+
- **Claude Code CLI** (`npm i -g @anthropic-ai/claude-code`)
|
|
76
|
+
- **Node.js 18+** (para o CLI npm)
|
|
77
|
+
- **Git** (recomendado)
|
|
78
|
+
|
|
79
|
+
### Dependências por Sistema
|
|
80
|
+
|
|
81
|
+
#### Debian/Ubuntu
|
|
82
|
+
```bash
|
|
83
|
+
sudo apt-get update
|
|
84
|
+
sudo apt-get install -y build-essential python3 git
|
|
85
|
+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
|
86
|
+
sudo apt-get install -y nodejs
|
|
87
|
+
npm install -g @anthropic-ai/claude-code
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Fedora
|
|
91
|
+
```bash
|
|
92
|
+
sudo dnf groupinstall -y "Development Tools"
|
|
93
|
+
sudo dnf install -y python3 git nodejs npm
|
|
94
|
+
npm install -g @anthropic-ai/claude-code
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
#### RHEL/CentOS/Rocky
|
|
98
|
+
```bash
|
|
99
|
+
sudo dnf groupinstall -y "Development Tools"
|
|
100
|
+
sudo dnf install -y python3 git
|
|
101
|
+
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
|
|
102
|
+
sudo dnf install -y nodejs
|
|
103
|
+
npm install -g @anthropic-ai/claude-code
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### macOS
|
|
107
|
+
```bash
|
|
108
|
+
xcode-select --install
|
|
109
|
+
brew install node
|
|
110
|
+
npm install -g @anthropic-ai/claude-code
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### Windows (WSL)
|
|
114
|
+
```powershell
|
|
115
|
+
# PowerShell como Admin
|
|
116
|
+
wsl --install
|
|
117
|
+
```
|
|
118
|
+
Depois siga as instruções de Debian/Ubuntu no terminal WSL.
|
|
119
|
+
|
|
120
|
+
### Web IDE (Opcional)
|
|
121
|
+
```bash
|
|
122
|
+
cd devflow/web
|
|
123
|
+
npm install
|
|
124
|
+
npm run dev
|
|
125
|
+
# Acesse http://localhost:3000
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 🤖 Os 6 Agentes
|
|
131
|
+
|
|
132
|
+
| # | Agente | Funcao | Uso |
|
|
133
|
+
|---|--------|--------|-----|
|
|
134
|
+
| 1 | **/agents:strategist** | Planejamento & Produto | Requisitos, PRDs, user stories |
|
|
135
|
+
| 2 | **/agents:architect** | Design & Arquitetura | Decisoes tecnicas, ADRs, APIs |
|
|
136
|
+
| 3 | **/agents:system-designer** | System Design & Escala | SDDs, RFCs, capacity planning, SLOs |
|
|
137
|
+
| 4 | **/agents:builder** | Implementacao | Codigo, reviews, refactoring |
|
|
138
|
+
| 5 | **/agents:guardian** | Qualidade & Seguranca | Testes, security, performance |
|
|
139
|
+
| 6 | **/agents:chronicler** | Documentacao & Memoria | CHANGELOG, snapshots, stories |
|
|
140
|
+
|
|
141
|
+
### Fluxo de Trabalho
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
strategist → architect → system-designer → builder → guardian → chronicler
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Cada agente tem **hard stops** — limites rigidos que impedem de fazer trabalho de outros agentes.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 🖥️ Web IDE Features
|
|
152
|
+
|
|
153
|
+
### Dashboard
|
|
154
|
+
- Métricas do projeto (specs, decisões, tasks)
|
|
155
|
+
- Health check (Claude CLI, .devflow, git)
|
|
156
|
+
- Status em tempo real
|
|
157
|
+
|
|
158
|
+
### Specs Panel
|
|
159
|
+
- **Requirements** - User stories com acceptance criteria
|
|
160
|
+
- **Design** - Architecture Decision Records (ADRs)
|
|
161
|
+
- **Tasks** - Tarefas de implementação
|
|
162
|
+
|
|
163
|
+
### Editor
|
|
164
|
+
- Monaco Editor (VS Code engine)
|
|
165
|
+
- Syntax highlighting para 50+ linguagens
|
|
166
|
+
- Preview de Markdown com Mermaid diagrams
|
|
167
|
+
- Múltiplas tabs com indicador de dirty state
|
|
168
|
+
|
|
169
|
+
### Terminal
|
|
170
|
+
- Terminal integrado via xterm.js + node-pty
|
|
171
|
+
- WebGL rendering para displays de alta resolução
|
|
172
|
+
- Histórico de comandos
|
|
173
|
+
- Resize responsivo
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 📁 Estrutura do Projeto
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
devflow/
|
|
181
|
+
├── .claude/ # Comandos e agentes
|
|
182
|
+
│ └── commands/ # Skills dos 6 agentes
|
|
183
|
+
│ └── agents/ # Definições dos agentes
|
|
184
|
+
│
|
|
185
|
+
├── .devflow/ # Configuração do projeto
|
|
186
|
+
│ ├── snapshots/ # Histórico do projeto
|
|
187
|
+
│ └── project.yaml # Estado do projeto
|
|
188
|
+
│
|
|
189
|
+
├── docs/ # Documentação
|
|
190
|
+
│ ├── decisions/ # ADRs
|
|
191
|
+
│ ├── planning/ # Stories e specs
|
|
192
|
+
│ └── images/ # Screenshots
|
|
193
|
+
│
|
|
194
|
+
└── web/ # Web IDE
|
|
195
|
+
├── app/ # Next.js pages
|
|
196
|
+
├── components/ # React components
|
|
197
|
+
└── lib/ # Utilities
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 📊 Versões
|
|
203
|
+
|
|
204
|
+
| Versão | Features |
|
|
205
|
+
|--------|----------|
|
|
206
|
+
| v0.1.0 | Multi-agent system, Documentation automation |
|
|
207
|
+
| v0.2.0 | Structured metadata, Knowledge graph |
|
|
208
|
+
| v0.3.0 | Hard stops, Mandatory delegation |
|
|
209
|
+
| v0.4.0 | Web IDE completa |
|
|
210
|
+
| v0.5.0 | Terminal como interface principal, WSL support |
|
|
211
|
+
| v0.6.0 | Permission mode configuration |
|
|
212
|
+
| **v0.7.0** | **System Designer agent (6th), npm package, token optimization** |
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 📚 Documentação
|
|
217
|
+
|
|
218
|
+
- **[Quick Start](docs/QUICKSTART.md)** - Comece em 5 minutos
|
|
219
|
+
- **[Instalação](docs/INSTALLATION.md)** - Guia detalhado
|
|
220
|
+
- **[Arquitetura](docs/ARCHITECTURE.md)** - Como funciona
|
|
221
|
+
- **[Changelog](docs/CHANGELOG.md)** - Histórico de mudanças
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 🛠️ Tech Stack (Web IDE)
|
|
226
|
+
|
|
227
|
+
- **Next.js 15** - Framework React
|
|
228
|
+
- **TypeScript** - Type safety
|
|
229
|
+
- **Tailwind CSS** - Styling
|
|
230
|
+
- **Monaco Editor** - Code editing
|
|
231
|
+
- **xterm.js** - Terminal emulator
|
|
232
|
+
- **node-pty** - PTY para terminal real
|
|
233
|
+
- **Zustand** - State management
|
|
234
|
+
- **Lucide Icons** - Iconografia
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 📜 Licença
|
|
239
|
+
|
|
240
|
+
MIT License - veja [LICENSE](LICENSE) para detalhes.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
**DevFlow v0.7.0** - Desenvolvido por [Evolve Labs](https://evolvelabs.cloud)
|
package/bin/devflow.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { Command } = require('commander');
|
|
4
|
+
const { VERSION } = require('../lib/constants');
|
|
5
|
+
const { initCommand } = require('../lib/init');
|
|
6
|
+
const { updateCommand } = require('../lib/update');
|
|
7
|
+
|
|
8
|
+
const program = new Command();
|
|
9
|
+
|
|
10
|
+
program
|
|
11
|
+
.name('devflow')
|
|
12
|
+
.description('DevFlow - Multi-agent system for software development with Claude Code')
|
|
13
|
+
.version(VERSION, '-v, --version');
|
|
14
|
+
|
|
15
|
+
program
|
|
16
|
+
.command('init')
|
|
17
|
+
.description('Initialize DevFlow in a project directory')
|
|
18
|
+
.argument('[path]', 'target project directory', '.')
|
|
19
|
+
.option('--agents-only', 'install only agents (minimal setup)')
|
|
20
|
+
.option('--full', 'full installation including .gitignore')
|
|
21
|
+
.option('-f, --force', 'overwrite existing installation without asking')
|
|
22
|
+
.option('--skip-deps', 'skip dependency checking')
|
|
23
|
+
.action(initCommand);
|
|
24
|
+
|
|
25
|
+
program
|
|
26
|
+
.command('update')
|
|
27
|
+
.description('Update an existing DevFlow installation')
|
|
28
|
+
.argument('[path]', 'target project directory', '.')
|
|
29
|
+
.option('-f, --force', 'update without confirmation')
|
|
30
|
+
.action(updateCommand);
|
|
31
|
+
|
|
32
|
+
program.parse();
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const path = require('node:path');
|
|
2
|
+
|
|
3
|
+
const VERSION = '0.7.0';
|
|
4
|
+
|
|
5
|
+
// Root of the installed npm package (where source files live)
|
|
6
|
+
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
7
|
+
|
|
8
|
+
// Directories to create in all install modes
|
|
9
|
+
const BASE_DIRS = [
|
|
10
|
+
'.claude/commands',
|
|
11
|
+
'.devflow/agents',
|
|
12
|
+
'.devflow/memory',
|
|
13
|
+
'.devflow/sessions',
|
|
14
|
+
'docs/snapshots',
|
|
15
|
+
'docs/system-design/sdd',
|
|
16
|
+
'docs/system-design/rfc',
|
|
17
|
+
'docs/system-design/capacity',
|
|
18
|
+
'docs/system-design/trade-offs',
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
// Additional directories for default/full modes
|
|
22
|
+
const DOCS_DIRS = [
|
|
23
|
+
'docs/planning/stories',
|
|
24
|
+
'docs/architecture/diagrams',
|
|
25
|
+
'docs/decisions',
|
|
26
|
+
'docs/security',
|
|
27
|
+
'docs/performance',
|
|
28
|
+
'docs/api',
|
|
29
|
+
'docs/migration',
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
// Directories that should have .gitkeep files
|
|
33
|
+
const GITKEEP_DIRS = [
|
|
34
|
+
'docs/planning',
|
|
35
|
+
'docs/planning/stories',
|
|
36
|
+
'docs/architecture',
|
|
37
|
+
'docs/architecture/diagrams',
|
|
38
|
+
'docs/decisions',
|
|
39
|
+
'docs/security',
|
|
40
|
+
'docs/performance',
|
|
41
|
+
'docs/api',
|
|
42
|
+
'docs/migration',
|
|
43
|
+
'docs/snapshots',
|
|
44
|
+
'docs/system-design/sdd',
|
|
45
|
+
'docs/system-design/rfc',
|
|
46
|
+
'docs/system-design/capacity',
|
|
47
|
+
'docs/system-design/trade-offs',
|
|
48
|
+
'.devflow/sessions',
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
// Files and directories to copy during init
|
|
52
|
+
const AGENTS_COPY = [
|
|
53
|
+
{ src: '.claude/commands/agents', dest: '.claude/commands/agents', type: 'dir' },
|
|
54
|
+
{ src: '.claude/commands/quick', dest: '.claude/commands/quick', type: 'dir' },
|
|
55
|
+
{ src: '.claude/commands/devflow-help.md', dest: '.claude/commands/devflow-help.md', type: 'file' },
|
|
56
|
+
{ src: '.claude/commands/devflow-status.md', dest: '.claude/commands/devflow-status.md', type: 'file' },
|
|
57
|
+
{ src: '.claude_project', dest: '.claude_project', type: 'file' },
|
|
58
|
+
{ src: '.devflow/project.yaml', dest: '.devflow/project.yaml', type: 'file' },
|
|
59
|
+
{ src: '.devflow/agents', dest: '.devflow/agents', type: 'dir' },
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
// Doc files to copy in default/full modes
|
|
63
|
+
const DOC_FILES = [
|
|
64
|
+
'docs/decisions/000-template.md',
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
module.exports = {
|
|
68
|
+
VERSION,
|
|
69
|
+
PACKAGE_ROOT,
|
|
70
|
+
BASE_DIRS,
|
|
71
|
+
DOCS_DIRS,
|
|
72
|
+
GITKEEP_DIRS,
|
|
73
|
+
AGENTS_COPY,
|
|
74
|
+
DOC_FILES,
|
|
75
|
+
};
|
package/lib/init.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const {
|
|
4
|
+
VERSION,
|
|
5
|
+
PACKAGE_ROOT,
|
|
6
|
+
BASE_DIRS,
|
|
7
|
+
DOCS_DIRS,
|
|
8
|
+
GITKEEP_DIRS,
|
|
9
|
+
AGENTS_COPY,
|
|
10
|
+
DOC_FILES,
|
|
11
|
+
} = require('./constants');
|
|
12
|
+
const {
|
|
13
|
+
printHeader,
|
|
14
|
+
success,
|
|
15
|
+
error,
|
|
16
|
+
warn,
|
|
17
|
+
info,
|
|
18
|
+
printSuccess,
|
|
19
|
+
confirm,
|
|
20
|
+
checkDependencies,
|
|
21
|
+
copyDir,
|
|
22
|
+
copyFile,
|
|
23
|
+
ensureDirs,
|
|
24
|
+
createGitkeep,
|
|
25
|
+
pathExists,
|
|
26
|
+
resolveTarget,
|
|
27
|
+
} = require('./utils');
|
|
28
|
+
|
|
29
|
+
async function initCommand(targetArg, options) {
|
|
30
|
+
printHeader(VERSION);
|
|
31
|
+
|
|
32
|
+
const targetDir = resolveTarget(targetArg);
|
|
33
|
+
|
|
34
|
+
// 1. Check dependencies
|
|
35
|
+
if (!options.skipDeps) {
|
|
36
|
+
checkDependencies();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 2. Validate/create target directory
|
|
40
|
+
if (!(await pathExists(targetDir))) {
|
|
41
|
+
info(`Directory does not exist: ${targetDir}`);
|
|
42
|
+
const shouldCreate = options.force || await confirm('Create this directory?');
|
|
43
|
+
if (!shouldCreate) {
|
|
44
|
+
error('Installation cancelled.');
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
await fs.promises.mkdir(targetDir, { recursive: true });
|
|
48
|
+
success(`Directory created: ${targetDir}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
info(`Installing DevFlow in: ${targetDir}`);
|
|
52
|
+
console.log();
|
|
53
|
+
|
|
54
|
+
// 3. Check for existing installation
|
|
55
|
+
if (await pathExists(path.join(targetDir, '.devflow'))) {
|
|
56
|
+
warn('.devflow/ already exists in target directory!');
|
|
57
|
+
if (!options.force) {
|
|
58
|
+
const shouldOverwrite = await confirm('Overwrite existing installation?');
|
|
59
|
+
if (!shouldOverwrite) {
|
|
60
|
+
error('Installation cancelled.');
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
console.log();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 4. Determine install mode
|
|
68
|
+
let mode = 'default';
|
|
69
|
+
if (options.agentsOnly) mode = 'agents-only';
|
|
70
|
+
if (options.full) mode = 'full';
|
|
71
|
+
|
|
72
|
+
const modeLabels = {
|
|
73
|
+
'agents-only': 'Agents only (minimal)',
|
|
74
|
+
'default': 'Agents + documentation structure',
|
|
75
|
+
'full': 'Full installation',
|
|
76
|
+
};
|
|
77
|
+
info(`Install mode: ${modeLabels[mode]}`);
|
|
78
|
+
console.log();
|
|
79
|
+
|
|
80
|
+
// 5. Create base directory structure
|
|
81
|
+
await ensureDirs(targetDir, BASE_DIRS);
|
|
82
|
+
|
|
83
|
+
// 6. Copy agent files and core config
|
|
84
|
+
for (const item of AGENTS_COPY) {
|
|
85
|
+
const src = path.join(PACKAGE_ROOT, item.src);
|
|
86
|
+
const dest = path.join(targetDir, item.dest);
|
|
87
|
+
try {
|
|
88
|
+
if (item.type === 'dir') {
|
|
89
|
+
await copyDir(src, dest);
|
|
90
|
+
} else {
|
|
91
|
+
await copyFile(src, dest);
|
|
92
|
+
}
|
|
93
|
+
} catch (err) {
|
|
94
|
+
warn(`Could not copy ${item.src}: ${err.message}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
success('Agents installed (.claude/commands/agents/)');
|
|
99
|
+
success('Quick commands installed (.claude/commands/quick/)');
|
|
100
|
+
success('.claude_project orchestration rules installed');
|
|
101
|
+
success('.devflow/ structure created');
|
|
102
|
+
|
|
103
|
+
// 7. Default/full: create docs structure with gitkeep files
|
|
104
|
+
if (mode === 'default' || mode === 'full') {
|
|
105
|
+
await ensureDirs(targetDir, DOCS_DIRS);
|
|
106
|
+
await createGitkeep(targetDir, GITKEEP_DIRS);
|
|
107
|
+
|
|
108
|
+
// Copy doc template files
|
|
109
|
+
for (const file of DOC_FILES) {
|
|
110
|
+
const src = path.join(PACKAGE_ROOT, file);
|
|
111
|
+
const dest = path.join(targetDir, file);
|
|
112
|
+
try {
|
|
113
|
+
if (!(await pathExists(dest))) {
|
|
114
|
+
await copyFile(src, dest);
|
|
115
|
+
}
|
|
116
|
+
} catch { /* skip if source missing */ }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
success('Documentation structure created (docs/)');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 8. Full: copy .gitignore
|
|
123
|
+
if (mode === 'full') {
|
|
124
|
+
const gitignoreSrc = path.join(PACKAGE_ROOT, '.gitignore-template');
|
|
125
|
+
const gitignoreDest = path.join(targetDir, '.gitignore');
|
|
126
|
+
|
|
127
|
+
if (await pathExists(gitignoreSrc)) {
|
|
128
|
+
if (await pathExists(gitignoreDest)) {
|
|
129
|
+
warn('.gitignore already exists - appending DevFlow entries');
|
|
130
|
+
const existing = await fs.promises.readFile(gitignoreDest, 'utf8');
|
|
131
|
+
if (!existing.includes('# DevFlow')) {
|
|
132
|
+
const devflowIgnore = await fs.promises.readFile(gitignoreSrc, 'utf8');
|
|
133
|
+
await fs.promises.appendFile(
|
|
134
|
+
gitignoreDest,
|
|
135
|
+
`\n\n# --- DevFlow entries ---\n${devflowIgnore}`
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
success('.gitignore updated with DevFlow entries');
|
|
139
|
+
} else {
|
|
140
|
+
await copyFile(gitignoreSrc, gitignoreDest);
|
|
141
|
+
success('.gitignore created');
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// 9. Success output
|
|
147
|
+
printSuccess(VERSION);
|
|
148
|
+
info('Next steps:');
|
|
149
|
+
console.log();
|
|
150
|
+
console.log('1. Open the project in Claude Code:');
|
|
151
|
+
console.log(` cd ${targetDir}`);
|
|
152
|
+
console.log(' claude');
|
|
153
|
+
console.log();
|
|
154
|
+
console.log('2. In Claude Code, test an agent:');
|
|
155
|
+
console.log(' /agents:strategist Hello! Introduce yourself');
|
|
156
|
+
console.log();
|
|
157
|
+
console.log('3. Create your first feature:');
|
|
158
|
+
console.log(' /agents:strategist I want to create [your feature]');
|
|
159
|
+
console.log();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
module.exports = { initCommand };
|