Issue
The issue pipeline connects user-reported bugs to automated fixes. Users click "Report an Issue" in the UI, a GitHub issue is created, and the report agent processes it.
Report an Issue (User-Facing)
Every hogwarts page has a "Report an Issue" link or icon. When clicked, a dialog opens with a textarea. On submit, a GitHub issue is created in databayt/hogwarts with the report label.
Where It Appears
| Location | Variant | How |
|---|---|---|
| SaaS marketing footer | text | Inline link next to "built by Databayt... GitHub" |
| Application form wizard | icon | Bug icon in FormFooter next to Logo, Help, Save |
| School marketing pages | text | Bottom of page |
| School dashboard | text | Bottom of page |
| SaaS dashboard | text | Bottom of page |
| Auth pages | text | Absolute bottom-left |
| Onboarding | text | Bottom of page |
| Exam wizard | text | Absolute bottom-left |
Component
src/components/report-issue.tsx
Two variants:
text(default) — underlined "Report an issue" link that opens the dialogicon— Bug icon (lucide-react) that opens the same dialog
The dialog contains only a textarea and submit button. Bilingual via useDictionary().
Server Action
src/lib/actions/report-issue.ts
On submit:
- Reads
GITHUB_PERSONAL_ACCESS_TOKENfrom env - Reads auth session via
auth()(for reporter identification) - Creates GitHub issue with
reportlabel - Posts acknowledgment comment: "Received. This report is queued for automated review and fix."
Issue Body Format
<user's description>
---
**Page**: https://kingfahad.databayt.org/en/admissions
**Time**: 2026-04-02T08:42:26ZTitle is truncated to 80 characters from the description.
i18n
Translation keys in en.json / ar.json under reportIssue:
| Key | English | Arabic |
|---|---|---|
link | Report an issue | الإبلاغ عن مشكلة |
title | Report an issue | الإبلاغ عن مشكلة |
placeholder | Describe the issue... | ...صف المشكلة |
submit | Submit | إرسال |
submitting | Submitting... | ...جاري الإرسال |
success | Submitted. Thank you! | !تم الإرسال. شكراً لك |
error | Something went wrong. Try again. | .حدث خطأ. حاول مرة أخرى |
Report Agent (Auto-Fix)
The report agent processes open report-labeled issues. Triggered manually by typing report in Claude Code, or by the session-start hook.
Trigger
# Manual
report
report hogwarts
# Session-start hook (automatic)
# Checks hogwarts + kun for open report issues on every session startPipeline
READ → LOCATE → CONTEXT → VALIDATE → FIX → BUILD → PUSH → CLOSE
| Step | What It Does |
|---|---|
| READ | gh issue view — extract description, page URL, time |
| LOCATE | Map URL to route directory (src/app/) and component directory (src/components/) |
| CONTEXT | Read CLAUDE.md, README.md, ISSUE.md in the component directory |
| VALIDATE | Is it a real bug? Does it align with plans? Will the fix improve things? |
| FIX | Edit minimum code needed, follow documented patterns |
| BUILD | pnpm build — verify no regressions |
| PUSH | fix: commit with Closes #N, push to main |
| CLOSE | gh issue close with structured comment (root cause, fix, files, verification) |
Validation Gate
Before writing any code, the agent answers three questions:
- Is it a real bug? — Can it reproduce from description + URL? If not →
cannot-reproducelabel - Is it aligned? — Does it contradict
ISSUE.mdplanned work? If feature request →needs-humanlabel - Is the fix safe? — Could it break shared code? When in doubt →
needs-humanlabel
Escalation
| Situation | Action |
|---|---|
| Build error after fix | Hand off to build agent |
| Server-side exception | Hand off to sse agent |
| Performance issue | Hand off to performance agent |
| Security concern | Hand off to guardian agent |
| Needs architecture change | Comment + needs-human label |
| Cannot reproduce | Comment + cannot-reproduce label |
Agent Definition
.claude/agents/report.md
Close Comment Format
Fixed in abc1234.
**What was wrong**: <root cause>
**What was fixed**: <change summary>
**Files changed**: <list>
**Verified**: build passes, auto-deploying to productionScheduled Trigger (Paused)
A remote trigger exists that runs the report agent every 2 hours in Anthropic's cloud. Currently paused — using manual report keyword until the feature stabilizes.
| Field | Value |
|---|---|
| Name | Report Auto-Fix (Every 2h) |
| ID | trig_01MFLRtUTfMMNTDGBBGQtZLq |
| Schedule | 0 */2 * * * (every 2 hours) |
| Status | Disabled |
| Repo | databayt/hogwarts |
| Model | claude-sonnet-4-6 |
| Manage | https://claude.ai/code/scheduled |
To re-enable when ready:
# In Claude Code
schedule update trig_01MFLRtUTfMMNTDGBBGQtZLq --enabled trueSession-Start Hook
Every time Claude Code opens, the session-start hook checks for open report issues:
# In ~/.claude/settings.json (SessionStart hook)
gh issue list --label report --state open --repo databayt/hogwarts
gh issue list --label report --state open --repo databayt/kunIf found, the agent processes them immediately per the rule in session-start.md.
Full Pipeline Flow
User clicks "Report an issue"
↓
Dialog opens → user types description → Submit
↓
Server action creates GitHub issue (label: report)
↓
Acknowledgment comment posted: "Received. Queued for review."
↓
Next Claude Code session → hook detects → agent processes
OR
User types "report" → agent processes manually
OR
Scheduled trigger (when enabled) → agent processes every 2h
↓
Agent: READ → LOCATE → CONTEXT → VALIDATE → FIX → BUILD → PUSH
↓
Issue closed with structured comment
↓
Vercel auto-deploys fix to production
Files
Hogwarts
| File | Role |
|---|---|
src/components/report-issue.tsx | UI component (text + icon variants) |
src/lib/actions/report-issue.ts | Server action (GitHub API + auth + ack comment) |
src/components/form/footer.tsx | FormFooter with showReport prop |
src/components/internationalization/en.json | English translations |
src/components/internationalization/ar.json | Arabic translations |
Kun (Engine)
| File | Role |
|---|---|
.claude/agents/report.md | Report agent definition (12-step pipeline) |
.claude/rules/session-start.md | Auto-process rule |
content/docs/issue.mdx | This documentation |
Issue Creation (CLI)
Issues can also be created from Claude Code or Slack, not just the dialog.
Usage
# From Claude Code
/issue "Login crashes on Safari mobile" --repo hogwarts
# From keyword
issue "Add dark mode to dashboard"Repo Mapping
| Repo | Scope |
|---|---|
databayt/kun | Engine: agents, skills, MCP, hooks, rules, memory |
databayt/hogwarts | Education: features, bugs, LMS, SIS, billing |
databayt/souq | E-commerce: vendors, cart, checkout |
databayt/mkan | Rentals: listings, booking, search |
databayt/shifa | Medical: appointments, patient records |
databayt/codebase | Shared: patterns, components, templates |
databayt/shadcn | UI: component library |
databayt/swift-app | Mobile: iOS app |
databayt/marketing | Marketing: landing pages |
Labels
Priority
| Label | When |
|---|---|
P0-critical | Production down, data loss, security |
P1-high | Blocks current sprint, customer-facing bug |
P2-medium | Important but not blocking |
P3-low | Nice to have, cleanup |
Type
| Label | When |
|---|---|
report | User-reported via dialog — auto-processed by report agent |
bug | Something is broken |
enhancement | Improve existing feature |
needs-human | Agent can't fix, needs human judgment |
cannot-reproduce | Agent couldn't reproduce the reported issue |
Issue Body Template (CLI)
## Context
Why this matters — user impact, business context, or technical debt.
## Action
- [ ] Step 1
- [ ] Step 2
- [ ] Step 3
## Verification
How to confirm it's done — test commands, URLs to check, expected behavior.On This Page
IssueReport an Issue (User-Facing)Where It AppearsComponentServer ActionIssue Body Formati18nReport Agent (Auto-Fix)TriggerPipelineValidation GateEscalationAgent DefinitionClose Comment FormatScheduled Trigger (Paused)Session-Start HookFull Pipeline FlowFilesHogwartsKun (Engine)Issue Creation (CLI)UsageRepo MappingLabelsPriorityTypeIssue Body Template (CLI)