Understanding prAxIs OS Workflows
In Tutorial 1, you experienced spec-driven development hands-on. Now you'll learn what workflows actually are and why they're critical to prAxIs OS's approach.
Learning Goalsâ
By completing this tutorial, you will learn to:
- Understand workflows as phase-gated tools, not general processes
- Experience checkpoint validation (trying to skip ahead vs. providing evidence)
- Check workflow state and understand resumption
- Know when and why to use workflows
- Understand how workflows enforce quality in code
Time Estimateâ
10-15 minutes
Prerequisitesâ
- Tutorial 1: Your First prAxIs OS Project completed
- Basic understanding of spec-driven development
What You'll Learnâ
By the end of this tutorial, you'll understand:
- Workflows are tools, not processes - They're executable enforcement mechanisms
- Phase gating works in code - AI literally cannot skip phases
- Evidence-based progression - Checkpoints require proof, not promises
- Workflow state is persistent - Resume from any point, never lose progress
Part 1: What Are Workflows? (2 minutes)â
Let's start with the mental model.
Workflows Are NOT General Processesâ
When most people hear "workflow," they think:
- â A checklist of steps to follow
- â A suggested best practice
- â A process documented in a diagram
- â Something you can skip if you know what you're doing
prAxIs OS workflows are different.
Workflows Are Phase-Gated Toolsâ
prAxIs OS workflows are:
- â Executable code that enforces progression
- â Hard gates that AI cannot bypass
- â Validation engines that check evidence
- â State machines with defined transitions
Think of a workflow like a TSA security checkpoint:
- You cannot board the plane (next phase) until you pass through security (checkpoint)
- Showing your boarding pass (evidence) allows you to proceed
- The gate physically blocks you - it's not a suggestion
The Two Main Workflowsâ
You've already used both of these in Tutorial 1:
1. spec_creation_v1 - Specification Creation
Creates comprehensive specifications through 6 phases:
- Phase 0: Supporting Documents Integration (optional)
- Phase 1: Requirements Gathering (creates
srd.md) - Phase 2: Technical Design (creates
specs.md) - Phase 3: Task Breakdown (creates
tasks.md) - Phase 4: Implementation Guidance (creates
implementation.md) - Phase 5: Finalization (creates
README.md)
Each phase has a validation gate with required evidence.
2. spec_execution_v1 - Specification Execution
Implements specifications through dynamic phases:
- Phase 0: Spec Analysis & Planning (parses
tasks.md) - Phases 1-N: Dynamic phases from your spec's task breakdown
The number of phases depends on your spec. The workflow parses your tasks.md and creates phases dynamically.
Key Insightâ
The workflow engine enforces progression through code, not through prompt engineering or hoping the AI "remembers" to do things correctly.
Part 2: Experience Checkpoint Validation (4 minutes)â
Let's experience how phase gates actually work by checking workflow state.
Step 1: Start a New Workflowâ
Open Cursor chat and say:
Let's create a spec for a simple feature: a health check endpoint at /health that returns {"status": "ok"}. Use spec_creation_v1 workflow.
Expected Response:
The agent will:
- Acknowledge the workflow request
- Start
spec_creation_v1workflow - Begin Phase 0 (or skip to Phase 1 if no supporting docs)
Success Indicator: â Agent mentions starting the workflow and the current phase
Step 2: Check Current Workflow Stateâ
While the workflow is running, ask:
What's the current workflow state? What phase are we in and what evidence is required?
Expected Response:
The agent will show you:
Current Workflow: spec_creation_v1
Session ID: [some-id]
Current Phase: 1 (Requirements Gathering)
Required Evidence for Phase 1 Checkpoint:
- srd_created
- business_goals_defined
- user_stories_documented
- functional_requirements_listed
- nfr_defined
- out_of_scope_clarified
Progress: Phase 1 in progress
Success Indicator: â You see the specific evidence items required
Step 3: Let the Workflow Progress Naturallyâ
Allow the agent to complete Phase 1. It will:
- Ask clarifying questions
- Create the
srd.mdfile - Collect all required evidence
- Present the Software Requirements Document
Expected Output:
â
Phase 1 Complete: Requirements Gathering
Created: .praxis-os/specs/2025-10-12-health-check-endpoint/srd.md
Evidence Collected:
â srd_created
â business_goals_defined
â user_stories_documented
â functional_requirements_listed
â nfr_defined
â out_of_scope_clarified
Ready to advance to Phase 2: Technical Design
Success Indicator: â All evidence items checked off
Step 4: Understand What Just Happenedâ
The workflow engine just:
- Tracked required evidence from the checkpoint definition
- Verified evidence was collected (the
srd.mdfile exists and contains required sections) - Allowed progression to next phase only after validation passed
If the agent had tried to skip Phase 1 or advance without creating the SRD, the workflow engine would have blocked the transition.
Why This Mattersâ
Without workflows, an AI might say:
"I've gathered the requirements mentally, let's start coding!"
With workflows, the AI must produce the srd.md file with all required sections before it can proceed. The gate is enforced in code.
Part 3: Workflow State and Resumption (2 minutes)â
Workflows maintain persistent state, which means you can resume from any point.
Step 5: Check Workflow State Againâ
Ask the agent:
Show me the full workflow state, including completed phases.
Expected Response:
Workflow: spec_creation_v1
Session ID: wf-spec-creation-[timestamp]
Phase Progress:
â
Phase 0: Supporting Documents Integration (skipped)
â
Phase 1: Requirements Gathering (complete)
đ Phase 2: Technical Design (in progress)
âšī¸ Phase 3: Task Breakdown (pending)
âšī¸ Phase 4: Implementation Guidance (pending)
âšī¸ Phase 5: Finalization (pending)
Completed Phases History:
- Phase 1 completed at 2025-10-12 10:30:15
Evidence: srd_created, business_goals_defined, ...
Artifact: .praxis-os/specs/.../srd.md
Success Indicator: â You see phase history with timestamps and evidence
What This State Enablesâ
The workflow state is saved to disk after each phase completion. This means:
- Crash Recovery: If the MCP server restarts mid-workflow, you can resume
- Session Interruption: If you close Cursor and come back tomorrow, the workflow remembers where you were
- Audit Trail: You have a complete history of what was done and when
Step 6: Complete or Cancel the Workflowâ
You can either:
Option A: Complete the workflow
Continue with the workflow to completion.
The agent will progress through all remaining phases.
Option B: Cancel and clean up
Cancel this workflow, we were just learning how they work.
The agent will clean up the partial spec files.
Success Indicator: â Agent acknowledges and takes appropriate action
Why State Management Mattersâ
Traditional AI assistance loses context when:
- The conversation gets too long
- You start a new chat
- The IDE restarts
Workflows maintain state persistently on disk, so none of those issues apply.
Part 4: When to Use Workflows (2 minutes)â
Now that you understand how workflows work, when should you use them?
Use Workflows For:â
â Complex, multi-phase work
- Creating specifications (>30 min of work)
- Implementing features with multiple components
- Refactoring with many steps
- Generating comprehensive test suites
â When quality gates matter
- Production code where tests are mandatory
- Documentation that must be complete
- Architecture decisions that need review
- Migrations with validation steps
â When you want resumability
- Work spanning multiple sessions
- Tasks that might be interrupted
- Long-running implementations
- Collaborative work (hand off to another developer)
Don't Use Workflows For:â
â Simple, one-step tasks
- "Fix this typo"
- "Add a log statement here"
- "Update this comment"
â Exploratory work
- "Show me 3 ways to solve X"
- "Explain how this code works"
- "What are the trade-offs of Y?"
â When you need maximum flexibility
- Rapid prototyping with frequent pivots
- Experimental code you might throw away
- Ad-hoc queries and research
The Rule of Thumbâ
If the task would take >30 minutes and has quality requirements (tests, docs, validation), use a workflow.
If it's quick or exploratory, conversational mode is fine.
Part 5: Creating Custom Workflows (Optional, 2 minutes)â
You're not limited to spec_creation_v1 and spec_execution_v1. You can create custom workflows.
When to Create a Custom Workflowâ
Create a custom workflow when you have:
- A repeatable process with multiple phases
- Quality gates that must be enforced
- Complex validation that AI might skip
- State that needs to persist across sessions
Examples of Custom Workflowsâ
Real workflows in prAxIs OS:
test_generation_v3- Generate comprehensive test suitespraxis_os_upgrade_v1- Upgrade prAxIs OS installations
You could create workflows for:
- Database migrations with validation
- API documentation generation from code
- Security audit processes
- Performance optimization procedures
How to Create a Custom Workflowâ
This is beyond the scope of this tutorial, but the process involves:
- Define workflow structure in
metadata.json - Create phase files (
phase.md) for each phase - Define validation gates (required evidence for each phase)
- Create task files for detailed guidance
- Test end-to-end with the workflow engine
For More: See the How-To guide "Create Custom Workflows" (coming in Phase 3) or read the meta-workflow standards.
What You Learnedâ
Congratulations! You now understand the prAxIs OS workflow system. Here are the key takeaways:
1. Workflows Are Enforcement Toolsâ
Workflows are not suggestions or checklists. They are:
- Executable code that enforces progression
- Phase gates that AI cannot bypass
- Validation engines that check evidence
2. Phase Gating Works in Codeâ
The workflow engine checks:
- â Required files exist
- â Required sections are present
- â Tests are passing
- â Evidence is collected
Only then does it allow progression to the next phase.
3. Evidence Over Promisesâ
The workflow doesn't trust the AI's word that something is done. It verifies:
- Files exist on disk
- Tests run and pass
- Coverage thresholds are met
- Validation checks succeed
4. State is Persistentâ
Workflows maintain state on disk, enabling:
- Resume from any point after interruption
- Audit trail of what was done
- Recovery from crashes or restarts
- Handoff between developers or sessions
5. Use Workflows for Complex Workâ
Use workflows when:
- Task will take >30 minutes
- Quality gates are important (tests, docs, validation)
- You want resumability and state tracking
- Multiple phases with dependencies exist
Next Stepsâ
Now that you understand workflows, continue learning:
- How-To: Create Custom Workflows (Coming in Phase 3) - Build your own phase-gated workflows
- How-To: Debug Workflow Execution (Coming in Phase 3) - Troubleshoot workflow issues
- How-To: Resume Interrupted Workflows (Coming in Phase 3) - Recover and continue
- Reference: Workflows - Complete workflow system reference
- Explanation: Architecture - How the workflow engine works
Troubleshootingâ
Issue: Agent advances phase without completing checkpointâ
This should not happen. If it does:
Stop. Show me the current workflow state and evidence collected for the checkpoint.
The workflow engine enforces checkpoints in code, so if this happens, there may be a bug. Report it.
Issue: Cannot find workflow stateâ
Solution:
Workflow state is stored in the workflow engine's internal state. Ask:
What's the current workflow status? Use get_workflow_state() to check.
Issue: Want to restart a workflow from beginningâ
Solution:
Cancel the current workflow and start a new session.
Workflow state is tied to a session ID. Starting a new workflow creates a new session.
Summaryâ
In this tutorial, you:
- â Learned workflows are phase-gated tools, not processes
- â Experienced checkpoint validation and evidence requirements
- â Checked workflow state and understood persistence
- â Learned when to use (and not use) workflows
- â Understood how to create custom workflows
Time taken: 10-15 minutes
Key Insight: Workflows enforce quality through code, not through hoping AI "remembers" best practices. Phase gates are real barriers that require evidence to pass.
You now understand why prAxIs OS workflows are essential for production-quality AI-assisted development! đ
Test Your Understandingâ
Answer these questions to verify your understanding:
-
What is the difference between a workflow and a checklist?
- Answer: A workflow enforces progression through code with validation gates. A checklist is a suggestion that can be ignored.
-
Can an AI skip a phase in a workflow?
- Answer: No. The workflow engine blocks phase transitions until checkpoint evidence is validated.
-
What happens to workflow state if the MCP server restarts?
- Answer: The state persists on disk and can be resumed from the last completed checkpoint.
-
When should you use a workflow vs. conversational mode?
- Answer: Use workflows for complex, multi-phase work (>30 min) with quality requirements. Use conversational mode for quick tasks and exploration.
If you can answer these confidently, you understand workflows! đ