4.3 KiB
4.3 KiB
Tasks — add @suaveplan/slack-client
Every checkbox MUST reflect work actually done in this change. No retroactive ticking.
1. Spec authoring
- 1.1 Read
../suaveplan/enterprise/slack-client.mdend-to-end - 1.2 No prior
openspec/specs/slack-client/spec.md(new capability) - 1.3 Read
openspec/AGENTS.mdworkflow (CLAUDE.md ref) + skillenterprise-package-migration - 1.4 Draft
proposal.mdfromopenspec/templates/proposal.md - 1.5 Source-mapping table filled — every requirement cites a line range or appears under "no source line"
- 1.6 Draft
specs/slack-client/spec.mdfromopenspec/templates/spec-delta.md - 1.7 Every requirement carries a
**Verified by:**line
2. Implementation
- 2.1
package.json+tsconfig.lib.json+vite.config.ts+vitest.config.tsat 0.1.0 - 2.2
src/error-codes.ts—defineCodes("SLACK", […])registry + 8 typed error subclasses - 2.3
src/types/slack-client.types.ts— public shapes (SlackMessage,SlackChannel,SlackUser,SlackResponse,SlackDeliveryReport, options bags) - 2.4
src/schemas/schemas.ts— Zod schemas for every public boundary input - 2.5
src/otel/metrics.ts— meter + four instruments wired via@opentelemetry/api - 2.6
src/client/retry-after.ts— parser for delay-seconds, HTTP-date, x-ratelimit-reset - 2.7
src/client/classify.ts— HTTP-status and slack-error-string classifiers - 2.8
src/client/slack-api-client.ts—SlackApiClientwith injectableFetchLike/Clock/Rng/LoggerLike - 2.9
src/webhook/slack-webhook.ts—SlackWebhookwith injectable transport bag - 2.10
src/fakes/fake-fetch.ts— deterministic test double (novi.mock) - 2.11
src/index.ts— explicit named re-exports, side-effectimport "./error-codes.js"
3. Tests
- 3.1 Unit tests at every
<feature>.test.tssite, ≥1 test per scenario in the spec delta — 121 tests, 8 files - 3.2 OTel test asserts emission via real in-memory
MeterProvider - 3.3 Every
it(...)carries{ timeout: 5000 }(or 30000 for genuinely async) - 3.4 Test files import ONLY from
@suaveplan/testing/runner— zero directvitest/bun:testimports
4. Documentation
- 4.1 Sibling
.mdfor every implementation.ts(≥200 words, basic + advanced examples, full API reference) - 4.2 README at package root only
5. Pre-archive verification (5-gate triple)
- 5.1
bun run check— slack-client clean (one pre-existing root-level failure inpackages/api/api-plugin-vault/src/plugin/plugin.ts:217is out of scope; verified slack-client itself is biome-clean) - 5.2
bunx turbo lint typecheck test --filter=@suaveplan/slack-client— green (121 tests pass) - 5.3
bunx turbo test:coverage --filter=@suaveplan/slack-client— 100/100/100/100 istanbul - 5.4
bun scripts/openspec-conformance.ts @suaveplan/slack-client—PASS @suaveplan/slack-client (0 error, 5 warn, 0 info) - 5.5
bunx turbo build --filter=@suaveplan/slack-client— green, 9 modules in dist
6. Pre-archive 9-row checklist
- 6.1 Generics threaded; literal types preserved through public surface (
SlackErrorCodeliteral union,SLACK_CODESfrozen record) - 6.2 Zod schemas wired at every declared boundary (constructors call
.safeParseand throwSlackConfigMissingErrorwith theZodErroras cause) - 6.3 Every error code in
error-codes.tsthrown by ≥1 production path (all 8 verified via conformance script) - 6.4 Strict-mode behaviors tested — constructor rejection on empty/invalid options AND Block-Kit
.strict()rejection of unknown keys - 6.5 OTel instruments emitted from production paths and asserted with real in-memory
MeterProvider(4 tests insrc/otel/metrics.test.ts) - 6.6 Lifecycle dedup tested — delivery-report Map idempotency, webhook message-id monotonicity
- 6.7 No retroactive tick — every box above reflects work done in this change
- 6.8 No
export *in any feature barrel (verified — every export is named) - 6.9 No direct
vitest/bun:testimports in test files (every test imports from@suaveplan/testing/runner)
7. Archive
- 7.1 Fold spec delta into
openspec/specs/slack-client/spec.md - 7.2 Move
openspec/changes/add-slack-client/→openspec/archive/2026-05-18-add-slack-client/