rbin-task-flow 1.19.5 → 1.23.1

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.
Files changed (65) hide show
  1. package/.claude/skills/rbin-coding-standards/SKILL.md +29 -0
  2. package/.claude/skills/rbin-coding-standards/reference.md +42 -0
  3. package/.claude/skills/rbin-git/SKILL.md +39 -0
  4. package/.claude/skills/task-flow-audit/SKILL.md +15 -0
  5. package/.claude/skills/task-flow-check/SKILL.md +15 -0
  6. package/.claude/skills/task-flow-estimate/SKILL.md +15 -0
  7. package/.claude/skills/task-flow-generate-flow/SKILL.md +15 -0
  8. package/.claude/skills/task-flow-improve-changes/SKILL.md +15 -0
  9. package/.claude/skills/task-flow-refactor/SKILL.md +14 -0
  10. package/.claude/skills/task-flow-report/SKILL.md +15 -0
  11. package/.claude/skills/task-flow-review/SKILL.md +14 -0
  12. package/.claude/skills/task-flow-run/SKILL.md +28 -0
  13. package/.claude/skills/task-flow-run/workflow.md +59 -0
  14. package/.claude/skills/task-flow-status/SKILL.md +13 -0
  15. package/.claude/skills/task-flow-sync/SKILL.md +30 -0
  16. package/.claude/skills/task-flow-sync/workflow.md +57 -0
  17. package/.claude/skills/task-flow-think/SKILL.md +17 -0
  18. package/.codex/config.toml +10 -0
  19. package/.cursor/rules/code_comments.mdc +4 -4
  20. package/.cursor/rules/coding_standards.mdc +57 -810
  21. package/.cursor/rules/commit_practices.mdc +5 -138
  22. package/.cursor/rules/cursor_rules.mdc +4 -3
  23. package/.cursor/rules/git_control.mdc +5 -86
  24. package/.cursor/rules/graphify-task-flow.mdc +31 -0
  25. package/.cursor/rules/rbin-git-policy.mdc +47 -0
  26. package/.cursor/rules/self_improve.mdc +3 -3
  27. package/.cursor/rules/task-flow-cursor.mdc +51 -0
  28. package/.cursor/rules/task-flow-sync.mdc +46 -0
  29. package/.cursor/rules/task_analysis.mdc +31 -179
  30. package/.cursor/rules/task_audit.mdc +6 -5
  31. package/.cursor/rules/task_check.mdc +2 -3
  32. package/.cursor/rules/task_estimate.mdc +3 -4
  33. package/.cursor/rules/task_execution.mdc +26 -138
  34. package/.cursor/rules/task_generate_flow.mdc +2 -3
  35. package/.cursor/rules/task_generation.mdc +22 -140
  36. package/.cursor/rules/task_improve_changes.mdc +3 -4
  37. package/.cursor/rules/task_refactor.mdc +4 -5
  38. package/.cursor/rules/task_report.mdc +3 -4
  39. package/.cursor/rules/task_review.mdc +4 -5
  40. package/.cursor/rules/task_status.mdc +4 -4
  41. package/.cursor/rules/task_work.mdc +23 -210
  42. package/.task-flow/AI-PLATFORMS.md +104 -0
  43. package/.task-flow/CODEX.md +141 -0
  44. package/.task-flow/CURSOR.md +94 -0
  45. package/.task-flow/GRAPHIFY.md +113 -0
  46. package/.task-flow/OPTIMIZATION-IMPLEMENTATION-TASKS.md +365 -0
  47. package/.task-flow/OPTIMIZATION-PLAN.md +264 -0
  48. package/.task-flow/README.md +19 -4
  49. package/.task-flow/docs/coding-standards-full.md +851 -0
  50. package/.task-flow/platforms/claude-code.md +352 -0
  51. package/.task-flow/platforms/codex.md +379 -0
  52. package/.task-flow/platforms/cursor.md +333 -0
  53. package/AGENTS.md +69 -31
  54. package/CLAUDE.md +56 -48
  55. package/README.md +78 -10
  56. package/bin/cli.js +40 -25
  57. package/lib/codex.js +45 -0
  58. package/lib/cursor.js +41 -0
  59. package/lib/gitignore.js +101 -0
  60. package/lib/graphify.js +122 -0
  61. package/lib/install.js +83 -47
  62. package/lib/profiles.js +110 -0
  63. package/lib/skills.js +34 -0
  64. package/lib/utils.js +38 -2
  65. package/package.json +6 -2
@@ -0,0 +1,94 @@
1
+ # RBIN Task Flow — Cursor
2
+
3
+ Cursor loads **two always-on rules** plus **optional** skills and intelligent/glob rules. Heavy workflows are **not** in every chat — invoke skills explicitly.
4
+
5
+ | Always-on | Purpose |
6
+ |-----------|---------|
7
+ | `task-flow-cursor.mdc` | Bootstrap, paths, command → skill table |
8
+ | `rbin-git-policy.mdc` | Never write git; suggest commits |
9
+
10
+ Verify: `rg 'alwaysApply: true' .cursor/rules` → only the two files above.
11
+
12
+ **Full guide:** [platforms/cursor.md](platforms/cursor.md) · **Token roadmap:** [OPTIMIZATION-PLAN.md](OPTIMIZATION-PLAN.md)
13
+
14
+ **Install profiles:** `rbin-task-flow init --profile minimal` → 2 always-on rules + skills only; `standard` (default) → all `.mdc` rules. Saved in `.task-flow/install-meta.json`.
15
+
16
+ **Team git:** `init --share-ai-config` → `.cursor/skills/` and `.cursor/rules/` not gitignored (default ignores all `.cursor/`).
17
+
18
+ ---
19
+
20
+ ## Quick commands
21
+
22
+ | Say in Agent / Chat | Best invoke |
23
+ |---------------------|-------------|
24
+ | `task-flow: sync` | `@task-flow-sync` |
25
+ | `task-flow: run next 4` | `@task-flow-run` |
26
+ | `task-flow: status` | `@task-flow-status` |
27
+ | `task-flow: check` | `@task-flow-check` |
28
+ | `task-flow: improve changes` | `@task-flow-improve-changes` |
29
+ | Implement feature code | `@rbin-coding-standards` (explicit; checklist glob on `src/**`) |
30
+
31
+ **Avoid:** `@task_work` (short fallback only — prefer `@task-flow-run`).
32
+
33
+ ---
34
+
35
+ ## Rule modes (v1.23+)
36
+
37
+ | Layer | Examples | When loaded |
38
+ |-------|----------|-------------|
39
+ | **Always** | `task-flow-cursor`, `rbin-git-policy` | Every chat (~0,9k tokens) |
40
+ | **Skills** | `@task-flow-run`, `@task-flow-sync`, … | You invoke (recommended for run/sync/audit) |
41
+ | **Intelligent** | `task_work`, `task_audit`, `task_analysis`, … | Agent matches `description` |
42
+ | **Glob** | `task-flow-sync`, `task_generation` (`.task-flow/**`), `coding_standards` (`src/**`, `app/**`), `code_comments` | Matching paths in chat |
43
+ | **Manual** | `@cursor_rules`, `@self_improve`, `@task_report`, legacy `git_control` | You `@`-mention only (no `description` auto-match) |
44
+
45
+ **Coding standards:** checklist in `coding_standards.mdc` (glob). Full reference: `.task-flow/docs/coding-standards-full.md` — **sections only**, never whole file.
46
+
47
+ If a command fails to trigger, use **`@task-flow-*`** explicitly.
48
+
49
+ ---
50
+
51
+ ## Agent vs Chat
52
+
53
+ | Surface | Best for |
54
+ |---------|----------|
55
+ | **Agent** (Composer) | `@task-flow-run`, multi-file implementation |
56
+ | **Chat** | `sync`, `status`, `think`, `estimate` |
57
+ | **@ files** | `@tasks.input.txt`, `@.task-flow/contexts/mockup.png` |
58
+
59
+ ---
60
+
61
+ ## Status updates (non-negotiable)
62
+
63
+ After each subtask:
64
+
65
+ 1. `.task-flow/.internal/status.json` → subtask `done`
66
+ 2. `.task-flow/tasks.status.md` → `- [x]` + regenerate 📊 Summary
67
+
68
+ ---
69
+
70
+ ## Graphify
71
+
72
+ Only during `run` / `think` when `graphify-out/` exists. Does not replace Task Flow status. See [GRAPHIFY.md](GRAPHIFY.md).
73
+
74
+ ---
75
+
76
+ ## Troubleshooting
77
+
78
+ | Issue | Fix |
79
+ |-------|-----|
80
+ | Ignores task-flow | `rbin-task-flow update` |
81
+ | Run workflow wrong | **`@task-flow-run`** — avoid `@task_work` |
82
+ | Rule not applied | `@task-flow-<command>` for that workflow |
83
+ | Standards missing | File under `src/` or `@rbin-coding-standards` |
84
+ | Context too large | Fewer `src/` files in chat; skills not full docs |
85
+ | Wrong always-on count | `update`; don't set `graphify.mdc` always-on |
86
+
87
+ ---
88
+
89
+ ## References
90
+
91
+ - [platforms/cursor.md](platforms/cursor.md) — full guide
92
+ - [README.md](README.md) — all commands
93
+ - [AI-PLATFORMS.md](AI-PLATFORMS.md) — install matrix
94
+ - [Cursor Rules docs](https://cursor.com/docs/context/rules)
@@ -0,0 +1,113 @@
1
+ # Graphify + RBIN Task Flow
2
+
3
+ Graphify ([graphifyy](https://pypi.org/project/graphifyyy/)) cria um **grafo de conhecimento** do repositório. O Task Flow gerencia **tarefas e status**. Este guia evita que os dois **compitam por contexto** na IA.
4
+
5
+ **Instalação global do CLI:** `rbin-install-dev` → `20.6-install-graphify.sh` (macOS) ou `19.6` (Linux).
6
+
7
+ ---
8
+
9
+ ## Token discipline
10
+
11
+ - Use **summarized** `graphify query` output (symbols, paths, short lists) — not full graph dumps in chat.
12
+ - **Do not paste** `graphify-out/GRAPH_REPORT.md` (or entire report files) into the model context unless the user **explicitly** `@`-mentions that file.
13
+ - Prefer one targeted query per subtask over loading `graph.json` or large exports.
14
+ - Task Flow status files (`.task-flow/`) always win over Graphify for workflow and git.
15
+
16
+ ---
17
+
18
+ ## Divisão de responsabilidades
19
+
20
+ | | Task Flow | Graphify |
21
+ |---|-----------|----------|
22
+ | **Pergunta** | O que fazer agora? | Onde está X no código? |
23
+ | **Dados** | `.task-flow/` | `graphify-out/` |
24
+ | **Comandos** | `task-flow: sync`, `run`, `status`, … | `graphify extract`, `query`, `affected` |
25
+ | **Regra Cursor** | Várias `.mdc` (workflow) | `graphify-task-flow.mdc` (**sob demanda**) |
26
+
27
+ ---
28
+
29
+ ## O que o `rbin-task-flow init` já faz por você
30
+
31
+ 1. Copia **`.cursor/rules/graphify-task-flow.mdc`** — `alwaysApply: false` (não compete com `task_work`, etc.).
32
+ 2. Adiciona **`graphify-out/`** ao `.gitignore`.
33
+ 3. Se existir **`.cursor/rules/graphify.mdc`** do `graphify cursor install` (upstream com `alwaysApply: true`), o instalador **desativa** `alwaysApply` para economizar contexto.
34
+ 4. Com **`--graphify`** em `init`, `update` ou **`reset`**, roda `graphify extract . --backend claude-cli` se o CLI estiver no PATH (usa assinatura Claude Code — sem API key separada).
35
+
36
+ **Não** rodamos `graphify claude install` / `graphify cursor install` automaticamente — o install upstream força `graphify.mdc` always-on e incham `CLAUDE.md` / `AGENTS.md`.
37
+
38
+ ---
39
+
40
+ ## Fluxo recomendado
41
+
42
+ ```bash
43
+ cd seu-projeto
44
+ rbin-task-flow reset --graphify # ou init/update --graphify; recria .task-flow + grafo
45
+ task-flow: sync
46
+ task-flow: run next 3 # IA usa grafo só ao implementar
47
+ task-flow: check
48
+ # você: git commit
49
+ ```
50
+
51
+ ### Na IA (Cursor / Claude / Codex)
52
+
53
+ | Comando Task Flow | Usar Graphify? |
54
+ |-------------------|----------------|
55
+ | `sync`, `status`, `estimate`, `report`, `generate flow` | Não |
56
+ | `run next X`, `run N` | Sim, se `graphify-out/` existir |
57
+ | `think`, `review` | Opcional |
58
+ | `audit`, `improve changes` | Opcional (estrutura); padrões = checklist `coding_standards.mdc` |
59
+ | `check` | Não |
60
+
61
+ **Prompt exemplo:**
62
+
63
+ ```text
64
+ task-flow: run next 2 — se graphify-out existir, graphify query "<módulo da subtarefa>" antes de editar arquivos.
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Claude Code
70
+
71
+ - Use **`/graphify`** ou `graphify query` **durante** `task-flow: run`, não no lugar de atualizar status.
72
+ - Se já rodou `graphify claude install` no passado: o hook PreToolUse pode ajudar; evite duplicar parágrafos longos no `CLAUDE.md` — priorize [.task-flow/platforms/claude-code.md](platforms/claude-code.md).
73
+
74
+ ## Cursor
75
+
76
+ - Regra ativa: **`graphify-task-flow.mdc`** (Apply Intelligently), não `graphify.mdc` always-on.
77
+ - Se precisar do upstream: `@graphify` manualmente; não reative `alwaysApply: true` em `graphify.mdc` se usa Task Flow diário.
78
+
79
+ ## Codex
80
+
81
+ - Graphify não entra no `AGENTS.md` automaticamente (limite 32 KiB).
82
+ - No prompt: cite `.task-flow/GRAPHIFY.md` + `graphify query` ao executar `run`.
83
+
84
+ ---
85
+
86
+ ## Manutenção
87
+
88
+ | Evento | Ação |
89
+ |--------|------|
90
+ | Primeiro setup | `rbin-task-flow init --graphify` ou `graphify extract . --backend claude-cli` |
91
+ | Reset completo (tasks + template + grafo) | `rbin-task-flow reset --graphify` |
92
+ | Refactor grande após vários `run` | `graphify update .` ou `graphify extract . --backend claude-cli` |
93
+ | `task-flow: update` | Reaplica `graphify-task-flow.mdc` e pode rebaixar `graphify.mdc` |
94
+
95
+ ---
96
+
97
+ ## Troubleshooting
98
+
99
+ | Problema | Solução |
100
+ |----------|---------|
101
+ | IA ignora `task-flow:` | Graphify não é a causa — verifique rules Task Flow |
102
+ | Contexto cheio no Cursor | Confirme `graphify.mdc` não está `alwaysApply: true` |
103
+ | `graphify: command not found` | Rode `rbin-install-dev` (módulo Graphify) |
104
+ | `no LLM API key found` ao rodar `graphify extract .` manual | Use `rbin-task-flow init --graphify` (roda `--backend claude-cli`) ou exporte uma API key / `--backend ollama` |
105
+ | Grafo desatualizado | `graphify extract . --backend claude-cli` de novo |
106
+
107
+ ---
108
+
109
+ ## Referências
110
+
111
+ - [AI-PLATFORMS.md](AI-PLATFORMS.md) — índice Claude / Cursor / Codex
112
+ - [README.md](README.md) — comandos Task Flow
113
+ - Graphify CLI: `graphify --help`
@@ -0,0 +1,365 @@
1
+ # Tarefas de implementação — Otimização de tokens (RBIN Task Flow)
2
+
3
+ Subtarefas para IA implementar o [OPTIMIZATION-PLAN.md](OPTIMIZATION-PLAN.md). Cada bloco é **uma task**; itens numerados são **subtasks** executáveis em sequência (`task-flow: run next X` após colar em `tasks.input.txt`, ou seguir manualmente).
4
+
5
+ **Repositório:** pacote `rbin-task-flow` (template). **Não** editar `.task-flow/.internal/` do cliente — só arquivos do pacote.
6
+
7
+ **Pré-requisito:** ler [OPTIMIZATION-PLAN.md](OPTIMIZATION-PLAN.md) §5–8 (orçamento e detalhamento P0.1/P0.2).
8
+
9
+ **Ao concluir cada subtask:** marcar `- [x]` aqui; atualizar checkboxes em `OPTIMIZATION-PLAN.md` §6; entrada no `CHANGELOG.md` no fim de cada **task** (P0/P1/P2).
10
+
11
+ ---
12
+
13
+ ## Como usar com Task Flow
14
+
15
+ 1. Copiar linhas `- Task …` da seção [Formato tasks.input.txt](#formato-tasksinputtxt) para `.task-flow/tasks.input.txt`.
16
+ 2. `task-flow: sync`
17
+ 3. `task-flow: run 1` (ou `run next N`) — respeitar ordem: **Task 1 → 2 → …** (dependências).
18
+ 4. `task-flow: check` antes de considerar PR pronto.
19
+ 5. Medir always-on: `node scripts/measure-rule-bytes.js` (após Task 10 existir) ou `wc -c` nas regras `alwaysApply: true`.
20
+
21
+ **Invoke preferido (Cursor/Claude):** `@task-flow-run` — evitar `@task_work` durante este epic.
22
+
23
+ ---
24
+
25
+ ## Dependências entre tasks
26
+
27
+ ```text
28
+ Task 1 (git) ──┐
29
+ Task 2 (standards split) ──┼──► Task 7 (referências checklist)
30
+ Task 3 (task_work) ─────────┤
31
+ Task 4 (task_execution) ───┤
32
+ Task 5 (skill standards) ────┘ (após Task 2)
33
+ Task 6 (cursor.md docs) ───► após 1–5
34
+ Task 7 (audit/sync refs) ──► após Task 2
35
+ Task 8–9 (P1) ─────────────► após Task 6–7
36
+ Task 10–13 (P2) ───────────► após P0 completo
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Task 1 — P0.1: Unificar política de git (always-on único) ✅
42
+
43
+ **Objetivo:** always-on ≤ ~1,2k tokens para git+commits (hoje ~2,1k em duas regras).
44
+
45
+ ### Subtask 1.1 — Criar `rbin-git-policy.mdc` ✅
46
+
47
+ **Descrição:** Nova regra always-on fundindo git proibido + Conventional Commits + sugestão pós-subtask.
48
+
49
+ **Instruções:**
50
+ 1. Criar `.cursor/rules/rbin-git-policy.mdc` com frontmatter: `alwaysApply: true`, `description` opcional curta.
51
+ 2. Incluir: lista proibida (`git add`, `commit`, `push`, `pull`, `merge`, `checkout`, `reset`, `rebase`, `tag`); permitidos read-only (`status`, `diff`, `log`, `show`, `branch` list); formato de sugestão Conventional Commits + Task/Subtask ID; princípio “usuário executa git”.
52
+ 3. Manter ≤ **90 linhas** (~3,5 KB máx.).
53
+ 4. Não duplicar parágrafos longos de exemplos — no máximo 1 exemplo de mensagem de commit.
54
+
55
+ **Critério de aceite:** `rg 'alwaysApply: true' .cursor/rules` inclui `rbin-git-policy.mdc`; arquivo ≤ 90 linhas.
56
+
57
+ ---
58
+
59
+ ### Subtask 1.2 — Rebaixar regras git antigas ✅
60
+
61
+ **Descrição:** Remover always duplicado sem perder referências `mdc:`.
62
+
63
+ **Instruções:**
64
+ 1. Em `git_control.mdc`: setar `alwaysApply: false`; adicionar `description` “Legacy git detail — prefer rbin-git-policy.mdc”; corpo ≤ 15 linhas apontando para `rbin-git-policy.mdc` e `@rbin-git` skill.
65
+ 2. Em `commit_practices.mdc`: idem — `alwaysApply: false`, pointer para `rbin-git-policy.mdc`.
66
+ 3. Atualizar `task-flow-cursor.mdc`: seção Git → 2 linhas (“Never write git” + “Details: `rbin-git-policy.mdc`, suggest via `@rbin-git`”).
67
+
68
+ **Critério de aceite:** Exatamente **2** regras always-on de política: `task-flow-cursor.mdc` + `rbin-git-policy.mdc` (não `git_control` nem `commit_practices`).
69
+
70
+ ---
71
+
72
+ ### Subtask 1.3 — Atualizar referências cruzadas ✅
73
+
74
+ **Descrição:** Rules e skills apontam para a política unificada.
75
+
76
+ **Instruções:**
77
+ 1. `rg 'git_control|commit_practices' .cursor .claude AGENTS.md CLAUDE.md .task-flow` — atualizar links `mdc:` para `rbin-git-policy.mdc` onde for regra primária; manter legado só como “extended”.
78
+ 2. `.claude/skills/rbin-git/SKILL.md`: primeira linha “Complements `rbin-git-policy.mdc` (always-on)”.
79
+ 3. `install.sh` / `lib/graphify.js` / docs: sem mudança funcional; só se citarem always git explicitamente.
80
+
81
+ **Critério de aceite:** `rg 'commit_practices.mdc' .cursor/rules/task-flow-cursor.mdc` não assume always; política primária é `rbin-git-policy`.
82
+
83
+ ---
84
+
85
+ ## Task 2 — P0.2: Dividir coding standards (checklist + full) ✅
86
+
87
+ **Objetivo:** glob `src/**` carrega ~80–120 linhas, não 853.
88
+
89
+ ### Subtask 2.1 — Mover conteúdo completo para doc ✅
90
+
91
+ **Descrição:** Preservar 100% do conteúdo atual em arquivo sob demanda.
92
+
93
+ **Instruções:**
94
+ 1. Criar `.task-flow/docs/` se não existir.
95
+ 2. Copiar corpo atual de `.cursor/rules/coding_standards.mdc` (sem frontmatter) para `.task-flow/docs/coding-standards-full.md`.
96
+ 3. Adicionar cabeçalho no full doc: “Carregar sob demanda — audit profundo, dúvidas de arquitetura; não colar no chat inteiro.”
97
+
98
+ **Critério de aceite:** `coding-standards-full.md` ≥ linhas do antigo corpo; nenhuma seção crítica perdida.
99
+
100
+ ---
101
+
102
+ ### Subtask 2.2 — Reescrever `coding_standards.mdc` como checklist ✅
103
+
104
+ **Descrição:** Regra glob enxuta com links para full doc.
105
+
106
+ **Instruções:**
107
+ 1. Manter frontmatter: `alwaysApply: false`, `globs: src/**,app/**`, `description` clara.
108
+ 2. Corpo **80–120 linhas**: estrutura `app/features/shared`; app thin; page orchestrator; service+use-case; RHF+zod; `cn()`; sem `any`; sem raw button/input; naming suffixes (tabela compacta); link `mdc:.task-flow/docs/coding-standards-full.md` para detalhes.
109
+ 3. Remover exemplos de código longos do `.mdc` (ficam no full doc).
110
+
111
+ **Critério de aceite:** `wc -l .cursor/rules/coding_standards.mdc` ≤ 130; `wc -c` ≤ 6 KB.
112
+
113
+ ---
114
+
115
+ ### Subtask 2.3 — Garantir cópia no install ✅
116
+
117
+ **Descrição:** Projetos destino recebem o full doc.
118
+
119
+ **Instruções:**
120
+ 1. Verificar `lib/install.js` `copyTaskFlow` copia `.task-flow/docs/` (ajustar `filter` se excluir `docs`).
121
+ 2. `install.sh`: copiar `.task-flow/docs/` se script copiar `.task-flow` parcialmente.
122
+ 3. `.task-flow/README.md`: link para `docs/coding-standards-full.md`.
123
+
124
+ **Critério de aceite:** Após `node -e` simular copy ou inspeção de `copyTaskFlow`, `docs/coding-standards-full.md` está no template e será copiado.
125
+
126
+ ---
127
+
128
+ ## Task 3 — P0.3: Enxugar `task_work.mdc` ✅
129
+
130
+ **Objetivo:** fallback intelligent ≤ 40 linhas; skill é fonte da verdade.
131
+
132
+ ### Subtask 3.1 — Substituir corpo por pointer ✅
133
+
134
+ **Instruções:**
135
+ 1. Manter `description` citando `task-flow: run`, `run next X`, `run N`.
136
+ 2. Corpo: tabela comando → `@task-flow-run`; 5 bullets do fluxo crítico (read tasks.json/status, deps, update status, suggest commit); link `.claude/skills/task-flow-run/workflow.md`.
137
+ 3. Remover exemplos longos e duplicação de `task_execution`.
138
+
139
+ **Critério de aceite:** `wc -l task_work.mdc` ≤ 45.
140
+
141
+ ---
142
+
143
+ ## Task 4 — P0.4: Enxugar `task_execution.mdc` ✅
144
+
145
+ **Objetivo:** eliminar índice duplicado de `CLAUDE.md` / `task-flow-cursor`.
146
+
147
+ ### Subtask 4.1 — Stub de referência ✅
148
+
149
+ **Instruções:**
150
+ 1. `description`: “Task Flow command index — use task-flow-cursor.mdc and skills first.”
151
+ 2. Corpo ≤ 25 linhas: tabela comando → skill `@`; link `task-flow-cursor.mdc`, `CLAUDE.md`, `.task-flow/README.md`.
152
+ 3. `alwaysApply: false` (já deve estar).
153
+
154
+ **Critério de aceite:** `wc -l task_execution.mdc` ≤ 30.
155
+
156
+ ---
157
+
158
+ ## Task 5 — P0.5: Skill `rbin-coding-standards` sob demanda estrita ✅
159
+
160
+ **Depende de:** Task 2.
161
+
162
+ ### Subtask 5.1 — Ajustar frontmatter e SKILL.md ✅
163
+
164
+ **Instruções:**
165
+ 1. `.claude/skills/rbin-coding-standards/SKILL.md`: `disable-model-invocation: true`.
166
+ 2. Steps: (1) aplicar checklist em `coding_standards.mdc`; (2) só se ambíguo, ler `.task-flow/docs/coding-standards-full.md` seções relevantes — **não** colar arquivo inteiro no chat.
167
+ 3. `reference.md`: paths atualizados para checklist + full doc.
168
+
169
+ **Critério de aceite:** skill não referencia “ler coding_standards.mdc inteiro” como passo 1.
170
+
171
+ ---
172
+
173
+ ## Task 6 — P0.6: Atualizar documentação Cursor (v1.23+) ✅
174
+
175
+ **Depende de:** Tasks 1, 3, 4.
176
+
177
+ ### Subtask 6.1 — Corrigir `platforms/cursor.md` ✅
178
+
179
+ **Instruções:**
180
+ 1. §1: only **2** always de política (`task-flow-cursor` + `rbin-git-policy`) — ajustar texto que diz “3” se Task 1 mudar contagem; listar reais após P0.1.
181
+ 2. §2 matriz e §3 inventário: modos reais (Intelligent / Glob / Manual); não listar `task_work` como Always.
182
+ 3. § “Otimização agressiva”: marcar como **implementado** o que P0 cobriu; apontar para OPTIMIZATION-PLAN.
183
+
184
+ **Critério de aceite:** Nenhuma frase “coding standards em toda conversa Agent”.
185
+
186
+ ---
187
+
188
+ ### Subtask 6.2 — Atualizar `CURSOR.md` e `AI-PLATFORMS.md` ✅
189
+
190
+ **Instruções:**
191
+ 1. `CURSOR.md` tabela Rule modes: always = `task-flow-cursor` + `rbin-git-policy`.
192
+ 2. Troubleshooting: “evite `@task_work`; use `@task-flow-run`”.
193
+ 3. `AI-PLATFORMS.md` tabela install: `rbin-git-policy.mdc`, `docs/coding-standards-full.md`.
194
+
195
+ **Critério de aceite:** docs consistentes com `rg alwaysApply: true .cursor/rules`.
196
+
197
+ ---
198
+
199
+ ## Task 7 — P0.7: Referências audit/sync → checklist ✅
200
+
201
+ **Depende de:** Task 2. *(Concluída junto com Task 2.)*
202
+
203
+ ### Subtask 7.1 — Rules ✅
204
+
205
+ **Instruções:**
206
+ 1. `task_audit.mdc`, `task_improve_changes.mdc`, `task_generation.mdc`: scoring/instructions vs **checklist** (`coding_standards.mdc`); full doc só “user asks depth / architecture”.
207
+ 2. `graphify-task-flow.mdc`: linha audit → checklist, não full.
208
+
209
+ **Critério de aceite:** `rg 'coding-standards-full' .cursor/rules` presente onde audit menciona profundidade.
210
+
211
+ ---
212
+
213
+ ### Subtask 7.2 — Skills e Codex ✅
214
+
215
+ **Instruções:**
216
+ 1. `task-flow-audit`, `task-flow-improve-changes`, `task-flow-sync` SKILL.md: paths checklist + full.
217
+ 2. `AGENTS.md` tabela Commands: audit/implement → checklist; full path explícito opcional.
218
+ 3. `.task-flow/CODEX.md`: mesma distinção.
219
+
220
+ **Critério de aceite:** AGENTS.md não manda “ler coding_standards.mdc inteiro” sem qualificador.
221
+
222
+ ---
223
+
224
+ ## Task 8 — P1.1: Unificar sync (regra + analysis) ✅
225
+
226
+ ### Subtask 8.1 — Criar ou consolidar `task-flow-sync.mdc` ✅
227
+
228
+ **Instruções:**
229
+ 1. Opção A: novo `.cursor/rules/task-flow-sync.mdc` (intelligent) com workflow de sync (~60 linhas) extraído de `task_generation` + `task_analysis`.
230
+ 2. `task_generation.mdc`: remover bloco sync duplicado; pointer para `task-flow-sync.mdc` / `@task-flow-sync`.
231
+ 3. `task_analysis.mdc`: remover sync; manter `think` + roadmap `OPTIMIZATION-PLAN`.
232
+
233
+ **Critério de aceite:** um único lugar primário para procedimento `task-flow: sync`.
234
+
235
+ ---
236
+
237
+ ## Task 9 — P1.2–P1.6: Polish P1 ✅
238
+
239
+ ### Subtask 9.1 — Meta-regras manual only (P1.2) ✅
240
+
241
+ **Instruções:** `cursor_rules.mdc`, `self_improve.mdc`: sem `description` de auto-match amplo; nota “Invoke with @ only” no topo.
242
+
243
+ ---
244
+
245
+ ### Subtask 9.2 — Skill run: leitura parcial tasks.json (P1.3) ✅
246
+
247
+ **Instruções:** `task-flow-run/SKILL.md` + `workflow.md`: passo “Parse only pending task/subtask IDs; do not load full tasks.json into context if >50 subtasks — read JSON slice by task id”.
248
+
249
+ ---
250
+
251
+ ### Subtask 9.3 — GRAPHIFY.md limites (P1.4) ✅
252
+
253
+ **Instruções:** Adicionar seção “Token discipline”: max usar saída resumida de query; proibir colar `GRAPH_REPORT.md` salvo `@` explícito do usuário.
254
+
255
+ ---
256
+
257
+ ### Subtask 9.4 — CLAUDE.md anti-patterns (P1.5) ✅
258
+
259
+ **Instruções:** 3 bullets: prefer `/task-flow-run`; avoid loading full standards; link CURSOR.md.
260
+
261
+ ---
262
+
263
+ ### Subtask 9.5 — CLI info bytes (P1.6) ✅
264
+
265
+ **Instruções:** `lib/cursor.js` ou `lib/utils.js` `showNextSteps`: após install, calcular soma `wc -c` dos `.mdc` com `alwaysApply: true` e imprimir “Always-on rules: ~X KB”.
266
+
267
+ ---
268
+
269
+ ## Task 10 — P2.1: CLI `--profile minimal|standard` ✅
270
+
271
+ ### Subtask 10.1 — Flag e comportamento ✅
272
+
273
+ **Instruções:**
274
+ 1. `bin/cli.js`: `--profile <minimal|standard>` em init/update/reset (default `standard`).
275
+ 2. `minimal`: copiar só `task-flow-cursor.mdc`, `rbin-git-policy.mdc`, skills, `.task-flow/`; não copiar regras intelligent pesadas OU copiar stubs apenas.
276
+ 3. Documentar em README + OPTIMIZATION-PLAN.
277
+
278
+ **Critério de aceite:** `init --profile minimal` deixa ≤ 3 always-on e skills; standard = comportamento atual pós-P0.
279
+
280
+ ---
281
+
282
+ ## Task 11 — P2.2: `--share-ai-config` ✅
283
+
284
+ ### Subtask 11.1 — Gitignore opcional ✅
285
+
286
+ **Instruções:**
287
+ 1. Flag `--share-ai-config` em init: **não** adicionar `.cursor/skills/` (e opcionalmente `.cursor/rules/`) ao gitignore gerado.
288
+ 2. Comentário no `.gitignore` explicando trade-off tokens vs time.
289
+
290
+ **Critério de aceite:** com flag, `.cursor/skills` ausente do gitignore template.
291
+
292
+ ---
293
+
294
+ ## Task 12 — P2.3: Script `measure-rule-bytes.js` ✅
295
+
296
+ ### Subtask 12.1 — Implementar medição ✅
297
+
298
+ **Instruções:**
299
+ 1. `scripts/measure-rule-bytes.js`: listar `.cursor/rules/*.mdc`, parse frontmatter `alwaysApply`, imprimir tabela arquivo | bytes | linhas | always.
300
+ 2. Totais always-on vs resto; exit 1 se always-on > 5 KB (configurável).
301
+ 3. `package.json` script `"measure:rules": "node scripts/measure-rule-bytes.js"`.
302
+
303
+ **Critério de aceite:** script roda no CI local; README menciona.
304
+
305
+ ---
306
+
307
+ ## Task 13 — P2.4: Release P0 (CHANGELOG + version) ✅
308
+
309
+ ### Subtask 13.1 — Bump e notas ✅
310
+
311
+ **Instruções:**
312
+ 1. `package.json` minor bump (ex. 1.23.0).
313
+ 2. CHANGELOG: P0 breaking — `rbin-git-policy`, standards split, always-on count, migration `rbin-task-flow update`.
314
+ 3. OPTIMIZATION-PLAN.md §6: marcar P0.1–P0.7 `[x]`.
315
+
316
+ **Critério de aceite:** Definition of Done §11 do OPTIMIZATION-PLAN verificada com script Task 12.
317
+
318
+ ---
319
+
320
+ ## Verificação final (após Task 13) ✅
321
+
322
+ | Métrica | Comando / ação | Meta | v1.23.0 |
323
+ |---------|----------------|------|---------|
324
+ | Always-on bytes | `npm run measure:rules` | ≤ 5 KB | ~3,66 KB ✅ |
325
+ | Always-on count | `rg -l 'alwaysApply: true' .cursor/rules` | ≤ 3 arquivos | 2 ✅ |
326
+ | coding_standards | `wc -l .cursor/rules/coding_standards.mdc` | ≤ 130 | 101 ✅ |
327
+ | Run path | `@task-flow-run` + checklist glob | sem full doc always-on | ✅ |
328
+ | Check | `npm run measure:rules` | pass | exit 0 ✅ |
329
+
330
+ ---
331
+
332
+ ## Formato tasks.input.txt
333
+
334
+ Copie abaixo para `.task-flow/tasks.input.txt` e rode `task-flow: sync`:
335
+
336
+ ```text
337
+ - P0.1 Unificar política de git (rbin-git-policy always-on)
338
+ - P0.2 Dividir coding standards (checklist mdc + full doc)
339
+ - P0.3 Enxugar task_work.mdc (pointer para task-flow-run skill)
340
+ - P0.4 Enxugar task_execution.mdc (stub para task-flow-cursor)
341
+ - P0.5 Skill rbin-coding-standards disable-model-invocation e paths
342
+ - P0.6 Atualizar documentação Cursor e AI-PLATFORMS
343
+ - P0.7 Referências audit sync Codex para checklist
344
+ - P1.1 Unificar sync task-flow-sync.mdc e task_analysis ✅
345
+ - P1.2–P1.6 Polish P1 (meta-rules, run partial JSON, GRAPHIFY, CLAUDE, CLI bytes) ✅
346
+ - P2.1 CLI profile minimal e standard ✅
347
+ - P2.2 CLI share-ai-config gitignore ✅
348
+ - P2.3 Script measure-rule-bytes.js ✅
349
+ - P2.4 Release CHANGELOG bump e fechar P0 no OPTIMIZATION-PLAN ✅
350
+ ```
351
+
352
+ Após sync, o gerador de subtasks pode expandir cada linha usando as **Instruções** das subtasks deste arquivo como fonte (ou manter este `.md` como referência fixa durante `run`).
353
+
354
+ ---
355
+
356
+ ## Histórico
357
+
358
+ | Data | Nota |
359
+ |------|------|
360
+ | 2026-06-02 | Criado a partir de OPTIMIZATION-PLAN.md — 13 tasks, subtarefas para IA |
361
+ | 2026-06-02 | Tasks 1–13 concluídas — release npm **v1.23.0** (minor) |
362
+
363
+ ---
364
+
365
+ *Referência: [OPTIMIZATION-PLAN.md](OPTIMIZATION-PLAN.md) · Índice: [README.md](README.md)*