@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.
- package/README.md +244 -36
- package/all/copy-overwrite/.claude/README.md +1 -3
- package/all/copy-overwrite/.claude/REFERENCE.md +519 -0
- package/all/copy-overwrite/.claude/agents/skill-evaluator.md +7 -7
- package/all/copy-overwrite/.claude/agents/test-coverage-agent.md +17 -0
- package/all/copy-overwrite/.claude/commands/git/commit.md +9 -5
- package/all/copy-overwrite/.claude/commands/git/submit-pr.md +1 -1
- package/all/copy-overwrite/.claude/commands/lisa/review-implementation.md +209 -0
- package/all/copy-overwrite/.claude/commands/project/add-test-coverage.md +58 -0
- package/all/copy-overwrite/.claude/commands/project/archive.md +1 -1
- package/all/copy-overwrite/.claude/commands/project/complete-task.md +53 -1
- package/all/copy-overwrite/.claude/commands/project/debrief.md +12 -23
- package/all/copy-overwrite/.claude/commands/project/execute.md +33 -77
- package/all/copy-overwrite/.claude/commands/project/fix-linter-error.md +87 -0
- package/all/copy-overwrite/.claude/commands/project/implement.md +24 -28
- package/all/copy-overwrite/.claude/commands/project/lower-code-complexity.md +30 -55
- package/all/copy-overwrite/.claude/commands/project/plan.md +87 -242
- package/all/copy-overwrite/.claude/commands/project/reduce-max-lines-per-function.md +76 -0
- package/all/copy-overwrite/.claude/commands/project/reduce-max-lines.md +75 -0
- package/all/copy-overwrite/.claude/commands/project/research.md +86 -188
- package/all/copy-overwrite/.claude/commands/project/review.md +19 -38
- package/all/copy-overwrite/.claude/commands/project/setup.md +1 -1
- package/all/copy-overwrite/.claude/commands/project/verify.md +62 -25
- package/all/copy-overwrite/.claude/commands/pull-request/review.md +25 -7
- package/all/copy-overwrite/.claude/commands/tasks/load.md +63 -0
- package/all/copy-overwrite/.claude/commands/tasks/sync.md +84 -0
- package/all/copy-overwrite/.claude/hooks/README.md +75 -0
- package/all/copy-overwrite/.claude/hooks/check-tired-boss.sh +61 -0
- package/all/copy-overwrite/.claude/hooks/debug-hook.sh +47 -0
- package/all/copy-overwrite/.claude/hooks/notify-ntfy.sh +2 -0
- package/all/copy-overwrite/.claude/hooks/sync-tasks.sh +95 -0
- package/all/copy-overwrite/.claude/{skills/coding-philosophy/SKILL.md → rules/coding-philosophy.md} +93 -70
- package/all/copy-overwrite/.claude/settings.json +35 -14
- package/all/copy-overwrite/.claude/skills/prompt-complexity-scorer/SKILL.md +41 -9
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/init_skill.py +2 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/package_skill.py +2 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/quick_validate.py +2 -0
- package/all/copy-overwrite/.safety-net.json +25 -0
- package/all/copy-overwrite/CLAUDE.md +8 -30
- package/all/copy-overwrite/HUMAN.md +517 -17
- package/all/create-only/.claude/rules/PROJECT_RULES.md +9 -0
- package/all/create-only/scripts/setup-deploy-key.sh +190 -0
- package/all/deletions.json +5 -0
- package/cdk/copy-overwrite/.github/workflows/ci.yml +142 -0
- package/cdk/copy-overwrite/.github/workflows/deploy.yml +59 -0
- package/cdk/copy-overwrite/eslint.cdk.ts +175 -0
- package/cdk/copy-overwrite/eslint.config.ts +51 -0
- package/cdk/copy-overwrite/eslint.slow.config.ts +80 -0
- package/cdk/copy-overwrite/knip.json +53 -0
- package/cdk/copy-overwrite/tsconfig.eslint.json +11 -0
- package/cdk/merge/package.json +17 -1
- package/dist/cli/index.d.ts +3 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +83 -64
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/prompts.d.ts +17 -3
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +52 -16
- package/dist/cli/prompts.js.map +1 -1
- package/dist/core/config.d.ts +13 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +17 -9
- package/dist/core/config.js.map +1 -1
- package/dist/core/git-service.d.ts +40 -0
- package/dist/core/git-service.d.ts.map +1 -0
- package/dist/core/git-service.js +52 -0
- package/dist/core/git-service.js.map +1 -0
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +3 -3
- package/dist/core/lisa.d.ts +124 -7
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +423 -221
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/manifest.d.ts +5 -1
- package/dist/core/manifest.d.ts.map +1 -1
- package/dist/core/manifest.js +22 -16
- package/dist/core/manifest.js.map +1 -1
- package/dist/detection/detector.interface.d.ts +1 -1
- package/dist/detection/detectors/cdk.d.ts +6 -1
- package/dist/detection/detectors/cdk.d.ts.map +1 -1
- package/dist/detection/detectors/cdk.js +16 -8
- package/dist/detection/detectors/cdk.js.map +1 -1
- package/dist/detection/detectors/expo.d.ts +6 -1
- package/dist/detection/detectors/expo.d.ts.map +1 -1
- package/dist/detection/detectors/expo.js +13 -8
- package/dist/detection/detectors/expo.js.map +1 -1
- package/dist/detection/detectors/nestjs.d.ts +7 -2
- package/dist/detection/detectors/nestjs.d.ts.map +1 -1
- package/dist/detection/detectors/nestjs.js +17 -9
- package/dist/detection/detectors/nestjs.js.map +1 -1
- package/dist/detection/detectors/npm-package.d.ts +6 -1
- package/dist/detection/detectors/npm-package.d.ts.map +1 -1
- package/dist/detection/detectors/npm-package.js +9 -4
- package/dist/detection/detectors/npm-package.js.map +1 -1
- package/dist/detection/detectors/typescript.d.ts +6 -1
- package/dist/detection/detectors/typescript.d.ts.map +1 -1
- package/dist/detection/detectors/typescript.js +12 -7
- package/dist/detection/detectors/typescript.js.map +1 -1
- package/dist/detection/index.d.ts +13 -3
- package/dist/detection/index.d.ts.map +1 -1
- package/dist/detection/index.js +17 -7
- package/dist/detection/index.js.map +1 -1
- package/dist/errors/index.d.ts +66 -2
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +89 -17
- package/dist/errors/index.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/logging/console-logger.d.ts +21 -1
- package/dist/logging/console-logger.d.ts.map +1 -1
- package/dist/logging/console-logger.js +26 -6
- package/dist/logging/console-logger.js.map +1 -1
- package/dist/logging/index.d.ts +3 -3
- package/dist/logging/index.js +2 -2
- package/dist/logging/logger.interface.d.ts +1 -1
- package/dist/logging/silent-logger.d.ts +21 -1
- package/dist/logging/silent-logger.d.ts.map +1 -1
- package/dist/logging/silent-logger.js +20 -0
- package/dist/logging/silent-logger.js.map +1 -1
- package/dist/strategies/copy-contents.d.ts +47 -6
- package/dist/strategies/copy-contents.d.ts.map +1 -1
- package/dist/strategies/copy-contents.js +99 -49
- package/dist/strategies/copy-contents.js.map +1 -1
- package/dist/strategies/copy-overwrite.d.ts +10 -2
- package/dist/strategies/copy-overwrite.d.ts.map +1 -1
- package/dist/strategies/copy-overwrite.js +17 -9
- package/dist/strategies/copy-overwrite.js.map +1 -1
- package/dist/strategies/create-only.d.ts +10 -2
- package/dist/strategies/create-only.d.ts.map +1 -1
- package/dist/strategies/create-only.js +14 -6
- package/dist/strategies/create-only.js.map +1 -1
- package/dist/strategies/index.d.ts +17 -7
- package/dist/strategies/index.d.ts.map +1 -1
- package/dist/strategies/index.js +19 -9
- package/dist/strategies/index.js.map +1 -1
- package/dist/strategies/merge.d.ts +10 -2
- package/dist/strategies/merge.d.ts.map +1 -1
- package/dist/strategies/merge.js +21 -21
- package/dist/strategies/merge.js.map +1 -1
- package/dist/strategies/strategy.interface.d.ts +1 -1
- package/dist/strategies/strategy.interface.d.ts.map +1 -1
- package/dist/transaction/backup.d.ts +15 -1
- package/dist/transaction/backup.d.ts.map +1 -1
- package/dist/transaction/backup.js +47 -12
- package/dist/transaction/backup.js.map +1 -1
- package/dist/transaction/index.d.ts +3 -3
- package/dist/transaction/index.js +2 -2
- package/dist/transaction/transaction.d.ts +25 -2
- package/dist/transaction/transaction.d.ts.map +1 -1
- package/dist/transaction/transaction.js +25 -2
- package/dist/transaction/transaction.js.map +1 -1
- package/dist/utils/file-operations.d.ts +21 -0
- package/dist/utils/file-operations.d.ts.map +1 -1
- package/dist/utils/file-operations.js +48 -12
- package/dist/utils/file-operations.js.map +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +3 -3
- package/dist/utils/json-utils.d.ts +12 -0
- package/dist/utils/json-utils.d.ts.map +1 -1
- package/dist/utils/json-utils.js +17 -5
- package/dist/utils/json-utils.js.map +1 -1
- package/dist/utils/path-utils.d.ts +11 -0
- package/dist/utils/path-utils.d.ts.map +1 -1
- package/dist/utils/path-utils.js +12 -1
- package/dist/utils/path-utils.js.map +1 -1
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +5 -0
- package/eslint-plugin-code-organization/index.js +5 -0
- package/eslint-plugin-code-organization/rules/enforce-statement-order.js +5 -0
- package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/scripts/validate_atomic_structure.py +2 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/create_component.py +2 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/validate_component.py +2 -0
- package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/scripts/validate_cross_platform.py +2 -0
- package/expo/copy-overwrite/.claude/skills/directory-structure/scripts/validate_structure.py +2 -0
- package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/scripts/generate-route.py +2 -0
- package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/scripts/validate_styling.py +2 -41
- package/{typescript → expo}/copy-overwrite/.github/workflows/build.yml +3 -0
- package/expo/copy-overwrite/.github/workflows/ci.yml +36 -0
- package/{typescript → expo}/copy-overwrite/.github/workflows/deploy.yml +22 -26
- package/{typescript → expo}/copy-overwrite/.github/workflows/lighthouse.yml +4 -1
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/plugin-index.test.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/require-memo-in-view.test.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/single-component-per-file.test.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/index.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/enforce-component-structure.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/no-return-in-view.js +6 -1
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/require-memo-in-view.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/single-component-per-file.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/README.md +0 -68
- package/expo/copy-overwrite/eslint-plugin-ui-standards/index.js +5 -3
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-classname-outside-ui.js +5 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-direct-rn-imports.js +5 -0
- package/expo/copy-overwrite/eslint.config.ts +53 -0
- package/expo/copy-overwrite/eslint.expo.ts +330 -0
- package/expo/copy-overwrite/eslint.slow.config.ts +86 -0
- package/expo/copy-overwrite/knip.json +132 -0
- package/expo/copy-overwrite/lighthouserc.js +27 -0
- package/expo/copy-overwrite/tsconfig.eslint.json +25 -0
- package/expo/create-only/lighthouserc-config.json +6 -1
- package/expo/merge/package.json +16 -3
- package/nestjs/copy-overwrite/.claude/skills/nestjs-rules/SKILL.md +1 -1
- package/{typescript → nestjs}/copy-overwrite/.github/k6/README.md +2 -2
- package/{typescript → nestjs}/copy-overwrite/.github/k6/examples/customer-deploy-integration.yml +3 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/examples/data-driven-test.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/load.js +6 -2
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/smoke.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/soak.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/spike.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/stress.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scripts/api-test.js +5 -0
- package/{typescript → nestjs}/copy-overwrite/.github/k6/scripts/default-test.js +5 -0
- package/nestjs/copy-overwrite/.github/workflows/ci.yml +29 -0
- package/nestjs/copy-overwrite/.github/workflows/deploy.yml +291 -0
- package/{typescript → nestjs}/copy-overwrite/.github/workflows/load-test.yml +3 -0
- package/nestjs/copy-overwrite/eslint.config.ts +53 -0
- package/nestjs/copy-overwrite/eslint.nestjs.ts +178 -0
- package/nestjs/merge/package.json +11 -3
- package/package.json +34 -40
- package/typescript/copy-contents/.husky/pre-commit +1 -1
- package/typescript/copy-contents/.husky/pre-push +99 -118
- package/typescript/copy-overwrite/.claude/hooks/format-on-edit.sh +2 -0
- package/typescript/copy-overwrite/.claude/hooks/install_pkgs.sh +3 -11
- package/typescript/copy-overwrite/.claude/hooks/lint-on-edit.sh +2 -0
- package/typescript/copy-overwrite/.claude/hooks/sg-scan-on-edit.sh +68 -0
- package/typescript/copy-overwrite/.claude/settings.json +79 -0
- package/typescript/copy-overwrite/.claude/skills/jsdoc-best-practices/SKILL.md +44 -0
- package/typescript/copy-overwrite/.github/README.md +49 -1
- package/typescript/copy-overwrite/.github/dependabot.yml +3 -0
- package/typescript/copy-overwrite/.github/workflows/ci.yml +7 -29
- package/typescript/copy-overwrite/.github/workflows/claude.yml +3 -0
- package/typescript/copy-overwrite/.github/workflows/create-github-issue-on-failure.yml +6 -4
- package/typescript/copy-overwrite/.github/workflows/create-issue-on-failure.yml +176 -0
- package/typescript/copy-overwrite/.github/workflows/create-jira-issue-on-failure.yml +3 -1
- package/typescript/copy-overwrite/.github/workflows/create-sentry-issue-on-failure.yml +3 -1
- package/typescript/copy-overwrite/.github/workflows/lint-slow.yml +40 -0
- package/typescript/copy-overwrite/.github/workflows/quality.yml +151 -38
- package/typescript/copy-overwrite/.github/workflows/release.yml +3 -0
- package/typescript/copy-overwrite/.gitleaksignore +3 -0
- package/typescript/copy-overwrite/.lintstagedrc.json +6 -0
- package/typescript/copy-overwrite/.prettierignore +2 -1
- package/typescript/copy-overwrite/.yamllint +2 -0
- package/typescript/copy-overwrite/ast-grep/rule-tests/.gitkeep +3 -0
- package/typescript/copy-overwrite/ast-grep/rules/.gitkeep +3 -0
- package/typescript/copy-overwrite/ast-grep/utils/.gitkeep +3 -0
- package/typescript/copy-overwrite/{commitlint.config.js → commitlint.config.cjs} +5 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +5 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/index.js +5 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/rules/enforce-statement-order.js +5 -0
- package/typescript/copy-overwrite/eslint.base.ts +430 -0
- package/typescript/copy-overwrite/eslint.config.ts +52 -0
- package/typescript/copy-overwrite/eslint.ignore.config.json +19 -2
- package/typescript/copy-overwrite/eslint.slow.config.ts +69 -0
- package/typescript/copy-overwrite/eslint.typescript.ts +142 -0
- package/typescript/copy-overwrite/knip.json +64 -0
- package/typescript/copy-overwrite/sgconfig.yml +11 -0
- package/typescript/copy-overwrite/tsconfig.eslint.json +9 -0
- package/typescript/create-only/eslint.config.local.ts +24 -0
- package/typescript/{copy-overwrite/eslint.thresholds.config.json → create-only/eslint.thresholds.json} +1 -1
- package/typescript/github-rulesets/base.json +2 -75
- package/typescript/merge/.claude/settings.json +160 -0
- package/typescript/merge/package.json +35 -34
- package/all/copy-overwrite/.claude/commands/rules/format-md.md +0 -72
- package/all/copy-overwrite/.claude/skills/coding-philosophy/references/function-structure.md +0 -416
- package/all/copy-overwrite/.claude/skills/coding-philosophy/references/immutable-patterns.md +0 -316
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-inline-styles.js +0 -73
- package/expo/copy-overwrite/eslint.config.mjs +0 -560
- package/lisa.sh +0 -35
- package/typescript/copy-overwrite/eslint.config.mjs +0 -390
- /package/{all/create-only/PROJECT_RULES.md → cdk/copy-overwrite/.github/workflows/.keep} +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/BROWSER_TESTING_NOTE.md +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/INTEGRATION_GUIDE.md +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/SCENARIO_SELECTION_GUIDE.md +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/load.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/smoke.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/soak.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/spike.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/scenarios/stress.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/normal.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/relaxed.json +0 -0
- /package/{typescript → nestjs}/copy-overwrite/.github/k6/thresholds/strict.json +0 -0
- /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
|
-
|
|
7
|
+
## Setup
|
|
7
8
|
|
|
8
|
-
|
|
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
|
-
|
|
14
|
+
## Implementation
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
Use **TaskList** to get current task status.
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
For each pending, unblocked task (filter by `metadata.project` = `<project-name>`):
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
Use
|
|
18
|
-
|
|
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
|
-
|
|
30
|
+
Continue until all tasks are completed.
|
|
21
31
|
|
|
22
|
-
|
|
32
|
+
## Complete
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
Use **TaskList** to generate a summary showing:
|
|
35
|
+
- Total tasks completed
|
|
36
|
+
- Any tasks that failed or remain in progress
|
|
25
37
|
|
|
26
|
-
|
|
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
|
|
3
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task, TaskCreate, TaskUpdate, TaskList, TaskGet
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Setup
|
|
7
7
|
|
|
8
|
-
|
|
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
|
-
|
|
10
|
+
If active, include `metadata: { "project": "<project-name>" }` in TaskCreate calls.
|
|
17
11
|
|
|
18
|
-
## Step 1: Lower
|
|
19
|
-
Mark "Step 1: Lower complexity threshold" as in_progress.
|
|
12
|
+
## Step 1: Lower Threshold
|
|
20
13
|
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
17
|
+
## Step 2: Identify Violations
|
|
25
18
|
|
|
26
|
-
|
|
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
|
-
|
|
21
|
+
If no violations, report success and exit.
|
|
30
22
|
|
|
31
|
-
|
|
23
|
+
## Step 3: Create Tasks
|
|
32
24
|
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
36
|
+
## Step 4: Execute
|
|
39
37
|
|
|
40
|
-
|
|
38
|
+
Launch up to 5 sub-agents using `code-simplifier` to refactor in parallel.
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
Work through all tasks until complete.
|
|
43
41
|
|
|
44
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
##
|
|
7
|
+
## Setup
|
|
7
8
|
|
|
8
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
**
|
|
34
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
35
|
+
Unanswered Questions Found:
|
|
36
|
+
[List each question]
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
```
|
|
46
|
+
## Step 3: Discover Skills
|
|
58
47
|
|
|
59
|
-
|
|
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
|
-
|
|
50
|
+
## Step 4: Create Tasks
|
|
63
51
|
|
|
64
|
-
|
|
65
|
-
Mark "Step 3: Discover skills" as in_progress.
|
|
52
|
+
### Determine Task List
|
|
66
53
|
|
|
67
|
-
**
|
|
68
|
-
-
|
|
69
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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
|
-
|
|
69
|
+
For each task, use **TaskCreate** with:
|
|
92
70
|
|
|
93
|
-
|
|
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
|
-
|
|
73
|
+
**activeForm**: Present continuous form (e.g., "Adding logout button to header")
|
|
97
74
|
|
|
98
|
-
**
|
|
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
|
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
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
|
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
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
|
-
[
|
|
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
|
-
[
|
|
155
|
-
|
|
156
|
-
- [ ] Test description
|
|
106
|
+
[Or "N/A - no integration points"]
|
|
157
107
|
|
|
158
108
|
### E2E Tests
|
|
159
|
-
[
|
|
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
|
-
|
|
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
|
|
116
|
+
[Single command to verify completion]
|
|
189
117
|
```
|
|
190
118
|
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
198
|
-
```
|
|
199
|
-
|
|
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
|
-
|
|
203
|
-
```bash
|
|
204
|
-
maestro test .maestro/flows/feature-test.yaml --platform android
|
|
205
|
-
```
|
|
206
|
-
-->
|
|
137
|
+
### Set Up Dependencies
|
|
207
138
|
|
|
208
|
-
|
|
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
|
|
292
|
-
|
|
293
|
-
| `ui-recording` | UI/UX changes
|
|
294
|
-
| `test-coverage` | New code with tests | `bun run test:cov -- --collectCoverageFrom='
|
|
295
|
-
| `api-test` | New API endpoints | `./scripts/verify/<task-name>.sh`
|
|
296
|
-
| `documentation` | Docs, README
|
|
297
|
-
| `manual-check` | Config, setup
|
|
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
|
-
|
|
151
|
+
## Step 5: Report
|
|
300
152
|
|
|
301
|
-
|
|
302
|
-
Mark "Step 6: Commit plan" as in_progress.
|
|
153
|
+
Report: "Planning complete - X tasks created for project <project-name>"
|
|
303
154
|
|
|
304
|
-
|
|
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
|
|
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
|
+
```
|