From quangflow
Use when project is shipped — systematic debugging, structured log scan, bug triage, hotfix
npx claudepluginhub duongmquang/quangflowThis skill uses the workspace's default tool permissions.
You are now entering Phase 5: Maintain — post-ship hotfix and maintenance workflow.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
You are now entering Phase 5: Maintain — post-ship hotfix and maintenance workflow.
After all milestones are SHIPPED, the project enters maintenance mode. This phase handles: production bugs, dependency failures, performance regressions, and ad-hoc fixes. It is lighter than the full qf:1→4 cycle but still structured.
All bug investigation and fixing in this phase follows _protocols/_systematic-debugging.md.
/qf:4-verify to verify and ship first."/qf:5-maintain — Enter maintain mode (auto-detect project)
/qf:5-maintain scan — Scan logs, build/refresh BUGLOG.md
/qf:5-maintain fix BUG-XXX — Start hotfix for a specific bug
The agent reads application logs from known locations. Convention:
./logs/ <- project log directory
├── backend/ <- BE logs
│ ├── error.log <- errors + exceptions
│ ├── app.log <- general application log
│ └── access.log <- HTTP access log (optional)
├── frontend/ <- FE logs (if captured)
│ ├── error.log <- JS errors, build failures
│ └── console.log <- browser console captures
└── infra/ <- infra logs (optional)
├── docker.log
└── ci.log
If project uses different log locations (e.g. /tmp/backend.log, nohup.out):
nohup.out, /tmp/*.log, *.log in project root./logs/ directory firstnohup.out, /tmp/*.log, *.log in rootWhen reading logs, classify entries:
| Severity | Pattern | Priority |
|---|---|---|
| CRITICAL | Unhandled exceptions, data loss, security breach, service down | Fix immediately |
| ERROR | Failed requests, broken features, exception traces | Fix in this session |
| WARNING | Deprecation, performance degradation, retry exhaustion | Triage — fix or defer |
| INFO | Expected behavior, debug traces | Skip unless user asks |
Do NOT dump entire log files. Read strategically:
log_bookmarks:
backend/error.log: { last_line: 1847, last_read: "2026-03-10T15:00:00" }
frontend/error.log: { last_line: 203, last_read: "2026-03-10T15:00:00" }
/qf:5-maintain scan: Read only lines AFTER the bookmark (new entries since last scan)/qf:5-maintain scan 7dSave to ./plans/{feature-slug}/BUGLOG.md:
# Bug Log — {feature-slug}
## Metadata
```yaml
last_scan: "2026-03-10T15:08:00+07:00"
log_bookmarks:
backend/error.log: { last_line: 2041, last_read: "2026-03-10T15:08:00" }
frontend/error.log: { last_line: 305, last_read: "2026-03-10T15:08:00" }
log_paths:
backend: ["./logs/backend/error.log", "/tmp/backend.log"]
frontend: ["./logs/frontend/error.log"]
(moved here after fix verified)
(moved here if user chooses DEFER)
---
## Scan Flow (`/qf:5-maintain scan`)
1. Discover log files (see Log Discovery Protocol)
2. Read new entries since last bookmark
3. Parse and classify by severity
4. Dedup by error signature
5. Map errors to requirements/files where possible (grep stack traces for known files)
6. Update or create BUGLOG.md
7. Present summary:
Scan complete. Found {N} new issues since last scan:
Top issues:
Actions:
/qf:5-maintain fix BUG-XXX — start hotfix for a specific bug
Agent waits. Does nothing until user responds.
---
## Autopilot Triage
See `_protocols/_autopilot.md → Phase 5 — Maintain`. If autopilot: auto-triage by severity, present plain summary, proceed on OK.
On user objection: fall through to manual Triage Flow below.
---
## Triage Flow (user types TRIAGE)
For each NEW bug, starting with highest severity:
Present bug details and ask via `AskUserQuestion`:
```json
{
"questions": [{
"question": "BUG-XXX [SEVERITY]: {description}\nSource: {file}:{line}\nOccurrences: {N}\n\nWhat should we do?",
"header": "Bug Triage",
"options": [
{ "label": "FIX NOW", "description": "Start hotfix immediately" },
{ "label": "FIX LATER", "description": "Keep in active bugs, fix in future session" },
{ "label": "DEFER", "description": "Move to deferred — known issue, not blocking" },
{ "label": "IGNORE", "description": "Not a real bug / expected behavior" }
],
"multiSelect": false
}]
}
Update BUGLOG.md status per decision. After triage, if any FIX NOW selected, proceed to Bug Dispatch.
Count how many bugs are marked FIX NOW. Choose execution mode:
Proceed directly to Hotfix Flow below. Main agent handles it.
Present dispatch options to user:
{N} bugs marked FIX NOW:
- BUG-001 [CRITICAL]: {desc} — affects backend (app/services/*)
- BUG-003 [ERROR]: {desc} — affects frontend (src/components/*)
- BUG-005 [ERROR]: {desc} — affects backend (app/api/*)
Execution mode:
1. **Sequential** — fix one at a time (safest, no conflicts)
2. **Parallel agents** — spawn debugger agents per domain (faster, needs distinct file ownership)
If Sequential (default): Fix highest-severity first, one by one via Hotfix Flow.
If Parallel agents:
debugger agent per domain group:
Task(subagent_type: "debugger", name: "fix-backend")
Prompt: BUGLOG.md context + BUG-001, BUG-005 details + file ownership: app/**
Task(subagent_type: "debugger", name: "fix-frontend")
Prompt: BUGLOG.md context + BUG-003 details + file ownership: src/**
When bugs are dispatched (sequential or parallel), update BUGLOG.md entries:
- **Status:** IN PROGRESS
- **Assigned:** {agent-name or "main"}
- **Started:** {timestamp}
During investigation, if a bug reveals a missing or incorrect requirement (not just a code bug):
Log it in BUGLOG.md with tag ESCALATION: requirement gap
Present to user: "This bug points to a requirement gap — not just a code issue:
Options:
/qf:1-brainstorm to properly scope this as a new requirement (uses the short milestone-2+ confirmation flow)"If user picks Escalate: stop maintain flow, tell user to run /qf:1-brainstorm {feature-slug} which will use the milestone-2+ short confirmation flow to add the new requirement properly
If user picks Fix here: proceed with the fix as a normal bug
/qf:5-maintain fix BUG-XXX)Lighter than full qf:1→4 cycle. No brainstorm, no milestone, no team pipeline.
Follow _protocols/_systematic-debugging.md Phase 1 (Observe) and Phase 2 (Hypothesize):
.evidence/logs/ for relevant *.jsonl files, filter by correlation ID or timestamp.evidence/debug/BUG-{ID}-investigation.md**BUG-XXX Investigation:**
- **Root cause:** {explanation}
- **Affected files:** {list}
- **Proposed fix:** {brief description}
- **Risk:** {what else could break}
- **Tests needed:** {what to test after fix}
- **Evidence:** .evidence/debug/BUG-{ID}-investigation.md
Proceed with fix? (YES / ADJUST / SKIP)
Agent waits for user response.
.evidence/tdd/BUG-{ID}-red.log.evidence/tdd/BUG-{ID}-green.log### BUG-XXX [CRITICAL] — Service X returns 500 on endpoint Y
- **Status:** RESOLVED
- **Fixed:** 2026-03-10 15:30
- **Fix:** Replaced vnstock3 API with VNDirect direct API (dependency was IP-banned)
- **Files changed:** app/services/fundamental_service.py, tests/test_fundamental_service.py
- **Regression test:** test_fundamental_service.py::test_api_failure_returns_all_null
Save resolution to .evidence/debug/BUG-{ID}-resolution.md with: root cause, fix applied, files changed, tests added.
See _protocols/_shared.md → GOTCHAs System → Logging Protocol.
After each bug fix, auto-create a gotcha entry in plans/{feature-slug}/GOTCHAS.md:
phase-4 if tests should have caught it, phase-2 if design was flawed, etc.Ask user: "Fix verified. Commit? (YES / NO)"
If YES, create conventional commit: fix: {brief description} (BUG-XXX)
When a bug is caused by an external dependency breaking (API down, library deprecated, service IP-banned):
type: dependency-failureresearcher agent to find replacement APIs/librariesDependency failure: {library/API} — {what broke}
Alternatives:
1. {Alternative A}: {pros/cons}
2. {Alternative B}: {pros/cons}
3. {Workaround}: {temporary fix}
Which approach? (1/2/3)
When scanning, check for patterns:
Present recurring patterns in scan summary:
Recurring patterns detected:
- BUG-003 was resolved on 03/08 but reappeared (regression)
- BUG-007 only occurs between 09:00-15:00 (time-dependent)
When user is done:
phase: maintain, status: idle/qf:5-maintain next session."See _protocols/_shared.md → Output Rule.