citec-typescript-contracts

Enforces strict TypeScript typing for data contracts, Astro props, and integration boundaries.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/TOBIASpuchito/Citec --skill citec-typescript-contracts-tobiaspuchito
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: citec-typescript-contracts
Source: https://github.com/TOBIASpuchito/Citec/tree/main/citec-frontend/.codex/skills/citec-typescript-contracts
Command: npx skills add https://github.com/TOBIASpuchito/Citec --skill citec-typescript-contracts-tobiaspuchito

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Frontend codebases often accumulate loose typing, any escapes, and unclear data boundaries that cause runtime errors and brittle integrations. This Skill provides a consistent set of rules for writing strict TypeScript contracts in the CITEC frontend so types, props, and data modules stay predictable. ## Core Features & Use Cases - Strict typing rules: Bans unjustified any, broad Record<string, unknown>, and non-null assertions, favoring narrow unions and explicit interfaces. - Framework conventions: Standardizes how to type Astro props with interface Props and Astro.props, and React props with named prop types near components. - Boundary ownership: Keeps data contracts in src/data, integration boundaries in src/lib, and pure utilities in src/utils. - Use Case: When adding a new partner directory page, use this Skill to define the partner and city types in src/data, type the Astro component props, and validate everything with bun run check. ## Quick Start Use the citec-typescript-contracts skill to review the TypeScript types and Astro props in my new events page for strictness and correct data boundaries.

Frequently Asked Questions about citec-typescript-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I type Astro component props in TypeScript?▼

Define an `interface Props` in the Astro component frontmatter and access values through `Astro.props`. This gives compile-time checking for every prop passed to the component and keeps prop contracts explicit.

How to enforce strict TypeScript types in a frontend codebase?▼

Use narrow unions and explicit interfaces instead of `any` or broad `Record<string, unknown>`, prefer `import type` for type-only imports, and avoid non-null assertions. Validate changes with a type check command such as `bun run check`.

Where should data contracts live in an Astro project?▼

Keep data contracts in a dedicated data layer such as `src/data` and integration boundaries in `src/lib`. UI components should consume typed data modules rather than importing service details directly.

When is using any acceptable in TypeScript?▼

Only when a boundary genuinely cannot be typed, and the reason must be documented locally in the code. In all other cases, prefer explicit interfaces, narrow unions, or domain-specific types.

Why avoid non-null assertions in TypeScript data flow?▼

Non-null assertions silence the compiler without resolving uncertainty, which can hide runtime failures when data is missing. Handle uncertain data with explicit checks, optional chaining, or refined types instead.