rafcode 1.0.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/settings.local.json +32 -0
- package/CLAUDE.md +187 -0
- package/LICENSE +21 -0
- package/RAF/001-raf-task-improvements/input.md +9 -0
- package/RAF/001-raf-task-improvements/outcomes/001-add-decisions-folder.md +21 -0
- package/RAF/001-raf-task-improvements/outcomes/002-fix-write-error-on-shutdown.md +22 -0
- package/RAF/001-raf-task-improvements/outcomes/003-stash-changes-on-failure.md +34 -0
- package/RAF/001-raf-task-improvements/outcomes/004-add-project-name-to-commits.md +28 -0
- package/RAF/001-raf-task-improvements/outcomes/005-add-running-time-display.md +36 -0
- package/RAF/001-raf-task-improvements/outcomes/006-add-task-name-to-logs.md +22 -0
- package/RAF/001-raf-task-improvements/outcomes/007-show-model-at-task-start.md +52 -0
- package/RAF/001-raf-task-improvements/outcomes/009-remove-editor-placeholder-text.md +20 -0
- package/RAF/001-raf-task-improvements/outcomes/SUMMARY.md +83 -0
- package/RAF/001-raf-task-improvements/plans/001-add-decisions-folder.md +38 -0
- package/RAF/001-raf-task-improvements/plans/002-fix-write-error-on-shutdown.md +33 -0
- package/RAF/001-raf-task-improvements/plans/003-stash-changes-on-failure.md +37 -0
- package/RAF/001-raf-task-improvements/plans/004-add-project-name-to-commits.md +34 -0
- package/RAF/001-raf-task-improvements/plans/005-add-running-time-display.md +39 -0
- package/RAF/001-raf-task-improvements/plans/006-add-task-name-to-logs.md +37 -0
- package/RAF/001-raf-task-improvements/plans/009-remove-editor-placeholder-text.md +34 -0
- package/RAF/002-raf-task-improvements-execution/decisions/DECISIONS.md +13 -0
- package/RAF/002-raf-task-improvements-execution/input.md +3 -0
- package/RAF/002-raf-task-improvements-execution/outcomes/001-commit-show-model-at-task-start.md +17 -0
- package/RAF/002-raf-task-improvements-execution/outcomes/002-delete-skipped-plan.md +23 -0
- package/RAF/002-raf-task-improvements-execution/outcomes/SUMMARY.md +32 -0
- package/RAF/002-raf-task-improvements-execution/plans/001-commit-show-model-at-task-start.md +37 -0
- package/RAF/002-raf-task-improvements-execution/plans/002-delete-skipped-plan.md +23 -0
- package/RAF/003-multi-project-execution/decisions/DECISIONS.md +68 -0
- package/RAF/003-multi-project-execution/input.md +6 -0
- package/RAF/003-multi-project-execution/outcomes/001-remove-state-json.md +52 -0
- package/RAF/003-multi-project-execution/outcomes/002-update-raf-status.md +50 -0
- package/RAF/003-multi-project-execution/outcomes/003-simplify-git-logic.md +35 -0
- package/RAF/003-multi-project-execution/outcomes/004-auto-commit-planning.md +43 -0
- package/RAF/003-multi-project-execution/outcomes/005-rerun-failed-tasks.md +43 -0
- package/RAF/003-multi-project-execution/outcomes/006-multi-project-execution.md +42 -0
- package/RAF/003-multi-project-execution/outcomes/007-verify-timeout.md +54 -0
- package/RAF/003-multi-project-execution/outcomes/008-move-decisions-file.md +38 -0
- package/RAF/003-multi-project-execution/outcomes/SUMMARY.md +79 -0
- package/RAF/003-multi-project-execution/plans/001-remove-state-json.md +71 -0
- package/RAF/003-multi-project-execution/plans/002-update-raf-status.md +65 -0
- package/RAF/003-multi-project-execution/plans/003-simplify-git-logic.md +74 -0
- package/RAF/003-multi-project-execution/plans/004-auto-commit-planning.md +57 -0
- package/RAF/003-multi-project-execution/plans/005-rerun-failed-tasks.md +69 -0
- package/RAF/003-multi-project-execution/plans/006-multi-project-execution.md +81 -0
- package/RAF/003-multi-project-execution/plans/007-verify-timeout.md +63 -0
- package/RAF/003-multi-project-execution/plans/008-move-decisions-file.md +78 -0
- package/RAF/004-task-naming-optimization/decisions.md +22 -0
- package/RAF/004-task-naming-optimization/input.md +6 -0
- package/RAF/004-task-naming-optimization/outcomes/001-remove-summary-file.md +17 -0
- package/RAF/004-task-naming-optimization/outcomes/002-base36-project-numbering.md +32 -0
- package/RAF/004-task-naming-optimization/outcomes/003-improve-haiku-prompt.md +20 -0
- package/RAF/004-task-naming-optimization/outcomes/SUMMARY.md +28 -0
- package/RAF/004-task-naming-optimization/plans/001-remove-summary-file.md +34 -0
- package/RAF/004-task-naming-optimization/plans/002-base36-project-numbering.md +56 -0
- package/RAF/004-task-naming-optimization/plans/003-improve-haiku-prompt.md +50 -0
- package/RAF/005-task-naming-improvements/decisions.md +60 -0
- package/RAF/005-task-naming-improvements/input.md +2 -0
- package/RAF/005-task-naming-improvements/outcomes/001-enhance-identifier-resolution.md +42 -0
- package/RAF/005-task-naming-improvements/outcomes/002-add-identifier-support-to-status.md +38 -0
- package/RAF/005-task-naming-improvements/outcomes/003-update-do-for-full-folder-names.md +44 -0
- package/RAF/005-task-naming-improvements/outcomes/004-implement-amend-flag-for-plan.md +55 -0
- package/RAF/005-task-naming-improvements/outcomes/005-commit-outcomes-on-complete.md +47 -0
- package/RAF/005-task-naming-improvements/outcomes/006-update-execution-prompt-commit-schema.md +40 -0
- package/RAF/005-task-naming-improvements/outcomes/007-allow-pending-task-amendments.md +38 -0
- package/RAF/005-task-naming-improvements/outcomes/008-fix-timeout-label.md +24 -0
- package/RAF/005-task-naming-improvements/plans/001-enhance-identifier-resolution.md +46 -0
- package/RAF/005-task-naming-improvements/plans/002-add-identifier-support-to-status.md +36 -0
- package/RAF/005-task-naming-improvements/plans/003-update-do-for-full-folder-names.md +38 -0
- package/RAF/005-task-naming-improvements/plans/004-implement-amend-flag-for-plan.md +67 -0
- package/RAF/005-task-naming-improvements/plans/005-commit-outcomes-on-complete.md +86 -0
- package/RAF/005-task-naming-improvements/plans/006-update-execution-prompt-commit-schema.md +60 -0
- package/RAF/005-task-naming-improvements/plans/007-allow-pending-task-amendments.md +60 -0
- package/RAF/005-task-naming-improvements/plans/008-fix-timeout-label.md +31 -0
- package/RAF/006-fix-double-summary-headers/decisions.md +28 -0
- package/RAF/006-fix-double-summary-headers/input.md +3 -0
- package/RAF/006-fix-double-summary-headers/outcomes/001-fix-double-summary-headers.md +29 -0
- package/RAF/006-fix-double-summary-headers/outcomes/002-update-readme-for-npm.md +31 -0
- package/RAF/006-fix-double-summary-headers/outcomes/003-npm-publish-instructions.md +30 -0
- package/RAF/006-fix-double-summary-headers/outcomes/004-flexible-project-lookup.md +47 -0
- package/RAF/006-fix-double-summary-headers/plans/001-fix-double-summary-headers.md +42 -0
- package/RAF/006-fix-double-summary-headers/plans/002-update-readme-for-npm.md +44 -0
- package/RAF/006-fix-double-summary-headers/plans/003-npm-publish-instructions.md +45 -0
- package/RAF/006-fix-double-summary-headers/plans/004-flexible-project-lookup.md +40 -0
- package/RAF/007-improve-outcome-format/decisions.md +28 -0
- package/RAF/007-improve-outcome-format/input.md +2 -0
- package/RAF/007-improve-outcome-format/outcomes/001-update-execution-prompt.md +10 -0
- package/RAF/007-improve-outcome-format/outcomes/002-update-state-derivation.md +17 -0
- package/RAF/007-improve-outcome-format/outcomes/003-update-do-command-outcome-handling.md +16 -0
- package/RAF/007-improve-outcome-format/outcomes/004-implement-failure-analysis.md +16 -0
- package/RAF/007-improve-outcome-format/outcomes/005-update-documentation.md +15 -0
- package/RAF/007-improve-outcome-format/plans/001-update-execution-prompt.md +36 -0
- package/RAF/007-improve-outcome-format/plans/002-update-state-derivation.md +35 -0
- package/RAF/007-improve-outcome-format/plans/003-update-do-command-outcome-handling.md +37 -0
- package/RAF/007-improve-outcome-format/plans/004-implement-failure-analysis.md +44 -0
- package/RAF/007-improve-outcome-format/plans/005-update-documentation.md +33 -0
- package/RAF/008-beautiful-do/decisions.md +31 -0
- package/RAF/008-beautiful-do/input.md +1 -0
- package/RAF/008-beautiful-do/outcomes/001-terminal-symbols.md +55 -0
- package/RAF/008-beautiful-do/outcomes/002-refactor-do-output.md +95 -0
- package/RAF/008-beautiful-do/outcomes/003-refactor-status-output.md +71 -0
- package/RAF/008-beautiful-do/outcomes/004-simplify-logger.md +53 -0
- package/RAF/008-beautiful-do/outcomes/005-add-tests.md +41 -0
- package/RAF/008-beautiful-do/plans/001-terminal-symbols.md +41 -0
- package/RAF/008-beautiful-do/plans/002-refactor-do-output.md +44 -0
- package/RAF/008-beautiful-do/plans/003-refactor-status-output.md +37 -0
- package/RAF/008-beautiful-do/plans/004-simplify-logger.md +32 -0
- package/RAF/008-beautiful-do/plans/005-add-tests.md +40 -0
- package/RAF/009-system-promt-ammend/decisions.md +13 -0
- package/RAF/009-system-promt-ammend/input.md +9 -0
- package/RAF/009-system-promt-ammend/outcomes/001-model-override.md +79 -0
- package/RAF/009-system-promt-ammend/outcomes/002-system-prompt-append.md +51 -0
- package/RAF/009-system-promt-ammend/outcomes/003-retry-context.md +60 -0
- package/RAF/009-system-promt-ammend/plans/001-model-override.md +61 -0
- package/RAF/009-system-promt-ammend/plans/002-system-prompt-append.md +56 -0
- package/RAF/009-system-promt-ammend/plans/003-retry-context.md +76 -0
- package/RAF/010-outcome-marker-fallback/decisions.md +19 -0
- package/RAF/010-outcome-marker-fallback/input.md +1 -0
- package/RAF/010-outcome-marker-fallback/outcomes/001-outcome-file-marker-fallback.md +35 -0
- package/RAF/010-outcome-marker-fallback/outcomes/002-creative-project-naming.md +47 -0
- package/RAF/010-outcome-marker-fallback/plans/001-outcome-file-marker-fallback.md +58 -0
- package/RAF/010-outcome-marker-fallback/plans/002-creative-project-naming.md +68 -0
- package/RAF/011-do-task-in-commit/decisions.md +22 -0
- package/RAF/011-do-task-in-commit/input.md +1 -0
- package/RAF/011-do-task-in-commit/outcomes/001-update-execution-prompt.md +54 -0
- package/RAF/011-do-task-in-commit/outcomes/002-update-tests.md +61 -0
- package/RAF/011-do-task-in-commit/outcomes/003-update-documentation.md +51 -0
- package/RAF/011-do-task-in-commit/plans/001-update-execution-prompt.md +46 -0
- package/RAF/011-do-task-in-commit/plans/002-update-tests.md +51 -0
- package/RAF/011-do-task-in-commit/plans/003-update-documentation.md +45 -0
- package/RAF/012-name-picker-buffet/decisions.md +40 -0
- package/RAF/012-name-picker-buffet/input.md +6 -0
- package/RAF/012-name-picker-buffet/outcomes/001-name-picker-for-raf-plan.md +49 -0
- package/RAF/012-name-picker-buffet/outcomes/002-interactive-project-picker-for-raf-do.md +49 -0
- package/RAF/012-name-picker-buffet/outcomes/003-raf-status-truncation.md +55 -0
- package/RAF/012-name-picker-buffet/outcomes/004-failure-reason-details.md +65 -0
- package/RAF/012-name-picker-buffet/outcomes/005-remove-raf-commits.md +57 -0
- package/RAF/012-name-picker-buffet/outcomes/006-update-execution-prompt-for-commits.md +47 -0
- package/RAF/012-name-picker-buffet/outcomes/007-fix-plan-mode-user-prompt.md +83 -0
- package/RAF/012-name-picker-buffet/outcomes/008-add-auto-flag-for-plan-mode.md +77 -0
- package/RAF/012-name-picker-buffet/plans/001-name-picker-for-raf-plan.md +47 -0
- package/RAF/012-name-picker-buffet/plans/002-interactive-project-picker-for-raf-do.md +43 -0
- package/RAF/012-name-picker-buffet/plans/003-raf-status-truncation.md +36 -0
- package/RAF/012-name-picker-buffet/plans/004-failure-reason-details.md +46 -0
- package/RAF/012-name-picker-buffet/plans/005-remove-raf-commits.md +42 -0
- package/RAF/012-name-picker-buffet/plans/006-update-execution-prompt-for-commits.md +47 -0
- package/RAF/012-name-picker-buffet/plans/007-fix-plan-mode-user-prompt.md +55 -0
- package/RAF/012-name-picker-buffet/plans/008-add-auto-flag-for-plan-mode.md +49 -0
- package/RAF/013-dependencies-watchdog/decisions.md +37 -0
- package/RAF/013-dependencies-watchdog/input.md +1 -0
- package/RAF/013-dependencies-watchdog/outcomes/001-define-dependency-syntax.md +56 -0
- package/RAF/013-dependencies-watchdog/outcomes/002-update-planning-prompts.md +60 -0
- package/RAF/013-dependencies-watchdog/outcomes/003-parse-dependencies-update-state.md +81 -0
- package/RAF/013-dependencies-watchdog/outcomes/004-implement-dependency-checking-in-do.md +116 -0
- package/RAF/013-dependencies-watchdog/outcomes/005-update-execution-prompts.md +75 -0
- package/RAF/013-dependencies-watchdog/outcomes/006-add-tests.md +100 -0
- package/RAF/013-dependencies-watchdog/outcomes/007-add-act-alias.md +46 -0
- package/RAF/013-dependencies-watchdog/outcomes/008-add-exit-message.md +52 -0
- package/RAF/013-dependencies-watchdog/plans/001-define-dependency-syntax.md +32 -0
- package/RAF/013-dependencies-watchdog/plans/002-update-planning-prompts.md +38 -0
- package/RAF/013-dependencies-watchdog/plans/003-parse-dependencies-update-state.md +46 -0
- package/RAF/013-dependencies-watchdog/plans/004-implement-dependency-checking-in-do.md +48 -0
- package/RAF/013-dependencies-watchdog/plans/005-update-execution-prompts.md +44 -0
- package/RAF/013-dependencies-watchdog/plans/006-add-tests.md +54 -0
- package/RAF/013-dependencies-watchdog/plans/007-add-act-alias.md +26 -0
- package/RAF/013-dependencies-watchdog/plans/008-add-exit-message.md +31 -0
- package/RAF/014-watchdog/decisions.md +16 -0
- package/RAF/014-watchdog/input.md +2 -0
- package/RAF/014-watchdog/outcomes/001-amend-flag-position.md +50 -0
- package/RAF/014-watchdog/outcomes/002-details-only-on-failure.md +58 -0
- package/RAF/014-watchdog/plans/001-amend-flag-position.md +34 -0
- package/RAF/014-watchdog/plans/002-details-only-on-failure.md +46 -0
- package/RAF/015-name-lottery/decisions.md +14 -0
- package/RAF/015-name-lottery/input.md +3 -0
- package/RAF/015-name-lottery/outcomes/001-auto-pick-project-name.md +31 -0
- package/RAF/015-name-lottery/outcomes/002-mention-plan-files-in-commit.md +23 -0
- package/RAF/015-name-lottery/outcomes/003-fix-input-md-in-amend-flow.md +44 -0
- package/RAF/015-name-lottery/plans/001-auto-pick-project-name.md +38 -0
- package/RAF/015-name-lottery/plans/002-mention-plan-files-in-commit.md +32 -0
- package/RAF/015-name-lottery/plans/003-fix-input-md-in-amend-flow.md +44 -0
- package/README.md +116 -0
- package/dist/commands/do.d.ts +12 -0
- package/dist/commands/do.d.ts.map +1 -0
- package/dist/commands/do.js +684 -0
- package/dist/commands/do.js.map +1 -0
- package/dist/commands/plan.d.ts +3 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +345 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +117 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/core/claude-runner.d.ts +78 -0
- package/dist/core/claude-runner.d.ts.map +1 -0
- package/dist/core/claude-runner.js +297 -0
- package/dist/core/claude-runner.js.map +1 -0
- package/dist/core/editor.d.ts +10 -0
- package/dist/core/editor.d.ts.map +1 -0
- package/dist/core/editor.js +77 -0
- package/dist/core/editor.js.map +1 -0
- package/dist/core/failure-analyzer.d.ts +28 -0
- package/dist/core/failure-analyzer.d.ts.map +1 -0
- package/dist/core/failure-analyzer.js +305 -0
- package/dist/core/failure-analyzer.js.map +1 -0
- package/dist/core/git.d.ts +42 -0
- package/dist/core/git.d.ts.map +1 -0
- package/dist/core/git.js +148 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/project-manager.d.ts +72 -0
- package/dist/core/project-manager.d.ts.map +1 -0
- package/dist/core/project-manager.js +193 -0
- package/dist/core/project-manager.js.map +1 -0
- package/dist/core/retry-handler.d.ts +19 -0
- package/dist/core/retry-handler.d.ts.map +1 -0
- package/dist/core/retry-handler.js +51 -0
- package/dist/core/retry-handler.js.map +1 -0
- package/dist/core/shutdown-handler.d.ts +30 -0
- package/dist/core/shutdown-handler.d.ts.map +1 -0
- package/dist/core/shutdown-handler.js +79 -0
- package/dist/core/shutdown-handler.js.map +1 -0
- package/dist/core/state-derivation.d.ts +82 -0
- package/dist/core/state-derivation.d.ts.map +1 -0
- package/dist/core/state-derivation.js +271 -0
- package/dist/core/state-derivation.js.map +1 -0
- package/dist/core/state-manager.d.ts +54 -0
- package/dist/core/state-manager.d.ts.map +1 -0
- package/dist/core/state-manager.js +198 -0
- package/dist/core/state-manager.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/output-parser.d.ts +19 -0
- package/dist/parsers/output-parser.d.ts.map +1 -0
- package/dist/parsers/output-parser.js +137 -0
- package/dist/parsers/output-parser.js.map +1 -0
- package/dist/prompts/amend.d.ts +20 -0
- package/dist/prompts/amend.d.ts.map +1 -0
- package/dist/prompts/amend.js +166 -0
- package/dist/prompts/amend.js.map +1 -0
- package/dist/prompts/execution.d.ts +30 -0
- package/dist/prompts/execution.d.ts.map +1 -0
- package/dist/prompts/execution.js +179 -0
- package/dist/prompts/execution.js.map +1 -0
- package/dist/prompts/planning.d.ts +15 -0
- package/dist/prompts/planning.d.ts.map +1 -0
- package/dist/prompts/planning.js +163 -0
- package/dist/prompts/planning.js.map +1 -0
- package/dist/types/config.d.ts +26 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +7 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/state.d.ts +33 -0
- package/dist/types/state.d.ts.map +1 -0
- package/dist/types/state.js +28 -0
- package/dist/types/state.js.map +1 -0
- package/dist/ui/name-picker-subprocess.d.ts +11 -0
- package/dist/ui/name-picker-subprocess.d.ts.map +1 -0
- package/dist/ui/name-picker-subprocess.js +83 -0
- package/dist/ui/name-picker-subprocess.js.map +1 -0
- package/dist/ui/name-picker.d.ts +19 -0
- package/dist/ui/name-picker.d.ts.map +1 -0
- package/dist/ui/name-picker.js +173 -0
- package/dist/ui/name-picker.js.map +1 -0
- package/dist/ui/project-picker.d.ts +27 -0
- package/dist/ui/project-picker.d.ts.map +1 -0
- package/dist/ui/project-picker.js +58 -0
- package/dist/ui/project-picker.js.map +1 -0
- package/dist/utils/config.d.ts +24 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +63 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/logger.d.ts +32 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +60 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/name-generator.d.ts +20 -0
- package/dist/utils/name-generator.d.ts.map +1 -0
- package/dist/utils/name-generator.js +183 -0
- package/dist/utils/name-generator.js.map +1 -0
- package/dist/utils/paths.d.ts +132 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +412 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/status-line.d.ts +14 -0
- package/dist/utils/status-line.d.ts.map +1 -0
- package/dist/utils/status-line.js +36 -0
- package/dist/utils/status-line.js.map +1 -0
- package/dist/utils/terminal-symbols.d.ts +50 -0
- package/dist/utils/terminal-symbols.d.ts.map +1 -0
- package/dist/utils/terminal-symbols.js +97 -0
- package/dist/utils/terminal-symbols.js.map +1 -0
- package/dist/utils/timer.d.ts +17 -0
- package/dist/utils/timer.d.ts.map +1 -0
- package/dist/utils/timer.js +56 -0
- package/dist/utils/timer.js.map +1 -0
- package/dist/utils/validation.d.ts +17 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +106 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/version.d.ts +2 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +12 -0
- package/dist/utils/version.js.map +1 -0
- package/jest.config.ts +30 -0
- package/package.json +55 -0
- package/src/commands/do.ts +829 -0
- package/src/commands/plan.ts +422 -0
- package/src/commands/status.ts +146 -0
- package/src/core/claude-runner.ts +374 -0
- package/src/core/editor.ts +85 -0
- package/src/core/failure-analyzer.ts +372 -0
- package/src/core/git.ts +166 -0
- package/src/core/project-manager.ts +243 -0
- package/src/core/retry-handler.ts +72 -0
- package/src/core/shutdown-handler.ts +93 -0
- package/src/core/state-derivation.ts +343 -0
- package/src/index.ts +20 -0
- package/src/parsers/output-parser.ts +164 -0
- package/src/prompts/amend.ts +194 -0
- package/src/prompts/execution.ts +223 -0
- package/src/prompts/planning.ts +175 -0
- package/src/types/config.ts +35 -0
- package/src/ui/name-picker-subprocess.ts +96 -0
- package/src/ui/name-picker.ts +198 -0
- package/src/ui/project-picker.ts +80 -0
- package/src/utils/config.ts +69 -0
- package/src/utils/logger.ts +81 -0
- package/src/utils/name-generator.ts +211 -0
- package/src/utils/paths.ts +497 -0
- package/src/utils/status-line.ts +45 -0
- package/src/utils/terminal-symbols.ts +124 -0
- package/src/utils/timer.ts +64 -0
- package/src/utils/validation.ts +132 -0
- package/src/utils/version.ts +12 -0
- package/tests/unit/claude-runner-interactive.test.ts +343 -0
- package/tests/unit/claude-runner.test.ts +629 -0
- package/tests/unit/command-output.test.ts +295 -0
- package/tests/unit/config.test.ts +72 -0
- package/tests/unit/dependency-integration.test.ts +559 -0
- package/tests/unit/do-blocked-tasks.test.ts +323 -0
- package/tests/unit/do-command.test.ts +198 -0
- package/tests/unit/do-multiproject.test.ts +270 -0
- package/tests/unit/do-rerun.test.ts +270 -0
- package/tests/unit/execution-prompt.test.ts +406 -0
- package/tests/unit/failure-analyzer.test.ts +276 -0
- package/tests/unit/failure-history.test.ts +143 -0
- package/tests/unit/git-stash.test.ts +138 -0
- package/tests/unit/git.test.ts +80 -0
- package/tests/unit/logger.test.ts +132 -0
- package/tests/unit/name-generator.test.ts +283 -0
- package/tests/unit/name-picker.test.ts +179 -0
- package/tests/unit/outcome-content.test.ts +166 -0
- package/tests/unit/output-parser.test.ts +178 -0
- package/tests/unit/paths.test.ts +741 -0
- package/tests/unit/plan-command-amend-flag.test.ts +115 -0
- package/tests/unit/plan-command-amend-input.test.ts +156 -0
- package/tests/unit/plan-command-auto-flag.test.ts +112 -0
- package/tests/unit/plan-command.test.ts +580 -0
- package/tests/unit/planning-prompt.test.ts +137 -0
- package/tests/unit/project-manager.test.ts +265 -0
- package/tests/unit/project-picker.test.ts +338 -0
- package/tests/unit/retry-handler.test.ts +89 -0
- package/tests/unit/state-derivation.test.ts +714 -0
- package/tests/unit/status-command.test.ts +271 -0
- package/tests/unit/status-line.test.ts +92 -0
- package/tests/unit/terminal-symbols.test.ts +214 -0
- package/tests/unit/timer.test.ts +102 -0
- package/tests/unit/validation.test.ts +118 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createPlanCommand } from '../../src/commands/plan.js';
|
|
2
|
+
|
|
3
|
+
describe('Plan Command - Amend Flag Position', () => {
|
|
4
|
+
describe('CLI option parsing', () => {
|
|
5
|
+
it('should accept --amend flag', () => {
|
|
6
|
+
const command = createPlanCommand();
|
|
7
|
+
const options = command.options;
|
|
8
|
+
|
|
9
|
+
const amendOption = options.find(
|
|
10
|
+
(opt) => opt.long === '--amend' || opt.short === '-a'
|
|
11
|
+
);
|
|
12
|
+
expect(amendOption).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should accept -a as shorthand for --amend', () => {
|
|
16
|
+
const command = createPlanCommand();
|
|
17
|
+
const options = command.options;
|
|
18
|
+
|
|
19
|
+
const amendOption = options.find((opt) => opt.short === '-a');
|
|
20
|
+
expect(amendOption).toBeDefined();
|
|
21
|
+
expect(amendOption?.long).toBe('--amend');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('should have description explaining what --amend does', () => {
|
|
25
|
+
const command = createPlanCommand();
|
|
26
|
+
const options = command.options;
|
|
27
|
+
|
|
28
|
+
const amendOption = options.find((opt) => opt.long === '--amend');
|
|
29
|
+
expect(amendOption?.description).toContain('existing project');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should have --amend as boolean flag (no required argument)', () => {
|
|
33
|
+
const command = createPlanCommand();
|
|
34
|
+
const options = command.options;
|
|
35
|
+
|
|
36
|
+
const amendOption = options.find((opt) => opt.long === '--amend');
|
|
37
|
+
// Boolean flags don't have required or optional args
|
|
38
|
+
expect(amendOption?.required).toBeFalsy();
|
|
39
|
+
expect(amendOption?.optional).toBeFalsy();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('positional argument usage', () => {
|
|
44
|
+
it('should have projectName as optional positional argument', () => {
|
|
45
|
+
const command = createPlanCommand();
|
|
46
|
+
// Commander stores arguments in _args array
|
|
47
|
+
const args = command.registeredArguments;
|
|
48
|
+
|
|
49
|
+
expect(args.length).toBeGreaterThanOrEqual(1);
|
|
50
|
+
expect(args[0].name()).toBe('projectName');
|
|
51
|
+
expect(args[0].required).toBe(false); // optional
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should allow positional argument with --amend flag', () => {
|
|
55
|
+
const command = createPlanCommand();
|
|
56
|
+
const options = command.options;
|
|
57
|
+
const args = command.registeredArguments;
|
|
58
|
+
|
|
59
|
+
// Both positional argument and --amend flag should be present
|
|
60
|
+
const amendOption = options.find((opt) => opt.long === '--amend');
|
|
61
|
+
expect(amendOption).toBeDefined();
|
|
62
|
+
expect(args.length).toBeGreaterThanOrEqual(1);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
describe('command syntax variants', () => {
|
|
67
|
+
// These tests verify that both syntaxes are structurally supported
|
|
68
|
+
// Note: Actual command execution is tested in integration tests
|
|
69
|
+
|
|
70
|
+
it('should support "raf plan myproject --amend" syntax structurally', () => {
|
|
71
|
+
const command = createPlanCommand();
|
|
72
|
+
|
|
73
|
+
// Verify both positional arg and boolean flag exist
|
|
74
|
+
const args = command.registeredArguments;
|
|
75
|
+
const options = command.options;
|
|
76
|
+
const amendOption = options.find((opt) => opt.long === '--amend');
|
|
77
|
+
|
|
78
|
+
// Positional argument for project name
|
|
79
|
+
expect(args[0].name()).toBe('projectName');
|
|
80
|
+
// Boolean flag (no required argument)
|
|
81
|
+
expect(amendOption?.required).toBeFalsy();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('should support "raf plan --amend myproject" syntax structurally', () => {
|
|
85
|
+
const command = createPlanCommand();
|
|
86
|
+
|
|
87
|
+
// In Commander.js, --flag <arg> consumes the next argument
|
|
88
|
+
// With boolean flag, positional args are separate
|
|
89
|
+
const args = command.registeredArguments;
|
|
90
|
+
const options = command.options;
|
|
91
|
+
const amendOption = options.find((opt) => opt.long === '--amend');
|
|
92
|
+
|
|
93
|
+
// Boolean flag allows positional arg to be used separately
|
|
94
|
+
expect(amendOption?.required).toBeFalsy();
|
|
95
|
+
expect(amendOption?.optional).toBeFalsy();
|
|
96
|
+
expect(args[0].name()).toBe('projectName');
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('flag type change verification', () => {
|
|
101
|
+
it('should not require an argument value for --amend', () => {
|
|
102
|
+
const command = createPlanCommand();
|
|
103
|
+
const options = command.options;
|
|
104
|
+
const amendOption = options.find((opt) => opt.long === '--amend');
|
|
105
|
+
|
|
106
|
+
// Verify it's a boolean flag, not a value-taking option
|
|
107
|
+
// In Commander.js:
|
|
108
|
+
// - required: true means <value> is required
|
|
109
|
+
// - optional: true means [value] is optional
|
|
110
|
+
// - both false means boolean flag
|
|
111
|
+
expect(amendOption?.required).toBe(false);
|
|
112
|
+
expect(amendOption?.optional).toBe(false);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as os from 'node:os';
|
|
4
|
+
|
|
5
|
+
describe('Plan Command - Amend Input.md Handling', () => {
|
|
6
|
+
let tempDir: string;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'raf-amend-input-test-'));
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe('Input.md append behavior', () => {
|
|
17
|
+
it('should append new content with separator to existing input.md', () => {
|
|
18
|
+
const inputPath = path.join(tempDir, 'input.md');
|
|
19
|
+
const originalContent = 'Original project description.';
|
|
20
|
+
const newContent = 'Add new feature X.';
|
|
21
|
+
|
|
22
|
+
// Simulate existing input.md
|
|
23
|
+
fs.writeFileSync(inputPath, originalContent);
|
|
24
|
+
|
|
25
|
+
// Simulate the append logic from runAmendCommand
|
|
26
|
+
const separator = '\n\n---\n\n';
|
|
27
|
+
const updatedInput = originalContent.trim()
|
|
28
|
+
? `${originalContent.trimEnd()}${separator}${newContent}`
|
|
29
|
+
: newContent;
|
|
30
|
+
fs.writeFileSync(inputPath, updatedInput);
|
|
31
|
+
|
|
32
|
+
// Verify result
|
|
33
|
+
const result = fs.readFileSync(inputPath, 'utf-8');
|
|
34
|
+
expect(result).toContain(originalContent);
|
|
35
|
+
expect(result).toContain('---');
|
|
36
|
+
expect(result).toContain(newContent);
|
|
37
|
+
expect(result).toBe(`${originalContent}${separator}${newContent}`);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should handle empty original input.md', () => {
|
|
41
|
+
const inputPath = path.join(tempDir, 'input.md');
|
|
42
|
+
const newContent = 'Add new feature X.';
|
|
43
|
+
|
|
44
|
+
// Simulate empty input.md
|
|
45
|
+
fs.writeFileSync(inputPath, '');
|
|
46
|
+
|
|
47
|
+
// Simulate the append logic from runAmendCommand
|
|
48
|
+
const originalContent = fs.readFileSync(inputPath, 'utf-8');
|
|
49
|
+
const separator = '\n\n---\n\n';
|
|
50
|
+
const updatedInput = originalContent.trim()
|
|
51
|
+
? `${originalContent.trimEnd()}${separator}${newContent}`
|
|
52
|
+
: newContent;
|
|
53
|
+
fs.writeFileSync(inputPath, updatedInput);
|
|
54
|
+
|
|
55
|
+
// Verify result - no separator when original is empty
|
|
56
|
+
const result = fs.readFileSync(inputPath, 'utf-8');
|
|
57
|
+
expect(result).toBe(newContent);
|
|
58
|
+
expect(result).not.toContain('---');
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should handle non-existent input.md', () => {
|
|
62
|
+
const inputPath = path.join(tempDir, 'input.md');
|
|
63
|
+
const newContent = 'Add new feature X.';
|
|
64
|
+
|
|
65
|
+
// Simulate the logic from runAmendCommand when input.md doesn't exist
|
|
66
|
+
const originalContent = fs.existsSync(inputPath)
|
|
67
|
+
? fs.readFileSync(inputPath, 'utf-8')
|
|
68
|
+
: '';
|
|
69
|
+
const separator = '\n\n---\n\n';
|
|
70
|
+
const updatedInput = originalContent.trim()
|
|
71
|
+
? `${originalContent.trimEnd()}${separator}${newContent}`
|
|
72
|
+
: newContent;
|
|
73
|
+
fs.writeFileSync(inputPath, updatedInput);
|
|
74
|
+
|
|
75
|
+
// Verify result - no separator when original is empty
|
|
76
|
+
const result = fs.readFileSync(inputPath, 'utf-8');
|
|
77
|
+
expect(result).toBe(newContent);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should handle multiple amend operations correctly', () => {
|
|
81
|
+
const inputPath = path.join(tempDir, 'input.md');
|
|
82
|
+
const original = 'First project description.';
|
|
83
|
+
const secondAmend = 'Add feature A.';
|
|
84
|
+
const thirdAmend = 'Add feature B.';
|
|
85
|
+
const separator = '\n\n---\n\n';
|
|
86
|
+
|
|
87
|
+
// First: write original content
|
|
88
|
+
fs.writeFileSync(inputPath, original);
|
|
89
|
+
|
|
90
|
+
// Second amend
|
|
91
|
+
let currentContent = fs.readFileSync(inputPath, 'utf-8');
|
|
92
|
+
let updatedInput = currentContent.trim()
|
|
93
|
+
? `${currentContent.trimEnd()}${separator}${secondAmend}`
|
|
94
|
+
: secondAmend;
|
|
95
|
+
fs.writeFileSync(inputPath, updatedInput);
|
|
96
|
+
|
|
97
|
+
// Third amend
|
|
98
|
+
currentContent = fs.readFileSync(inputPath, 'utf-8');
|
|
99
|
+
updatedInput = currentContent.trim()
|
|
100
|
+
? `${currentContent.trimEnd()}${separator}${thirdAmend}`
|
|
101
|
+
: thirdAmend;
|
|
102
|
+
fs.writeFileSync(inputPath, updatedInput);
|
|
103
|
+
|
|
104
|
+
// Verify result
|
|
105
|
+
const result = fs.readFileSync(inputPath, 'utf-8');
|
|
106
|
+
expect(result).toContain(original);
|
|
107
|
+
expect(result).toContain(secondAmend);
|
|
108
|
+
expect(result).toContain(thirdAmend);
|
|
109
|
+
|
|
110
|
+
// Should have two separators
|
|
111
|
+
const separatorCount = (result.match(/---/g) || []).length;
|
|
112
|
+
expect(separatorCount).toBe(2);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('should preserve trailing whitespace correctly in original content', () => {
|
|
116
|
+
const inputPath = path.join(tempDir, 'input.md');
|
|
117
|
+
const originalWithWhitespace = 'Original content.\n\n\n';
|
|
118
|
+
const newContent = 'New content.';
|
|
119
|
+
const separator = '\n\n---\n\n';
|
|
120
|
+
|
|
121
|
+
fs.writeFileSync(inputPath, originalWithWhitespace);
|
|
122
|
+
|
|
123
|
+
// Simulate the append logic (trims end of original)
|
|
124
|
+
const originalContent = fs.readFileSync(inputPath, 'utf-8');
|
|
125
|
+
const updatedInput = originalContent.trim()
|
|
126
|
+
? `${originalContent.trimEnd()}${separator}${newContent}`
|
|
127
|
+
: newContent;
|
|
128
|
+
fs.writeFileSync(inputPath, updatedInput);
|
|
129
|
+
|
|
130
|
+
// Verify - trailing whitespace should be trimmed
|
|
131
|
+
const result = fs.readFileSync(inputPath, 'utf-8');
|
|
132
|
+
expect(result).toBe(`Original content.${separator}${newContent}`);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('should handle content with only whitespace', () => {
|
|
136
|
+
const inputPath = path.join(tempDir, 'input.md');
|
|
137
|
+
const whitespaceOnly = ' \n\n ';
|
|
138
|
+
const newContent = 'New content.';
|
|
139
|
+
const separator = '\n\n---\n\n';
|
|
140
|
+
|
|
141
|
+
fs.writeFileSync(inputPath, whitespaceOnly);
|
|
142
|
+
|
|
143
|
+
// Simulate the append logic
|
|
144
|
+
const originalContent = fs.readFileSync(inputPath, 'utf-8');
|
|
145
|
+
const updatedInput = originalContent.trim()
|
|
146
|
+
? `${originalContent.trimEnd()}${separator}${newContent}`
|
|
147
|
+
: newContent;
|
|
148
|
+
fs.writeFileSync(inputPath, updatedInput);
|
|
149
|
+
|
|
150
|
+
// Verify - whitespace-only content treated as empty
|
|
151
|
+
const result = fs.readFileSync(inputPath, 'utf-8');
|
|
152
|
+
expect(result).toBe(newContent);
|
|
153
|
+
expect(result).not.toContain('---');
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { createPlanCommand } from '../../src/commands/plan.js';
|
|
2
|
+
|
|
3
|
+
describe('Plan Command - Auto Flag', () => {
|
|
4
|
+
describe('CLI option parsing', () => {
|
|
5
|
+
it('should accept --auto flag', () => {
|
|
6
|
+
const command = createPlanCommand();
|
|
7
|
+
const options = command.options;
|
|
8
|
+
|
|
9
|
+
const autoOption = options.find(
|
|
10
|
+
(opt) => opt.long === '--auto' || opt.short === '-y'
|
|
11
|
+
);
|
|
12
|
+
expect(autoOption).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should accept -y as shorthand for --auto', () => {
|
|
16
|
+
const command = createPlanCommand();
|
|
17
|
+
const options = command.options;
|
|
18
|
+
|
|
19
|
+
const autoOption = options.find((opt) => opt.short === '-y');
|
|
20
|
+
expect(autoOption).toBeDefined();
|
|
21
|
+
expect(autoOption?.long).toBe('--auto');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('should have description explaining what --auto does', () => {
|
|
25
|
+
const command = createPlanCommand();
|
|
26
|
+
const options = command.options;
|
|
27
|
+
|
|
28
|
+
const autoOption = options.find((opt) => opt.long === '--auto');
|
|
29
|
+
expect(autoOption?.description).toContain('permission');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should have --auto as boolean flag (no required argument)', () => {
|
|
33
|
+
const command = createPlanCommand();
|
|
34
|
+
const options = command.options;
|
|
35
|
+
|
|
36
|
+
const autoOption = options.find((opt) => opt.long === '--auto');
|
|
37
|
+
// Boolean flags don't have required or optional args
|
|
38
|
+
expect(autoOption?.required).toBeFalsy();
|
|
39
|
+
expect(autoOption?.optional).toBeFalsy();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('command options coexistence', () => {
|
|
44
|
+
it('should allow --auto with --amend', () => {
|
|
45
|
+
const command = createPlanCommand();
|
|
46
|
+
const options = command.options;
|
|
47
|
+
|
|
48
|
+
const autoOption = options.find((opt) => opt.long === '--auto');
|
|
49
|
+
const amendOption = options.find((opt) => opt.long === '--amend');
|
|
50
|
+
|
|
51
|
+
expect(autoOption).toBeDefined();
|
|
52
|
+
expect(amendOption).toBeDefined();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should allow --auto with --model', () => {
|
|
56
|
+
const command = createPlanCommand();
|
|
57
|
+
const options = command.options;
|
|
58
|
+
|
|
59
|
+
const autoOption = options.find((opt) => opt.long === '--auto');
|
|
60
|
+
const modelOption = options.find((opt) => opt.long === '--model');
|
|
61
|
+
|
|
62
|
+
expect(autoOption).toBeDefined();
|
|
63
|
+
expect(modelOption).toBeDefined();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should allow --auto with --sonnet', () => {
|
|
67
|
+
const command = createPlanCommand();
|
|
68
|
+
const options = command.options;
|
|
69
|
+
|
|
70
|
+
const autoOption = options.find((opt) => opt.long === '--auto');
|
|
71
|
+
const sonnetOption = options.find((opt) => opt.long === '--sonnet');
|
|
72
|
+
|
|
73
|
+
expect(autoOption).toBeDefined();
|
|
74
|
+
expect(sonnetOption).toBeDefined();
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe('auto-name selection behavior', () => {
|
|
79
|
+
it('should have behavior where first name is auto-selected in auto mode', () => {
|
|
80
|
+
// This test documents the expected behavior:
|
|
81
|
+
// When autoMode is true and no projectName is provided,
|
|
82
|
+
// the first name from generateProjectNames() should be used
|
|
83
|
+
// without calling pickProjectName()
|
|
84
|
+
|
|
85
|
+
// The actual behavior is tested implicitly by the implementation:
|
|
86
|
+
// - generateProjectNames() returns ['first-name', 'second-name', 'third-name']
|
|
87
|
+
// - In auto mode: finalProjectName = suggestedNames[0] // 'first-name'
|
|
88
|
+
// - In normal mode: finalProjectName = await pickProjectName(suggestedNames)
|
|
89
|
+
|
|
90
|
+
// This test validates the command structure supports this flow
|
|
91
|
+
const command = createPlanCommand();
|
|
92
|
+
const autoOption = command.options.find((opt) => opt.long === '--auto');
|
|
93
|
+
|
|
94
|
+
expect(autoOption).toBeDefined();
|
|
95
|
+
expect(autoOption?.short).toBe('-y');
|
|
96
|
+
// The argument is optional (user can omit project name for auto-selection)
|
|
97
|
+
const args = command.registeredArguments;
|
|
98
|
+
expect(args).toHaveLength(1);
|
|
99
|
+
expect(args[0].required).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('should support projectName argument as optional', () => {
|
|
103
|
+
const command = createPlanCommand();
|
|
104
|
+
|
|
105
|
+
// The first argument is the optional projectName
|
|
106
|
+
const args = command.registeredArguments;
|
|
107
|
+
expect(args).toHaveLength(1);
|
|
108
|
+
expect(args[0].name()).toBe('projectName');
|
|
109
|
+
expect(args[0].required).toBe(false);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
});
|