Setup TypeScript Gitignore

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Create or refresh the root .gitignore for a TypeScript/npm project, mirroring `iru-setup-java-gitignore’s contract for the npm ecosystem — never overwriting an existing file without showing the user exactly what would change and getting explicit approval first.

Purpose

iru-setup-typescript-gitignore composes a TypeScript-appropriate .gitignore: a universal base (node_modules/, build/output directories, test/coverage output, TypeScript incremental-build info, lint caches, env files, OS/editor noise) plus conditionally-detected sections for whichever package manager, frontend framework, and documentation tooling are actually present in the target repository — pnpm/Yarn debug logs, Angular, React/Vite (and Storybook), NestJS (logs, runtime and diagnostic files, test reports), Next.js (.next/, next-env.d.ts, .vercel, matching create-next-app), a Prisma client generated inside the source tree (the path is read from schema.prisma; migrations are never ignored), the repository-wide .integration-test.lock/ used by the NestJS/Next.js/React Native coding and e2e skills, React Native (Expo, or a bare Metro/React Native CLI app — Gradle, Xcode, CocoaPods and Bundler outputs, signing material, and keeping the template’s committed debug.keystore; paths are prefixed with the app subdirectory when the app does not live at the root), Ionic/Capacitor, Playwright, the UI tests' .ui-screenshots/ capture directory (every UI project — React, Angular, Ionic, Next.js, React Native, Hilla; the catalog’s UI contract), Turborepo, Istanbul/nyc, Antora docs build output, TypeDoc/Compodoc API docs, and a Spring Boot + Vaadin Hilla frontend embedded in a Maven project. It never invents entries for things that aren’t actually present. If .gitignore already exists, it is treated as sensitive: the skill announces it is updating rather than creating from scratch, reads it, composes a merged draft (hand-added lines kept) and a template-only draft, and shows the user a diff, then asks Update / Keep as is / Replace before writing anything.

Plugin

Shipped by the iru-typescript plugin of the ai-catalog marketplace (install with /plugin install iru-typescript@ai-catalog; see Plugins).

Invocation

/iru-setup-typescript-gitignore

Optionally with an args line (key: value) for scripted runs:

/iru-setup-typescript-gitignore
args:
on-existing: update

Inputs

Argument Required Description Default

on-existing

No

How to treat an existing .gitignore in scripted runs: ask, keep, update or replace. Orchestrators forward it only if their own args received it. Any other key (e.g. mode) is ignored; mode: existing alone does not skip the Update / Keep / Replace question.

ask

Everything else is derived by exploring the target repository directly (package.json’s `packageManager field and lockfile, angular.json, vite.config., .storybook/, nest-cli.json, next.config., prisma/schema.prisma, app.json with an "expo" key, metro.config.js, capacitor.config., playwright.config., turbo.json, .nycrc, docs/antora.yml / docs/antora-playbook.yml, typedoc.json, and a pom.xml depending on hilla-spring-boot-starter / com.vaadin:hilla or a src/main/frontend/ directory).

Outputs

  • A .gitignore file at the repository root — newly created, updated (merged), replaced, or left untouched.

  • If .gitignore didn’t previously exist: the run is announced as "from scratch" and the file is written directly, no approval step needed.

  • If .gitignore already existed: the run is announced as "updating existing", and a diff of the merged draft is shown first (via git diff --no-index). The user is asked Update (merged draft; hand-added lines kept), Keep as is (nothing written) or Replace (template-only draft; the hand-added lines that would be lost are listed) — or on-existing answers it. If the merged draft is identical to the current file, the question is skipped and the outcome is "kept as is".

  • A closing report naming which conditional sections (package manager, Angular, React/Vite, NestJS, Next.js, Prisma client, integration-test lock, React Native (Expo or Metro), Ionic/Capacitor, Playwright, Turborepo, nyc, Antora, TypeDoc/Compodoc, Hilla) were included versus skipped and why, the action taken (created / updated / replaced / kept as is, and whether it came from the user or on-existing), which hand-added lines were preserved or dropped, plus warnings that detection is heuristic and that already-tracked files under a newly-ignored directory need a manual git rm -r --cached.

Execution flow

flowchart TD A[Start /iru-setup-typescript-gitignore] --> A0["Step 0: parse args\n(on-existing)"] A0 --> B{".gitignore already\nexists at root?"} B -- no --> B1["Announce: creating\nfrom scratch"] B1 --> C["Compose universal base template\n(node_modules, dist/build/out, coverage,\ntsbuildinfo, eslintcache, env files, OS/IDE noise)"] B -- yes --> D["Announce: updating existing;\nread existing content"] D --> D1{"on-existing: keep?"} D1 -- yes --> M D1 -- no --> C C --> E{"Tracked files already\nunder dist/build/out?"} E -- yes --> F["Ask user: keep ignoring\nor drop from template"] E -- no --> G["Detect project-specific additions:\npackage manager, Angular, React/Vite,\nNestJS, Next.js, Prisma client, test lock,\nReact Native (Expo or Metro),\nIonic/Capacitor, Playwright, Turborepo, nyc,\nAntora, TypeDoc/Compodoc, Hilla"] F --> G G --> H["Compose merged draft and\ntemplate-only draft"] H --> I{"Did .gitignore\nalready exist?"} I -- no --> J["Write .gitignore directly"] I -- yes --> K["Show diff of merged draft;\nask Update / Keep as is / Replace\n(or apply on-existing)"] K -- Update --> J K -- Replace --> J2["Write template-only draft"] K -- Keep as is --> L["Leave existing .gitignore untouched"] J2 --> M J --> M[Report] L --> M

Dependencies

Invokes

None — iru-setup-typescript-gitignore is a leaf skill; it does not call any other skill in this catalog.

Invoked by

None — this skill does not delegate any part of its work to a built-in agent.

Source

SKILL.md on GitHub — the file this page was generated from.