up-cc 0.5.1 → 0.6.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/agents/up-execution-supervisor.md +36 -1
- package/agents/up-planejador.md +6 -6
- package/agents/up-planning-auditor.md +284 -0
- package/bin/install.js +24 -0
- package/commands/build.md +99 -0
- package/commands/plan.md +91 -0
- package/package.json +1 -1
- package/templates/audit-plan.md +139 -0
- package/templates/builder-defaults.md +9 -20
- package/templates/plan-ready.md +137 -0
- package/workflows/build.md +373 -0
- package/workflows/builder.md +31 -59
- package/workflows/plan.md +378 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# AUDIT-PLAN.md Template
|
|
2
|
+
|
|
3
|
+
Template para `.plano/AUDIT-PLAN.md` — relatorio do up-planning-auditor.
|
|
4
|
+
Gerado ao final do planejamento, antes do PLAN-READY.md.
|
|
5
|
+
|
|
6
|
+
Diferente do AUDIT-REPORT.md (do delivery-auditor) que audita execucao,
|
|
7
|
+
este audita SOMENTE o planejamento.
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
---
|
|
13
|
+
audited_at: ""
|
|
14
|
+
auditor: up-planning-auditor
|
|
15
|
+
planning_confidence: 0 # 0-100
|
|
16
|
+
recommendation: PENDING | READY_FOR_BUILD | NEEDS_REWORK | BLOCKED
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Planning Audit Report
|
|
20
|
+
|
|
21
|
+
**Planning Confidence Score:** {N}/100
|
|
22
|
+
|
|
23
|
+
**Recomendacao:** {status}
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Completude por Estagio
|
|
28
|
+
|
|
29
|
+
| Estagio | Items | Completed | Missing | Score |
|
|
30
|
+
|---------|-------|-----------|---------|-------|
|
|
31
|
+
| Intake (E1) | 5 | {N} | {N} | {%} |
|
|
32
|
+
| Arquitetura (E2) | 7 | {N} | {N} | {%} |
|
|
33
|
+
| Planejamento (E2.5) | {6 × phases} | {N} | {N} | {%} |
|
|
34
|
+
| **TOTAL** | **{N}** | **{N}** | **{N}** | **{%}** |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Validacao de Completude
|
|
39
|
+
|
|
40
|
+
### Artefatos Arquiteturais
|
|
41
|
+
|
|
42
|
+
- [ ] BRIEFING.md existe
|
|
43
|
+
- [ ] OWNER.md existe
|
|
44
|
+
- [ ] PROJECT.md existe e completo
|
|
45
|
+
- [ ] ROADMAP.md existe e tem fases
|
|
46
|
+
- [ ] REQUIREMENTS.md existe
|
|
47
|
+
- [ ] SYSTEM-DESIGN.md existe e completo
|
|
48
|
+
- [ ] DESIGN-TOKENS.md existe (se projeto com UI)
|
|
49
|
+
- [ ] PENDING.md existe (mesmo se vazio)
|
|
50
|
+
|
|
51
|
+
### Planos por Fase
|
|
52
|
+
|
|
53
|
+
Para cada fase em ROADMAP.md:
|
|
54
|
+
- [ ] Existe pasta `.plano/fases/XX-nome/`
|
|
55
|
+
- [ ] Existe pelo menos 1 PLAN.md
|
|
56
|
+
- [ ] Cada PLAN.md tem frontmatter valido
|
|
57
|
+
- [ ] Cada PLAN.md tem 5-8 tarefas
|
|
58
|
+
- [ ] Cada PLAN.md tem must_haves
|
|
59
|
+
- [ ] Cada PLAN.md passou no planning-supervisor (PLAN-REVIEW.md existe)
|
|
60
|
+
|
|
61
|
+
### Cobertura de Requisitos
|
|
62
|
+
|
|
63
|
+
| REQ-ID | Mapeado a fase? | Coberto por plano? | Status |
|
|
64
|
+
|--------|----------------|-------------------|--------|
|
|
65
|
+
| AUTH-01 | Sim (Fase 1) | Sim (01-01-PLAN) | OK |
|
|
66
|
+
| ... | | | |
|
|
67
|
+
|
|
68
|
+
**Cobertura:** {covered}/{total} ({%})
|
|
69
|
+
|
|
70
|
+
### Sonnet-readiness
|
|
71
|
+
|
|
72
|
+
Para cada PLAN.md, checar nivel de detalhe:
|
|
73
|
+
|
|
74
|
+
| Plan | Imports | Tipos | Endpoints | SQL | Score |
|
|
75
|
+
|------|---------|-------|-----------|-----|-------|
|
|
76
|
+
| 01-01-PLAN.md | ✓ | ✓ | ✓ | N/A | 100% |
|
|
77
|
+
| 01-02-PLAN.md | ✓ | ✓ | ✓ | ✓ | 100% |
|
|
78
|
+
|
|
79
|
+
**Score medio Sonnet-ready:** {%}
|
|
80
|
+
|
|
81
|
+
### Dependency Graph
|
|
82
|
+
|
|
83
|
+
- [ ] Todas dependencias entre planos resolvidas
|
|
84
|
+
- [ ] Sem ciclos detectados
|
|
85
|
+
- [ ] Waves atribuidas (0, 1, 2, 3)
|
|
86
|
+
- [ ] Paralelismo maximizado onde possivel
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Aprovacoes Faltantes
|
|
91
|
+
|
|
92
|
+
| Item | Esperado | Atual |
|
|
93
|
+
|------|----------|-------|
|
|
94
|
+
| [item] | [supervisor] APPROVE | pending/missing |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Inconsistencias Detectadas
|
|
99
|
+
|
|
100
|
+
### INC-001: [Titulo]
|
|
101
|
+
**Tipo:** [conflito | gap | duplicacao]
|
|
102
|
+
**Descricao:** [...]
|
|
103
|
+
**Acao sugerida:** [...]
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Pendencias Conhecidas
|
|
108
|
+
|
|
109
|
+
Da PENDING.md:
|
|
110
|
+
- {N} blockers
|
|
111
|
+
- {N} non-blockers
|
|
112
|
+
|
|
113
|
+
Estas pendencias NAO bloqueiam o planejamento, mas serao revistas no delivery.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Veredito
|
|
118
|
+
|
|
119
|
+
**{READY_FOR_BUILD | NEEDS_REWORK | BLOCKED}**
|
|
120
|
+
|
|
121
|
+
[Justificativa em 1-2 paragrafos]
|
|
122
|
+
|
|
123
|
+
### Rework Plan (se NEEDS_REWORK)
|
|
124
|
+
|
|
125
|
+
1. [acao 1]
|
|
126
|
+
2. [acao 2]
|
|
127
|
+
3. [acao 3]
|
|
128
|
+
|
|
129
|
+
Apos rework, re-rodar auditor.
|
|
130
|
+
|
|
131
|
+
### Pronto pra Build (se READY_FOR_BUILD)
|
|
132
|
+
|
|
133
|
+
Proximos passos:
|
|
134
|
+
1. Gerar PLAN-READY.md
|
|
135
|
+
2. Apresentar ao dono via CEO
|
|
136
|
+
3. Aguardar `/up:build` (mesmo runtime ou outro)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
</template>
|
|
@@ -35,26 +35,15 @@ O usuario customiza uma vez e vale para todos os projetos criados com `/up:modo-
|
|
|
35
35
|
- Linter: ESLint + Prettier
|
|
36
36
|
- Git: branch main, commits diretos
|
|
37
37
|
|
|
38
|
-
## Modelos
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
| verification | opus | verificador, code-reviewer, blind-validator, requirements-validator |
|
|
48
|
-
| detection | sonnet | visual-critic, exhaustive-tester, api-tester |
|
|
49
|
-
| research | sonnet | pesquisador-projeto, pesquisador-mercado, mapeador-codigo |
|
|
50
|
-
| quality | opus | qa-agent, security-reviewer, auditor-ux, auditor-performance |
|
|
51
|
-
|
|
52
|
-
Notas:
|
|
53
|
-
- Opus: raciocinio profundo, decisoes arquiteturais, verificacao critica. Mais lento, mais caro.
|
|
54
|
-
- Sonnet: execucao rapida, seguir instrucoes, volume de codigo. Mais rapido, mais barato.
|
|
55
|
-
- Haiku: tarefas simples. NAO recomendado para codigo de producao.
|
|
56
|
-
- Opus e Sonnet ambos suportam 1M de contexto.
|
|
57
|
-
- Se execution=sonnet, planos serao gerados com nivel extra de detalhe (Sonnet-ready).
|
|
38
|
+
## Modelos
|
|
39
|
+
|
|
40
|
+
**v0.6.0+: Removido.** O runtime que voce usa decide o modelo.
|
|
41
|
+
|
|
42
|
+
- Em Claude Code: usa o modelo selecionado via /model (default Opus 4.6)
|
|
43
|
+
- Em OpenCode: usa o modelo do opencode.json
|
|
44
|
+
- Em Gemini CLI: usa o modelo do runtime
|
|
45
|
+
|
|
46
|
+
Planos sao sempre gerados em nivel detalhado (Sonnet-ready) independente do modelo executor.
|
|
58
47
|
|
|
59
48
|
## Nao usar
|
|
60
49
|
- (liste aqui tecnologias que voce NAO quer em nenhum projeto)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# PLAN-READY.md Template
|
|
2
|
+
|
|
3
|
+
Template para `.plano/PLAN-READY.md` — arquivo-flag que indica que o projeto foi
|
|
4
|
+
completamente planejado e esta pronto para execucao.
|
|
5
|
+
|
|
6
|
+
Gerado por `/up:plan` ao final do planejamento.
|
|
7
|
+
Lido por `/up:build` como gate de entrada.
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
---
|
|
13
|
+
version: "0.6.0"
|
|
14
|
+
planned_at: ""
|
|
15
|
+
planned_by:
|
|
16
|
+
runtime: "" # claude-code | opencode | gemini-cli
|
|
17
|
+
ceo_name: ""
|
|
18
|
+
user_preferred_name: ""
|
|
19
|
+
intended_execution:
|
|
20
|
+
runtime: "" # same | claude-code | opencode | gemini-cli | any
|
|
21
|
+
project_name: ""
|
|
22
|
+
mode: "" # greenfield | brownfield
|
|
23
|
+
total_phases: 0
|
|
24
|
+
total_plans: 0
|
|
25
|
+
total_requirements: 0
|
|
26
|
+
estimated_tasks: 0
|
|
27
|
+
status: ready_for_execution
|
|
28
|
+
planning_confidence: 0 # 0-100, do AUDIT-PLAN.md
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# Projeto Pronto Para Execucao
|
|
32
|
+
|
|
33
|
+
Este projeto foi completamente planejado. Todos os artefatos arquiteturais
|
|
34
|
+
foram gerados, todas as fases foram planejadas em detalhe maximo (Sonnet-ready),
|
|
35
|
+
e todas as aprovacoes de supervisores/chiefs foram obtidas.
|
|
36
|
+
|
|
37
|
+
## Como executar
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
/up:build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Pode ser executado neste mesmo runtime ou em outro. O estado esta completamente
|
|
44
|
+
salvo em `.plano/`.
|
|
45
|
+
|
|
46
|
+
## Resumo do Projeto
|
|
47
|
+
|
|
48
|
+
**Briefing:** [resumo em 1-2 frases do BRIEFING.md]
|
|
49
|
+
|
|
50
|
+
**Stack:** [stack escolhida]
|
|
51
|
+
|
|
52
|
+
**Mode:** [greenfield | brownfield]
|
|
53
|
+
|
|
54
|
+
## Fases Planejadas
|
|
55
|
+
|
|
56
|
+
| # | Fase | Planos | Tarefas | Wave | Status |
|
|
57
|
+
|---|------|--------|---------|------|--------|
|
|
58
|
+
| 1 | [nome] | [N] | [M] | 0 | planejada |
|
|
59
|
+
| 2 | [nome] | [N] | [M] | 1 | planejada |
|
|
60
|
+
| 3 | [nome] | [N] | [M] | 1 | planejada |
|
|
61
|
+
|
|
62
|
+
## Aprovacoes Obtidas
|
|
63
|
+
|
|
64
|
+
Todas estas aprovacoes foram registradas em governance/approvals.log:
|
|
65
|
+
|
|
66
|
+
- [x] CEO: Briefing aprovado, intake completo
|
|
67
|
+
- [x] Chief-architect: Arquitetura aprovada
|
|
68
|
+
- [x] Chief-product: Fit com briefing confirmado
|
|
69
|
+
- [x] Architecture-supervisor: PROJECT, ROADMAP, SYSTEM-DESIGN, REQUIREMENTS aprovados
|
|
70
|
+
- [x] Planning-supervisor: Todos planos aprovados
|
|
71
|
+
- [x] Chief-engineer: Planejamento consistente cross-fase
|
|
72
|
+
- [x] Planning-auditor: Confidence score [N]/100
|
|
73
|
+
|
|
74
|
+
## Artefatos Disponiveis
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
.plano/
|
|
78
|
+
├── BRIEFING.md
|
|
79
|
+
├── OWNER.md
|
|
80
|
+
├── PENDING.md
|
|
81
|
+
├── DESIGN-TOKENS.md
|
|
82
|
+
├── PRODUCT-ANALYSIS.md
|
|
83
|
+
├── SYSTEM-DESIGN.md
|
|
84
|
+
├── PROJECT.md
|
|
85
|
+
├── ROADMAP.md
|
|
86
|
+
├── REQUIREMENTS.md
|
|
87
|
+
├── AUDIT-PLAN.md ← relatorio do planning auditor
|
|
88
|
+
├── CHECKLIST.md
|
|
89
|
+
├── PLAN-READY.md ← este arquivo
|
|
90
|
+
└── fases/
|
|
91
|
+
├── 01-[nome]/
|
|
92
|
+
│ ├── 01-01-PLAN.md
|
|
93
|
+
│ ├── 01-01-PLAN-REVIEW.md
|
|
94
|
+
│ └── 01-02-PLAN.md
|
|
95
|
+
├── 02-[nome]/
|
|
96
|
+
└── ...
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Credenciais
|
|
100
|
+
|
|
101
|
+
- [x] [credencial 1]
|
|
102
|
+
- [ ] [credencial pendente] (mock ativo)
|
|
103
|
+
- [ ] [credencial pendente] (mock ativo)
|
|
104
|
+
|
|
105
|
+
Ver `.plano/PENDING.md` para detalhes.
|
|
106
|
+
|
|
107
|
+
## Listagem Completa de Planos
|
|
108
|
+
|
|
109
|
+
[lista de todos os PLANs com seus paths, para o /up:build validar que existem]
|
|
110
|
+
|
|
111
|
+
| ID | Path | Wave | Tasks |
|
|
112
|
+
|----|------|------|-------|
|
|
113
|
+
| 01-01 | fases/01-auth/01-01-PLAN.md | 0 | 8 |
|
|
114
|
+
| 01-02 | fases/01-auth/01-02-PLAN.md | 1 | 7 |
|
|
115
|
+
...
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
</template>
|
|
119
|
+
|
|
120
|
+
<guidelines>
|
|
121
|
+
|
|
122
|
+
## Como o /up:build usa este arquivo
|
|
123
|
+
|
|
124
|
+
1. Gate de entrada: arquivo deve existir
|
|
125
|
+
2. Parse YAML frontmatter
|
|
126
|
+
3. Para cada plano listado, verificar se arquivo existe no disco
|
|
127
|
+
4. Se algum plano falta: alertar e oferecer planejamento local
|
|
128
|
+
5. Se tudo OK: prosseguir com execucao
|
|
129
|
+
|
|
130
|
+
## Quando este arquivo e atualizado
|
|
131
|
+
|
|
132
|
+
- Criado: ao final de `/up:plan`
|
|
133
|
+
- Lido: no inicio de `/up:build`
|
|
134
|
+
- Atualizado: nunca (e snapshot do planejamento)
|
|
135
|
+
- Deletado: ao final do `/up:build` (vira PROJECT-COMPLETE.md)
|
|
136
|
+
|
|
137
|
+
</guidelines>
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Workflow `/up:build` — Execucao de projeto previamente planejado.
|
|
3
|
+
|
|
4
|
+
Requer `.plano/PLAN-READY.md` (gerado por `/up:plan`).
|
|
5
|
+
|
|
6
|
+
Conduz Estagios 3 (Build) + 4 (Quality Gate) + 4.5 (Delivery Audit) + 5 (Delivery).
|
|
7
|
+
|
|
8
|
+
Pode executar projeto planejado em outro runtime — confia no PLAN-READY.md.
|
|
9
|
+
</purpose>
|
|
10
|
+
|
|
11
|
+
<core_principle>
|
|
12
|
+
Este workflow assume que o projeto foi completamente planejado por `/up:plan`.
|
|
13
|
+
|
|
14
|
+
Diferenca do builder:
|
|
15
|
+
- Builder: planeja + executa em sequencia, no mesmo runtime
|
|
16
|
+
- Build: SO executa, le PLAN-READY.md gerado anteriormente (mesmo runtime ou outro)
|
|
17
|
+
|
|
18
|
+
**Sem model routing** — runtime decide o modelo.
|
|
19
|
+
|
|
20
|
+
**Re-plan local permitido (max 2):**
|
|
21
|
+
Se durante execucao o execution-supervisor detectar que um plano esta inviavel,
|
|
22
|
+
ele pode pedir REQUEST_REPLAN. O planejador local refaz o plano daquela fase.
|
|
23
|
+
NUNCA volta pro runtime que planejou originalmente.
|
|
24
|
+
</core_principle>
|
|
25
|
+
|
|
26
|
+
<process>
|
|
27
|
+
|
|
28
|
+
## Estagio 0: GATES OBRIGATORIOS
|
|
29
|
+
|
|
30
|
+
### 0.1 Owner Profile (LOCAL)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
if [ ! -f ~/.claude/up/owner-profile.md ]; then
|
|
34
|
+
echo "Owner profile nao existe NESTE runtime. Rodando /up:onboard..."
|
|
35
|
+
# Delegar pro workflow onboarding.md
|
|
36
|
+
fi
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**IMPORTANTE:** O profile e do RUNTIME ATUAL, nao do runtime que planejou. Cada runtime tem seu profile.
|
|
40
|
+
|
|
41
|
+
### 0.2 PLAN-READY.md Existe?
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
if [ ! -f .plano/PLAN-READY.md ]; then
|
|
45
|
+
echo "ERRO: Este projeto nao foi planejado."
|
|
46
|
+
echo ""
|
|
47
|
+
echo "Use /up:plan primeiro pra planejar o projeto."
|
|
48
|
+
echo "Ou /up:modo-builder pra planejar e executar de uma vez."
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 0.3 Crash Recovery
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ls .plano/LOCK.md 2>/dev/null
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Se LOCK.md existe e `stage: build`: retomar.
|
|
60
|
+
|
|
61
|
+
## Estagio V: VALIDACAO LIGHT
|
|
62
|
+
|
|
63
|
+
**Confiar no PLAN-READY.md, mas spot-check estrutura.**
|
|
64
|
+
|
|
65
|
+
### V.1 Parsear PLAN-READY.md
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Extrair frontmatter
|
|
69
|
+
PLANNED_RUNTIME=$(grep "runtime:" .plano/PLAN-READY.md | head -1 | awk '{print $2}')
|
|
70
|
+
INTENDED_RUNTIME=$(grep -A1 "intended_execution:" .plano/PLAN-READY.md | tail -1 | awk '{print $2}')
|
|
71
|
+
TOTAL_PHASES=$(grep "total_phases:" .plano/PLAN-READY.md | awk '{print $2}')
|
|
72
|
+
CONFIDENCE=$(grep "planning_confidence:" .plano/PLAN-READY.md | awk '{print $2}')
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### V.2 Validacao de Compatibilidade
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
CURRENT_RUNTIME="claude-code" # detectar
|
|
79
|
+
[ -d ~/.config/opencode ] && CURRENT_RUNTIME="opencode"
|
|
80
|
+
[ -d ~/.gemini ] && CURRENT_RUNTIME="gemini-cli"
|
|
81
|
+
|
|
82
|
+
# Se intended_execution especifica um runtime e nao e o atual, alertar
|
|
83
|
+
if [ "$INTENDED_RUNTIME" != "same" ] && [ "$INTENDED_RUNTIME" != "any" ] && [ "$INTENDED_RUNTIME" != "$CURRENT_RUNTIME" ]; then
|
|
84
|
+
echo "AVISO: Plano gerado pra $INTENDED_RUNTIME, voce esta em $CURRENT_RUNTIME"
|
|
85
|
+
echo "Pode haver incompatibilidades. Continuar mesmo assim?"
|
|
86
|
+
# AskUserQuestion sim/nao
|
|
87
|
+
fi
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### V.3 Validar Artefatos Esperados
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
[ -f .plano/PROJECT.md ] || { echo "FALTANDO: PROJECT.md"; FAIL=1; }
|
|
94
|
+
[ -f .plano/ROADMAP.md ] || { echo "FALTANDO: ROADMAP.md"; FAIL=1; }
|
|
95
|
+
[ -f .plano/REQUIREMENTS.md ] || { echo "FALTANDO: REQUIREMENTS.md"; FAIL=1; }
|
|
96
|
+
[ -f .plano/SYSTEM-DESIGN.md ] || { echo "FALTANDO: SYSTEM-DESIGN.md"; FAIL=1; }
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### V.4 Validar Planos Listados
|
|
100
|
+
|
|
101
|
+
Pra cada plano listado em PLAN-READY.md, checar se arquivo existe:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Extrair lista de planos do PLAN-READY.md
|
|
105
|
+
PLANS=$(grep -oE "fases/[0-9]+-[a-z-]+/[0-9]+-[0-9]+-PLAN.md" .plano/PLAN-READY.md)
|
|
106
|
+
|
|
107
|
+
for plan in $PLANS; do
|
|
108
|
+
if [ ! -f ".plano/$plan" ]; then
|
|
109
|
+
echo "FALTANDO: $plan"
|
|
110
|
+
FAIL=1
|
|
111
|
+
fi
|
|
112
|
+
done
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### V.5 Decidir
|
|
116
|
+
|
|
117
|
+
**Se todos arquivos OK:** prosseguir.
|
|
118
|
+
|
|
119
|
+
**Se algo falta:**
|
|
120
|
+
- Alertar usuario
|
|
121
|
+
- Oferecer: "Posso planejar localmente?" (re-roda /up:plan)
|
|
122
|
+
- Ou abortar
|
|
123
|
+
|
|
124
|
+
## Estagio C: CEO CONFIRMA
|
|
125
|
+
|
|
126
|
+
Spawnar CEO local:
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
Agent(
|
|
130
|
+
subagent_type="up-project-ceo",
|
|
131
|
+
prompt="""
|
|
132
|
+
Confirmar execucao de projeto previamente planejado.
|
|
133
|
+
|
|
134
|
+
<files_to_read>
|
|
135
|
+
- ~/.claude/up/owner-profile.md (perfil LOCAL deste runtime)
|
|
136
|
+
- .plano/BRIEFING.md (briefing original)
|
|
137
|
+
- .plano/PLAN-READY.md (resumo do planejamento)
|
|
138
|
+
- .plano/AUDIT-PLAN.md (audit do planejamento)
|
|
139
|
+
- .plano/PENDING.md
|
|
140
|
+
</files_to_read>
|
|
141
|
+
|
|
142
|
+
Apresentar ao dono:
|
|
143
|
+
- "Detectei projeto planejado em {runtime} por {ceo_name_anterior}"
|
|
144
|
+
- Resumo: N fases, M planos
|
|
145
|
+
- Planning confidence: X/100
|
|
146
|
+
- Pendencias conhecidas
|
|
147
|
+
- "Iniciar execucao? (enter pra continuar)"
|
|
148
|
+
|
|
149
|
+
Se dono confirmar: prosseguir.
|
|
150
|
+
Se recusar: abortar.
|
|
151
|
+
"""
|
|
152
|
+
)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Estagio 3: BUILD (loop por fase)
|
|
156
|
+
|
|
157
|
+
**Mesmo processo do builder.md secao Estagio 3, mas SEM model routing.**
|
|
158
|
+
|
|
159
|
+
Para cada fase em ROADMAP.md (em ordem):
|
|
160
|
+
|
|
161
|
+
### 3.1 Carregar Plano da Fase
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
PHASE_DIR=$(ls -d .plano/fases/{phase_number}-* 2>/dev/null)
|
|
165
|
+
PLAN=$(ls "$PHASE_DIR"/*-PLAN.md | head -1)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 3.2 Detectar Tipo de Plano (Specialist Routing)
|
|
169
|
+
|
|
170
|
+
Ler o frontmatter do plano pra determinar qual specialist usar:
|
|
171
|
+
- Frontend tasks → up-frontend-specialist
|
|
172
|
+
- Backend tasks → up-backend-specialist
|
|
173
|
+
- Database tasks → up-database-specialist
|
|
174
|
+
- Misto → up-executor
|
|
175
|
+
|
|
176
|
+
### 3.3 Spawnar Specialist
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
Agent(
|
|
180
|
+
subagent_type="{up-specialist}",
|
|
181
|
+
prompt=f"""
|
|
182
|
+
Executar Plano da Fase {phase_number}.
|
|
183
|
+
|
|
184
|
+
<files_to_read>
|
|
185
|
+
- {PLAN}
|
|
186
|
+
- .plano/PROJECT.md
|
|
187
|
+
- .plano/SYSTEM-DESIGN.md
|
|
188
|
+
- $HOME/.claude/up/references/engineering-principles.md
|
|
189
|
+
- $HOME/.claude/up/references/production-requirements.md
|
|
190
|
+
</files_to_read>
|
|
191
|
+
|
|
192
|
+
Implementar todas as tarefas. Commitar atomicamente.
|
|
193
|
+
Gerar SUMMARY.md.
|
|
194
|
+
"""
|
|
195
|
+
)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 3.4 Execution Supervisor Revisa
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
Agent(
|
|
202
|
+
subagent_type="up-execution-supervisor",
|
|
203
|
+
prompt=f"""
|
|
204
|
+
Revisar execucao da Fase {phase_number}.
|
|
205
|
+
|
|
206
|
+
<files_to_read>
|
|
207
|
+
- {PLAN}
|
|
208
|
+
- {PHASE_DIR}/*-SUMMARY.md
|
|
209
|
+
- git diff
|
|
210
|
+
</files_to_read>
|
|
211
|
+
|
|
212
|
+
Decisao: APPROVE | REQUEST_CHANGES | REQUEST_REPLAN | ESCALATE
|
|
213
|
+
|
|
214
|
+
REQUEST_REPLAN: Se descobrir que o plano e fundamentalmente errado/inviavel.
|
|
215
|
+
Max 2 re-plans por projeto.
|
|
216
|
+
"""
|
|
217
|
+
)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### 3.5 Processar Decisao do Supervisor
|
|
221
|
+
|
|
222
|
+
**Se APPROVE:** prosseguir.
|
|
223
|
+
|
|
224
|
+
**Se REQUEST_CHANGES:** re-spawn specialist com feedback (max 3 ciclos).
|
|
225
|
+
|
|
226
|
+
**Se REQUEST_REPLAN:**
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
REPLAN_COUNT=$(cat .plano/governance/replans.log 2>/dev/null | wc -l)
|
|
230
|
+
if [ "$REPLAN_COUNT" -ge 2 ]; then
|
|
231
|
+
echo "Max re-plans atingido. Escalando pro CEO."
|
|
232
|
+
# ESCALATE
|
|
233
|
+
else
|
|
234
|
+
# Re-planejar fase localmente
|
|
235
|
+
echo "REQUEST_REPLAN aprovado. Re-planejando fase {phase_number} localmente..."
|
|
236
|
+
|
|
237
|
+
# Spawnar planejador LOCAL
|
|
238
|
+
Agent(
|
|
239
|
+
subagent_type="up-planejador",
|
|
240
|
+
prompt=f"""
|
|
241
|
+
RE-PLAN da Fase {phase_number}.
|
|
242
|
+
|
|
243
|
+
Plano original: {PLAN}
|
|
244
|
+
Razao do re-plan: {execution_supervisor_reason}
|
|
245
|
+
|
|
246
|
+
Refaca o plano corrigindo o problema descoberto.
|
|
247
|
+
"""
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
# Salvar como -PLAN-v2.md
|
|
251
|
+
mv "$PLAN" "${PLAN%-PLAN.md}-PLAN-v1.md"
|
|
252
|
+
# novo plano vira PLAN principal
|
|
253
|
+
|
|
254
|
+
# Registrar
|
|
255
|
+
echo "$(date -u) | phase-{phase_number} | execution-supervisor | REPLAN | reason: {reason}" >> .plano/governance/replans.log
|
|
256
|
+
|
|
257
|
+
# Planning-supervisor revisa novo plano
|
|
258
|
+
Agent(subagent_type="up-planning-supervisor", ...)
|
|
259
|
+
|
|
260
|
+
# Voltar pro 3.3 (re-spawn specialist)
|
|
261
|
+
fi
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Se ESCALATE:** chief-engineer entra.
|
|
265
|
+
|
|
266
|
+
### 3.6 Verificacao
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
Agent(subagent_type="up-verificador", ...)
|
|
270
|
+
Agent(subagent_type="up-verification-supervisor", ...)
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### 3.7 E2E + DCRV
|
|
274
|
+
|
|
275
|
+
Ver builder.md secao 3.1.5 (E2E) e 3.1.5.1 (DCRV).
|
|
276
|
+
|
|
277
|
+
### 3.8 Chief-engineer Aprova Fase
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
Agent(
|
|
281
|
+
subagent_type="up-chief-engineer",
|
|
282
|
+
prompt="Revisar Fase {phase_number} consolidada."
|
|
283
|
+
)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### 3.9 Marcar Completa e Avancar
|
|
287
|
+
|
|
288
|
+
## Estagio 4: QUALITY GATE GLOBAL
|
|
289
|
+
|
|
290
|
+
Mesmo processo do builder.md secao Estagio 4. Sem model routing.
|
|
291
|
+
|
|
292
|
+
## Estagio 4.5: DELIVERY AUDIT
|
|
293
|
+
|
|
294
|
+
```python
|
|
295
|
+
Agent(subagent_type="up-delivery-auditor", ...)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Estagio 5: DELIVERY
|
|
299
|
+
|
|
300
|
+
Mesmo processo. CEO local apresenta resultado.
|
|
301
|
+
|
|
302
|
+
### 5.X Marcar Projeto Completo
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
# PLAN-READY.md → PROJECT-COMPLETE.md
|
|
306
|
+
mv .plano/PLAN-READY.md .plano/PROJECT-COMPLETE.md
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Adicionar ao frontmatter:
|
|
310
|
+
```yaml
|
|
311
|
+
status: complete
|
|
312
|
+
completed_at: [timestamp]
|
|
313
|
+
completed_by:
|
|
314
|
+
runtime: [current]
|
|
315
|
+
ceo_name: [local]
|
|
316
|
+
final_confidence: [from audit]
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
</process>
|
|
320
|
+
|
|
321
|
+
<replans>
|
|
322
|
+
|
|
323
|
+
## Re-plans Locais (max 2)
|
|
324
|
+
|
|
325
|
+
Quando: execution-supervisor descobre que o plano original esta inviavel.
|
|
326
|
+
|
|
327
|
+
Como funciona:
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
Execution falha
|
|
331
|
+
↓
|
|
332
|
+
execution-supervisor analisa
|
|
333
|
+
↓
|
|
334
|
+
Decide: REQUEST_REPLAN
|
|
335
|
+
↓
|
|
336
|
+
Verifica replans.log < 2?
|
|
337
|
+
├─ Sim: prosseguir
|
|
338
|
+
└─ Nao: ESCALATE pro CEO
|
|
339
|
+
↓
|
|
340
|
+
Spawnar planejador LOCAL no runtime atual
|
|
341
|
+
↓
|
|
342
|
+
Refaz plano daquela fase
|
|
343
|
+
↓
|
|
344
|
+
Salva como PLAN-v2.md (preserva v1 pra historico)
|
|
345
|
+
↓
|
|
346
|
+
Planning-supervisor LOCAL revisa
|
|
347
|
+
↓
|
|
348
|
+
Se APPROVE: voltar pro executor com novo plano
|
|
349
|
+
Se REJECT: ESCALATE pro chief-engineer
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Registro em `.plano/governance/replans.log`:
|
|
353
|
+
```
|
|
354
|
+
2026-04-11T15:30:00Z | phase-3 | execution-supervisor | REPLAN | cycle 1/2
|
|
355
|
+
reason: Library X discontinued, need to use Y instead
|
|
356
|
+
original_plan: 03-01-PLAN-v1.md
|
|
357
|
+
new_plan: 03-01-PLAN.md (was v2)
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
</replans>
|
|
361
|
+
|
|
362
|
+
<success_criteria>
|
|
363
|
+
- [ ] Owner profile LOCAL validado
|
|
364
|
+
- [ ] PLAN-READY.md existe e parseado
|
|
365
|
+
- [ ] Validacao light passou (artefatos + planos existem)
|
|
366
|
+
- [ ] CEO confirmou execucao
|
|
367
|
+
- [ ] Todas fases executadas com supervisao
|
|
368
|
+
- [ ] Re-plans registrados (se houve)
|
|
369
|
+
- [ ] Quality Gate global passou
|
|
370
|
+
- [ ] Delivery audit aprovou
|
|
371
|
+
- [ ] CEO apresentou resultado
|
|
372
|
+
- [ ] PLAN-READY.md → PROJECT-COMPLETE.md
|
|
373
|
+
</success_criteria>
|