nasa_typescript_safety

NASA TypeScript Safety Protocol

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "nasa_typescript_safety" with this command: npx skills add cityfish91159/maihouses/cityfish91159-maihouses-nasa-typescript-safety

NASA TypeScript Safety Protocol

  1. Simple Control Flow
  • Rule: Avoid complex recursion. Use simple iteration.

  • Limit: functions should be perceivable on a single screen (approx 50-60 lines). If longer, Refactor.

  1. Strict Scope & Initialization
  • Rule: Variables must be declared in the smallest possible scope (const

let var ).

  • Initialization: Objects should be fully initialized. Avoid "build-up" patterns where properties are added later (forces consistent Shapes/Hidden Classes).
  1. The "No Magic" Rule (Type Safety)
  • Strict Ban: as unknown as Type . If you need this, your types are wrong.

  • Strict Ban: any . Use unknown with Type Guards if data is truly dynamic.

  • Validation: Input data (from API/User) MUST be validated (Zod) at the boundary. Never trust external input.

  1. Robust Error Handling
  • Rule: Check return values. Promises must be caught.

  • Crash Proof: Critical flows (Payment, Data Save) must have try/catch and recovery logic, not just "log and crash".

  1. Safety Checklist
  • Is the function small enough?

  • Did I remove all any uses?

  • Is there any unhandled Promise rejection?

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

code-review-excellence

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-simplifier

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-validator

No summary provided by upstream source.

Repository SourceNeeds Review