Complete example showing how to use Skill Seekers to generate Windsurf rules for FastAPI development.
- ✅ Generates FastAPI documentation skill
- ✅ Creates modular .windsurfrules for Windsurf IDE
- ✅ Shows Cascade AI-powered FastAPI code generation
- ✅ Handles character limits with split rules
# Install Skill Seekers
pip install skill-seekers
# Generate FastAPI documentation skill
skill-seekers scrape --config configs/fastapi.json
# Package for Windsurf with split rules (respects 6K char limit)
skill-seekers package output/fastapi --target markdown --split-rules# Create rules directory
mkdir -p my-fastapi-project/.windsurf/rules
# Copy all rule files
cp -r output/fastapi-markdown/rules/* my-fastapi-project/.windsurf/rules/
# Or use the automation script
python generate_windsurfrules.py --project my-fastapi-project# Open project in Windsurf
windsurf my-fastapi-project/
# Start Cascade (Cmd+L or Ctrl+L)
# Try these prompts:
# - "Create a FastAPI endpoint with async database queries"
# - "Add Pydantic models with validation for user registration"
# - "Implement JWT authentication with dependencies"Prompt: "Create a FastAPI user endpoint with database"
Cascade Output:
from fastapi import FastAPI
app = FastAPI()
@app.get("/users")
def get_users():
# Generic sync code
users = db.query(User).all()
return users❌ Uses sync code (not async) ❌ No dependency injection ❌ Returns ORM instances (not Pydantic)
Prompt: "Create a FastAPI user endpoint with database"
Cascade Output:
from fastapi import APIRouter, Depends
from sqlalchemy.ext.asyncio import AsyncSession
from app.database import get_db
from app.schemas import UserResponse
router = APIRouter(prefix="/api/v1")
@router.get("/users", response_model=list[UserResponse])
async def get_users(
skip: int = 0,
limit: int = 100,
db: AsyncSession = Depends(get_db)
):
"""Get all users with pagination."""
result = await db.execute(
select(User).offset(skip).limit(limit)
)
users = result.scalars().all()
return [UserResponse.model_validate(user) for user in users]✅ Async/await pattern ✅ Dependency injection ✅ Pydantic response models ✅ Proper pagination ✅ OpenAPI documentation
generate_windsurfrules.py- Automation script for generating rulesrequirements.txt- Python dependenciesexample-project/- Minimal FastAPI project structureapp/main.py- FastAPI applicationapp/models.py- SQLAlchemy modelsapp/schemas.py- Pydantic schemasapp/database.py- Database connection
After running the script, you'll have:
my-fastapi-project/.windsurf/rules/
├── fastapi-core.md (5,200 chars, Always On)
├── fastapi-database.md (5,800 chars, Always On)
├── fastapi-authentication.md (4,900 chars, Model Decision)
├── fastapi-testing.md (4,100 chars, Manual)
└── fastapi-best-practices.md (3,500 chars, Always On)
| File | Activation | When Used |
|---|---|---|
fastapi-core.md |
Always On | Every request - core patterns |
fastapi-database.md |
Always On | Database-related code |
fastapi-authentication.md |
Model Decision | When Cascade detects auth needs |
fastapi-testing.md |
Manual | Only when @mentioned for testing |
fastapi-best-practices.md |
Always On | Code quality, error handling |
Create project-conventions.md:
---
name: "Project Conventions"
activation: "always-on"
priority: "highest"
---
# Project-Specific Patterns
## Database Sessions
ALWAYS use this pattern:
\```python
async with get_session() as db:
result = await db.execute(query)
\```
## API Versioning
All endpoints MUST use `/api/v1` prefix:
\```python
router = APIRouter(prefix="/api/v1")
\```# Generate smaller rule files (5K chars each)
skill-seekers package output/fastapi --target markdown --split-rules --max-chars 5000
# Generate larger rule files (5.5K chars each)
skill-seekers package output/fastapi --target markdown --split-rules --max-chars 5500Solution 1: Verify directory structure
# Must be exactly:
my-project/.windsurf/rules/*.md
# Check:
ls -la my-project/.windsurf/rules/Solution 2: Reload Windsurf
Cmd+Shift+P → "Reload Window"
Solution: Re-generate with smaller max-chars
skill-seekers package output/fastapi --target markdown --split-rules --max-chars 4500Solution: Check activation mode in frontmatter
---
activation: "always-on" # Not "model-decision"
priority: "high"
---# Install Skill Seekers MCP server
pip install skill-seekers[mcp]
# Configure in Windsurf's mcp_config.json
{
"mcpServers": {
"skill-seekers": {
"command": "python",
"args": ["-m", "skill_seekers.mcp.server_fastmcp", "--transport", "stdio"]
}
}
}Now Cascade can query documentation dynamically via MCP tools.
# Generate backend rules (FastAPI)
skill-seekers package output/fastapi --target markdown --split-rules
# Generate frontend rules (React)
skill-seekers package output/react --target markdown --split-rules
# Organize rules:
.windsurf/rules/
├── backend/
│ ├── fastapi-core.md
│ └── fastapi-database.md
└── frontend/
├── react-hooks.md
└── react-components.md- Cursor Example - Similar IDE, different format
- Cline Example - VS Code extension with MCP
- Continue.dev Example - IDE-agnostic
- LangChain RAG Example - Build RAG systems
- Customize rules for your project patterns
- Add team-specific conventions
- Integrate with MCP for live documentation
- Build RAG pipeline with
--target langchain - Share your rules at Windsurf Rules Directory
- Skill Seekers Issues: GitHub
- Windsurf Docs: docs.windsurf.com
- Integration Guide: WINDSURF.md