rbin-task-flow 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Run lint fix when available, then build the current project
3
+ globs: **/*
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # task-flow: check
8
+
9
+ When the user runs `task-flow: check`:
10
+
11
+ 1. **Detect project scripts**: Read `package.json` and look for lint and build scripts.
12
+ 2. **Run lint first**: Prefer a fix-capable lint command if present (`lint:fix`, `lint-fix`, or equivalent). If there is only `lint`, run it and fix the reported issues.
13
+ 3. **Run build next**: If a `build` script exists, run it after lint succeeds.
14
+ 4. **Fix failures**: If lint or build fails, fix the issues and re-run until they pass.
15
+ 5. **Keep scope local**: This command is only for project checks. It does not run the coding-standards audit and does not change task files by itself.
16
+
17
+ ---
18
+
19
+ ## How to execute
20
+
21
+ - **Step 1**: Read `package.json` and identify which package manager and scripts the project uses.
22
+ - **Step 2**: Run lint first, preferring an autofix variant when one exists.
23
+ - **Step 3**: Fix any lint errors or warnings that should be resolved now.
24
+ - **Step 4**: Run build and fix any failures.
25
+ - **Step 5**: Report what ran, what was skipped, and whether the project is passing.
26
+
27
+ ---
28
+
29
+ ## Natural language
30
+
31
+ - **FAST FORMAT**: `task-flow: check` or `task-flow check`
32
+ - "run checks", "run lint and build", "validate this project" → same command
33
+
34
+ ---
35
+
36
+ ## Principle
37
+
38
+ > **Use `task-flow: check` to make the current project pass its local validation steps before reviewing or committing changes.**
@@ -22,7 +22,8 @@ alwaysApply: true
22
22
  - `task-flow: sync` - Sync new tasks from tasks.input.txt
23
23
  - `task-flow: think` - Analyze codebase and suggest new tasks
24
24
  - `task-flow: audit` - Audit codebase against coding standards and suggest incremental improvements
25
- - `task-flow: improve changes` - Run lint fix and build (fix issues), then audit only uncommitted files
25
+ - `task-flow: check` - Run lint fix when available, then build the current project
26
+ - `task-flow: improve changes` - Audit only files changed in the current diff against `HEAD`
26
27
  - `task-flow: run next X` - Work on next X subtasks sequentially
27
28
  - `task-flow: run X` - Work on all pending subtasks of task X (simplified - no "task" needed)
28
29
  - `task-flow: run X,Y` - Work on multiple tasks (comma-separated)
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Run lint fix and build, then audit only uncommitted files against coding standards
2
+ description: Audit only files changed in the current diff against coding standards
3
3
  globs: **/*
4
4
  alwaysApply: true
5
5
  ---
@@ -8,8 +8,8 @@ alwaysApply: true
8
8
 
9
9
  When the user runs `task-flow: improve changes`:
10
10
 
11
- 1. **Lint and build**: Check if the project has a lint-fix script and a build script; run lint fix, fix any warnings or errors, then run build and fix until it passes.
12
- 2. **Audit uncommitted only**: Then do the **same as** [task-flow: audit](mdc:.cursor/rules/task_audit.mdc) (codebase audit against [coding_standards.mdc](mdc:.cursor/rules/coding_standards.mdc)), but **restricted to files that were changed and not yet committed**.
11
+ 1. **Audit current changes only**: Do the **same as** [task-flow: audit](mdc:.cursor/rules/task_audit.mdc) (codebase audit against [coding_standards.mdc](mdc:.cursor/rules/coding_standards.mdc)), but **restricted to files that were changed and not yet committed**.
12
+ 2. **Do not run project checks here**: Lint fix and build now belong to [task-flow: check](mdc:.cursor/rules/task_check.mdc).
13
13
 
14
14
  ---
15
15
 
@@ -23,42 +23,19 @@ When the user runs `task-flow: improve changes`:
23
23
 
24
24
  2. If there are **no uncommitted changes**, tell the user and stop.
25
25
 
26
- 3. **Lint and build** (see below): run lint fix if available; fix any lint warnings or errors; run build and fix if it fails.
26
+ 3. **Restrict the audit to those paths**: when performing the steps from [task_audit.mdc](mdc:.cursor/rules/task_audit.mdc) (explore, score, report, ask what to adopt, generate tasks), consider **only** the files in the list above. Do not score or suggest improvements for files that were not changed.
27
27
 
28
- 4. **Restrict the audit to those paths**: when performing the steps from [task_audit.mdc](mdc:.cursor/rules/task_audit.mdc) (explore, score, report, ask what to adopt, generate tasks), consider **only** the files in the list above. Do not score or suggest improvements for files that were not changed.
29
-
30
- 5. **Same principles as audit**: non-destructive, incremental, suggest improvements and let the user choose. Only the scope is different: uncommitted files only.
31
-
32
- ---
33
-
34
- ## Lint fix and build (mandatory before audit)
35
-
36
- Before running the coding-standards audit on uncommitted files:
37
-
38
- 1. **Check for lint fix**: Read `package.json` and look for scripts that run lint with fix (e.g. `lint:fix`, `lint --fix`, `lint-fix`, or `lint` with a fix option). Common names: `lint:fix`, `lint -- --fix`, `eslint . --fix`, `npm run lint -- --fix`.
39
-
40
- 2. **Run lint fix**: If such a script exists, run it (e.g. `npm run lint:fix` or `pnpm run lint -- --fix`). You may run npm/pnpm/yarn without asking per project rules.
41
-
42
- 3. **Fix lint output**: If lint reports **warnings or errors** after the fix run, correct them in the code (only in the affected files when possible). Re-run lint until there are no errors; reduce warnings where feasible.
43
-
44
- 4. **Check for build**: Look for a `build` (or `build:prod`, `build:dev`) script in `package.json`.
45
-
46
- 5. **Run build**: If a build script exists, run it (e.g. `npm run build`). If the **build fails**, fix the failing errors (compile errors, type errors, missing deps) and re-run until the build passes.
47
-
48
- 6. **Order**: Run lint fix (and fix issues) first, then build (and fix issues). Only after both are passing, proceed with the coding-standards audit on uncommitted files.
49
-
50
- If the project has no lint fix script or no build script, skip the missing step and continue with the audit.
28
+ 4. **Same principles as audit**: non-destructive, incremental, suggest improvements and let the user choose. Only the scope is different: uncommitted files only.
51
29
 
52
30
  ---
53
31
 
54
32
  ## How to execute
55
33
 
56
34
  - **Step 1**: Obtain uncommitted file list (e.g. run `git diff --name-only HEAD` or use your tools to get the list). If empty, stop.
57
- - **Step 2**: **Lint and build**: run lint fix if available; fix any lint warnings/errors; run build and fix until it passes (see "Lint fix and build" above).
58
- - **Step 3**: Read and analyze **only** the uncommitted files (and their immediate context if needed).
59
- - **Step 4**: For that subset, apply the same categories and scoring as in task-flow: audit (folder structure, thin app/, naming, cn(), forms, etc.) and note which of those categories are relevant to the changed files.
60
- - **Step 5**: Present findings and suggested improvements **only for the uncommitted files**.
61
- - **Step 6**: Ask which improvements the user wants; generate tasks or concrete edits only for the selected items, touching only uncommitted files where possible.
35
+ - **Step 2**: Read and analyze **only** the uncommitted files (and their immediate context if needed).
36
+ - **Step 3**: For that subset, apply the same categories and scoring as in task-flow: audit (folder structure, thin app/, naming, cn(), forms, etc.) and note which of those categories are relevant to the changed files.
37
+ - **Step 4**: Present findings and suggested improvements **only for the uncommitted files**.
38
+ - **Step 5**: Ask which improvements the user wants; generate tasks or concrete edits only for the selected items, touching only uncommitted files where possible.
62
39
 
63
40
  ---
64
41
 
@@ -71,4 +48,4 @@ If the project has no lint fix script or no build script, skip the missing step
71
48
 
72
49
  ## Principle
73
50
 
74
- > **Same as audit, but scoped to what the developer is about to commit. First ensure lint fix runs and build passes (fixing any warnings/errors); then run the coding-standards audit on uncommitted files. Use it to tighten quality and standards on the current change set before committing.**
51
+ > **Use `task-flow: improve changes` as a scoped audit for the current diff against `HEAD`. Use `task-flow: check` separately when you want lint/build validation.**
package/AGENTS.md CHANGED
@@ -29,9 +29,10 @@ This repo follows the same development norms as in `.cursor/rules/` and `CLAUDE.
29
29
  - **Task flow** always means **RBIN Task Flow**.
30
30
  - Tasks: `.task-flow/tasks.input.txt` (format: `- Task description`).
31
31
  - Status: `.task-flow/tasks.status.md` and `.task-flow/.internal/status.json`.
32
- - **Commands** to support: `task-flow: sync`, `task-flow: think`, `task-flow: audit`, `task-flow: improve changes`, `task-flow: status`, `task-flow: run next X`, `task-flow: run X` (or `X,Y` / `all`), `task-flow: review X`, `task-flow: refactor X`, `task-flow: estimate X`, `task-flow: report X`.
32
+ - **Commands** to support: `task-flow: sync`, `task-flow: think`, `task-flow: audit`, `task-flow: check`, `task-flow: improve changes`, `task-flow: status`, `task-flow: run next X`, `task-flow: run X` (or `X,Y` / `all`), `task-flow: review X`, `task-flow: refactor X`, `task-flow: estimate X`, `task-flow: report X`.
33
33
  - When running `task-flow: audit`: scan the codebase, score it against `.cursor/rules/coding_standards.mdc`, present a report, and ask the user which improvements to adopt — never impose changes.
34
- - When running `task-flow: improve changes`: (1) run lint fix if present and fix lint warnings/errors; run build and fix until it passes; (2) then same as audit but only for files changed and not yet committed (obtain list via `git diff --name-only HEAD`, then audit only those paths).
34
+ - When running `task-flow: check`: run lint fix if present and fix lint warnings/errors; run build and fix until it passes.
35
+ - When running `task-flow: improve changes`: same as audit but only for files changed and not yet committed (obtain list via `git diff --name-only HEAD`, then audit only those paths).
35
36
  - When running subtasks: read `.task-flow/.internal/tasks.json` and `status.json`, implement, then update `status.json` and `tasks.status.md` (mark done, refresh summary).
36
37
  - Use context from `.task-flow/contexts/` when subtask instructions reference it.
37
38
 
package/CLAUDE.md CHANGED
@@ -22,7 +22,8 @@ This project uses RBIN Task Flow for task management:
22
22
  - `task-flow: sync` - Synchronize tasks from tasks.input.txt
23
23
  - `task-flow: think` - Analyze code and suggest new tasks
24
24
  - `task-flow: audit` - Audit codebase against coding standards and suggest incremental improvements
25
- - `task-flow: improve changes` - Run lint fix and build (fix issues), then audit only uncommitted files
25
+ - `task-flow: check` - Run lint fix when available, then build the current project
26
+ - `task-flow: improve changes` - Audit only files changed in the current diff against `HEAD`
26
27
  - `task-flow: status` - View current task status
27
28
  - `task-flow: run next X` - Work on next X subtasks
28
29
  - `task-flow: run X` - Execute all pending subtasks of task X (simplified - no "task" needed)
package/README.md CHANGED
@@ -73,6 +73,7 @@ rbin-task-flow init # Inicializa no projeto atual
73
73
  rbin-task-flow update # Atualiza configurações
74
74
  rbin-task-flow version-check # Verifica atualizações de modelos
75
75
  rbin-task-flow info # Mostra informações
76
+ rbin-task-flow check # Roda lint/fix e build quando existirem
76
77
  rbin-task-flow estimate <ids> # Estima tempo (ex: "1" ou "1,2" ou "all")
77
78
  rbin-task-flow report <ids> # Gera relatório (ex: "1" ou "1,2" ou "all")
78
79
  ```
@@ -86,6 +87,8 @@ Após inicializar, use estes comandos na IA (Cursor/Claude) para gerenciar taref
86
87
  | `task-flow: sync` | **Sincroniza** tarefas do arquivo texto com o sistema | Mantém tudo sincronizado automaticamente - adiciona novas, remove deletadas, preserva seu progresso |
87
88
  | `task-flow: think` | **Descobre** tarefas que você esqueceu | Analisa código e sugere tarefas que faltam (testes, refatoração, documentação) |
88
89
  | `task-flow: audit` | **Avalia** o quanto o código bate com os padrões de codificação | Analisa a codebase, dá um score por categoria e pergunta quais melhorias você quer adotar — sem impor nada |
90
+ | `task-flow: check` | **Valida** lint e build antes de revisar ou commitar | Roda lint com fix quando disponível e depois build, corrigindo problemas do projeto atual |
91
+ | `task-flow: improve changes` | **Audita** só o diff atual | Faz o mesmo audit de padrões, mas restrito aos arquivos alterados em relação ao `HEAD` |
89
92
  | `task-flow: status` | **Visualiza** o progresso rapidamente | Vê resumo com tasks completas, em andamento e quantas subtarefas faltam |
90
93
  | `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
94
  | `task-flow: run X` | **Completa** uma tarefa inteira de uma vez | Executa todas as subtarefas de uma tarefa específica (permite trabalho paralelo) |
@@ -417,6 +420,7 @@ rbin-task-flow init # Initialize in current project
417
420
  rbin-task-flow update # Update configurations
418
421
  rbin-task-flow version-check # Check for model updates
419
422
  rbin-task-flow info # Show information
423
+ rbin-task-flow check # Run lint/fix and build when available
420
424
  rbin-task-flow estimate <ids> # Estimate time (e.g., "1" or "1,2" or "all")
421
425
  rbin-task-flow report <ids> # Generate report (e.g., "1" or "1,2" or "all")
422
426
  ```
@@ -430,6 +434,8 @@ After initializing, use these commands in your AI (Cursor/Claude) to automatical
430
434
  | `task-flow: sync` | **Sync** tasks from text file with system | Keeps everything synchronized automatically - adds new, removes deleted, preserves your progress |
431
435
  | `task-flow: think` | **Discover** tasks you forgot | Analyzes code and suggests missing tasks (tests, refactoring, documentation) |
432
436
  | `task-flow: audit` | **Evaluate** how well your code matches coding standards | Scans the codebase, scores it by category and asks which improvements you want to adopt — never imposes changes |
437
+ | `task-flow: check` | **Validate** lint and build before review or commit | Runs lint with autofix when available and then build, fixing current-project issues first |
438
+ | `task-flow: improve changes` | **Audit** only the current diff | Runs the same standards audit, but restricted to files changed relative to `HEAD` |
433
439
  | `task-flow: status` | **Visualize** progress quickly | See summary with completed tasks, in progress, and remaining subtasks |
434
440
  | `task-flow: run next X` | **Automate** work on next subtasks | AI works on next X subtasks sequentially, you just follow along |
435
441
  | `task-flow: run X` | **Complete** an entire task at once | Executes all subtasks of a specific task (allows parallel work) |
package/bin/cli.js CHANGED
@@ -7,6 +7,7 @@ const { checkVersionUpdates } = require('../lib/version');
7
7
  const { estimateTask } = require('../lib/estimate');
8
8
  const { generateReport } = require('../lib/report');
9
9
  const { runAudit } = require('../lib/audit');
10
+ const { runCheck } = require('../lib/check');
10
11
  const chalk = require('chalk');
11
12
 
12
13
  program
@@ -68,6 +69,15 @@ program
68
69
  await runAudit(targetPath);
69
70
  });
70
71
 
72
+ program
73
+ .command('check')
74
+ .description('Run lint fix when available, then build')
75
+ .option('-p, --path <path>', 'Target directory (default: current directory)')
76
+ .action(async (options) => {
77
+ const targetPath = options.path || process.cwd();
78
+ await runCheck(targetPath);
79
+ });
80
+
71
81
  program
72
82
  .command('info')
73
83
  .description('Show information about RBIN Task Flow')
@@ -84,6 +94,7 @@ program
84
94
  console.log(chalk.cyan(' rbin-task-flow version-check') + ' - Check for model updates');
85
95
  console.log(chalk.cyan(' rbin-task-flow estimate <ids>') + ' - Estimate time (e.g., "1" or "1,2" or "all")');
86
96
  console.log(chalk.cyan(' rbin-task-flow report <ids>') + ' - Generate report (e.g., "1" or "1,2" or "all")');
97
+ console.log(chalk.cyan(' rbin-task-flow check') + ' - Run lint fix and build when available');
87
98
  console.log(chalk.cyan(' rbin-task-flow audit') + ' - List unstaged files (not yet git add)');
88
99
  console.log(chalk.cyan(' rbin-task-flow info') + ' - Show this information\n');
89
100
  });
package/lib/check.js ADDED
@@ -0,0 +1,113 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { execSync } = require('child_process');
4
+ const chalk = require('chalk');
5
+
6
+ function getPackageManager(targetPath) {
7
+ const cwd = path.resolve(targetPath);
8
+
9
+ if (fs.existsSync(path.join(cwd, 'pnpm-lock.yaml'))) {
10
+ return 'pnpm';
11
+ }
12
+
13
+ if (fs.existsSync(path.join(cwd, 'yarn.lock'))) {
14
+ return 'yarn';
15
+ }
16
+
17
+ if (fs.existsSync(path.join(cwd, 'bun.lockb')) || fs.existsSync(path.join(cwd, 'bun.lock'))) {
18
+ return 'bun';
19
+ }
20
+
21
+ return 'npm';
22
+ }
23
+
24
+ function readPackageJson(targetPath) {
25
+ const packageJsonPath = path.join(path.resolve(targetPath), 'package.json');
26
+
27
+ if (!fs.existsSync(packageJsonPath)) {
28
+ return null;
29
+ }
30
+
31
+ return JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
32
+ }
33
+
34
+ function buildRunCommand(packageManager, scriptName, args = []) {
35
+ if (packageManager === 'yarn') {
36
+ return ['yarn', scriptName, ...args].join(' ');
37
+ }
38
+
39
+ return [packageManager, 'run', scriptName, ...(args.length > 0 ? ['--', ...args] : [])].join(' ');
40
+ }
41
+
42
+ function resolveLintScript(scripts = {}) {
43
+ if (scripts['lint:fix']) {
44
+ return { scriptName: 'lint:fix', label: 'lint:fix' };
45
+ }
46
+
47
+ if (scripts['lint-fix']) {
48
+ return { scriptName: 'lint-fix', label: 'lint-fix' };
49
+ }
50
+
51
+ if (scripts.lint) {
52
+ if (scripts.lint.includes('--fix')) {
53
+ return { scriptName: 'lint', label: 'lint' };
54
+ }
55
+
56
+ return { scriptName: 'lint', args: ['--fix'], label: 'lint --fix' };
57
+ }
58
+
59
+ return null;
60
+ }
61
+
62
+ function runScript(targetPath, packageManager, scriptConfig) {
63
+ const command = buildRunCommand(packageManager, scriptConfig.scriptName, scriptConfig.args);
64
+ execSync(command, {
65
+ cwd: path.resolve(targetPath),
66
+ stdio: 'inherit',
67
+ encoding: 'utf8'
68
+ });
69
+ }
70
+
71
+ async function runCheck(targetPath = process.cwd()) {
72
+ const cwd = path.resolve(targetPath);
73
+ const packageJson = readPackageJson(cwd);
74
+
75
+ if (!packageJson) {
76
+ console.log(chalk.red('❌ package.json not found. Run this command from a project root.'));
77
+ return;
78
+ }
79
+
80
+ const packageManager = getPackageManager(cwd);
81
+ const scripts = packageJson.scripts || {};
82
+ const lintScript = resolveLintScript(scripts);
83
+ const hasBuild = Boolean(scripts.build);
84
+ let ranSomething = false;
85
+
86
+ console.log(chalk.cyan('🔎 Running project checks'));
87
+ console.log(chalk.gray(` Package manager: ${packageManager}`));
88
+
89
+ if (lintScript) {
90
+ ranSomething = true;
91
+ console.log(chalk.cyan(`\n▶ Running ${lintScript.label}`));
92
+ runScript(cwd, packageManager, lintScript);
93
+ } else {
94
+ console.log(chalk.yellow('\n⚠️ No lint script found. Skipping lint step.'));
95
+ }
96
+
97
+ if (hasBuild) {
98
+ ranSomething = true;
99
+ console.log(chalk.cyan('\n▶ Running build'));
100
+ runScript(cwd, packageManager, { scriptName: 'build' });
101
+ } else {
102
+ console.log(chalk.yellow('\n⚠️ No build script found. Skipping build step.'));
103
+ }
104
+
105
+ if (!ranSomething) {
106
+ console.log(chalk.yellow('\n⚠️ Nothing to run. Add a lint and/or build script to package.json.'));
107
+ return;
108
+ }
109
+
110
+ console.log(chalk.green('\n✅ Checks completed successfully.'));
111
+ }
112
+
113
+ module.exports = { runCheck };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rbin-task-flow",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "AI-powered task management for Claude and Cursor",
5
5
  "main": "index.js",
6
6
  "bin": {