rbin-task-flow 1.1.2 → 1.3.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.
@@ -1,66 +1,116 @@
1
- # RBIN Task Flow - Comandos Rápidos
2
-
3
- ## 🚀 Comandos Rápidos
4
-
5
- | Comando | Descrição |
6
- |---------|-----------|
7
- | `task-flow: sync` | Sincronização completa: adiciona novas, remove removidas, atualiza modificadas, preserva status |
8
- | `task-flow: think` | Analisa código e sugere novas tasks |
9
- | `task-flow: run next X` | Trabalha nas próximas X subtasks (ex: `task-flow: run next 4`) |
10
- | `task-flow: run task X` | Executa todas as subtasks pendentes da task X (ex: `task-flow: run task 1`) |
11
- | `task-flow: status` | Mostra status atual das tasks |
12
- | `task-flow: review` | Revisa tasks marcadas como "done" |
13
- | `task-flow: refactor` | Refatora código do commit atual |
14
-
15
- **Veja detalhes completos abaixo ↓**
1
+ # RBIN Task Flow - Quick Commands
2
+
3
+ ## 🚀 Quick Commands
4
+
5
+ | Command | Description |
6
+ |---------|-------------|
7
+ | `task-flow: sync` | Complete synchronization: adds new, removes deleted, updates modified, preserves status |
8
+ | `task-flow: think` | Analyzes code and suggests new tasks |
9
+ | `task-flow: status` | Shows current task status |
10
+ | `task-flow: run next X` | Works on next X subtasks (e.g., `task-flow: run next 4`) |
11
+ | `task-flow: run X` | Executes all pending subtasks of task X (e.g., `task-flow: run 1`) |
12
+ | `task-flow: run X,Y` | Executes multiple tasks (e.g., `task-flow: run 10,11`) |
13
+ | `task-flow: run all` | Executes all tasks |
14
+ | `task-flow: review X` | Reviews specific task(s) (e.g., `task-flow: review 1` or `task-flow: review 10,11` or `task-flow: review all`) |
15
+ | `task-flow: refactor X` | Refactors specific task(s) (e.g., `task-flow: refactor 1` or `task-flow: refactor 10,11` or `task-flow: refactor all`) |
16
+ | `task-flow: estimate X` | Estimates time for task X (e.g., `task-flow: estimate 1` or `task-flow: estimate 10,11`) |
17
+ | `task-flow: report X` | Generates implementation report for task X (e.g., `task-flow: report 1` or `task-flow: report 10,11`) |
18
+
19
+ **See complete details below ↓**
16
20
 
17
21
  ---
18
22
 
19
- ## Comandos Detalhados
23
+ ## Detailed Commands
20
24
 
21
25
  ### `task-flow: sync`
22
- Sincronização completa entre `tasks.input.txt` e o sistema:
23
- - ✅ Adiciona novas tasks do `tasks.input.txt`
24
- - ✅ Remove tasks que foram removidas do `tasks.input.txt`
25
- - ✅ Atualiza tasks que foram modificadas no `tasks.input.txt`
26
- - ✅ Preserva o status (done/pending) das tasks existentes
27
- - ✅ Sincroniza status entre `status.json` e `tasks.status.md` (garante que estão sempre alinhados)
26
+ Complete synchronization between `tasks.input.txt` and the system:
27
+ - ✅ Adds new tasks from `tasks.input.txt`
28
+ - ✅ Removes tasks that were deleted from `tasks.input.txt`
29
+ - ✅ Updates tasks that were modified in `tasks.input.txt`
30
+ - ✅ Preserves status (done/pending) of existing tasks
31
+ - ✅ Synchronizes status between `status.json` and `tasks.status.md` (ensures they are always aligned)
28
32
 
29
33
  ### `task-flow: think`
30
- Analisa código e sugere novas tasks. Pergunta antes de adicionar ao `tasks.input.txt`.
34
+ Analyzes code and suggests new tasks. Asks before adding to `tasks.input.txt`.
35
+
36
+ ### `task-flow: status`
37
+ Shows current status of tasks and subtasks from the `tasks.status.md` file.
38
+
39
+ ---
40
+
41
+ ## Commands with Task ID
31
42
 
32
43
  ### `task-flow: run next X`
33
- Trabalha nas próximas X subtasks pendentes em ordem sequencial. Implementa e marca como "done".
44
+ Works on next X pending subtasks in sequential order. Implements and marks as "done".
34
45
 
35
- **Exemplos:**
36
- - `task-flow: run next 4` → Próximas 4 subtasks
37
- - `task-flow: run next` → Próxima 1 subtask
46
+ **Examples:**
47
+ - `task-flow: run next 4` → Next 4 subtasks
48
+ - `task-flow: run next` → Next 1 subtask
38
49
 
39
- ### `task-flow: run task X`
40
- Executa todas as subtasks pendentes de uma task específica. Implementa e marca como "done".
50
+ ### `task-flow: run X` (simplified syntax)
51
+ Executes all pending subtasks of a specific task. Implements and marks as "done".
41
52
 
42
- **⚠️ Verificação de Dependências:**
43
- - executa se todas as tasks anteriores (1, 2, ..., X-1) estiverem completamente concluídas
44
- - Permite trabalho paralelo por múltiplas IAs sem conflitos
45
- - Se houver tasks anteriores pendentes, avisa quais precisam ser concluídas primeiro
53
+ **⚠️ Dependency Check:**
54
+ - Only executes if all previous tasks (1, 2, ..., X-1) are completely finished
55
+ - Allows parallel work by multiple AIs without conflicts
56
+ - If there are pending previous tasks, warns which ones need to be completed first
46
57
 
47
- **Exemplos:**
48
- - `task-flow: run task 1` → Todas as subtasks pendentes da task 1 (sempre pode executar)
49
- - `task-flow: run task 3` → executa se tasks 1 e 2 estiverem completas
58
+ **Examples:**
59
+ - `task-flow: run 1` → All pending subtasks of task 1 (can always execute)
60
+ - `task-flow: run 10,11` → All pending subtasks of tasks 10 and 11
61
+ - `task-flow: run all` → All pending subtasks of all tasks
62
+ - `task-flow: run 3` → Only executes if tasks 1 and 2 are complete
50
63
 
51
- ### `task-flow: status`
52
- Mostra o status atual das tasks e subtasks do arquivo `tasks.status.md`.
64
+ ### `task-flow: review X`
65
+ Reviews specific task(s) marked as "done" to verify they are actually completed.
66
+
67
+ **Examples:**
68
+ - `task-flow: review 1` → Reviews task 1
69
+ - `task-flow: review 10,11` → Reviews tasks 10 and 11
70
+ - `task-flow: review all` → Reviews all tasks
71
+
72
+ ### `task-flow: refactor X`
73
+ Refactors code from specific task(s). Removes explanatory comments, improves code without changing functionality.
74
+
75
+ **Examples:**
76
+ - `task-flow: refactor 1` → Refactors task 1
77
+ - `task-flow: refactor 10,11` → Refactors tasks 10 and 11
78
+ - `task-flow: refactor all` → Refactors all tasks
79
+
80
+ ### `task-flow: estimate X` (simplified syntax)
81
+ Estimates time required to complete task(s) based on the number of subtasks and developer experience level.
82
+
83
+ **Output includes:**
84
+ - Time estimates for Junior (0-2 years), Mid-level (3-5 years), and Senior (6+ years) developers
85
+ - Estimates in hours and business days
86
+ - Recommendation for management with buffer
87
+
88
+ **Examples:**
89
+ - `task-flow: estimate 1` → Shows time estimate for task 1
90
+ - `task-flow: estimate 10,11` → Shows time estimates for tasks 10 and 11
91
+ - `task-flow: estimate all` → Shows time estimates for all tasks
92
+
93
+ ### `task-flow: report X` (simplified syntax)
94
+ Generates a detailed implementation report for completed task(s) in Markdown format.
95
+
96
+ **Report includes:**
97
+ - Task overview and completion status
98
+ - List of completed subtasks
99
+ - Files created and modified (detected from git history)
100
+ - Code change summaries with analysis
101
+ - Task creation and completion dates
53
102
 
54
- ### `task-flow: review`
55
- Revisa tasks marcadas como "done" para verificar se estão realmente concluídas.
103
+ **Report location:** `.task-flow/docs/task-X-implementation.md`
56
104
 
57
- ### `task-flow: refactor`
58
- Refatora código do commit atual. Remove comentários explicativos, melhora código sem mudar funcionalidade.
105
+ **Examples:**
106
+ - `task-flow: report 1` Generates report for task 1
107
+ - `task-flow: report 10,11` → Generates reports for tasks 10 and 11
108
+ - `task-flow: report all` → Generates reports for all tasks
59
109
 
60
110
  ---
61
111
 
62
- ## Arquivos
112
+ ## Files
63
113
 
64
- - `.task-flow/tasks.input.txt` - Edite tasks aqui (formato: `- Task description`)
65
- - `.task-flow/tasks.status.md` - ⚠️ **NÃO EDITE** - Atualizado automaticamente pela IA
66
- - `.task-flow/.internal/` - ⚠️ **IGNORE** - Arquivos internos do sistema (não precisa ler nem editar)
114
+ - `.task-flow/tasks.input.txt` - Edit tasks here (format: `- Task description`)
115
+ - `.task-flow/tasks.status.md` - ⚠️ **DO NOT EDIT** - Automatically updated by AI
116
+ - `.task-flow/.internal/` - ⚠️ **IGNORE** - Internal system files (no need to read or edit)
@@ -1,14 +1,14 @@
1
- # Screenshot de Exemplo
1
+ # Example Screenshot
2
2
 
3
- Este é um arquivo placeholder. Substitua este arquivo por um screenshot real (PNG ou JPG).
3
+ This is a placeholder file. Replace this file with a real screenshot (PNG or JPG).
4
4
 
5
- ## Como adicionar screenshots:
5
+ ## How to add screenshots:
6
6
 
7
- 1. Adicione seus arquivos de imagem (.png ou .jpg) nesta pasta
8
- 2. Use nomes descritivos em kebab-case
9
- 3. O RBIN Task Flow automaticamente detectará e referenciará os screenshots
7
+ 1. Add your image files (.png or .jpg) to this folder
8
+ 2. Use descriptive names in kebab-case
9
+ 3. RBIN Task Flow will automatically detect and reference the screenshots
10
10
 
11
- ## Exemplos de nomes:
11
+ ## Example names:
12
12
 
13
13
  - `login_recover_signup.png`
14
14
  - `dashboard.png`
@@ -17,8 +17,7 @@ Este é um arquivo placeholder. Substitua este arquivo por um screenshot real (P
17
17
  - `prescriptions.png`
18
18
  - `medicine.png`
19
19
 
20
- ## Referenciar em tasks:
21
-
22
- Para referenciar um screenshot específico em uma task, use:
23
- `task-flow-screen nome_do_arquivo.png`
20
+ ## Reference in tasks:
24
21
 
22
+ To reference a specific screenshot in a task, use:
23
+ `task-flow-screen filename.png`
@@ -9,10 +9,10 @@
9
9
 
10
10
  ## Screenshots:
11
11
 
12
- - Adicione seus screenshots na pasta `.task-flow/screens/` (PNG ou JPG)
13
- - O RBIN Task Flow automaticamente detecta e referencia os screenshots disponíveis ao gerar subtasks
14
- - Para referenciar um screenshot específico em uma task, use: `task-flow-screen nome_do_arquivo.png`
15
- - Exemplo: `- Criar tela de login task-flow-screen login.png`
12
+ - Add your screenshots to the `.task-flow/screens/` folder (PNG or JPG)
13
+ - RBIN Task Flow automatically detects and references available screenshots when generating subtasks
14
+ - To reference a specific screenshot in a task, use: `task-flow-screen filename.png`
15
+ - Example: `- Create login screen task-flow-screen login.png`
16
16
 
17
17
  ## Tasks:
18
18
 
@@ -1,16 +1,16 @@
1
1
  # Task Status
2
2
 
3
- <!-- ⚠️ AVISO: Este arquivo é atualizado automaticamente pela IA. NÃO edite manualmente. -->
3
+ <!-- ⚠️ WARNING: This file is automatically updated by AI. DO NOT edit manually. -->
4
4
 
5
- ## 📊 Resumo
5
+ ## 📊 Summary
6
6
 
7
- - ✅ **Tasks Completas**: 0
8
- - ⏳ **Tasks em Andamento**: 0
9
- - 📝 **Subtasks Restantes**: 0
7
+ - ✅ **Completed Tasks**: 0
8
+ - ⏳ **Tasks in Progress**: 0
9
+ - 📝 **Remaining Subtasks**: 0
10
10
 
11
11
  **Tasks:**
12
- - ⏳ Task 1: First task (0 subtasks restantes de 0)
13
- - ⏳ Task 2: Second task (0 subtasks restantes de 0)
12
+ - ⏳ Task 1: First task (0 remaining subtasks out of 0)
13
+ - ⏳ Task 2: Second task (0 remaining subtasks out of 0)
14
14
 
15
15
  ---
16
16
 
package/CLAUDE.md CHANGED
@@ -16,12 +16,20 @@ This project uses RBIN Task Flow for task management:
16
16
  - **Task Definition**: Edit `.task-flow/tasks.input.txt` using simple format: `- Task description`
17
17
  - **AI Commands**: Use AI-powered commands for task management:
18
18
  - `task-flow: sync` - Synchronize tasks from tasks.input.txt
19
- - `task-flow: run next X` - Work on next X subtasks
20
- - `task-flow: run task X` - Execute all pending subtasks of task X
21
- - `task-flow: status` - View current task status
22
- - `task-flow: review` - Review completed tasks
23
19
  - `task-flow: think` - Analyze code and suggest new tasks
24
- - `task-flow: refactor` - Refactor code from current commit
20
+ - `task-flow: status` - View current task status
21
+ - `task-flow: run next X` - Work on next X subtasks
22
+ - `task-flow: run X` - Execute all pending subtasks of task X (simplified - no "task" needed)
23
+ - `task-flow: run X,Y` - Execute multiple tasks (comma-separated)
24
+ - `task-flow: run all` - Execute all tasks
25
+ - `task-flow: review X` - Review specific task(s) (comma-separated or "all")
26
+ - `task-flow: refactor X` - Refactor specific task(s) (comma-separated or "all")
27
+ - `task-flow: estimate X` - Estimate time for task X (simplified - no "task" needed)
28
+ - `task-flow: estimate X,Y` - Estimate multiple tasks (comma-separated)
29
+ - `task-flow: estimate all` - Estimate all tasks
30
+ - `task-flow: report X` - Generate implementation report for task X (simplified - no "task" needed)
31
+ - `task-flow: report X,Y` - Generate reports for multiple tasks (comma-separated)
32
+ - `task-flow: report all` - Generate reports for all tasks
25
33
  - **Files**:
26
34
  - `.task-flow/tasks.input.txt` - Define your tasks here
27
35
  - `.task-flow/tasks.status.md` - Auto-generated status (DO NOT EDIT manually)
package/GEMINI.md CHANGED
@@ -16,12 +16,20 @@ This project uses RBIN Task Flow for task management:
16
16
  - **Task Definition**: Edit `.task-flow/tasks.input.txt` using simple format: `- Task description`
17
17
  - **AI Commands**: Use AI-powered commands for task management:
18
18
  - `task-flow: sync` - Synchronize tasks from tasks.input.txt
19
- - `task-flow: run next X` - Work on next X subtasks
20
- - `task-flow: run task X` - Execute all pending subtasks of task X
21
- - `task-flow: status` - View current task status
22
- - `task-flow: review` - Review completed tasks
23
19
  - `task-flow: think` - Analyze code and suggest new tasks
24
- - `task-flow: refactor` - Refactor code from current commit
20
+ - `task-flow: status` - View current task status
21
+ - `task-flow: run next X` - Work on next X subtasks
22
+ - `task-flow: run X` - Execute all pending subtasks of task X (simplified - no "task" needed)
23
+ - `task-flow: run X,Y` - Execute multiple tasks (comma-separated)
24
+ - `task-flow: run all` - Execute all tasks
25
+ - `task-flow: review X` - Review specific task(s) (comma-separated or "all")
26
+ - `task-flow: refactor X` - Refactor specific task(s) (comma-separated or "all")
27
+ - `task-flow: estimate X` - Estimate time for task X (simplified - no "task" needed)
28
+ - `task-flow: estimate X,Y` - Estimate multiple tasks (comma-separated)
29
+ - `task-flow: estimate all` - Estimate all tasks
30
+ - `task-flow: report X` - Generate implementation report for task X (simplified - no "task" needed)
31
+ - `task-flow: report X,Y` - Generate reports for multiple tasks (comma-separated)
32
+ - `task-flow: report all` - Generate reports for all tasks
25
33
  - **Files**:
26
34
  - `.task-flow/tasks.input.txt` - Define your tasks here
27
35
  - `.task-flow/tasks.status.md` - Auto-generated status (DO NOT EDIT manually)
package/README.md CHANGED
@@ -60,7 +60,7 @@ rbin-task-flow init
60
60
  # Edite .task-flow/tasks.input.txt e use:
61
61
  # - task-flow: sync
62
62
  # - task-flow: run next X
63
- # - task-flow: run task X
63
+ # - task-flow: run X (ou task-flow: run X,Y ou task-flow: run all)
64
64
  ```
65
65
 
66
66
  **Pronto!** RBIN Task Flow agora está disponível globalmente no seu sistema.
@@ -74,6 +74,8 @@ rbin-task-flow init # Inicializa no projeto atual
74
74
  rbin-task-flow update # Atualiza configurações
75
75
  rbin-task-flow version-check # Verifica atualizações de modelos
76
76
  rbin-task-flow info # Mostra informações
77
+ rbin-task-flow estimate <ids> # Estima tempo (ex: "1" ou "1,2" ou "all")
78
+ rbin-task-flow report <ids> # Gera relatório (ex: "1" ou "1,2" ou "all")
77
79
  ```
78
80
 
79
81
  ### Comandos da IA - Por Que Usar?
@@ -84,11 +86,15 @@ Após inicializar, use estes comandos na IA (Cursor/Claude/Gemini) para gerencia
84
86
  |---------|--------------|-------------------|
85
87
  | `task-flow: sync` | **Sincroniza** tarefas do arquivo texto com o sistema | Mantém tudo sincronizado automaticamente - adiciona novas, remove deletadas, preserva seu progresso |
86
88
  | `task-flow: think` | **Descobre** tarefas que você esqueceu | Analisa código e sugere tarefas que faltam (testes, refatoração, documentação) |
87
- | `task-flow: run next X` | **Automatiza** o trabalho nas próximas subtarefas | A IA trabalha nas próximas X subtarefas sequencialmente, você só acompanha |
88
- | `task-flow: run task X` | **Completa** uma tarefa inteira de uma vez | Executa todas as subtarefas de uma tarefa específica (permite trabalho paralelo) |
89
89
  | `task-flow: status` | **Visualiza** o progresso rapidamente | Vê resumo com tasks completas, em andamento e quantas subtarefas faltam |
90
- | `task-flow: review` | **Garante** qualidade do trabalho | Verifica se tarefas marcadas como "done" estão realmente concluídas |
91
- | `task-flow: refactor` | **Melhora** código sem quebrar | Refatora código do commit atual removendo comentários e melhorando qualidade |
90
+ | `task-flow: run next X` | **Automatiza** o trabalho nas próximas subtarefas | A IA trabalha nas próximas X subtarefas sequencialmente, você só acompanha |
91
+ | `task-flow: run X` | **Completa** uma tarefa inteira de uma vez | Executa todas as subtarefas de uma tarefa específica (permite trabalho paralelo) |
92
+ | `task-flow: run X,Y` | **Completa** múltiplas tarefas | Executa tarefas separadas por vírgula (ex: `task-flow: run 10,11`) |
93
+ | `task-flow: run all` | **Completa** todas as tarefas | Executa todas as tarefas pendentes |
94
+ | `task-flow: review X` | **Garante** qualidade do trabalho | Verifica tarefas específicas (ex: `task-flow: review 1` ou `task-flow: review 10,11` ou `task-flow: review all`) |
95
+ | `task-flow: refactor X` | **Melhora** código sem quebrar | Refatora tarefas específicas (ex: `task-flow: refactor 1` ou `task-flow: refactor 10,11` ou `task-flow: refactor all`) |
96
+ | `task-flow: estimate X` | **Estima** tempo para gestão | Calcula estimativa de tempo (ex: `task-flow: estimate 1` ou `task-flow: estimate 10,11`) |
97
+ | `task-flow: report X` | **Documenta** implementação | Gera relatório detalhado (ex: `task-flow: report 1` ou `task-flow: report 10,11`) |
92
98
 
93
99
  **Fluxo típico:**
94
100
 
@@ -419,7 +425,7 @@ rbin-task-flow init
419
425
  # Edit .task-flow/tasks.input.txt and use:
420
426
  # - task-flow: sync
421
427
  # - task-flow: run next X
422
- # - task-flow: run task X
428
+ # - task-flow: run X (or task-flow: run X,Y or task-flow: run all)
423
429
  ```
424
430
 
425
431
  **That's it!** RBIN Task Flow is now available globally on your system.
@@ -433,6 +439,8 @@ rbin-task-flow init # Initialize in current project
433
439
  rbin-task-flow update # Update configurations
434
440
  rbin-task-flow version-check # Check for model updates
435
441
  rbin-task-flow info # Show information
442
+ rbin-task-flow estimate <ids> # Estimate time (e.g., "1" or "1,2" or "all")
443
+ rbin-task-flow report <ids> # Generate report (e.g., "1" or "1,2" or "all")
436
444
  ```
437
445
 
438
446
  ### AI Commands - Why Use Them?
@@ -443,11 +451,15 @@ After initializing, use these commands in your AI (Cursor/Claude/Gemini) to auto
443
451
  |---------|------------|-------------|
444
452
  | `task-flow: sync` | **Sync** tasks from text file with system | Keeps everything synchronized automatically - adds new, removes deleted, preserves your progress |
445
453
  | `task-flow: think` | **Discover** tasks you forgot | Analyzes code and suggests missing tasks (tests, refactoring, documentation) |
446
- | `task-flow: run next X` | **Automate** work on next subtasks | AI works on next X subtasks sequentially, you just follow along |
447
- | `task-flow: run task X` | **Complete** an entire task at once | Executes all subtasks of a specific task (allows parallel work) |
448
454
  | `task-flow: status` | **Visualize** progress quickly | See summary with completed tasks, in progress, and remaining subtasks |
449
- | `task-flow: review` | **Ensure** work quality | Verifies that tasks marked as "done" are actually completed |
450
- | `task-flow: refactor` | **Improve** code without breaking | Refactors code from current commit removing comments and improving quality |
455
+ | `task-flow: run next X` | **Automate** work on next subtasks | AI works on next X subtasks sequentially, you just follow along |
456
+ | `task-flow: run X` | **Complete** an entire task at once | Executes all subtasks of a specific task (allows parallel work) |
457
+ | `task-flow: run X,Y` | **Complete** multiple tasks | Executes comma-separated tasks (e.g., `task-flow: run 10,11`) |
458
+ | `task-flow: run all` | **Complete** all tasks | Executes all pending tasks |
459
+ | `task-flow: review X` | **Ensure** work quality | Verifies specific tasks (e.g., `task-flow: review 1` or `task-flow: review 10,11` or `task-flow: review all`) |
460
+ | `task-flow: refactor X` | **Improve** code without breaking | Refactors specific tasks (e.g., `task-flow: refactor 1` or `task-flow: refactor 10,11` or `task-flow: refactor all`) |
461
+ | `task-flow: estimate X` | **Estimate** time for management | Calculates time estimate (e.g., `task-flow: estimate 1` or `task-flow: estimate 10,11`) |
462
+ | `task-flow: report X` | **Document** implementation | Generates detailed report (e.g., `task-flow: report 1` or `task-flow: report 10,11`) |
451
463
 
452
464
  **Typical workflow:**
453
465
 
package/bin/cli.js CHANGED
@@ -4,6 +4,8 @@ const { program } = require('commander');
4
4
  const path = require('path');
5
5
  const { installInProject } = require('../lib/install');
6
6
  const { checkVersionUpdates } = require('../lib/version');
7
+ const { estimateTask } = require('../lib/estimate');
8
+ const { generateReport } = require('../lib/report');
7
9
  const chalk = require('chalk');
8
10
 
9
11
  program
@@ -36,6 +38,26 @@ program
36
38
  await checkVersionUpdates();
37
39
  });
38
40
 
41
+ program
42
+ .command('estimate')
43
+ .description('Estimate time for task(s) based on subtasks and experience level')
44
+ .argument('<taskIds>', 'Task ID(s) to estimate (comma-separated or "all")')
45
+ .option('-p, --path <path>', 'Target directory (default: current directory)')
46
+ .action(async (taskIds, options) => {
47
+ const targetPath = options.path || process.cwd();
48
+ await estimateTask(taskIds, targetPath);
49
+ });
50
+
51
+ program
52
+ .command('report')
53
+ .description('Generate implementation report for completed task(s)')
54
+ .argument('<taskIds>', 'Task ID(s) to generate report for (comma-separated or "all")')
55
+ .option('-p, --path <path>', 'Target directory (default: current directory)')
56
+ .action(async (taskIds, options) => {
57
+ const targetPath = options.path || process.cwd();
58
+ await generateReport(taskIds, targetPath);
59
+ });
60
+
39
61
  program
40
62
  .command('info')
41
63
  .description('Show information about RBIN Task Flow')
@@ -50,6 +72,8 @@ program
50
72
  console.log(chalk.cyan(' rbin-task-flow init') + ' - Initialize in current directory');
51
73
  console.log(chalk.cyan(' rbin-task-flow update') + ' - Update configurations');
52
74
  console.log(chalk.cyan(' rbin-task-flow version-check') + ' - Check for model updates');
75
+ console.log(chalk.cyan(' rbin-task-flow estimate <ids>') + ' - Estimate time (e.g., "1" or "1,2" or "all")');
76
+ console.log(chalk.cyan(' rbin-task-flow report <ids>') + ' - Generate report (e.g., "1" or "1,2" or "all")');
53
77
  console.log(chalk.cyan(' rbin-task-flow info') + ' - Show this information\n');
54
78
  });
55
79
 
@@ -0,0 +1,117 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const chalk = require('chalk');
4
+ const { parseTaskIds } = require('./utils');
5
+
6
+ async function estimateTask(taskIdsInput, targetPath = process.cwd()) {
7
+ const tasksPath = path.join(targetPath, '.task-flow/.internal/tasks.json');
8
+
9
+ if (!fs.existsSync(tasksPath)) {
10
+ console.log(chalk.red('❌ Tasks file not found. Run "task-flow: sync" first.'));
11
+ return;
12
+ }
13
+
14
+ try {
15
+ const tasksData = await fs.readJSON(tasksPath);
16
+ const taskIds = parseTaskIds(taskIdsInput, tasksData.tasks);
17
+
18
+ if (taskIds.length === 0) {
19
+ console.log(chalk.red('❌ No valid task IDs provided.'));
20
+ return;
21
+ }
22
+
23
+ let successCount = 0;
24
+ let errorCount = 0;
25
+
26
+ for (const taskId of taskIds) {
27
+ const task = tasksData.tasks.find(t => t.id === taskId);
28
+
29
+ if (!task) {
30
+ console.log(chalk.red(`❌ Task ${taskId} not found.`));
31
+ errorCount++;
32
+ continue;
33
+ }
34
+
35
+ const subtaskCount = task.subtasks ? task.subtasks.length : 0;
36
+
37
+ if (subtaskCount === 0) {
38
+ console.log(chalk.yellow(`⚠️ Task ${taskId} has no subtasks. Cannot estimate.`));
39
+ errorCount++;
40
+ continue;
41
+ }
42
+
43
+ const estimates = calculateEstimates(subtaskCount);
44
+
45
+ if (taskIds.length > 1) {
46
+ console.log('\n' + chalk.cyan('═'.repeat(70)));
47
+ } else {
48
+ console.log('\n' + chalk.cyan('═'.repeat(70)));
49
+ }
50
+ console.log(chalk.magenta('📊 Task Estimation Report'));
51
+ console.log(chalk.cyan('═'.repeat(70)) + '\n');
52
+
53
+ console.log(chalk.blue.bold('Task:'), chalk.yellow(`#${taskId} - ${task.title}\n`));
54
+ console.log(chalk.blue(`Complexity: ${chalk.yellow(subtaskCount)} subtasks\n`));
55
+
56
+ console.log(chalk.cyan('─'.repeat(70)));
57
+ console.log(chalk.magenta.bold('Time Estimates by Experience Level:\n'));
58
+
59
+ const juniorDays = Math.ceil(estimates.junior.upper / 8);
60
+ const midDays = Math.ceil(estimates.mid.upper / 8);
61
+ const seniorDays = Math.ceil(estimates.senior.upper / 8);
62
+
63
+ console.log(chalk.gray('👶 Junior Developer (0-2 years):'));
64
+ console.log(chalk.white(' Hours:'), chalk.yellow(`${estimates.junior.lower}-${estimates.junior.upper} hours`));
65
+ console.log(chalk.white(' Days: '), chalk.yellow(`~${juniorDays} business day(s)`));
66
+ console.log('');
67
+
68
+ console.log(chalk.gray('👨‍💼 Mid-level Developer (3-5 years):'));
69
+ console.log(chalk.white(' Hours:'), chalk.yellow(`${estimates.mid.lower}-${estimates.mid.upper} hours`));
70
+ console.log(chalk.white(' Days: '), chalk.yellow(`~${midDays} business day(s)`));
71
+ console.log('');
72
+
73
+ console.log(chalk.gray('👴 Senior Developer (6+ years):'));
74
+ console.log(chalk.white(' Hours:'), chalk.yellow(`${estimates.senior.lower}-${estimates.senior.upper} hours`));
75
+ console.log(chalk.white(' Days: '), chalk.yellow(`~${seniorDays} business day(s)`));
76
+ console.log('');
77
+
78
+ console.log(chalk.cyan('─'.repeat(70)));
79
+ console.log(chalk.magenta.bold('Recommendation for Management:\n'));
80
+ console.log(chalk.white(' Recommended estimate:'), chalk.yellow(`${estimates.mid.lower}-${estimates.mid.upper} hours`), chalk.gray('(mid-level baseline)'));
81
+ console.log(chalk.white(' Buffer recommended:'), chalk.yellow(`+20%`), chalk.gray('for unexpected issues'));
82
+ console.log(chalk.white(' Total estimate:'), chalk.yellow(`${Math.round(estimates.mid.upper * 1.2)} hours`), chalk.gray(`(~${Math.ceil(estimates.mid.upper * 1.2 / 8)} business days)`));
83
+ console.log('');
84
+
85
+ successCount++;
86
+ }
87
+
88
+ if (taskIds.length > 1) {
89
+ console.log(chalk.cyan(`\n📊 Estimated ${successCount} task(s), ${errorCount} error(s)`));
90
+ }
91
+
92
+ } catch (error) {
93
+ console.error(chalk.red('Error reading tasks:'), error.message);
94
+ }
95
+ }
96
+
97
+ function calculateEstimates(subtaskCount) {
98
+ const baseLower = subtaskCount * 2;
99
+ const baseUpper = subtaskCount * 3;
100
+
101
+ return {
102
+ junior: {
103
+ lower: Math.round(baseLower * 1.5),
104
+ upper: Math.round(baseUpper * 1.5)
105
+ },
106
+ mid: {
107
+ lower: baseLower,
108
+ upper: baseUpper
109
+ },
110
+ senior: {
111
+ lower: Math.round(baseLower * 0.7),
112
+ upper: Math.round(baseUpper * 0.7)
113
+ }
114
+ };
115
+ }
116
+
117
+ module.exports = { estimateTask };