Prompt file imported from anzchy/mdpro (
.codex/prompts/mdpro-mecha-audit.md). Copyright stays with the author.
mdpro Deep Audit
Do not edit files. Audit only the selected dimensions.
If arguments are empty, use the current UTC minute as a seed:
start = minute % 17
walk forward, wrapping around, picking every other dimension until 5 are selected
If arguments contain numbers, audit exactly those dimensions.
Dimensions
-
Keyboard shortcut sync Files:
src-tauri/src/menu.rs,src/types/preferences.ts,docs/guide/keyboard-shortcuts.mdCheck: menu accelerators, default preferences, docs, and new handlers stay aligned. -
Zustand anti-patterns Files:
src/stores/*.ts,src/components/**/*.tsx,src/hooks/*.tsCheck: no top-level store destructuring in components, freshgetState()in callbacks, tests reset state, stores use explicit generics. -
IPC trust boundaries Files:
src-tauri/src/commands/*.rsCheck: input validation, no unwrap/expect on user input, commands returnResult<T, String>, MCP args validated. -
Rust backend safety Files:
src-tauri/src/**/*.rsCheck: no panic on user-derived values, no unchecked indexing, errors propagated with?ormap_err. -
Draft and auto-save races Files:
src/hooks/useAutoSave.ts,src-tauri/src/services/draft.rs,src-tauri/src/commands/draft.rsCheck: timers cancel on close, drafts do not overwrite newer content, writes are atomic. -
File watcher correctness Files:
src-tauri/src/services/file_watcher.rs,src/hooks/useFileWatcher.tsCheck: debounce, cleanup, self-trigger protection, platform assumptions. -
Milkdown WYSIWYG edge cases Files:
src/plugins/milkdown/*.ts,src/hooks/useMilkdown.tsCheck: init/unmount races, schema conflicts, dispatch after destroy, cleanup, circular imports. -
CodeMirror source mode edge cases Files:
src/plugins/codemirror/*.ts,src/components/Editor/Check: IME composition, multi-cursor behavior, duplicate facets, circular dependencies. -
Plugin CSS isolation Files:
src/plugins/**/*.css,src/styles/*.cssCheck: plugin CSS is colocated, scoped, uses CSS variables, and does not bleed globally. -
MCP shadow store correctness Files:
src-tauri/src/services/shadow_store.rs,src-tauri/src/commands/mcp.rsCheck: open/close sync, stale content, serializable events, mutex/deadlock risk. -
Type safety Files:
src/**/*.ts,src/**/*.tsxCheck:any, unsafe casts,(e as Error).message, missing optional guards, exported return types. -
Logging completeness Files: recently modified
src/**/*.ts,src-tauri/src/**/*.rsCheck: Start plus Success/Fail logs, no console/println/eprintln, actionId present. -
Test coverage gaps Files: stores, hooks, services, plugins Check: corresponding tests, bug regression tests, explicit assertions, no logic snapshots.
-
Dead code Files:
src/**/*.ts(x),src-tauri/src/**/*.rsCheck: unused exports/imports, unreachable branches, orphaned CSS, unused deps. -
Export and HTML rendering Files:
src/services/exportService.ts,src-tauri/src/commands/export.rs,src-tauri/src/services/html_template.rs,src-tauri/src/services/markdown.rsCheck: sanitization, image paths, filename collisions, write errors, XSS vectors. -
Dependency health Files:
package.json,src-tauri/Cargo.tomlCheck: known CVEs, deprecated APIs, risky upgrades. -
Version file sync Files:
package.json,src-tauri/tauri.conf.json,src-tauri/Cargo.tomlCheck: all three version strings match.
Output
Announce selected dimensions:
Auditing dimensions: [list] - [names]
For each finding:
### [SEVERITY] Dimension: short problem
**File**: `path/to/file.ts` (line N)
**Impact**: what breaks or what risk this creates
**Fix**: concrete change needed
Severity:
- BLOCK: data loss, security, or silent failure
- MUST: rule violation or correctness issue
- SHOULD: code quality or test gap
- NOTE: observation only
If a dimension has no findings, write Dimension - clean.
End with:
| Dimension | Findings | Highest Severity |
| --- | --- | --- |