@codyswann/lisa 1.0.0 → 1.0.5

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 (280) hide show
  1. package/README.md +244 -36
  2. package/all/copy-overwrite/.claude/README.md +1 -3
  3. package/all/copy-overwrite/.claude/REFERENCE.md +519 -0
  4. package/all/copy-overwrite/.claude/agents/skill-evaluator.md +7 -7
  5. package/all/copy-overwrite/.claude/agents/test-coverage-agent.md +17 -0
  6. package/all/copy-overwrite/.claude/commands/git/commit.md +9 -5
  7. package/all/copy-overwrite/.claude/commands/git/submit-pr.md +1 -1
  8. package/all/copy-overwrite/.claude/commands/lisa/review-implementation.md +209 -0
  9. package/all/copy-overwrite/.claude/commands/project/add-test-coverage.md +58 -0
  10. package/all/copy-overwrite/.claude/commands/project/archive.md +1 -1
  11. package/all/copy-overwrite/.claude/commands/project/complete-task.md +53 -1
  12. package/all/copy-overwrite/.claude/commands/project/debrief.md +12 -23
  13. package/all/copy-overwrite/.claude/commands/project/execute.md +33 -77
  14. package/all/copy-overwrite/.claude/commands/project/fix-linter-error.md +87 -0
  15. package/all/copy-overwrite/.claude/commands/project/implement.md +24 -28
  16. package/all/copy-overwrite/.claude/commands/project/lower-code-complexity.md +30 -55
  17. package/all/copy-overwrite/.claude/commands/project/plan.md +87 -242
  18. package/all/copy-overwrite/.claude/commands/project/reduce-max-lines-per-function.md +76 -0
  19. package/all/copy-overwrite/.claude/commands/project/reduce-max-lines.md +75 -0
  20. package/all/copy-overwrite/.claude/commands/project/research.md +86 -188
  21. package/all/copy-overwrite/.claude/commands/project/review.md +19 -38
  22. package/all/copy-overwrite/.claude/commands/project/setup.md +1 -1
  23. package/all/copy-overwrite/.claude/commands/project/verify.md +62 -25
  24. package/all/copy-overwrite/.claude/commands/pull-request/review.md +25 -7
  25. package/all/copy-overwrite/.claude/commands/tasks/load.md +63 -0
  26. package/all/copy-overwrite/.claude/commands/tasks/sync.md +84 -0
  27. package/all/copy-overwrite/.claude/hooks/README.md +75 -0
  28. package/all/copy-overwrite/.claude/hooks/check-tired-boss.sh +61 -0
  29. package/all/copy-overwrite/.claude/hooks/debug-hook.sh +47 -0
  30. package/all/copy-overwrite/.claude/hooks/notify-ntfy.sh +2 -0
  31. package/all/copy-overwrite/.claude/hooks/sync-tasks.sh +95 -0
  32. package/all/copy-overwrite/.claude/{skills/coding-philosophy/SKILL.md → rules/coding-philosophy.md} +93 -70
  33. package/all/copy-overwrite/.claude/settings.json +35 -14
  34. package/all/copy-overwrite/.claude/skills/prompt-complexity-scorer/SKILL.md +41 -9
  35. package/all/copy-overwrite/.claude/skills/skill-creator/scripts/init_skill.py +2 -0
  36. package/all/copy-overwrite/.claude/skills/skill-creator/scripts/package_skill.py +2 -0
  37. package/all/copy-overwrite/.claude/skills/skill-creator/scripts/quick_validate.py +2 -0
  38. package/all/copy-overwrite/.safety-net.json +25 -0
  39. package/all/copy-overwrite/CLAUDE.md +8 -30
  40. package/all/copy-overwrite/HUMAN.md +517 -17
  41. package/all/create-only/.claude/rules/PROJECT_RULES.md +9 -0
  42. package/all/create-only/scripts/setup-deploy-key.sh +190 -0
  43. package/all/deletions.json +5 -0
  44. package/cdk/copy-overwrite/.github/workflows/ci.yml +142 -0
  45. package/cdk/copy-overwrite/.github/workflows/deploy.yml +59 -0
  46. package/cdk/copy-overwrite/eslint.cdk.ts +175 -0
  47. package/cdk/copy-overwrite/eslint.config.ts +51 -0
  48. package/cdk/copy-overwrite/eslint.slow.config.ts +80 -0
  49. package/cdk/copy-overwrite/knip.json +53 -0
  50. package/cdk/copy-overwrite/tsconfig.eslint.json +11 -0
  51. package/cdk/merge/package.json +17 -1
  52. package/dist/cli/index.d.ts +3 -2
  53. package/dist/cli/index.d.ts.map +1 -1
  54. package/dist/cli/index.js +83 -64
  55. package/dist/cli/index.js.map +1 -1
  56. package/dist/cli/prompts.d.ts +17 -3
  57. package/dist/cli/prompts.d.ts.map +1 -1
  58. package/dist/cli/prompts.js +52 -16
  59. package/dist/cli/prompts.js.map +1 -1
  60. package/dist/core/config.d.ts +13 -4
  61. package/dist/core/config.d.ts.map +1 -1
  62. package/dist/core/config.js +17 -9
  63. package/dist/core/config.js.map +1 -1
  64. package/dist/core/git-service.d.ts +40 -0
  65. package/dist/core/git-service.d.ts.map +1 -0
  66. package/dist/core/git-service.js +52 -0
  67. package/dist/core/git-service.js.map +1 -0
  68. package/dist/core/index.d.ts +3 -3
  69. package/dist/core/index.js +3 -3
  70. package/dist/core/lisa.d.ts +124 -7
  71. package/dist/core/lisa.d.ts.map +1 -1
  72. package/dist/core/lisa.js +423 -221
  73. package/dist/core/lisa.js.map +1 -1
  74. package/dist/core/manifest.d.ts +5 -1
  75. package/dist/core/manifest.d.ts.map +1 -1
  76. package/dist/core/manifest.js +22 -16
  77. package/dist/core/manifest.js.map +1 -1
  78. package/dist/detection/detector.interface.d.ts +1 -1
  79. package/dist/detection/detectors/cdk.d.ts +6 -1
  80. package/dist/detection/detectors/cdk.d.ts.map +1 -1
  81. package/dist/detection/detectors/cdk.js +16 -8
  82. package/dist/detection/detectors/cdk.js.map +1 -1
  83. package/dist/detection/detectors/expo.d.ts +6 -1
  84. package/dist/detection/detectors/expo.d.ts.map +1 -1
  85. package/dist/detection/detectors/expo.js +13 -8
  86. package/dist/detection/detectors/expo.js.map +1 -1
  87. package/dist/detection/detectors/nestjs.d.ts +7 -2
  88. package/dist/detection/detectors/nestjs.d.ts.map +1 -1
  89. package/dist/detection/detectors/nestjs.js +17 -9
  90. package/dist/detection/detectors/nestjs.js.map +1 -1
  91. package/dist/detection/detectors/npm-package.d.ts +6 -1
  92. package/dist/detection/detectors/npm-package.d.ts.map +1 -1
  93. package/dist/detection/detectors/npm-package.js +9 -4
  94. package/dist/detection/detectors/npm-package.js.map +1 -1
  95. package/dist/detection/detectors/typescript.d.ts +6 -1
  96. package/dist/detection/detectors/typescript.d.ts.map +1 -1
  97. package/dist/detection/detectors/typescript.js +12 -7
  98. package/dist/detection/detectors/typescript.js.map +1 -1
  99. package/dist/detection/index.d.ts +13 -3
  100. package/dist/detection/index.d.ts.map +1 -1
  101. package/dist/detection/index.js +17 -7
  102. package/dist/detection/index.js.map +1 -1
  103. package/dist/errors/index.d.ts +66 -2
  104. package/dist/errors/index.d.ts.map +1 -1
  105. package/dist/errors/index.js +89 -17
  106. package/dist/errors/index.js.map +1 -1
  107. package/dist/index.js +3 -3
  108. package/dist/index.js.map +1 -1
  109. package/dist/logging/console-logger.d.ts +21 -1
  110. package/dist/logging/console-logger.d.ts.map +1 -1
  111. package/dist/logging/console-logger.js +26 -6
  112. package/dist/logging/console-logger.js.map +1 -1
  113. package/dist/logging/index.d.ts +3 -3
  114. package/dist/logging/index.js +2 -2
  115. package/dist/logging/logger.interface.d.ts +1 -1
  116. package/dist/logging/silent-logger.d.ts +21 -1
  117. package/dist/logging/silent-logger.d.ts.map +1 -1
  118. package/dist/logging/silent-logger.js +20 -0
  119. package/dist/logging/silent-logger.js.map +1 -1
  120. package/dist/strategies/copy-contents.d.ts +47 -6
  121. package/dist/strategies/copy-contents.d.ts.map +1 -1
  122. package/dist/strategies/copy-contents.js +99 -49
  123. package/dist/strategies/copy-contents.js.map +1 -1
  124. package/dist/strategies/copy-overwrite.d.ts +10 -2
  125. package/dist/strategies/copy-overwrite.d.ts.map +1 -1
  126. package/dist/strategies/copy-overwrite.js +17 -9
  127. package/dist/strategies/copy-overwrite.js.map +1 -1
  128. package/dist/strategies/create-only.d.ts +10 -2
  129. package/dist/strategies/create-only.d.ts.map +1 -1
  130. package/dist/strategies/create-only.js +14 -6
  131. package/dist/strategies/create-only.js.map +1 -1
  132. package/dist/strategies/index.d.ts +17 -7
  133. package/dist/strategies/index.d.ts.map +1 -1
  134. package/dist/strategies/index.js +19 -9
  135. package/dist/strategies/index.js.map +1 -1
  136. package/dist/strategies/merge.d.ts +10 -2
  137. package/dist/strategies/merge.d.ts.map +1 -1
  138. package/dist/strategies/merge.js +21 -21
  139. package/dist/strategies/merge.js.map +1 -1
  140. package/dist/strategies/strategy.interface.d.ts +1 -1
  141. package/dist/strategies/strategy.interface.d.ts.map +1 -1
  142. package/dist/transaction/backup.d.ts +15 -1
  143. package/dist/transaction/backup.d.ts.map +1 -1
  144. package/dist/transaction/backup.js +47 -12
  145. package/dist/transaction/backup.js.map +1 -1
  146. package/dist/transaction/index.d.ts +3 -3
  147. package/dist/transaction/index.js +2 -2
  148. package/dist/transaction/transaction.d.ts +25 -2
  149. package/dist/transaction/transaction.d.ts.map +1 -1
  150. package/dist/transaction/transaction.js +25 -2
  151. package/dist/transaction/transaction.js.map +1 -1
  152. package/dist/utils/file-operations.d.ts +21 -0
  153. package/dist/utils/file-operations.d.ts.map +1 -1
  154. package/dist/utils/file-operations.js +48 -12
  155. package/dist/utils/file-operations.js.map +1 -1
  156. package/dist/utils/index.d.ts +3 -3
  157. package/dist/utils/index.js +3 -3
  158. package/dist/utils/json-utils.d.ts +12 -0
  159. package/dist/utils/json-utils.d.ts.map +1 -1
  160. package/dist/utils/json-utils.js +17 -5
  161. package/dist/utils/json-utils.js.map +1 -1
  162. package/dist/utils/path-utils.d.ts +11 -0
  163. package/dist/utils/path-utils.d.ts.map +1 -1
  164. package/dist/utils/path-utils.js +12 -1
  165. package/dist/utils/path-utils.js.map +1 -1
  166. package/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +5 -0
  167. package/eslint-plugin-code-organization/index.js +5 -0
  168. package/eslint-plugin-code-organization/rules/enforce-statement-order.js +5 -0
  169. package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/scripts/validate_atomic_structure.py +2 -0
  170. package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/create_component.py +2 -0
  171. package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/validate_component.py +2 -0
  172. package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/scripts/validate_cross_platform.py +2 -0
  173. package/expo/copy-overwrite/.claude/skills/directory-structure/scripts/validate_structure.py +2 -0
  174. package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/scripts/generate-route.py +2 -0
  175. package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/scripts/validate_styling.py +2 -41
  176. package/{typescript → expo}/copy-overwrite/.github/workflows/build.yml +3 -0
  177. package/expo/copy-overwrite/.github/workflows/ci.yml +36 -0
  178. package/{typescript → expo}/copy-overwrite/.github/workflows/deploy.yml +22 -26
  179. package/{typescript → expo}/copy-overwrite/.github/workflows/lighthouse.yml +4 -1
  180. package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/plugin-index.test.js +5 -0
  181. package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/require-memo-in-view.test.js +5 -0
  182. package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/single-component-per-file.test.js +5 -0
  183. package/expo/copy-overwrite/eslint-plugin-component-structure/index.js +5 -0
  184. package/expo/copy-overwrite/eslint-plugin-component-structure/rules/enforce-component-structure.js +5 -0
  185. package/expo/copy-overwrite/eslint-plugin-component-structure/rules/no-return-in-view.js +6 -1
  186. package/expo/copy-overwrite/eslint-plugin-component-structure/rules/require-memo-in-view.js +5 -0
  187. package/expo/copy-overwrite/eslint-plugin-component-structure/rules/single-component-per-file.js +5 -0
  188. package/expo/copy-overwrite/eslint-plugin-ui-standards/README.md +0 -68
  189. package/expo/copy-overwrite/eslint-plugin-ui-standards/index.js +5 -3
  190. package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-classname-outside-ui.js +5 -0
  191. package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-direct-rn-imports.js +5 -0
  192. package/expo/copy-overwrite/eslint.config.ts +53 -0
  193. package/expo/copy-overwrite/eslint.expo.ts +330 -0
  194. package/expo/copy-overwrite/eslint.slow.config.ts +86 -0
  195. package/expo/copy-overwrite/knip.json +132 -0
  196. package/expo/copy-overwrite/lighthouserc.js +27 -0
  197. package/expo/copy-overwrite/tsconfig.eslint.json +25 -0
  198. package/expo/create-only/lighthouserc-config.json +6 -1
  199. package/expo/merge/package.json +16 -3
  200. package/nestjs/copy-overwrite/.claude/skills/nestjs-rules/SKILL.md +1 -1
  201. package/{typescript → nestjs}/copy-overwrite/.github/k6/README.md +2 -2
  202. package/{typescript → nestjs}/copy-overwrite/.github/k6/examples/customer-deploy-integration.yml +3 -0
  203. package/{typescript → nestjs}/copy-overwrite/.github/k6/examples/data-driven-test.js +5 -0
  204. package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/load.js +6 -2
  205. package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/smoke.js +5 -0
  206. package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/soak.js +5 -0
  207. package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/spike.js +5 -0
  208. package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/stress.js +5 -0
  209. package/{typescript → nestjs}/copy-overwrite/.github/k6/scripts/api-test.js +5 -0
  210. package/{typescript → nestjs}/copy-overwrite/.github/k6/scripts/default-test.js +5 -0
  211. package/nestjs/copy-overwrite/.github/workflows/ci.yml +29 -0
  212. package/nestjs/copy-overwrite/.github/workflows/deploy.yml +291 -0
  213. package/{typescript → nestjs}/copy-overwrite/.github/workflows/load-test.yml +3 -0
  214. package/nestjs/copy-overwrite/eslint.config.ts +53 -0
  215. package/nestjs/copy-overwrite/eslint.nestjs.ts +178 -0
  216. package/nestjs/merge/package.json +11 -3
  217. package/package.json +34 -40
  218. package/typescript/copy-contents/.husky/pre-commit +1 -1
  219. package/typescript/copy-contents/.husky/pre-push +99 -118
  220. package/typescript/copy-overwrite/.claude/hooks/format-on-edit.sh +2 -0
  221. package/typescript/copy-overwrite/.claude/hooks/install_pkgs.sh +3 -11
  222. package/typescript/copy-overwrite/.claude/hooks/lint-on-edit.sh +2 -0
  223. package/typescript/copy-overwrite/.claude/hooks/sg-scan-on-edit.sh +68 -0
  224. package/typescript/copy-overwrite/.claude/settings.json +79 -0
  225. package/typescript/copy-overwrite/.claude/skills/jsdoc-best-practices/SKILL.md +44 -0
  226. package/typescript/copy-overwrite/.github/README.md +49 -1
  227. package/typescript/copy-overwrite/.github/dependabot.yml +3 -0
  228. package/typescript/copy-overwrite/.github/workflows/ci.yml +7 -29
  229. package/typescript/copy-overwrite/.github/workflows/claude.yml +3 -0
  230. package/typescript/copy-overwrite/.github/workflows/create-github-issue-on-failure.yml +6 -4
  231. package/typescript/copy-overwrite/.github/workflows/create-issue-on-failure.yml +176 -0
  232. package/typescript/copy-overwrite/.github/workflows/create-jira-issue-on-failure.yml +3 -1
  233. package/typescript/copy-overwrite/.github/workflows/create-sentry-issue-on-failure.yml +3 -1
  234. package/typescript/copy-overwrite/.github/workflows/lint-slow.yml +40 -0
  235. package/typescript/copy-overwrite/.github/workflows/quality.yml +151 -38
  236. package/typescript/copy-overwrite/.github/workflows/release.yml +3 -0
  237. package/typescript/copy-overwrite/.gitleaksignore +3 -0
  238. package/typescript/copy-overwrite/.lintstagedrc.json +6 -0
  239. package/typescript/copy-overwrite/.prettierignore +2 -1
  240. package/typescript/copy-overwrite/.yamllint +2 -0
  241. package/typescript/copy-overwrite/ast-grep/rule-tests/.gitkeep +3 -0
  242. package/typescript/copy-overwrite/ast-grep/rules/.gitkeep +3 -0
  243. package/typescript/copy-overwrite/ast-grep/utils/.gitkeep +3 -0
  244. package/typescript/copy-overwrite/{commitlint.config.js → commitlint.config.cjs} +5 -0
  245. package/typescript/copy-overwrite/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +5 -0
  246. package/typescript/copy-overwrite/eslint-plugin-code-organization/index.js +5 -0
  247. package/typescript/copy-overwrite/eslint-plugin-code-organization/rules/enforce-statement-order.js +5 -0
  248. package/typescript/copy-overwrite/eslint.base.ts +430 -0
  249. package/typescript/copy-overwrite/eslint.config.ts +52 -0
  250. package/typescript/copy-overwrite/eslint.ignore.config.json +19 -2
  251. package/typescript/copy-overwrite/eslint.slow.config.ts +69 -0
  252. package/typescript/copy-overwrite/eslint.typescript.ts +142 -0
  253. package/typescript/copy-overwrite/knip.json +64 -0
  254. package/typescript/copy-overwrite/sgconfig.yml +11 -0
  255. package/typescript/copy-overwrite/tsconfig.eslint.json +9 -0
  256. package/typescript/create-only/eslint.config.local.ts +24 -0
  257. package/typescript/{copy-overwrite/eslint.thresholds.config.json → create-only/eslint.thresholds.json} +1 -1
  258. package/typescript/github-rulesets/base.json +2 -75
  259. package/typescript/merge/.claude/settings.json +160 -0
  260. package/typescript/merge/package.json +35 -34
  261. package/all/copy-overwrite/.claude/commands/rules/format-md.md +0 -72
  262. package/all/copy-overwrite/.claude/skills/coding-philosophy/references/function-structure.md +0 -416
  263. package/all/copy-overwrite/.claude/skills/coding-philosophy/references/immutable-patterns.md +0 -316
  264. package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-inline-styles.js +0 -73
  265. package/expo/copy-overwrite/eslint.config.mjs +0 -560
  266. package/lisa.sh +0 -35
  267. package/typescript/copy-overwrite/eslint.config.mjs +0 -390
  268. /package/{all/create-only/PROJECT_RULES.md → cdk/copy-overwrite/.github/workflows/.keep} +0 -0
  269. /package/{typescript → nestjs}/copy-overwrite/.github/k6/BROWSER_TESTING_NOTE.md +0 -0
  270. /package/{typescript → nestjs}/copy-overwrite/.github/k6/INTEGRATION_GUIDE.md +0 -0
  271. /package/{typescript → nestjs}/copy-overwrite/.github/k6/SCENARIO_SELECTION_GUIDE.md +0 -0
  272. /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/load.json +0 -0
  273. /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/smoke.json +0 -0
  274. /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/soak.json +0 -0
  275. /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/spike.json +0 -0
  276. /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/stress.json +0 -0
  277. /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/normal.json +0 -0
  278. /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/relaxed.json +0 -0
  279. /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/strict.json +0 -0
  280. /package/{typescript → nestjs}/copy-overwrite/.github/workflows/k6-load-test-README.md +0 -0
@@ -1,42 +1,38 @@
1
1
  ---
2
2
  description: Systematically implements all tasks in a specified project
3
3
  argument-hint: <project-directory>
4
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task, TaskCreate, TaskUpdate, TaskList, TaskGet, Skill
4
5
  ---
5
6
 
6
- ### Get Task State
7
+ ## Setup
7
8
 
8
- Read $ARGUMENTS/progress.md
9
+ 1. Set active project marker: `echo "$ARGUMENTS" | sed 's|.*/||' > .claude-active-project`
10
+ 2. Extract `<project-name>` from the last segment of `$ARGUMENTS`
11
+ 3. Use **TaskList** to verify tasks exist for this project (check metadata.project)
12
+ 4. If no tasks found, error: "No tasks found. Run /project:plan first"
9
13
 
10
- If the file does not exist or is empty, report an error: "Error: $ARGUMENTS/progress.md not found or empty. Run /project:plan first to create the task list."
14
+ ## Implementation
11
15
 
12
- If the file contains no task items (checkbox items), report an error: "Error: No tasks found in $ARGUMENTS/progress.md. The file should contain markdown checklist items."
16
+ Use **TaskList** to get current task status.
13
17
 
14
- Count tasks: total=X, completed=Y, remaining=X-Y
18
+ For each pending, unblocked task (filter by `metadata.project` = `<project-name>`):
15
19
 
16
- ### Create Workflow Tracking for all tasks
17
- Use TodoWrite to create workflow todos for each task using the following format:
18
- - Step <task-number>: <task-name>
20
+ 1. Use **TaskUpdate** to mark it `in_progress`
21
+ 2. Use **TaskGet** to retrieve full task details (description contains all instructions)
22
+ 3. Launch a subagent to complete the task:
23
+ - Pass the task's full description (includes skills to invoke, verification, etc.)
24
+ - Subagent should follow the instructions in the description
25
+ - Subagent runs the verification command and confirms expected output
26
+ 4. When subagent completes successfully, use **TaskUpdate** to mark it `completed`
27
+ 5. If verification fails, keep task `in_progress` and report the failure
28
+ 6. Check **TaskList** for newly unblocked tasks
19
29
 
20
- ### Sync with progress file
30
+ Continue until all tasks are completed.
21
31
 
22
- If any of the tasks are marked as completed in $ARGUMENTS/progress.md, mark them as completed in the Workflow Tracking
32
+ ## Complete
23
33
 
24
- If any of the tasks are marked as in_progress in $ARGUMENTS/progress.md, mark them as in_progress in the Workflow Tracking
34
+ Use **TaskList** to generate a summary showing:
35
+ - Total tasks completed
36
+ - Any tasks that failed or remain in progress
25
37
 
26
- ### Complete the outstanding Workflow items
27
-
28
- Work on the non-completed tasks in sequence
29
-
30
- ⚠️ **CRITICAL**: DO NOT STOP until all todos are marked completed.
31
-
32
- For each non-completed task:
33
-
34
- 1. mark the task as in_progress in $ARGUMENTS/progress.md
35
- 2. mark the task as in_progress in Workflow Tracking
36
- 3. Use Task tool with subagent_type "general-purpose" and prompt: "run /project:complete-task <task-markdown-file>"
37
- 4. Wait for the subagent to finish the task
38
- 5. After subagent finishes with the task, mark the task as completed in $ARGUMENTS/progress.md
39
- 6. After subagent finishes with the task, mark the task as completed in Workflow Tracking
40
- 7. CRITICAL. DO NOT STOP. Move on to the next non-completed task
41
-
42
- Repeat until all tasks are marked completed
38
+ Suggest running `/project:review`.
@@ -1,74 +1,49 @@
1
1
  ---
2
2
  description: Reduces the code complexity of the codebase by 2 on each run
3
- allowed-tools: Read, Write, Bash(git*), Glob, Grep, Task, TodoWrite
3
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task, TaskCreate, TaskUpdate, TaskList, TaskGet
4
4
  ---
5
5
 
6
- ## Step 0: MANDATORY SETUP
6
+ ## Setup
7
7
 
8
- Create workflow tracking todos:
9
- - Step 1: Lower complexity threshold
10
- - Step 2: Run lint
11
- - Step 3: Save spec file
12
- - Step 4: Bootstrap project
13
- - Step 5: Resolve questions
14
- - Step 6: Execute project
8
+ Check for active project: `cat .claude-active-project 2>/dev/null`
15
9
 
16
- ⚠️ **CRITICAL**: DO NOT STOP until all 7 todos are marked completed.
10
+ If active, include `metadata: { "project": "<project-name>" }` in TaskCreate calls.
17
11
 
18
- ## Step 1: Lower Complexity Threshold
19
- Mark "Step 1: Lower complexity threshold" as in_progress.
12
+ ## Step 1: Lower Threshold
20
13
 
21
- In @eslint.config.mjs, lower the active cognitive complexity rule by two.
22
- Save the file.
14
+ 1. Read the eslint config to find the current `cognitive-complexity` threshold
15
+ 2. Lower the threshold by 2 (e.g., 15 → 13)
23
16
 
24
- Mark "Step 1: Lower complexity threshold" as completed. Proceed to Step 2.
17
+ ## Step 2: Identify Violations
25
18
 
26
- ## Step 2: Run Lint
27
- Mark "Step 2: Run lint" as in_progress.
19
+ Run lint to find all cognitive complexity violations. Note file path, function name, and complexity score.
28
20
 
29
- Run the lint command from @package.json.
21
+ If no violations, report success and exit.
30
22
 
31
- Mark "Step 2: Run lint" as completed. Proceed to Step 3.
23
+ ## Step 3: Create Tasks
32
24
 
33
- ## Step 3: Save Spec File
34
- Mark "Step 3: Save spec file" as in_progress.
25
+ Create a task for each function needing refactoring, ordered by complexity score (highest first).
35
26
 
36
- Save the output of the lint command to `specs/reduce-cognitive-complexity.md` along with the following instructions:
27
+ Each task should include:
28
+ - File path and function name
29
+ - Current complexity score and target threshold
30
+ - Refactoring strategies:
31
+ - **Extract functions**: Break complex logic into smaller, named functions
32
+ - **Early returns**: Reduce nesting with guard clauses
33
+ - **Extract conditions**: Move complex boolean logic into named variables
34
+ - **Use lookup tables**: Replace complex switch/if-else chains with object maps
37
35
 
38
- ```text
36
+ ## Step 4: Execute
39
37
 
40
- Refactor the <files> to adhere to the cognitive complexity rule.
38
+ Launch up to 5 sub-agents using `code-simplifier` to refactor in parallel.
41
39
 
42
- Common Solutions
40
+ Work through all tasks until complete.
43
41
 
44
- 1. Extract functions: Break complex logic into smaller, named functions
45
- 2. Early returns: Reduce nesting with guard clauses
46
- 3. Extract conditions: Move complex boolean logic into named variables
47
- 4. Use lookup tables: Replace complex switch/if-else chains
48
- 5. Break larger components into smaller components with their own View/Container pattern
49
- ```
50
-
51
- Mark "Step 3: Save spec file" as completed. Proceed to Step 4.
52
-
53
- ## Step 4: Bootstrap Project
54
- Mark "Step 4: Bootstrap project" as in_progress.
55
-
56
- Run /project:bootstrap @specs/reduce-cognitive-complexity.md
57
-
58
- Mark "Step 4: Bootstrap project" as completed. Proceed to Step 5.
59
-
60
- ## Step 5: Resolve Questions
61
- Mark "Step 5: Resolve questions" as in_progress.
62
-
63
- Answer any unresolved questions in the new project's `research.md` file.
42
+ ## Step 5: Report
64
43
 
65
- Mark "Step 5: Resolve questions" as completed. Proceed to Step 6.
66
-
67
- ## Step 6: Execute Project
68
- Mark "Step 6: Execute project" as in_progress.
69
-
70
- Run /project:execute [project-dir] where [project-dir] is the directory created from Step 4.
71
-
72
- Mark "Step 6: Execute project" as completed.
73
-
74
- Report: "🎉 Code complexity reduction complete"
44
+ ```
45
+ Code complexity reduction complete:
46
+ - Previous threshold: [X]
47
+ - New threshold: [Y]
48
+ - Functions simplified: [list]
49
+ ```
@@ -1,314 +1,159 @@
1
1
  ---
2
2
  description: Uses the research.md and brief.md file in the specified directory to create a detailed list of tasks to implement the project
3
3
  argument-hint: <project-directory>
4
+ allowed-tools: Read, Bash, Glob, Grep, TaskCreate, TaskUpdate, TaskList, Skill
4
5
  ---
5
6
 
6
- ## Step 0: MANDATORY SETUP
7
+ ## Setup
7
8
 
8
- Use TodoWrite to create workflow tracking todos:
9
- - Step 1: Read project files
10
- - Step 2: Validate research
11
- - Step 3: Discover skills
12
- - Step 4: Create task list
13
- - Step 5: Create task files
14
- - Step 6: Commit plan
9
+ Set active project marker: `echo "$ARGUMENTS" | sed 's|.*/||' > .claude-active-project`
15
10
 
16
- ⚠️ **CRITICAL**: DO NOT STOP until all 6 todos are marked completed.
11
+ Extract `<project-name>` from the last segment of `$ARGUMENTS`.
17
12
 
18
13
  ## Step 1: Read Project Files
19
- Mark "Step 1: Read project files" as in_progress.
20
14
 
21
- 1. Read the `brief.md` file inside $ARGUMENTS FULLY (no limit/offset)
22
- 2. Read the `research.md` file inside $ARGUMENTS FULLY (no limit/offset)
23
-
24
- Mark "Step 1: Read project files" as completed. Proceed to Step 2.
15
+ Read `$ARGUMENTS/brief.md` and `$ARGUMENTS/research.md` FULLY (no limit/offset).
25
16
 
26
17
  ## Step 2: Validate Research
27
- Mark "Step 2: Validate research" as in_progress.
28
18
 
29
- **VALIDATE RESEARCH COMPLETENESS**:
30
- - Locate the "## Open Questions" section in the research.md file you just read
31
- - Examine the content under this section carefully
19
+ Locate "## Open Questions" in research.md.
20
+
21
+ **Valid states** (proceed):
22
+ - Section contains "None", "[None identified]", "N/A", or is empty
23
+ - Section doesn't exist
24
+ - All `**Answer**:` fields are filled
32
25
 
33
- **VALID STATES** (proceed to Step 3):
34
- Section contains "None", "[None identified]", "N/A", or is empty
35
- ✅ Section doesn't exist at all
36
- ✅ Section contains questions BUT all `**Answer**:` fields are filled (not empty, not placeholder text like "_[Human fills this in]_")
26
+ **Invalid state** (stop immediately):
27
+ - Questions with unfilled `**Answer**:` fields
37
28
 
38
- **INVALID STATE** (stop immediately):
39
- ❌ Section contains questions with unfilled `**Answer**:` fields (empty or placeholder text)
40
- Section contains unstructured questions without Answer fields
41
- - If INVALID state is detected, **STOP IMMEDIATELY** and report:
29
+ If invalid, report:
30
+ ```
31
+ CANNOT PROCEED WITH PLANNING
42
32
 
43
- ```
44
- ❌ CANNOT PROCEED WITH PLANNING
33
+ The research.md file has unanswered open questions.
45
34
 
46
- The research.md file has unanswered open questions that must be addressed before planning can begin.
35
+ Unanswered Questions Found:
36
+ [List each question]
47
37
 
48
- Unanswered Questions Found:
49
- [List each question title and its Question field]
38
+ Action Required:
39
+ 1. Review $ARGUMENTS/research.md "## Open Questions"
40
+ 2. Fill in the **Answer**: field for each question
41
+ 3. Re-run /project:plan
42
+ ```
50
43
 
51
- Action Required:
52
- 1. Review $ARGUMENTS/research.md "## Open Questions" section
53
- 2. Fill in the **Answer**: field for each question
54
- 3. Re-run /project:plan
44
+ **IMPORTANT**: NEVER modify research.md during validation.
55
45
 
56
- Planning has been aborted.
57
- ```
46
+ ## Step 3: Discover Skills
58
47
 
59
- **IMPORTANT**: NEVER modify, delete, or replace any existing sections in research.md during validation.
60
- Only READ and VALIDATE. The research.md file is a historical record and must be preserved as-is.
48
+ Read `.claude/skills/*/SKILL.md` files (first 10 lines each) to map skills to applicable tasks.
61
49
 
62
- Mark "Step 2: Validate research" as completed. Proceed to Step 3.
50
+ ## Step 4: Create Tasks
63
51
 
64
- ## Step 3: Discover Skills
65
- Mark "Step 3: Discover skills" as in_progress.
52
+ ### Determine Task List
66
53
 
67
- **DISCOVER APPLICABLE SKILLS**:
68
- - Read all skill descriptions by examining `.claude/skills/*/SKILL.md` files (read only the frontmatter description, first 10 lines of each)
69
- - For each skill, determine if it applies to ANY task in this project based on brief.md requirements
70
- - Create a mental map of: skill name → when it applies (e.g., "container-view-pattern → when creating React components")
71
- - You will use this mapping in Step 5 to annotate each task with its applicable skills
54
+ Each task must be small enough to have a **single, specific verification**.
55
+ - Ask: "Can I prove this task is done with ONE command or check?"
56
+ - Exception: `ui-recording` tasks may verify per-platform (web/iOS/Android)
72
57
 
73
- Mark "Step 3: Discover skills" as completed. Proceed to Step 4.
58
+ **Properly-sized tasks:**
59
+ - "Add logout button to header" → single Playwright test
60
+ - "Add unit tests for UserService" → single coverage command
61
+ - "Create API endpoint for user profile" → single curl command
74
62
 
75
- ## Step 4: Create Task List
76
- Mark "Step 4: Create task list" as in_progress.
63
+ **Too large (split these):**
64
+ - "Build authentication system" split into login, logout, session, etc.
65
+ - "Add user management feature" → split into list, create, edit, etc.
77
66
 
78
- 1. Determine a list of tasks required to complete the project
79
- 2. **CRITICAL: Each task must be small enough to have a single, specific verification**
80
- - If a task would require multiple verifications, split it into smaller tasks
81
- - Ask: "Can I prove this task is done with ONE command or check?"
82
- - **Exception for multi-platform UI recordings**: Tasks with `ui-recording` verification may have one proof command per platform (web/iOS/Android) since the same UI feature must be verified on each target platform
83
- - Examples of properly-sized tasks:
84
- - ✅ "Add logout button to header" → single Playwright test verifies button exists and works
85
- - ✅ "Add unit tests for UserService" → single coverage command shows UserService coverage
86
- - ✅ "Create API endpoint for user profile" → single curl command returns expected response
87
- - ❌ "Build authentication system" → too large, needs multiple verifications (split into login, logout, session, etc.)
88
- - ❌ "Add user management feature" → too large (split into list users, create user, edit user, etc.)
89
- 3. Write that list of tasks to `progress.md` inside $ARGUMENTS
67
+ ### Create Tasks with TaskCreate
90
68
 
91
- Mark "Step 4: Create task list" as completed. Proceed to Step 5.
69
+ For each task, use **TaskCreate** with:
92
70
 
93
- ## Step 5: Create Task Files
94
- Mark "Step 5: Create task files" as in_progress.
71
+ **subject**: Task name in imperative form (e.g., "Add logout button to header")
95
72
 
96
- For each task in `progress.md`, create a new file called `tasks/000<step-number>-<task-name>.md`
73
+ **activeForm**: Present continuous form (e.g., "Adding logout button to header")
97
74
 
98
- **For each task, create a file using this template:**
75
+ **description**: Full task specification in markdown:
99
76
 
100
77
  ```markdown
101
- # Task: [Task Name]
102
-
103
78
  **Type:** Bug | Task | Epic | Story
104
- **Parent:** [Parent Task Name, or "None"]
105
79
 
106
80
  ## Description
107
-
108
- [Write a clear description based on task type:
109
- - **Bug**: Describe the bug, symptoms, and root cause analysis approach
110
- - **Story**: Use Gherkin BDD format (Given/When/Then)
111
- - **Task**: Straightforward description with clear goal
112
- - **Epic**: Goal overview with list of sub-tasks]
81
+ [Clear description based on type:
82
+ - Bug: Symptoms, root cause approach
83
+ - Story: Gherkin BDD format (Given/When/Then)
84
+ - Task: Straightforward with clear goal
85
+ - Epic: Goal overview with sub-tasks]
113
86
 
114
87
  ## Acceptance Criteria
115
-
116
- [Specific, testable criteria that define "done" for this task]
117
-
118
88
  - [ ] Criterion 1
119
89
  - [ ] Criterion 2
120
- - [ ] Criterion 3
121
90
 
122
91
  ## Relevant Research
92
+ [Extract from research.md: code references, patterns, architecture constraints]
123
93
 
124
- [Extract and summarize relevant sections from research.md, including:
125
- - Code references (file:line) that will be modified or referenced
126
- - Patterns to follow from the codebase
127
- - Architecture constraints that apply
128
- - Any resolved questions that affect this task]
129
-
130
- ## Applicable Skills
131
-
132
- Invoke these skills before writing implementation code:
133
-
134
- - `/coding-philosophy` - Always required for all code
135
- - [Add other skills from Step 3 that apply to THIS SPECIFIC task]
94
+ ## Skills to Invoke
95
+ - `/coding-philosophy` - Always required
96
+ - [Other applicable skills from Step 3]
136
97
 
137
98
  ## Implementation Details
138
-
139
- [Specific implementation guidance:
140
- - Files to create or modify
141
- - Functions/classes to implement
142
- - Integration points with existing code
143
- - Edge cases to handle]
99
+ [Files to modify, functions to implement, edge cases]
144
100
 
145
101
  ## Testing Requirements
146
-
147
102
  ### Unit Tests
148
- [List specific unit tests required. Reference patterns from research.md]
149
-
150
- - [ ] `describe('X')/it('should Y')`: Test description
151
- - [ ] `describe('X')/it('should Y')`: Test description
103
+ - [ ] `describe('X')/it('should Y')`: Description
152
104
 
153
105
  ### Integration Tests
154
- [List integration tests required, or "N/A - no integration points"]
155
-
156
- - [ ] Test description
106
+ [Or "N/A - no integration points"]
157
107
 
158
108
  ### E2E Tests
159
- [List e2e tests required, or "N/A - no user-facing changes"]
160
-
161
- - [ ] Test scenario description
162
-
163
- ## Documentation Requirements
164
-
165
- ### Code Documentation (JSDoc)
166
- [List functions/types needing JSDoc, or "N/A"]
167
-
168
- - [ ] `functionName` - @param, @returns, @throws
169
- - [ ] `TypeName` - @description
170
-
171
- ### Database Comments
172
- [List tables/columns needing comments, or "N/A - no database changes"]
173
-
174
- - [ ] `table.column` - purpose description
175
-
176
- ### GraphQL Descriptions
177
- [List types/fields needing descriptions, or "N/A - no GraphQL changes"]
178
-
179
- - [ ] `Type.field` - purpose description
109
+ [Or "N/A - no user-facing changes"]
180
110
 
181
111
  ## Verification
112
+ **Type:** `ui-recording` | `test-coverage` | `api-test` | `manual-check` | `documentation`
182
113
 
183
- ### Type
184
- [One of: `ui-recording` | `test-coverage` | `api-test` | `manual-check` | `documentation`]
185
-
186
- ### Proof Command
114
+ **Proof Command:**
187
115
  ```bash
188
- [Single command to verify task completion - must be specific to THIS task]
116
+ [Single command to verify completion]
189
117
  ```
190
118
 
191
- <!-- For ui-recording on multi-platform apps, provide one command per platform:
192
- #### Web
193
- ```bash
194
- bun run playwright:test e2e/feature.spec.ts --grep "specific test" --trace on
119
+ **Expected Output:**
120
+ [What success looks like]
195
121
  ```
196
122
 
197
- #### iOS
198
- ```bash
199
- maestro test .maestro/flows/feature-test.yaml --platform ios
123
+ **metadata**:
124
+ ```json
125
+ {
126
+ "project": "<project-name>",
127
+ "type": "bug|task|epic|story",
128
+ "skills": ["/coding-philosophy", ...],
129
+ "verification": {
130
+ "type": "test-coverage|ui-recording|api-test|manual-check|documentation",
131
+ "command": "the proof command",
132
+ "expected": "what success looks like"
133
+ }
134
+ }
200
135
  ```
201
136
 
202
- #### Android
203
- ```bash
204
- maestro test .maestro/flows/feature-test.yaml --platform android
205
- ```
206
- -->
137
+ ### Set Up Dependencies
207
138
 
208
- <!-- For api-test, create a documented bash script at scripts/verify/<task-name>.sh:
209
- - Script must support -h and --help flags with usage documentation
210
- - Script must handle authentication if required
211
- - Script must return exit code 0 on success, non-zero on failure
212
- - Script must output clear success/failure message
213
-
214
- Example:
215
- ```bash
216
- ./scripts/verify/user-profile-api.sh --help
217
- ./scripts/verify/user-profile-api.sh
218
- ```
219
- -->
220
-
221
- ### Expected Output
222
- [What the proof command output should show to confirm success]
223
-
224
- ## Implementation Steps
225
-
226
- ### Step 0: Setup Tracking
227
- Use TodoWrite to create task tracking todos:
228
- - Invoke skills
229
- - Write failing tests
230
- - Write implementation
231
- - Verify implementation
232
- - Update documentation
233
- - Commit changes
234
-
235
- ⚠️ **CRITICAL**: DO NOT STOP until all todos are marked completed.
236
-
237
- ### Step 1: Invoke Skills
238
- Mark "Invoke skills" as in_progress.
239
-
240
- 1. Mark this task as "in progress" in `progress.md`
241
- 2. Invoke each skill listed in "Applicable Skills" using the Skill tool
242
-
243
- Mark "Invoke skills" as completed.
244
-
245
- ### Step 2: Write Failing Tests
246
- Mark "Write failing tests" as in_progress.
247
-
248
- 1. Write unit tests based on Testing Requirements
249
- 2. Write integration tests based on Testing Requirements
250
- 3. Run tests to confirm they fail (TDD)
251
-
252
- Mark "Write failing tests" as completed.
253
-
254
- ### Step 3: Write Implementation
255
- Mark "Write implementation" as in_progress.
256
-
257
- Implement code following Implementation Details until tests pass.
258
-
259
- Mark "Write implementation" as completed.
260
-
261
- ### Step 4: Verify Implementation
262
- Mark "Verify implementation" as in_progress.
263
-
264
- 1. Run the Proof Command from Verification section
265
- 2. Confirm output matches Expected Output
266
- 3. If verification fails, fix and re-verify
267
-
268
- Mark "Verify implementation" as completed.
269
-
270
- ### Step 5: Update Documentation
271
- Mark "Update documentation" as in_progress.
272
-
273
- Complete all items in Documentation Requirements section.
274
-
275
- Mark "Update documentation" as completed.
276
-
277
- ### Step 6: Commit Changes
278
- Mark "Commit changes" as in_progress.
279
-
280
- 1. Run `/git:commit`
281
- 2. Mark this task as "completed" in `progress.md`
282
- 3. Record any learnings in `findings.md`
283
-
284
- Mark "Commit changes" as completed.
285
- ```
286
-
287
- ---
139
+ After creating all tasks, use **TaskUpdate** with `addBlockedBy` to establish task order where needed.
288
140
 
289
141
  **Verification Type Reference:**
290
142
 
291
- | Type | When to Use | Example Command |
292
- |------|-------------|-----------------|
293
- | `ui-recording` | UI/UX changes visible to users | Web: `bun run playwright:test ...`, iOS/Android: `maestro test ...` |
294
- | `test-coverage` | New code with tests | `bun run test:cov -- --collectCoverageFrom='src/path/to/file.ts'` |
295
- | `api-test` | New API endpoints | `./scripts/verify/<task-name>.sh` (documented script with -h/--help) |
296
- | `documentation` | Docs, README updates | `cat path/to/doc.md` |
297
- | `manual-check` | Config, setup, infrastructure | Command showing the config/state exists |
143
+ | Type | When to Use | Example |
144
+ |------|-------------|---------|
145
+ | `ui-recording` | UI/UX changes | `bun run playwright:test ...` |
146
+ | `test-coverage` | New code with tests | `bun run test:cov -- --collectCoverageFrom='...'` |
147
+ | `api-test` | New API endpoints | `./scripts/verify/<task-name>.sh` |
148
+ | `documentation` | Docs, README | `cat path/to/doc.md` |
149
+ | `manual-check` | Config, setup | Command showing config exists |
298
150
 
299
- Mark "Step 5: Create task files" as completed. Proceed to Step 6.
151
+ ## Step 5: Report
300
152
 
301
- ## Step 6: Commit Plan
302
- Mark "Step 6: Commit plan" as in_progress.
153
+ Report: "Planning complete - X tasks created for project <project-name>"
303
154
 
304
- Run /git:commit
305
-
306
- Mark "Step 6: Commit plan" as completed.
307
-
308
- Report: "📋 Planning complete - X tasks created"
155
+ Use **TaskList** to show the created tasks.
309
156
 
310
157
  ---
311
158
 
312
- IMPORTANT: Each task should contain all the necessary information from `brief.md` and `research.md` and any other support files necessary to complete the task in isolation. Tasks should be completely independent of one another and be as small in scope as possible.
313
-
314
- IMPORTANT: If, at the end of a task, the pre-commit blocks you because it is dependent on another task, complete the other task first and then commit.
159
+ **IMPORTANT**: Each task description should contain all necessary information from `brief.md` and `research.md` to complete in isolation. Tasks should be independent and as small in scope as possible.
@@ -0,0 +1,76 @@
1
+ ---
2
+ description: Reduce max lines per function threshold and fix violations
3
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task, TaskCreate, TaskUpdate, TaskList, TaskGet
4
+ argument-hint: <max-lines-per-function-value>
5
+ model: sonnet
6
+ ---
7
+
8
+ # Reduce Max Lines Per Function
9
+
10
+ Target threshold: $ARGUMENTS lines per function
11
+
12
+ If no argument provided, prompt the user for a target.
13
+
14
+ ## Process
15
+
16
+ ### Step 0: Check Project Context
17
+
18
+ Check if there's an active project for task syncing:
19
+
20
+ ```bash
21
+ cat .claude-active-project 2>/dev/null
22
+ ```
23
+
24
+ If a project is active, include `metadata: { "project": "<project-name>" }` in all TaskCreate calls.
25
+
26
+ ### Step 1: Locate Configuration
27
+
28
+ Read the eslint thresholds config (`eslint.thresholds.json` or similar).
29
+
30
+ ### Step 2: Update Threshold
31
+
32
+ Set the `maxLinesPerFunction` threshold to $ARGUMENTS (e.g., `"maxLinesPerFunction": $ARGUMENTS`).
33
+
34
+ ### Step 3: Identify Violations
35
+
36
+ Run lint to find all functions exceeding the new threshold. Note file path, function name, and current line count.
37
+
38
+ If no violations, report success and exit.
39
+
40
+ ### Step 4: Create Task List
41
+
42
+ Create a task for each function needing refactoring, ordered by line count (highest first).
43
+
44
+ Each task should have:
45
+ - **subject**: "Reduce lines in [function-name]" (imperative form)
46
+ - **description**: File path and line number, function name, current line count, target threshold, refactoring strategies
47
+ - **activeForm**: "Reducing lines in [function-name]" (present continuous)
48
+ - **metadata**: `{ "project": "<active-project>" }` if project context exists
49
+
50
+ Refactoring strategies:
51
+ - **Extract functions**: Break function into smaller named functions
52
+ - **Early returns**: Reduce nesting with guard clauses
53
+ - **Extract conditions**: Move complex boolean logic into named variables
54
+ - **Use lookup tables**: Replace complex switch/if-else chains with object maps
55
+ - **Consolidate logic**: Merge similar code paths
56
+
57
+ ### Step 5: Parallel Execution
58
+
59
+ Launch **up to 5 sub-agents** using the `code-simplifier` subagent to refactor in parallel.
60
+
61
+ ### Step 6: Iterate
62
+
63
+ Check for remaining pending tasks. Re-run lint to verify.
64
+
65
+ If violations remain, repeat from Step 3.
66
+
67
+ Continue until all functions meet or are under $ARGUMENTS lines.
68
+
69
+ ### Step 7: Report
70
+
71
+ ```
72
+ Max lines per function reduction complete:
73
+ - Target threshold: $ARGUMENTS
74
+ - Functions refactored: [count]
75
+ - Functions reduced: [list with line counts]
76
+ ```