Mr Fix It — Debugging & Error Resolution
Identify, diagnose, and fix problems surfaced by Cursor: syntax errors, linter warnings, configuration issues, runtime errors, and extension conflicts. Follow the workflow below for every fix request.
Workflow
1. Gather context
Collect all available information before proposing any fix:
- •Read the file(s) mentioned in the error (use
Readtool; never guess content). - •Run
ReadLintson the affected file(s) to get current diagnostics. - •Check the screenshot / error message for exact text, file path, line, and column.
- •Note the environment: language, framework, PHP/Node version, OS (from conversation context).
2. Diagnose
For each error or warning, determine:
| Question | Action |
|---|---|
| Is it a syntax error? | Read the file around the reported line. Check for unclosed brackets, missing semicolons, encoding issues (BOM, invisible chars). Use hex dump if needed. |
| Is it a linter false positive? | Compare linter output (ReadLints) with actual file content. If the file is syntactically valid and the linter disagrees, note it as false positive. |
| Is it a config / environment issue? | Check versions (PHP, Node, etc.), extension settings, tsconfig.json, .eslintrc, phpcs.xml, etc. |
| Is it a runtime error? | Check terminal output, stack traces, network responses. |
| Is it a warning (not error)? | Determine if it's actionable or informational. Suppress only if safe. |
Root-cause checklist:
- •Hidden / invisible characters (use hex dump:
Format-Hexon Windows,xxdon Unix) - •Version mismatch (local linter vs server runtime)
- •Duplicate definitions across files
- •Missing dependencies or imports
- •Encoding issues (BOM, mixed line endings)
3. Fix
Apply fixes in order of severity (errors first, then warnings):
- •Read before editing — always read the target file first.
- •Minimal change — fix only what is broken; do not refactor unrelated code.
- •Preserve credentials — never remove or expose secrets. If a file contains hardcoded secrets, warn the user but do not delete them unless asked.
- •Best practices — apply language-specific best practices when they help resolve the issue:
- •PHP: omit closing
?>in PHP-only files; usedeclare(strict_types=1)where appropriate. - •YAML (GitHub Actions): map secrets through
envat job level; reference as$VARinrunblocks. - •JS/TS: prefer
const/letovervar; ensure imports resolve. - •Python: check indentation consistency (tabs vs spaces).
- •PHP: omit closing
- •Run
ReadLintsafter editing to confirm the fix resolved the issue and introduced no new errors.
4. Verify
After all fixes:
- •Run
ReadLintson every edited file. - •If the project has local tests or a local server (e.g.,
serve_local.py, Playwright), run them. - •Summarize what was fixed, what was a false positive, and any remaining warnings that are informational only.
Severity classification
| Level | Icon | Meaning | Action |
|---|---|---|---|
| error | Red circle | Breaks functionality | Must fix |
| warning | Yellow triangle | Potential issue | Fix if actionable; explain if informational |
| info | Blue icon | Style / suggestion | Fix only if asked or trivial |
Response format
For each problem found, report:
- •Problem — one-line summary.
- •Root cause — why it happens (one sentence).
- •Severity — error / warning / info.
- •Fix — exact change made (or explanation if no code change needed).
- •Verification — how to confirm the fix (e.g., "ReadLints shows 0 errors", "Playwright passes").
- •Safety notes — any side effects or caveats ("None" if clean).
Common fix patterns
Syntax errors
- •Unclosed bracket/quote: find the opener, count nesting, add the closer.
- •Extra token: usually from bad merge or copy-paste; remove duplicate.
- •Encoding: rewrite the file via
Writetool to strip BOM/invisible chars.
Linter false positives
- •PHP linter version mismatch (e.g., PHP 8 linter on PHP 5 code): note and ignore, or adjust linter config.
- •YAML secret warnings: use
envmapping; remaining warnings about unverifiable secrets are informational. - •TypeScript strict mode: add explicit types or assertions where the linter insists.
Config / environment issues
- •Missing env var: add to
.env.example, warn user to set it. - •Extension conflict: suggest disabling one, or add workspace settings to override.
- •Path mismatch: align local paths with deployment paths (see project deploy rules).
Runtime errors
- •Check terminal output for stack trace.
- •Reproduce locally if possible (use
serve_local.py,node,php -l, etc.). - •Fix the code, then verify with local test.
Self-check before finishing
- • Every error in the screenshot / report has been addressed.
- •
ReadLintsshows no new errors on edited files. - • Fixes are minimal and do not break unrelated functionality.
- • Credentials and secrets are preserved (not exposed or deleted).
- • Severity levels are correct.
- • Verification steps have been run (not just proposed).