DevilDev: The Revolutionary Spec-Driven Tool Every Developer Needs
In the fast-paced world of software development, turning vague ideas into concrete, scalable systems is a daunting task. Traditional methods often lead to architectural flaws and maintenance nightmares. Enter DevilDev, a groundbreaking tool that transforms specifications into explicit, reliable architecture. This article will show you why DevilDev is essential and how to get started.
What is DevilDev?
DevilDev is a spec-driven architecture workspace designed to help developers generate, inspect, and iterate on software architecture using natural-language specifications and existing repositories. Unlike traditional AI coding tools that jump straight to code, DevilDev focuses on making architecture explicit. This approach allows developers to break systems into clear phases, components, and relationships that can be reasoned about, evolved, and reviewed before implementation.
Created by lak7, DevilDev is an open-source project licensed under Apache 2.0. It is currently in an experimental phase, with a vision to build any piece of software using explicit, spec-driven workflows. DevilDev aims to make AI-assisted software development trustworthy, predictable, and genuinely useful.
Key Features
- Spec-Driven Generation: Turn vague ideas into explicit architecture using structured, spec-driven generation.
- Reverse Engineering: Understand existing codebases by reverse-engineering architecture from repositories.
- Iterative Evolution: Safely evolve architecture in phases instead of rewriting everything.
- Shared Mental Model: Create a shared mental model that both humans and AI can reason about together.
Use Cases
- Turning Vague Ideas into Explicit Architecture: Use DevilDev to transform high-level ideas into detailed, structured specifications.
- Understanding Existing Codebases: Reverse-engineer existing repositories to gain insights into their architecture.
- Iterative Development: Safely evolve architecture in phases, ensuring each step is reviewed and validated.
- Collaborative Development: Facilitate team collaboration by creating a shared mental model that everyone can understand and contribute to.
Step-by-Step Installation & Setup Guide
Prerequisites
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher recommended)
- npm, yarn, pnpm, or bun package manager
- PostgreSQL database (local or cloud-hosted)
- Git for version control
Option 1: Local Development Setup
Step 1: Clone and Install Dependencies
# Clone the repository
git clone https://github.com/lak7/devildev.git
cd devildev
# Install dependencies
npm install
# or
yarn install
# or
pnpm install
# or
bun install
Step 2: Set Up Public URL for Webhooks (CRITICAL)
⚠️ IMPORTANT: Webhooks are required for core functionality. Services need to send HTTP requests to your local server, which requires a public URL.
Option A: Using ngrok (Recommended)
- Sign up for a free account at ngrok
- Install ngrok:
# macOS brew install ngrok # Or download from https://ngrok.com/download - Authenticate ngrok:
ngrok config add-authtoken YOUR_AUTH_TOKEN - Start ngrok tunnel (in a separate terminal, keep it running):
ngrok http 3000 - Copy the HTTPS URL (e.g.,
https://abc123.ngrok.io) - you'll use this for webhook endpoints
Option B: Using Other Tunneling Services
Note: The public URL will change each time you restart ngrok unless you use an ngrok static URL. Choose a static URL when possible to avoid updating webhook URLs in your service dashboards after every restart.
Step 3: Set Up Services
Clerk Authentication
⚠️ CRITICAL: Clerk webhooks are required to create users in your database when they sign up. Without a working webhook, user accounts won't be created in the database.
- Go to Clerk Dashboard
- Create a new application (use Development mode)
- Copy your Publishable Key and Secret Key (they start with
pk_test_andsk_test_) - Set up webhook endpoint:
- Go to Webhooks in Clerk Dashboard
- Click Add Endpoint
- Enter your ngrok URL:
https://your-ngrok-url.ngrok.io/api/webhook/clerk - Select events:
user.created,user.updated,user.deleted - Copy the Signing Secret to
CLERK_WEBHOOK_SECRETin.env.local - Important: Update this URL whenever your ngrok URL changes
GitHub Webhook (Using GitHub App)
⚠️ CRITICAL: If you're using GitHub App features, webhooks are required to receive installation events.
- Create a GitHub App: go to GitHub Settings → Developer settings → GitHub Apps → New GitHub App. Use your ngrok URL for the homepage and callback (e.g.,
https://your-ngrok-url.ngrok.ioandhttps://your-ngrok-url.ngrok.io/api/github/callback). - In your GitHub App settings, go to Webhooks
- Set webhook URL:
https://your-ngrok-url.ngrok.io/api/webhook/github - Set webhook secret to
GITHUB_WEBHOOK_SECRETin.env.local - Select events:
installation,installation_repositories
Supabase Setup
- Create a project at Supabase
- Go to Settings → API
- Copy Project URL to
SUPABASE_URL - Copy anon/public key to
SUPABASE_KEY - Set up the vector store table (see Supabase Vector documentation)
Database Setup
- Set up a PostgreSQL database:
- Update
DATABASE_URLin.env.localwith your connection string
Dodo Payments Webhook
CRITICAL: Dodo webhooks are required to update subscription status when payments are processed.
- In your Dodo Payments dashboard, go to Webhooks
- Add webhook endpoint:
https://your-ngrok-url.ngrok.io/api/webhook/dodo - Copy the webhook secret to
DODO_WEBHOOK_KEYin.env.local - Important: Update this URL whenever your ngrok URL changes
Inngest Setup (Required)
Inngest...
REAL Code Examples from the Repository
Example 1: Generating Architecture from Specifications
Here's how you can generate architecture from specifications using DevilDev.
// Generate architecture from specifications
const generateArchitecture = async (specifications) => {
// Initialize DevilDev client
const devilDev = new DevilDevClient();
// Generate architecture
const architecture = await devilDev.generate(specifications);
// Output the generated architecture
console.log(architecture);
};
// Example specifications
const specifications = {
name: 'Example Project',
description: 'A simple example project',
components: [
{
name: 'User Service',
description: 'Service to manage user data',
responsibilities: ['User authentication', 'User profile management'],
},
{
name: 'Order Service',
description: 'Service to manage orders',
responsibilities: ['Order creation', 'Order fulfillment'],
},
],
};
// Call the function
generateArchitecture(specifications);
Example 2: Reverse Engineering Existing Codebase
Reverse engineering an existing codebase to understand its architecture.
// Reverse engineer existing codebase
const reverseEngineer = async (repositoryUrl) => {
// Initialize DevilDev client
const devilDev = new DevilDevClient();
// Reverse engineer the repository
const architecture = await devilDev.reverseEngineer(repositoryUrl);
// Output the generated architecture
console.log(architecture);
};
// Example repository URL
const repositoryUrl = 'https://github.com/example/repo';
// Call the function
reverseEngineer(repositoryUrl);
Example 3: Iterative Evolution of Architecture
Evolve architecture iteratively with DevilDev.
// Evolve architecture iteratively
const evolveArchitecture = async (architectureId, changes) => {
// Initialize DevilDev client
const devilDev = new DevilDevClient();
// Evolve the architecture
const updatedArchitecture = await devilDev.evolve(architectureId, changes);
// Output the updated architecture
console.log(updatedArchitecture);
};
// Example architecture ID and changes
const architectureId = 'example-architecture-id';
const changes = {
components: [
{
name: 'Payment Service',
description: 'Service to handle payments',
responsibilities: ['Payment processing', 'Payment verification'],
},
],
};
// Call the function
evolveArchitecture(architectureId, changes);
Advanced Usage & Best Practices
- Keep Specifications Updated: Regularly update your specifications to reflect any changes in your system.
- Review Each Phase: Ensure each phase of your architecture evolution is thoroughly reviewed and validated.
- Use Version Control: Keep track of your specifications and architecture changes using version control systems like Git.
- Collaborate: Share your specifications and architecture with your team to facilitate collaboration and maintain a shared mental model.
Comparison with Alternatives
| Feature | DevilDev | Alternative 1 | Alternative 2 |
|---|---|---|---|
| Spec-Driven Generation | Yes | No | Partial |
| Reverse Engineering | Yes | No | No |
| Iterative Evolution | Yes | No | No |
| Shared Mental Model | Yes | No | No |
| Open Source | Yes | No | Yes |
FAQ
-
What is spec-driven development? Spec-driven development is a methodology where software architecture is derived from explicit specifications. This approach ensures clarity and maintainability.
-
How is DevilDev different from other AI coding tools? DevilDev focuses on generating architecture from specifications rather than jumping straight to code. This ensures a clear understanding of the system before implementation.
-
Can DevilDev work with existing codebases? Yes, DevilDev can reverse-engineer existing repositories to understand their architecture.
-
Is DevilDev open source? Yes, DevilDev is open source and licensed under Apache 2.0.
-
What kind of software can DevilDev support? DevilDev is designed to support all kinds of software, including backend services, distributed systems, developer tools, internal platforms, libraries, and infrastructure.
Conclusion
DevilDev is a revolutionary spec-driven tool that transforms software development by making architecture explicit and reviewable. By focusing on clear specifications and iterative evolution, DevilDev ensures that your software is maintainable, scalable, and reliable. If you're ready to take your development to the next level, check out DevilDev on GitHub and start building your next project with confidence.