Skip to content

hei-ying/openspec-workflow-builder

Repository files navigation

OpenSpec Workflow Builder

A conversational workflow builder for OpenSpec that helps teams create custom workflows through natural language dialogue.

Features

  • 🎯 Conversational Guidance: Build workflows through natural conversation
  • 🧠 Smart Template Recommendations: AI-powered suggestions based on your tech stack and team
  • 🔧 Capability Configuration: Configure skills, MCPs, plugins, and agents for each workflow step
  • 📝 Auto-Generated Files: Complete OpenSpec schemas and template files
  • Validation: Built-in validation to ensure generated schemas are correct

Installation

npm install
npm run build

Usage

As an OpenClaw Skill

  1. Copy this directory to ~/.openclaw/skills/openspec-workflow-builder/
  2. The skill will be automatically loaded by OpenClaw
  3. Start a conversation to create a workflow

Programmatically

import { OpenSpecWorkflowBuilder } from 'openspec-workflow-builder';

const builder = new OpenSpecWorkflowBuilder('./openspec/schemas');

// Process user messages
const response = await builder.processMessage("Help me create a rapid workflow");
console.log(response);

// Install the workflow
const result = await builder.install();
console.log(result.message);

Quick CLI Usage

import { buildWorkflow } from 'openspec-workflow-builder';

const result = await buildWorkflow({
  name: 'my-workflow',
  template: 'rapid',
  techStack: ['TypeScript', 'React'],
  teamSize: 'small',
  iterationStyle: 'rapid',
  outputPath: './openspec/schemas'
});

Workflow Templates

Rapid Template

Fast iteration with minimal overhead. Ideal for bug fixes and quick changes.

Research-First Template

Thorough research before implementation. Ideal for architecture decisions and new tech.

Document-Processing Template

End-to-end documentation workflow. Ideal for API docs, user manuals, technical docs.

Security-Review Template

Security-focused workflow with threat analysis. Ideal for vulnerability fixes and auth systems.

Project Structure

openspec-workflow-builder/
├── src/
│   ├── types.ts              # TypeScript type definitions
│   ├── workflow-builder.ts   # Core conversational guide
│   ├── capability-manager.ts  # Capability management
│   ├── template-manager.ts    # Template management
│   ├── schema-generator.ts   # OpenSpec schema generator
│   └── installer.ts         # OpenSpec installer
├── config/
│   ├── templates/           # Workflow templates (YAML)
│   └── capabilities/        # Capability mappings
├── templates/               # OpenSpec template files (Markdown)
├── SKILL.md                # Skill documentation
├── package.json
└── tsconfig.json

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode (for development)
npm run dev

# Type check
npm run type-check

Example Conversation

User: "Help me create a React component library workflow"
AI: "I'll help you design a suitable workflow! Let me ask a few questions..."
AI: "What's your project's tech stack?"
User: "TypeScript, React, Tailwind CSS"
AI: "How large is your team?"
User: "Small team, 5 people"
AI: "What's your iteration style?"
User: "Rapid iteration"
AI: "Based on your inputs, I recommend the 'Rapid' template..."
AI: "Here's a preview..."
User: "Looks good, generate it!"
AI: "✅ Workflow created successfully!"

Generated Output

After generation, you'll have a complete OpenSpec workflow structure:

openspec/schemas/my-workflow/
├── schema.yaml              # OpenSpec schema definition
├── templates/
│   ├── proposal.md         # Template files
│   ├── tasks.md
│   └── ...
└── .openspec/
    └── metadata.json      # Workflow metadata

Using Your Workflow

Once created, use the OpenSpec CLI:

# Create a new task with your workflow
openspec new my-feature --schema my-workflow

# List available schemas
openspec schema list

# Validate your schema
openspec schema validate my-workflow

Customization

Adding New Templates

  1. Create a new YAML file in config/templates/
  2. Add corresponding template files in templates/
  3. Update capability-map.yaml with new capability mappings

Adding New Capabilities

  1. Add capability definition to capability-map.yaml
  2. Update CapabilityManager with descriptions
  3. Modify recommendation logic if needed

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details.

Links

About

OpenSpec workflow builder skill

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors