Every pipeline step beyond context generation is implemented as a tool adapter — a class that wraps a bridge call, file I/O, or a pure Python check behind a consistentDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/8BitTacoSupreme/flowstate/llms.txt
Use this file to discover all available pages before exploring further.
ToolResult return value. The orchestrator never calls subprocess or writes files directly; it calls an adapter method and checks result.success. This makes adapters independently testable and swappable.
ToolAdapter Base Class
All adapters extendToolAdapter from flowstate/tools/base.py. The constructor accepts four parameters:
bridge property is lazy — if no bridge is injected at construction time, one is created on first access from a default BridgeConfig. In practice, the orchestrator always injects the shared bridge instance.
bridge_to_result()
A convenience method that converts aBridgeResult from a bridge call into the adapter’s ToolResult contract:
get_memory_context()
Queries theMemoryStore for prior knowledge relevant to a topic and returns a formatted string ready for prompt injection:
memory is None (e.g., in a test with no store), an empty string is returned and the adapter proceeds without prior context.
ToolResult Dataclass
All adapter methods return aToolResult:
| Field | Type | Description |
|---|---|---|
success | bool | Whether the step succeeded |
output | str | Human-readable status line (printed by _run_step()) |
artifacts | list[str] | Absolute file paths to created output files |
error | str | None | Error message stored in flowstate.json if success=False |
ResearchAdapter
ResearchAdapter in flowstate/tools/research.py performs split-topic research by running one short bridge call per topic and merging the sections into research/report.md.
Class name: ResearchAdapter | Adapter name: "research"
execute(answers: InterviewAnswers) -> ToolResult
_split_topics() splits answers.research_focus by comma, strips whitespace, and falls back to ["general research"] if the field is empty.
For each topic, the adapter:
- Builds a focused prompt with
_build_topic_prompt(topic, answers)— includescore_problemandarchitecture_patternas context - Prepends prior memory context via
get_memory_context(topic)if any exists - Calls
self.bridge.run(...)with these parameters:
# Research Report document separated by --- dividers and written to research/report.md.
RESEARCH_SYSTEM_PROMPT
Dry-run mock
Whendry_run=True, the adapter writes MOCK_REPORT to research/report.md and returns immediately without calling the bridge:
StrategyAdapter
StrategyAdapter in flowstate/tools/strategy.py runs a single strategic pressure-test call and writes the result to research/strategy.md.
Class name: StrategyAdapter | Adapter name: "strategy"
pressure_test(answers: InterviewAnswers) -> ToolResult
_build_pressure_test_prompt() constructs a structured markdown prompt from core_problem, ten_x_vision, milestones, architecture_pattern, and test_coverage. Prior memory context for "{core_problem} {ten_x_vision}" is prepended if available.
The bridge call uses:
br.output is written directly to research/strategy.md and the path is returned as an artifact. On failure, bridge_to_result(br) is returned with success=False.
STRATEGY_SYSTEM_PROMPT
Dry-run mock
Whendry_run=True, the adapter writes MOCK_STRATEGY filled with core_problem and ten_x_vision values from answers:
GSDAdapter
GSDAdapter in flowstate/tools/gsd_adapter.py handles Step 4 (Management). Unlike the research and strategy adapters, it does not make any bridge calls in live mode — it delegates entirely to write_context_files() from context.py.
Class name: GSDAdapter | Adapter name: "gsd"
new_project(state: FlowStateModel) -> ToolResult
ROADMAP.md is written using the MOCK_ROADMAP template (with milestones from interview answers). In live mode, all five context files are written by write_context_files().
The full GSD skill system (
/gsd:plan-phase, /gsd:execute-phase, /gsd:progress) runs natively inside Claude Code sessions, not through this adapter. Use flowstate launch gsd <N> to get the exact commands for native GSD execution.DisciplineAudit
The discipline step does not use aToolAdapter subclass. check_setup() in flowstate/discipline.py is a standalone function that returns an AuditResult — a pure Python project health check with no LLM calls.
check_setup(root: Path) -> AuditResult
| Check | Passes when |
|---|---|
git_repo | .git/ directory exists |
pytest_config | pyproject.toml, pytest.ini, or setup.cfg exists |
pre_commit_config | .pre-commit-config.yaml exists |
git_hooks | .git/hooks/pre-commit exists |
tests_dir | tests/ directory exists |
src_dir | src/ exists or any directory contains __init__.py |
planning_dir | .planning/ directory exists (written by GSD step) |
AuditResult fields
summary string renders as:
Creating a Custom Adapter
SubclassToolAdapter, set a name, implement one method, and return a ToolResult:
run_pipeline() and dispatch it through _run_step() with the shared bridge and memory instances.