OpenParable
Skip to content
← Back to skills

Loc Guard

Testing & Quality
loc-guard

Loc Guard 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 on two scopes: (1) PARITY — after editing any *.resx (base or satellite), verifies the 28-language satellite parity (missing/orphan keys, placeholder drift, untranslated). (2) SOURCE — after editing *.xaml or *.cs under App/, Editors/, Plugins/, Core/, Controls/, advisory checks for: DynamicResource on loc keys (must be StaticResource), hardcoded user-visible string literals, IdeMessageBox.Show literals, legacy MessageBox.Show usage (ADR-009), and missing LocalizedResourceDictionary wiring (ADR-005). All SOURCE findings are warn-only. Distinct from xaml-guard (which only checks Designer.cs parity for the base resx). Skip on: Themes/, ColorPicker, Designer.cs/g.cs, Tests/, Samples/, pure structural XAML 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/loc-guard/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/loc-guard, 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.

loc-guard (internal)

56 base *Resources.resx files × up to 28 satellites. xaml-guard covers base↔Designer.cs; this skill covers base↔satellites (Scope 1) and source advisory (Scope 2).

When I invoke

Scope 1 — PARITY

SituationRun?
Edit a base *Resources.resxyes (scan all satellites)
Edit a satellite *.<lang>.resxyes (scan against base only)

Scope 2 — SOURCE (advisory)

SituationRun?
Edit *.xaml / *.cs under App/, Editors/, Plugins/, Core/, Controls/yes
Edit Themes/, ColorPicker/, *.Designer.cs, *.g.cs, Tests/, Samples/no
Pure structural edit (Grid.Row, Margin), comment/whitespace onlyno

Pipeline

Scope 1: scripts/loc-parity.ps1 -Files <paths> Scope 2: scripts/loc-source-guard.ps1 -Files <paths> (always exits 0) Silence a line: // loc-ignore: <reason> (CS) or same-line XML comment (XAML). Tune: data/allowlist.json.

Rules

Scope 1 — parity (blocking)

RuleSeverity
satellite-missing-keyerror — key in base, absent from satellite
satellite-orphan-keyerror — key in satellite, absent from base
placeholder-mismatcherror — format-arg drift ({0}/{1} base vs {0} sat)
untranslatedwarn — satellite value identical to base (non-en-* only)
satellite-malformederror — XML parse fails or root != <root>

Scope 2 — source (advisory)

RuleDetects
loc-static-required{DynamicResource <LocKey>} → must be StaticResource
loc-hardcoded-stringliteral in Text/ToolTip/Header/Content/Title (XAML) or .Text =/.Title = (CS)
loc-idemessagebox-literalIdeMessageBox.Show("literal", …) — first arg must be a resource key
loc-messagebox-legacyMessageBox.Show(…) → use IdeMessageBox (ADR-009)
loc-locdict-missingassembly has *Resources.resx but no LocalizedResourceDictionary merge (ADR-005)

Output

Loc AppResources (28 satellites):
  fr-FR  OK     keys=680
  ja-JP  3 missing-key   APP_NewFile_Title, APP_Recent_Header, PA_FilterTitle
  ar-SA  1 placeholder-mismatch  APP_Status_Loading base="{0}/{1}" sat="{0}"
  ru-RU  124 untranslated  (warn)

Language matrix auto-detected per assembly by scanning sibling <base>.<lang>(-<region>)?.resx files. Scope 2 exit 0 (advisory); does not translate, generate, or coordinate sub-agents (see feedback_localization_agent_strategy).

Maintenance

  • New language added → auto-picked up.
  • Renaming a base resx → update all satellites in same commit (orphan files not detected at filesystem level).