turbo_promptable

Object-Oriented Prompting framework for the turbo ecosystem. Define AI agent prompts, roles, workflows, and tools as type-safe Dart objects.

Features

  • TurboPromptable base class extending TurboSerializable
  • FrontmatterDto for structured metadata with custom values
  • ExportResult for export output
  • export() for single promptable export
  • 18 DTOs for organizational hierarchy (Team, Area, Role)
  • Knowledge DTOs (Collection, Instruction, Workflow, Reference, Template, RawBox, Activity, SubAgent, Repo)
  • Tool DTOs (API, Script) with method and parameter definitions
  • PersonaDto for agent identity
  • YAML frontmatter generation
  • Config inheritance across tree levels

Installation

dependencies:
  turbo_promptable: ^0.0.1

Usage

import 'package:turbo_promptable/turbo_promptable.dart';

// Create a team structure using convenience parameters
final team = TeamDto(
  name: 'Engineering',
  description: 'Engineering team',
  body: (_) => 'Engineering team content',
  areas: [
    AreaDto(
      name: 'Backend',
      description: 'Backend area',
      body: (_) => 'Backend area content',
      roles: [
        RoleDto(
          name: 'API Developer',
          description: 'API Developer role',
          body: (_) => 'API Developer role content',
          expertise: ExpertiseDto(
            name: 'Backend Expertise',
            description: 'Backend development expertise',
            field: 'Backend',
            specialization: 'API Development',
            experience: '5 years',
            body: (_) => 'Expertise content',
          ),
        ),
      ],
    ),
  ],
);

// Generate frontmatter
final frontmatter = team.exportMetaData();
// ---
// name: Engineering
// description: Engineering team
// ---

// Export single promptable
final result = team.export(null);
print(result?.value);

FrontmatterDto

All DTOs accept name and description as convenience parameters. Use metaData for custom values or to override:

// Simple usage - name and description only
final instruction = InstructionDto(
  name: 'Code Review',
  description: 'How to review code',
  body: (_) => 'Review code thoroughly...',
);

// With custom values via metaData
final instruction = InstructionDto(
  name: 'Code Review',
  description: 'How to review code',
  metaData: {'priority': 'high', 'category': 'process'},
  body: (_) => 'Review code thoroughly...',
);
// Result: name='Code Review', description='How to review code', priority='high', category='process'

// metaData overrides name/description when both are provided
final instruction = InstructionDto(
  name: 'Code Review',           // ignored
  metaData: {
    'name': 'PR Review',           // takes precedence
    'description': 'How to review PRs',
    'priority': 'high',
  },
  body: (_) => 'Review code thoroughly...',
);
// Result: name='PR Review', description='How to review PRs', priority='high'

// Generate frontmatter includes custom values
final frontmatter = instruction.generateFrontmatter();
// ---
// name: PR Review
// description: How to review PRs
// priority: high
// ---

Export Configuration

Control how promptables are exported with ExportConfig:

final role = RoleDto(
  name: 'Developer',
  description: 'Developer role',
  body: (_) => 'Developer role content',
  expertise: ExpertiseDto(
    name: 'Development Expertise',
    description: 'Development expertise',
    field: 'Software',
    specialization: 'Full Stack',
    experience: '3 years',
    body: (_) => 'Expertise content',
  ),
  exportConfig: const ExportConfig(
    shouldExport: true,
    fileExtension: 'md',
    bodyType: BodyType.markdown,
    path: '.',
    fileName: 'developer-role',
  ),
);

// Export single promptable
final result = role.export(null);
print(result?.combined); // frontmatter + body

// Resolve config with parent inheritance
final resolved = role.resolveConfig(parentConfig);

DTOs

Hierarchy

  • TeamDto - Top-level organizational unit containing areas
  • AreaDto - Domain within a team containing roles
  • RoleDto - Specialist role within an area containing knowledge items

Knowledge

  • CollectionDto - Lists of items
  • InstructionDto - How-to guides and behavioral rules
  • WorkflowDto - Step-by-step processes
  • ReferenceDto - Static documentation with optional URL
  • TemplateDto - Reusable patterns with variables
  • RawBoxDto - Raw input materials
  • ActivityDto - AI commands with prompt and model
  • SubAgentDto - AI agents with role assignment
  • RepoDto - Repository references with path and URL

Tools

  • ApiDto - HTTP/REST API tools
  • ScriptDto - Executable script tools with input/output types

Identity

  • PersonaDto - Agent identity with traits, tone, and constraints

License

MIT

Libraries

core/constants/tp_keys
core/extensions/t_collection_extensions
core/helpers/t_dart_render_helper
core/helpers/t_dart_string_helper
core/models/t_config
core/models/t_embed_type
core/models/t_md_section
core/models/t_render_type
core/typedefs/t_body_builder_def
spawn/abstracts/t_spawnable
spawn/enums/t_cli_tool
spawn/enums/t_prompt_delivery
spawn/models/t_file
spawn/models/t_folder
spawn/models/t_spawn_config
turbo_promptable
Object-Oriented Prompting framework for defining AI agent prompts, roles, workflows, and tools as type-safe Dart objects.
workspace/abstracts/of_abilities
workspace/abstracts/of_features
workspace/abstracts/of_issues
workspace/abstracts/of_journeys
workspace/abstracts/of_mockups
workspace/abstracts/of_modules
workspace/abstracts/of_prds
workspace/abstracts/of_projects
workspace/abstracts/of_prototypes
workspace/abstracts/of_scenarios
workspace/enums/t_body_type
workspace/enums/t_ref_type
workspace/models/checklists/acceptance_criteria
workspace/models/checklists/constraints
workspace/models/checklists/non_goals
workspace/models/context/actor
workspace/models/context/collection
workspace/models/context/concept
workspace/models/context/documentation
workspace/models/context/project
workspace/models/context/reference
workspace/models/context/stakeholder
workspace/models/context/subject
workspace/models/instructions/convention
workspace/models/instructions/skill
workspace/models/memories/decision
workspace/models/memories/event
workspace/models/memories/insight
workspace/models/memories/meeting
workspace/models/memories/progress
workspace/models/meta/t_meta_data
workspace/models/meta/t_promptable
workspace/models/meta/t_tag
workspace/models/root/activity
workspace/models/root/agent
workspace/models/root/checklist
workspace/models/root/context
workspace/models/root/goal
workspace/models/root/input
workspace/models/root/instruction
workspace/models/root/issue
workspace/models/root/memory
workspace/models/root/output
workspace/models/root/persona
workspace/models/root/prompt_field
workspace/models/root/role
workspace/models/root/spec
workspace/models/root/template
workspace/models/root/tool
workspace/models/root/workflow
workspace/models/specs/ability
workspace/models/specs/feature
workspace/models/specs/fr
workspace/models/specs/journey
workspace/models/specs/mockup
workspace/models/specs/module
workspace/models/specs/nfr
workspace/models/specs/prototype
workspace/models/specs/requirement
workspace/models/specs/scenario
workspace/models/specs/task
workspace/models/tools/api
workspace/models/tools/cli
workspace/models/tools/script
workspace/models/workflows/step