rbin-task-flow 1.25.1 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/rbin-coding-standards/SKILL.md +1 -1
- package/.claude/skills/task-flow-estimate/SKILL.md +8 -5
- package/.claude/skills/task-flow-from-contexts/SKILL.md +16 -0
- package/.claude/skills/task-flow-run/SKILL.md +1 -1
- package/.claude/skills/task-flow-sync/SKILL.md +0 -1
- package/.claude/skills/task-flow-sync/workflow.md +1 -1
- package/.claude/skills/task-flow-validate/SKILL.md +2 -2
- package/.cursor/rules/graphify-task-flow.mdc +7 -8
- package/.cursor/rules/task-flow-cursor.mdc +3 -8
- package/.cursor/rules/task-flow-sync.mdc +1 -1
- package/.cursor/rules/task_execution.mdc +2 -7
- package/.cursor/rules/task_from_contexts.mdc +93 -0
- package/.cursor/rules/task_validate.mdc +1 -7
- package/.cursor/rules/task_work.mdc +1 -1
- package/.task-flow/README.md +70 -53
- package/.task-flow/guides/AI-PLATFORMS.md +6 -7
- package/.task-flow/guides/CODEX.md +16 -63
- package/.task-flow/guides/CURSOR.md +4 -5
- package/.task-flow/guides/GRAPHIFY.md +12 -13
- package/.task-flow/guides/platforms/claude-code.md +13 -23
- package/.task-flow/guides/platforms/codex.md +9 -22
- package/.task-flow/guides/platforms/cursor.md +14 -35
- package/.task-flow/tasks.input.txt +3 -4
- package/AGENTS.md +3 -13
- package/CLAUDE.md +3 -8
- package/README.md +14 -22
- package/bin/cli.js +3 -24
- package/lib/gitignore.js +0 -2
- package/lib/graphify.js +50 -18
- package/lib/install.js +1 -14
- package/package.json +1 -2
- package/.claude/skills/task-flow-check/SKILL.md +0 -15
- package/.claude/skills/task-flow-generate-flow/SKILL.md +0 -15
- package/.claude/skills/task-flow-improve-changes/SKILL.md +0 -15
- package/.claude/skills/task-flow-refactor/SKILL.md +0 -14
- package/.claude/skills/task-flow-review/SKILL.md +0 -14
- package/.claude/skills/task-flow-think/SKILL.md +0 -19
- package/.cursor/rules/task_analysis.mdc +0 -45
- package/.cursor/rules/task_check.mdc +0 -37
- package/.cursor/rules/task_generate_flow.mdc +0 -90
- package/.cursor/rules/task_improve_changes.mdc +0 -50
- package/.cursor/rules/task_refactor.mdc +0 -94
- package/.cursor/rules/task_review.mdc +0 -88
- package/lib/audit.js +0 -44
- package/lib/check.js +0 -113
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Populates tasks.flow.md with dependencies and hours for task-flow generate flow.
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
- **Task Flow Generation - Dependencies, Hours & Model Recommendations:**
|
|
7
|
-
- **FAST FORMAT**: `task-flow: generate flow` → Populate tasks.flow.md
|
|
8
|
-
- When user says "task-flow: generate flow", "generate flow", "gerar flow", or "flow":
|
|
9
|
-
- **READ**: `.task-flow/.internal/tasks.json` and optionally `status.json`
|
|
10
|
-
- **SEARCH**: Current versions of GPT-5.x, Composer, Claude (Haiku, Sonnet) via web search
|
|
11
|
-
- **WRITE**: Populate `.task-flow/tasks.flow.md` with the generated flow
|
|
12
|
-
- **DO NOT**: Populate tasks.flow.md when running `task-flow: sync`
|
|
13
|
-
|
|
14
|
-
- **Generation Process:**
|
|
15
|
-
1. **Search for current model versions** (web search): one GPT-5.x coding-capable model, Composer (Cursor), Claude Haiku, Claude Sonnet. Include version next to each model (e.g. "Claude Sonnet 4.6").
|
|
16
|
-
2. Read tasks from tasks.json
|
|
17
|
-
3. For each task, determine:
|
|
18
|
-
- **Dependencies**: Which tasks must be completed first (or "—" if none)
|
|
19
|
-
- **Estimated hours** (for billing): infer from real task scope, ambiguity, dependencies, and validation needs. Subtask count informs scope, but do not use a fixed subtasks × hours formula. Do NOT show "dev mediano" or "mid-level".
|
|
20
|
-
- **3 model options** (in order of priority): one GPT-5.x model, one Composer, one Claude — always these 3. Include version and effort for each.
|
|
21
|
-
- **Model priority must be defined by AI judgment**, based on task nature, implementation risk, ambiguity, architecture impact, validation needs, and expected autonomy. Do not use a fixed ranking.
|
|
22
|
-
- **Effort** per model: low, medium, or high, defined by task level and difficulty. Do not infer effort from subtask count alone.
|
|
23
|
-
4. **Claude**: Use only Haiku or Sonnet — **never Opus**
|
|
24
|
-
5. **Effort heuristics**:
|
|
25
|
-
- **low**: localized change, clear requirement, low ambiguity, low regression risk, limited validation
|
|
26
|
-
- **medium**: multi-file implementation, moderate ambiguity, moderate regression risk, requires broader validation
|
|
27
|
-
- **high**: architecture or cross-cutting change, high ambiguity, high regression risk, sequencing concerns, or deep investigation/refactor
|
|
28
|
-
6. **Model heuristics**:
|
|
29
|
-
- **GPT-5.x**: prioritize when the task needs strong implementation, refactoring, debugging, or broader code reasoning
|
|
30
|
-
- **Composer**: prioritize when the task benefits from editor-native iteration, repo-wide navigation, and fast execution in the coding flow
|
|
31
|
-
- **Claude Haiku**: prioritize for simpler, well-bounded tasks with low effort
|
|
32
|
-
- **Claude Sonnet**: prioritize for tasks that need more synthesis, reasoning depth, or architectural analysis
|
|
33
|
-
- The first recommendation must reflect the best fit for that specific task, not a template order reused across all tasks
|
|
34
|
-
|
|
35
|
-
- **Output Format (direct blocks per task):**
|
|
36
|
-
```markdown
|
|
37
|
-
# Task Flow — Dependencies, Hours & Model Recommendations
|
|
38
|
-
|
|
39
|
-
<!-- Populated by task-flow: generate flow. Do not edit manually. -->
|
|
40
|
-
<!-- Horas: uso para cobrança ao cliente -->
|
|
41
|
-
|
|
42
|
-
## Legenda
|
|
43
|
-
|
|
44
|
-
| Símbolo | Significado |
|
|
45
|
-
|---------|-------------|
|
|
46
|
-
| ✅ | Task concluída |
|
|
47
|
-
| ⚡ | Pode iniciar agora (deps satisfeitas) |
|
|
48
|
-
| 🔒 | Bloqueada por dependências |
|
|
49
|
-
|
|
50
|
-
**Esforço (Effort):** definido pelo nível e dificuldade real da task, não pela quantidade de subtasks
|
|
51
|
-
**Claude:** Haiku ou Sonnet — **não use Opus**
|
|
52
|
-
|
|
53
|
-
## Tasks (blocos diretos por task)
|
|
54
|
-
|
|
55
|
-
### ✅ Task 1 — [Título]
|
|
56
|
-
- **Depende de:** —
|
|
57
|
-
- **Horas cobrança:** 10-15h
|
|
58
|
-
- **Modelos sugeridos** (ordem de prioridade):
|
|
59
|
-
1. GPT-5.x [versão] — effort medium
|
|
60
|
-
2. Composer [versão] — effort medium
|
|
61
|
-
3. Claude Sonnet [versão] — effort medium
|
|
62
|
-
|
|
63
|
-
### ⚡ Task 2 — [Título]
|
|
64
|
-
- **Depende de:** Task 1 ✅
|
|
65
|
-
- **Horas cobrança:** 10-15h
|
|
66
|
-
- **Modelos sugeridos** (ordem de prioridade):
|
|
67
|
-
1. Composer [versão] — effort medium
|
|
68
|
-
2. GPT-5.x [versão] — effort medium
|
|
69
|
-
3. Claude Sonnet [versão] — effort medium
|
|
70
|
-
|
|
71
|
-
### 🔒 Task 3 — [Título]
|
|
72
|
-
- **Depende de:** Task 2
|
|
73
|
-
- **Horas cobrança:** 8-12h
|
|
74
|
-
- **Modelos sugeridos** (ordem de prioridade):
|
|
75
|
-
1. Claude Haiku [versão] — effort low
|
|
76
|
-
2. GPT-5.x [versão] — effort low
|
|
77
|
-
3. Composer [versão] — effort low
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
- **Model Rules:**
|
|
81
|
-
- **3 models per task**: One GPT-5.x model, one Composer, one Claude — always in order of priority
|
|
82
|
-
- **Version required**: Include current version next to each model name (from web search)
|
|
83
|
-
- **Effort required**: low, medium, or high for each model
|
|
84
|
-
- **AI-defined ranking**: order models by best fit for the task, not by a fixed global priority
|
|
85
|
-
- **No Opus**: Claude = Haiku or Sonnet only
|
|
86
|
-
|
|
87
|
-
- **Natural Language:** "generate flow", "gerar flow", "flow"
|
|
88
|
-
|
|
89
|
-
- **Principle:**
|
|
90
|
-
> **Populate tasks.flow.md with direct blocks per task. Dependencies, hours, and 3 model options (GPT-5.x, Composer, Claude) with version and effort. Let AI define ranking and effort from task context. Never use Opus.**
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Audits uncommitted files only for task-flow improve changes. Use git diff against HEAD scope.
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# task-flow: improve changes
|
|
7
|
-
|
|
8
|
-
When the user runs `task-flow: improve changes`:
|
|
9
|
-
|
|
10
|
-
1. **Audit current changes only**: Do the **same as** [task-flow: audit](mdc:.cursor/rules/task_audit.mdc) (score against the [coding_standards.mdc](mdc:.cursor/rules/coding_standards.mdc) checklist; [full doc](mdc:.task-flow/guides/coding-standards-full.md) only if needed), but **restricted to files that were changed and not yet committed**.
|
|
11
|
-
2. **Do not run project checks here**: Lint fix and build now belong to [task-flow: check](mdc:.cursor/rules/task_check.mdc).
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Scope: uncommitted files only
|
|
16
|
-
|
|
17
|
-
1. **Get the list of uncommitted files** (read-only git; do not run `git add`/`git commit`). Use the list of paths from:
|
|
18
|
-
- Modified but not staged: `git diff --name-only`
|
|
19
|
-
- Staged but not committed: `git diff --name-only --cached`
|
|
20
|
-
- Combined: all files that differ from `HEAD` → `git diff --name-only HEAD`
|
|
21
|
-
- **Use** `git diff --name-only HEAD` so that both unstaged and staged (but uncommitted) changes are included.
|
|
22
|
-
|
|
23
|
-
2. If there are **no uncommitted changes**, tell the user and stop.
|
|
24
|
-
|
|
25
|
-
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.
|
|
26
|
-
|
|
27
|
-
4. **Same principles as audit**: non-destructive, incremental, suggest improvements and let the user choose. Only the scope is different: uncommitted files only.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## How to execute
|
|
32
|
-
|
|
33
|
-
- **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.
|
|
34
|
-
- **Step 2**: Read and analyze **only** the uncommitted files (and their immediate context if needed).
|
|
35
|
-
- **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.
|
|
36
|
-
- **Step 4**: Present findings and suggested improvements **only for the uncommitted files**.
|
|
37
|
-
- **Step 5**: Ask which improvements the user wants; generate tasks or concrete edits only for the selected items, touching only uncommitted files where possible.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Natural language
|
|
42
|
-
|
|
43
|
-
- **FAST FORMAT**: `task-flow: improve changes` or `task-flow improve changes`
|
|
44
|
-
- "improve my changes", "audit my uncommitted changes", "check my changes against standards" → same command
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Principle
|
|
49
|
-
|
|
50
|
-
> **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.**
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Refactors task-flow task code without behavior change. Use for task-flow refactor X.
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
- **Task Refactor - Improve Code Quality:**
|
|
7
|
-
- **FAST FORMAT**: `task-flow: refactor X` or `task-flow: refactor X,Y` or `task-flow: refactor all` → Refactor specific task(s)
|
|
8
|
-
- **SIMPLIFIED SYNTAX**: No need to say "task" - just use the number: `task-flow: refactor 1` instead of `task-flow: refactor task 1`
|
|
9
|
-
- **REQUIRED**: Task ID is required - use `task-flow: refactor all` to refactor all tasks
|
|
10
|
-
- When user says "task-flow: refactor X", "task-flow: refactor X,Y", "task-flow: refactor all", or "refactor tasks":
|
|
11
|
-
- **IDENTIFY**: Files changed in current commit (or staged changes)
|
|
12
|
-
- **REFACTOR**: Improve code quality without changing functionality
|
|
13
|
-
- **REMOVE**: All explanatory comments (following code_comments.mdc rules)
|
|
14
|
-
- **PRESERVE**: Only separation comments in format: `// ────────────────────────────────`
|
|
15
|
-
- **IMPROVE**: Code structure, naming, organization, but keep behavior identical
|
|
16
|
-
|
|
17
|
-
- **Refactoring Rules:**
|
|
18
|
-
1. **No Functional Changes**: Code must behave exactly the same
|
|
19
|
-
2. **Remove Comments**: Remove all explanatory comments
|
|
20
|
-
3. **Keep Separation Comments**: Preserve comments that separate code blocks:
|
|
21
|
-
```typescript
|
|
22
|
-
// ────────────────────────────────
|
|
23
|
-
// Section Name
|
|
24
|
-
// ────────────────────────────────
|
|
25
|
-
```
|
|
26
|
-
4. **Improve Code Quality**:
|
|
27
|
-
- Better variable/function names
|
|
28
|
-
- Extract repeated code
|
|
29
|
-
- Improve code organization
|
|
30
|
-
- Better error handling
|
|
31
|
-
- Remove dead code
|
|
32
|
-
- Simplify complex logic
|
|
33
|
-
5. **Follow Project Rules**: Respect [code_comments.mdc](mdc:.cursor/rules/code_comments.mdc)
|
|
34
|
-
|
|
35
|
-
- **Comment Removal:**
|
|
36
|
-
- ❌ Remove: `// This function does X`
|
|
37
|
-
- ❌ Remove: `// Check if user exists`
|
|
38
|
-
- ❌ Remove: `// TODO: fix this later`
|
|
39
|
-
- ✅ Keep: `// ────────────────────────────────`
|
|
40
|
-
- ✅ Keep: `// ────────────────────────────────\n// Section Name\n// ────────────────────────────────`
|
|
41
|
-
|
|
42
|
-
- **Process:**
|
|
43
|
-
1. Identify files changed in current commit/staged changes
|
|
44
|
-
2. Read each file
|
|
45
|
-
3. Refactor:
|
|
46
|
-
- Remove explanatory comments
|
|
47
|
-
- Improve code structure
|
|
48
|
-
- Better naming
|
|
49
|
-
- Extract functions if needed
|
|
50
|
-
- Simplify logic
|
|
51
|
-
4. Verify: Code still works the same way
|
|
52
|
-
5. Show summary of changes
|
|
53
|
-
|
|
54
|
-
- **Natural Language Phrases:**
|
|
55
|
-
- **FAST FORMAT**: `task-flow: refactor X` or `task-flow: refactor X,Y` or `task-flow: refactor all`
|
|
56
|
-
- "refactor task 1"
|
|
57
|
-
- "refactor tasks 10,11"
|
|
58
|
-
- "refactor all tasks"
|
|
59
|
-
- "improve code quality"
|
|
60
|
-
- "clean up code"
|
|
61
|
-
- Any variation asking to refactor/improve code (must include task ID or "all")
|
|
62
|
-
|
|
63
|
-
- **Example:**
|
|
64
|
-
```
|
|
65
|
-
User: "task-flow: refactor 1"
|
|
66
|
-
|
|
67
|
-
AI Action:
|
|
68
|
-
1. Identify files related to task 1 (from git history or task implementation)
|
|
69
|
-
2. Read each file
|
|
70
|
-
3. For each file:
|
|
71
|
-
- Remove explanatory comments
|
|
72
|
-
- Improve code structure
|
|
73
|
-
- Better naming
|
|
74
|
-
- Simplify logic
|
|
75
|
-
4. Preserve separation comments
|
|
76
|
-
5. Verify functionality unchanged
|
|
77
|
-
6. Show refactoring summary
|
|
78
|
-
|
|
79
|
-
User: "task-flow: refactor all"
|
|
80
|
-
|
|
81
|
-
AI Action:
|
|
82
|
-
1. Process all tasks
|
|
83
|
-
2. Identify files for each task
|
|
84
|
-
3. Refactor all files
|
|
85
|
-
4. Show summary
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
- **Integration:**
|
|
89
|
-
- Follows [code_comments.mdc](mdc:.cursor/rules/code_comments.mdc) - comment removal rules
|
|
90
|
-
- Works with [task-flow-cursor.mdc](mdc:.cursor/rules/task-flow-cursor.mdc) / `@task-flow-refactor`
|
|
91
|
-
- Respects [rbin-git-policy.mdc](mdc:.cursor/rules/rbin-git-policy.mdc) — never commit automatically
|
|
92
|
-
|
|
93
|
-
- **Principle:**
|
|
94
|
-
> **Refactor code to improve quality without changing behavior. Remove explanatory comments, keep only separation comments, improve structure and naming. Code must work exactly the same.**
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Verifies completed task-flow tasks are actually implemented. Use for task-flow review X or review all.
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
- **Task Review - Verify Completed Tasks:**
|
|
7
|
-
- **FAST FORMAT**: `task-flow: review X` or `task-flow: review X,Y` or `task-flow: review all` → Review specific task(s)
|
|
8
|
-
- **SIMPLIFIED SYNTAX**: No need to say "task" - just use the number: `task-flow: review 1` instead of `task-flow: review task 1`
|
|
9
|
-
- **REQUIRED**: Task ID is required - use `task-flow: review all` to review all tasks
|
|
10
|
-
- When user says "task-flow: review X", "task-flow: review X,Y", "task-flow: review all", or "review completed tasks":
|
|
11
|
-
- **READ**: `.task-flow/.internal/tasks.json` and `.task-flow/.internal/status.json`
|
|
12
|
-
- **IDENTIFY**: All tasks/subtasks marked as "done"
|
|
13
|
-
- **VERIFY**: Check if each completed task/subtask is actually implemented
|
|
14
|
-
- **REPORT**: List tasks that are erroneously marked as done
|
|
15
|
-
- **SUGGEST**: Mark incorrectly completed tasks back to "pending" or "in_progress"
|
|
16
|
-
|
|
17
|
-
- **Review Process:**
|
|
18
|
-
1. Read `.task-flow/.internal/tasks.json` to get all task definitions
|
|
19
|
-
2. Read `.task-flow/.internal/status.json` to get completion status
|
|
20
|
-
3. For each task/subtask marked as "done":
|
|
21
|
-
- Check if the implementation exists in codebase
|
|
22
|
-
- Verify if implementation matches the task requirements
|
|
23
|
-
- Check if tests exist (if required by task)
|
|
24
|
-
- Verify if documentation is updated (if required)
|
|
25
|
-
4. Identify discrepancies:
|
|
26
|
-
- Task marked "done" but code doesn't exist
|
|
27
|
-
- Task marked "done" but implementation incomplete
|
|
28
|
-
- Task marked "done" but tests missing
|
|
29
|
-
- Task marked "done" but requirements not met
|
|
30
|
-
5. Report findings and ask user if they want to correct status
|
|
31
|
-
|
|
32
|
-
- **Review Report Format:**
|
|
33
|
-
```
|
|
34
|
-
📋 Task Review Results:
|
|
35
|
-
|
|
36
|
-
✅ Correctly Completed:
|
|
37
|
-
- Task 1.2: User authentication (verified)
|
|
38
|
-
- Task 2.1: Database migration (verified)
|
|
39
|
-
|
|
40
|
-
⚠️ Erroneously Marked as Done:
|
|
41
|
-
- Task 1.3: API endpoint - Code exists but tests missing
|
|
42
|
-
- Task 2.4: Error handling - Implementation incomplete
|
|
43
|
-
|
|
44
|
-
Do you want to update status for erroneous tasks? [y/N]
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
- **Natural Language Phrases:**
|
|
48
|
-
- **FAST FORMAT**: `task-flow: review X` or `task-flow: review X,Y` or `task-flow: review all`
|
|
49
|
-
- "review task 1"
|
|
50
|
-
- "review tasks 10,11"
|
|
51
|
-
- "review all tasks"
|
|
52
|
-
- "verify done tasks"
|
|
53
|
-
- "check if tasks are really done"
|
|
54
|
-
- "review task status"
|
|
55
|
-
- Any variation asking to review/verify completed tasks (must include task ID or "all")
|
|
56
|
-
|
|
57
|
-
- **Example:**
|
|
58
|
-
```
|
|
59
|
-
User: "task-flow: review 1"
|
|
60
|
-
|
|
61
|
-
AI Action:
|
|
62
|
-
1. Read tasks.json and status.json
|
|
63
|
-
2. Find task 1 and its "done" subtasks
|
|
64
|
-
3. Verify each one:
|
|
65
|
-
- Check if files exist
|
|
66
|
-
- Check if code matches requirements
|
|
67
|
-
- Check if tests exist
|
|
68
|
-
4. Report findings
|
|
69
|
-
5. Ask if user wants to correct status
|
|
70
|
-
6. If confirmed, update status.json
|
|
71
|
-
|
|
72
|
-
User: "task-flow: review all"
|
|
73
|
-
|
|
74
|
-
AI Action:
|
|
75
|
-
1. Read tasks.json and status.json
|
|
76
|
-
2. Find all "done" tasks/subtasks
|
|
77
|
-
3. Verify each one
|
|
78
|
-
4. Report findings
|
|
79
|
-
5. Ask if user wants to correct status
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
- **Integration:**
|
|
83
|
-
- Works with [task-flow-cursor.mdc](mdc:.cursor/rules/task-flow-cursor.mdc) / `@task-flow-review`
|
|
84
|
-
- For verify + auto-add lacunas + sync: [task_validate.mdc](mdc:.cursor/rules/task_validate.mdc) / `@task-flow-validate`
|
|
85
|
-
- Respects [rbin-git-policy.mdc](mdc:.cursor/rules/rbin-git-policy.mdc) — never commit automatically
|
|
86
|
-
|
|
87
|
-
- **Principle:**
|
|
88
|
-
> **Review completed tasks to ensure quality. Verify that "done" means actually done, not just marked. Help maintain accurate task status.**
|
package/lib/audit.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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/lib/check.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
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 };
|