Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .claude/skills/ably-codebase-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,26 @@ Launch these agents **in parallel**. Each agent gets a focused mandate and uses

**Method (grep/glob — text patterns and file matching):**
1. **Glob** for each command in `src/commands/` and check if a corresponding test file exists at `test/unit/commands/`
2. **Grep** for `describe(` in test files to check for required describe blocks: `help`, `argument validation`, `functionality`, `flags`, `error handling`
3. **Grep** for `--duration` in subscribe test files
2. **Grep** for `describe(` in test files to check for the 5 required describe blocks with EXACT standard names:
- `describe("help"` — required in every test file
- `describe("argument validation"` — required (test required args OR unknown flag rejection)
- `describe("functionality"` — required (core happy-path tests)
- `describe("flags"` — required (verify flags exist and work)
- `describe("error handling"` — required (API errors, network failures)
Flag non-standard variants: `"command arguments and flags"`, `"command flags"`, `"flag options"`, `"parameter validation"`.
Exception: `interactive.test.ts`, `interactive-sigint.test.ts`, and `bench/*.test.ts` are exempt.
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.
4. **Grep** for `getMockAblyRealtime`, `getMockAblyRest`, `getMockConfigManager` in test files to verify correct mock usage per command type
5. **Grep** for `--api-key`, `--token`, `--access-token` in unit test files — these should not use CLI auth flags
6. **Check** for use of shared test helpers where applicable:
- Control API tests should use `nockControl()`, `getControlApiContext()`, `controlApiCleanup()` from `test/helpers/control-api-test-helpers.ts` instead of manual nock setup
- Control API tests should use mock factories (`mockApp()`, `mockKey()`, `mockRule()`, `mockQueue()`, `mockNamespace()`, `mockStats()`) from `test/fixtures/control-api.ts` instead of duplicating inline response objects
- Tests with boilerplate help/arg-validation/flags blocks should use `standardHelpTests()`, `standardArgValidationTests()`, `standardFlagTests()` from `test/helpers/standard-tests.ts`
- Control API error handling blocks should use `standardControlApiErrorTests()` from `test/helpers/standard-tests.ts` for 401/500/network error tests

**Reasoning guidance:**
- Missing test files are deviations but may be documented as known gaps
- Missing describe blocks in existing tests are deviations but may be lower priority
- Missing describe blocks or non-standard block names are deviations that should be flagged
- Subscribe tests that auto-exit via mocked callbacks (without `--duration`) may be acceptable

### Agent 7: Lifecycle & Convention Sweep
Expand Down
9 changes: 7 additions & 2 deletions .claude/skills/ably-new-command/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ If the new command shouldn't be available in the web CLI, add it to the appropri

After creating command and test files, always run:
```bash
pnpm prepare # Build + update manifest/README
pnpm prepare # Build + update manifest
pnpm exec oclif readme # Regenerate README.md from command metadata
pnpm exec eslint . # Lint (must be 0 errors)
pnpm test:unit # Run tests
```
Expand Down Expand Up @@ -395,6 +396,10 @@ See the "Keeping Skills Up to Date" section in `CLAUDE.md` for the full list of
- [ ] Test file at matching path under `test/unit/commands/`
- [ ] Tests use correct mock helper (`getMockAblyRealtime`, `getMockAblyRest`, `nock`)
- [ ] Tests don't pass auth flags — `MockConfigManager` handles auth
- [ ] Subscribe tests use `--duration` flag to auto-exit
- [ ] Subscribe tests auto-exit via env var (ABLY_CLI_DEFAULT_DURATION: "0.25" in vitest.config.ts) — do NOT pass --duration to runCommand()
- [ ] Tests use `standardHelpTests()`, `standardArgValidationTests()`, `standardFlagTests()` from `test/helpers/standard-tests.ts`
- [ ] Control API tests use `nockControl()`, `controlApiCleanup()` from `test/helpers/control-api-test-helpers.ts`
- [ ] Control API tests use `standardControlApiErrorTests()` for 401/500/network error tests in the `describe("error handling", ...)` block
- [ ] Control API response bodies use `mockApp()`, `mockKey()`, `mockRule()`, `mockQueue()`, `mockNamespace()`, `mockStats()` from `test/fixtures/control-api.ts` where applicable
- [ ] Index file created if new topic/subtopic
- [ ] `pnpm prepare && pnpm exec eslint . && pnpm test:unit` passes
Loading
Loading