You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/ably-codebase-review/SKILL.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,14 +154,21 @@ Launch these agents **in parallel**. Each agent gets a focused mandate and uses
154
154
155
155
**Method (grep/glob — text patterns and file matching):**
156
156
1. **Glob** for each command in `src/commands/` and check if a corresponding test file exists at `test/unit/commands/`
157
-
2. **Grep** for `describe(` in test files to check for required describe blocks: `help`, `argument validation`, `functionality`, `flags`, `error handling`
158
-
3. **Grep** for `--duration` in subscribe test files
157
+
2. **Grep** for `describe(` in test files to check for the 5 required describe blocks with EXACT standard names:
158
+
- `describe("help"` — required in every test file
159
+
- `describe("argument validation"` — required (test required args OR unknown flag rejection)
Flag non-standard variants: `"command arguments and flags"`, `"command flags"`, `"flag options"`, `"parameter validation"`.
164
+
Exception: `interactive.test.ts`, `interactive-sigint.test.ts`, and `bench/*.test.ts` are exempt.
165
+
3. **Grep** for `--duration` in unit test `runCommand()` args — should NOT be present (env var handles it). Exceptions: `test:wait` tests, `interactive-sigint` tests, help output checks.
159
166
4. **Grep** for `getMockAblyRealtime`, `getMockAblyRest`, `getMockConfigManager` in test files to verify correct mock usage per command type
160
167
5. **Grep** for `--api-key`, `--token`, `--access-token` in unit test files — these should not use CLI auth flags
161
168
162
169
**Reasoning guidance:**
163
170
- Missing test files are deviations but may be documented as known gaps
164
-
- Missing describe blocks in existing tests are deviations but may be lower priority
171
+
- Missing describe blocks or non-standard block names are deviations that should be flagged
165
172
- Subscribe tests that auto-exit via mocked callbacks (without `--duration`) may be acceptable
Test files go at `test/unit/commands/<path-matching-command>.test.ts`.
4
4
5
+
> **Note:** Do NOT pass `--duration` to `runCommand()` in unit/integration tests. `vitest.config.ts` sets `ABLY_CLI_DEFAULT_DURATION: "0.25"` which makes subscribe commands auto-exit after 250ms. Adding `--duration` overrides this with a slower value.
6
+
5
7
## Table of Contents
6
8
-[Product API Test (Realtime Mock)](#product-api-test-realtime-mock)
7
9
-[Product API Test (REST Mock)](#product-api-test-rest-mock)
1.`help` — verify `--help` shows USAGE, key flags, and EXAMPLES
271
-
2.`argument validation` — verify required args produce errors when missing
272
-
3.`functionality` — core behavior tests
273
-
4.`flags` — verify key flags are accepted and configured
274
-
5.`error handling` — API errors, invalid input
359
+
Every test file MUST include all 5 of these describe blocks (exact names — no variants):
360
+
361
+
1.**`help`** — verify `--help` shows USAGE, key flags, and EXAMPLES
362
+
2.**`argument validation`** — verify required args produce errors when missing. For commands with no required args, test that unknown flags are rejected.
363
+
3.**`functionality`** — core happy-path behavior tests. This is where the main command logic is tested.
364
+
4.**`flags`** — verify key flags are accepted and configured (check help output contains flag names, test flag behavior)
365
+
5.**`error handling`** — API errors, invalid input, network failures
366
+
367
+
### Block naming rules
368
+
- Use EXACTLY these names: `"help"`, `"argument validation"`, `"functionality"`, `"flags"`, `"error handling"`
369
+
- Do NOT use variants like `"command arguments and flags"`, `"command flags"`, `"flag options"`, `"parameter validation"`, or domain-specific names like `"subscription behavior"`
370
+
- Additional describe blocks beyond the 5 required ones are fine (e.g., `"JSON output"`, `"cleanup behavior"`)
371
+
372
+
### What goes in each block
373
+
374
+
**`argument validation`** for commands WITH required args:
Flag any non-standard variants: `"command arguments and flags"`, `"command flags"`, `"flag options"`, `"parameter validation"`. These must use the exact standard names above.
131
+
Exception: `interactive.test.ts`, `interactive-sigint.test.ts`, and `bench/*.test.ts` are exempt (REPL/benchmark tests, not command tests).
125
132
2. **Grep** for `getMockAblyRealtime`, `getMockAblyRest`, `getMockConfigManager` to verify correct mock usage
126
-
3. **Grep** for `--duration` in subscribe test files
133
+
3. **Grep** for `--duration` in unit test `runCommand()` args — should NOT be present (env var handles it). Exceptions: `test:wait` tests, `interactive-sigint` tests, help output checks.
127
134
4. **Grep** for `--api-key`, `--token`, `--access-token` — unit tests should not use CLI auth flags
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ All code changes, whether features or bug fixes, **MUST** follow the mandatory w
8
8
9
9
In summary, this involves:
10
10
11
-
1.**Build:** Run `pnpm prepare` to compile, update manifests, and update the README.
11
+
1.**Build:** Run `pnpm prepare` to compile and update manifests, then `pnpm exec oclif readme` to regenerate the README.
12
12
2.**Lint:** Run `pnpm exec eslint .` and fix all errors/warnings.
13
-
3.**Test:** Run relevant tests (`pnpm test:unit`, `pnpm test:integration`, `pnpm test:e2e`, `pnpm test:playwright`, or specific files) and ensure they pass. Add new tests or update existing ones as needed.
13
+
3.**Test:** Run relevant tests (`pnpm test:unit`, `pnpm test:integration`, `pnpm test:e2e`, `pnpm test:playwright`, or specific files) and ensure they pass. For interactive mode changes, also run `pnpm run test:tty` (requires a real terminal, not run in CI). Add new tests or update existing ones as needed.
14
14
4.**Document:** Update all relevant documentation (`docs/`, `AGENTS.md`, `README.md`) to reflect your changes.
15
15
16
16
**Pull requests will not be merged unless all these steps are completed and verified.**
0 commit comments