create-service
Skill337 starsChanged 5 months agoMITView on GitHub
Scaffold a new microservice that follows the project's server/handlers/adapters architecture. Use when asked to create, scaffold, or add a new service or package. Writes files and may create a git branch, so it runs only when invoked explicitly.
- Reads credentials
5 other projects use a version of this.
Adopted by
Most recently taken up by
- harness/harness-skillstheir own version, first seen Nov 1, 2026
- buildpad-ai/skillstheir own version, first seen Oct 16, 2026
- cachix/devenvtheir own version, first seen Oct 8, 2026
- amariwan/FastApi-templatetheir own version, first seen May 10, 2026
- euronone/Claude-Code-Templatetheir own version, first seen Mar 10, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- cachix/devenv★ 7.8ksame name
- harness/harness-skills★ 127same name
- buildpad-ai/skills★ 1same name
- amariwan/FastApi-template★ 0same name
- euronone/Claude-Code-Template★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository26 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- global-claude-md/CLAUDE.mdCLAUDE.md
- accessibilitySkill
- api-conventionsSkill
- code-reviewSkill
- css-structureSkill
- debuggerSkill
- dependency-vettingSkill
- design-reviewSkill
- dev-pitfallsSkill
- dockerSkill
- docker-swarmSkill
- mcp-builderSkill
- mdd-workflowSkill
- mongodb-backupsSkill
- mongodb-replica-setsSkill
- mongodb-rulesSkill
- nginxSkill
- nodejsSkill
- responsive-cssSkill
- schema-source-of-truthSkill
- test-writerSkill
- tui-builderSkill
- wafSkill
- web-architectureSkill
- web-performanceSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 53
Do not hardcode dependency versions: Before writing package.json, resolve the current stable version of each dependency (npm view <pkg> …
- Distinctive: line 182
Before scaffolding, check the branch:
- Very specific: line 188
Default (auto_branch = true in claude-mastery-project.conf):
- Distinctive: line 196
Not a git repo: skip.
- Very specific: line 197
If
claude-mastery-project.confis missing: treat auto_branch as unset and ask before creating a branch on main, rather than assuming. - Distinctive: line 219
After scaffolding, check RuleCatch:
- Distinctive: line 221
If the RuleCatch MCP server is available, query it for violations in the new service files and report them.
- Distinctive: line 222
If not connected, suggest checking the RuleCatch dashboard.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Service
Scaffold a new service that follows the project architecture. This writes files and may create a branch, so it only runs when you type /create-service.
Architecture
Three layers, one direction. server.ts is thin, handlers/ hold logic, adapters/ wrap everything external.
server.ts routes only, NEVER business logic
│
▼
handlers/ business logic, one file per domain
│
▼
adapters/ external wrappers (database via StrictDB or native driver, APIs, queues)This matches the api-conventions skill. Keep them in sync: if the layering changes, change both.
Directory structure
packages/{name}/
├── src/
│ ├── server.ts # entry point — routes only
│ ├── handlers/ # business logic
│ │ └── index.ts
│ ├── adapters/ # external wrappers
│ │ ├── index.ts
│ │ └── db.ts # data adapter — StrictDB or native driver, the only place the driver lives
│ └── types.ts # TypeScript types
├── tests/
│ └── handlers.test.ts
├── package.json
├── tsconfig.json
└── CLAUDE.md # service-specific instructionspackage.json — resolve versions at scaffold time
Do not hardcode dependency versions. Before writing package.json, resolve the current stable version of each dependency (npm view <pkg> version, or context7) and pin those. Hardcoded versions rot the day they ship, and a stale pin is how you get an Express 4 runtime against Express 5 types.
Dependencies to resolve and include:
- runtime:
express(current major is 5) - dev:
tsx,typescript,vitest,@types/express
Make the @types/express major match the express major. Verify, don't assume.
{
"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": "<resolved>"
},
"devDependencies": {
"tsx": "<resolved>",
"typescript": "<resolved>",
"vitest": "<resolved>",
"@types/express": "<resolved, major matching express>"
}
}Template: src/server.ts
import express from 'express';
import { handlers } from './handlers/index.js';
const app = express();
const PORT = process.env.PORT || 3000;
app.use(express.json());
app.get('/health', (_req, res) => {
res.json({ status: 'ok', service: '{name}' });
});
// Routes delegate to handlers. NEVER put logic here.
// Replace this catch-all with real REST routes per domain.
app.post('/api/v1/:action', handlers.handleAction);
process.on('unhandledRejection', (reason) => {
console.error('Unhandled Rejection:', reason);
process.exit(1);
});
process.on('uncaughtException', (error) => {
console.error('Uncaught Exception:', error);
process.exit(1);
});
app.listen(PORT, () => {
console.log(`{name} running on port ${PORT}`);
});Template: src/adapters/db.ts
The data adapter is the only place the driver is touched. Use StrictDB if it's installed, otherwise the native MongoDB driver. Never Mongoose. Handlers import this, never the driver.
// Wire to StrictDB if installed, otherwise the native MongoDB driver. The data boundary for the service.
// Rules enforced here (see the mongodb-rules skill):
// - StrictDB if installed, else the native driver; never Mongoose
// - reads are aggregation pipelines, not find()
// - multi-document writes use bulkWrite
// - never put _id in a write body; rehydrate types before upserts
import { StrictDB } from 'strictdb'; // if StrictDB isn't installed, import { MongoClient } from 'mongodb' and use that instead
const db = new StrictDB({ uri: process.env.MONGODB_URI! });
export const dbAdapter = {
// Example read — express as an aggregation pipeline in real methods.
async getById(collection: string, id: unknown) {
// ensure `id` is an ObjectId, not a string, before querying
return db.collection(collection).aggregate([{ $match: { _id: id } }]).next();
},
// Example write — use bulkWrite for multi-document operations.
async upsertMany(collection: string, ops: unknown[]) {
return db.collection(collection).bulkWrite(ops);
},
};Template: src/types.ts
export interface ServiceConfig {
port: number;
name: string;
environment: 'development' | 'staging' | 'production';
}
// Add your domain types here.Template: tsconfig.json
{
"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"]
}Auto-branch (if on main)
Before scaffolding, check the branch:
git branch --show-currentDefault (auto_branch = true in claude-mastery-project.conf):
- On
main/master: create and switch to a feature branch, then report it.
"Created branchgit checkout -b feat/<service-name>feat/<service-name>, main stays untouched." - On a feature branch already: proceed.
- Not a git repo: skip.
- If
claude-mastery-project.confis missing: treatauto_branchas unset and ask before creating a branch on main, rather than assuming.
To disable: set auto_branch = false. When disabled, warn and ask before proceeding on main.
After creating — checklist
- Directory matches the template, including
adapters/db.ts package.jsonversions were resolved at scaffold time, not copied@types/expressmajor matchesexpressmajor- TypeScript strict mode on
- Entry point has both
unhandledRejectionanduncaughtExceptionhandlers - All routes under
/api/v1/ - Business logic in
handlers/, notserver.ts - Database access through the adapter in
adapters/(StrictDB if installed, else native driver), no Mongoose, no raw driver in handlers - No file exceeds 300 lines
- Port assigned in the root CLAUDE.md port table
- Service added to
project-docs/ARCHITECTURE.md - Basic test file created
.dockerignorecreated (if using Docker)
RuleCatch
After scaffolding, check RuleCatch:
- If the RuleCatch MCP server is available, query it for violations in the new service files and report them.
- If not connected, suggest checking the RuleCatch dashboard.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

