ts-maintain-reduce-repro

Comment créer des repos minimaux avec lesquels l'équipe TypeScript aime travailler

npx skills add https://github.com/microsoft/typescript-maintainer-skills --skill ts-maintain-reduce-repro

name: ts-maintain-reduce-repro description: How to make minimal repos that the TypeScript team enjoys working with

The user has launched you from a folder that contains a repro for a bug in tsc or tsgo

Greet the user

Welcome to the repro reduction assistant! I can help you with all kinds of things related to making a minimal repro for a bug in TypeScript. Let's get started!

Ask the user to describe the necessary preconditions for the bug. Offer a menu of:

What kind of bug do you have?

[ ] Crash or stack overflow [ ] Should have 0 errors but doesn't [ ] Should have non-zero errors but doesn't [ ] Language service problem [ ] Takes too long (more than 5s) [ ] (describe something else)

If this is a language service problem, you'll be using tsgo --lsp --stdio to work on the repo. Ask the user to describe which operation to perform in which file, and what they were expecting to happen vs what actually happened.

If it's not a language service problem, ask the user what command to invoke:

What commandline should I run to repro this? [ ] tsc [ ] tsgo [ ] (something else)

Ask the user

Should I make progress commits as I go?

[ ] Yes [ ] No

Ask the user to confirm that you're about to be destructive in this repo:

I will be extensively modifying code on disk to reduce this repro. Are you okay to proceed?

[ ] Let's go [ ] Run git switch -c minimal-repro before we start [ ] Wait, I changed my mind [ ] Something else

Once you understand the bug description, reproduce the problem to confirm you've understood it. If you can't reproduce the problem, ask the user for help.

I ran the provided command and I couldn't reproduce the problem. Can you help me understand how to reproduce it?

Once you've reproduced the problem, you now need to minimize it. Minimization is not minification, and it's not over-simplification. Things to look for:

  • Must reproduce the problem
  • Ideally one file (two files if the problem relates to module imports, you may need two files)
  • Always syntactically valid unless the bug specifically requires otherwise
  • Always semantically valid unless the bug specifically requires otherwise
  • Short and simple

"Short and simple" is a subjective measure. We are necessarily not trying to make the file as small as possibly, just as easy to understand as possible. For example, if a bug requires a loop,

// GOOD
while (true) {

is shorter and simpler than

// MID
for (let i = 0; i < n; i++) {

You would not change this to

// NO, BAD
for (;;) {

because, while this is fewer characters, it's not idiomatic in TypeScript and would imply that the bug is possibly specific to missing clauses in for loops.

Don't rename things to be overly short, but do rename them to be shorter while clarifying semantics. For example, if the starting repro is

type CustomerManagerOrderKeeper<T> = {
    cutomer: string;
    keeper: T;
    manager: ManagerManagerProvider;
    orderId: number
};

and you reduce it to

type CustomerManagerOrderKeeper<T> = {
    cutomer: string;
    keeper: T;
};

Then you should rename it to be a shorter semantic simplication of the original name:

type NamedBox<T> = {
    name: string;
    content: T;
};

The entire closure of files must be reduced (excluding the TypeScript standard library files). For example, even if you have a "two-line" repro

// BAD: Still lots of code in this import!
import { foo } from "some-giant-library";
foo.thisCausesProblems();

You don't have a minimal repro yet -- "some-giant-library" is still a giant surface area to investigate. Remember, the final repro must be self-contained, not relying on large portions of code (even if that code is external to the originating repo). When this happens, make a stub repro module and reduce it until you have a self-contained repro, e.g.:

// GOOD: Reduce dependencies to their minimum needed to show the issue

// some-giant-library-stub.d.ts
export function thisCausesProblems(): SomeProbemType;
type SomeProblemType = string

// entry-point.ts
import { foo } from "./some-giant-library-stub";
foo.thisCausesProblems();

Typical operations you should do:

  • Figure out which file is key to demonstrating the bug
  • Make this file as small as possible while still demonstrating the bug
  • Reduce the number of imports in this file by inlining definitions of imported symbols
  • Make a commit each time you simplify something while retaining the repro-ness of the bug
  • Lather, rinse, repeat
  • Once the file is self-contained, make a progress commit noting this then look for ways to make it even simpler
  • Simplify those inlined definitions
  • Repeat until you have a single file that is as simple as you can make it while still demonstrating the bug

For language service bugs, include comments that indicate to a human what operation should be performed where, and what was expected vs what actually happened.

Plus de skills de microsoft

oss-growth
microsoft
Persona de growth hacker OSS
agent-framework-azure-ai-py
microsoft
Créez des agents Azure AI Foundry à l’aide du SDK Python Microsoft Agent Framework (agent-framework-azure-ai). À utiliser lors de la création d’agents persistants avec AzureAIAgentsProvider, de l’utilisation d’outils hébergés (interpréteur de code, recherche de fichiers, recherche web), de l’intégration de serveurs MCP, de la gestion de fils de conversation ou de l’implémentation de réponses en streaming. Couvre les outils de fonction, les sorties structurées et les agents multi-outils.
development
airunway-aks-setup
microsoft
Configurez AI Runway sur AKS — du cluster nu au modèle en cours d'exécution. Couvre la vérification du cluster, l'installation du contrôleur, l'évaluation GPU, la configuration du fournisseur et le premier déploiement. QUAND : « configurer AI Runway », « intégrer un cluster AKS », « installer AI Runway », « configuration airunway », « déployer un modèle sur AKS », « inférence GPU sur AKS », « configuration KAITO sur AKS », « exécuter LLM sur AKS », « vLLM sur AKS », « configurer le service de modèles sur AKS », « contrôleur AI Runway ».
devops
appinsights-instrumentation
microsoft
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
devops
applicationinsights-web-ts
microsoft
Instrumentez les applications navigateur/web avec le SDK JavaScript Application Insights (@microsoft/applicationinsights-web). Utilisez-le pour la surveillance des utilisateurs réels (RUM) — vues de page, clics, dépendances AJAX/fetch, exceptions, événements personnalisés et traces d’agents GenAI côté navigateur corrélées aux traces OpenTelemetry backend. Couvre le script de chargement du SDK et la configuration npm, les extensions de framework (React, React Native, Angular), Click Analytics, les initialiseurs de télémétrie et les conventions sémantiques OTel GenAI pour les spans d’agents/outils/modèles émises depuis le navigateur.
devops
azure-ai-anomalydetector-java
microsoft
Créez des applications de détection d'anomalies avec le SDK Azure AI Anomaly Detector pour Java. Utilisez-le lors de l'implémentation de la détection d'anomalies univariées/multivariées, de l'analyse de séries temporelles ou de la surveillance basée sur l'IA.
development
azure-ai-language-conversations-py
microsoft
Implémentez la compréhension du langage conversationnel (CLU) à l’aide du SDK Python azure-ai-language-conversations. Utilisez-le lorsque vous travaillez avec ConversationAnalysisClient pour analyser l’intention et les entités d’une conversation, créer des fonctionnalités de NLP ou intégrer la compréhension du langage dans des applications.
development
azure-ai-ml-py
microsoft
SDK v2 d’Azure Machine Learning pour Python. Utiliser pour les espaces de travail ML, les tâches, les modèles, les jeux de données, le calcul et les pipelines. Déclencheurs : « azure-ai-ml », « MLClient », « espace de travail », « registre de modèles », « tâches d’entraînement », « jeux de données ».
development