pub trait Phase {
// Required methods
fn id(&self) -> PhaseId;
fn deps(&self) -> &'static [PhaseId];
fn can_resume(&self) -> bool;
fn prompt(&self, ctx: &PhaseContext) -> String;
fn make_packet(&self, ctx: &PhaseContext) -> Result<Packet>;
fn postprocess(&self, raw: &str, ctx: &PhaseContext) -> Result<PhaseResult>;
}Expand description
Core trait that all workflow phases must implement
This trait separates concerns into three distinct operations:
prompt(): Generate the prompt for Claudemake_packet(): Prepare context packet for Claudepostprocess(): Process Claude’s response into artifacts
Required Methods§
Sourcefn deps(&self) -> &'static [PhaseId]
fn deps(&self) -> &'static [PhaseId]
Returns the phases that must complete before this phase can run
Sourcefn can_resume(&self) -> bool
fn can_resume(&self) -> bool
Returns whether this phase can be resumed from a partial state
Sourcefn prompt(&self, ctx: &PhaseContext) -> String
fn prompt(&self, ctx: &PhaseContext) -> String
Generate the prompt text for Claude CLI
This method creates the specific prompt that will be sent to Claude for this phase, based on the current context and available artifacts.
Sourcefn make_packet(&self, ctx: &PhaseContext) -> Result<Packet>
fn make_packet(&self, ctx: &PhaseContext) -> Result<Packet>
Create a packet of context information for Claude
This method builds the context packet that will be included with the prompt, selecting and organizing relevant files and information.
Sourcefn postprocess(&self, raw: &str, ctx: &PhaseContext) -> Result<PhaseResult>
fn postprocess(&self, raw: &str, ctx: &PhaseContext) -> Result<PhaseResult>
Process Claude’s raw response into structured artifacts
This method takes Claude’s raw output and converts it into the appropriate artifacts for this phase, handling any necessary parsing and validation.