| name | Workflow Patterns |
| description | Patterns for output formats, reflection checkpoints, agent references, and self-evaluation shared across agents and commands. |
| version | 2.0.0 |
Provide standardized patterns for output formatting, workflow checkpoints, agent references, and self-evaluation shared across agents and commands.
Standard agent output format with status criteria
Include in agents for consistent output structure
Standard analysis quality checkpoint for workflow phases
Include in workflows for consistent quality gates
Standard self-evaluation phase for agents producing reports
Include in agents for consistent quality assessment
Standard Serena initialization phase for commands
Include at start of command workflows for Serena initialization
Serena validation elements for reflection checkpoints
Include in checkpoints before code modifications or after investigations
Standard agent output format with status criteria
{
"status": "success|warning|error",
"status_criteria": {
"success": "All checks passed, confidence >= 80",
"warning": "Minor issues OR confidence 60-79",
"error": "Critical issues OR confidence less than 60"
},
"confidence": 0,
"summary": "Brief summary of results",
"metrics": {},
"findings": [],
"next_actions": []
}
Standard status criteria for agent output format
"status_criteria": {
"success": "All checks passed, confidence >= 80",
"warning": "Minor issues OR confidence 60-79",
"error": "Critical issues OR confidence less than 60"
}
Standard analysis quality checkpoint for workflow phases
Have I gathered sufficient evidence to proceed?
Are there gaps in my understanding?
If confidence less than 70, seek more evidence or ask user
Standard Serena initialization phase for workflows
Initialize Serena and check existing patterns
Activate Serena project with activate_project
Workflow guidance
Step completed
Check list_memories for relevant patterns
Workflow guidance
Step completed
Load applicable memories with read_memory
Workflow guidance
Step completed
Serena validation for investigation/analysis checkpoints
think_about_collected_information
After investigation phase completes
Serena validation before code modification operations
think_about_task_adherence
Before code modification
Serena validation before reporting task completion
think_about_whether_you_are_done
Before reporting completion to user
Mandatory reflection tool calls as explicit workflow steps (not just checkpoint definitions)
Validate search completeness
Serena think_about_collected_information
Search quality validation
true
Validate task adherence
Serena think_about_task_adherence
Task alignment validation
true
Validate task completion
Serena think_about_whether_you_are_done
Completion validation
true
After search sequence of 3+ operations (find_symbol, search_for_pattern, get_symbols_overview, Grep, Glob)
Before any symbol editing (replace_symbol_body, insert_before_symbol, insert_after_symbol, rename_symbol) or file modification
Before returning final result to user
Expand search scope, use alternative search strategies, or ask user for clarification
Review requirements, document deviation rationale, or ask user before proceeding
Identify incomplete items, iterate on missing work, or report partial completion with remaining items
Tool output indicates incomplete coverage, missing critical areas, or low confidence in search results
Tool output indicates task deviation, requirements mismatch, or scope creep detected
Tool output indicates incomplete items, pending work, or unresolved blockers
Failure-handling phase template for exceptional paths aligned with shared workflow usage
Handle errors and edge cases gracefully
If tool call fails: log error and attempt alternative approach
If data unavailable: document gap and continue with bounded analysis
If contradictory evidence: flag uncertainty and request clarification
Standard agent reference syntax for commands
Use ref attribute to reference agent defined in agents/ directory.
readonly attribute indicates whether agent can modify files.
Standard self-evaluation phase for commands and agents that produce reports
Brief quality assessment of output
Calculate confidence using decision_criteria factors
Decision criteria evaluation
Confidence score
Identify top 1-2 critical issues if confidence below 80
Gap analysis
Issue list
Append self_feedback section to output
Output formatting
Self-feedback section
Standard self-feedback output section for commands that include self-evaluation
XX/100 (based on decision_criteria calculation)
- [Critical] Issue description (if any, max 2 total)
- [Warning] Issue description (if any)
<best_practices>
Use output_format for all agents that return structured results
Include reflection_checkpoint at key workflow decision points
Include prepare_phase for Serena initialization in commands
Add serena_validation to checkpoints before code modifications
Use reflection_workflow_steps pattern for mandatory think_about_* calls
Add self_evaluate_phase for agents producing reports or recommendations
Use failure_handling phase in all workflows
Use agent_ref syntax for consistent agent references in commands
</best_practices>
Output status must use standard criteria (success >= 80, warning 60-79, error less than 60)
Reflection checkpoints must include confidence threshold
Commands must include prepare_phase for Serena initialization
Use serena_validation_pre_edit before code modification operations
Call think_about_collected_information after any search sequence of 3+ operations
Call think_about_task_adherence before any symbol editing or file modification
Call think_about_whether_you_are_done before returning final result to user
Include failure_handling phase in complex workflows
Use self_feedback_output format for self-evaluation results
Use agent_ref with readonly attribute for clarity
Add serena_validation_investigation after investigation phases
Use standard output_status_criteria thresholds
Include confidence score in all structured outputs
Define threshold in reflection_checkpoints
Include prepare_phase in command workflows
Use serena_validation before code modifications
Call think_about_collected_information after 3+ search operations
Call think_about_whether_you_are_done before final response
Custom status thresholds that differ from standard
Omitting failure_handling in complex workflows
Omitting Serena initialization in commands
Skipping reflection tool calls at mandatory checkpoints
<related_skills>
Base templates for error escalation, decision criteria, enforcement
Parallel execution and timeout configuration
Serena MCP operations (memory, symbol search, code navigation)
</related_skills>