# Preflight

Webiny-only.

- Repository: https://github.com/webiny/webiny-js (8051 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add webiny/webiny-js --skill preflight -g -a claude-code -y`
Codex: `npx skills add webiny/webiny-js --skill preflight -g -a codex -y`
Cursor: `npx skills add webiny/webiny-js --skill preflight -g -a cursor -y`
Gemini CLI: `npx skills add webiny/webiny-js --skill preflight -g -a gemini-cli -y`

## Description

Webiny-only. Run all checks required before packages are ready for publish: deps, build, lint, format, tests.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Preflight

Webiny-only skill. Run all checks required before packages are ready for publish.

## Important

- Run steps in order.
- If any step fails, diagnose and fix the issue, then restart from step 1.
- Never run tests in parallel. Run each package sequentially.
- Before running tests for each package, count active test cases and shard at 32 tests per shard.
- To count active tests: `rg "^\s*(it|test|it\.each|test\.each)\s*\(" packages/<name>/__tests__ -t ts --count-matches | awk -F: '{s+=$2} END {print s}'`
- Calculate shards: `shards = ceil(count / 32)`. If shards is 1, no `--shard` flag needed.
- Suppress noisy output: redirect stdout to `/dev/null` or pipe through `tail` as needed.

## Steps

### 1. Install dependencies

```bash
yarn > /dev/null 2>&1
```

### 2. Generate `webiny` package

```bash
yarn webiny-scripts generate-webiny-package
```

### 3. Sync dependency versions

```bash
yarn webiny sync-dependencies
```

Verify `packages/cli/files/duplicates.json` is an empty array (`[]`). If it contains entries, there are duplicate dependency versions that must be resolved before continuing.

### 4. Generate tsconfig files

```bash
node scripts/generateTsConfigsInPackages.js
```

### 5. Check package node_modules

```bash
node scripts/checkPackageNodeModules.js
```

### 6. Verify package.json dependencies match source imports

```bash
yarn adio
```

Must output "All dependencies in order!" to pass.

### 7. Format code

```bash
yarn format:fix > /dev/null 2>&1
```

This auto-fixes formatting issues. No manual intervention needed.

### 8. Lint

```bash
yarn eslint
```

This only checks, it does not auto-fix. If eslint reports errors, fix them manually, then restart from step 1.

### 9. Full clean build

```bash
yarn build --no-cache 2>&1 | tail -10
```

### 10. Check dist paths

```bash
node scripts/checkDistPaths.js
```

Verifies no `src/` paths remain in built output.

### 11. Run DDB tests

The rest: https://github.com/webiny/webiny-js/blob/HEAD/.claude/skills/preflight/SKILL.md
