sincron-auto 1.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.
@@ -0,0 +1,406 @@
1
+ ---
2
+ name: sincron-auto
3
+ description: Start automated development workflow. Creates projects, manages stories, implements and evaluates code.
4
+ allowed-tools: ["Task", "Read", "Write", "Edit", "Bash", "AskUserQuestion"]
5
+ ---
6
+
7
+ # Sincron-Auto Command (Central Controller)
8
+
9
+ You are the CENTRAL CONTROLLER. You control ALL flow. Agents NEVER call other agents - they always RETURN to you.
10
+
11
+ ## Architecture
12
+
13
+ ```
14
+ YOU (Command) ─┬─ Estrutura (setup only, returns)
15
+ ├─ Gestor (planning only, returns)
16
+ ├─ Construtor (1 story, returns)
17
+ ├─ Avaliador (1 evaluation, returns)
18
+ └─ Orquestrador (report only, returns)
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Step 0: Create Communication Directory
24
+
25
+ ```bash
26
+ mkdir -p .sincron-auto
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Step 1: Check State
32
+
33
+ ```
34
+ Read sincron-auto-state.json
35
+ ```
36
+
37
+ - **File NOT found** → Go to PHASE A (First Run)
38
+ - **File found, status="initialized"** → Go to PHASE B (Planning)
39
+ - **File found, stories_approved=false** → Go to PHASE C (Approval)
40
+ - **File found, stories_approved=true** → Go to PHASE D (Implementation Loop)
41
+ - **File found, status="complete"** → Go to PHASE E (Report)
42
+
43
+ ---
44
+
45
+ ## PHASE A: First Run Setup
46
+
47
+ ### A1. Ask Automation Level
48
+
49
+ ```
50
+ AskUserQuestion({
51
+ questions: [{
52
+ question: "Qual nível de automação você deseja para este projeto?",
53
+ header: "Automação",
54
+ multiSelect: false,
55
+ options: [
56
+ { label: "Total (Recomendado)", description: "Permissões completas: Git, npm, Bash, MCPs." },
57
+ { label: "Parcial", description: "Apenas ferramentas core. Requer aprovação para comandos." },
58
+ { label: "Nenhuma", description: "Mantém suas permissões atuais." }
59
+ ]
60
+ }]
61
+ })
62
+ ```
63
+
64
+ ### A2. Write Request
65
+
66
+ ```
67
+ Write(".sincron-auto/request.json", {
68
+ "automation_level": "[user answer]",
69
+ "original_request": "$ARGUMENTS"
70
+ })
71
+ ```
72
+
73
+ ### A3. Call Estrutura
74
+
75
+ ```
76
+ Task(
77
+ subagent_type: "sincron-auto:estrutura",
78
+ prompt: "Configure project. Read .sincron-auto/request.json for automation_level.",
79
+ description: "Setting up environment"
80
+ )
81
+ ```
82
+
83
+ ### A4. Handle Estrutura Response
84
+
85
+ Estrutura returns `restart_required`. Show message and EXIT:
86
+
87
+ ```
88
+ ✅ Configuração completa!
89
+
90
+ PRÓXIMO PASSO OBRIGATÓRIO:
91
+ 1. Saia do Claude Code: Ctrl+C ou /exit
92
+ 2. Reinicie: claude
93
+ 3. Execute novamente: /sincron-auto [mesmo comando]
94
+
95
+ Por que reiniciar? Permissões carregam apenas no início da sessão.
96
+ ```
97
+
98
+ **EXIT HERE** (user must restart)
99
+
100
+ ---
101
+
102
+ ## PHASE B: Planning
103
+
104
+ ### B1. Write Request
105
+
106
+ ```
107
+ Write(".sincron-auto/request.json", {
108
+ "original_request": "$ARGUMENTS"
109
+ })
110
+ ```
111
+
112
+ ### B2. Call Gestor
113
+
114
+ ```
115
+ Task(
116
+ subagent_type: "sincron-auto:gestor-projeto",
117
+ prompt: "MODE: plan. Create user stories. Read .sincron-auto/request.json for original_request.",
118
+ description: "Creating user stories"
119
+ )
120
+ ```
121
+
122
+ ### B3. Handle Gestor Response
123
+
124
+ Gestor returns `stories_created`. Go to PHASE C.
125
+
126
+ ---
127
+
128
+ ## PHASE C: Story Approval
129
+
130
+ ### C1. Show Stories
131
+
132
+ ```
133
+ Read .sincron-auto/user-stories.md
134
+ Read sincron-auto-state.json (for stories array)
135
+ ```
136
+
137
+ ⚠️ **CRITICAL: You MUST show ALL fields for EVERY story. NEVER abbreviate or skip fields.**
138
+
139
+ Display ALL stories using this TABLE format:
140
+
141
+ ```
142
+ ### 📋 User Stories para Aprovação
143
+
144
+ | # | Story | Persona | Ação | Benefício | Critérios |
145
+ |---|-------|---------|------|-----------|-----------|
146
+ | US-001 | [title] | [as_a] | [i_want] | [so_that] | [count] |
147
+ | US-002 | [title] | [as_a] | [i_want] | [so_that] | [count] |
148
+ | ... | ... | ... | ... | ... | ... |
149
+ ```
150
+
151
+ **Example with 4 stories (CORRECT):**
152
+
153
+ | # | Story | Persona | Ação | Benefício | Critérios |
154
+ |---|-------|---------|------|-----------|-----------|
155
+ | US-001 | Header Responsivo | visitante | ver um header que se adapta | navegar em qualquer dispositivo | 5 |
156
+ | US-002 | Formulário de Contato | visitante | preencher formulário | empresa responder | 4 |
157
+ | US-003 | Galeria de Projetos | visitante | ver projetos anteriores | avaliar qualidade do trabalho | 6 |
158
+ | US-004 | Footer com Links | visitante | acessar links importantes | encontrar informações rapidamente | 3 |
159
+
160
+ ---
161
+
162
+ ⛔ **NEVER do this (BAD - INCOMPLETE):**
163
+ ```
164
+ - US-001: Header Responsivo
165
+ - US-002: Formulário de Contato
166
+ - US-003: Galeria de Projetos
167
+ ```
168
+ This is INCOMPLETE. User CANNOT evaluate stories without Persona/Ação/Benefício columns.
169
+
170
+ ✅ **ALWAYS show the complete table** even if there are 10+ stories.
171
+
172
+ ### C2. Ask Approval
173
+
174
+ ```
175
+ AskUserQuestion({
176
+ questions: [{
177
+ question: "Aprova as user stories geradas?",
178
+ header: "Aprovação",
179
+ multiSelect: false,
180
+ options: [
181
+ { label: "Aprovar", description: "Prosseguir com implementação" },
182
+ { label: "Editar", description: "Vou editar user-stories.md manualmente" },
183
+ { label: "Cancelar", description: "Cancelar projeto" }
184
+ ]
185
+ }]
186
+ })
187
+ ```
188
+
189
+ ### C3. Handle Response
190
+
191
+ **If "Aprovar":**
192
+ ```
193
+ Edit sincron-auto-state.json: set stories_approved = true
194
+ ```
195
+ Go to PHASE D.
196
+
197
+ **If "Editar":**
198
+ ```
199
+ "Edite .sincron-auto/user-stories.md e execute /sincron-auto novamente"
200
+ ```
201
+ EXIT.
202
+
203
+ **If "Cancelar":**
204
+ ```
205
+ Bash("rm sincron-auto-state.json")
206
+ "Projeto cancelado."
207
+ ```
208
+ EXIT.
209
+
210
+ ---
211
+
212
+ ## PHASE D: Implementation Loop
213
+
214
+ This is the MAIN LOOP. You control it entirely.
215
+
216
+ ### D1. Find Next Story
217
+
218
+ ```
219
+ Read sincron-auto-state.json
220
+ Find first story with status = "pending"
221
+ ```
222
+
223
+ **If no pending story found** → Go to PHASE E (Report)
224
+
225
+ ### D2. Write Current Story
226
+
227
+ ```
228
+ Write(".sincron-auto/current-story.json", {
229
+ "story_id": "[story_id]",
230
+ "attempt": 1,
231
+ "max_attempts": 3
232
+ })
233
+ ```
234
+
235
+ ### D3. Call Construtor
236
+
237
+ ```
238
+ Task(
239
+ subagent_type: "sincron-auto:construtor",
240
+ prompt: "Implement the current story. Read .sincron-auto/current-story.json and sincron-auto-state.json.",
241
+ description: "Building [story_id]"
242
+ )
243
+ ```
244
+
245
+ Construtor returns `build_complete`.
246
+
247
+ ### D4. Call Avaliador
248
+
249
+ ```
250
+ Task(
251
+ subagent_type: "sincron-auto:avaliador",
252
+ prompt: "Evaluate the current story using Playwright MCP.
253
+
254
+ MANDATORY STEPS (you MUST do ALL of these):
255
+ 1. mcp__playwright__browser_navigate to open the page
256
+ 2. mcp__playwright__browser_console to check for JS errors (ANY error = FAIL)
257
+ 3. mcp__playwright__browser_screenshot to capture visual state
258
+ 4. mcp__playwright__browser_click on ALL buttons/interactive elements
259
+ 5. mcp__playwright__browser_console again after each interaction
260
+
261
+ Code review alone is NOT sufficient. Visual and behavioral tests via Playwright are REQUIRED.
262
+ If you skip Playwright, the evaluation is INVALID.
263
+
264
+ Read .sincron-auto/current-story.json and .sincron-auto/build-result.json for context.",
265
+ description: "Evaluating [story_id]"
266
+ )
267
+ ```
268
+
269
+ ### D5. Handle Evaluation Result
270
+
271
+ ```
272
+ Read .sincron-auto/eval-result.json
273
+ ```
274
+
275
+ **If result = "approved":**
276
+ ```
277
+ Edit sincron-auto-state.json: set story status = "approved"
278
+ ```
279
+ Go back to D1 (next story).
280
+
281
+ **If result = "rejected" AND attempt < 3:**
282
+ ```
283
+ Read .sincron-auto/current-story.json
284
+ Edit: increment attempt
285
+ Write back
286
+ ```
287
+ Go back to D3 (retry Construtor).
288
+
289
+ **If result = "rejected" AND attempt >= 3:**
290
+ ```
291
+ Edit sincron-auto-state.json: set story status = "not_approved"
292
+ ```
293
+ Go back to D1 (next story).
294
+
295
+ ### D6. Loop Complete
296
+
297
+ When no more pending stories, go to PHASE E.
298
+
299
+ ---
300
+
301
+ ## PHASE E: Final Report
302
+
303
+ ### E1. Update State
304
+
305
+ ```
306
+ Edit sincron-auto-state.json: set status = "complete"
307
+ ```
308
+
309
+ ### E2. Call Orquestrador for Report
310
+
311
+ ```
312
+ Task(
313
+ subagent_type: "sincron-auto:orquestrador",
314
+ prompt: "MODE: report. Generate final report. Read sincron-auto-state.json for results.",
315
+ description: "Generating report"
316
+ )
317
+ ```
318
+
319
+ ### E3. Present Final Summary
320
+
321
+ ```
322
+ Read .sincron-auto/report.md
323
+ Read sincron-auto-state.json
324
+ ```
325
+
326
+ **CRITICAL: You MUST present a rich summary to the user, NOT just mention the file exists.**
327
+
328
+ Display the following to the user:
329
+
330
+ ```
331
+ 🎉 **Projeto Concluído!**
332
+
333
+ ## Highlights do Projeto
334
+
335
+ | Métrica | Resultado |
336
+ |---------|-----------|
337
+ | User Stories | [total] |
338
+ | Aprovadas | [approved] ✅ |
339
+ | Não Aprovadas | [not_approved] ❌ |
340
+ | Taxa de Sucesso | [percentage]% |
341
+
342
+ ## Stories Implementadas
343
+
344
+ [For each approved story, show:]
345
+ - ✅ **US-XXX**: [title] - [brief description of what was built]
346
+
347
+ [If any not approved:]
348
+ ## Stories que Precisam de Atenção
349
+
350
+ - ❌ **US-XXX**: [title] - [reason for failure]
351
+
352
+ ---
353
+
354
+ 📄 **Relatório Completo**: `.sincron-auto/report.md`
355
+
356
+ O relatório detalhado contém:
357
+ - Resumo executivo do projeto
358
+ - Lista de todos os arquivos criados/modificados
359
+ - Critérios atendidos por story
360
+ - Próximos passos recomendados
361
+
362
+ ---
363
+
364
+ > 🚀 **Esse projeto foi desenvolvido com Sincron-Auto.**
365
+ > **Conheça a Sincron IA em [sincronia.digital](https://sincronia.digital)**
366
+ ```
367
+
368
+ EXIT.
369
+
370
+ ---
371
+
372
+ ## Critical Rules
373
+
374
+ 1. **YOU are the ONLY one who uses AskUserQuestion** - it doesn't work in subagents
375
+ 2. **Agents RETURN to you** - they never call other agents
376
+ 3. **YOU control the loop** - not Gestor, not anyone else
377
+ 4. **Max 2 nesting levels** - You → Agent → done
378
+ 5. **Always write state before calling agents** - they read from files
379
+
380
+ ---
381
+
382
+ ## Status Codes from Agents
383
+
384
+ | Agent | Returns | Meaning |
385
+ |-------|---------|---------|
386
+ | Estrutura | `restart_required` | Setup done, need restart |
387
+ | Gestor | `stories_created` | Planning done, stories in file |
388
+ | Construtor | `build_complete` | Implementation done, result in file |
389
+ | Avaliador | `approved` / `rejected` | Evaluation done, result in file |
390
+ | Orquestrador | `report_complete` | Report generated |
391
+
392
+ ---
393
+
394
+ ## Files Reference
395
+
396
+ ```
397
+ .sincron-auto/
398
+ ├── request.json # You write, agents read
399
+ ├── user-stories.md # Gestor writes, you read/show to user
400
+ ├── current-story.json # You write, Construtor/Avaliador read
401
+ ├── build-result.json # Construtor writes, Avaliador reads
402
+ ├── eval-result.json # Avaliador writes, you read
403
+ └── report.md # Orquestrador writes, you read/show
404
+
405
+ sincron-auto-state.json # Master state file (root directory)
406
+ ```