Skip to main content

Tool: Vetra Studio

This chapter introduces you to one of the most powerfull features of the Powerhouse development framework: Specification Driven AI-control. In the 'Get Started' chapter we've been making use of strict schema definition principles to communicate the intended use case of our reactive documents.

Important

The schema definition language, is a not only a shared language that bridges the gap between developer, designer and analyst but also the gap between builder and AI-agent.

Vision: Specification Driven AI

At Powerhouse we are embracing the progress of AI assisted coding while unlocking the next level of AI control through specification driven AI control.

  • Communicate your solution and intent through a structured specification framework designed for AI collaboration.
  • Specifications enable precise, iterative edits, since all our specification documents are machine-readable and executable.
  • Specifications offer the ability to update exact parameters and properties as your specs evolve in lock-step with your agent.
  • Specifications turn fragile sandcastles into solid, editable, and maintainable functionality with predictable results.

This approach allows for the creation of editable specifications, enabling business analysts to modify details and instruct the AI to generate code based on updated specifications. It results in composable, maintainable, and scalable functionality.

Introducing Vetra Studio

Vetra Studio serves as a centralized hub for developers to access and manage specifications. It allows developers to open packages (Git repositories with metadata) from a Vetra package library, providing access to a remote Vetra drive where all specifications are stored.

This setup ensures that all necessary documentation and project requirements are in one accessible location, streamlining communication and agreement on requirements and operations. Additionally, Vetra Studio functions as the orchestration hub where you as a builder assemble all the necessary specifications for your intended use-case, software solution or package. For each of the different modules that together form a package a specification document can be created in Vetra Studio.

As Vetra Studio matures each of these specification documents will offer an interface by which you as a builder get more control over the modules that make up your package.

Modules
The list of available modules color coded according to the 3 categories.

Module Categories

1. Document Models

  • Document model specification: Defines the structure and operations of a document model using GraphQL SDL, ensuring consistent data management and processing.

2. User Experiences

  • Editor specification: Outlines the interface and functionalities of a document model editor, allowing users to interact with and modify document data.
  • Drive-app specification: Specifies the UI and interactions for managing documents within a Drive, providing tailored views and functionalities.

3. Data integrations

  • Subgraph specification: Details the connections and relationships within a subgraph, facilitating efficient data querying and manipulation.
  • Codegen Processor Specification: Describes the process for automatically generating code from document model specifications, ensuring alignment with intended architecture.
  • RelationalDb Processor Specification: Defines how relational databases are structured and queried, supporting efficient data management and retrieval.
Vetra Studio Drive
The Vetra Studio Drive, a builder app that collects all of the specification of a package.

Vetra Studio Workflow

1. Launch Vetra Studio

You can launch Vetra Studio in two modes:

ph vetra --interactive

In interactive mode:

  • You'll receive confirmation prompts before any code generation
  • Changes require explicit confirmation before being processed
  • Provides better control and visibility over document changes

Standard Mode

ph vetra

In standard mode:

  • Changes are processed automatically with 1-second debounce
  • Multiple changes are batched and processed together
  • Uses the latest document state for processing

2. Launch Claude with Reactor-MCP

Vetra Studio integrates deeply with Claude through MCP (Model Control Protocol). This is where AI comes into the mix and you get the chance to have greater control and direction over what your llm is coding for you.

1. Start the Reactor MCP:

ph mcp

2. Verify MCP connection:

  • Check that the Reactor MCP is available.

  • Confirm Vetra Studio shows "Connected to Reactor MCP"

  • To learn what is a [Reactor] itself read (apps/academy/docs/academy/Architecture/WorkingWithTheReactor)

  • To learn more about the [Reactor MCP] read (apps/academy/docs/academy/GetStarted/ReactorMCP)

Key Reactor MCP Features:

  • Automatic document model creation from natural language descriptions
  • Smart editor generation based on document models
  • Automatically triggers code generation when documents reach valid state

The powerhouse config includes a vetra URL for consistent project configuration across different environments.

tip
  • Vetra supports integration with custom remote drives, allowing users to create, share and manage documents within these drives.
  • The MCP server enables the agent to work with both existing and newly created document models.

3. Vetra Studio Package Creation Workflow

A. Set Package Description (Required)

  1. Provide a name for your package
  2. Add a meaningful description
  3. Add keywords to add search terms to your package
  4. Confirm changes when prompted in interactive mode

B. Define Document Model (Required)

You can create document models in two ways:

  1. Using MCP (AI-Assisted)

    • Describe your document needs in natural language in great detail.
    • Claude will:
      • Generate an appropriate schema
      • Create the necessary operations
      • Implement the required reducers
      • Place the document in the Vetra drive
  2. Manual Creation

    • Define document schema with fields and types as in the 'Get Started'
    • Create the necessary operations
    • Add the required modules to your package
    • The document model creation chapter in the Mastery track provides in depth support here

C. Add Document Editor (Required)

  1. Using MCP (AI-Assisted)

    • Request Claude to create an editor for your document. Do this with the help of a detailed description of the user interface, user experience and logic that you wish to generate. Make sure to reference operations from the document model to get the best results
    • Claude will:
      • Generate editor components
      • Implement necessary hooks
      • Create required UI elements
  2. Manual Creation

    • Select your target document model
    • Configure the currently limited editor properties
    • Add the editor specification to Vetra Studio drive
    • The system will generate scaffolding code

D. Data Integrations (Coming Soon)

Support for:

  • Subgraph integration
  • Code generation processors
  • Relational database processors

Best Practices

Working with MCP and claude

  • Provide clear, specific instructions and ask for clarifying questions to be answered before code generation.
  • Review generated schemas before confirmation and work in layers instead of 'one-shotting' your code.
  • Verify implementation details in generated code before continuing.
  • Always double-check proposed next actions