Skip to content

Commit a4b54c5

Browse files
committed
feat(planner): ship planner as a workspace agent package
1 parent 081c161 commit a4b54c5

7 files changed

Lines changed: 139 additions & 1 deletion

File tree

‎agents/planner/package.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@corbits/agent-planner",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"license": "SEE LICENSE IN LICENSE.md",
7+
"exports": {
8+
".": {
9+
"types": "./src/index.ts",
10+
"default": "./src/index.ts"
11+
}
12+
}
13+
}

‎agents/planner/src/index.ts‎

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/**
2+
* Planner worker (CL-9797): sawyer-skills artifact planner.
3+
* Authors requirements (PRD.md), solution scopes (SOLUTION_SCOPE.md),
4+
* and concrete ordered build plans (BUILD_PLAN.md).
5+
*
6+
* Ships as the @corbits/agent-planner workspace package: the tool allowlist
7+
* lives here so the package stays importable without the app. Drift against
8+
* the app build surface fails src/agent/directors/planner/package.test.ts.
9+
*/
10+
export type AgentPackage = {
11+
readonly id: "planner";
12+
readonly primaryIntent: string;
13+
readonly outOfLane: readonly string[];
14+
readonly description: string;
15+
readonly systemPrompt: string;
16+
/** Unset — planner never attaches skill bodies at spawn. */
17+
readonly attachedSkills?: readonly string[];
18+
/** Unset — planner declares no skill scope. */
19+
readonly optionalSkills?: readonly string[];
20+
readonly tools: {
21+
readonly allow: readonly string[];
22+
};
23+
readonly spawn: {
24+
readonly maySpawn: false;
25+
};
26+
readonly modelRole: "plan";
27+
readonly tier: "leaf";
28+
};
29+
30+
const PLANNER_TOOLS = [
31+
"read_file",
32+
"grep",
33+
"search_files",
34+
"list_dir",
35+
"lsp",
36+
"run_shell",
37+
"web_fetch",
38+
"web_search",
39+
"skill_search",
40+
"use_skill",
41+
"write_file",
42+
"edit_file",
43+
"delete_file",
44+
] as const;
45+
46+
export const plannerPackage: AgentPackage = {
47+
id: "planner",
48+
primaryIntent:
49+
"Author requirements (PRD.md), solution scopes (SOLUTION_SCOPE.md), and ordered build plans (BUILD_PLAN.md)",
50+
outOfLane: [
51+
"shipping product implementation code",
52+
"fleet orchestration or spawning",
53+
"pure code defect review",
54+
"becoming Coder or Reviewer as primary",
55+
],
56+
description:
57+
"Planning specialist — PRD.md, SOLUTION_SCOPE.md, and BUILD_PLAN.md authoring",
58+
systemPrompt: `You are PlannerDirector (Planner), a specialist in Corbits Code.
59+
60+
PRIMARY INTENT: author concrete, agent-proof engineering artifacts and plans. You are the planning lane only — not Coder, not Reviewer, not an orchestrator. Do not ship product implementation code yourself; author the plan and artifacts that Coder can execute without guessing.
61+
62+
Sawyer-skills discipline & core artifacts:
63+
1. PRD.md (Requirements):
64+
- Problem statement & user/operator value.
65+
- User stories and detailed acceptance criteria.
66+
- Edge cases, error modes, and boundary behaviors.
67+
2. SOLUTION_SCOPE.md (Boundaries & Invariants):
68+
- Explicit in-scope deliverables.
69+
- Non-goals (what we deliberately do NOT build).
70+
- Architectural assumptions, subsystem invariants, and ownership boundaries.
71+
- Backward compatibility implications and migration impact.
72+
3. BUILD_PLAN.md (Execution Steps):
73+
- Exact files and paths to create, modify, or delete.
74+
- Ordered, phased implementation sequence designed for incremental verification.
75+
- Specific verification command for each phase (unit tests, types, lint, check).
76+
- Rollback or fallback strategy if an approach fails.
77+
78+
Workflow:
79+
1. Clarify requirements: read the brief's goals and success_criteria. If critical unknowns remain, ask the parent via ask_director; otherwise resolve ambiguity under explicit Assumptions.
80+
2. Inspect the codebase: read relevant paths, existing contracts, and test patterns to ground the plan in reality.
81+
3. Produce the plan: author the requested artifacts (PRD.md / SOLUTION_SCOPE.md / BUILD_PLAN.md when requested, or include the structured plan directly in Findings).
82+
4. Report: use the standard Summary / Findings / Blockers / Paths report envelope. Findings must carry the complete ordered plan, acceptance criteria, non-goals, and risks.
83+
84+
OUT OF LANE: shipping product implementation code, executing test suites for product verification, fleet orchestration or spawning, becoming Coder or Reviewer as primary.`,
85+
tools: { allow: [...PLANNER_TOOLS] },
86+
spawn: { maySpawn: false },
87+
tier: "leaf",
88+
modelRole: "plan",
89+
};

‎bun.lock‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"tar": "^7.5.1"
8787
},
8888
"dependencies": {
89+
"@corbits/agent-planner": "workspace:*",
8990
"@corbits/codex-provider": "0.1.1",
9091
"@corbits/oauth-core": "0.2.0",
9192
"@corbits/openai-responses": "0.2.1",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
import { plannerPackage } from "@corbits/agent-planner";
4+
import { BUILD_TOOLS } from "../tool-sets.js";
5+
import { DIRECTOR_REGISTRY } from "../registry.js";
6+
import type { DirectorPackage } from "../types.js";
7+
8+
describe("plannerPackage", () => {
9+
test("workspace package satisfies the director contract and feeds the registry", () => {
10+
const asDirector: DirectorPackage = plannerPackage;
11+
expect(asDirector.id).toBe("planner");
12+
expect(DIRECTOR_REGISTRY.planner).toBe(plannerPackage);
13+
expect([...plannerPackage.tools.allow]).toEqual([...BUILD_TOOLS]);
14+
});
15+
16+
test("extracted copy stays build-scoped and non-spawning", () => {
17+
expect(plannerPackage.tools.allow).toContain("write_file");
18+
expect(plannerPackage.tools.allow).toContain("edit_file");
19+
expect(plannerPackage.tools.allow).toContain("delete_file");
20+
expect(plannerPackage.tools.allow).not.toContain("spawn_agent");
21+
expect(plannerPackage.tools.allow).not.toContain("ask_operator");
22+
expect(plannerPackage.spawn.maySpawn).toBe(false);
23+
expect(plannerPackage.tier).toBe("leaf");
24+
expect(plannerPackage.modelRole).toBe("plan");
25+
});
26+
});

‎src/agent/directors/registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { plannerPackage } from "@corbits/agent-planner";
12
import type { AgentProfile, CapabilityFilter } from "../profile-types.js";
23
import { artistPackage } from "./artist/package.js";
34
import { coderPackage } from "./coder/package.js";
45
import { designerPackage } from "./designer/package.js";
56
import { dispatchPackage } from "./dispatch/package.js";
67
import { explorerPackage } from "./explorer/package.js";
7-
import { plannerPackage } from "./planner/package.js";
88
import { proberPackage } from "./prober/package.js";
99
import { qaLeadPackage } from "./qa-lead/package.js";
1010
import { reviewerPackage } from "./reviewer/package.js";

‎tsconfig.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"composite": false,
66
"baseUrl": ".",
77
"paths": {
8+
"@corbits/agent-planner": ["./agents/planner/src/index.ts"],
89
"@corbits/provider-opencode-go": ["./packages/opencode-go/src/index.ts"],
910
"@corbits/first-class-providers": [
1011
"./packages/first-class-providers/src/index.ts"
@@ -17,6 +18,7 @@
1718
"src/**/*.ts",
1819
"testkit/**/*.ts",
1920
"packages/**/*.ts",
21+
"agents/**/*.ts",
2022
"e2e/**/*.ts",
2123
"evals/**/*.ts",
2224
"scripts/**/*.ts"

0 commit comments

Comments
 (0)