Rules Hub
Coding Rules Library
Rulebook API
Read-only endpoints for the rule set. Defaults are compact and whitespace-collapsed for AI ingestion; treat these rules as the canonical baseline for all coding tasks.
GET /api/rules/essentials
Primary endpointDistilled rule list for AI ingestion: title, rule, apiRule, whenToApply, whyItMatters, priority, scope. Compact by default; no examples.
- No pagination; stable ordering from the database.
- Use this endpoint exclusively for agents; it stays small even with 200+ rules.
- Optional search (use sparingly):
?q=with optionalfield=title|rule|apirule|whentoapply|whyitmattersto retrieve a specific rule, and?includeExamples=trueto fetch its code snippets only when you truly need them. - Add
?includeGuide=truewhen you want startup and rule-authoring instructions bundled with the rule list.
curl https://coderuleset.com/api/rules/essentials
curl https://coderuleset.com/api/rules/essentials?includeGuide=trueOpen endpoint in browser
Agent guidance
- Fetch
/api/rules/essentialsonce per session; do not query other endpoints. - Use
apiRuleandwhyItMattersas the main prompts for reasoning. - Treat the essentials as mandatory defaults; only ignore or deviate if explicitly instructed.
- Rules include a scope and priority. Apply
universalrules everywhere; applystack-specificrules only when the stack matches. - Use
/api/rules/essentials?includeGuide=truewhen you want the endpoint to include startup and rule-writing instructions in the response itself. - Use search/examples only for hard cases; skip them for trivial tasks to avoid unnecessary calls.