turbo_promptable 0.6.0
turbo_promptable: ^0.6.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:
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, andTToolSet, each carrying a list ofTToolAbility - Spawnable abstraction (
TSpawnable, extended byTAgent) carryingid,allowedTools,yolo,model, andheadless, with aspawnmethod that builds a launch command via aTCliToolfor 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 fromturbo_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 identifiermetaData— optionalTMetaDatafor frontmatter (description, tags, etc.) on models that declare it
Roles and Personas #
TRole— a capability bundle with requiredexpertise, plus optionalinstructionsandtoolsTPersona— aTRoleaugmented with anidentitystring that describes the persona's character; construct viaTPersona(...)orTPersona.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