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
package/workflows/builder.md
CHANGED
|
@@ -55,37 +55,25 @@ Neste modo, TODOS os agentes devem:
|
|
|
55
55
|
7. **Quality Gate:** Incluir clone-verifier como dimensao "Fidelidade" (20% do score).
|
|
56
56
|
</core_principle>
|
|
57
57
|
|
|
58
|
-
<
|
|
59
|
-
##
|
|
58
|
+
<model_handling>
|
|
59
|
+
## Modelos (v0.6.0+)
|
|
60
60
|
|
|
61
|
-
**
|
|
61
|
+
**O runtime decide o modelo.** O UP nao especifica `model=opus/sonnet/haiku` em nenhum spawn de agente.
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
| **Execution** | $MODEL_EXECUTION | up-executor, up-frontend-specialist, up-backend-specialist, up-database-specialist | sonnet |
|
|
67
|
-
| **Verification** | $MODEL_VERIFICATION | up-verificador, up-code-reviewer, up-blind-validator, up-requirements-validator | opus |
|
|
68
|
-
| **Detection** | $MODEL_DETECTION | up-visual-critic, up-exhaustive-tester, up-api-tester | sonnet |
|
|
69
|
-
| **Research** | $MODEL_RESEARCH | up-pesquisador-projeto, up-pesquisador-mercado, up-mapeador-codigo, up-sintetizador | sonnet |
|
|
70
|
-
| **Quality** | $MODEL_QUALITY | up-qa-agent, up-security-reviewer, up-auditor-ux, up-auditor-performance, up-auditor-modernidade, up-sintetizador-melhorias, up-consolidador-ideias, up-devops-agent, up-technical-writer | opus |
|
|
63
|
+
- Em Claude Code, os agentes usam o modelo default (Opus 4.6) ou o que o usuario configurou via `/model`.
|
|
64
|
+
- Em OpenCode, cada agente usa o modelo configurado no `opencode.json`.
|
|
65
|
+
- Em Gemini CLI, usa o modelo do runtime.
|
|
71
66
|
|
|
72
|
-
|
|
73
|
-
```python
|
|
74
|
-
# ANTES (sem model routing):
|
|
75
|
-
Task(subagent_type="up-executor", prompt="...")
|
|
67
|
+
Antes v0.5.x tinha routing por papel (planning=opus, execution=sonnet). Isso foi removido em v0.6.0 para simplicidade e portabilidade entre runtimes.
|
|
76
68
|
|
|
77
|
-
|
|
78
|
-
Task(subagent_type="up-executor", model="$MODEL_EXECUTION", prompt="...")
|
|
69
|
+
**Planos sao sempre gerados em nivel detalhado (Sonnet-ready)** independente do modelo que vai executar. Assim funcionam em qualquer runtime.
|
|
79
70
|
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
**Ao spawnar qualquer agente:**
|
|
72
|
+
```python
|
|
73
|
+
Task(subagent_type="up-executor", prompt="...")
|
|
82
74
|
```
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
1. Identificar o papel do agente na tabela acima
|
|
86
|
-
2. Usar a variavel $MODEL_* correspondente como parametro model
|
|
87
|
-
3. Se a variavel nao foi definida (sem builder-defaults), usar o default da tabela
|
|
88
|
-
</model_routing>
|
|
75
|
+
Sem parametro `model`.
|
|
76
|
+
</model_handling>
|
|
89
77
|
|
|
90
78
|
<governance>
|
|
91
79
|
## Camada de Governanca (v0.5.0+)
|
|
@@ -207,23 +195,7 @@ DEFAULTS_PATH="$HOME/.claude/up/builder-defaults.md"
|
|
|
207
195
|
|
|
208
196
|
Ler `$DEFAULTS_PATH` se existir. Se nao existir, informar: "Sem builder-defaults.md. Usando inferencia inteligente para decisoes nao especificadas. Crie ~/.claude/up/builder-defaults.md para personalizar."
|
|
209
197
|
|
|
210
|
-
**
|
|
211
|
-
|
|
212
|
-
Se builder-defaults.md existe, procurar secao "## Modelos por Papel" e extrair mapeamento:
|
|
213
|
-
```
|
|
214
|
-
$MODEL_PLANNING = modelo para planning (default: opus)
|
|
215
|
-
$MODEL_EXECUTION = modelo para execution (default: sonnet)
|
|
216
|
-
$MODEL_VERIFICATION = modelo para verification (default: opus)
|
|
217
|
-
$MODEL_DETECTION = modelo para detection (default: sonnet)
|
|
218
|
-
$MODEL_RESEARCH = modelo para research (default: sonnet)
|
|
219
|
-
$MODEL_QUALITY = modelo para quality (default: opus)
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Se secao nao existe: usar defaults acima (opus planeja, sonnet executa, opus verifica).
|
|
223
|
-
|
|
224
|
-
**IMPORTANTE — Sonnet-ready planning:**
|
|
225
|
-
Se `$MODEL_EXECUTION = sonnet`, setar flag `$SONNET_EXECUTION = true`.
|
|
226
|
-
Isso ativa nivel extra de detalhe nos planos (ver planejador Sonnet-ready mode).
|
|
198
|
+
**v0.6.0+: Sem extracao de modelos.** O runtime decide o modelo. Planos sao sempre Sonnet-ready (detalhe maximo).
|
|
227
199
|
|
|
228
200
|
**Detectar modo automaticamente:**
|
|
229
201
|
|
|
@@ -659,7 +631,7 @@ Escrever .plano/PRODUCT-ANALYSIS.md
|
|
|
659
631
|
Commit apos escrever.
|
|
660
632
|
Retornar: ## PRODUCT ANALYSIS COMPLETE
|
|
661
633
|
</output>
|
|
662
|
-
", subagent_type="up-product-analyst",
|
|
634
|
+
", subagent_type="up-product-analyst", description="Analisar produto e mercado")
|
|
663
635
|
```
|
|
664
636
|
|
|
665
637
|
Verificar retorno `## PRODUCT ANALYSIS COMPLETE`. Se falhou: registrar e continuar (System Designer usara blueprints como fallback).
|
|
@@ -708,7 +680,7 @@ Escrever .plano/SYSTEM-DESIGN.md
|
|
|
708
680
|
Commit apos escrever.
|
|
709
681
|
Retornar: ## SYSTEM DESIGN COMPLETE
|
|
710
682
|
</output>
|
|
711
|
-
", subagent_type="up-system-designer",
|
|
683
|
+
", subagent_type="up-system-designer", description="Projetar sistema completo")
|
|
712
684
|
```
|
|
713
685
|
|
|
714
686
|
```
|
|
@@ -771,7 +743,7 @@ Se brownfield:
|
|
|
771
743
|
- parallelization=true
|
|
772
744
|
- Commit todos arquivos ao final
|
|
773
745
|
</constraints>
|
|
774
|
-
", subagent_type="up-arquiteto",
|
|
746
|
+
", subagent_type="up-arquiteto", description="Estruturar projeto executavel")
|
|
775
747
|
```
|
|
776
748
|
|
|
777
749
|
### 2.7 Validar Requisitos (Quality Gate de Planejamento)
|
|
@@ -785,7 +757,7 @@ Validando requisitos (13 checks)...
|
|
|
785
757
|
```
|
|
786
758
|
Task(
|
|
787
759
|
subagent_type="up-requirements-validator",
|
|
788
|
-
|
|
760
|
+
,
|
|
789
761
|
prompt="
|
|
790
762
|
<objective>
|
|
791
763
|
Validar REQUIREMENTS.md com 13 checks automaticos.
|
|
@@ -977,7 +949,7 @@ Task(prompt="
|
|
|
977
949
|
<planning_context>
|
|
978
950
|
**Fase:** {phase_number}
|
|
979
951
|
**Modo:** builder (autonomo -- NAO use AskUserQuestion)
|
|
980
|
-
|
|
952
|
+
**Sonnet-ready:** sempre (default em v0.6.0+)
|
|
981
953
|
|
|
982
954
|
<files_to_read>
|
|
983
955
|
- .plano/STATE.md (Estado do Projeto)
|
|
@@ -1019,14 +991,14 @@ Se algo falhar, corrija antes de retornar.
|
|
|
1019
991
|
Escrever PLAN.md em: .plano/fases/{phase_dir}/
|
|
1020
992
|
Retornar: ## PLANNING COMPLETE com resumo dos planos
|
|
1021
993
|
</output>
|
|
1022
|
-
", subagent_type="up-planejador",
|
|
994
|
+
", subagent_type="up-planejador", description="Planejar Fase {phase_number}")
|
|
1023
995
|
```
|
|
1024
996
|
|
|
1025
997
|
Verificar retorno:
|
|
1026
998
|
- `## PLANNING COMPLETE` → prosseguir para quality gate do plano
|
|
1027
999
|
- `## PLANNING INCONCLUSIVE` → tentar novamente com mais contexto (max 2 tentativas)
|
|
1028
1000
|
|
|
1029
|
-
**Quality Gate do Plano (
|
|
1001
|
+
**Quality Gate do Plano (sempre):**
|
|
1030
1002
|
|
|
1031
1003
|
Antes de passar pro executor, verificar qualidade do plano rapidamente:
|
|
1032
1004
|
```bash
|
|
@@ -1043,7 +1015,7 @@ done
|
|
|
1043
1015
|
```
|
|
1044
1016
|
|
|
1045
1017
|
Se algum plano tem detail_score < 2 e a fase tem mais de 3 tarefas:
|
|
1046
|
-
- Re-spawnar planejador com instrucao extra: "Plano insuficientemente detalhado
|
|
1018
|
+
- Re-spawnar planejador com instrucao extra: "Plano insuficientemente detalhado. Reescrever com imports, tipos, schemas e endpoints explicitos. Ver self-check Sonnet-ready."
|
|
1047
1019
|
- Max 1 re-tentativa de enriquecimento
|
|
1048
1020
|
|
|
1049
1021
|
```
|
|
@@ -1091,7 +1063,7 @@ Para cada wave, spawnar agentes especializados em paralelo (se parallelization=t
|
|
|
1091
1063
|
```
|
|
1092
1064
|
Task(
|
|
1093
1065
|
subagent_type="{up-frontend-specialist | up-backend-specialist | up-database-specialist | up-executor}",
|
|
1094
|
-
|
|
1066
|
+
,
|
|
1095
1067
|
prompt="
|
|
1096
1068
|
<objective>
|
|
1097
1069
|
Executar plano {plan_number} da fase {phase_number}-{phase_name}.
|
|
@@ -1154,7 +1126,7 @@ Spawnar code reviewer:
|
|
|
1154
1126
|
```
|
|
1155
1127
|
Task(
|
|
1156
1128
|
subagent_type="up-code-reviewer",
|
|
1157
|
-
|
|
1129
|
+
,
|
|
1158
1130
|
prompt="
|
|
1159
1131
|
<objective>
|
|
1160
1132
|
Revisar codigo da fase {phase_number} contra production-requirements e padroes de qualidade.
|
|
@@ -1211,7 +1183,7 @@ Modo builder. NAO use AskUserQuestion.
|
|
|
1211
1183
|
</builder_mode>
|
|
1212
1184
|
",
|
|
1213
1185
|
subagent_type="up-verificador",
|
|
1214
|
-
|
|
1186
|
+
|
|
1215
1187
|
)
|
|
1216
1188
|
```
|
|
1217
1189
|
|
|
@@ -1707,7 +1679,7 @@ Relatorio em .plano/ideias/RELATORIO.md
|
|
|
1707
1679
|
```
|
|
1708
1680
|
Task(
|
|
1709
1681
|
subagent_type="up-blind-validator",
|
|
1710
|
-
|
|
1682
|
+
,
|
|
1711
1683
|
prompt="
|
|
1712
1684
|
<objective>
|
|
1713
1685
|
Validar requisitos SEM ler codigo. Apenas navegar o app via Playwright e curl.
|
|
@@ -1859,7 +1831,7 @@ Spawnar devops agent:
|
|
|
1859
1831
|
```
|
|
1860
1832
|
Task(
|
|
1861
1833
|
subagent_type="up-devops-agent",
|
|
1862
|
-
|
|
1834
|
+
,
|
|
1863
1835
|
prompt="
|
|
1864
1836
|
<objective>
|
|
1865
1837
|
Gerar artefatos de producao para o projeto: Dockerfile, docker-compose, CI/CD, .env.example, seed data, scripts.
|
|
@@ -1898,7 +1870,7 @@ Spawnar technical writer:
|
|
|
1898
1870
|
```
|
|
1899
1871
|
Task(
|
|
1900
1872
|
subagent_type="up-technical-writer",
|
|
1901
|
-
|
|
1873
|
+
,
|
|
1902
1874
|
prompt="
|
|
1903
1875
|
<objective>
|
|
1904
1876
|
Gerar documentacao completa: README.md, API docs, CHANGELOG.md, setup guide.
|
|
@@ -1940,7 +1912,7 @@ Spawnar security reviewer:
|
|
|
1940
1912
|
```
|
|
1941
1913
|
Task(
|
|
1942
1914
|
subagent_type="up-security-reviewer",
|
|
1943
|
-
|
|
1915
|
+
,
|
|
1944
1916
|
prompt="
|
|
1945
1917
|
<objective>
|
|
1946
1918
|
Auditar codigo para vulnerabilidades de seguranca (OWASP Top 10, auth, injection, data exposure).
|
|
@@ -1978,7 +1950,7 @@ Spawnar QA agent:
|
|
|
1978
1950
|
```
|
|
1979
1951
|
Task(
|
|
1980
1952
|
subagent_type="up-qa-agent",
|
|
1981
|
-
|
|
1953
|
+
,
|
|
1982
1954
|
prompt="
|
|
1983
1955
|
<objective>
|
|
1984
1956
|
Identificar gaps de cobertura de testes, escrever testes que faltam, executar todos.
|
|
@@ -2505,7 +2477,7 @@ Spawnar up-verificador (mesmo do full — verificacao real, nao shortcut):
|
|
|
2505
2477
|
```
|
|
2506
2478
|
Task(
|
|
2507
2479
|
subagent_type="up-verificador",
|
|
2508
|
-
|
|
2480
|
+
,
|
|
2509
2481
|
prompt="Verificar fase {phase_number}. Diretorio: {phase_dir}. Objetivo: {goal}."
|
|
2510
2482
|
)
|
|
2511
2483
|
```
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Workflow `/up:plan` — Planejamento completo de projeto.
|
|
3
|
+
|
|
4
|
+
Conduz Estagios 1 (Intake) + 2 (Arquitetura) + 2.5 (Planejamento exaustivo de TODAS fases) + Planning Audit + PLAN-READY.
|
|
5
|
+
|
|
6
|
+
NAO executa nada. Para apos gerar PLAN-READY.md.
|
|
7
|
+
|
|
8
|
+
Resultado: projeto completamente planejado, pronto para `/up:build` no mesmo runtime ou outro.
|
|
9
|
+
</purpose>
|
|
10
|
+
|
|
11
|
+
<core_principle>
|
|
12
|
+
Este workflow REUTILIZA os agentes existentes do UP. Apenas orquestra Intake → Arquitetura → Planejamento → Audit.
|
|
13
|
+
|
|
14
|
+
Diferenca do builder:
|
|
15
|
+
- Builder planeja UMA fase, executa, planeja proxima, executa, etc. (incremental)
|
|
16
|
+
- Plan planeja TODAS as fases de uma vez antes de qualquer execucao (batch)
|
|
17
|
+
|
|
18
|
+
Por que? Para permitir que o build rode em outro runtime (ex: planeja em Claude Code, executa em OpenCode).
|
|
19
|
+
|
|
20
|
+
**Sem model routing** — runtime decide o modelo.
|
|
21
|
+
**Sonnet-ready obrigatorio** — todos planos em nivel maximo de detalhe.
|
|
22
|
+
</core_principle>
|
|
23
|
+
|
|
24
|
+
<process>
|
|
25
|
+
|
|
26
|
+
## Estagio 0: GATES OBRIGATORIOS
|
|
27
|
+
|
|
28
|
+
### 0.1 Owner Profile
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
if [ ! -f ~/.claude/up/owner-profile.md ]; then
|
|
32
|
+
echo "Owner profile nao existe. Rodando /up:onboard primeiro..."
|
|
33
|
+
# Delegar pro workflow onboarding.md
|
|
34
|
+
fi
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 0.2 Crash Recovery
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
ls .plano/LOCK.md 2>/dev/null
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Se LOCK.md existe e `stage: planning`: retomar de onde parou.
|
|
44
|
+
|
|
45
|
+
## Estagio 1: INTAKE (CEO conduz)
|
|
46
|
+
|
|
47
|
+
**Referencia:** `@~/.claude/up/workflows/ceo-intake.md`
|
|
48
|
+
|
|
49
|
+
Spawnar CEO:
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
Agent(
|
|
53
|
+
subagent_type="up-project-ceo",
|
|
54
|
+
prompt="""
|
|
55
|
+
Conduzir intake para novo projeto UP via /up:plan.
|
|
56
|
+
|
|
57
|
+
Briefing: {ARGUMENTS}
|
|
58
|
+
Modo: detectar (greenfield | brownfield)
|
|
59
|
+
|
|
60
|
+
Executar workflow ceo-intake.md ate completar:
|
|
61
|
+
- Briefing coletado
|
|
62
|
+
- Design system (passar pendente se nao tem)
|
|
63
|
+
- Credenciais (passar pendente se nao tem)
|
|
64
|
+
- Referencias
|
|
65
|
+
- Restricoes
|
|
66
|
+
|
|
67
|
+
Gerar BRIEFING.md, OWNER.md, PENDING.md, DESIGN-TOKENS.md.
|
|
68
|
+
"""
|
|
69
|
+
)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Estagio 2: ARQUITETURA
|
|
73
|
+
|
|
74
|
+
### 2.0 Gate: Inicializar .plano/
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
mkdir -p .plano .plano/captures .plano/fases .plano/issues-carryover .plano/governance
|
|
78
|
+
git init 2>/dev/null
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 2.1 Detectar Modo
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Brownfield se ha codigo existente
|
|
85
|
+
if ls package.json src/ app/ pages/ components/ 2>/dev/null; then
|
|
86
|
+
MODE=brownfield
|
|
87
|
+
else
|
|
88
|
+
MODE=greenfield
|
|
89
|
+
fi
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 2.2 Pesquisa OU Mapeamento (paralelo)
|
|
93
|
+
|
|
94
|
+
**Greenfield:** spawnar 4 pesquisadores em paralelo (ver builder.md secao similar).
|
|
95
|
+
|
|
96
|
+
**Brownfield:** spawnar 4 mapeadores em paralelo (ver builder.md secao similar).
|
|
97
|
+
|
|
98
|
+
### 2.3 Pipeline de Arquitetura
|
|
99
|
+
|
|
100
|
+
Spawnar em sequencia:
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
# Product Analyst
|
|
104
|
+
Agent(subagent_type="up-product-analyst", prompt="...")
|
|
105
|
+
|
|
106
|
+
# Product-supervisor revisa
|
|
107
|
+
Agent(subagent_type="up-product-supervisor", prompt="...")
|
|
108
|
+
|
|
109
|
+
# System Designer
|
|
110
|
+
Agent(subagent_type="up-system-designer", prompt="...")
|
|
111
|
+
|
|
112
|
+
# Architecture-supervisor revisa
|
|
113
|
+
Agent(subagent_type="up-architecture-supervisor", prompt="...")
|
|
114
|
+
|
|
115
|
+
# Arquiteto
|
|
116
|
+
Agent(subagent_type="up-arquiteto", prompt="...")
|
|
117
|
+
|
|
118
|
+
# Architecture-supervisor revisa
|
|
119
|
+
Agent(subagent_type="up-architecture-supervisor", prompt="...")
|
|
120
|
+
|
|
121
|
+
# Requirements validator
|
|
122
|
+
Agent(subagent_type="up-requirements-validator", prompt="...")
|
|
123
|
+
|
|
124
|
+
# Chief-architect aprova arquitetura global
|
|
125
|
+
Agent(subagent_type="up-chief-architect", prompt="...")
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 2.4 Gate Pos-Arquitetura
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
[ -f .plano/PROJECT.md ] || { echo "FALTANDO: PROJECT.md"; exit 1; }
|
|
132
|
+
[ -f .plano/ROADMAP.md ] || { echo "FALTANDO: ROADMAP.md"; exit 1; }
|
|
133
|
+
[ -f .plano/REQUIREMENTS.md ] || { echo "FALTANDO: REQUIREMENTS.md"; exit 1; }
|
|
134
|
+
[ -f .plano/SYSTEM-DESIGN.md ] || { echo "FALTANDO: SYSTEM-DESIGN.md"; exit 1; }
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Estagio 2.5: PLANEJAMENTO EXAUSTIVO
|
|
138
|
+
|
|
139
|
+
**Para CADA fase do ROADMAP, planejar AGORA (nao incrementalmente).**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
PHASES=$(node "$HOME/.claude/up/bin/up-tools.cjs" roadmap list-phases)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Para cada fase:
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
# Planejador (Sonnet-ready obrigatorio)
|
|
149
|
+
Agent(
|
|
150
|
+
subagent_type="up-planejador",
|
|
151
|
+
prompt=f"""
|
|
152
|
+
Planejar Fase {phase_number}: {phase_name}.
|
|
153
|
+
|
|
154
|
+
Modo: builder (autonomo, sem AskUserQuestion)
|
|
155
|
+
Sonnet-ready: SEMPRE (default v0.6.0+)
|
|
156
|
+
|
|
157
|
+
<files_to_read>
|
|
158
|
+
- .plano/STATE.md
|
|
159
|
+
- .plano/ROADMAP.md
|
|
160
|
+
- .plano/REQUIREMENTS.md
|
|
161
|
+
- .plano/SYSTEM-DESIGN.md
|
|
162
|
+
- .plano/PROJECT.md
|
|
163
|
+
- .plano/codebase/* (se brownfield)
|
|
164
|
+
</files_to_read>
|
|
165
|
+
|
|
166
|
+
REQs da fase: {phase_req_ids}
|
|
167
|
+
|
|
168
|
+
Gerar 5-8 planos com nivel maximo de detalhe.
|
|
169
|
+
"""
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
# Planning-supervisor revisa
|
|
173
|
+
Agent(
|
|
174
|
+
subagent_type="up-planning-supervisor",
|
|
175
|
+
prompt=f"""
|
|
176
|
+
Revisar planos da Fase {phase_number}.
|
|
177
|
+
|
|
178
|
+
Decisao: APPROVE | REQUEST_CHANGES | ESCALATE
|
|
179
|
+
Max 3 ciclos de rework.
|
|
180
|
+
"""
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
# Se REQUEST_CHANGES: re-spawn planejador com feedback
|
|
184
|
+
# Se ESCALATE: chief-engineer entra
|
|
185
|
+
# Se APPROVE: prosseguir pra proxima fase
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Apos todas fases planejadas:
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
# Chief-engineer aprova consistencia cross-fase
|
|
192
|
+
Agent(
|
|
193
|
+
subagent_type="up-chief-engineer",
|
|
194
|
+
prompt="""
|
|
195
|
+
Revisar TODOS os planos gerados.
|
|
196
|
+
Validar coerencia cross-fase, dependencies, waves.
|
|
197
|
+
Decisao: APPROVE | REQUEST_CHANGES
|
|
198
|
+
"""
|
|
199
|
+
)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Estagio P: PLANNING AUDIT
|
|
203
|
+
|
|
204
|
+
```python
|
|
205
|
+
Agent(
|
|
206
|
+
subagent_type="up-planning-auditor",
|
|
207
|
+
prompt="""
|
|
208
|
+
Auditar planejamento completo.
|
|
209
|
+
|
|
210
|
+
<files_to_read>
|
|
211
|
+
- .plano/CHECKLIST.md
|
|
212
|
+
- .plano/BRIEFING.md
|
|
213
|
+
- .plano/PROJECT.md
|
|
214
|
+
- .plano/ROADMAP.md
|
|
215
|
+
- .plano/REQUIREMENTS.md
|
|
216
|
+
- .plano/SYSTEM-DESIGN.md
|
|
217
|
+
- .plano/PENDING.md
|
|
218
|
+
- .plano/fases/*/*.md
|
|
219
|
+
- .plano/governance/approvals.log
|
|
220
|
+
- $HOME/.claude/up/templates/audit-plan.md
|
|
221
|
+
</files_to_read>
|
|
222
|
+
|
|
223
|
+
Calcular Planning Confidence Score (0-100).
|
|
224
|
+
Validar artefatos, planos, cobertura REQs, Sonnet-readiness, aprovacoes.
|
|
225
|
+
|
|
226
|
+
Gerar .plano/AUDIT-PLAN.md.
|
|
227
|
+
|
|
228
|
+
Decisao: READY_FOR_BUILD | READY_WITH_WARNINGS | NEEDS_REWORK | BLOCKED
|
|
229
|
+
"""
|
|
230
|
+
)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Processar Decisao
|
|
234
|
+
|
|
235
|
+
**Se READY_FOR_BUILD:** prosseguir pro Estagio PR.
|
|
236
|
+
|
|
237
|
+
**Se READY_WITH_WARNINGS:** CEO confirma com dono se quer prosseguir mesmo assim.
|
|
238
|
+
|
|
239
|
+
**Se NEEDS_REWORK:** executar rework plan, re-rodar auditor (max 3 ciclos).
|
|
240
|
+
|
|
241
|
+
**Se BLOCKED:** escalar pro CEO, que alerta dono.
|
|
242
|
+
|
|
243
|
+
## Estagio PR: PLAN READY
|
|
244
|
+
|
|
245
|
+
### PR.1 Gerar PLAN-READY.md
|
|
246
|
+
|
|
247
|
+
Usar template `$HOME/.claude/up/templates/plan-ready.md`.
|
|
248
|
+
|
|
249
|
+
Preencher com:
|
|
250
|
+
- planned_at: timestamp atual
|
|
251
|
+
- planned_by.runtime: detectar (claude-code | opencode | gemini-cli)
|
|
252
|
+
- planned_by.ceo_name: do owner-profile
|
|
253
|
+
- intended_execution.runtime: do flag --execution-runtime ou "same"
|
|
254
|
+
- project_name: do PROJECT.md
|
|
255
|
+
- mode: greenfield | brownfield
|
|
256
|
+
- total_phases, total_plans, total_requirements
|
|
257
|
+
- planning_confidence: do AUDIT-PLAN.md
|
|
258
|
+
- Lista completa de planos
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Detectar runtime atual
|
|
262
|
+
if [ -d ~/.claude ]; then RUNTIME="claude-code"
|
|
263
|
+
elif [ -d ~/.config/opencode ]; then RUNTIME="opencode"
|
|
264
|
+
elif [ -d ~/.gemini ]; then RUNTIME="gemini-cli"
|
|
265
|
+
fi
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### PR.2 Commit Final
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
git add .plano/
|
|
272
|
+
node "$HOME/.claude/up/bin/up-tools.cjs" commit "plan: project ready for execution" --files .plano/PLAN-READY.md .plano/AUDIT-PLAN.md
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### PR.3 CEO Apresenta
|
|
276
|
+
|
|
277
|
+
Spawnar CEO:
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
Agent(
|
|
281
|
+
subagent_type="up-project-ceo",
|
|
282
|
+
prompt="""
|
|
283
|
+
Apresentar resumo do planejamento ao dono.
|
|
284
|
+
|
|
285
|
+
<files_to_read>
|
|
286
|
+
- ~/.claude/up/owner-profile.md
|
|
287
|
+
- .plano/PLAN-READY.md
|
|
288
|
+
- .plano/AUDIT-PLAN.md
|
|
289
|
+
- .plano/PENDING.md
|
|
290
|
+
</files_to_read>
|
|
291
|
+
|
|
292
|
+
Apresentar:
|
|
293
|
+
- Briefing entendido
|
|
294
|
+
- Stack escolhida
|
|
295
|
+
- N fases planejadas
|
|
296
|
+
- M planos gerados
|
|
297
|
+
- Planning confidence score
|
|
298
|
+
- Pendencias (agrupadas)
|
|
299
|
+
|
|
300
|
+
Informar:
|
|
301
|
+
"Planejamento completo. Para executar, use /up:build neste runtime
|
|
302
|
+
ou em outro (ex: OpenCode mais barato pra rodar)."
|
|
303
|
+
"""
|
|
304
|
+
)
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Sair
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
311
|
+
UP > /up:plan COMPLETO
|
|
312
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
313
|
+
|
|
314
|
+
Projeto planejado com sucesso.
|
|
315
|
+
|
|
316
|
+
Confidence: {N}/100
|
|
317
|
+
Fases: {N}
|
|
318
|
+
Planos: {M}
|
|
319
|
+
|
|
320
|
+
Proximo passo:
|
|
321
|
+
/up:build ← executar neste runtime
|
|
322
|
+
|
|
323
|
+
Ou em outro runtime:
|
|
324
|
+
cd <projeto> && /up-build (OpenCode)
|
|
325
|
+
cd <projeto> && /up:build (Gemini CLI)
|
|
326
|
+
|
|
327
|
+
Estado completo em .plano/
|
|
328
|
+
|
|
329
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
</process>
|
|
333
|
+
|
|
334
|
+
<flags>
|
|
335
|
+
|
|
336
|
+
## Flags Suportadas
|
|
337
|
+
|
|
338
|
+
### --execution-runtime=<runtime>
|
|
339
|
+
|
|
340
|
+
Informa ao planejador qual runtime sera usado pra executar.
|
|
341
|
+
|
|
342
|
+
Valores: `same` | `claude-code` | `opencode` | `gemini-cli` | `any`
|
|
343
|
+
|
|
344
|
+
Default: `same`
|
|
345
|
+
|
|
346
|
+
Efeito:
|
|
347
|
+
- Marca em PLAN-READY.md
|
|
348
|
+
- Se diferente do runtime atual, planejador adapta documentacao
|
|
349
|
+
- Build vai validar se PLAN-READY.md.intended_execution e compativel
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
/up:plan "CRM" --execution-runtime=opencode
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### --no-audit
|
|
356
|
+
|
|
357
|
+
Pula o Planning Audit (estagio P). Util pra desenvolvimento rapido.
|
|
358
|
+
NAO RECOMENDADO em producao.
|
|
359
|
+
|
|
360
|
+
</flags>
|
|
361
|
+
|
|
362
|
+
<success_criteria>
|
|
363
|
+
- [ ] Owner profile validado
|
|
364
|
+
- [ ] CEO conduziu intake
|
|
365
|
+
- [ ] BRIEFING, OWNER, PENDING, DESIGN-TOKENS gerados
|
|
366
|
+
- [ ] Pipeline de arquitetura completo (product-analyst → system-designer → arquiteto)
|
|
367
|
+
- [ ] Architecture supervisor aprovou cada artefato
|
|
368
|
+
- [ ] Chief-architect aprovou arquitetura global
|
|
369
|
+
- [ ] Chief-product aprovou fit
|
|
370
|
+
- [ ] TODAS fases do ROADMAP foram planejadas
|
|
371
|
+
- [ ] Planning-supervisor aprovou cada plano
|
|
372
|
+
- [ ] Chief-engineer aprovou cross-fase
|
|
373
|
+
- [ ] Planning-auditor rodou e gerou AUDIT-PLAN.md
|
|
374
|
+
- [ ] Planning Confidence Score calculado
|
|
375
|
+
- [ ] PLAN-READY.md gerado
|
|
376
|
+
- [ ] CEO apresentou resumo ao dono
|
|
377
|
+
- [ ] Commit final feito
|
|
378
|
+
</success_criteria>
|