rbin-task-flow 1.12.0 → 1.13.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.
@@ -22,6 +22,7 @@ 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
26
  - `task-flow: run next X` - Work on next X subtasks sequentially
26
27
  - `task-flow: run X` - Work on all pending subtasks of task X (simplified - no "task" needed)
27
28
  - `task-flow: run X,Y` - Work on multiple tasks (comma-separated)
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Run lint fix and build, then audit only uncommitted files against coding standards
3
+ globs: **/*
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # task-flow: improve changes
8
+
9
+ When the user runs `task-flow: improve changes`:
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**.
13
+
14
+ ---
15
+
16
+ ## Scope: uncommitted files only
17
+
18
+ 1. **Get the list of uncommitted files** (read-only git; do not run `git add`/`git commit`). Use the list of paths from:
19
+ - Modified but not staged: `git diff --name-only`
20
+ - Staged but not committed: `git diff --name-only --cached`
21
+ - Combined: all files that differ from `HEAD` → `git diff --name-only HEAD`
22
+ - **Use** `git diff --name-only HEAD` so that both unstaged and staged (but uncommitted) changes are included.
23
+
24
+ 2. If there are **no uncommitted changes**, tell the user and stop.
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.
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.
51
+
52
+ ---
53
+
54
+ ## How to execute
55
+
56
+ - **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.
62
+
63
+ ---
64
+
65
+ ## Natural language
66
+
67
+ - **FAST FORMAT**: `task-flow: improve changes` or `task-flow improve changes`
68
+ - "improve my changes", "audit my uncommitted changes", "check my changes against standards" → same command
69
+
70
+ ---
71
+
72
+ ## Principle
73
+
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.**
@@ -15,6 +15,9 @@
15
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
16
  | `task-flow: estimate X` | Estimates time for task X (e.g., `task-flow: estimate 1` or `task-flow: estimate 10,11`) |
17
17
  | `task-flow: report X` | Generates implementation report for task X (e.g., `task-flow: report 1` or `task-flow: report 10,11`) |
18
+ | `task-flow: audit` | Audits codebase against coding standards and suggests incremental improvements |
19
+ | `task-flow: improve changes` | Run lint fix + build (fix issues), then audit only uncommitted files |
20
+ | `rbin-task-flow audit` | **(CLI)** Lists files with unstaged changes (not yet `git add`) |
18
21
 
19
22
  **See complete details below ↓**
20
23
 
@@ -36,6 +39,16 @@ Analyzes code and suggests new tasks. Asks before adding to `tasks.input.txt`.
36
39
  ### `task-flow: status`
37
40
  Shows current status of tasks and subtasks from the `tasks.status.md` file.
38
41
 
42
+ ### `task-flow: audit`
43
+ Audits the **entire codebase** against the coding standards in [coding_standards.mdc](.cursor/rules/coding_standards.mdc). Non-destructive: reports gaps and suggests incremental improvements; the user chooses what to adopt. See [task_audit.mdc](.cursor/rules/task_audit.mdc) for the full flow.
44
+
45
+ ### `task-flow: improve changes`
46
+ 1. **Lint and build**: Run lint fix if the project has it; fix any lint warnings or errors; run build and fix until it passes.
47
+ 2. **Audit uncommitted only**: Same as **task-flow: audit**, but **only for files that were changed and not yet committed** (unstaged + staged). Use before committing to align the current change set with coding standards. The AI obtains the list of uncommitted files and runs the audit flow restricted to those paths.
48
+
49
+ ### `rbin-task-flow audit` (CLI only)
50
+ Lists **unstaged** file paths (modified but not yet `git add`). Run in the project root: `rbin-task-flow audit`. Option: `-p, --path <path>`.
51
+
39
52
  ---
40
53
 
41
54
  ## Commands with Task ID
package/AGENTS.md CHANGED
@@ -29,8 +29,9 @@ 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: 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: 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
35
  - 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).
35
36
  - Use context from `.task-flow/contexts/` when subtask instructions reference it.
36
37
 
package/CLAUDE.md CHANGED
@@ -22,6 +22,7 @@ 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
26
  - `task-flow: status` - View current task status
26
27
  - `task-flow: run next X` - Work on next X subtasks
27
28
  - `task-flow: run X` - Execute all pending subtasks of task X (simplified - no "task" needed)
package/bin/cli.js CHANGED
@@ -6,6 +6,7 @@ const { installInProject } = require('../lib/install');
6
6
  const { checkVersionUpdates } = require('../lib/version');
7
7
  const { estimateTask } = require('../lib/estimate');
8
8
  const { generateReport } = require('../lib/report');
9
+ const { runAudit } = require('../lib/audit');
9
10
  const chalk = require('chalk');
10
11
 
11
12
  program
@@ -58,6 +59,15 @@ program
58
59
  await generateReport(taskIds, targetPath);
59
60
  });
60
61
 
62
+ program
63
+ .command('audit')
64
+ .description('List files with unstaged changes (not yet git add)')
65
+ .option('-p, --path <path>', 'Target directory (default: current directory)')
66
+ .action(async (options) => {
67
+ const targetPath = options.path || process.cwd();
68
+ await runAudit(targetPath);
69
+ });
70
+
61
71
  program
62
72
  .command('info')
63
73
  .description('Show information about RBIN Task Flow')
@@ -74,6 +84,7 @@ program
74
84
  console.log(chalk.cyan(' rbin-task-flow version-check') + ' - Check for model updates');
75
85
  console.log(chalk.cyan(' rbin-task-flow estimate <ids>') + ' - Estimate time (e.g., "1" or "1,2" or "all")');
76
86
  console.log(chalk.cyan(' rbin-task-flow report <ids>') + ' - Generate report (e.g., "1" or "1,2" or "all")');
87
+ console.log(chalk.cyan(' rbin-task-flow audit') + ' - List unstaged files (not yet git add)');
77
88
  console.log(chalk.cyan(' rbin-task-flow info') + ' - Show this information\n');
78
89
  });
79
90
 
package/lib/audit.js ADDED
@@ -0,0 +1,44 @@
1
+ const { execSync } = require('child_process');
2
+ const path = require('path');
3
+ const chalk = require('chalk');
4
+
5
+ function getUnstagedFiles(targetPath) {
6
+ const cwd = path.resolve(targetPath);
7
+ try {
8
+ const out = execSync('git diff --name-only', { encoding: 'utf8', cwd });
9
+ return out
10
+ .trim()
11
+ .split('\n')
12
+ .filter(Boolean);
13
+ } catch (err) {
14
+ if (err.stderr && (err.stderr.includes('not a git repository') || err.message.includes('not a git'))) {
15
+ return null;
16
+ }
17
+ throw err;
18
+ }
19
+ }
20
+
21
+ async function runAudit(targetPath = process.cwd()) {
22
+ const files = getUnstagedFiles(targetPath);
23
+
24
+ if (files === null) {
25
+ console.log(chalk.red('❌ Not a git repository. Run from a project root with git initialized.'));
26
+ return;
27
+ }
28
+
29
+ if (files.length === 0) {
30
+ console.log(chalk.yellow('⚠️ No unstaged changes. All modified files are staged (or working tree is clean).'));
31
+ console.log(chalk.gray(' Use "task-flow: audit" after editing files and before "git add".'));
32
+ return;
33
+ }
34
+
35
+ console.log(chalk.cyan('📋 Unstaged files (not yet added with git add):'));
36
+ console.log(chalk.cyan('─'.repeat(50)));
37
+ files.forEach((f) => console.log(chalk.white(' ' + f)));
38
+ console.log(chalk.cyan('─'.repeat(50)));
39
+ console.log(chalk.magenta(' Total:'), chalk.yellow(files.length), chalk.magenta('file(s)'));
40
+ console.log('');
41
+ console.log(chalk.gray(' Tip: run lint/test only on these paths, then "git add" when ready.'));
42
+ }
43
+
44
+ module.exports = { runAudit, getUnstagedFiles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rbin-task-flow",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "AI-powered task management for Claude and Cursor",
5
5
  "main": "index.js",
6
6
  "bin": {