Agent skill

Enforce Rules For Typescript

by moeru-ai in moeru-ai/airi

Enforce AIRI's TypeScript and Vue source rules for imports, naming, comments, JSDoc, fallbacks, stateful and protocol code, and module design.

MITAuto-check passedDevelopment

Install Enforce Rules For Typescript

skills CLI
$ npx skills add moeru-ai/airi --skill enforce-rules-for-typescript -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install moeru-ai/airi enforce-rules-for-typescript --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/moeru-ai/airi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/enforce-rules-for-typescript .claude/skills/enforce-rules-for-typescript && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
enforce-rules-for-typescript
GitHub stars
50k
Token cost
~3.4k tokens
SKILL.md length
1,901 words
Files
2
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Enforce AIRI's TypeScript and Vue source rules for imports, naming, comments, JSDoc, fallbacks, stateful and protocol code, and module design.

  • Reviewing TypeScript
  • SKILL.md covers Imports and Types, Naming, Comments and JSDoc, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Vue source code in the AIRI monorepo

What it does

Enforce Rules For Typescript is an agent skill from moeru-ai/airi. Enforce AIRI's TypeScript and Vue source rules for imports, naming, comments, JSDoc, fallbacks, stateful and protocol code, and module design. Use when writing, refactoring, or reviewing TypeScript or Vue source code in the AIRI monorepo.

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Development, covering Technical documentation, Monorepo tooling and Refactoring. It works with TypeScript and Vue.js. The repository describes itself as: 💖🧸 Self hosted, you-owned Grok Companion, a container of souls of waifu, cyber livings to bring them into our worlds, wishing to achieve Neuro-sama's altitude. Capable of… The licence is MIT.

When your agent uses it

  • Reviewing TypeScript
  • Vue source code in the AIRI monorepo

Example prompts

  • “/enforce-rules-for-typescript”

What it can do on your machine

Read from SKILL.md and the folder at commit 0327dc8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Enforce Rules For Typescript loads about 3.4k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 1,901 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from moeru-ai/airi at commit 0327dc8, republished under its MIT licence (© moeru-ai). 1,901 words, ~3,378 tokens.

Download SKILL.mdSave it as .claude/skills/enforce-rules-for-typescript/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
enforce-rules-for-typescript
description
Enforce AIRI's TypeScript and Vue source rules for imports, naming, comments, JSDoc, fallbacks, stateful and protocol code, and module design. Use when writing, refactoring, or reviewing TypeScript or Vue source code in the AIRI monorepo.

Enforce AIRI TypeScript Rules

Apply these rules to every TypeScript and Vue source change in AIRI. The root AGENTS.md gives the core code rules. This skill gives the detailed rules.

Imports and Types

  • Import types from the module or package that owns the contract. Do not redeclare an external or public contract locally to use a narrower subset.
  • Do not route type imports through local runtime assembly modules when the original side-effect-free type source is available.
  • If Node-only and browser-only types mix in one import chain, move the type declarations into a neutral type file. Keep the runtime modules environment-specific.
  • Do not import values from a module that has side effects only to get its types.
  • If a wrong or missing export causes an error, trace the full import chain and side-effect chain first. Fix the package exports or the owning boundary. Do not add a local workaround import at the leaf.
  • Before you fix an import or type error, examine the compilation behavior and the type declarations. Also examine the exports field in package.json, and the browser and Node entry points of the dependency.
  • Keep JSON Schemas compliant with providers. Give an explicit type: object and the required fields. Do not use unbounded records.

Naming

  • Let module boundaries provide context. Do not repeat package, product, protocol, or transport names in symbols. The exception is a symbol that crosses a boundary where that context is otherwise lost.
  • Name functions after domain operations, not implementation layers.
  • Use nouns for resolved domain concepts. Use verbs for transformations and side effects.
  • If a symbol needs several ownership qualifiers to be clear, reconsider the module boundary or introduce a clearer domain concept.

Comments

  • Write a comment only for information that the code cannot express clearly: intent, constraints, ownership, invariants, precedence, lifecycle, ordering, side effects, protocol shape, or non-obvious fallbacks.
  • Do not add comments that only restate names, types, or visible operations.
  • Treat a contract comment as an explanation of the relationship between a producer and its consumers.
  • Explain why a value exists in the system before you explain how the code represents it.
  • Describe the decision, behavior, or invariant that a value controls.
  • If different values select different control-flow or UI paths, describe each observable outcome.
  • If a value crosses a module or component boundary, identify the consumer and how it applies the value.
  • Put representation details after behavior: units, coordinate systems, thresholds, clamps, and source API fields.
  • Put background evidence after the contract: browser behavior, issue links, investigation history, and removal conditions.
  • If the name, type, and surrounding code express the full contract, omit the comment.
  • Put an implementation comment next to the branch, calculation, transition, or side effect that it explains.
  • In calculation-heavy code, explain non-obvious coordinate systems, units, conversions, clamps, rounding, aggregation, and precedence. Put each explanation next to the related intermediate value or branch.
  • Prefer clearer names, types, and structured state over comments that compensate for hidden or encoded concepts.
  • When you move code, keep the accurate comments. Remove the comments that no longer describe current behavior.
  • Write an investigation-heavy comment as short paragraphs. When useful, give the context and the observed failure. Then give the reason that the obvious fix is not sufficient. Give the chosen fix and its removal condition or references.
  • Use these markers:
    • // TODO: for follow-up work.
    • // REVIEW: for a concern that needs another opinion.
    • // NOTICE: for workarounds, magic values, external constraints, and other important non-obvious context. The root AGENTS.md gives the required format for a workaround.

JSDoc

  • Use JSDoc for public APIs, package-level exports, shared architectural boundaries, and non-trivial exported functions, classes, and types.

  • In JSDoc, document only the contract details that the signature cannot express: assumptions, side effects, lifecycle, and return guarantees.

  • Do not export a helper only to satisfy tests or documentation rules. Keep implementation helpers private unless production code reuses them.

  • Do not add JSDoc to trivial helpers, local projections, or pass-through functions.

  • Do not use fixed section templates that restate names and signatures. Prefer precise names and branch-local comments for implementation details.

  • For exported test helpers or non-obvious reusable test fixtures, add @example when it clarifies the intended usage.

  • Do not attach JSDoc or @example blocks to ordinary describe, it, or expect* calls.

  • For exported interfaces and type aliases, keep the top-level JSDoc on what the type represents. Put detailed semantics on the related fields.

  • Document generic parameters with @param. Add @default to every option that has a default value.

  • Give each runner and CLI entry point /** ... */ JSDoc with a clear ASCII call-stack diagram. Use {@link ...} references where applicable.

  • For a server orchestrator, add a call-stack diagram only when it clarifies a stable architecture boundary. Do not add diagrams to shallow glue code.

  • Use this format for the call-stack section:

    ts
    /**
     * ...
     *
     * Call stack:
     *
     * collectEvalEntries (../runner)
     *   -> {@link createRunnerSchedule}
     *     -> {@link createMatrixCombinations}
     *       -> {@link VievalScheduledTask}[]
     */
  • Give /** ... */ JSDoc with an @example to each exported normalizer, shared normalizer, and non-obvious local normalizer. This applies to normalizers of outputs, formats, file names, and values. It does not apply to config default normalization.

  • In the example, show a representative input and output. Use this format:

    ts
    /**
     * Normalizes <target>.
     *
     * @example
     * normalizeTarget('ExampleInput')
     * // => 'example-output'
     */

Fallbacks and Precedence

  • If a fallback chain has more than two sources, make the precedence explicit.
  • Some fallback sources represent different schema versions, compatibility behavior, specificity levels, or user and system overrides. For these sources, explain why each non-primary branch exists and why it has that priority.
  • Do not use nested ternaries for a fallback chain when any branch is non-obvious. Use named intermediate variables or if / else if blocks, so that each comment can be next to its branch.
  • Do not use a new object or array as a casual fallback. Expressions such as value ?? {}, value ?? [], value || {}, and value || [] create a new reference each time.
  • Never use an inline object or array fallback in a reactive getter, computed value, watcher source, or Pinia state projection. New references can cause false changes, watcher loops, and state broadcasts.
  • If an immutable empty fallback is valid, reuse a stable module-level value. If consumers must not mutate the value, freeze it.
  • Use ?? only when null and undefined mean that a value is missing. Use || only when false, 0, and an empty string must also select the fallback.
  • In non-trivial domain or protocol code, a fallback can return an empty string, stale value, cached value, default value, or ignored result. At that return or branch site, explain why the fallback is safe.
  • The root AGENTS.md gives the rules for backward-compatibility fallbacks.
Show full SKILL.md (839 more words)Show less

Stateful and Protocol Code

  • Some code implements a protocol, state machine, lifecycle, cache, request and response flow, event routing, watcher, session, cookie, or cleanup sequence. Document the state model of this code near the implementation.
  • Distinguish these kinds of state in names or nearby comments: persisted configuration, discovered filesystem state, runtime-loaded state, cache state, session or cookie state, watcher state, and external side effects.
  • Some methods look like state transitions, such as setEnabled, load, unload, dispose, start, stop, or refresh. If the owning type or module does not make it obvious, make clear which state each of these methods changes.
  • When you match events or responses, document the correlation keys and isolation rules. Examples are requestId, sessionId, ownerExtensionId, bindingId, the route namespace, and the source window.
  • Make each ignored event understandable in its event handler. A handler can ignore an event because of a route mismatch, owner mismatch, stale request ID, disposed lifecycle, or wrong source. Show that reason in code or in a named predicate.
  • For a request and response flow, define or name the envelope shape near the producer and the consumer.
  • Document what happens to pending requests on timeout, close, unload, dispose, and publish failure.
  • When cleanup spans multiple owners, keep the order visible. Explain why the order is important.
  • When you return a snapshot, fallback value, stale value, or cached value, document its freshness at the return site.
  • For watchers, event listeners, and async background work, make ownership and shutdown behavior explicit. Tell what starts and stops the work, and whether duplicate starts are allowed. Tell what happens to in-flight work during unload or dispose.

Module Design

  • Prefer deep modules over shallow modules. A module must hide a meaningful decision: policy, persistence boundary, protocol or schema contract, scheduling semantics, model prompt contract, domain invariant, or lifecycle concern.
  • Do not split code by execution order alone. A module boundary must represent a stable responsibility that a reader can understand without all of the sibling files.
  • Keep cohesive domain flows together until there is proven pressure to split them. A cohesive module of 200 to 400 lines is better than several shallow modules that pass the same context or options to each other.
  • Split a module only when the new module owns a distinct responsibility. Do not split a file only to reduce nesting or line count, or to create a test seam.
  • Do not divide a module into sections with separators such as ========. Use cohesive groups of private helpers.
  • Before you create a new createXService or XDependencies, make sure that X adds value. Value means policy, validation, state, retry or error handling, an IO boundary, or a reusable abstraction. If X adds no value, keep it as a private helper or inline it.
  • Do not create a pass-through service such as createXService({ yService }) when X adds no policy, validation, state, or abstraction.
  • Keep special cases near the branch that they affect.
  • Some helpers manipulate encoded keys, ownership, filesystem paths, routes, or protocol-shaped data. Make the invariant of such a helper explicit in its structure, name, or nearby documentation.
  • Keep reusable domain contracts and rendering or building logic in the package that owns the domain. Runtime entry points wire dependencies and call those boundaries. They do not inline large reusable contracts.
  • Keep runtime entry points lean. Move heavy logic into services or modules.
  • Prefer early returns, and keep functions simple. Limit nesting when it improves readability. Do not add pass-through helpers or shallow modules only to reduce indentation.
  • The root AGENTS.md gives the rules for classes and dependency injection.

Constants, Options, and Tables

  • Do not move everything into constants. Keep a constant that is used one or two times near its usage. Usually, put it near the top of the file, after the imports. Add a /** ... */ comment that tells why the constant exists.
  • For configurable options with defaults, prefer the merge functions of @moeru/std. When possible, define the defaults as a documented object, not as separate standalone constants.
  • For retry, backoff, and limit values, do not use one standalone constant for all of them.
  • Do not use table-driven style too much. In many cases, keep the table array inline and map it directly with .map(...).

OS, Process, and Paths

  • For non-obvious OS, exec, process, argument, networking, file, or directory handling, explain the constraint or purpose near the code.
  • Do not hardcode Unix, macOS, or Windows path literals. Use path-safe array arguments and cross-platform handling.

Readability Refactors

  • A readability-only change must keep the runtime behavior. If the behavior changes, add focused tests and document the contract change.

Review Checklist

When you review a complex TypeScript module, examine these points:

  • Can a reader identify owned state, external side effects, lifecycle transitions, cleanup, and freshness without tracing several neighboring files?
  • Are protocol envelopes, correlation keys, isolation rules, and fallback precedence explicit at their decision points?
  • Do module and helper boundaries hide meaningful policy, or do they only forward context or hide special cases?
  • Do comments explain non-obvious decisions next to the related code, without restating names, types, or visible operations?

© moeru-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/enforce-rules-for-typescript of moeru-ai/airi.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 0327dc8

Compare with similar skills

Enforce Rules For Typescript next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Enforce Rules For Typescript compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Enforce Rules For Typescript this skillmoeru-ai/airi50k—~3.4kAutomated safety check: PassMIT
Pnpm Engineteambit/bit18k—~1.9kAutomated safety check: PassCustom licence
Add Packageremix-run/remix33k—~2kAutomated safety check: PassMIT
Code Guidelinesgetsentry/sentry-react-native1.8k—~3.2kAutomated safety check: PassMIT
Vue Best Practicesoyjt/uniapp-vue3-template6273 repos~667Automated safety check: PassMIT
Qovery Console StandardsQovery/console227—~924Automated safety check: PassMIT

Similar skills

  • Pnpm Engine

    teambit/bit

    Work on the pnpm Rust engine (@pnpm/napi, the pacquet crates) that bit install runs through.

    18k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Add Package

    remix-run/remix

    Create or align a package in the Remix monorepo to match existing package conventions.

    33k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Guidelines

    getsentry/sentry-react-native

    Official

    Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review.

    1.8k GitHub stars~3.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Vue Best Practices

    oyjt/uniapp-vue3-template

    Vue 3 and Vue.js best practices for TypeScript, vue-tsc, and Volar.

    627 GitHub starsUsed in 3 repos~667 tokens
    DevelopmentAuto-check passed
  • Qovery Console coding standards, architecture guidelines, naming conventions, testing practices, and development workflows.

    227 GitHub stars~924 tokensUpdated today
    DevelopmentAuto-check passed
  • Adk Readme Writer

    BrainDAO/adk-ts

    ADK-TS README specialist. An agent skill from BrainDAO/adk-ts.

    119 GitHub stars~2.6k tokensUpdated 3 mo ago
    DevelopmentAuto-check: notes

More from moeru-ai/airi

All 24 skills in this repo
  • Simple English

    moeru-ai/airi

    Write or rewrite technical text with the rules of ASD-STE100 Simplified Technical English so it is clear, unambiguous, and free of AI slop.

    50k GitHub starsUsed in 2 repos~4.6k tokens
    Auto-check passed
  • Review pending AIRI translations on Crowdin in a batch, then sync them into the repository.

    50k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Upload a local image or file to GitHub's user-attachments storage and return a URL suitable for issue, pull request, discussion, or comment Markdown.

    50k GitHub stars~554 tokensUpdated today
    Auto-check passed
  • Create PR

    moeru-ai/airi

    Prepare and create an AIRI pull request with verifiable change context, architecture evidence, and required visual evidence.

    50k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Test AIRI display-model imports with agent-browser across stage-tamagotchi Electron, stage-web, and stage-pocket mobile web layouts.

    50k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when Codex needs to inspect, debug, or automate an Electron app through agent-browser and Chrome DevTools Protocol, especially when the app has multiple BrowserWindow…

    50k GitHub stars~3.1k tokensUpdated today
    Auto-check passed

Categories

Questions about Enforce Rules For Typescript

What does Enforce Rules For Typescript do?

Enforce AIRI's TypeScript and Vue source rules for imports, naming, comments, JSDoc, fallbacks, stateful and protocol code, and module design. Enforce Rules For Typescript is an agent skill from moeru-ai/airi. Enforce AIRI's TypeScript and Vue source rules for imports, naming, comments, JSDoc, fallbacks, stateful and protocol code, and module design.

When should I use Enforce Rules For Typescript?

Enforce Rules For Typescript fits situations like: reviewing TypeScript; vue source code in the AIRI monorepo.

How do I install Enforce Rules For Typescript in Claude Code?

Run `npx skills add moeru-ai/airi --skill enforce-rules-for-typescript -a claude-code`. Or copy the skill folder (.agents/skills/enforce-rules-for-typescript in moeru-ai/airi) into .claude/skills/enforce-rules-for-typescript in your project. Claude Code loads it when a task matches its description.

How do I install Enforce Rules For Typescript in Codex?

Run `npx skills add moeru-ai/airi --skill enforce-rules-for-typescript -a codex`. Or copy the skill folder (.agents/skills/enforce-rules-for-typescript in moeru-ai/airi) into .agents/skills/enforce-rules-for-typescript in your project. Codex loads it when a task matches its description.

Can I use Enforce Rules For Typescript in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add moeru-ai/airi --skill enforce-rules-for-typescript -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/enforce-rules-for-typescript, .gemini/skills/enforce-rules-for-typescript, .github/skills/enforce-rules-for-typescript and .opencode/skills/enforce-rules-for-typescript in your project.

What does Enforce Rules For Typescript need to run?

SKILL.md names no scripts, command-line tools or credentials: Enforce Rules For Typescript is instructions for the agent only.

Does Enforce Rules For Typescript access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Enforce Rules For Typescript safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Enforce Rules For Typescript use?

Enforce Rules For Typescript is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Enforce Rules For Typescript use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Enforce Rules For Typescript?

Skills that share tags, products or a category with Enforce Rules For Typescript: Pnpm Engine (teambit/bit, 18k stars), Add Package (remix-run/remix, 33k stars), Code Guidelines (getsentry/sentry-react-native, 1.8k stars) and Vue Best Practices (oyjt/uniapp-vue3-template, 627 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Enforce Rules For Typescript?

moeru-ai (a GitHub organization) maintains it in moeru-ai/airi, which has 50,204 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 9, 2026.

Source: moeru-ai/airi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.