Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/PaulJPhilp/EffectPatternsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/pauljphilp/effectpatterns/generate-openapi-documentation)<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/generate-openapi-documentation"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/generate-openapi-documentation/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/generate-openapi-documentation"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/generate-openapi-documentation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01218 | $0.01218 |
| Opus 5.5 | $0.00487 | $0.00487 |
| Sonnet 5.5 | $0.00244 | $0.00244 |
| Haiku 4.5 | $0.00122 | $0.00122 |
Grade A, and why
generate-openapi-documentation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Use Schema definitions to automatically generate OpenAPI documentation for your API. globs: "**/*.ts" alwaysApply: true
Generate OpenAPI Documentation
Rule: Use Schema definitions to automatically generate OpenAPI documentation for your API.
Example
import { Effect, Schema } from "effect"
import {
HttpApi,
HttpApiBuilder,
HttpApiEndpoint,
HttpApiGroup,
HttpApiSwagger,
OpenApi,
} from "@effect/platform"
// ============================================
// 1. Define schemas for request/response
// ============================================
const UserSchema = Schema.Struct({
id: Schema.String,
email: Schema.String.pipe(Schema.pattern(/@/)),
name: Schema.String,
createdAt: Schema.DateFromString,
})
const CreateUserSchema = Schema.Struct({
email: Schema.String.pipe(Schema.pattern(/@/)),
name: Schema.String,
})
const UserListSchema = Schema.Array(UserSchema)
const ErrorSchema = Schema.Struct({
error: Schema.String,
code: Schema.String,
})
// ============================================
// 2. Define API endpoints with schemas
// ============================================
const usersApi = HttpApiGroup.make("users")
.pipe(
HttpApiGroup.add(
HttpApiEndpoint.get("getUsers", "/users")
.pipe(
HttpApiEndpoint.setSuccess(UserListSchema),
HttpApiEndpoint.addError(ErrorSchema, { status: 500 })
)
),
HttpApiGroup.add(
HttpApiEndpoint.get("getUser", "/users/:id")
.pipe(
HttpApiEndpoint.setPath(Schema.Struct({
id: Schema.String,
})),
HttpApiEndpoint.setSuccess(UserSchema),
HttpApiEndpoint.addError(ErrorSchema, { status: 404 }),
HttpApiEndpoint.addError(ErrorSchema, { status: 500 })
)
),
HttpApiGroup.add(
HttpApiEndpoint.post("createUser", "/users")
.pipe(
HttpApiEndpoint.setPayload(CreateUserSchema),
HttpApiEndpoint.setSuccess(UserSchema, { status: 201 }),
HttpApiEndpoint.addError(ErrorSchema, { status: 400 }),
HttpApiEndpoint.addError(ErrorSchema, { status: 500 })
)
),
HttpApiGroup.add(
HttpApiEndpoint.del("deleteUser", "/users/:id")
.pipe(
HttpApiEndpoint.setPath(Schema.Struct({
id: Schema.String,
})),
HttpApiEndpoint.setSuccess(Schema.Void, { status: 204 }),
HttpApiEndpoint.addError(ErrorSchema, { status: 404 }),
HttpApiEndpoint.addError(ErrorSchema, { status: 500 })
)
)
)
// ============================================
// 3. Create the API definition
// ============================================
const api = HttpApi.make("My API")
.pipe(
HttpApi.addGroup(usersApi),
OpenApi.annotate({
title: "My Effect API",
version: "1.0.0",
description: "A sample API built with Effect",
})
)
// ============================================
// 4. Implement the handlers
// ============================================
const usersHandlers = HttpApiBuilder.group(api, "users", (handlers) =>
handlers
.pipe(
HttpApiBuilder.handle("getUsers", () =>
Effect.succeed([
{
id: "1",
email: "[email protected]",
name: "Alice",
createdAt: new Date(),
},
])
),
HttpApiBuilder.handle("getUser", ({ path }) =>
Effect.gen(function* () {
if (path.id === "not-found") {
return yield* Effect.fail({ error: "User not found", code: "NOT_FOUND" })
}
return {
id: path.id,
email: "[email protected]",
name: "User",
createdAt: new Date(),
}
})
),
HttpApiBuilder.handle("createUser", ({ payload }) =>
Effect.succeed({
id: crypto.randomUUID(),
email: payload.email,
name: payload.name,
createdAt: new Date(),
})
),
HttpApiBuilder.handle("deleteUser", ({ path }) =>
Effect.gen(function* () {
if (path.id === "not-found") {
return yield* Effect.fail({ error: "User not found", code: "NOT_FOUND" })
}
yield* Effect.log(`Deleted user ${path.id}`)
})
)
)
)
// ============================================
// 5. Build the server with Swagger UI
// ============================================
const MyApiLive = HttpApiBuilder.api(api).pipe(
Layer.provide(usersHandlers)
)
const ServerLive = HttpApiBuilder.serve().pipe(
// Add Swagger UI at /docs
Layer.provide(HttpApiSwagger.layer({ path: "/docs" })),
Layer.provide(MyApiLive),
Layer.provide(NodeHttpServer.layer({ port: 3000 }))
)
// ============================================
// 6. Export OpenAPI spec as JSON
// ============================================
const openApiSpec = OpenApi.fromApi(api)
// Save to file for external tools
import { NodeFileSystem } from "@effect/platform-node"
const saveSpec = Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem
yield* fs.writeFileString(
"openapi.json",
JSON.stringify(openApiSpec, null, 2)
)
yield* Effect.log("OpenAPI spec saved to openapi.json")
})
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 196 lines · 1,218 tokens per session scan A 2cd6ea81cb49
generate-openapi-documentation is a cursor rule published in the GitHub repository PaulJPhilp/EffectPatterns (807 stars, last pushed 5mo ago), licensed MIT. It adds 1,218 tokens to every session, about $0.0049 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
generate-openapi-documentation compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| generate-openapi-documentationPaulJPhilp/EffectPatterns | Cursor rule | 807 | 5mo ago | MIT | A | 1,218 | Cursor |
| workflowWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| activitiesWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| go-api-development-general-rulesWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| backend-general-expertWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 349 | Cursor |
| service-class-conventionsWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 172 | Cursor |
| repository-class-conventionsWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 149 | Cursor |