Remove Incidents

Incidents record problems an administrator must resolve. This guide removes the whole system (model, service, admin API, Incident Board and reporters), not only the board. It works in any order with the billing and demo guides: items marked "if ... still exists" apply only then. It follows the shared removal loop.

Entry points

  • Domain and API: src/server/domain/incident/, src/server/api/admin/incidents/. Their specs sit next to them and go with them.
  • Shared types: src/shared/types/domain/Incident.ts, src/shared/types/domain/IncidentListQuery.ts.
  • App: src/app/components/domain/incident/, src/app/pages/admin/incidents/, src/app/composables/actions/use-incident-actions.ts, src/app/store/incident.ts. Specs and stories sit next to the app files and go with them.
  • Prisma: prisma/schema/incident.prisma (model Incident, enum IncidentSeverity).
  • Docs and knowledge: content/docs/02.core-concepts/10.incidents.md, .agents/knowledge/adr/0006-incident-rule.md.
  • The i18n namespaces IncidentContext, IncidentDetails, IncidentSeverity, IncidentTable, common.Incidents and pages.admin.incidents.*.

Not found by the compiler

  • Sidebar: in src/app/layouts/app.vue, remove the "Incidents" link (/admin/incidents) from the "Platform" section. The other links stay.
  • Translation maps: in src/shared/enums/translation-maps.ts, remove getIncidentSeverityTranslations and the IncidentSeverity type import.
  • If billing still exists: delete src/server/domain/subscription/billing-incident-keys.ts. In src/server/domain/subscription/use-subscription-service.ts, remove reportBillingIncident, SYNC_FAILURE_INCIDENTS, every report call and the resolveIncidentByKey calls; keep the billing warnings in the logs.
  • If billing still exists: delete the "End subscription" feature, which exists only for incidents. Remove src/server/api/admin/subscriptions/[id]/end.patch.ts with its spec, the end-subscription action in the incident components (deleted anyway) and the service, store and action parts only it uses (endMissingSubscription; the compiler reports leftovers).
  • If billing still exists: adjust the incident mentions in use-subscription-service.spec.ts, use-subscription-service.reconciliation.spec.ts, src/server/api/webhooks/lemonsqueezy.post.spec.ts, src/server/api/webhooks/stripe.post.spec.ts and src/server/domain/workspace-trial/use-workspace-trial-service.notifications.spec.ts.
  • If the demo still exists: in src/server/demo/seed-demo-data.ts, remove DemoIncidents, the reportIncident calls and the missing-subscription incident; keep the seeded subscription if billing stays. In src/server/demo/reset-demo-data.ts, remove incident.deleteMany() and deletedIncidents. Adjust src/server/demo/seed-demo-data.spec.ts and src/server/demo/run-demo-lifecycle.spec.ts.
  • Comment: in src/server/domain/workspace-plan/post-commit-consequences.ts, remove the words "and not an Incident", if the file still exists.
  • Prisma: after deleting the schema file, create a new migration with npm run db:migrate and never edit the existing init migration. The migration drops the Incident table and its data, so back up first and confirm it. The generated client and src/public/swagger/openapi.json are regenerated by the scripts.
  • Marketing wording (only if you keep marketing; see the marketing guide): MonetizationSection.incidents.* (or the whole section), FoundationSection.platform.incidentBoard, ConversionSection.included.admin, FaqSection.included.answer, FaqSection.openSource.answer, FaqSection.demo.answer, NextStepsSection.tile.demo.description, and DemoLogin.admin.description if the demo stays.
  • i18n: the extractor never removes keys. Delete unused keys by hand from en-US.json and de-DE.json in i18n/locales.
  • Docs: content/docs/02.core-concepts/09.quality.md ends with "Continue with Incidents"; point it to the next page, Dev Workflow (content/docs/03.development/01.workflow.md, description in its front matter). Remove the incident links and sections in content/docs/02.core-concepts/07.billing-and-subscriptions.md (billing incidents, Incident Board mention, runbook steps, "End subscription") and in content/docs/03.development/04.configuration.md (the "Incidents" part of the demo seed tree and its paragraph, the incident mention in the demo reset paragraph). Remove the sentence "and is not an Incident" in content/docs/02.core-concepts/06.plans-and-entitlements.md. Only pages that still exist need changes. The anchors #billing-incidents break.
  • Agent skills: .agents/skills/vuesion-backend/SKILL.md uses src/server/domain/incident/use-incident-service.ts and src/shared/types/domain/Incident.ts as reference examples in its artifact table; replace them with surviving files of the same kind, such as another domain service and shared type.
  • Agent knowledge: in .agents/knowledge/domain.md, delete the product rule "Incidents must be resolvable ... (ADR 0006)" and the glossary term "Incident". In .agents/knowledge/backlog.md, delete the two ideas that mention incidents (admin workspace search by ID, resolution hints).
  • If the billing guide was followed first, its incident items are already done: skip the billing bullets above. Its "Incident wording" item is moot, because this guide deletes ADR 0006 and the incidents page.

Coding-agent prompt

Read this guide and the shared removal loop. Delete every entry point of this guide, handle every item under "Not found by the compiler", and run the loop until lint, test and build pass.