Project Automation Plan 8
Scope: Build the project-level execution data layer: AgentJob project/phase tracking, run-summary generation, and project-aware Forge Optimizer support.
Task 1 — Add project and phase as first-class AgentJob fields
Spec Section 8 requires
project TEXTandphase TEXTon AgentJob, and Spec Section 4 requires Project Runner to pass both when spawning agents.Research §9 decided: Option B — add first-class project and phase fields to AgentJob rather than inferring project from prompts. Rationale: cleaner and queryable.
Add project TEXT and phase TEXT columns to the AgentJob table schema in the forge-spawn MCP server. Update spawn_agent so it accepts project and phase parameters and stores them on job creation. Update Project Runner to pass both fields when spawning agents. Verify with a test run that both values are recorded correctly.
Task 2 — Implement the project run-summary generator
Spec Section 8 requires
{Project}_Runs.mdwith agent, model, task, duration, token usage per turn and total, per-conversation cost, and total project cost.Research §9 decided: Option B — generate a durable runs document from AgentJob + MongoDB + LangFuse data rather than inferring from prompts.
Create a TypeScript script (use the Write_Typescript skill) that queries AgentJob for all runs matching a project name, pulls token and cost data from MongoDB conversation records, and generates {Project}_Runs.md from the template at Forge/Skills/Project_Create/templates/Runs_Template.md. The output must include per-conversation: agent, model, task/message, duration, token usage per turn and total, and cost. It must also compute total project cost across all conversations.
Task 3 — Make Forge Optimizer project-aware
Spec Section 7 requires Forge Optimizer to analyze project conversations and preserve a manual, user-controlled invocation model.
Research §7 decided: Option B — manual project-aware Optimizer with a workflow reminder, rather than automatic runs after every phase. Rationale: preserves user control over cost.
Edit Forge/Skills/Forge_Optimizer/SKILL.md and its script so the /forge-optimizer command accepts a project flag, defaults to GLM 5.1 unless the user overrides, and can query the project’s conversations using the new AgentJob project/phase data. The Optimizer should be able to reference persisted report files as supporting context when analyzing a project.
Task 4 — Add the post-Eval Optimizer reminder
Spec Section 7 requires the workflow to remind the user after Eval that project-level optimizer analysis is available.
Update Project_Eval so, after writing its persisted evaluation report and updating phase state, it records the reminder exactly where the workflow expects humans to see it.
Task 5 — Build, commit, push
Spec Sections 7 and 8 require execution-data and optimizer features to be verifiable project artifacts.
Run the build, stage the schema/tool/script/doc changes, commit with message Project Automation: Plan 8 — runs and optimizer integration, and push to dev.