{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "bug-reports",
  "type": "registry:block",
  "title": "Bug Reports",
  "description": "Bug report intake, severity, reproduction steps, and triage workflow.",
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://stackfoundry.dev/r/support-console.json"
  ],
  "files": [
    {
      "path": "packages/db/src/schema/bug-reports.ts",
      "type": "registry:file",
      "target": "packages/db/src/schema/bug-reports.ts",
      "content": "import { index, jsonb, pgTable, text, timestamp, uuid } from \"drizzle-orm/pg-core\";\n\nexport const bugReports = pgTable(\n  \"bug_reports\",\n  {\n    id: uuid(\"id\").primaryKey().defaultRandom(),\n    organizationId: text(\"organization_id\"),\n    ownerId: text(\"owner_id\"),\n    key: text(\"key\").notNull(),\n    status: text(\"status\").notNull().default(\"active\"),\n    metadata: jsonb(\"metadata\").$type<Record<string, unknown>>().notNull().default({}),\n    createdAt: timestamp(\"created_at\", { withTimezone: true }).defaultNow().notNull(),\n    updatedAt: timestamp(\"updated_at\", { withTimezone: true }).defaultNow().notNull(),\n  },\n  (item) => [\n    index(\"bug_reports_organization_idx\").on(item.organizationId),\n    index(\"bug_reports_owner_idx\").on(item.ownerId),\n  ]\n);\n"
    },
    {
      "path": "apps/web/src/lib/stackfoundry/bug-reports.ts",
      "type": "registry:file",
      "target": "apps/web/src/lib/stackfoundry/bug-reports.ts",
      "content": "export type BugReportsConfig = {\n  key: string;\n  enabled?: boolean;\n  metadata?: Record<string, unknown>;\n};\n\nexport function createBugReportsConfig(config: BugReportsConfig) {\n  return {\n    key: config.key,\n    enabled: config.enabled ?? true,\n    metadata: config.metadata ?? {},\n  };\n}\n\nexport const bugReportsChecks = [\n  \"Validate tenant and permission boundaries\",\n  \"Record audit events for sensitive changes\",\n  \"Document deployment and rollback behavior\",\n] as const;\n"
    },
    {
      "path": "apps/web/src/app/(console)/admin/support/bug-reports/page.tsx",
      "type": "registry:page",
      "target": "apps/web/src/app/(console)/admin/support/bug-reports/page.tsx",
      "content": "const checklist = [\n  \"Confirm ownership boundaries\",\n  \"Wire persistence and authorization\",\n  \"Run smoke checks before production\",\n];\n\nexport default function BugReportsPage() {\n  return (\n    <main className=\"flex flex-col gap-6 p-6\">\n      <div>\n        <h1 className=\"text-2xl font-semibold\">Bug Reports</h1>\n        <p className=\"text-muted-foreground\">Bug report intake, severity, reproduction steps, and triage workflow.</p>\n      </div>\n      <div className=\"grid gap-3\">\n        {checklist.map((item) => (\n          <div key={item} className=\"rounded-lg border p-4 text-sm\">{item}</div>\n        ))}\n      </div>\n    </main>\n  );\n}\n"
    }
  ],
  "maintenanceSkills": [
    {
      "name": "bug-reports",
      "target": ".stackfoundry/skills/bug-reports/SKILL.md",
      "content": "---\nname: bug-reports\ndescription: Maintain the Bug Reports module installed by StackFoundry.\n---\n\n# Bug Reports Skill\n\n## Boundary\n\nThis module owns the Bug Reports source block and its safety checklist. Keep business-specific behavior outside the reusable block until an app adopts it.\n\n## Shared Skills\n\nWhen provider, framework, or database behavior changes, load the installed shared skill before editing implementation details:\n\n- `.stackfoundry/skills/nextjs/SKILL.md` (source: `registry/skills/nextjs/SKILL.md`)\n- `.stackfoundry/skills/drizzle/SKILL.md` (source: `registry/skills/drizzle/SKILL.md`)\n\nKeep this module skill focused on ownership, installed files, env vars, deployment checks, and module-specific invariants.\n\n## Source Files\n\n- `packages/db/src/schema/bug-reports.ts`\n- `apps/web/src/lib/stackfoundry/bug-reports.ts`\n- `apps/web/src/app/(console)/admin/support/bug-reports/page.tsx`\n\n## Dependencies\n\n- Depends on `support-console`\n\n## Maintenance Rules\n\n- Preserve tenant, permission, and data-safety boundaries.\n- Keep examples small, typed, and replaceable.\n- Update docs and checklist with behavior changes.\n- Do not add secrets, credentials, or generated machine metadata.\n"
    },
    {
      "name": "nextjs",
      "target": ".stackfoundry/skills/nextjs/SKILL.md",
      "content": "---\nname: nextjs\ndescription: Maintain Next.js App Router code installed by StackFoundry modules.\n---\n\n# Next.js Operating Instructions\n\n## Installed Location\n\n- Installed target: `.stackfoundry/skills/nextjs/SKILL.md`\n- Registry source: `registry/skills/nextjs/SKILL.md`\n\nAgents maintaining an installed module should load this shared skill from the installed target when provider, framework, database, SDK, or platform behavior is involved. Keep provider-specific API details here instead of duplicating them inside module maintenance skills.\n\n- Keep server-only data access out of Client Components.\n- Put route handlers under `app/api` and UI routes under the relevant App Router segment.\n- Prefer Server Components for data loading and add `\"use client\"` only for interactivity.\n- Keep public environment variables prefixed with `NEXT_PUBLIC_`; keep secrets server-only.\n- Re-run typecheck and build after changing route handlers, layouts, or shared app configuration.\n"
    },
    {
      "name": "drizzle",
      "target": ".stackfoundry/skills/drizzle/SKILL.md",
      "content": "---\nname: drizzle\ndescription: Maintain Drizzle ORM and Postgres code installed by StackFoundry modules.\n---\n\n# Drizzle Operating Instructions\n\n## Installed Location\n\n- Installed target: `.stackfoundry/skills/drizzle/SKILL.md`\n- Registry source: `registry/skills/drizzle/SKILL.md`\n\nAgents maintaining an installed module should load this shared skill from the installed target when provider, framework, database, SDK, or platform behavior is involved. Keep provider-specific API details here instead of duplicating them inside module maintenance skills.\n\n- Keep database access in server-only code.\n- Add schema changes under `packages/db/src/schema` and export shared tables from the schema barrel.\n- Generate and commit migrations when schema changes are intended.\n- Use typed query helpers instead of raw SQL unless the query needs a documented escape hatch.\n- Include tenant, organization, or user scope in queries and cache tags whenever data is not global.\n"
    }
  ],
  "envVars": {},
  "docs": "# Bug Reports Module\n\nBug report intake, severity, reproduction steps, and triage workflow.\n\n## Owns\n\n- `packages/db/src/schema/bug-reports.ts`\n- `apps/web/src/lib/stackfoundry/bug-reports.ts`\n- `apps/web/src/app/(console)/admin/support/bug-reports/page.tsx`\n\n## Safety Notes\n\n- Keep tenant, permission, and billing boundaries explicit.\n- Validate all server inputs before side effects.\n- Record audit events for sensitive state changes.\n- Do not commit secrets, credentials, local caches, or provider tokens.\n\n## Maintenance\n\n- Update `module.json`, `docs.md`, `skill/SKILL.md`, and `tests/checklist.md` together.\n- Verify install output with `pnpm stackfoundry add bug-reports --target /tmp/app --dry-run`.\n",
  "meta": {
    "category": "support",
    "env": [],
    "status": "ready",
    "maturity": "ready",
    "drizzle": {
      "schemaExports": [
        "bugReports"
      ],
      "migrationRecommended": true
    },
    "recommendedFor": []
  }
}
