Skills for pi coding agent enable automation of code generation, debugging, and refactoring tasks. Compatible with Claude Code and Codex CLI, it benefits developers and operations teams by streamlining workflows and integrating with existing tools.
git clone https://github.com/badlogic/pi-skills.gitSkills for pi coding agent enable automation of code generation, debugging, and refactoring tasks. Compatible with Claude Code and Codex CLI, it benefits developers and operations teams by streamlining workflows and integrating with existing tools.
["Identify the task: Define the specific coding task you need automated (e.g., 'Create a CRUD API for a task manager').","Set constraints: Specify programming language, frameworks, and any business rules (e.g., 'Use Flask, SQLAlchemy, and enforce role-based access control').","Run the agent: Paste the prompt into Claude Code or Codex CLI with your [PLACEHOLDERS] filled in.","Review and refine: Check the generated code for edge cases, then iterate by adding more constraints or debugging errors.","Integrate: Deploy the code to your environment and test with real data. Use the agent again for refactoring or debugging if issues arise."]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/badlogic/pi-skillsCopy 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.
Act as a pi coding agent to automate the following task: [TASK_DESCRIPTION]. Use [PROGRAMMING_LANGUAGE] and follow these constraints: [CONSTRAINTS]. Generate the code with clear comments and error handling. If debugging is needed, analyze the error message: [ERROR_MESSAGE] and suggest fixes. For refactoring, optimize the code for [OPTIMIZATION_GOAL]. Return the final output in a code block.
```python
# Automated code generation for a REST API endpoint to fetch user data
# Constraints: Must use FastAPI, include rate limiting, and validate JWT tokens
from fastapi import FastAPI, Depends, HTTPException, Request
from fastapi.security import OAuth2PasswordBearer
from fastapi.middleware.cors import CORSMiddleware
from slowapi import Limiter
from slowapi.util import get_remote_address
from slowapi.errors import RateLimitExceeded
import jwt
from datetime import datetime, timedelta
app = FastAPI()
limiter = Limiter(key_func=get_remote_address)
app.state.limiter = limiter
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
SECRET_KEY = "your-secret-key-here"
ALGORITHM = "HS256"
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
# Mock database
users_db = {
"user1": {"username": "admin", "password": "hashedpassword", "role": "admin"},
"user2": {"username": "editor", "password": "hashedpassword", "role": "editor"}
}
@app.get("/users/{user_id}")
@limiter.limit("10/minute")
async def get_user(user_id: int, request: Request, token: str = Depends(oauth2_scheme)):
try:
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
username: str = payload.get("sub")
if username is None:
raise HTTPException(status_code=401, detail="Invalid authentication credentials")
user = users_db.get(f"user{user_id}")
if not user:
raise HTTPException(status_code=404, detail="User not found")
return {"user_id": user_id, "username": user["username"], "role": user["role"]}
except jwt.ExpiredSignatureError:
raise HTTPException(status_code=401, detail="Token has expired")
except jwt.InvalidTokenError:
raise HTTPException(status_code=401, detail="Invalid token")
except RateLimitExceeded:
raise HTTPException(status_code=429, detail="Too many requests")
# Error handling for invalid routes
@app.exception_handler(HTTPException)
async def http_exception_handler(request, exc):
return JSONResponse(
status_code=exc.status_code,
content={"message": exc.detail},
)
```
This code generates a secure FastAPI endpoint with JWT authentication, rate limiting, and proper error handling. The agent automatically includes best practices like CORS middleware, dependency injection for authentication, and structured error responses. The mock database simulates user data retrieval while the actual implementation would integrate with a real database like PostgreSQL.AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
ITIL-aligned IT service management platform
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