| name | deco-incident-debugging |
| description | Fast incident response skill for Deco engineering team. Rapidly identifies known issues from past learnings, proposes solutions, and guides debugging for new incidents. Optimized for speed - get to root cause in minutes, not hours. |
Deco Incident Debugging
PRIORITY: SPEED - This skill is designed for real-time incident response. Every second counts. Execute the triage workflow immediately and propose solutions as fast as possible.
When to Use This Skill
- Production incident in progress
- Site is down, slow, or showing errors
- Customer escalation requiring immediate response
- On-call engineer needs AI assistance during war room
- Post-incident to document root cause and learnings
Quick Start - 60 Second Triage
1. GET SYMPTOMS → What error/behavior is the user seeing?
2. MATCH LEARNINGS → Search learnings/ for similar patterns
3. PROPOSE SOLUTIONS → If match found, apply known fix
4. DEEP DIVE → If no match, run diagnostic workflow
5. DOCUMENT → Capture new learning if novel issue
Files in This Skill
| File | Purpose |
|---|
SKILL.md | This overview and quick reference |
triage-workflow.md | Step-by-step fast triage process (interactive) |
headless-mode.md | Autonomous investigation without human interaction |
learnings-index.md | Categorized index of all past learnings |
Operating Modes
Interactive Mode (default)
Use when working alongside an engineer during an incident. The agent asks clarifying questions and collaborates on diagnosis.
Headless Mode
Use when triggered automatically by incident management systems (PagerDuty, Opsgenie, etc.). The agent receives minimal context and autonomously:
- Extracts keywords from alert message
- Searches learnings for matching patterns
- Collects live data (logs, metrics)
- Correlates findings to known issues
- Outputs structured diagnosis with proposed fix
See headless-mode.md for full autonomous workflow, input/output formats, and integration examples.
Learnings Database
Status: learnings/ does not exist yet in this repo. There is no seeded
knowledge base to search — do not grep learnings/ and treat a silent/empty
result as "no known issue." Until the folder is created and seeded, use these
two real sources instead:
CHANGELOG.md (repo root) — the human-curated ledger of behavior
changes, several of which are incident-driven fixes. Example: the
"Unreleased — Admin async (⚡) toggle is the source of truth for deferral"
entry documents a real regression (issue #266, sections silently rendering
client-side) and its fix/migration path.
git log — search commit history for prior fixes to the same area,
e.g. git log --oneline --grep="fix" -i -- <path> or
git log --oneline -- <affected-file>. Example: commit a3f9b9c test(cms): add regression test for the layout-cache index-corruption race
is a real past incident with a regression test you can read for the
root-cause pattern.
grep -ri "SYMPTOM_KEYWORD" CHANGELOG.md
git log --oneline --grep="fix\|regression\|incident" -i -20
git log --oneline -20 -- <affected-file-or-dir>
If you want to seed learnings/ for future incidents
The workflow below (Phase 5, "Document New Learning") still assumes a place
to write novel findings. If none exists, create it with this structure before
relying on it:
learnings/
cache-strategy/
loader-optimization/
block-config/
ui-bug/
vtex-integration/
migration/
<filename>.md # [keyword]-[brief-description].md, using the template
# in Phase 5 / triage-workflow.md Step 6
Seed it opportunistically — turn each future Phase 5 write-up into a real
file instead of a one-off chat response, and it will compound. Until then,
treat every category table below as illustrative of the kind of pattern to
look for, not as a literal file that exists.
Incident Response Workflow
Phase 1: Rapid Assessment (< 2 minutes)
Ask the engineer these questions:
-
What is the error message or behavior?
- Copy exact error text if available
- Describe what user sees
-
When did it start?
- Sudden vs gradual
- After deployment?
- Traffic spike?
-
What is the scope?
- All users or specific segment?
- All pages or specific routes?
- One site or multiple?
-
What changed recently?
- Code deployments
- Config changes
- Third-party updates
Phase 2: Pattern Matching (< 3 minutes)
Search for known patterns. If learnings/ has been seeded (see above),
search it first; either way, fall back to CHANGELOG.md and git log:
grep -ri "SYMPTOM_KEYWORD" learnings/ 2>/dev/null
grep -ri "SYMPTOM_KEYWORD" CHANGELOG.md
git log --oneline --grep="SYMPTOM_KEYWORD" -i -20
grep -ri "429" CHANGELOG.md
grep -ri "cache" CHANGELOG.md
grep -ri "slow" CHANGELOG.md
grep -ri "not found" CHANGELOG.md
grep -ri "cookie" CHANGELOG.md
grep -ri "vtex" CHANGELOG.md
grep -ri "lazy" CHANGELOG.md
Phase 3: Known Issue? Apply Fix Immediately
If symptom matches a learning (or a past CHANGELOG/git entry):
- Read the full learning file / CHANGELOG entry / commit
- Verify root cause matches the current symptoms
- Apply the documented solution
- Verify the fix works
Phase 4: Unknown Issue? Deep Diagnostic
If no learning matches, run full diagnostics:
SEARCH_LOGS({ query: "level:error site:SITENAME", limit: 50 })
MONITOR_SUMMARY({ sitename: "SITE", hostname: "HOSTNAME" })
MONITOR_TOP_PATHS({ ... })
MONITOR_STATUS_CODES({ ... })
bun run typecheck
git log --oneline -20
git diff HEAD~5
npx tsx node_modules/@decocms/blocks-cli/scripts/generate-blocks.ts
Phase 5: Document New Learning
If this is a novel issue, create a new learning:
# [Title]
## Category
[category-name]
## Problem
[What went wrong]
## Symptoms
- [Observable indicator 1]
- [Observable indicator 2]
## Root Cause
[Why it happened with code examples]
## Solution
[How to fix with code examples]
## How to Debug
[Commands and techniques]
## Files Affected
[List of file patterns]
## Pattern Name
[Short memorable name]
## Checklist Item
[One-line check for future audits]
## Impact
[What happens if unfixed]
Common Incident Patterns
Rate Limiting (429 Errors)
Symptoms: "Too Many Requests" errors, spiky error rates
Quick Check:
grep -ri "rate limit\|429\|overfetch" learnings/ CHANGELOG.md 2>/dev/null
Where to look (until learnings/ is seeded, no filenames are guaranteed
to exist — search CHANGELOG.md / git log for prior cache- or
loader-related fixes instead):
- Loaders missing
export const cache causing repeated upstream calls
- N+1 / overfetching patterns in loaders
Immediate Actions:
- Check if loaders have
export const cache
- Check for N+1 query patterns
- Add stale-while-revalidate caching
Slow Page Load
Symptoms: High TTFB, slow LCP, user complaints about speed
Quick Check:
grep -ri "slow\|cache\|lazy\|performance" learnings/ CHANGELOG.md 2>/dev/null
Where to look: the "Unreleased — Admin async (⚡) toggle" entry in
CHANGELOG.md documents a real deferral/rendering behavior change relevant
to slow-page investigations (position-based auto-deferral, foldThreshold).
Also check cache hit rates and lazy-section cache headers directly.
Immediate Actions:
- Check cache hit rates with CDN metrics
- Verify lazy sections have proper cache headers (see the async ⚡ /
foldThreshold behavior in CHANGELOG.md)
- Check for sync loaders blocking render
Missing Content / Blank Sections
Symptoms: Sections not rendering, blank areas on page
Quick Check:
grep -ri "dangling\|missing\|not found\|blank" learnings/ CHANGELOG.md 2>/dev/null
Where to look: block config pointing at a deleted component, or a loader
error masked by duplicate sections. Search git log for past fixes touching
.deco/blocks/ or the affected section.
Immediate Actions:
- Sanity-check
.deco/blocks/*.json by regenerating:
npx tsx node_modules/@decocms/blocks-cli/scripts/generate-blocks.ts
(fails loudly on malformed JSON; there is no full schema validator)
- Check browser console for loader errors
- Verify component files exist
VTEX Integration Issues
Symptoms: Products not loading, cart errors, checkout problems
Quick Check:
grep -ri "vtex" learnings/ CHANGELOG.md 2>/dev/null
Where to look: wrong VTEX domain (myvtex vs vtexcommercestable), or
cookies blocking edge caching. Search git log / CHANGELOG.md for past
VTEX-related fixes.
Immediate Actions:
- Check VTEX domain configuration
- Verify API credentials
- Check for VTEX service status
Visual Bugs / UI Issues
Symptoms: Broken layouts, invisible elements, style issues
Quick Check:
grep -ri "invisible\|css\|style\|responsive\|safari" learnings/ CHANGELOG.md 2>/dev/null
Where to look: empty links covering clickable content, mobile/desktop
breakpoint inconsistencies, Safari-specific image flashing, or missing
styles on lazy-loaded sections. Search git log for past fixes to the
affected component.
Immediate Actions:
- Check browser dev tools for overlapping elements
- Inspect CSS loading order
- Test on affected browser/device
Debugging Commands Reference
Error Investigation
SEARCH_LOGS({ query: "level:error site:SITENAME", limit: 50 })
GET_LOG_DETAILS({
query: "level:error site:SITENAME",
groupBy: ["body", "service"]
})
QUERY_CHART_DATA({
series: [{ dataSource: "events", aggFn: "count", where: "level:error" }],
granularity: "1 hour"
})
Performance Investigation
MONITOR_SUMMARY({ sitename: "SITE", hostname: "HOST", startDate: "YYYY-MM-DD", endDate: "YYYY-MM-DD" })
MONITOR_TOP_PATHS({ ... })
MONITOR_CACHE_STATUS({ ... })
MONITOR_STATUS_CODES({ ... })
Code Investigation
bun run typecheck
npx tsx node_modules/@decocms/blocks-cli/scripts/generate-blocks.ts
grep -L "export const cache" loaders/**/*.ts
git log --oneline -20
git diff HEAD~5
bun run typecheck 2>&1 | grep "error TS" | sed 's/:.*//g' | sort | uniq -c | sort -rn
Escalation Criteria
Escalate Immediately If:
- Site completely down (no pages loading)
- Checkout broken (revenue impact)
- Data breach suspected
- Issue affecting multiple customers
- Fix requires platform changes (not site code)
Can Handle with This Skill:
- Single site performance issues
- Configuration problems
- Code bugs in site repository
- Cache/loader issues
- Visual/UI bugs
Post-Incident Checklist
After resolving the incident:
Related Skills
deco-full-analysis - For comprehensive site audits (non-urgent)
deco-performance-audit - For deep performance analysis
deco-typescript-fixes - For systematic type error fixes