Mini Example¶
The examples/MiniWorkflow/ directory is a runnable two-stage workflow: the first stage analyzes the Calculator's README, and the second stage generates project documentation. It demonstrates the minimal combination of configuration, external tools, Guide_Doc, and custom Checkers.
1. Directory and Inputs¶
The mini.yaml file uses the current workflow fields: ex_tools, template_overwrite, mission, stage, reference_files, output_files, and checker. The startup command uses output/ as the workspace; since --output is not passed, the stage artifacts are actually located at examples/MiniWorkflow/output/unit_test/. When changing the output directory, pass --output <name> and verify the path using the current stage information.
2. Running¶
First, complete the source installation, activate the virtual environment, and then follow the direct usage to configure the model. Execute from the repository root:
make test only checks if custom tools and Checkers can be imported. make run will clean and create output/, copy Calculator, and then start UCAgent:
The --loop flag enables immediate execution in normal mode; running only make run will pause at the TUI, requiring input of loop to begin. PYTHONPATH=. is used to import my_tools and my_checkers from the current directory, which the Makefile sets automatically.
When an external Code Agent is required, use:
This command does not automatically enter the model loop. In another terminal, enter examples/MiniWorkflow/output/ first, then follow MCP Access to configure and start Codex. The Mini task requires using EditTextFile, so full MCP file tools are enabled here.
You can also copy the entire MiniWorkflow/ directory to another directory and run it; the installed UCAgent will start via the ucagent command, while custom tools and Checkers are imported from the current example directory.
The example workflow does not require embedded tools by default; the current CLI's --no-embed-tools is already set to true by default, so there is no need to add this parameter again.
3. What the Workflow Does¶
Stage analyze_project:
- Reads
Calculator/README.mdandGuide_Doc/project_analysis_guide.md; - Generates
unit_test/Calculator_analysis.md(relative to workspace); - Uses
CountWordsto provide statistics; - Accepts using a word count and Markdown format Checker.
Stage generate_documentation:
- Reads the analysis document and
Guide_Doc/documentation_template.md; - Generates
unit_test/Calculator_documentation.md(relative to workspace); - Uses
ExtractSectionsto check sections; - Accepts using word count, required sections, and Markdown format Checkers.
All stages must pass through Check/Complete. If a Checker fails, fix it according to the returned file and field, then retry.
4. Viewing Results¶
The actual word count and content are determined by the model output; do not treat the word count ranges in the example as universal requirements for all workflows.
5. Modifying the Example¶
Adding a Stage¶
Append a complete stage to the stage list in mini.yaml:
Add a Checker for this stage if reliable acceptance is required.
Adding a Tool¶
Define a class inheriting UCTool in my_tools.py, describe parameters using Pydantic args_schema, and then register the full import path in ex_tools within mini.yaml. Tools must only access paths allowed within the workspace.
Adding a Checker¶
In my_checkers.py, inherit Checker; in the constructor, call super().__init__() first, and in do_check return (bool, result). Failure results should include a stable error_code, specific error, and next_action.
6. Further Learning¶
- Custom Development Intro: Build configuration, tools, and Checkers from scratch.
- Workflow Configuration: Stages, template variables, batching, and stage indexing.
- Custom Tools: Local tools and MCP schema.
- Checkers: Lifecycle, diagnostics, and batching conventions.
- Plugin Development and Release: Package workflow resources as installable plugins.