turbo_promptable

Object-Oriented Prompting framework for the turbo ecosystem. Define AI agent prompts, roles, workflows, and tools as type-safe Dart objects that serialize to JSON, YAML, Markdown, and XML.

Features

  • Type-safe workspace models: TRole, TPersona, TWorkflow, TStep, TInstruction, TInput, TOutput, TGoal, TEndGoal, TIssue, TContext, TTemplate, TTool, and more
  • Spec models: TAbility, TFeature, TRequirement, TScenario, TJourney, TTask, TModule, TMockup, TPrototype
  • Tool models: TApi, TCli, TScript, TMcp, and TToolSet, each carrying a list of TToolAbility
  • Spawnable abstraction (TSpawnable, extended by TAgent) carrying id, allowedTools, yolo, model, and headless, with a spawn method that builds a launch command via a TCliTool for tools like Claude Code, Cursor, Windsurf, and custom CLIs
  • Cross-referencing abstracts (TOfAbilities, TOfFeatures, TOfIssues, TOfJourneys, TOfMockups, TOfModules, TOfPrds, TOfProjects, TOfPrototypes, TOfScenarios) for composing specs
  • JSON serialization on every model via json_serializable; YAML, Markdown, and XML output inherited from turbo_serializable
  • Structured metadata (TMetaData) on every promptable

Installation

dependencies:
  turbo_promptable: ^0.6.0

Usage

import 'package:turbo_promptable/turbo_promptable.dart';

const workflow = TWorkflow(
  name: 'Review Workflow',
  endGoal: TEndGoal(
    'A reviewed, higher-quality codebase',
    name: 'Quality Review',
  ),
  steps: [
    TStep(
      name: 'Analyse',
      input: TInput(name: 'Source Code'),
      instructions: 'Analyse the provided source code for quality issues.',
      output: TOutput(
        name: 'Analysis Report',
        schema: 'markdown',
      ),
    ),
  ],
);

const persona = TPersona(
  name: 'Code Reviewer',
  expertise: 'Static analysis and code quality',
  identity: 'A meticulous reviewer focused on maintainability.',
);

void main() {
  print(workflow.toJson());
  print(persona.toJson());
}

Core Concepts

TPromptable

Every workspace model extends TPromptable, which itself extends TSerializable from turbo_serializable. Models have:

  • name — required identifier
  • metaData — optional TMetaData for frontmatter (description, tags, etc.) on models that declare it

Roles and Personas

  • TRole — a capability bundle with required expertise, plus optional instructions and tools
  • TPersona — a TRole augmented with an identity string that describes the persona's character; construct via TPersona(...) or TPersona.fromRole(role: ..., identity: ...)

Workflows and Steps

A TWorkflow contains an ordered list of TSteps and a required TEndGoal. Each TStep has a required TInput, a string instructions field, and a required TOutput.

Specs

Spec models (TAbility, TFeature, TRequirement, TScenario, TJourney, TTask, TModule, TMockup, TPrototype) describe intended behaviour and deliverables. They cross-reference each other via the TOf* abstracts exported from workspace/abstracts/.

Tools

Tool subclasses (TApi, TCli, TScript, TMcp) extend the shared TTool base, which carries a list of TToolAbilitys. TTool.asToolSet(...) converts a tool into a TToolSet.

Spawnable

TSpawnable (extended by TAgent) carries id, allowedTools, yolo, model, and headless, and exposes a spawn method that builds a launch command via a TCliTool for orchestrating agent launches across tools like Claude Code, Cursor, Windsurf, and custom CLIs.

License

MIT

Libraries

core/extensions/t_collection_extensions
spawn/enums/t_cli_tool
spawn/enums/t_config_source
spawn/models/t_file
spawn/models/t_folder
spawn/records/headless_invocation
spawn/records/interactive_invocation
spawn/records/system_prompt_invocation
turbo_promptable
Object-Oriented Prompting framework for defining AI agent prompts, roles, workflows, and tools as type-safe Dart objects.
workspace/abstracts/t_of_abilities
workspace/abstracts/t_of_features
workspace/abstracts/t_of_issues
workspace/abstracts/t_of_journeys
workspace/abstracts/t_of_mockups
workspace/abstracts/t_of_modules
workspace/abstracts/t_of_prds
workspace/abstracts/t_of_projects
workspace/abstracts/t_of_prototypes
workspace/abstracts/t_of_scenarios
workspace/constants/t_tp_defaults
workspace/enums/t_body_type
workspace/enums/t_ref_type
workspace/models/checklists/t_acceptance_criteria
workspace/models/checklists/t_constraints
workspace/models/checklists/t_non_goals
workspace/models/context/t_actor
workspace/models/context/t_collection
workspace/models/context/t_concept
workspace/models/context/t_documentation
workspace/models/context/t_project
workspace/models/context/t_reference
workspace/models/context/t_stakeholder
workspace/models/context/t_subject
workspace/models/instructions/t_convention
workspace/models/instructions/t_skill
workspace/models/memories/t_decision
workspace/models/memories/t_event
workspace/models/memories/t_insight
workspace/models/memories/t_meeting
workspace/models/memories/t_progress
workspace/models/meta/t_meta_data
workspace/models/meta/t_promptable
workspace/models/meta/t_spawnable
workspace/models/root/t_agent
workspace/models/root/t_checklist
workspace/models/root/t_context
workspace/models/root/t_end_goal
workspace/models/root/t_goal
workspace/models/root/t_input
workspace/models/root/t_instruction
workspace/models/root/t_issue
workspace/models/root/t_memory
workspace/models/root/t_output
workspace/models/root/t_persona
workspace/models/root/t_role
workspace/models/root/t_spec
workspace/models/root/t_template
workspace/models/root/t_tool
workspace/models/root/t_tool_set
workspace/models/root/t_workflow
workspace/models/specs/t_ability
workspace/models/specs/t_feature
workspace/models/specs/t_fr
workspace/models/specs/t_journey
workspace/models/specs/t_mockup
workspace/models/specs/t_module
workspace/models/specs/t_nfr
workspace/models/specs/t_prototype
workspace/models/specs/t_requirement
workspace/models/specs/t_scenario
workspace/models/specs/t_task
workspace/models/tools/t_api
workspace/models/tools/t_cli
workspace/models/tools/t_mcp
workspace/models/tools/t_script
workspace/models/tools/t_tool_ability
workspace/models/workflows/t_step