AI-native testing framework where AI uses tools to create specs, generate tests, and keep everything in sync.
Specter is a monorepo containing:
- @codervisor/specter - AI-native testing framework with tool-augmented spec creation
- webapp - Enterprise Next.js web application for project and task management
The monorepo is managed with pnpm workspaces.
Specter is an innovative testing framework that leverages AI and tools to automate the entire testing workflow:
System → AI explores with tools → Specs → Tests → Results → AI heals/syncs
- 🤖 AI-Powered Spec Creation - AI explores your application and creates comprehensive test specifications
- 🔧 Tool-Augmented Testing - Uses Playwright, MCP tools, and code analysis to understand your system
- 🔄 Self-Healing Tests - AI automatically fixes broken tests by re-inspecting the implementation
- 🔌 Provider-Agnostic - Works with OpenAI, Anthropic, or any provider supported by Vercel AI SDK
- 📝 Framework-Agnostic - Generate tests for Vitest, Jest, or Playwright
- 🎯 Spec-First Approach - Human-readable specs that sync with implementation
specter/
├── packages/
│ ├── specter/ # Core testing framework
│ │ ├── src/ # Source code
│ │ ├── tests/ # Tests
│ │ ├── docs/ # Documentation
│ │ └── examples/ # Examples
│ └── webapp/ # Next.js web application
│ ├── src/ # App source
│ ├── prisma/ # Database schema
│ └── public/ # Static assets
├── pnpm-workspace.yaml # Workspace configuration
└── package.json # Root package.json
- Node.js 20 or later
- pnpm 8 or later
- Clone the repository:
git clone https://github.com/codervisor/specter.git
cd specter- Install dependencies:
pnpm install- Build all packages:
pnpm run buildNavigate to the specter package:
cd packages/specter- Copy
.env.exampleto.envand configure your AI provider:
cp .env.example .env- Edit
.envwith your API keys:
AI_PROVIDER=openai
OPENAI_API_KEY=your-api-key-here
OPENAI_MODEL=gpt-4ospecter explore https://example.com/login \
--description "Test login flow with valid and invalid credentials"This will:
- Launch a browser and navigate to the URL
- Use AI to analyze the page structure
- Generate a detailed test specification
- Save the spec to
./specs/
specter generate ./specs/login-flow.md \
--framework vitest \
--output ./tests/generatedspecter run ./tests/generated/*.test.ts \
--framework vitest \
--reporter markdown,json,htmlspecter heal ./tests/generated/login-flow.test.ts \
./specs/login-flow.md \
--output ./tests/generated/login-flow.test.tsspecter sync ./specs/login-flow.md \
https://example.com/login \
--output ./specs/login-flow.mdimport { AIEngine, SpecCreator, PlaywrightTool } from '@codervisor/specter';
const playwrightTool = new PlaywrightTool();
const aiEngine = new AIEngine({ config: aiConfig });
const specCreator = new SpecCreator(aiEngine, playwrightTool);
const spec = await specCreator.createSpecFromURL('https://example.com');import { CodeGenerator } from '@codervisor/specter';
const codeGenerator = new CodeGenerator(aiEngine);
const testCode = await codeGenerator.generateTest(spec, 'vitest');import { Healer } from '@codervisor/specter';
const healer = new Healer(aiEngine, playwrightTool);
const healedCode = await healer.healTest(testCode, testResult, spec);Specter is built on modern, production-ready technologies:
- Vercel AI SDK - Provider-agnostic LLM integration with tool calling
- MCP (Model Context Protocol) - Extensible tool system
- Playwright - Browser automation and UI exploration
- TypeScript 5.x - Type-safe, modern ES modules
- Node.js 20+ - Latest JavaScript runtime features
See packages/specter/docs/architecture.md for detailed design information.
Create a specter.config.ts file:
import type { SpecterConfig } from '@codervisor/specter';
const config: SpecterConfig = {
ai: {
provider: 'openai',
model: 'gpt-4o',
temperature: 0.7,
},
playwright: {
headless: true,
viewport: { width: 1280, height: 720 },
},
output: {
specsDir: './specs',
testsDir: './tests/generated',
reportsDir: './results',
format: ['markdown', 'json', 'html'],
},
};
export default config;Specter works with multiple AI providers. See docs/ai-providers.md for details.
AI_PROVIDER=openai
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4oAI_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-...
ANTHROPIC_MODEL=claude-3-5-sonnet-20241022Check out the packages/specter/examples/ directory for:
- Example workflows in
examples/workflows/ - Generated specs in
examples/specs/ - Configuration examples in
examples/configs/
# Install dependencies for all packages
pnpm install
# Build all packages
pnpm run build
# Run tests in all packages
pnpm test
# Run dev mode for all packages (parallel)
pnpm run dev
# Typecheck all packages
pnpm run typecheck
# Lint all packages
pnpm run lint
# Format all packages
pnpm run format
# Clean all build artifacts
pnpm run clean# Navigate to the package
cd packages/specter
# or
cd packages/webapp
# Run package-specific commands
pnpm run build
pnpm run test
pnpm run devcd packages/specter
# Build
pnpm run build
# Run tests
pnpm test
# Run in development mode
pnpm run devcd packages/webapp
# Start development server
pnpm run dev
# Build for production
pnpm run build
# Start production server
pnpm start- Testing Framework: See
packages/specter/README.mdandpackages/specter/docs/ - Web Application: See
packages/webapp/README.mdandWEBAPP_README.md
Contributions are welcome! Please read our contributing guidelines.
MIT - see LICENSE file for details.
- Getting Started Guide
- Architecture Overview
- AI Provider Configuration
- Agents Guide - Build Custom AI Agents
- Contributing Guidelines
- Web Application Features
Built with ❤️ by codervisor