agentleFS
vibe-cokitvibe-cokit/claude-code/skills/context-engine/context-engine-debugging/SKILL.md

context-engine-debugging

Skill1 starsChanged 4 months agoApache-2.0View on GitHub

Use when the user is debugging a bug, tracing an error, or asking why something fails, and wants to locate the responsible code via the Context Engine MCP. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this 500\"

The file

Files
SKILL.md

Debugging with Context Engine

When to Use

  • "Why is this function failing?"
  • "Trace where this error / log message comes from"
  • "Who calls this method?"
  • "This endpoint returns 500 / a wrong value"
  • Investigating bugs, errors, or unexpected behavior

Workflow

1. list-repos                                              → repoId + freshness check
2. codebase-retrieval({repoId, information_request: "<error text or symptom>"})
                                                           → locate suspect symbols + their snippets
3. Follow [callers:…] / [calls:…] to trace inward/outward from the suspect
4. file-retrieval({repoId, file_path, information_request}) → pinpoint the failing branch
5. Read <file>:<lines>                                     → confirm root cause

If the index is stale (lastCommitSha ≠ local HEAD), recent changes won't be searchable → push first (context-engine-sync).

Checklist

- [ ] Capture the exact symptom (error message, status code, unexpected value)
- [ ] codebase-retrieval for the error TEXT or the behavior in natural language
- [ ] Identify the suspect symbol from the ranked snippets
- [ ] Use [callers:…] to see who reaches it, [calls:…] for downstream/external deps
- [ ] file-retrieval to zoom into the failing function
- [ ] Read source at the returned lines to confirm before fixing

Debugging Patterns

SymptomContext Engine approach
Error / log messagecodebase-retrieval for the message text → inspect throw/log sites
Wrong return valuecodebase-retrieval on the function → follow [calls:…] for data flow
Intermittent failureinspect [calls:…] for external/async deps (fetch, DB, Redis, timeouts)
Performance hot pathsymbols with many [callers:…] are the hot paths
Recently brokeensure the index is fresh (push), then search the changed area

Tools

codebase-retrieval — find code related to the error:

codebase-retrieval({repoId, information_request: "SSE streaming response re-stream ZlibError accept-encoding"})
→ core/apps/registry/src/api/bff-data.routes.ts#L290-362  (accept-encoding: identity to avoid Bun ZlibError)

file-retrieval — narrow to the failing branch in a known file:

file-retrieval({repoId, file_path: "apps/models-router/apps/api/src/api/public.routes.ts",
                 information_request: "where usage buckets are aggregated by model"})

Note: codebase-retrieval has NO git-history awareness — it reflects only the last indexed snapshot. For "what changed recently" use git log/git diff; for "what does my current diff affect" read the changed files directly.

Example: "Models-router /public usage endpoint returns wrong totals"

1. list-repos → repoId, status=indexed
2. codebase-retrieval({repoId, information_request: "public usage stats aggregation by request_model and bucket"})
   → apps/models-router/apps/api/src/api/public.routes.ts (modelBucketMap aggregation)
3. file-retrieval on public.routes.ts: "how the bucket key is built"
   → key uses `${request_model}\0${bucket}` (NUL separator)
4. Read the aggregation block → confirm the bucketing logic / off-by-one

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.