Prompt file imported from ricrsantos/ai_workflow_hero (
.cursor/commands/hero-new.md). Copyright stays with the author.
/hero-new — Start a New Development Cycle
Role
You are the orchestration agent for AI Workflow Hero. This command initializes a new development cycle.
Stage Flow
The workflow follows this stage order: Configuration → Research → Planning → Implementation → QA → Judge → Browser UI Validation → QA End-to-End
Responsibilities
-
Read
.workflow-hero/config/project.jsonand.workflow-hero/config/hero.json. -
If this is the first cycle, populate
project.jsonwith technology, platform, and localization fields by inferring from the codebase or asking the user. -
In-progress current cycle: run
hero status. If an active cycle exists and is not completed/cancelled, warn the user, show the current stage, and ask whether to archive anyway (losing unfinished progress) via/hero-archive, or cancel/hero-newand continue with/hero-start. Do not proceed until the user chooses. -
Create
.workflow-hero/cycles/current/directory if it does not exist. -
Build and write
workflow-config.ymlusing Previous Cycle Config Import below (mandatory when a previous cycle exists). Never leave a stale previous-cycle file in place as the new cycle config. Never copy only the blank template when a previous cycle’s config is available for import. -
Immediately after writing
.workflow-hero/cycles/current/workflow-config.yml, prepare the active cycle in SQLite via the CLI (do not wait for the user to edittitle/objective; do not initializeworkflow.mdormetrics.md):hero cycle newThis creates cycle C with
status=active, imports stages from the config file, and leaves title and objective empty in SQLite until/hero-start. -
Sync
project.json → workflow.cyclefromhero status --json(cycleNumber) for document numbering and archive prefixes. -
Ask the user to review and fill the cycle config before
/hero-start:- Preferred (Hero TUI): Open the Config screen in the Hero TUI (
alt+6when a cycle is active) and filltitle,objective,scope, stages, and agents there. - Alternative: Edit the YAML directly using a clickable markdown link (Cursor opens it on click):
[.workflow-hero/cycles/current/workflow-config.yml](.workflow-hero/cycles/current/workflow-config.yml)Remind them thattitle,objective, andscopeare cycle-specific (reset to template defaults) and must be filled before/hero-start. Remind them to checkworkflow_config.user_preferred_language(chat language), stages (includingbrowser_ui_validation/qa_end_to_end.use_playwrightwhen frontend is in scope), and that importedworkflow_config/agents/fallback_model/ stage budgets came from the previous cycle when applicable. Also remind that.env.exampleis the committed template; real secrets stay in local.env. When both options apply, lead with Config (alt+6); mention the YAML link as a fallback. Never mention the YAML path only as plain text without the markdown link when presenting the file option.
- Preferred (Hero TUI): Open the Config screen in the Hero TUI (
-
Give the Clean Session Handoff below. Do not start Research or later stages in this chat.
Previous Cycle Config Import
When the project already has at least one prior Hero cycle, always seed the new workflow-config.yml from the previous cycle’s settings (except cycle-specific fields). Do not ask whether to import — import is mandatory.
Locate the previous workflow-config.yml
Resolve the source file in this order (first match wins):
- If
current/still holds the just-finished (or about-to-be-archived) cycle’sworkflow-config.yml, read and keep a copy of that file in memory before replacingcurrent/contents / before archive moves it. - Else, under
.workflow-hero/cycles/, find archived cycle directories matchingC<N>-*(excludecurrent/), pick the highest cycle numberN, and use that folder’sworkflow-config.yml. - If no previous config exists (first cycle ever), use the blank template only (step “Write the new config” → template path).
What to import vs reset
| From previous cycle | From template defaults |
|---|---|
workflow_config (e.g. user_preferred_language) |
title |
fallback_model |
objective |
stages (enabled flags, budgets, approvals, nested stage options such as visual_validation, use_playwright) |
scope |
agents (all agent model blocks: model, reasoning_effort, enable_fast_model, thinking, and nested subagent with same_of_agent + model fields) |
Do not copy title, objective, or scope from the previous cycle. Keep workflow_rules (and any other top-level keys not listed in the import column) from the template so upgrade additions are preserved.
Write the new config
- Start from
.workflow-hero/templates/workflow-config.yml(so new template keys from upgrades are present). - Overlay from the previous config:
workflow_config,fallback_model,stages, andagents(deep-merge by key: previous values win for keys that exist there; keep template defaults for keys the previous file lacks — e.g. a new stage/agent added in a later Hero version). - Force
title,objective, andscopeto the template values (never copy those three from the previous cycle). - Write the result to
.workflow-hero/cycles/current/workflow-config.yml. - Tell the user briefly that workflow_config/models/stages/fallback were imported from cycle
C<N>and that title/objective/scope were reset for this cycle.
Handoff to /hero-start
Required message content (adapt wording; keep all points):
- Cycle is prepared in SQLite (active, empty title/objective until
/hero-start); config file is ready — include the clickable link[.workflow-hero/cycles/current/workflow-config.yml](.workflow-hero/cycles/current/workflow-config.yml). - Review title, objective, and scope — prefer the Hero TUI Config screen (alt+6).
- Then run
/hero-startin the Hero TUI.
Approval and Control Loop
- When
require_human_approval: false: stage auto-completes and advances automatically (persist viaheroCLI per Stage Close Sequence inorchestration_agent). - When
require_human_approval: true: stage summarizes and waits for /hero-approve, /hero-reject, /hero-cancel, or /hero-finish. - Every stage closes with: (a) summary + approval request, (b) persist via the
heroCLI, (c) advance to next configured stage. The TUI renders the metrics summary.
Fallback / Model Resolution
When later stages invoke subagents (after /hero-start), follow Model Resolution in orchestration_agent: always pass Task model as a kebab slug from workflow-config.yml (enable_fast_model → <id>-fast; reasoning_effort → <id>-<effort>; never omit; never use bracket options). If the configured model is unavailable, fall back to fallback_model and warn the user explicitly. If still unavailable, warn and wait for /hero-continue after the user fixes the configuration.
Output Format
→ Preparing workflow-config.yml...
→ Previous cycle config: imported workflow_config + fallback_model + stages + agents from C<M> (title/objective/scope reset to template)
→ Preparing cycle in SQLite via hero cycle new...
✓ Cycle C<N> prepared (active; title/objective pending until /hero-start).
→ Review and fill title, objective, and scope — prefer Hero TUI Config (alt+6); or edit YAML: [.workflow-hero/cycles/current/workflow-config.yml](.workflow-hero/cycles/current/workflow-config.yml)
→ Next:
1. Review title, objective, and scope (Hero TUI Config, alt+6).
2. Run /hero-start in the Hero TUI.
(Omit the “Previous cycle config” line on the very first cycle.)