Skip to content

Resolve frontend type-safety guidance by guarantee, not by a fixed route - #175

Merged
shinpr merged 3 commits into
mainfrom
fix/frontend-type-safety-route
Sep 6, 2026
Merged

shinpr merged 3 commits into
mainfrom
fix/frontend-type-safety-route

Conversation

@shinpr

@shinpr shinpr commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Problem

frontend-ai-guide and quality-fixer-frontend prescribed unknown plus type guards as the single route for external data, while typescript-rules already owns that policy and permits bounded exceptions — including a generated client that enforces its contract at runtime. The fixed route both duplicated and contradicted the owning policy, and the backend counterpart (ai-development-guide) had already moved to a guarantee-based criterion, leaving the frontend side behind.

Two further problems came from the same place: the anti-pattern entry judged type assertions by how many were used rather than by whether anything backed them, and the fix guidance was stated twice in quality-fixer-frontend.

Changes

skills/frontend-ai-guide/SKILL.md — criteria stated within this skill's own responsibility, with no dependency on another progressively disclosed skill

  • Anti-pattern 7 now reads "Type assertions standing in for a guarantee — Declaring a type established by neither a check nor an existing contract", replacing the unmeasurable "Excessive use of type assertions (as)".
  • Failure Pattern 2 becomes "Circumventing Type Guarantees"; its symptom and avoidance are stated as whether a check or an existing contract backs the declared type, rather than naming a single technique.

agents/quality-fixer-frontend.md — deferral to the preloaded owning policy

  • External API response types are resolved by the typescript-rules boundary validation policy (the skill is preloaded through this agent's frontmatter).
  • The duplicate React-specific "Unknown API responses" entry is removed; the auto-fix entry that already scopes unknown plus validation to untyped external API responses is kept unchanged.

Versions — patch bump to 0.25.4 across package.json, .claude-plugin/marketplace.json, and the four plugin manifests.

Verification

pnpm run sync, pnpm run sync:check, pnpm run check:skills-index, and claude plugin validate for the marketplace manifest and all four plugins pass.

🤖 Generated with Claude Code

shinpr and others added 3 commits September 6, 2026 19:00
frontend-ai-guide and quality-fixer-frontend prescribed `unknown` plus type
guards as the single route for external data, while typescript-rules already
permits bounded exceptions and a generated client that enforces its contract at
runtime. The fixed route both duplicated and contradicted the owning policy.

- frontend-ai-guide: state the anti-pattern and its avoidance as a guarantee
  criterion within this skill's own responsibility, without prescribing a route
  or depending on another progressively disclosed skill
- quality-fixer-frontend: defer external API response types to the preloaded
  typescript-rules policy and drop the duplicate React-specific entry

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The anti-pattern read "a type the code does not check or a contract does not
establish", which literally requires both backings and would flag an assertion
that one of them already guarantees.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@shinpr shinpr self-assigned this Sep 6, 2026
@shinpr
shinpr merged commit 6e67dd8 into main Sep 6, 2026
1 check passed
@shinpr
shinpr deleted the fix/frontend-type-safety-route branch September 6, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant