turbo_promptable 0.5.0
turbo_promptable: ^0.5.0 copied to clipboard
Object-Oriented Prompting framework for defining AI agent prompts, roles, workflows, and tools as type-safe Dart objects.
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:
Role,Persona,Workflow,Step,Activity,Instruction,Input,Output,Goal,Issue,Context,Template,Tool, and more - Spec models:
Ability,Feature,Requirement,Scenario,Journey,Task,Module,Mockup,Prototype - Tool models:
Api,Cli,Script,Mcp, together withToolCommand,ToolParameter, andToolParameterOptionfor declarative command schemas - Spawnable abstraction (
TSpawnable) with CLI tool and prompt-delivery enums for launching agents against Claude Code, Cursor, Windsurf, and others - Cross-referencing abstracts (
OfAbilities,OfFeatures,OfIssues,OfJourneys,OfMockups,OfModules,OfPrds,OfProjects,OfPrototypes,OfScenarios) for composing specs - JSON serialization on every model via
json_serializable; YAML, Markdown, and XML output inherited fromturbo_serializable - Structured metadata (
TMetaData) on every promptable
Installation #
dependencies:
turbo_promptable: ^0.4.0
Usage #
import 'package:turbo_promptable/turbo_promptable.dart';
const workflow = Workflow(
name: 'Review Workflow',
steps: [
Step(
name: 'Analyse',
input: Input(name: 'Source Code'),
instructions: 'Analyse the provided source code for quality issues.',
output: Output(
name: 'Analysis Report',
schema: 'markdown',
),
),
],
);
const role = Role(
name: 'Code Reviewer',
expertise: 'Static analysis and code quality',
workflows: [workflow],
);
const persona = Persona(
name: 'Code Reviewer',
expertise: 'Static analysis and code quality',
workflows: [workflow],
identity: 'A meticulous reviewer focused on maintainability.',
);
print(persona.toJson());
Core Concepts #
TPromptable #
Every workspace model extends TPromptable, which itself extends TSerializable from turbo_serializable. Models have:
name— required identifiermetaData— optionalTMetaDatafor frontmatter (description, tags, etc.) on models that declare it
Roles and Personas #
Role— a spawnable capability bundle with expertise, activities, checklists, instructions, templates, tools, and workflowsPersona— aRoleaugmented with anidentitystring that describes the persona's character; construct viaPersona(...)orPersona.fromRole(role: ..., identity: ...)
Workflows and Steps #
A Workflow contains an ordered list of Steps. Each Step has a required Input, a string instructions field, and a required Output.
Specs #
Spec models (Ability, Feature, Requirement, Scenario, Journey, Task, Module, Mockup, Prototype) describe intended behaviour and deliverables. They cross-reference each other via the Of* abstracts exported from workspace/abstracts/.
Tools #
Tool subclasses (Api, Cli, Script, Mcp) extend the shared Tool base, which carries a list of ToolCommands. Each command declares its parameters via ToolParameter, and parameters can enumerate discrete ToolParameterOptions.
Spawnable #
TSpawnable (used by Role and Persona) carries cliTool (TCliTool), command, and promptDelivery (TPromptDelivery) for orchestrating agent launches across tools like Claude Code, Cursor, Windsurf, and custom CLIs.
License #
MIT