@bastani/atomic 0.8.29-alpha.2 → 0.8.29-alpha.4
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/CHANGELOG.md +14 -6
- package/dist/builtin/cursor/package.json +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/CHANGELOG.md +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +4 -4
- package/dist/builtin/subagents/README.md +4 -4
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.ts +14 -0
- package/dist/builtin/subagents/src/extension/schemas.ts +1 -1
- package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +1 -6
- package/dist/builtin/subagents/src/runs/foreground/execution.ts +1 -6
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +0 -1
- package/dist/builtin/subagents/src/runs/shared/pi-args.ts +0 -1
- package/dist/builtin/subagents/src/runs/shared/structured-output.ts +16 -285
- package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +1 -9
- package/dist/builtin/subagents/src/shared/types.ts +4 -4
- package/dist/builtin/subagents/src/slash/saved-chain-mapping.ts +3 -18
- package/dist/builtin/web-access/CHANGELOG.md +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +12 -5
- package/dist/builtin/workflows/README.md +10 -8
- package/dist/builtin/workflows/builtin/deep-research-codebase.ts +9 -49
- package/dist/builtin/workflows/builtin/goal.ts +68 -155
- package/dist/builtin/workflows/builtin/index.d.ts +2 -0
- package/dist/builtin/workflows/builtin/open-claude-design.ts +42 -110
- package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
- package/dist/builtin/workflows/builtin/ralph.ts +235 -565
- package/dist/builtin/workflows/builtin/shared-prompts.ts +7 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.ts +17 -0
- package/dist/builtin/workflows/src/extension/wiring.ts +55 -8
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +2 -29
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +1 -5
- package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +1 -1
- package/dist/builtin/workflows/src/shared/types.ts +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +7 -7
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/resource-loader.d.ts +2 -2
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +3 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +2 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +0 -36
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/structured-output.d.ts +7 -18
- package/dist/core/tools/structured-output.d.ts.map +1 -1
- package/dist/core/tools/structured-output.js +9 -89
- package/dist/core/tools/structured-output.js.map +1 -1
- package/dist/core/tools/todos.d.ts +1 -0
- package/dist/core/tools/todos.d.ts.map +1 -1
- package/dist/core/tools/todos.js +4 -0
- package/dist/core/tools/todos.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/docs/extensions.md +1 -1
- package/docs/quickstart.md +3 -3
- package/docs/sdk.md +1 -1
- package/docs/subagents.md +4 -6
- package/docs/usage.md +1 -1
- package/docs/workflows.md +23 -19
- package/package.json +2 -2
|
@@ -803,7 +803,6 @@ export interface RunSyncOptions {
|
|
|
803
803
|
schema: JsonSchemaObject;
|
|
804
804
|
schemaPath: string;
|
|
805
805
|
outputPath: string;
|
|
806
|
-
metadataPath: string;
|
|
807
806
|
};
|
|
808
807
|
acceptance?: AcceptanceInput;
|
|
809
808
|
acceptanceContext?: {
|
|
@@ -1008,8 +1007,9 @@ export function resolveWorkflowStageMaxSubagentDepth(
|
|
|
1008
1007
|
): number {
|
|
1009
1008
|
const maxDepth = resolveCurrentMaxSubagentDepth(configMaxDepth);
|
|
1010
1009
|
return isWorkflowStageOrchestrationContext(ctx)
|
|
1011
|
-
// Workflow stages
|
|
1012
|
-
//
|
|
1010
|
+
// Workflow stages use the same two-hop default as main chat. A 0-depth
|
|
1011
|
+
// constraint still preserves one child-subagent hop so configured workflow
|
|
1012
|
+
// stages can delegate at least once.
|
|
1013
1013
|
? Math.min(maxDepth, Math.max(1, ctx.orchestrationContext?.constraints.maxSubagentDepth ?? 1))
|
|
1014
1014
|
: maxDepth;
|
|
1015
1015
|
}
|
|
@@ -1030,7 +1030,7 @@ export function resolveSubagentDepthPolicy(
|
|
|
1030
1030
|
}
|
|
1031
1031
|
|
|
1032
1032
|
function workflowStageSubagentDepthMessage(depth: number, maxDepth: number, action: "call" | "resume" = "call"): string {
|
|
1033
|
-
return `Nested subagent ${action} blocked (depth=${depth}, max=${maxDepth}). Sub-agents inside workflow stages
|
|
1033
|
+
return `Nested subagent ${action} blocked (depth=${depth}, max=${maxDepth}). Sub-agents inside workflow stages are running at the maximum nesting depth.`;
|
|
1034
1034
|
}
|
|
1035
1035
|
|
|
1036
1036
|
export function subagentDepthBlockedMessage(
|
|
@@ -1,36 +1,22 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import type { ChainConfig } from "../agents/agents.ts";
|
|
4
|
-
import { assertJsonSchemaDescriptor, assertStructuredOutputParameterSchema } from "../runs/shared/structured-output.ts";
|
|
5
4
|
import { isDynamicParallelStep, isParallelStep, type ChainStep } from "../shared/settings.ts";
|
|
6
5
|
import type { JsonSchemaObject } from "../shared/types.ts";
|
|
7
6
|
|
|
8
7
|
function loadSavedOutputSchema(
|
|
9
8
|
chain: ChainConfig,
|
|
10
|
-
|
|
9
|
+
_stepAgent: string,
|
|
11
10
|
outputSchema: unknown,
|
|
12
|
-
options: { schemaRole: "tool-parameters" | "collection" } = { schemaRole: "tool-parameters" },
|
|
13
11
|
): JsonSchemaObject | undefined {
|
|
14
12
|
if (outputSchema === undefined) return undefined;
|
|
15
|
-
const labelForSchema = (schemaPath?: string): string => schemaPath
|
|
16
|
-
? `outputSchema for chain '${chain.name}' step '${stepAgent}' (${schemaPath})`
|
|
17
|
-
: `outputSchema for chain '${chain.name}' step '${stepAgent}'`;
|
|
18
|
-
const validateSavedSchema = (schema: unknown, label: string): JsonSchemaObject => {
|
|
19
|
-
if (options.schemaRole === "collection") {
|
|
20
|
-
assertJsonSchemaDescriptor(schema, label);
|
|
21
|
-
} else {
|
|
22
|
-
assertStructuredOutputParameterSchema(schema, label);
|
|
23
|
-
}
|
|
24
|
-
return schema;
|
|
25
|
-
};
|
|
26
13
|
if (typeof outputSchema === "string") {
|
|
27
14
|
const schemaPath = path.isAbsolute(outputSchema)
|
|
28
15
|
? outputSchema
|
|
29
16
|
: path.join(path.dirname(chain.filePath), outputSchema);
|
|
30
|
-
|
|
31
|
-
return validateSavedSchema(parsed, labelForSchema(schemaPath));
|
|
17
|
+
return JSON.parse(fs.readFileSync(schemaPath, "utf-8")) as JsonSchemaObject;
|
|
32
18
|
}
|
|
33
|
-
return
|
|
19
|
+
return outputSchema as JsonSchemaObject;
|
|
34
20
|
}
|
|
35
21
|
|
|
36
22
|
export function mapSavedChainSteps(chain: ChainConfig, worktree = false): ChainStep[] {
|
|
@@ -50,7 +36,6 @@ export function mapSavedChainSteps(chain: ChainConfig, worktree = false): ChainS
|
|
|
50
36
|
chain,
|
|
51
37
|
`${step.collect.as} collection`,
|
|
52
38
|
step.collect.outputSchema,
|
|
53
|
-
{ schemaRole: "collection" },
|
|
54
39
|
);
|
|
55
40
|
return {
|
|
56
41
|
...step,
|
|
@@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file.
|
|
|
6
6
|
|
|
7
7
|
### Changed
|
|
8
8
|
|
|
9
|
-
- Published a synchronized Atomic 0.8.29-alpha.
|
|
9
|
+
- Published a synchronized Atomic 0.8.29-alpha.4 prerelease with the upstream pi TUI dependency aligned to `^0.79.3`; no functional changes were made in the web-access extension.
|
|
10
10
|
|
|
11
11
|
## [0.8.28] - 2026-06-11
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.8.29-alpha.
|
|
3
|
+
"version": "0.8.29-alpha.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
|
|
6
6
|
"contributors": [
|
|
@@ -8,21 +8,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
8
8
|
|
|
9
9
|
### Added
|
|
10
10
|
|
|
11
|
-
- Added opt-in schema-backed workflow item results: `ctx.stage(..., { schema })`, `ctx.task(..., { schema })`, `ctx.chain` items, and `ctx.parallel` items now receive a schema-specific `structured_output` tool only for that item,
|
|
11
|
+
- Added opt-in schema-backed workflow item results: `ctx.stage(..., { schema })`, `ctx.task(..., { schema })`, `ctx.chain` items, and `ctx.parallel` items now receive a schema-specific `structured_output` tool only for that item, return the captured value from `ctx.stage().prompt(...)`, and expose parsed task values as `result.structured` while preserving formatted JSON handoff text ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
|
|
12
12
|
|
|
13
13
|
### Changed
|
|
14
14
|
|
|
15
|
+
- Changed the builtin `ralph` workflow to start each iteration with `/skill:prompt-engineer` prompt-engineering and `/skill:research-codebase` research instead of an RFC/planner stage, pass the resulting research artifact to the orchestrator as primary implementation context, fork follow-up research from prior research session data, and feed unresolved reviewer findings into subsequent research passes ([#1371](https://github.com/bastani-inc/atomic/issues/1371)).
|
|
16
|
+
- Changed builtin `goal`, `ralph`, and `open-claude-design` decision gates to use schema-backed workflow `structured_output` stages with TypeBox-native schema builders instead of registering bespoke terminating custom tools or wrapping plain JSON schemas with `Type.Unsafe`.
|
|
17
|
+
- Changed the builtin `ralph` prompt-engineering stage to disable all tools while relying on the `/skill:prompt-engineer` skill prompt, keeping that first-pass rewrite focused and tool-free.
|
|
18
|
+
- Changed builtin `goal` worker/reviewer prompts and `ralph` orchestrator/reviewer prompts to request end-to-end verification when practical, using browser-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios.
|
|
15
19
|
- Aligned the workflows extension with upstream pi TUI `^0.79.3` so workflow graph, custom UI, and prompt-broker integrations inherit the latest shared TUI compatibility fixes.
|
|
16
|
-
- Documented the opt-in `structured_output` workflow path and clarified that ordinary workflow stages do not receive `structured_output` from the default tool registry; schema-enabled items auto-add the runtime tool to explicit `tools` allowlists ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
|
|
17
|
-
-
|
|
18
|
-
- Documented that terminating workflow-stage `structured_output` JSON stays inline even when large, while artifact-sized handoffs should still be saved to files when downstream stages do not need the full payload in context ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
|
|
20
|
+
- Documented the opt-in `structured_output` workflow path and clarified that ordinary workflow stages do not receive `structured_output` from the default tool registry; schema-enabled items auto-add the runtime tool to explicit `tools` allowlists without adding extra workflow prompt text about the tool ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
|
|
21
|
+
- Removed top-level-object restrictions from workflow `structured_output` gate schemas; Atomic now passes any plain JSON Schema object directly to the tool and documents the one-`prompt()` limit for schema-backed `StageContext` result contracts ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
|
|
19
22
|
|
|
20
23
|
### Fixed
|
|
21
24
|
|
|
22
|
-
- Fixed direct workflow tool validation so schema-enabled `task`, `tasks`, `chain`, and `parallel` items
|
|
25
|
+
- Fixed direct workflow tool validation so schema-enabled `task`, `tasks`, `chain`, and `parallel` items accept plain JSON Schema objects without additional object-root constraints ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
|
|
23
26
|
- Fixed schema-backed workflow stages to fail with a clear stage-level error when `prompt()` is called more than once on the same `StageContext`, rather than surfacing the lower-level structured-output single-use guard ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
|
|
24
27
|
- Fixed schema-backed workflow model fallback so an attempt that already captured a valid terminating `structured_output` result is treated as successful instead of retrying against fallback models and tripping the single-use result guard ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
|
|
25
28
|
- Fixed the workflow graph overlay remaining interactive when the parent/main-chat agent opens `ask_user_question`: the graph keeps focus, the parent question stays pending behind it with a clear “Main chat needs input — exit graph to answer.” status hint, hiding/exiting the graph focuses the pending question, and host custom-UI state changes no longer hide, restore, remount, or repaint the overlay ([#1353](https://github.com/bastani-inc/atomic/issues/1353)).
|
|
29
|
+
- Fixed builtin `ralph` skill-prompt stages to invoke bundled skills through `/skill:<name>` expansion so prompt engineering and research stages receive the intended skill instructions.
|
|
30
|
+
- Fixed concurrent workflow stage resource reloads to serialize temporary subagent child environment isolation so parallel stage startup cannot leave parent process child flags accidentally cleared.
|
|
31
|
+
- Fixed workflow stage sessions to keep bundled workflow package skills (`create-spec`, `impeccable`, `prompt-engineer`, `research-codebase`, and `skill-creator`) available while still disabling only the recursive workflows extension inside child sessions.
|
|
32
|
+
- Fixed workflow stage resource discovery so bundled subagent definitions stay available, `subagent` is active by default with the same two-hop nesting budget as main chat, and explicitly allowlisted bundled extension tools such as `subagent`, `web_search`, `fetch_content`, and `intercom` remain visible even when a workflow is launched from a subagent child process.
|
|
26
33
|
|
|
27
34
|
## [0.8.28] - 2026-06-11
|
|
28
35
|
|
|
@@ -280,7 +280,9 @@ const decision = await ctx.stage("review-gate", { schema: Decision }).prompt(
|
|
|
280
280
|
// decision.approved is typed from the schema.
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
-
Atomic registers the canonical `structured_output` tool only for schema-enabled items
|
|
283
|
+
Atomic registers the canonical `structured_output` tool only for schema-enabled items and automatically adds it to explicit `tools` allowlists. The schema is used directly as the tool argument contract. A schema-backed `StageContext` supports one `prompt()` call because the final-answer tool is a single result contract; create another `ctx.stage(..., { schema })` for another structured prompt. `ctx.task`/`ctx.chain`/`ctx.parallel` results expose the captured value as `result.structured` and keep `result.text` as formatted JSON for handoffs.
|
|
284
|
+
|
|
285
|
+
`subagent` is available as a default workflow-stage tool with the same default two-hop nesting budget as main chat: a stage can launch a subagent, and that child can launch one nested subagent before the guard blocks further delegation. `tools` allowlists apply to bundled extension tools as well as built-ins; if a stage sets `tools`, list every tool it should see. Workflow stages can explicitly list `subagent`, `web_search`, `fetch_content`, `intercom`, and other loaded extension tools, while `excludedTools` and `noTools: "all"` still win. Bundled `@bastani/subagents` agent definitions are available to the `subagent` tool in workflow stages, including workflows launched from a subagent child process.
|
|
284
286
|
|
|
285
287
|
### Model fallbacks
|
|
286
288
|
|
|
@@ -589,7 +591,7 @@ Child workflow outputs: `result`, `findings`, `research_doc_path`, `artifact_dir
|
|
|
589
591
|
|
|
590
592
|
### `goal`
|
|
591
593
|
|
|
592
|
-
Goal Runner workflow: initialize a persisted goal ledger with a per-run goal id and lifecycle events, render goal-continuation context, run bounded worker LM turns, append receipts, run three independent reviewers, and let a TypeScript reducer decide `complete`, `continue`, `blocked`, or `needs_human`. Token budget behavior is intentionally excluded.
|
|
594
|
+
Goal Runner workflow: initialize a persisted goal ledger with a per-run goal id and lifecycle events, render goal-continuation context, run bounded worker LM turns, append receipts, run three independent reviewers, and let a TypeScript reducer decide `complete`, `continue`, `blocked`, or `needs_human`. Workers and reviewers are prompted to verify user-visible behavior end-to-end when practical with browser-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios. Token budget behavior is intentionally excluded.
|
|
593
595
|
|
|
594
596
|
```text
|
|
595
597
|
/workflow goal objective="Migrate the database layer to Drizzle ORM" base_branch=develop
|
|
@@ -607,22 +609,22 @@ Child workflow outputs: `result`, `status`, `approved`, `goal_id`, `objective`,
|
|
|
607
609
|
|
|
608
610
|
### `ralph`
|
|
609
611
|
|
|
610
|
-
|
|
612
|
+
Prompt-engineering → research → orchestrate → review workflow with optional final-stage PR handoff: transform the user prompt into a codebase and online research question with `/skill:prompt-engineer`, run `/skill:research-codebase` against it, write findings under `research/`, delegate implementation through sub-agents from that research, run parallel reviewers, and iterate until approval or the loop limit. Ralph's orchestrator and reviewers are prompted to verify user-visible behavior end-to-end when practical with browser-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios. Follow-up iterations pass unresolved review artifacts into prompt-engineering/research and fork research from prior research session data when available. Ralph skips PR creation by default; prompt text alone does not opt in. Pass `create_pr=true` to authorize only the final `pull-request` stage to inspect provider credentials and attempt provider-appropriate PR/MR/review creation (for example GitHub `gh`, Azure Repos `az repos pr create`, or Sapling/Phabricator tooling). Ralph's own PR-creation instructions live in that final stage. Reviewers inspect repository infrastructure directly as needed; Ralph no longer runs separate `infra-*` discovery stages.
|
|
611
613
|
|
|
612
614
|
```text
|
|
613
|
-
/workflow ralph prompt="
|
|
614
|
-
/workflow ralph prompt="
|
|
615
|
+
/workflow ralph prompt="Migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop
|
|
616
|
+
/workflow ralph prompt="Migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop create_pr=true
|
|
615
617
|
```
|
|
616
618
|
|
|
617
619
|
| Input | Type | Required | Default | Description |
|
|
618
620
|
| ------------------ | --------- | -------- | ------------- | ------------------------------------------------------------- |
|
|
619
|
-
| `prompt` | `text` | ✓ | — | Task, feature request, issue summary, or spec path to
|
|
620
|
-
| `max_loops` | `number` | — | `10` | Maximum
|
|
621
|
+
| `prompt` | `text` | ✓ | — | Task, feature request, issue summary, or spec path to research, execute, refine, and review. |
|
|
622
|
+
| `max_loops` | `number` | — | `10` | Maximum research/orchestrate/review iterations before completion or optional final handoff. |
|
|
621
623
|
| `base_branch` | `string` | — | `origin/main` | Branch reviewers and the optional final stage compare the current delta with; also used to create a missing worktree. |
|
|
622
624
|
| `git_worktree_dir` | `string` | — | `""` | Optional reusable Git worktree root. Empty runs in the invoking checkout; non-empty values run Ralph stages in the created/reused worktree. |
|
|
623
625
|
| `create_pr` | `boolean` | — | `false` | Safe-by-default PR creation flag. Omitted or `false` skips the final `pull-request` stage and omits `pr_report`; prompt text alone does not opt in, and only strict `true` authorizes the final `pull-request` stage to attempt provider-appropriate PR/MR/review creation. |
|
|
624
626
|
|
|
625
|
-
Child workflow outputs: `result`, `plan
|
|
627
|
+
Child workflow outputs: `result`, `plan` (latest transformed research question), `plan_path` (compatibility alias for `research_path`), `research`, `research_path`, `implementation_notes_path`, `approved`, `iterations_completed`, `review_report`, and `review_report_path`. `pr_report` is included only when `create_pr=true` and the final `pull-request` stage runs.
|
|
626
628
|
|
|
627
629
|
### `open-claude-design`
|
|
628
630
|
|
|
@@ -44,27 +44,6 @@ interface DeepResearchCodebaseResult {
|
|
|
44
44
|
|
|
45
45
|
const FILE_ONLY_OUTPUT = "file-only" satisfies WorkflowOutputMode;
|
|
46
46
|
|
|
47
|
-
const CODEBASE_SKILLS = {
|
|
48
|
-
locator:
|
|
49
|
-
"codebase-locator — use this skill's search-first discipline when mapping where files, symbols, docs, tests, and configuration live.",
|
|
50
|
-
analyzer:
|
|
51
|
-
"codebase-analyzer — use this skill's evidence-driven deep-read style when explaining behavior, architecture, control flow, data flow, and edge cases.",
|
|
52
|
-
patternFinder:
|
|
53
|
-
"codebase-pattern-finder — use this skill's example-mining approach when separating reusable conventions from one-off details.",
|
|
54
|
-
researchLocator:
|
|
55
|
-
"codebase-research-locator — use this skill's historical-discovery approach when finding prior research, specs, ADRs, issues, and TODOs.",
|
|
56
|
-
researchAnalyzer:
|
|
57
|
-
"codebase-research-analyzer — use this skill's synthesis approach when extracting decisions, constraints, stale assumptions, and open questions from prior research.",
|
|
58
|
-
onlineResearcher:
|
|
59
|
-
"codebase-online-researcher — use this skill's source-citing approach when external documentation or ecosystem behavior materially affects the answer.",
|
|
60
|
-
} as const;
|
|
61
|
-
|
|
62
|
-
function codebaseSkillGuidance(
|
|
63
|
-
...skills: readonly (keyof typeof CODEBASE_SKILLS)[]
|
|
64
|
-
): string {
|
|
65
|
-
return skills.map((skill) => CODEBASE_SKILLS[skill]).join("\n");
|
|
66
|
-
}
|
|
67
|
-
|
|
68
47
|
function taggedPrompt(sections: readonly PromptSection[]): string {
|
|
69
48
|
return sections
|
|
70
49
|
.map(([tag, content]) => {
|
|
@@ -446,11 +425,7 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
446
425
|
"role",
|
|
447
426
|
"You are a senior codebase research scout preparing work for specialist agents.",
|
|
448
427
|
],
|
|
449
|
-
["objective", `Map the repository. Research question: ${prompt}`],
|
|
450
|
-
[
|
|
451
|
-
"codebase_skills",
|
|
452
|
-
codebaseSkillGuidance("locator", "analyzer", "patternFinder"),
|
|
453
|
-
],
|
|
428
|
+
["objective", `Map the repository using parallel codebase-locator, codebase-analyzer, and codebase-pattern-finder subagents. Research question: ${prompt}`],
|
|
454
429
|
[
|
|
455
430
|
"instructions",
|
|
456
431
|
[
|
|
@@ -480,10 +455,9 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
480
455
|
["role", "You locate prior project research and decision history."],
|
|
481
456
|
[
|
|
482
457
|
"objective",
|
|
483
|
-
"Find existing docs, specs, ADRs, issues/PR notes, TODOs, and research artifacts relevant to the task.",
|
|
458
|
+
"Find existing docs, specs, ADRs, issues/PR notes, TODOs, and research artifacts relevant to the task using parallel codebase-research-locator subagents.",
|
|
484
459
|
],
|
|
485
460
|
["task", "{task}"],
|
|
486
|
-
["codebase_skills", codebaseSkillGuidance("researchLocator")],
|
|
487
461
|
[
|
|
488
462
|
"instructions",
|
|
489
463
|
[
|
|
@@ -520,10 +494,9 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
520
494
|
],
|
|
521
495
|
[
|
|
522
496
|
"objective",
|
|
523
|
-
`Extract reusable historical context. Research question: ${prompt}`,
|
|
497
|
+
`Extract reusable historical context using parallel codebase-research-analyzer subagents. Research question: ${prompt}`,
|
|
524
498
|
],
|
|
525
499
|
["prior_research_locator_output", "{previous}"],
|
|
526
|
-
["codebase_skills", codebaseSkillGuidance("researchAnalyzer")],
|
|
527
500
|
[
|
|
528
501
|
"instructions",
|
|
529
502
|
[
|
|
@@ -558,13 +531,9 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
558
531
|
["role", "You turn scout research into clean work partitions."],
|
|
559
532
|
[
|
|
560
533
|
"objective",
|
|
561
|
-
`Return at most ${partitionCap} independent partitions for this research question: ${prompt}
|
|
534
|
+
`Return at most ${partitionCap} independent partitions for this research question: ${prompt}. Use parallel codebase-locator, codebase-analyzer, and codebase-pattern-finder subagents.`,
|
|
562
535
|
],
|
|
563
536
|
["scout_output", "{previous}"],
|
|
564
|
-
[
|
|
565
|
-
"codebase_skills",
|
|
566
|
-
codebaseSkillGuidance("locator", "analyzer", "patternFinder"),
|
|
567
|
-
],
|
|
568
537
|
[
|
|
569
538
|
"instructions",
|
|
570
539
|
[
|
|
@@ -607,11 +576,11 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
607
576
|
"scout_context",
|
|
608
577
|
`Read the scout artifact before making evidence claims: ${displayWorkflowPath(scoutPath)}\nCompact saved-output reference: {previous}`,
|
|
609
578
|
],
|
|
610
|
-
["codebase_skills", codebaseSkillGuidance("locator")],
|
|
611
579
|
[
|
|
612
580
|
"instructions",
|
|
613
581
|
[
|
|
614
582
|
"Find the highest-signal files, tests, docs, commands, configs, and symbols for this partition.",
|
|
583
|
+
"Use parallel codebase-locator subagents to explore different areas of the partition.",
|
|
615
584
|
"Explain why each path matters for the research question.",
|
|
616
585
|
"Prioritize exact paths and symbol names over broad descriptions.",
|
|
617
586
|
"Flag areas that look relevant but could not be verified.",
|
|
@@ -643,11 +612,10 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
643
612
|
"scout_context",
|
|
644
613
|
`Read the scout artifact before making evidence claims: ${displayWorkflowPath(scoutPath)}\nCompact saved-output reference: {previous}`,
|
|
645
614
|
],
|
|
646
|
-
["codebase_skills", codebaseSkillGuidance("patternFinder")],
|
|
647
615
|
[
|
|
648
616
|
"instructions",
|
|
649
617
|
[
|
|
650
|
-
"Identify recurring implementation patterns, abstractions, naming conventions, and anti-patterns in this partition.",
|
|
618
|
+
"Identify recurring implementation patterns, abstractions, naming conventions, and anti-patterns in this partition using parallel codebase-pattern-finder subagents.",
|
|
651
619
|
"Use concrete examples with paths, symbols, or test names.",
|
|
652
620
|
"Distinguish established conventions from one-off implementation details.",
|
|
653
621
|
"Avoid generic advice that is not grounded in the repository.",
|
|
@@ -711,11 +679,10 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
711
679
|
"context",
|
|
712
680
|
`Read these artifacts before analyzing: ${displayWorkflowPaths(analyzerReads)}\nCompact saved-output reference: {previous}`,
|
|
713
681
|
],
|
|
714
|
-
["codebase_skills", codebaseSkillGuidance("analyzer")],
|
|
715
682
|
[
|
|
716
683
|
"instructions",
|
|
717
684
|
[
|
|
718
|
-
"Analyze behavior, control flow, data flow, lifecycle, error handling, and test coverage for this partition.",
|
|
685
|
+
"Analyze behavior, control flow, data flow, lifecycle, error handling, and test coverage for this partition using parallel codebase-analyzer subagents.",
|
|
719
686
|
"Build on the locator output; do not repeat file discovery except where needed as evidence.",
|
|
720
687
|
"Call out edge cases, invariants, and coupling to other partitions.",
|
|
721
688
|
"If evidence is incomplete, explain what remains unknown and how to verify it.",
|
|
@@ -747,11 +714,11 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
747
714
|
["assignment", `Partition ${i}/${partitions.length}: ${partition}`],
|
|
748
715
|
["research_question", prompt],
|
|
749
716
|
["local_context", onlineResearcherLocalContext],
|
|
750
|
-
["codebase_skills", codebaseSkillGuidance("onlineResearcher")],
|
|
751
717
|
[
|
|
752
718
|
"instructions",
|
|
753
719
|
[
|
|
754
720
|
"Identify external library/framework behavior, standards, or docs that materially affect the local interpretation.",
|
|
721
|
+
"Use parallel codebase-online-researcher subagents to explore different angles of external research.",
|
|
755
722
|
"Cite sources, package names, API names, versions, or documentation titles when available.",
|
|
756
723
|
"Explain how each external fact applies to this repository.",
|
|
757
724
|
"If external research is unnecessary or unavailable, say so and focus on local implications.",
|
|
@@ -829,14 +796,6 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
829
796
|
"specialist_reports",
|
|
830
797
|
`Read the complete explorer handoff artifact(s) at ${displayWorkflowPaths(explorerPaths)}. They preserve every partition's Locator, Pattern Finder, Analyzer, and Online Researcher output from the original inline specialist handoff while keeping this prompt bounded.`,
|
|
831
798
|
],
|
|
832
|
-
[
|
|
833
|
-
"codebase_skills",
|
|
834
|
-
codebaseSkillGuidance(
|
|
835
|
-
"analyzer",
|
|
836
|
-
"researchAnalyzer",
|
|
837
|
-
"onlineResearcher",
|
|
838
|
-
),
|
|
839
|
-
],
|
|
840
799
|
[
|
|
841
800
|
"instructions",
|
|
842
801
|
[
|
|
@@ -845,6 +804,7 @@ export default defineWorkflow("deep-research-codebase")
|
|
|
845
804
|
"Prioritize claims supported by concrete paths, symbols, tests, docs, or cited external references.",
|
|
846
805
|
"Resolve contradictions explicitly and preserve important uncertainty.",
|
|
847
806
|
"Avoid inventing facts not supported by the supplied reports; state unknowns instead.",
|
|
807
|
+
"Use parallel codebase-analyzer, codebase-research-analyzer, and codebase-online-researcher subagents as needed to verify claims or fill critical gaps in the supplied reports.",
|
|
848
808
|
"End with actionable next steps for a developer who will use this research.",
|
|
849
809
|
].join("\n"),
|
|
850
810
|
],
|