@promptbook/cli 0.114.0-41 → 0.114.0-47
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/agents/default/copywriter.book +15 -0
- package/agents/default/developer.book +3 -0
- package/agents/default/lawyer.book +14 -0
- package/agents/default/planner.book +16 -0
- package/esm/index.es.js +4769 -809
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/find-fresh-emoji-tags/find-fresh-emoji-tags.d.ts +1 -1
- package/esm/scripts/find-refactor-candidates/find-refactor-candidates.d.ts +2 -0
- package/esm/scripts/find-refactor-candidates/resolveRefactorCandidateProject.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/common/CoderRunControlFeedback.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/buildCoderRunControlKeyBadge.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +3 -2
- package/esm/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +15 -5
- package/esm/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/captureLiveScriptOutput.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/createScriptOutputLineReader.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/resolveShellHereDocumentDelimiter.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +4 -1
- package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/git/commitInitializedAgentBooks.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/git/ensureWorkingTreeClean.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/isolation/copyCoderIsolationEnvironment.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/main/findUnwrittenPrompts.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +10 -2
- package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/cline/ClineRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/gemini/GeminiRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/github-copilot/GitHubCopilotRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/openai-codex/OpenAiCodexRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/opencode/OpencodeRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/qwen-code/QwenCodeRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/server/runCoderHttpServer.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/team/CoderTeamRuntime.d.ts +87 -0
- package/esm/scripts/run-codex-prompts/team/coderTeamProtocol.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/team/compileCoderTeamAgent.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/team/createCoderTeamPromptRunner.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/team/startCoderTeamBridge.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +16 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiViewport.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +4 -1
- package/esm/scripts/run-codex-prompts/ui/coderRunUiText.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/ui/output/CoderOutputEvent.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/ui/output/CoderRunOutput.d.ts +48 -0
- package/esm/scripts/run-codex-prompts/ui/output/buildCoderOutputLines.d.ts +18 -0
- package/esm/scripts/run-codex-prompts/ui/output/normalizeCoderOutputRecord.d.ts +10 -0
- package/esm/scripts/utils/emojiTags/scanEmojiTagUsage.d.ts +2 -0
- package/esm/scripts/utils/prompts/isPromptDocumentationFile.d.ts +5 -0
- package/esm/scripts/utils/prompts/promptEmojiTags.d.ts +2 -0
- package/esm/scripts/verify-prompts/verify-prompts.d.ts +3 -0
- package/esm/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/add.d.ts +16 -0
- package/esm/src/cli/cli-commands/coder/agentCliOptions.d.ts +3 -2
- package/esm/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/coderAgentRole.d.ts +16 -0
- package/esm/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +8 -7
- package/esm/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
- package/esm/src/cli/cli-commands/coder/plan.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningTerminal.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningTerminal.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningWorkspace.d.ts +11 -0
- package/esm/src/cli/cli-commands/coder/planning/discussPlanningTurn.d.ts +15 -0
- package/esm/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.d.ts +5 -0
- package/esm/src/cli/cli-commands/coder/planning/planningGitSync.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/planningPackagedCli.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/planningProtocol.d.ts +152 -0
- package/esm/src/cli/cli-commands/coder/planning/planningTeam.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/preparePlanningChanges.d.ts +16 -0
- package/esm/src/cli/cli-commands/coder/planning/readPlanningContext.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/resolvePlanningPath.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningHarness.d.ts +30 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningHarness.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningSession.d.ts +21 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningSession.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/savePlanningChanges.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/printInitializationSummary.d.ts +2 -1
- package/esm/src/cli/cli-commands/coder/promptsReadmeTemplate.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/promptsReadmeTemplate.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/readCoderAgentBook.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/workspacePreflight.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +4 -2
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +8 -1
- package/esm/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/workspaceRepository.d.ts +36 -0
- package/esm/src/cli/cli-commands/common/workspaceRepository.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/workspaceRepositoryCliOptions.d.ts +11 -0
- package/esm/src/commitments/TEAM/TEAM.test.d.ts +1 -0
- package/esm/src/conversion/archive/loadJsZipModule.d.ts +10 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +4 -3
- package/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.ts +2 -0
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/applyCommitmentsToAgentModelRequirements.ts +8 -3
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.ts +6 -0
- package/src/cli/$initializePromptbookCliProgram.ts +2 -0
- package/src/cli/cli-commands/coder/add.ts +44 -14
- package/src/cli/cli-commands/coder/agentCliOptions.ts +9 -3
- package/src/cli/cli-commands/coder/augmentCoderAgentTeam.ts +152 -0
- package/src/cli/cli-commands/coder/coderAgentRole.ts +22 -0
- package/src/cli/cli-commands/coder/coderReferencedArtifacts.ts +9 -12
- package/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.ts +90 -0
- package/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.ts +2 -21
- package/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.ts +36 -0
- package/src/cli/cli-commands/coder/find-fresh-emoji-tags.ts +11 -2
- package/src/cli/cli-commands/coder/find-refactor-candidates.ts +10 -1
- package/src/cli/cli-commands/coder/find-unwritten.ts +10 -1
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +12 -3
- package/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.ts +42 -0
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +7 -2
- package/src/cli/cli-commands/coder/init.ts +88 -26
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +67 -21
- package/src/cli/cli-commands/coder/list.ts +7 -1
- package/src/cli/cli-commands/coder/ping.ts +8 -1
- package/src/cli/cli-commands/coder/plan.ts +127 -0
- package/src/cli/cli-commands/coder/planning/README.md +37 -0
- package/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.ts +23 -0
- package/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.ts +57 -0
- package/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.ts +34 -0
- package/src/cli/cli-commands/coder/planning/createPlanningTerminal.ts +57 -0
- package/src/cli/cli-commands/coder/planning/createPlanningWorkspace.ts +36 -0
- package/src/cli/cli-commands/coder/planning/discussPlanningTurn.ts +61 -0
- package/src/cli/cli-commands/coder/planning/fixtures/codex.cjs +54 -0
- package/src/cli/cli-commands/coder/planning/fixtures/conversation.json +70 -0
- package/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.ts +17 -0
- package/src/cli/cli-commands/coder/planning/fixtures/terminal.cjs +26 -0
- package/src/cli/cli-commands/coder/planning/planningProtocol.ts +132 -0
- package/src/cli/cli-commands/coder/planning/preparePlanningChanges.ts +178 -0
- package/src/cli/cli-commands/coder/planning/readPlanningContext.ts +108 -0
- package/src/cli/cli-commands/coder/planning/resolvePlanningPath.ts +72 -0
- package/src/cli/cli-commands/coder/planning/runPlanningHarness.ts +249 -0
- package/src/cli/cli-commands/coder/planning/runPlanningSession.ts +243 -0
- package/src/cli/cli-commands/coder/planning/savePlanningChanges.ts +107 -0
- package/src/cli/cli-commands/coder/printInitializationSummary.ts +26 -3
- package/src/cli/cli-commands/coder/promptsReadmeTemplate.ts +358 -0
- package/src/cli/cli-commands/coder/readCoderAgentBook.ts +62 -0
- package/src/cli/cli-commands/coder/run.ts +37 -15
- package/src/cli/cli-commands/coder/server.ts +31 -10
- package/src/cli/cli-commands/coder/verify.ts +18 -1
- package/src/cli/cli-commands/coder.ts +7 -0
- package/src/cli/cli-commands/common/LocalAgentBookCollection.ts +56 -18
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +1 -1
- package/src/cli/cli-commands/common/createLocalAgentReferenceResolver.ts +7 -0
- package/src/cli/cli-commands/common/resolveLocalAgentSource.ts +39 -19
- package/src/cli/cli-commands/common/validateCoderRunOptions.ts +91 -0
- package/src/cli/cli-commands/common/workspaceRepository.md +46 -0
- package/src/cli/cli-commands/common/workspaceRepository.ts +265 -0
- package/src/cli/cli-commands/common/workspaceRepositoryCliOptions.ts +29 -0
- package/src/commitments/TEAM/TEAM.ts +26 -4
- package/src/conversion/archive/loadJsZipModule.ts +3 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +921 -830
- package/src/version.ts +2 -2
- package/src/versions.txt +7 -1
- package/umd/index.umd.js +4767 -809
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/find-fresh-emoji-tags/find-fresh-emoji-tags.d.ts +1 -1
- package/umd/scripts/find-refactor-candidates/find-refactor-candidates.d.ts +2 -0
- package/umd/scripts/find-refactor-candidates/resolveRefactorCandidateProject.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/common/CoderRunControlFeedback.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/buildCoderRunControlKeyBadge.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +3 -2
- package/umd/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +15 -5
- package/umd/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/captureLiveScriptOutput.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/createScriptOutputLineReader.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/resolveShellHereDocumentDelimiter.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +4 -1
- package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/git/commitInitializedAgentBooks.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/git/ensureWorkingTreeClean.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/isolation/copyCoderIsolationEnvironment.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/main/findUnwrittenPrompts.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +10 -2
- package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/cline/ClineRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/gemini/GeminiRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/github-copilot/GitHubCopilotRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/openai-codex/OpenAiCodexRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/opencode/OpencodeRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/qwen-code/QwenCodeRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/server/runCoderHttpServer.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/team/CoderTeamRuntime.d.ts +87 -0
- package/umd/scripts/run-codex-prompts/team/coderTeamProtocol.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/team/compileCoderTeamAgent.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/team/createCoderTeamPromptRunner.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/team/startCoderTeamBridge.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +16 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiViewport.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +4 -1
- package/umd/scripts/run-codex-prompts/ui/coderRunUiText.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/ui/output/CoderOutputEvent.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/ui/output/CoderRunOutput.d.ts +48 -0
- package/umd/scripts/run-codex-prompts/ui/output/buildCoderOutputLines.d.ts +18 -0
- package/umd/scripts/run-codex-prompts/ui/output/normalizeCoderOutputRecord.d.ts +10 -0
- package/umd/scripts/utils/emojiTags/scanEmojiTagUsage.d.ts +2 -0
- package/umd/scripts/utils/prompts/isPromptDocumentationFile.d.ts +5 -0
- package/umd/scripts/utils/prompts/promptEmojiTags.d.ts +2 -0
- package/umd/scripts/verify-prompts/verify-prompts.d.ts +3 -0
- package/umd/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/add.d.ts +16 -0
- package/umd/src/cli/cli-commands/coder/agentCliOptions.d.ts +3 -2
- package/umd/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/coderAgentRole.d.ts +16 -0
- package/umd/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +8 -7
- package/umd/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
- package/umd/src/cli/cli-commands/coder/plan.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningTerminal.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningTerminal.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningWorkspace.d.ts +11 -0
- package/umd/src/cli/cli-commands/coder/planning/discussPlanningTurn.d.ts +15 -0
- package/umd/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.d.ts +5 -0
- package/umd/src/cli/cli-commands/coder/planning/planningGitSync.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/planningPackagedCli.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/planningProtocol.d.ts +152 -0
- package/umd/src/cli/cli-commands/coder/planning/planningTeam.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/preparePlanningChanges.d.ts +16 -0
- package/umd/src/cli/cli-commands/coder/planning/readPlanningContext.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/resolvePlanningPath.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningHarness.d.ts +30 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningHarness.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningSession.d.ts +21 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningSession.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/savePlanningChanges.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/printInitializationSummary.d.ts +2 -1
- package/umd/src/cli/cli-commands/coder/promptsReadmeTemplate.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/promptsReadmeTemplate.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/readCoderAgentBook.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/workspacePreflight.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +4 -2
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +8 -1
- package/umd/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/workspaceRepository.d.ts +36 -0
- package/umd/src/cli/cli-commands/common/workspaceRepository.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/workspaceRepositoryCliOptions.d.ts +11 -0
- package/umd/src/commitments/TEAM/TEAM.test.d.ts +1 -0
- package/umd/src/conversion/archive/loadJsZipModule.d.ts +10 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { spaceTrim } from 'spacetrim';
|
|
3
|
+
import { PROMPTS_DIRECTORY_PATH } from './boilerplateTemplates';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Project-relative location of the offline guide, reserved from prompt discovery.
|
|
7
|
+
*
|
|
8
|
+
* @private internal constant of `coder init`
|
|
9
|
+
*/
|
|
10
|
+
export const PROMPTS_README_FILE_PATH = join(PROMPTS_DIRECTORY_PATH, 'README.md');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Maintained project-independent guide, bundled as text in the published CLI.
|
|
14
|
+
* Keep examples executable against the parser and command registry in the accompanying tests.
|
|
15
|
+
*
|
|
16
|
+
* @private internal template of `coder init`
|
|
17
|
+
*/
|
|
18
|
+
export const PROMPTS_README_TEMPLATE = spaceTrim(`
|
|
19
|
+
# PRDs and the implementation queue
|
|
20
|
+
|
|
21
|
+
This directory holds version-controlled implementation specifications, often called **PRDs** (Product
|
|
22
|
+
Requirements Documents), and a work queue. A PRD describes an intended change: its presence does not mean the
|
|
23
|
+
feature already exists. Read the status, implementation evidence, and current code before relying on it.
|
|
24
|
+
|
|
25
|
+
The same Markdown can be implemented by a person or handed to another coding assistant. Promptbook Coder
|
|
26
|
+
automates selection, execution, checks, and status recording; it is not required to understand or use these
|
|
27
|
+
files. The manual workflow below needs only an editor, Git, and this project's normal development tools. No
|
|
28
|
+
Promptbook installation, account, or monorepo checkout is required.
|
|
29
|
+
|
|
30
|
+
## What belongs here
|
|
31
|
+
|
|
32
|
+
The default layout, relative to the project root, is:
|
|
33
|
+
|
|
34
|
+
\`\`\`text
|
|
35
|
+
prompts/
|
|
36
|
+
README.md This guide, excluded from the queue
|
|
37
|
+
YYYY-MM-NNNN-short-title.md PRDs, including pending tasks and drafts
|
|
38
|
+
done/ Reviewed, archived task history
|
|
39
|
+
templates/
|
|
40
|
+
common.md Reusable authoring instructions
|
|
41
|
+
traces/ Execution traces, created when tasks run
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
\`init\` creates the directory, \`done/\`, and \`templates/\`. New default npm scripts also initialize the
|
|
45
|
+
project-owned \`templates/common.md\`. Existing scripts and their custom template choices are preserved. A
|
|
46
|
+
fresh, empty directory receives numbered boilerplates with \`[-]\` and \`@@@\` placeholders; they need authoring
|
|
47
|
+
before use. Repeating init fills missing configuration and creates this README if missing, preserving an
|
|
48
|
+
existing README without appending to it. It does not replenish boilerplates in a nonempty directory.
|
|
49
|
+
|
|
50
|
+
Only Markdown files directly in \`prompts/\` enter the queue. \`README.md\` is excluded case-insensitively, even
|
|
51
|
+
if customized or filled with sample statuses. Subdirectories such as \`done/\`, \`templates/\`, and \`traces/\` are
|
|
52
|
+
not scanned for runnable tasks. A file containing the exact comment \`<!--ptbk-coder-ignore-->\` is also
|
|
53
|
+
excluded from queue loading.
|
|
54
|
+
|
|
55
|
+
- **Specifications:** top-level PRDs are the requirements and status of work. Commit them with the project
|
|
56
|
+
so reviewers can connect intent with code.
|
|
57
|
+
- **Templates:** reusable instructions, not tasks. Adapt \`templates/common.md\` to this repository's
|
|
58
|
+
conventions and actual check commands before copying it into new PRDs.
|
|
59
|
+
- **History:** \`done/\` holds archived PRDs. An archive records what was reviewed at the time; it does not
|
|
60
|
+
guarantee today's code still has that behavior.
|
|
61
|
+
- **Diagnostics:** \`traces/\` contains per-task Markdown run traces, with section suffixes for files
|
|
62
|
+
containing multiple tasks. Failures may also leave a neighboring \`.error.log\`; temporary harness logs may
|
|
63
|
+
be retained after failure or with \`--preserve-logs\`. Planning keeps runtime state under the project root's
|
|
64
|
+
\`.promptbook/\`. These artifacts explain what a run did, rather than specify new work. Inspect them before
|
|
65
|
+
sharing and follow the project's retention policy.
|
|
66
|
+
|
|
67
|
+
## Names, titles, and sections
|
|
68
|
+
|
|
69
|
+
Coder-generated filenames use \`YYYY-MM-NNNN-short-title.md\`: year/month, a sequence starting at \`0000\` and
|
|
70
|
+
normally increasing by 10, and a descriptive slug. Number allocation also considers numbered Markdown files
|
|
71
|
+
below the directory, including archived PRDs, to avoid reusing their numbers. The number is a naming/order
|
|
72
|
+
convention, not a deadline, dependency, or priority. Handwritten names such as \`fix-search.md\` are valid; no
|
|
73
|
+
date prefix is required.
|
|
74
|
+
|
|
75
|
+
Put the status on the **first nonempty line of each task section**, then a blank line, a short title, and the
|
|
76
|
+
requirements. A leading title tag such as \`[✨🔎]\` is a searchable reference used to connect related work and
|
|
77
|
+
code. Generated tasks receive emoji tags; a tag is not a status or a scheduling rule. Headings and the wording
|
|
78
|
+
of titles are conventions, not required syntax. The runner removes the status line and a leading bracketed
|
|
79
|
+
title tag from the task text it sends for implementation.
|
|
80
|
+
|
|
81
|
+
One file can contain several independent, multiline task sections. A line whose trimmed content is exactly
|
|
82
|
+
\`---\` starts another section, each with its own status and priority. The parser splits on that line even
|
|
83
|
+
inside a code fence: avoid YAML front matter and decorative \`---\` rules in PRDs. Ordinary headings, lists, and
|
|
84
|
+
acceptance checkboxes inside a section do not create more tasks. Do not put a heading or a comment before the
|
|
85
|
+
section's status: an unmarked first line defaults to pending at priority zero.
|
|
86
|
+
|
|
87
|
+
Repository references supply context; they do not automatically include the referenced file's contents. Tell
|
|
88
|
+
the implementer what to inspect and why. Paths written as code, such as \`src/search/filterItems.ts\`, should be
|
|
89
|
+
identified as project-root-relative. Markdown links in a top-level PRD need \`../\` to reach that root, for
|
|
90
|
+
example \`[project instructions](../AGENTS.md)\`. Adapt links when moving files deeper into \`done/\` (often
|
|
91
|
+
\`../../\`), or retain explicit project-root-relative paths in the text.
|
|
92
|
+
|
|
93
|
+
## A small PRD to adapt
|
|
94
|
+
|
|
95
|
+
Copy this block into a new file such as \`prompts/YYYY-MM-0010-trim-search-query.md\`, replacing the date/number
|
|
96
|
+
and every example path, command, and assumption with ones that exist in your repository. Read the referenced
|
|
97
|
+
code first. Keep \`[-]\` instead of \`[ ]\` while requirements or acceptance checks remain undecided. The sample
|
|
98
|
+
is illustrative, not a claim that this project contains these files.
|
|
99
|
+
|
|
100
|
+
\`\`\`markdown
|
|
101
|
+
[ ] !
|
|
102
|
+
|
|
103
|
+
[✨🔎] Ignore outer whitespace in the item search
|
|
104
|
+
|
|
105
|
+
## Goal
|
|
106
|
+
|
|
107
|
+
People pasting a query should get the same results as people typing it.
|
|
108
|
+
|
|
109
|
+
## Repository context
|
|
110
|
+
|
|
111
|
+
Paths below are relative to the project root:
|
|
112
|
+
|
|
113
|
+
- Read \`src/search/filterItems.ts\` for the current matching behavior.
|
|
114
|
+
- Extend \`src/search/filterItems.test.ts\` using its existing test style.
|
|
115
|
+
- Read \`AGENTS.md\` and the root \`README.md\` for development instructions.
|
|
116
|
+
|
|
117
|
+
## Requirements
|
|
118
|
+
|
|
119
|
+
- Trim leading and trailing whitespace from the query before matching.
|
|
120
|
+
- An empty or whitespace-only query returns all items, as an empty query does today.
|
|
121
|
+
- Preserve internal spaces, case matching, result order, and the input array.
|
|
122
|
+
|
|
123
|
+
## Scope
|
|
124
|
+
|
|
125
|
+
Change the search helper and its tests. Do not change the UI, dependencies, persistence, or unrelated matching
|
|
126
|
+
rules.
|
|
127
|
+
|
|
128
|
+
## Acceptance criteria
|
|
129
|
+
|
|
130
|
+
- Add cases for an empty query, only spaces, and a padded matching query.
|
|
131
|
+
- Keep an existing case proving that internal spaces retain their meaning.
|
|
132
|
+
- Run \`npm test -- --runInBand src/search/filterItems.test.ts\` and record the result.
|
|
133
|
+
- Review the diff for unchanged sorting and no input mutation.
|
|
134
|
+
\`\`\`
|
|
135
|
+
|
|
136
|
+
Acceptance criteria should be observable, with commands suitable for your actual test runner and any required
|
|
137
|
+
manual checks. Small bounded tasks are easier to review. Add another section only when it has enough context
|
|
138
|
+
to be implemented independently; section order alone does not enforce dependencies.
|
|
139
|
+
|
|
140
|
+
## Status and scheduling reference
|
|
141
|
+
|
|
142
|
+
The following status lines are recognized at the start of a section. The state names describe parser behavior;
|
|
143
|
+
they are not proof that a check passed.
|
|
144
|
+
|
|
145
|
+
| Status line | Parsed state | Priority | Meaning |
|
|
146
|
+
| -------------------------------------------- | ------------ | -------- | ----------------------------------------------------------------------------- |
|
|
147
|
+
| \`[ ]\` | todo | 0 | Pending, eligible after authoring and selection filters. |
|
|
148
|
+
| \`[ ] !!!\` | todo | 3 | Pending with higher scheduling priority. |
|
|
149
|
+
| \`[^]\` | in-progress | 0 | Started, not finished; not selected as a fresh task. |
|
|
150
|
+
| \`[x]\` | done | 0 | Completion recorded; inspect evidence and review before archiving. |
|
|
151
|
+
| \`[X]\` | done | 0 | Uppercase X is also accepted. |
|
|
152
|
+
| \`[!]\` | failed | 0 | Failed work; inspect the recorded reason before retrying. |
|
|
153
|
+
| \`[-]\` | not-ready | 0 | Draft or deliberately held work, excluded from execution. |
|
|
154
|
+
| \`[.]\` | not-ready | 0 | Alternative spelling of the same draft state. |
|
|
155
|
+
| \`[-] !!\` | not-ready | 0 | Exclamation marks do not make a draft runnable. |
|
|
156
|
+
| \`[.] !\` | not-ready | 0 | The alternative draft spelling also accepts whitespace and exclamation marks. |
|
|
157
|
+
| \`[^] implementation started\` | in-progress | 0 | Trailing progress information is accepted. |
|
|
158
|
+
| \`[x] by a developer; results below\` | done | 0 | Trailing completion information is accepted. |
|
|
159
|
+
| \`[X] reviewed; results below\` | done | 0 | Uppercase completion also accepts trailing information. |
|
|
160
|
+
| \`[!] acceptance check failed; details below\` | failed | 0 | Trailing failure information is accepted. |
|
|
161
|
+
|
|
162
|
+
Only \`x\` has an accepted letter-case variant. Surrounding whitespace is trimmed. Clean \`[-]\` / \`[.]\` lines
|
|
163
|
+
accept whitespace and \`!\` after the marker; put draft explanations on the following lines. \`[x]\`, \`[X]\`,
|
|
164
|
+
\`[^]\`, and \`[!]\` accept arbitrary trailing metadata. Keep a pending line to whitespace, priority marks, and
|
|
165
|
+
any intended targeting annotations below. Ordinary trailing prose without a backtick target (for example
|
|
166
|
+
\`[ ] implement search\`) makes that recognized status line not-ready, rather than providing a task title.
|
|
167
|
+
Unsupported prefixes such as \`[?]\` are ordinary content and can therefore become pending tasks: **do not use
|
|
168
|
+
\`[?]\` to skip work**.
|
|
169
|
+
|
|
170
|
+
Every \`!\` after a valid pending marker contributes one priority point, including marks before or after
|
|
171
|
+
targeting tokens. Higher priorities run first; \`!\` in the task body has no scheduling effect. Equal priorities
|
|
172
|
+
retain filename order from directory loading, then section order. Date numbers and emoji tags do not override
|
|
173
|
+
priority. \`--min-priority\` and \`--max-priority\` set inclusive bounds; \`--priority\` is an alias for the
|
|
174
|
+
minimum, not an exact-priority selector.
|
|
175
|
+
|
|
176
|
+
Backtick-delimited tokens on the pending status line target the selected harness, model, or Book agent. For
|
|
177
|
+
example, these are four separate task sections:
|
|
178
|
+
|
|
179
|
+
\`\`\`markdown
|
|
180
|
+
[ ] !! use \`gpt\`
|
|
181
|
+
|
|
182
|
+
Review search edge cases with a matching model family. Keep the current matching rules and document uncovered
|
|
183
|
+
cases.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
[ ] use \`openai-codex\` !!!
|
|
188
|
+
|
|
189
|
+
Add the agreed search regression tests with this harness. Run the project's focused search checks.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
[ ] use \`developer\`
|
|
194
|
+
|
|
195
|
+
Implement the reviewed search requirement with the Developer Book. Read the repository instructions before
|
|
196
|
+
changing the helper.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
[ ] use \`agents/developer.book\` or \`claude-code\` !
|
|
201
|
+
|
|
202
|
+
Review the search helper's test coverage. Report any missing cases without expanding the feature scope.
|
|
203
|
+
\`\`\`
|
|
204
|
+
|
|
205
|
+
Tokens are normalized and matched as substrings of the selected harness name, model name, or the Book's
|
|
206
|
+
path/name/title aliases. Multiple tokens are **alternatives** (any match), not an AND condition; words such as
|
|
207
|
+
\`use\`, \`model\`, and \`or\` are explanatory text. A token does not launch a different runner, switch models, or
|
|
208
|
+
select a Book for you. Omit targets to allow any runner. With no selection flags or runner environment
|
|
209
|
+
settings, \`ptbk coder list\` applies no runner/agent filter; a filtered list can differ from it.
|
|
210
|
+
|
|
211
|
+
Status, priority, and targeting affect scheduling and are removed from the implementation prompt. The body,
|
|
212
|
+
referenced context, and selected Book supply implementation instructions. Normal selection chooses pending,
|
|
213
|
+
fully authored, compatible sections. In-progress tasks need deliberate recovery; Coder's
|
|
214
|
+
\`--git-changes continue\` supports resuming a single interrupted task. Review failures before resetting them to
|
|
215
|
+
\`[ ]\`.
|
|
216
|
+
|
|
217
|
+
### Drafts and completion evidence
|
|
218
|
+
|
|
219
|
+
The literal placeholder \`@@@\` anywhere in the task text keeps a pending section out of the runnable queue.
|
|
220
|
+
Boilerplates and repair templates use it for missing requirements. Ordinary prose such as “TODO” or “needs
|
|
221
|
+
discussion” is not a skip mechanism. Use \`[-]\` or \`[.]\`, retain placeholders while writing, then review all
|
|
222
|
+
requirements, replace every placeholder, and change the first line to \`[ ]\` only when the task is ready.
|
|
223
|
+
\`ptbk coder find-unwritten\` helps locate pending sections with placeholders; inspect not-ready drafts
|
|
224
|
+
separately.
|
|
225
|
+
|
|
226
|
+
Runner-written completion lines may attribute implementation to a harness and model, include
|
|
227
|
+
reasoning/authentication labels, attempts or interrupted/continued history, and report implementation,
|
|
228
|
+
testing, fixing, or total cost/time information. Those are observed run metadata, not instructions, budgets,
|
|
229
|
+
or a frozen list of supported models. A completed status alone does not prove tests ran: direct runs only
|
|
230
|
+
execute an automated verification command when configured. Preserve actual measurements and record unknown
|
|
231
|
+
results or checks that were not run honestly. Manual users must not invent cost/time figures, copy another
|
|
232
|
+
run's attribution, or mark unverified work as verified. The textual metadata rows above demonstrate syntax
|
|
233
|
+
only; use them only when the described events actually happened.
|
|
234
|
+
|
|
235
|
+
## From discussion to a reviewed change
|
|
236
|
+
|
|
237
|
+
1. **Discuss and write:** establish the goal, repository context, scope, requirements, and acceptance checks.
|
|
238
|
+
Write a draft directly, use a template, or discuss it with a person or assistant. Keep unresolved tasks
|
|
239
|
+
not-ready.
|
|
240
|
+
2. **Review the PRD:** confirm assumptions against the code, settle open questions, and identify dependencies.
|
|
241
|
+
Leave dependent tasks not-ready until their prerequisites exist; filename or section order is not
|
|
242
|
+
dependency management.
|
|
243
|
+
3. **Make it runnable:** remove placeholders, set \`[ ]\`, and choose a priority or target only when needed.
|
|
244
|
+
Commit/review the specification according to the project's process.
|
|
245
|
+
4. **Select and implement:** inspect the ready queue, read repository instructions and referenced files, mark
|
|
246
|
+
the chosen section \`[^]\`, and implement only its scoped changes.
|
|
247
|
+
5. **Verify and record:** run the acceptance checks and inspect behavior. Record commands, results,
|
|
248
|
+
limitations, and accurate attribution. Mark successful, checked work \`[x]\`; record a failed attempt as
|
|
249
|
+
\`[!]\`, or hold unresolved requirements with \`[-]\` and explain why below it.
|
|
250
|
+
6. **Review and commit:** inspect source, tests, and PRD changes together. Review completed files before
|
|
251
|
+
archiving them into \`done/\`; keep pending or blocked sections in the active directory or move them into a
|
|
252
|
+
separate PRD first. Commit the intended changes under the project's normal review process.
|
|
253
|
+
|
|
254
|
+
### Using Promptbook Coder
|
|
255
|
+
|
|
256
|
+
Run commands from the project root. The examples assume \`ptbk\` is already available; see the optional links
|
|
257
|
+
below for installation. Harness execution needs that harness's installation and authentication. Reading,
|
|
258
|
+
editing, and manually implementing PRDs does not.
|
|
259
|
+
|
|
260
|
+
Every workspace command checks the enclosing Git working tree, including a parent monorepo, linked
|
|
261
|
+
worktree, or submodule. The selected project directory still owns its Books, prompts and configuration.
|
|
262
|
+
An unborn branch (a repository with no commits) and a local repository with no remote are valid.
|
|
263
|
+
\`ptbk init\` and \`ptbk coder init\` create missing Git metadata automatically, even with
|
|
264
|
+
\`--no-questions\`, and reuse existing Git without changing history, remotes, hooks, configuration or index.
|
|
265
|
+
They never stage pre-existing files or create an initial commit by default.
|
|
266
|
+
|
|
267
|
+
Other potentially mutating commands show the resolved target and ask once before \`git init\`; accepting
|
|
268
|
+
resumes the original command. Declining or cancelling stops it before setup, file writes or harness execution.
|
|
269
|
+
With \`--no-questions\` or noninteractive input, a missing repository fails immediately: run
|
|
270
|
+
\`ptbk init --no-questions\`, \`ptbk coder init --no-questions\`, or \`git init\` in the target directory,
|
|
271
|
+
then retry. Disabling commits does not disable this prerequisite. Listing and true \`--dry-run\` previews
|
|
272
|
+
only warn about missing Git and create no setup files. Missing Git itself, bare repositories, corrupt
|
|
273
|
+
metadata, ownership errors and permission failures require repair; they never trigger automatic initialization.
|
|
274
|
+
Remote pull/push options still require your configured remote and identity. Git creation finishes before
|
|
275
|
+
initialization-time synchronization; partial setup failures report completed steps and require review.
|
|
276
|
+
|
|
277
|
+
| Command | What it does |
|
|
278
|
+
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
279
|
+
| \`ptbk init\` / \`ptbk coder init\` | Initializes missing Git, then creates missing configuration, local Books, this guide, and fresh-directory boilerplates; preserves project-owned content. \`--no-questions\` skips installation questions/checks. |
|
|
280
|
+
| \`ptbk coder add "Describe the reviewed change"\` | Creates one numbered, tagged pending PRD. Accepts a description argument, stdin, or interactive input; \`--priority\` and \`--template\` are available. It does not discuss or implement the task. Review the generated requirements before running. |
|
|
281
|
+
| \`ptbk coder plan --harness openai-codex\` | Interactive planning with the local Planner. Review proposals; \`/save\` writes pending PRDs, \`/draft\` writes not-ready drafts, \`/discard\` drops proposals, \`/exit\` ends. It changes PRD Markdown only and never implements or starts the queue. Currently this planning command supports the Codex harness in a compatible interactive terminal. |
|
|
282
|
+
| \`ptbk coder list\` | Displays fully authored pending tasks grouped by descending priority without execution or file changes. Optional harness/model/agent and priority filters narrow the list. |
|
|
283
|
+
| \`ptbk coder run --harness openai-codex --limit 1 --no-commit --no-auto --test "npm test"\` | Confirms and implements one selected task, then runs the specified project check. Replace the test command as needed. Without \`--limit\`, execution proceeds through the eligible queue; without \`--no-commit\`, run stages and commits its changes. |
|
|
284
|
+
| \`ptbk coder verify\` | Human review helper: shows completion claims, offers archival or a repair section, and can also ask about pending tasks. It does not run acceptance tests itself. Archival moves the whole file to \`done/\`, so inspect every section before agreeing. There is no separate archive command. |
|
|
285
|
+
| \`ptbk coder find-unwritten\` | Lists pending sections still containing authoring placeholders; not-ready drafts are not included. |
|
|
286
|
+
| \`ptbk coder generate-boilerplates\` | Adds not-ready starter sections using reusable templates; author and review them before making them pending. |
|
|
287
|
+
|
|
288
|
+
For a review-before-commit run, first review and commit or stash existing work: the default run mode refuses a
|
|
289
|
+
dirty working tree. Use the \`--no-commit --no-auto --limit 1\` example, inspect the result, and commit it
|
|
290
|
+
yourself. Here \`--no-auto\` requests interactive confirmation and makes the no-commit mode valid without
|
|
291
|
+
ignoring existing changes. Init/add/plan/verify Git synchronization is opt-in with \`--commit\`; pushing and
|
|
292
|
+
pulling require the corresponding explicit options. Consult \`ptbk coder --help\` and the relevant subcommand's
|
|
293
|
+
\`--help\` for the installed version's full options.
|
|
294
|
+
|
|
295
|
+
The initialized \`npm run coder:run\` script supplies \`AGENTS.md\` as context, selects the Codex harness, and
|
|
296
|
+
uses \`npm run test-for-ptbk-coder\` for checks (including pre-run repair mode). The new check script delegates
|
|
297
|
+
to \`npm test\`; configure real tests for your project before running it. Existing npm scripts are preserved, so
|
|
298
|
+
read your \`package.json\` to see your actual commands. Direct \`ptbk coder run\` does not inherit npm-script
|
|
299
|
+
flags.
|
|
300
|
+
|
|
301
|
+
### Book agent, harness, and model
|
|
302
|
+
|
|
303
|
+
A **Book agent** is an editable \`.book\` file supplying a role, persona, instructions, identity, and routing
|
|
304
|
+
aliases. A **harness** is the tool that operates on the repository, such as Codex or Claude Code. A **model**
|
|
305
|
+
is the underlying model used by that harness. \`--agent\`, \`--harness\`, and \`--model\` select these
|
|
306
|
+
independently.
|
|
307
|
+
|
|
308
|
+
Init creates local Developer and Planner Books in \`agents/developer.book\` and \`agents/planner.book\`, their
|
|
309
|
+
Lawyer and Copywriter TEAM advisers, and shared \`agents/.core/adam.book\` instructions. Books can
|
|
310
|
+
inherit/import instructions; TEAM entries expose advisers for relevant consultations, not an obligation to
|
|
311
|
+
invoke everyone. \`run\` and \`server\` default to Developer; \`plan\` defaults to Planner.
|
|
312
|
+
\`--agent agents/my-developer.book\` overrides the Book only. \`list\` has no default Book filter. Selecting
|
|
313
|
+
Developer for \`plan\` still permits planning only.
|
|
314
|
+
|
|
315
|
+
Edit local Books to reflect this project's rules; repeat init preserves customizations and adds missing
|
|
316
|
+
defaults/helper references. An invalid explicit Book selection fails rather than silently changing roles.
|
|
317
|
+
Execution uses the current default model for the chosen harness unless \`--model\` or environment configuration
|
|
318
|
+
overrides it; no model version needs to be written into every PRD.
|
|
319
|
+
|
|
320
|
+
## Working manually or with another assistant
|
|
321
|
+
|
|
322
|
+
1. Choose one top-level PRD section that is pending, has no \`@@@\`, and has no unresolved prerequisites.
|
|
323
|
+
Respect any deliberate targeting constraints or discuss changing them. Treat this README, templates,
|
|
324
|
+
history, and traces as context, never as queued tasks.
|
|
325
|
+
2. Read the whole selected section, the root \`README.md\`, \`AGENTS.md\` if present, and each relevant
|
|
326
|
+
source/test file. Confirm the request still makes sense. If requirements are incomplete, set \`[-]\` and
|
|
327
|
+
record the missing decisions instead of guessing.
|
|
328
|
+
3. Hand that section and its repository context to your preferred assistant, or implement it yourself. Ask for
|
|
329
|
+
only the stated scope, actual acceptance checks, and an honest result report. Mark the task \`[^]\` so
|
|
330
|
+
collaborators can see it is being worked on.
|
|
331
|
+
4. Implement, run the project's required tests and the PRD's specific acceptance checks, and inspect any
|
|
332
|
+
required UI or behavioral results. Record what ran and what passed or failed in a result paragraph inside
|
|
333
|
+
the same section. Do not insert a \`---\` before that paragraph: it would create another task.
|
|
334
|
+
5. Use \`[x]\` after the scoped work and checks succeed. Use \`[!]\` for an unsuccessful attempt, or \`[-]\` for a
|
|
335
|
+
task waiting on decisions; keep the explanation in the body. If stopping mid-implementation, retain \`[^]\`
|
|
336
|
+
and describe remaining work. Leave unavailable checks explicitly unverified and do not claim verified
|
|
337
|
+
completion.
|
|
338
|
+
6. Run \`git status\` and \`git diff\` from the root. Review the implementation, tests, status, and evidence;
|
|
339
|
+
inspect untracked files too. Archive only fully reviewed files with no work that should remain active,
|
|
340
|
+
adjust relative links as needed, and stage the specific intended paths. Inspect \`git diff --cached\` before
|
|
341
|
+
committing. Follow the repository's normal pull-request/review process.
|
|
342
|
+
|
|
343
|
+
These steps work offline with ordinary repository tools; no Promptbook-specific state needs to be
|
|
344
|
+
reconstructed to understand the task.
|
|
345
|
+
|
|
346
|
+
## Optional further reading
|
|
347
|
+
|
|
348
|
+
- [Promptbook Coder website](https://coder.ptbk.io)
|
|
349
|
+
- [Promptbook repository](https://github.com/webgptorg/promptbook)
|
|
350
|
+
- [Coder workflow and command documentation](https://github.com/webgptorg/promptbook/blob/main/scripts/run-codex-prompts/README.md)
|
|
351
|
+
- [Planning workflow documentation](https://github.com/webgptorg/promptbook/blob/main/src/cli/cli-commands/coder/planning/README.md)
|
|
352
|
+
|
|
353
|
+
The links add background; the requirements, annotations, and manual workflow needed to use this directory are
|
|
354
|
+
explained above.
|
|
355
|
+
`);
|
|
356
|
+
|
|
357
|
+
// Note: [🟡] Coder documentation must never be published outside of `@promptbook/cli`.
|
|
358
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { lstat, readFile } from 'fs/promises';
|
|
2
|
+
import { spaceTrim } from 'spacetrim';
|
|
3
|
+
import { parseAgentSourceWithCommitments } from '../../../book-2.0/agent-source/parseAgentSourceWithCommitments';
|
|
4
|
+
import type { string_book } from '../../../book-2.0/agent-source/string_book';
|
|
5
|
+
import { getCommitmentDefinition } from '../../../commitments/_common/getCommitmentDefinition';
|
|
6
|
+
import { ParseError } from '../../../errors/ParseError';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Reads a project-owned Book before initialization, refusing unsafe edits while preserving its original bytes.
|
|
10
|
+
* Unknown commitments remain supported, as in the normal Book parser.
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of `coder init`
|
|
13
|
+
*/
|
|
14
|
+
export async function readCoderAgentBook(filePath: string): Promise<string_book> {
|
|
15
|
+
const entry = await lstat(filePath);
|
|
16
|
+
if (!entry.isFile()) {
|
|
17
|
+
throw new ParseError(
|
|
18
|
+
spaceTrim(
|
|
19
|
+
`Expected a regular Book file at \`${filePath}\`; directories and symbolic links are left untouched.`,
|
|
20
|
+
),
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const bytes = await readFile(filePath);
|
|
25
|
+
const source = bytes.toString('utf-8') as string_book;
|
|
26
|
+
if (!Buffer.from(source, 'utf-8').equals(bytes) || source.includes('\0')) {
|
|
27
|
+
throw new ParseError(spaceTrim(`Book \`${filePath}\` is not valid UTF-8 text.`));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const parsed = parseAgentSourceWithCommitments(source);
|
|
31
|
+
if (!parsed.agentName) {
|
|
32
|
+
throw new ParseError(spaceTrim(`Book \`${filePath}\` is empty or has no agent name.`));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let isInsideCodeBlock = false;
|
|
36
|
+
for (const line of source.split(/\r?\n/).slice(parsed.agentNameLineNumber)) {
|
|
37
|
+
if (line.trim().startsWith('```')) {
|
|
38
|
+
isInsideCodeBlock = !isInsideCodeBlock;
|
|
39
|
+
} else if (!isInsideCodeBlock && /^(?:<{7}|={7}|>{7})(?:\s|$)/.test(line)) {
|
|
40
|
+
throw new ParseError(spaceTrim(`Book \`${filePath}\` contains unresolved merge markers.`));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (isInsideCodeBlock) {
|
|
44
|
+
throw new ParseError(spaceTrim(`Book \`${filePath}\` contains an unclosed code block.`));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
for (const commitment of parsed.commitments) {
|
|
48
|
+
// FROM may disable inheritance, and OPEN is valid without its optional teacher instructions.
|
|
49
|
+
if (
|
|
50
|
+
!['FROM', 'OPEN'].includes(commitment.type) &&
|
|
51
|
+
!commitment.content &&
|
|
52
|
+
!getCommitmentDefinition(commitment.type)?.createRegex().test(commitment.type)
|
|
53
|
+
) {
|
|
54
|
+
throw new ParseError(
|
|
55
|
+
spaceTrim(
|
|
56
|
+
`Book \`${filePath}\` has an empty \`${commitment.type}\` commitment on line ${commitment.lineNumber}.`,
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return source;
|
|
62
|
+
}
|
|
@@ -7,6 +7,9 @@ import { assertsError } from '../../../errors/assertsError';
|
|
|
7
7
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
8
8
|
import { createPositiveIntegerOptionParser } from '../common/createPositiveIntegerOptionParser';
|
|
9
9
|
import { $assertSufficientFreeDiskSpace } from '../common/disk-space/$assertSufficientFreeDiskSpace';
|
|
10
|
+
import { validateCoderRunOptions } from '../common/validateCoderRunOptions';
|
|
11
|
+
import { $preflightWorkspaceRepository } from '../common/workspaceRepository';
|
|
12
|
+
import { addWorkspaceRepositoryOptions } from '../common/workspaceRepositoryCliOptions';
|
|
10
13
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
11
14
|
import { $ensureHarnessInstallations } from '../common/harness/$ensureHarnessInstallations';
|
|
12
15
|
import {
|
|
@@ -47,7 +50,7 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
47
50
|
command.description(
|
|
48
51
|
spaceTrim(
|
|
49
52
|
(block) => `
|
|
50
|
-
Execute coding prompts through selected
|
|
53
|
+
Execute coding prompts with the project's Developer Book through the selected harness
|
|
51
54
|
|
|
52
55
|
${block(PROMPT_RUNNER_DESCRIPTION)}
|
|
53
56
|
|
|
@@ -66,6 +69,7 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
66
69
|
- Saves the run trace of every round into prompts/traces/, named after its prompt file
|
|
67
70
|
- Optional --preserve-logs keeps temp prompt/log artifacts after successful rounds
|
|
68
71
|
- Optional --no-ui keeps plain streaming console output for logging and debugging
|
|
72
|
+
- The dashboard starts in Normal output; press O to toggle Raw output without restarting the task
|
|
69
73
|
- Refuses to start on a nearly full disk and pauses the run when the free disk space becomes critical, unless --no-questions is used
|
|
70
74
|
- Checks that the selected harness is installed and up to date before the first prompt unless --no-questions is used
|
|
71
75
|
- Offers to add missing project-local ignore rules for the selected harness
|
|
@@ -73,7 +77,7 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
73
77
|
- Supports GPG signing of commits
|
|
74
78
|
- Optional pre-coding test run that can stop or repair pre-existing failures
|
|
75
79
|
- Optional post-prompt verification with test-feedback retries
|
|
76
|
-
- Progress tracking and interactive P/S/X terminal controls
|
|
80
|
+
- Progress tracking and interactive P/S/X terminal controls; O changes only the dashboard output view
|
|
77
81
|
- Dry-run mode to preview prompts
|
|
78
82
|
`,
|
|
79
83
|
),
|
|
@@ -82,7 +86,7 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
82
86
|
command.option('--dry-run', 'Print unwritten prompts without executing', false);
|
|
83
87
|
addPromptRunnerSelectionOptions(command);
|
|
84
88
|
addQuestionsOption(command);
|
|
85
|
-
addCoderAgentOption(command);
|
|
89
|
+
addCoderAgentOption(command, 'developer');
|
|
86
90
|
command.option(
|
|
87
91
|
'--context <context-or-file>',
|
|
88
92
|
'Append extra instructions either inline or from a file path relative to the current project',
|
|
@@ -158,6 +162,8 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
158
162
|
'Allow auto-migrate even when heuristic SQL safety check flags destructive pending migrations',
|
|
159
163
|
);
|
|
160
164
|
|
|
165
|
+
addWorkspaceRepositoryOptions(command);
|
|
166
|
+
|
|
161
167
|
command.action(
|
|
162
168
|
handleActionErrors(async (cliOptions) => {
|
|
163
169
|
const {
|
|
@@ -216,17 +222,6 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
216
222
|
|
|
217
223
|
assertUserConfirmationIsAllowed({ ...questionsOptions, isWaitingForUser: waitForUser });
|
|
218
224
|
|
|
219
|
-
// Note: Checked before anything is installed or written, because installing a harness, updating the
|
|
220
|
-
// Promptbook CLI and coding itself all need the disk space which is missing
|
|
221
|
-
await $assertSufficientFreeDiskSpace(process.cwd());
|
|
222
|
-
|
|
223
|
-
if (await $ensurePromptbookCliInstallations(questionsOptions)) {
|
|
224
|
-
return process.exit(0);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
await $ensureHarnessInstallations([runnerOptions.agentName], questionsOptions);
|
|
228
|
-
await $ensureCoderHarnessGitignoreRules(process.cwd(), runnerOptions.agentName, questionsOptions);
|
|
229
|
-
|
|
230
225
|
const waitAfterPrompt = parseOptionalWaitDuration(waitAfterPromptValue, 0);
|
|
231
226
|
const waitBetweenPrompts = parseOptionalWaitDuration(waitBetweenPromptsValue, 0);
|
|
232
227
|
const waitAfterError = parseOptionalWaitDuration(waitAfterErrorValue, DEFAULT_WAIT_AFTER_ERROR_MS);
|
|
@@ -263,12 +258,39 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
263
258
|
isAskingQuestionsEnabled: questionsOptions.isAskingQuestionsEnabled,
|
|
264
259
|
};
|
|
265
260
|
|
|
261
|
+
validateCoderRunOptions(runOptions);
|
|
262
|
+
const workspace = await $preflightWorkspaceRepository({
|
|
263
|
+
policy: dryRun ? 'read-only' : 'mutate',
|
|
264
|
+
...questionsOptions,
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
if (!dryRun) {
|
|
268
|
+
// Reject missing or unreadable Books before offering installations or project configuration writes.
|
|
269
|
+
const { resolveCoderAgentBook } = await import(
|
|
270
|
+
'../../../../scripts/run-codex-prompts/common/resolveCoderAgent'
|
|
271
|
+
);
|
|
272
|
+
await resolveCoderAgentBook(agent, workspace.projectPath, { defaultRole: 'developer' });
|
|
273
|
+
// Check disk space before installations and repository writes; previews require no setup.
|
|
274
|
+
await $assertSufficientFreeDiskSpace(workspace.projectPath);
|
|
275
|
+
|
|
276
|
+
if (await $ensurePromptbookCliInstallations(questionsOptions)) {
|
|
277
|
+
return process.exit(0);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
await $ensureHarnessInstallations([runnerOptions.agentName], questionsOptions);
|
|
281
|
+
await $ensureCoderHarnessGitignoreRules(
|
|
282
|
+
workspace.projectPath,
|
|
283
|
+
runnerOptions.agentName,
|
|
284
|
+
questionsOptions,
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
|
|
266
288
|
// Note: Import the function dynamically to avoid loading heavy dependencies until needed
|
|
267
289
|
const { runCodexPrompts } = await import('../../../../scripts/run-codex-prompts/main/runCodexPrompts');
|
|
268
290
|
|
|
269
291
|
try {
|
|
270
292
|
// Override process.argv to pass options to the legacy parseRunOptions if needed
|
|
271
|
-
await runCodexPrompts(runOptions);
|
|
293
|
+
await runCodexPrompts({ ...runOptions, workspace });
|
|
272
294
|
} catch (error) {
|
|
273
295
|
assertsError(error);
|
|
274
296
|
printCoderRunFailure(error);
|
|
@@ -9,6 +9,9 @@ import { NotAllowed } from '../../../errors/NotAllowed';
|
|
|
9
9
|
import type { number_port } from '../../../types/number_positive';
|
|
10
10
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
11
11
|
import { $assertSufficientFreeDiskSpace } from '../common/disk-space/$assertSufficientFreeDiskSpace';
|
|
12
|
+
import { validateCoderRunOptions } from '../common/validateCoderRunOptions';
|
|
13
|
+
import { $preflightWorkspaceRepository } from '../common/workspaceRepository';
|
|
14
|
+
import { addWorkspaceRepositoryOptions } from '../common/workspaceRepositoryCliOptions';
|
|
12
15
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
13
16
|
import { $ensureHarnessInstallations } from '../common/harness/$ensureHarnessInstallations';
|
|
14
17
|
import {
|
|
@@ -60,7 +63,7 @@ export function $initializeCoderServerCommand(program: Program): $side_effect {
|
|
|
60
63
|
${block(QUESTIONS_DESCRIPTION)}
|
|
61
64
|
|
|
62
65
|
Features:
|
|
63
|
-
- Runs the same prompt processing as \`ptbk coder run\`
|
|
66
|
+
- Runs the same prompt processing and Developer Book default as \`ptbk coder run\`
|
|
64
67
|
- Refuses to start on a nearly full disk and pauses the run when the free disk space becomes critical, unless --no-questions is used
|
|
65
68
|
- Checks that the selected harness is installed and up to date on startup unless --no-questions is used
|
|
66
69
|
- Offers to add missing project-local ignore rules for the selected harness
|
|
@@ -81,7 +84,7 @@ export function $initializeCoderServerCommand(program: Program): $side_effect {
|
|
|
81
84
|
command.option('--dry-run', 'Print unwritten prompts without executing', false);
|
|
82
85
|
addPromptRunnerSelectionOptions(command);
|
|
83
86
|
addQuestionsOption(command);
|
|
84
|
-
addCoderAgentOption(command);
|
|
87
|
+
addCoderAgentOption(command, 'developer');
|
|
85
88
|
command.option(
|
|
86
89
|
'--context <context-or-file>',
|
|
87
90
|
'Append extra instructions either inline or from a file path relative to the current project',
|
|
@@ -132,6 +135,8 @@ export function $initializeCoderServerCommand(program: Program): $side_effect {
|
|
|
132
135
|
'Allow auto-migrate even when heuristic SQL safety check flags destructive pending migrations',
|
|
133
136
|
);
|
|
134
137
|
|
|
138
|
+
addWorkspaceRepositoryOptions(command);
|
|
139
|
+
|
|
135
140
|
command.action(
|
|
136
141
|
handleActionErrors(async (cliOptions) => {
|
|
137
142
|
const {
|
|
@@ -181,13 +186,6 @@ export function $initializeCoderServerCommand(program: Program): $side_effect {
|
|
|
181
186
|
|
|
182
187
|
assertUserConfirmationIsAllowed({ ...questionsOptions, isWaitingForUser: waitForUser });
|
|
183
188
|
|
|
184
|
-
// Note: Checked before anything is installed or written, because installing a harness and coding
|
|
185
|
-
// itself both need the disk space which is missing
|
|
186
|
-
await $assertSufficientFreeDiskSpace(process.cwd());
|
|
187
|
-
|
|
188
|
-
await $ensureHarnessInstallations([runnerOptions.agentName], questionsOptions);
|
|
189
|
-
await $ensureCoderHarnessGitignoreRules(process.cwd(), runnerOptions.agentName, questionsOptions);
|
|
190
|
-
|
|
191
189
|
const waitAfterPrompt = parseOptionalWaitDuration(waitAfterPromptValue, 0);
|
|
192
190
|
const waitBetweenPrompts = parseOptionalWaitDuration(waitBetweenPromptsValue, 0);
|
|
193
191
|
const waitAfterError = parseOptionalWaitDuration(waitAfterErrorValue, DEFAULT_WAIT_AFTER_ERROR_MS);
|
|
@@ -221,13 +219,36 @@ export function $initializeCoderServerCommand(program: Program): $side_effect {
|
|
|
221
219
|
isAskingQuestionsEnabled: questionsOptions.isAskingQuestionsEnabled,
|
|
222
220
|
};
|
|
223
221
|
|
|
222
|
+
validateCoderRunOptions(runOptions);
|
|
223
|
+
const workspace = await $preflightWorkspaceRepository({
|
|
224
|
+
policy: dryRun ? 'read-only' : 'mutate',
|
|
225
|
+
...questionsOptions,
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
if (!dryRun) {
|
|
229
|
+
// Reject missing or unreadable Books before offering installations or project configuration writes.
|
|
230
|
+
const { resolveCoderAgentBook } = await import(
|
|
231
|
+
'../../../../scripts/run-codex-prompts/common/resolveCoderAgent'
|
|
232
|
+
);
|
|
233
|
+
await resolveCoderAgentBook(agent, workspace.projectPath, { defaultRole: 'developer' });
|
|
234
|
+
// Check disk space before installations and repository writes; previews require no setup.
|
|
235
|
+
await $assertSufficientFreeDiskSpace(workspace.projectPath);
|
|
236
|
+
|
|
237
|
+
await $ensureHarnessInstallations([runnerOptions.agentName], questionsOptions);
|
|
238
|
+
await $ensureCoderHarnessGitignoreRules(
|
|
239
|
+
workspace.projectPath,
|
|
240
|
+
runnerOptions.agentName,
|
|
241
|
+
questionsOptions,
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
224
245
|
// Note: Import dynamically to avoid loading heavy dependencies until needed
|
|
225
246
|
const { runCodexPromptsServer } = await import(
|
|
226
247
|
'../../../../scripts/run-codex-prompts/main/runCodexPromptsServer'
|
|
227
248
|
);
|
|
228
249
|
|
|
229
250
|
try {
|
|
230
|
-
await runCodexPromptsServer(runOptions);
|
|
251
|
+
await runCodexPromptsServer({ ...runOptions, workspace });
|
|
231
252
|
} catch (error) {
|
|
232
253
|
assertsError(error);
|
|
233
254
|
printCoderRunFailure(error);
|