Exposes curated rule templates and built-in governance methods (communication, membership, decision-making, conflict management, and core values) through public, machine-readable HTTP APIs. External clients and integrations can discover the full catalog without importing messages/en/create/customRule/*.json or duplicating slug→copy maps.
Builds on existing facet ranking (GET /api/templates?facet.*, GET /api/create-flow/methods scores). The in-app wizard can keep using useMessages(); these routes are the stable contract for out-of-app consumers (English v1).
Changes
GET /api/templates/[slug] — single seeded template plus { section, slug } composition from templateMethodsFromBody; 404 when unknown; Cache-Control: public, max-age=3600
GET /api/create-flow/methods (extended) — full deck with label, description, sections for method sections; core values via section=coreValues (alias values); 1-based ids ("1", "2", …); optional matches when facet.* is present; full deck returned (ranking preserved, zero-score methods stay in list)
lib/server/governanceCatalog.ts — assembles DTOs from messages JSON (server-only)
getRuleTemplateBySlug in lib/server/ruleTemplates.ts
CATALOG_SECTION_IDS in lib/create/customRuleFacets.ts; catalogSectionIdSchema in methodFacetsSchemas.ts
fetchTemplateDetailBySlug / updated fetchTemplateBySlug in lib/create/fetchTemplates.ts (detail endpoint instead of full-list scan)
Tests:governanceCatalog.test.ts, templatesBySlugRoute.test.ts, extended createFlowMethodsRoute.test.ts and methodFacets.test.ts
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Overview
Exposes curated rule templates and built-in governance methods (communication, membership, decision-making, conflict management, and core values) through public, machine-readable HTTP APIs. External clients and integrations can discover the full catalog without importing
messages/en/create/customRule/*.jsonor duplicating slug→copy maps.Builds on existing facet ranking (
GET /api/templates?facet.*,GET /api/create-flow/methodsscores). The in-app wizard can keep usinguseMessages(); these routes are the stable contract for out-of-app consumers (English v1).Changes
GET /api/templates/[slug]— single seeded template plus{ section, slug }composition fromtemplateMethodsFromBody; 404 when unknown;Cache-Control: public, max-age=3600GET /api/create-flow/methods(extended) — full deck withlabel,description,sectionsfor method sections; core values viasection=coreValues(aliasvalues); 1-based ids ("1","2", …); optionalmatcheswhenfacet.*is present; full deck returned (ranking preserved, zero-score methods stay in list)lib/server/governanceCatalog.ts— assembles DTOs from messages JSON (server-only)getRuleTemplateBySluginlib/server/ruleTemplates.tsCATALOG_SECTION_IDSinlib/create/customRuleFacets.ts;catalogSectionIdSchemainmethodFacetsSchemas.tsfetchTemplateDetailBySlug/ updatedfetchTemplateBySluginlib/create/fetchTemplates.ts(detail endpoint instead of full-list scan)governanceCatalog.test.ts,templatesBySlugRoute.test.ts, extendedcreateFlowMethodsRoute.test.tsandmethodFacets.test.tsCONTRIBUTING.mdAPI table,template-recommendation-matrix.md§9 (de-ticketed),backend-linear-tickets.mdTicket 22 / CR-115 entryScreenshots
N/A — API and documentation only.
How to Test
docker compose up -d postgres,.envwithDATABASE_URL,npx prisma migrate dev,npx prisma db seed,npm run devnpx next build