OpenParable
Skip to content
← Back to skills

Code Analysis

Testing & Quality
code-analysis

Code Analysis is an Agent Skill for testing & quality published in the abbaye/WpfHexEditorIDE repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

INTERNAL DEV WORKFLOW for WpfHexEditor — Claude self-invokes this skill BEFORE any non-trivial edit AND AFTER multi-file changes, to enforce CLAUDE.md rules (functions <=25 lines, classes <=300, 1-file-1-responsibility, module boundaries, forbidden patterns). Auto-trigger on: edits >50 lines, new files, refactors, module-crossing changes, plugin/SDK touches, performance-sensitive paths (HexEditor buffer, CodeEditor render, viewport, drag/scroll), Roslyn diagnostics work. Skip on: doc-only, resx-only, comment fixes, single-line bug fixes, single-file <20-line edits.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/abbaye/WpfHexEditorIDE/blob/HEAD/Sources/.claude/skills/code-analysis/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/code-analysis, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

code-analysis (internal)

Pre/post guard for CLAUDE.md thresholds and forbidden patterns. Not a replacement for the in-app CodeAnalysisRunner (deep Roslyn/Halstead).

When I invoke

SituationPhases
Non-trivial edit, 2+ modules, new fileP1, P3
HexEditor/ or CodeEditor/ render/buffer, plugin/SDKP1, P3 (mandatory)
Multi-file completionP3
Single-file <20 lines, no new symbol, resx/md/comment onlyskip

Phases

P1 — pre-edit scripts/pre-edit-check.ps1 -File <path> → LOC=X | Funcs>25=N | Class>300=M | Callers=K | Module=<id> | Risk=LOW|MED|HIGH HIGH risk → propose PLAN, do not edit.

P2 — during edit (mental checklist from references/forbidden-patterns.md) Refuse: using ICSharpCode/AvalonEdit, MessageBox.Show( (use IDialogService), .md in Sources/, hardcoded user-strings in XAML/VMs, Resources.X in HexEditor partials (use L10n), background fix without root cause, new mutable static on hot paths.

P3 — post-edit scripts/post-edit-audit.ps1 -Files <paths> -Baseline HEAD → OK or VIOLATIONS: <list> VIOLATIONS ≤2 mechanical → fix immediately. VIOLATIONS large/architectural → stop, propose PLAN.

Scope-impact (on demand): scripts/scope-impact.ps1 -Symbol <name> — enumerate referencing files (cap 50, depth 2) before public symbol rename/move.

Performance budget

P1 ≤150 tokens | P3 ≤200 tokens | scope = changed files only | cache valid <5 min + unchanged mtime.

Failure modes to avoid

ModeGuard
Sur-déclenchement on typo fixesHonor skip rules above
Cache stalenessP3 must not use P1 cache for a just-edited file
PowerShell edition mismatchScripts exit with clear message; fall back to Grep/Read

Does not replace CodeAnalysisRunner, modify source, run dotnet build, or invoke external services.