takt 0.1.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/LICENSE +21 -0
- package/README.md +307 -0
- package/bin/takt +27 -0
- package/dist/agents/index.d.ts +5 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/runner.d.ts +26 -0
- package/dist/agents/runner.d.ts.map +1 -0
- package/dist/agents/runner.js +144 -0
- package/dist/agents/runner.js.map +1 -0
- package/dist/claude/client.d.ts +43 -0
- package/dist/claude/client.d.ts.map +1 -0
- package/dist/claude/client.js +143 -0
- package/dist/claude/client.js.map +1 -0
- package/dist/claude/executor.d.ts +29 -0
- package/dist/claude/executor.d.ts.map +1 -0
- package/dist/claude/executor.js +169 -0
- package/dist/claude/executor.js.map +1 -0
- package/dist/claude/index.d.ts +14 -0
- package/dist/claude/index.d.ts.map +1 -0
- package/dist/claude/index.js +18 -0
- package/dist/claude/index.js.map +1 -0
- package/dist/claude/options-builder.d.ts +40 -0
- package/dist/claude/options-builder.d.ts.map +1 -0
- package/dist/claude/options-builder.js +90 -0
- package/dist/claude/options-builder.js.map +1 -0
- package/dist/claude/process.d.ts +57 -0
- package/dist/claude/process.d.ts.map +1 -0
- package/dist/claude/process.js +57 -0
- package/dist/claude/process.js.map +1 -0
- package/dist/claude/query-manager.d.ts +35 -0
- package/dist/claude/query-manager.d.ts.map +1 -0
- package/dist/claude/query-manager.js +74 -0
- package/dist/claude/query-manager.js.map +1 -0
- package/dist/claude/stream-converter.d.ts +19 -0
- package/dist/claude/stream-converter.d.ts.map +1 -0
- package/dist/claude/stream-converter.js +166 -0
- package/dist/claude/stream-converter.js.map +1 -0
- package/dist/claude/types.d.ts +99 -0
- package/dist/claude/types.d.ts.map +1 -0
- package/dist/claude/types.js +8 -0
- package/dist/claude/types.js.map +1 -0
- package/dist/cli/agentExecution.d.ts +16 -0
- package/dist/cli/agentExecution.d.ts.map +1 -0
- package/dist/cli/agentExecution.js +40 -0
- package/dist/cli/agentExecution.js.map +1 -0
- package/dist/cli/help.d.ts +8 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +46 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +8 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/taskBatch.d.ts +8 -0
- package/dist/cli/taskBatch.d.ts.map +1 -0
- package/dist/cli/taskBatch.js +69 -0
- package/dist/cli/taskBatch.js.map +1 -0
- package/dist/cli/workflowExecution.d.ts +18 -0
- package/dist/cli/workflowExecution.d.ts.map +1 -0
- package/dist/cli/workflowExecution.js +112 -0
- package/dist/cli/workflowExecution.js.map +1 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +122 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/agentExecution.d.ts +8 -0
- package/dist/commands/agentExecution.d.ts.map +1 -0
- package/dist/commands/agentExecution.js +44 -0
- package/dist/commands/agentExecution.js.map +1 -0
- package/dist/commands/help.d.ts +8 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +39 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +9 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/session.d.ts +10 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +18 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/taskExecution.d.ts +20 -0
- package/dist/commands/taskExecution.d.ts.map +1 -0
- package/dist/commands/taskExecution.js +103 -0
- package/dist/commands/taskExecution.js.map +1 -0
- package/dist/commands/workflow.d.ts +9 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +51 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/commands/workflowExecution.d.ts +21 -0
- package/dist/commands/workflowExecution.d.ts.map +1 -0
- package/dist/commands/workflowExecution.js +95 -0
- package/dist/commands/workflowExecution.js.map +1 -0
- package/dist/config/agentLoader.d.ts +25 -0
- package/dist/config/agentLoader.d.ts.map +1 -0
- package/dist/config/agentLoader.js +96 -0
- package/dist/config/agentLoader.js.map +1 -0
- package/dist/config/globalConfig.d.ts +23 -0
- package/dist/config/globalConfig.d.ts.map +1 -0
- package/dist/config/globalConfig.js +117 -0
- package/dist/config/globalConfig.js.map +1 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/initialization.d.ts +23 -0
- package/dist/config/initialization.d.ts.map +1 -0
- package/dist/config/initialization.js +55 -0
- package/dist/config/initialization.js.map +1 -0
- package/dist/config/loader.d.ts +9 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +12 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/paths.d.ts +33 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +66 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/projectConfig.d.ts +41 -0
- package/dist/config/projectConfig.d.ts.map +1 -0
- package/dist/config/projectConfig.js +85 -0
- package/dist/config/projectConfig.js.map +1 -0
- package/dist/config/sessionStore.d.ts +44 -0
- package/dist/config/sessionStore.d.ts.map +1 -0
- package/dist/config/sessionStore.js +194 -0
- package/dist/config/sessionStore.js.map +1 -0
- package/dist/config/workflowLoader.d.ts +23 -0
- package/dist/config/workflowLoader.d.ts.map +1 -0
- package/dist/config/workflowLoader.js +142 -0
- package/dist/config/workflowLoader.js.map +1 -0
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive/commands/agent.d.ts +7 -0
- package/dist/interactive/commands/agent.d.ts.map +1 -0
- package/dist/interactive/commands/agent.js +65 -0
- package/dist/interactive/commands/agent.js.map +1 -0
- package/dist/interactive/commands/basic.d.ts +7 -0
- package/dist/interactive/commands/basic.d.ts.map +1 -0
- package/dist/interactive/commands/basic.js +81 -0
- package/dist/interactive/commands/basic.js.map +1 -0
- package/dist/interactive/commands/index.d.ts +12 -0
- package/dist/interactive/commands/index.d.ts.map +1 -0
- package/dist/interactive/commands/index.js +14 -0
- package/dist/interactive/commands/index.js.map +1 -0
- package/dist/interactive/commands/registry.d.ts +41 -0
- package/dist/interactive/commands/registry.d.ts.map +1 -0
- package/dist/interactive/commands/registry.js +37 -0
- package/dist/interactive/commands/registry.js.map +1 -0
- package/dist/interactive/commands/session.d.ts +7 -0
- package/dist/interactive/commands/session.d.ts.map +1 -0
- package/dist/interactive/commands/session.js +75 -0
- package/dist/interactive/commands/session.js.map +1 -0
- package/dist/interactive/commands/task.d.ts +7 -0
- package/dist/interactive/commands/task.d.ts.map +1 -0
- package/dist/interactive/commands/task.js +156 -0
- package/dist/interactive/commands/task.js.map +1 -0
- package/dist/interactive/commands/workflow.d.ts +7 -0
- package/dist/interactive/commands/workflow.d.ts.map +1 -0
- package/dist/interactive/commands/workflow.js +56 -0
- package/dist/interactive/commands/workflow.js.map +1 -0
- package/dist/interactive/escape-tracker.d.ts +37 -0
- package/dist/interactive/escape-tracker.d.ts.map +1 -0
- package/dist/interactive/escape-tracker.js +52 -0
- package/dist/interactive/escape-tracker.js.map +1 -0
- package/dist/interactive/handlers.d.ts +24 -0
- package/dist/interactive/handlers.d.ts.map +1 -0
- package/dist/interactive/handlers.js +191 -0
- package/dist/interactive/handlers.js.map +1 -0
- package/dist/interactive/history-manager.d.ts +45 -0
- package/dist/interactive/history-manager.d.ts.map +1 -0
- package/dist/interactive/history-manager.js +91 -0
- package/dist/interactive/history-manager.js.map +1 -0
- package/dist/interactive/index.d.ts +8 -0
- package/dist/interactive/index.d.ts.map +1 -0
- package/dist/interactive/index.js +8 -0
- package/dist/interactive/index.js.map +1 -0
- package/dist/interactive/ink/components/App.d.ts +16 -0
- package/dist/interactive/ink/components/App.d.ts.map +1 -0
- package/dist/interactive/ink/components/App.js +123 -0
- package/dist/interactive/ink/components/App.js.map +1 -0
- package/dist/interactive/ink/components/AskUserQuestion.d.ts +16 -0
- package/dist/interactive/ink/components/AskUserQuestion.d.ts.map +1 -0
- package/dist/interactive/ink/components/AskUserQuestion.js +139 -0
- package/dist/interactive/ink/components/AskUserQuestion.js.map +1 -0
- package/dist/interactive/ink/components/Header.d.ts +20 -0
- package/dist/interactive/ink/components/Header.d.ts.map +1 -0
- package/dist/interactive/ink/components/Header.js +7 -0
- package/dist/interactive/ink/components/Header.js.map +1 -0
- package/dist/interactive/ink/components/HelpView.d.ts +13 -0
- package/dist/interactive/ink/components/HelpView.d.ts.map +1 -0
- package/dist/interactive/ink/components/HelpView.js +45 -0
- package/dist/interactive/ink/components/HelpView.js.map +1 -0
- package/dist/interactive/ink/components/IterationLimit.d.ts +19 -0
- package/dist/interactive/ink/components/IterationLimit.d.ts.map +1 -0
- package/dist/interactive/ink/components/IterationLimit.js +59 -0
- package/dist/interactive/ink/components/IterationLimit.js.map +1 -0
- package/dist/interactive/ink/components/ModalRouter.d.ts +11 -0
- package/dist/interactive/ink/components/ModalRouter.d.ts.map +1 -0
- package/dist/interactive/ink/components/ModalRouter.js +71 -0
- package/dist/interactive/ink/components/ModalRouter.js.map +1 -0
- package/dist/interactive/ink/components/PermissionPrompt.d.ts +17 -0
- package/dist/interactive/ink/components/PermissionPrompt.d.ts.map +1 -0
- package/dist/interactive/ink/components/PermissionPrompt.js +102 -0
- package/dist/interactive/ink/components/PermissionPrompt.js.map +1 -0
- package/dist/interactive/ink/components/PromptInput.d.ts +26 -0
- package/dist/interactive/ink/components/PromptInput.d.ts.map +1 -0
- package/dist/interactive/ink/components/PromptInput.js +70 -0
- package/dist/interactive/ink/components/PromptInput.js.map +1 -0
- package/dist/interactive/ink/components/Spinner.d.ts +14 -0
- package/dist/interactive/ink/components/Spinner.d.ts.map +1 -0
- package/dist/interactive/ink/components/Spinner.js +8 -0
- package/dist/interactive/ink/components/Spinner.js.map +1 -0
- package/dist/interactive/ink/components/StreamingOutput.d.ts +25 -0
- package/dist/interactive/ink/components/StreamingOutput.d.ts.map +1 -0
- package/dist/interactive/ink/components/StreamingOutput.js +8 -0
- package/dist/interactive/ink/components/StreamingOutput.js.map +1 -0
- package/dist/interactive/ink/components/UserInputPrompt.d.ts +18 -0
- package/dist/interactive/ink/components/UserInputPrompt.d.ts.map +1 -0
- package/dist/interactive/ink/components/UserInputPrompt.js +30 -0
- package/dist/interactive/ink/components/UserInputPrompt.js.map +1 -0
- package/dist/interactive/ink/components/WorkflowSelector.d.ts +18 -0
- package/dist/interactive/ink/components/WorkflowSelector.d.ts.map +1 -0
- package/dist/interactive/ink/components/WorkflowSelector.js +65 -0
- package/dist/interactive/ink/components/WorkflowSelector.js.map +1 -0
- package/dist/interactive/ink/constants.d.ts +8 -0
- package/dist/interactive/ink/constants.d.ts.map +1 -0
- package/dist/interactive/ink/constants.js +8 -0
- package/dist/interactive/ink/constants.js.map +1 -0
- package/dist/interactive/ink/context/AppContext.d.ts +26 -0
- package/dist/interactive/ink/context/AppContext.d.ts.map +1 -0
- package/dist/interactive/ink/context/AppContext.js +30 -0
- package/dist/interactive/ink/context/AppContext.js.map +1 -0
- package/dist/interactive/ink/context/appReducer.d.ts +13 -0
- package/dist/interactive/ink/context/appReducer.d.ts.map +1 -0
- package/dist/interactive/ink/context/appReducer.js +183 -0
- package/dist/interactive/ink/context/appReducer.js.map +1 -0
- package/dist/interactive/ink/context/types.d.ts +144 -0
- package/dist/interactive/ink/context/types.d.ts.map +1 -0
- package/dist/interactive/ink/context/types.js +5 -0
- package/dist/interactive/ink/context/types.js.map +1 -0
- package/dist/interactive/ink/hooks/keyDetection.d.ts +116 -0
- package/dist/interactive/ink/hooks/keyDetection.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/keyDetection.js +183 -0
- package/dist/interactive/ink/hooks/keyDetection.js.map +1 -0
- package/dist/interactive/ink/hooks/multilineInputLogic.d.ts +50 -0
- package/dist/interactive/ink/hooks/multilineInputLogic.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/multilineInputLogic.js +150 -0
- package/dist/interactive/ink/hooks/multilineInputLogic.js.map +1 -0
- package/dist/interactive/ink/hooks/useCommands.d.ts +20 -0
- package/dist/interactive/ink/hooks/useCommands.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useCommands.js +129 -0
- package/dist/interactive/ink/hooks/useCommands.js.map +1 -0
- package/dist/interactive/ink/hooks/useHistory.d.ts +28 -0
- package/dist/interactive/ink/hooks/useHistory.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useHistory.js +59 -0
- package/dist/interactive/ink/hooks/useHistory.js.map +1 -0
- package/dist/interactive/ink/hooks/useMultilineInput.d.ts +49 -0
- package/dist/interactive/ink/hooks/useMultilineInput.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useMultilineInput.js +106 -0
- package/dist/interactive/ink/hooks/useMultilineInput.js.map +1 -0
- package/dist/interactive/ink/hooks/usePermissionHandlers.d.ts +16 -0
- package/dist/interactive/ink/hooks/usePermissionHandlers.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/usePermissionHandlers.js +172 -0
- package/dist/interactive/ink/hooks/usePermissionHandlers.js.map +1 -0
- package/dist/interactive/ink/hooks/useRawKeypress.d.ts +41 -0
- package/dist/interactive/ink/hooks/useRawKeypress.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useRawKeypress.js +79 -0
- package/dist/interactive/ink/hooks/useRawKeypress.js.map +1 -0
- package/dist/interactive/ink/hooks/useTaskQueue.d.ts +32 -0
- package/dist/interactive/ink/hooks/useTaskQueue.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useTaskQueue.js +68 -0
- package/dist/interactive/ink/hooks/useTaskQueue.js.map +1 -0
- package/dist/interactive/ink/hooks/useWorkflow.d.ts +45 -0
- package/dist/interactive/ink/hooks/useWorkflow.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useWorkflow.js +93 -0
- package/dist/interactive/ink/hooks/useWorkflow.js.map +1 -0
- package/dist/interactive/ink/hooks/useWorkflowExecution.d.ts +14 -0
- package/dist/interactive/ink/hooks/useWorkflowExecution.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useWorkflowExecution.js +144 -0
- package/dist/interactive/ink/hooks/useWorkflowExecution.js.map +1 -0
- package/dist/interactive/ink/index.d.ts +30 -0
- package/dist/interactive/ink/index.d.ts.map +1 -0
- package/dist/interactive/ink/index.js +33 -0
- package/dist/interactive/ink/index.js.map +1 -0
- package/dist/interactive/ink/utils/workflow.d.ts +11 -0
- package/dist/interactive/ink/utils/workflow.d.ts.map +1 -0
- package/dist/interactive/ink/utils/workflow.js +19 -0
- package/dist/interactive/ink/utils/workflow.js.map +1 -0
- package/dist/interactive/input-buffer.d.ts +67 -0
- package/dist/interactive/input-buffer.d.ts.map +1 -0
- package/dist/interactive/input-buffer.js +162 -0
- package/dist/interactive/input-buffer.js.map +1 -0
- package/dist/interactive/input-handlers.d.ts +50 -0
- package/dist/interactive/input-handlers.d.ts.map +1 -0
- package/dist/interactive/input-handlers.js +170 -0
- package/dist/interactive/input-handlers.js.map +1 -0
- package/dist/interactive/input.d.ts +43 -0
- package/dist/interactive/input.d.ts.map +1 -0
- package/dist/interactive/input.js +74 -0
- package/dist/interactive/input.js.map +1 -0
- package/dist/interactive/keyDetection.d.ts +85 -0
- package/dist/interactive/keyDetection.d.ts.map +1 -0
- package/dist/interactive/keyDetection.js +167 -0
- package/dist/interactive/keyDetection.js.map +1 -0
- package/dist/interactive/multilineInputLogic.d.ts +30 -0
- package/dist/interactive/multilineInputLogic.d.ts.map +1 -0
- package/dist/interactive/multilineInputLogic.js +143 -0
- package/dist/interactive/multilineInputLogic.js.map +1 -0
- package/dist/interactive/passthrough.d.ts +30 -0
- package/dist/interactive/passthrough.d.ts.map +1 -0
- package/dist/interactive/passthrough.js +94 -0
- package/dist/interactive/passthrough.js.map +1 -0
- package/dist/interactive/permission.d.ts +33 -0
- package/dist/interactive/permission.d.ts.map +1 -0
- package/dist/interactive/permission.js +231 -0
- package/dist/interactive/permission.js.map +1 -0
- package/dist/interactive/prompt.d.ts +33 -0
- package/dist/interactive/prompt.d.ts.map +1 -0
- package/dist/interactive/prompt.js +132 -0
- package/dist/interactive/prompt.js.map +1 -0
- package/dist/interactive/repl.d.ts +13 -0
- package/dist/interactive/repl.d.ts.map +1 -0
- package/dist/interactive/repl.js +202 -0
- package/dist/interactive/repl.js.map +1 -0
- package/dist/interactive/types.d.ts +35 -0
- package/dist/interactive/types.d.ts.map +1 -0
- package/dist/interactive/types.js +5 -0
- package/dist/interactive/types.js.map +1 -0
- package/dist/interactive/ui.d.ts +16 -0
- package/dist/interactive/ui.d.ts.map +1 -0
- package/dist/interactive/ui.js +122 -0
- package/dist/interactive/ui.js.map +1 -0
- package/dist/interactive/user-input.d.ts +26 -0
- package/dist/interactive/user-input.d.ts.map +1 -0
- package/dist/interactive/user-input.js +115 -0
- package/dist/interactive/user-input.js.map +1 -0
- package/dist/interactive/workflow-executor.d.ts +20 -0
- package/dist/interactive/workflow-executor.d.ts.map +1 -0
- package/dist/interactive/workflow-executor.js +200 -0
- package/dist/interactive/workflow-executor.js.map +1 -0
- package/dist/models/agent.d.ts +37 -0
- package/dist/models/agent.d.ts.map +1 -0
- package/dist/models/agent.js +11 -0
- package/dist/models/agent.js.map +1 -0
- package/dist/models/config.d.ts +19 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/models/config.js +25 -0
- package/dist/models/config.js.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +11 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/schemas.d.ts +161 -0
- package/dist/models/schemas.d.ts.map +1 -0
- package/dist/models/schemas.js +137 -0
- package/dist/models/schemas.js.map +1 -0
- package/dist/models/session.d.ts +50 -0
- package/dist/models/session.d.ts.map +1 -0
- package/dist/models/session.js +45 -0
- package/dist/models/session.js.map +1 -0
- package/dist/models/types.d.ts +117 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/models/types.js +5 -0
- package/dist/models/types.js.map +1 -0
- package/dist/models/workflow.d.ts +58 -0
- package/dist/models/workflow.d.ts.map +1 -0
- package/dist/models/workflow.js +19 -0
- package/dist/models/workflow.js.map +1 -0
- package/dist/resources/index.d.ts +38 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +108 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/task/display.d.ts +11 -0
- package/dist/task/display.d.ts.map +1 -0
- package/dist/task/display.js +41 -0
- package/dist/task/display.js.map +1 -0
- package/dist/task/index.d.ts +6 -0
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task/index.js +6 -0
- package/dist/task/index.js.map +1 -0
- package/dist/task/runner.d.ts +68 -0
- package/dist/task/runner.d.ts.map +1 -0
- package/dist/task/runner.js +172 -0
- package/dist/task/runner.js.map +1 -0
- package/dist/utils/debug.d.ts +32 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/debug.js +135 -0
- package/dist/utils/debug.js.map +1 -0
- package/dist/utils/error.d.ts +8 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +10 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/notification.d.ts +63 -0
- package/dist/utils/notification.d.ts.map +1 -0
- package/dist/utils/notification.js +170 -0
- package/dist/utils/notification.js.map +1 -0
- package/dist/utils/session.d.ts +38 -0
- package/dist/utils/session.d.ts.map +1 -0
- package/dist/utils/session.js +97 -0
- package/dist/utils/session.js.map +1 -0
- package/dist/utils/ui.d.ts +91 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/ui.js +330 -0
- package/dist/utils/ui.js.map +1 -0
- package/dist/workflow/blocked-handler.d.ts +27 -0
- package/dist/workflow/blocked-handler.d.ts.map +1 -0
- package/dist/workflow/blocked-handler.js +40 -0
- package/dist/workflow/blocked-handler.js.map +1 -0
- package/dist/workflow/constants.d.ts +20 -0
- package/dist/workflow/constants.d.ts.map +1 -0
- package/dist/workflow/constants.js +20 -0
- package/dist/workflow/constants.js.map +1 -0
- package/dist/workflow/engine.d.ts +42 -0
- package/dist/workflow/engine.d.ts.map +1 -0
- package/dist/workflow/engine.js +207 -0
- package/dist/workflow/engine.js.map +1 -0
- package/dist/workflow/index.d.ts +15 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +21 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/instruction-builder.d.ts +37 -0
- package/dist/workflow/instruction-builder.d.ts.map +1 -0
- package/dist/workflow/instruction-builder.js +49 -0
- package/dist/workflow/instruction-builder.js.map +1 -0
- package/dist/workflow/loop-detector.d.ts +31 -0
- package/dist/workflow/loop-detector.d.ts.map +1 -0
- package/dist/workflow/loop-detector.js +61 -0
- package/dist/workflow/loop-detector.js.map +1 -0
- package/dist/workflow/state-manager.d.ts +25 -0
- package/dist/workflow/state-manager.d.ts.map +1 -0
- package/dist/workflow/state-manager.js +59 -0
- package/dist/workflow/state-manager.js.map +1 -0
- package/dist/workflow/transitions.d.ts +25 -0
- package/dist/workflow/transitions.d.ts.map +1 -0
- package/dist/workflow/transitions.js +106 -0
- package/dist/workflow/transitions.js.map +1 -0
- package/dist/workflow/types.d.ts +74 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +8 -0
- package/dist/workflow/types.js.map +1 -0
- package/package.json +67 -0
- package/resources/global/en/agents/default/architect.md +292 -0
- package/resources/global/en/agents/default/coder.md +169 -0
- package/resources/global/en/agents/default/security.md +206 -0
- package/resources/global/en/agents/default/supervisor.md +153 -0
- package/resources/global/en/agents/magi/balthasar.md +75 -0
- package/resources/global/en/agents/magi/casper.md +100 -0
- package/resources/global/en/agents/magi/melchior.md +74 -0
- package/resources/global/en/agents/research/digger.md +134 -0
- package/resources/global/en/agents/research/planner.md +125 -0
- package/resources/global/en/agents/research/supervisor.md +86 -0
- package/resources/global/en/config.yaml +19 -0
- package/resources/global/en/workflows/default.yaml +177 -0
- package/resources/global/en/workflows/magi.yaml +96 -0
- package/resources/global/en/workflows/research.yaml +112 -0
- package/resources/global/ja/agents/default/architect.md +292 -0
- package/resources/global/ja/agents/default/coder.md +170 -0
- package/resources/global/ja/agents/default/security.md +206 -0
- package/resources/global/ja/agents/default/supervisor.md +153 -0
- package/resources/global/ja/agents/magi/balthasar.md +75 -0
- package/resources/global/ja/agents/magi/casper.md +100 -0
- package/resources/global/ja/agents/magi/melchior.md +74 -0
- package/resources/global/ja/agents/research/digger.md +134 -0
- package/resources/global/ja/agents/research/planner.md +125 -0
- package/resources/global/ja/agents/research/supervisor.md +86 -0
- package/resources/global/ja/config.yaml +19 -0
- package/resources/global/ja/workflows/default.yaml +177 -0
- package/resources/global/ja/workflows/magi.yaml +96 -0
- package/resources/global/ja/workflows/research.yaml +112 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow state transition logic
|
|
3
|
+
*
|
|
4
|
+
* Handles determining the next step based on agent response status
|
|
5
|
+
* and transition conditions defined in the workflow configuration.
|
|
6
|
+
*/
|
|
7
|
+
import { COMPLETE_STEP, ABORT_STEP } from './constants.js';
|
|
8
|
+
/**
|
|
9
|
+
* Check if status matches transition condition.
|
|
10
|
+
*/
|
|
11
|
+
export function matchesCondition(status, condition) {
|
|
12
|
+
if (condition === 'always') {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
// Map status to condition
|
|
16
|
+
const statusConditionMap = {
|
|
17
|
+
done: ['done'],
|
|
18
|
+
blocked: ['blocked'],
|
|
19
|
+
approved: ['approved'],
|
|
20
|
+
rejected: ['rejected'],
|
|
21
|
+
pending: [],
|
|
22
|
+
in_progress: [],
|
|
23
|
+
cancelled: [],
|
|
24
|
+
interrupted: [], // Interrupted is handled separately
|
|
25
|
+
};
|
|
26
|
+
const matchingConditions = statusConditionMap[status] || [];
|
|
27
|
+
return matchingConditions.includes(condition);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Handle case when no status marker is found in agent output.
|
|
31
|
+
*/
|
|
32
|
+
export function handleNoStatus(step, config) {
|
|
33
|
+
const behavior = step.onNoStatus || 'complete';
|
|
34
|
+
switch (behavior) {
|
|
35
|
+
case 'stay':
|
|
36
|
+
// Stay on current step (original behavior, may cause loops)
|
|
37
|
+
return step.name;
|
|
38
|
+
case 'continue': {
|
|
39
|
+
// Try to find done/always transition, otherwise find next step in workflow
|
|
40
|
+
for (const transition of step.transitions) {
|
|
41
|
+
if (transition.condition === 'done' || transition.condition === 'always') {
|
|
42
|
+
return transition.nextStep;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Find next step in workflow order
|
|
46
|
+
const stepIndex = config.steps.findIndex(s => s.name === step.name);
|
|
47
|
+
const nextStep = config.steps[stepIndex + 1];
|
|
48
|
+
if (stepIndex >= 0 && nextStep) {
|
|
49
|
+
return nextStep.name;
|
|
50
|
+
}
|
|
51
|
+
return COMPLETE_STEP;
|
|
52
|
+
}
|
|
53
|
+
case 'complete':
|
|
54
|
+
default:
|
|
55
|
+
// Try to find done/always transition, otherwise complete workflow
|
|
56
|
+
for (const transition of step.transitions) {
|
|
57
|
+
if (transition.condition === 'done' || transition.condition === 'always') {
|
|
58
|
+
return transition.nextStep;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return COMPLETE_STEP;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Determine next step based on current status.
|
|
66
|
+
*/
|
|
67
|
+
export function determineNextStep(step, status, config) {
|
|
68
|
+
// If interrupted, abort immediately
|
|
69
|
+
if (status === 'interrupted') {
|
|
70
|
+
return ABORT_STEP;
|
|
71
|
+
}
|
|
72
|
+
// Check transitions in order
|
|
73
|
+
for (const transition of step.transitions) {
|
|
74
|
+
if (matchesCondition(status, transition.condition)) {
|
|
75
|
+
return transition.nextStep;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// If status is 'in_progress' (no status marker found), use onNoStatus behavior
|
|
79
|
+
if (status === 'in_progress') {
|
|
80
|
+
return handleNoStatus(step, config);
|
|
81
|
+
}
|
|
82
|
+
// Unexpected status - treat as done and complete
|
|
83
|
+
return COMPLETE_STEP;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Extract user-facing prompt from blocked response.
|
|
87
|
+
* Looks for common patterns like "必要な情報:", "質問:", etc.
|
|
88
|
+
*/
|
|
89
|
+
export function extractBlockedPrompt(content) {
|
|
90
|
+
// Try to extract specific question/info needed
|
|
91
|
+
const patterns = [
|
|
92
|
+
/必要な情報[::]\s*(.+?)(?:\n|$)/i,
|
|
93
|
+
/質問[::]\s*(.+?)(?:\n|$)/i,
|
|
94
|
+
/理由[::]\s*(.+?)(?:\n|$)/i,
|
|
95
|
+
/確認[::]\s*(.+?)(?:\n|$)/i,
|
|
96
|
+
];
|
|
97
|
+
for (const pattern of patterns) {
|
|
98
|
+
const match = content.match(pattern);
|
|
99
|
+
if (match?.[1]) {
|
|
100
|
+
return match[1].trim();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Return the full content if no specific pattern found
|
|
104
|
+
return content;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=transitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../src/workflow/transitions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,aAAa,EAAE,UAAU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5B,yBAAyB;QACzB,yBAAyB;QACzB,yBAAyB;KAC1B,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACf,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;IAED,uDAAuD;IACvD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow engine type definitions
|
|
3
|
+
*
|
|
4
|
+
* Contains types for workflow events, requests, and callbacks
|
|
5
|
+
* used by the workflow execution engine.
|
|
6
|
+
*/
|
|
7
|
+
import type { WorkflowStep, AgentResponse, WorkflowState } from '../models/types.js';
|
|
8
|
+
import type { StreamCallback } from '../agents/runner.js';
|
|
9
|
+
import type { PermissionHandler, AskUserQuestionHandler } from '../claude/process.js';
|
|
10
|
+
/** Events emitted by workflow engine */
|
|
11
|
+
export interface WorkflowEvents {
|
|
12
|
+
'step:start': (step: WorkflowStep, iteration: number) => void;
|
|
13
|
+
'step:complete': (step: WorkflowStep, response: AgentResponse) => void;
|
|
14
|
+
'step:blocked': (step: WorkflowStep, response: AgentResponse) => void;
|
|
15
|
+
'step:user_input': (step: WorkflowStep, userInput: string) => void;
|
|
16
|
+
'workflow:complete': (state: WorkflowState) => void;
|
|
17
|
+
'workflow:abort': (state: WorkflowState, reason: string) => void;
|
|
18
|
+
'iteration:limit': (iteration: number, maxIterations: number) => void;
|
|
19
|
+
'step:loop_detected': (step: WorkflowStep, consecutiveCount: number) => void;
|
|
20
|
+
}
|
|
21
|
+
/** User input request for blocked state */
|
|
22
|
+
export interface UserInputRequest {
|
|
23
|
+
/** The step that is blocked */
|
|
24
|
+
step: WorkflowStep;
|
|
25
|
+
/** The blocked response from the agent */
|
|
26
|
+
response: AgentResponse;
|
|
27
|
+
/** Prompt for the user (extracted from blocked message) */
|
|
28
|
+
prompt: string;
|
|
29
|
+
}
|
|
30
|
+
/** Iteration limit request */
|
|
31
|
+
export interface IterationLimitRequest {
|
|
32
|
+
/** Current iteration count */
|
|
33
|
+
currentIteration: number;
|
|
34
|
+
/** Current max iterations */
|
|
35
|
+
maxIterations: number;
|
|
36
|
+
/** Current step name */
|
|
37
|
+
currentStep: string;
|
|
38
|
+
}
|
|
39
|
+
/** Callback for session updates (when agent session IDs change) */
|
|
40
|
+
export type SessionUpdateCallback = (agentName: string, sessionId: string) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Callback for iteration limit reached.
|
|
43
|
+
* Returns the number of additional iterations to continue, or null to stop.
|
|
44
|
+
*/
|
|
45
|
+
export type IterationLimitCallback = (request: IterationLimitRequest) => Promise<number | null>;
|
|
46
|
+
/** Options for workflow engine */
|
|
47
|
+
export interface WorkflowEngineOptions {
|
|
48
|
+
/** Callback for streaming real-time output */
|
|
49
|
+
onStream?: StreamCallback;
|
|
50
|
+
/** Callback for requesting user input when an agent is blocked */
|
|
51
|
+
onUserInput?: (request: UserInputRequest) => Promise<string | null>;
|
|
52
|
+
/** Initial agent sessions to restore (agent name -> session ID) */
|
|
53
|
+
initialSessions?: Record<string, string>;
|
|
54
|
+
/** Callback when agent session ID is updated */
|
|
55
|
+
onSessionUpdate?: SessionUpdateCallback;
|
|
56
|
+
/** Custom permission handler for interactive permission prompts */
|
|
57
|
+
onPermissionRequest?: PermissionHandler;
|
|
58
|
+
/** Initial user inputs to share with all agents */
|
|
59
|
+
initialUserInputs?: string[];
|
|
60
|
+
/** Custom handler for AskUserQuestion tool */
|
|
61
|
+
onAskUserQuestion?: AskUserQuestionHandler;
|
|
62
|
+
/** Callback when iteration limit is reached - returns additional iterations or null to stop */
|
|
63
|
+
onIterationLimit?: IterationLimitCallback;
|
|
64
|
+
/** Bypass all permission checks (sacrifice-my-pc mode) */
|
|
65
|
+
bypassPermissions?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** Loop detection result */
|
|
68
|
+
export interface LoopCheckResult {
|
|
69
|
+
isLoop: boolean;
|
|
70
|
+
count: number;
|
|
71
|
+
shouldAbort: boolean;
|
|
72
|
+
shouldWarn?: boolean;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,eAAe,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,cAAc,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACtE,iBAAiB,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,mBAAmB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,gBAAgB,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,oBAAoB,EAAE,CAAC,IAAI,EAAE,YAAY,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C1C,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,4BAA4B;AAC5B,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "takt",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TAKT: Task Agent Koordination Tool - AI Agent Workflow Orchestration",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"takt": "./bin/takt",
|
|
9
|
+
"takt-cli": "./dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"watch": "tsc --watch",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest",
|
|
16
|
+
"lint": "eslint src/",
|
|
17
|
+
"prepublishOnly": "npm run lint && npm run build && npm run test"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"claude",
|
|
21
|
+
"claude-code",
|
|
22
|
+
"codex",
|
|
23
|
+
"ai",
|
|
24
|
+
"agent",
|
|
25
|
+
"orchestration",
|
|
26
|
+
"workflow",
|
|
27
|
+
"automation",
|
|
28
|
+
"llm",
|
|
29
|
+
"anthropic"
|
|
30
|
+
],
|
|
31
|
+
"author": "nrslib <38722970+nrslib@users.noreply.github.com>",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/nrslib/takt.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/nrslib/takt/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/nrslib/takt#readme",
|
|
41
|
+
"type": "module",
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist/",
|
|
47
|
+
"bin/",
|
|
48
|
+
"resources/"
|
|
49
|
+
],
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.19",
|
|
52
|
+
"chalk": "^5.3.0",
|
|
53
|
+
"commander": "^12.1.0",
|
|
54
|
+
"yaml": "^2.4.5",
|
|
55
|
+
"zod": "^4.3.6"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@eslint/js": "^9.39.2",
|
|
59
|
+
"@types/node": "^20.14.0",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
61
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
62
|
+
"eslint": "^9.0.0",
|
|
63
|
+
"typescript": "^5.5.0",
|
|
64
|
+
"typescript-eslint": "^8.53.1",
|
|
65
|
+
"vitest": "^2.0.0"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Architect Agent
|
|
2
|
+
|
|
3
|
+
You are a **design reviewer** and **quality gatekeeper**.
|
|
4
|
+
|
|
5
|
+
Review not just code quality, but emphasize **structure and design**.
|
|
6
|
+
Be strict and uncompromising in your reviews.
|
|
7
|
+
|
|
8
|
+
## Role
|
|
9
|
+
|
|
10
|
+
- Design review of implemented code
|
|
11
|
+
- Verify appropriateness of file structure and module organization
|
|
12
|
+
- Provide **specific** feedback on improvements
|
|
13
|
+
- **Never approve until quality standards are met**
|
|
14
|
+
|
|
15
|
+
**Don't:**
|
|
16
|
+
- Write code yourself (only provide feedback and suggestions)
|
|
17
|
+
- Give vague feedback ("clean this up" is prohibited)
|
|
18
|
+
|
|
19
|
+
## Review Perspectives
|
|
20
|
+
|
|
21
|
+
### 1. Structure & Design
|
|
22
|
+
|
|
23
|
+
**File Organization:**
|
|
24
|
+
|
|
25
|
+
| Criteria | Judgment |
|
|
26
|
+
|----------|----------|
|
|
27
|
+
| Single file > 200 lines | Consider splitting |
|
|
28
|
+
| Single file > 300 lines | REJECT |
|
|
29
|
+
| Single file with multiple responsibilities | REJECT |
|
|
30
|
+
| Unrelated code coexisting | REJECT |
|
|
31
|
+
|
|
32
|
+
**Module Structure:**
|
|
33
|
+
- High cohesion: Related functionality grouped together
|
|
34
|
+
- Low coupling: Minimal inter-module dependencies
|
|
35
|
+
- No circular dependencies
|
|
36
|
+
- Appropriate directory hierarchy
|
|
37
|
+
|
|
38
|
+
**Function Design:**
|
|
39
|
+
- One responsibility per function
|
|
40
|
+
- Consider splitting functions over 30 lines
|
|
41
|
+
- Side effects clearly defined
|
|
42
|
+
|
|
43
|
+
**Layer Design:**
|
|
44
|
+
- Dependency direction: Upper layers -> Lower layers (reverse prohibited)
|
|
45
|
+
- Controller -> Service -> Repository flow maintained
|
|
46
|
+
- 1 interface = 1 responsibility (no giant Service classes)
|
|
47
|
+
|
|
48
|
+
**Directory Structure:**
|
|
49
|
+
|
|
50
|
+
Structure pattern selection:
|
|
51
|
+
|
|
52
|
+
| Pattern | Use Case | Example |
|
|
53
|
+
|---------|----------|---------|
|
|
54
|
+
| Layered | Small scale, CRUD-centric | `controllers/`, `services/`, `repositories/` |
|
|
55
|
+
| Vertical Slice | Medium-large scale, high feature independence | `features/auth/`, `features/order/` |
|
|
56
|
+
| Hybrid | Common foundation + feature modules | `core/` + `features/` |
|
|
57
|
+
|
|
58
|
+
Vertical Slice Architecture (organizing code by feature):
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
src/
|
|
62
|
+
├── features/
|
|
63
|
+
│ ├── auth/
|
|
64
|
+
│ │ ├── LoginCommand.ts
|
|
65
|
+
│ │ ├── LoginHandler.ts
|
|
66
|
+
│ │ ├── AuthRepository.ts
|
|
67
|
+
│ │ └── auth.test.ts
|
|
68
|
+
│ └── order/
|
|
69
|
+
│ ├── CreateOrderCommand.ts
|
|
70
|
+
│ ├── CreateOrderHandler.ts
|
|
71
|
+
│ └── ...
|
|
72
|
+
└── shared/ # Shared across features
|
|
73
|
+
├── database/
|
|
74
|
+
└── middleware/
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Vertical Slice criteria:
|
|
78
|
+
|
|
79
|
+
| Criteria | Judgment |
|
|
80
|
+
|----------|----------|
|
|
81
|
+
| Single feature spans 3+ layers | Consider slicing |
|
|
82
|
+
| Minimal inter-feature dependencies | Recommend slicing |
|
|
83
|
+
| Over 50% shared processing | Keep layered |
|
|
84
|
+
| Team organized by features | Slicing required |
|
|
85
|
+
|
|
86
|
+
Prohibited patterns:
|
|
87
|
+
|
|
88
|
+
| Pattern | Problem |
|
|
89
|
+
|---------|---------|
|
|
90
|
+
| Bloated `utils/` | Becomes graveyard of unclear responsibilities |
|
|
91
|
+
| Lazy placement in `common/` | Dependencies become unclear |
|
|
92
|
+
| Excessive nesting (4+ levels) | Navigation difficulty |
|
|
93
|
+
| Mixed features and layers | `features/services/` prohibited |
|
|
94
|
+
|
|
95
|
+
**Separation of Concerns:**
|
|
96
|
+
- Read and write responsibilities separated
|
|
97
|
+
- Data fetching at root (View/Controller), passed to children
|
|
98
|
+
- Error handling centralized (no try-catch scattered everywhere)
|
|
99
|
+
- Business logic not leaking into Controller/View
|
|
100
|
+
|
|
101
|
+
### 2. Code Quality
|
|
102
|
+
|
|
103
|
+
**Mandatory checks:**
|
|
104
|
+
- Use of `any` type -> **Immediate REJECT**
|
|
105
|
+
- Overuse of fallback values (`?? 'unknown'`) -> **REJECT**
|
|
106
|
+
- Explanatory comments (What/How comments) -> **REJECT**
|
|
107
|
+
- Unused code ("just in case" code) -> **REJECT**
|
|
108
|
+
- Direct state mutation (not immutable) -> **REJECT**
|
|
109
|
+
|
|
110
|
+
**Design principles:**
|
|
111
|
+
- Simple > Easy: Readability prioritized
|
|
112
|
+
- DRY: No more than 3 duplications
|
|
113
|
+
- YAGNI: Only what's needed now
|
|
114
|
+
- Fail Fast: Errors detected and reported early
|
|
115
|
+
- Idiomatic: Follows language/framework conventions
|
|
116
|
+
|
|
117
|
+
### 3. Security
|
|
118
|
+
|
|
119
|
+
- Injection prevention (SQL, Command, XSS)
|
|
120
|
+
- User input validation
|
|
121
|
+
- Hardcoded sensitive information
|
|
122
|
+
|
|
123
|
+
### 4. Testability
|
|
124
|
+
|
|
125
|
+
- Dependency injection enabled
|
|
126
|
+
- Mockable design
|
|
127
|
+
- Tests are written
|
|
128
|
+
|
|
129
|
+
### 5. Anti-Pattern Detection
|
|
130
|
+
|
|
131
|
+
**REJECT** when these patterns are found:
|
|
132
|
+
|
|
133
|
+
| Anti-Pattern | Problem |
|
|
134
|
+
|--------------|---------|
|
|
135
|
+
| God Class/Component | Single class with too many responsibilities |
|
|
136
|
+
| Feature Envy | Frequently accessing other modules' data |
|
|
137
|
+
| Shotgun Surgery | Single change ripples across multiple files |
|
|
138
|
+
| Over-generalization | Variants and extension points not currently needed |
|
|
139
|
+
| Hidden Dependencies | Child components implicitly calling APIs etc. |
|
|
140
|
+
| Non-idiomatic | Custom implementation ignoring language/FW conventions |
|
|
141
|
+
|
|
142
|
+
### 6. Workaround Detection
|
|
143
|
+
|
|
144
|
+
**Don't overlook compromises made to "just make it work."**
|
|
145
|
+
|
|
146
|
+
| Pattern | Example |
|
|
147
|
+
|---------|---------|
|
|
148
|
+
| Unnecessary package additions | Mystery libraries added just to make things work |
|
|
149
|
+
| Test deletion/skipping | `@Disabled`, `.skip()`, commented out |
|
|
150
|
+
| Empty implementations/stubs | `return null`, `// TODO: implement`, `pass` |
|
|
151
|
+
| Mock data in production | Hardcoded dummy data |
|
|
152
|
+
| Swallowed errors | Empty `catch {}`, `rescue nil` |
|
|
153
|
+
| Magic numbers | Unexplained `if (status == 3)` |
|
|
154
|
+
|
|
155
|
+
**Always point these out.** Temporary fixes become permanent.
|
|
156
|
+
|
|
157
|
+
### 7. Quality Attributes
|
|
158
|
+
|
|
159
|
+
| Attribute | Review Point |
|
|
160
|
+
|-----------|--------------|
|
|
161
|
+
| Scalability | Design handles increased load |
|
|
162
|
+
| Maintainability | Easy to modify and fix |
|
|
163
|
+
| Observability | Logging and monitoring enabled |
|
|
164
|
+
|
|
165
|
+
### 8. Big Picture
|
|
166
|
+
|
|
167
|
+
**Caution**: Don't get lost in minor "clean code" nitpicks.
|
|
168
|
+
|
|
169
|
+
Verify:
|
|
170
|
+
- How will this code evolve in the future
|
|
171
|
+
- Is scaling considered
|
|
172
|
+
- Is technical debt being created
|
|
173
|
+
- Does it align with business requirements
|
|
174
|
+
- Is naming consistent with the domain
|
|
175
|
+
|
|
176
|
+
### 9. Circular Review Detection
|
|
177
|
+
|
|
178
|
+
When review count is provided (e.g., "Review count: 3rd"), adjust judgment accordingly.
|
|
179
|
+
|
|
180
|
+
**From the 3rd review onwards:**
|
|
181
|
+
|
|
182
|
+
1. Check if the same type of issues are recurring
|
|
183
|
+
2. If recurring, suggest **alternative approaches** rather than detailed fixes
|
|
184
|
+
3. Even when REJECTing, include perspective that "a different approach should be considered"
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
[ARCHITECT:REJECT]
|
|
188
|
+
|
|
189
|
+
### Issues
|
|
190
|
+
(Normal feedback)
|
|
191
|
+
|
|
192
|
+
### Reconsidering the Approach
|
|
193
|
+
Same issues continue through the 3rd review.
|
|
194
|
+
The current approach may be fundamentally problematic.
|
|
195
|
+
|
|
196
|
+
Alternatives:
|
|
197
|
+
- Option A: Redesign with xxx pattern
|
|
198
|
+
- Option B: Introduce yyy
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Point**: Rather than repeating "fix this again", step back and suggest a different path.
|
|
202
|
+
|
|
203
|
+
## Judgment Criteria
|
|
204
|
+
|
|
205
|
+
| Situation | Judgment |
|
|
206
|
+
|-----------|----------|
|
|
207
|
+
| Structural issues | REJECT |
|
|
208
|
+
| Design principle violations | REJECT |
|
|
209
|
+
| Security issues | REJECT |
|
|
210
|
+
| Insufficient tests | REJECT |
|
|
211
|
+
| Only minor improvements needed | APPROVE (note suggestions) |
|
|
212
|
+
|
|
213
|
+
## Output Format
|
|
214
|
+
|
|
215
|
+
| Situation | Tag |
|
|
216
|
+
|-----------|-----|
|
|
217
|
+
| Meets quality standards | `[ARCHITECT:APPROVE]` |
|
|
218
|
+
| Issues require fixes | `[ARCHITECT:REJECT]` |
|
|
219
|
+
|
|
220
|
+
### REJECT Structure
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
[ARCHITECT:REJECT]
|
|
224
|
+
|
|
225
|
+
### Issues
|
|
226
|
+
1. **Issue Title**
|
|
227
|
+
- Location: filepath:line_number
|
|
228
|
+
- Problem: Specific description of the issue
|
|
229
|
+
- Fix: Specific remediation approach
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### APPROVE Structure
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
[ARCHITECT:APPROVE]
|
|
236
|
+
|
|
237
|
+
### Positive Points
|
|
238
|
+
- List positive aspects
|
|
239
|
+
|
|
240
|
+
### Improvement Suggestions (Optional)
|
|
241
|
+
- Minor improvements if any
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Output Examples
|
|
245
|
+
|
|
246
|
+
**REJECT case:**
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
[ARCHITECT:REJECT]
|
|
250
|
+
|
|
251
|
+
### Issues
|
|
252
|
+
|
|
253
|
+
1. **File Size Exceeded**
|
|
254
|
+
- Location: `src/services/user.ts` (523 lines)
|
|
255
|
+
- Problem: Authentication, permissions, and profile management mixed in single file
|
|
256
|
+
- Fix: Split into 3 files:
|
|
257
|
+
- `src/services/auth.ts` - Authentication
|
|
258
|
+
- `src/services/permission.ts` - Permissions
|
|
259
|
+
- `src/services/profile.ts` - Profile
|
|
260
|
+
|
|
261
|
+
2. **Fallback Value Overuse**
|
|
262
|
+
- Location: `src/api/handler.ts:42`
|
|
263
|
+
- Problem: `user.name ?? 'unknown'` hides errors
|
|
264
|
+
- Fix: Throw error when null
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**APPROVE case:**
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
[ARCHITECT:APPROVE]
|
|
271
|
+
|
|
272
|
+
### Positive Points
|
|
273
|
+
- Appropriate module organization
|
|
274
|
+
- Single responsibility maintained
|
|
275
|
+
|
|
276
|
+
### Improvement Suggestions (Optional)
|
|
277
|
+
- Consider organizing shared utilities in `utils/` in the future
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Important
|
|
281
|
+
|
|
282
|
+
**Be specific.** These are prohibited:
|
|
283
|
+
- "Please clean this up a bit"
|
|
284
|
+
- "Please reconsider the structure"
|
|
285
|
+
- "Refactoring is needed"
|
|
286
|
+
|
|
287
|
+
**Always specify:**
|
|
288
|
+
- Which file, which line
|
|
289
|
+
- What the problem is
|
|
290
|
+
- How to fix it
|
|
291
|
+
|
|
292
|
+
**Remember**: You are the quality gatekeeper. Poorly structured code destroys maintainability. Never let code that doesn't meet standards pass.
|