MUSUBI automates code generation from specifications. Developers and engineering teams use it to streamline development workflows. It connects to IDEs and version control systems, reducing manual coding tasks and improving accuracy.
git clone https://github.com/nahisaho/MUSUBI.gitMUSUBI is a comprehensive Specification Driven Development (SDD) framework designed for development teams using AI coding agents like Claude Code, GitHub Copilot, Cursor, and Gemini. It automates code generation from detailed specifications using the EARS format with structured requirement patterns, design documents, and implementation tasks. The tool provides end-to-end traceability from requirements through design to code and tests, maintaining 100% requirement-to-implementation mapping. MUSUBI includes quality gates at each development stage, constitutional governance with 9 articles, and support for multiple workflow modes from small bug fixes to large architectural changes. Teams benefit from reduced manual coding, improved accuracy, standardized documentation, and systematic review processes across brownfield and greenfield projects.
["Prepare your specifications in a clear, structured format including inputs, outputs, business logic, and any constraints. MUSUBI works best with detailed technical requirements.","Open your IDE (VS Code, IntelliJ, etc.) and use the MUSUBI extension or CLI tool. Run: `musubi generate --spec auth-service.yaml --language python --output ./src`","Review the generated code in your IDE. MUSUBI includes inline comments marking auto-generated sections. Manually adjust any parts that need refinement based on your project's unique needs.","Run the included unit tests to verify functionality. MUSUBI generates test cases for critical paths. Use `pytest generated_tests.py` or your framework's equivalent.","Commit the generated code to your version control system. MUSUBI integrates with Git to create a pull request with the generated code and tests. Review and merge as needed.","Tip: For complex systems, break specifications into smaller components. MUSUBI handles dependencies between components automatically when you specify the relationships in your requirements."]
Automating code generation from detailed specifications with EARS format requirements
Ensuring traceability and gap detection across requirements, design, and implementation
Implementing quality gates and constitutional compliance checks before code generation
Managing monorepo projects with package dependency tracking and per-package coverage
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/nahisaho/MUSUBICopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Generate production-ready [LANGUAGE] code for [FUNCTIONALITY] based on these specifications: [SPECIFICATIONS]. Include unit tests, error handling, and comments. Follow [STYLE_GUIDE] and ensure compatibility with [FRAMEWORK/LIBRARY]. Optimize for [PERFORMANCE_CRITERIA].
```python
# Generated by MUSUBI - Automated Code Generator
# Specification: User authentication service with JWT tokens
# Language: Python 3.11
# Framework: FastAPI
# Style Guide: PEP 8
# Performance Criteria: <100ms response time for authentication
from fastapi import FastAPI, Depends, HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
from pydantic import BaseModel
from datetime import datetime, timedelta
from jose import JWTError, jwt
from passlib.context import CryptContext
import os
# Configuration
SECRET_KEY = os.getenv("SECRET_KEY", "your-secret-key-here")
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 30
# Password hashing
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
# Models
class Token(BaseModel):
access_token: str
token_type: str
class TokenData(BaseModel):
username: str | None = None
class User(BaseModel):
username: str
email: str | None = None
full_name: str | None = None
disabled: bool | None = None
# Mock database
fake_users_db = {
"johndoe": {
"username": "johndoe",
"full_name": "John Doe",
"email": "johndoe@example.com",
"hashed_password": pwd_context.hash("secret"),
"disabled": False,
}
}
app = FastAPI()
# Utility functions
def verify_password(plain_password: str, hashed_password: str):
return pwd_context.verify(plain_password, hashed_password)
def get_password_hash(password: str):
return pwd_context.hash(password)
def get_user(db, username: str):
if username in db:
user_dict = db[username]
return User(**user_dict)
return None
def authenticate_user(fake_db, username: str, password: str):
user = get_user(fake_db, username)
if not user:
return False
if not verify_password(password, user.hashed_password):
return False
return user
def create_access_token(data: dict, expires_delta: timedelta | None = None):
to_encode = data.copy()
if expires_delta:
expire = datetime.utcnow() + expires_delta
else:
expire = datetime.utcnow() + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
# Authentication endpoints
@app.post("/token", response_model=Token)
async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends()):
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Incorrect username or password",
headers={"WWW-Authenticate": "Bearer"},
)
access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
access_token = create_access_token(
data={"sub": user.username}, expires_delta=access_token_expires
)
return {"access_token": access_token, "token_type": "bearer"}
# User endpoints
@app.get("/users/me/", response_model=User)
async def read_users_me(token: str = Depends(OAuth2PasswordBearer(tokenUrl="token"))):
credentials_exception = HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Could not validate credentials",
headers={"WWW-Authenticate": "Bearer"},
)
try:
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
username: str = payload.get("sub")
if username is None:
raise credentials_exception
token_data = TokenData(username=username)
except JWTError:
raise credentials_exception
user = get_user(fake_users_db, username=token_data.username)
if user is None:
raise credentials_exception
return user
# Unit tests
import pytest
from fastapi.testclient import TestClient
client = TestClient(app)
def test_login_success():
response = client.post(
"/token",
data={"username": "johndoe", "password": "secret"}
)
assert response.status_code == 200
assert "access_token" in response.json()
def test_login_failure():
response = client.post(
"/token",
data={"username": "johndoe", "password": "wrongpassword"}
)
assert response.status_code == 401
def test_get_current_user():
# First get a token
token_response = client.post(
"/token",
data={"username": "johndoe", "password": "secret"}
)
token = token_response.json()["access_token"]
# Then use the token to get user info
response = client.get("/users/me/", headers={"Authorization": f"Bearer {token}"})
assert response.status_code == 200
assert response.json()["username"] == "johndoe"
```Your one-stop shop for church and ministry supplies.
Automate your browser workflows effortlessly
IronCalc is a spreadsheet engine and ecosystem
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan