.claude/skills/create-service/SKILL.md
Scaffold a new microservice that follows project architecture patterns
npx skillsauth add thedecipherist/claude-code-mastery-project-starter-kit Create ServiceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a new service that follows our architecture patterns.
┌─────────────────────────────────────────────────────────────┐
│ YOUR SERVICE │
├─────────────────────────────────────────────────────────────┤
│ ┌───────────────────────────────────────────────────────┐ │
│ │ SERVER (server.ts) │ │
│ │ - Express/Fastify entry point │ │
│ │ - Defines routes │ │
│ │ - NEVER contains business logic │ │
│ └───────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ HANDLERS (handlers/) │ │
│ │ - Business logic lives here │ │
│ │ - One file per domain │ │
│ └───────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ ADAPTERS (adapters/) │ │
│ │ - External service wrappers │ │
│ │ - Database, APIs, etc. │ │
│ └───────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
packages/{name}/
├── src/
│ ├── server.ts # Entry point — routes only
│ ├── handlers/ # Business logic
│ │ └── index.ts
│ ├── adapters/ # External service wrappers
│ │ └── index.ts
│ └── types.ts # TypeScript types
├── tests/
│ └── handlers.test.ts
├── package.json
├── tsconfig.json
└── CLAUDE.md # Service-specific instructions
{
"name": "@project/{name}",
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsx watch src/server.ts",
"start": "node dist/server.js",
"test": "vitest run"
},
"dependencies": {
"express": "^4.21.0"
},
"devDependencies": {
"tsx": "^4.0.0",
"typescript": "^5.7.0",
"vitest": "^3.0.0",
"@types/express": "^5.0.0"
}
}
import express from 'express';
import { handlers } from './handlers/index.js';
const app = express();
const PORT = process.env.PORT || 3000;
app.use(express.json());
// Health check
app.get('/health', (_req, res) => {
res.json({ status: 'ok', service: '{name}' });
});
// Routes — delegate to handlers (NEVER put logic here)
app.post('/api/v1/:action', handlers.handleAction);
// Unhandled rejection handler
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled Rejection:', reason);
process.exit(1);
});
// Uncaught exception handler
process.on('uncaughtException', (error) => {
console.error('Uncaught Exception:', error);
process.exit(1);
});
app.listen(PORT, () => {
console.log(`{name} running on port ${PORT}`);
});
export interface ServiceConfig {
port: number;
name: string;
environment: 'development' | 'staging' | 'production';
}
// Add your domain types here
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"declaration": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "tests"]
}
Before scaffolding a new service, check the current branch:
git branch --show-current
Default behavior (auto_branch = true in claude-mastery-project.conf):
main or master: automatically create a feature branch and switch to it:
git checkout -b feat/<service-name>
Report: "Created branch feat/<service-name> — main stays untouched."To disable: Set auto_branch = false in claude-mastery-project.conf. When disabled, warn and ask the user before proceeding on main.
After the service is scaffolded, check RuleCatch:
development
Comprehensive code review with security, performance, and best practices focus
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------