slash-do 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/commands/do/review.md +11 -0
- package/lib/code-review-checklist.md +8 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
+
## Philosophy
|
|
34
|
+
|
|
35
|
+
slashdo commands emphasize **high-quality software engineering over token conservation**. While efforts are made to use agents, models, and prompts efficiently, these tools work hard to ensure your software meets high-quality standards — and will use the tokens necessary to meet that end. Expect thorough reviews, multi-agent scans, and verification loops rather than shortcuts.
|
|
36
|
+
|
|
33
37
|
## Quick Start
|
|
34
38
|
|
|
35
39
|
**With npm/npx:**
|
package/commands/do/review.md
CHANGED
|
@@ -112,6 +112,17 @@ Check every file against this checklist:
|
|
|
112
112
|
- If the PR modifies a value (identifier, parameter name, format convention, threshold, timeout) that is referenced in other files, trace all cross-references and verify they agree. This includes: reviewer usernames, API names, placeholder formats, GraphQL field names, operational constants
|
|
113
113
|
- If the PR adds or reorders sequential steps/instructions, verify the ordering matches execution dependencies — readers following steps in order must not perform an action before its prerequisite
|
|
114
114
|
|
|
115
|
+
**Transactional write integrity**
|
|
116
|
+
- If the PR performs multi-item writes (database transactions, batch operations), verify each write includes condition expressions that prevent stale-read races (TOCTOU) — an unconditioned write after a read can upsert deleted records, double-count aggregates, or drive counters negative. Trace the gap between read and write for each operation
|
|
117
|
+
- If the PR catches transaction/conditional failures, verify the error is translated to a client-appropriate status (409, 404) rather than bubbling as 500 — expected concurrency failures are not server errors
|
|
118
|
+
|
|
119
|
+
**Batch/paginated API consumption**
|
|
120
|
+
- If the PR calls batch or paginated external APIs (database batch gets, paginated queries, bulk service calls), verify the caller handles partial results — unprocessed items, continuation tokens, and rate-limited responses must be retried or surfaced, not silently dropped. Check that retry loops include backoff and attempt limits
|
|
121
|
+
- If the PR references resource names from API responses (table names, queue names), verify lookups account for environment-prefixed names rather than hardcoding bare names
|
|
122
|
+
|
|
123
|
+
**Data model vs access pattern alignment**
|
|
124
|
+
- If the PR adds queries that claim ordering (e.g., "recent", "top"), verify the underlying key/index design actually supports that ordering natively — random UUIDs and non-time-sortable keys require full scans and in-memory sorting, which degrades at scale
|
|
125
|
+
|
|
115
126
|
**Formatting & structural consistency**
|
|
116
127
|
- If the PR adds content to an existing file (list items, sections, config entries), verify the new content matches the file's existing indentation, bullet style, heading levels, and structure — rendering inconsistencies are the most common Copilot review finding
|
|
117
128
|
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
- Initialization functions (schedulers, pollers, listeners) that don't guard against multiple calls — creates duplicate instances. Check for existing instances before reinitializing
|
|
27
27
|
|
|
28
28
|
**Error handling**
|
|
29
|
-
- Service functions throwing generic `Error` for client-caused conditions — bubbles as 500 instead of 400/404. Use typed error classes with explicit status codes; ensure consistent error responses across similar endpoints
|
|
29
|
+
- Service functions throwing generic `Error` for client-caused conditions — bubbles as 500 instead of 400/404. Use typed error classes with explicit status codes; ensure consistent error responses across similar endpoints. Include expected concurrency/conditional failures (transaction cancellations, optimistic lock conflicts) — catch and translate to 409/retry rather than letting them surface as 500
|
|
30
30
|
- Swallowed errors (empty `.catch(() => {})`), handlers that replace detailed failure info with generic messages, and error/catch handlers that exit cleanly (`exit 0`, `return`) without any user-visible output — surface a notification, propagate original context, and make failures look like failures
|
|
31
31
|
- Destructive operations in retry/cleanup paths assumed to succeed without their own error handling — if cleanup fails, retry logic crashes instead of reporting the intended failure
|
|
32
32
|
|
|
33
33
|
**API & URL safety**
|
|
34
|
-
- User-supplied values interpolated into URL paths, shell commands, file paths, or subprocess arguments without encoding/validation — use `encodeURIComponent()` for URLs, regex allowlists for execution boundaries
|
|
34
|
+
- User-supplied or system-generated values interpolated into URL paths, shell commands, file paths, or subprocess arguments without encoding/validation — use `encodeURIComponent()` for URLs, regex allowlists for execution boundaries. Generated identifiers used as URL path segments must be safe for your router/storage (no `/`, `?`, `#`; consider allowlisting characters and/or applying `encodeURIComponent()`)
|
|
35
35
|
- Route params passed to services without format validation; path containment checks using string prefix without path separator boundary (use `path.relative()`)
|
|
36
36
|
- Error/fallback responses that hardcode security headers instead of using centralized policy — error paths bypass security tightening
|
|
37
37
|
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
- Handlers reading properties from framework-provided objects using field names the framework doesn't populate — silent `undefined`. Verify property names match the caller's contract
|
|
51
51
|
- Numeric values from strings used without `NaN`/type guards — `NaN` comparisons silently pass bounds checks. Clamp query params to safe lower bounds
|
|
52
52
|
- UI elements hidden from navigation but still accessible via direct URL — enforce restrictions at the route level
|
|
53
|
-
- Summary counters/accumulators that miss edge cases (removals, branch coverage); silent operations in verbose sequences where all branches should print status
|
|
53
|
+
- Summary counters/accumulators that miss edge cases (removals, branch coverage, underflow on decrements — guard against going negative with lower-bound conditions); silent operations in verbose sequences where all branches should print status
|
|
54
54
|
|
|
55
55
|
**Intent vs implementation**
|
|
56
56
|
- Labels, comments, status messages, or documentation that describe behavior the code doesn't implement — e.g., a map named "renamed" that only deletes, or an action labeled "migrated" that never creates the target
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
- Registering references to resources without verifying the resource exists — dangling references after failed operations
|
|
65
65
|
|
|
66
66
|
**Concurrency & data integrity**
|
|
67
|
-
- Shared mutable state accessed by concurrent requests without locking or atomic writes; multi-step read-modify-write cycles that can interleave
|
|
67
|
+
- Shared mutable state accessed by concurrent requests without locking or atomic writes; multi-step read-modify-write cycles that can interleave — use conditional writes/optimistic concurrency (e.g., condition expressions, version checks) to close the gap between read and write; if the conditional write fails, surface a retryable error instead of letting it bubble as a 500
|
|
68
68
|
- Multi-table writes without a transaction — FK violations or errors leave partial state
|
|
69
69
|
- Functions with early returns for "no primary fields to update" that silently skip secondary operations (relationship updates, link writes)
|
|
70
70
|
- Functions that acquire shared state (locks, flags, markers) with exit paths that skip cleanup — leaves the system permanently locked. Trace all exit paths including error branches
|
|
@@ -76,6 +76,8 @@
|
|
|
76
76
|
**Sync & replication**
|
|
77
77
|
- Upsert/`ON CONFLICT UPDATE` updating only a subset of exported fields — replicas diverge. Document deliberately omitted fields
|
|
78
78
|
- Pagination using `COUNT(*)` (full table scan) instead of `limit + 1`; endpoints missing `next` token input/output; hard-capped limits silently truncating results
|
|
79
|
+
- Batch/paginated API calls (database batch gets, external service calls) that don't handle partial results — unprocessed items, continuation tokens, or rate-limited responses silently dropped. Add retry loops with backoff for unprocessed items
|
|
80
|
+
- Retry loops without backoff or max-attempt limits — tight loops under throttling extend latency indefinitely. Use bounded retries with exponential backoff/jitter
|
|
79
81
|
|
|
80
82
|
**SQL & database**
|
|
81
83
|
- Parameterized query placeholder indices must match parameter array positions — especially with shared param builders or computed indices
|
|
@@ -94,6 +96,7 @@
|
|
|
94
96
|
**Data format portability**
|
|
95
97
|
- Values crossing serialization boundaries may change format (arrays in JSON vs string literals in DB) — convert consistently
|
|
96
98
|
- BIGINT values parsed into JavaScript `Number` — precision lost past `MAX_SAFE_INTEGER`. Use strings or `BigInt`
|
|
99
|
+
- Data model key/index design that doesn't support required query access patterns — e.g., claiming "recent" ordering but using non-time-sortable keys (random UUIDs, user IDs). Verify sort keys and indexes can serve the queries the code performs without full-partition scans and in-memory sorting
|
|
97
100
|
|
|
98
101
|
**Shell & portability**
|
|
99
102
|
- Subprocess calls under `set -e` abort on failure; non-critical writes fail on broken pipes — use `|| true` for non-critical output
|
|
@@ -112,7 +115,7 @@
|
|
|
112
115
|
- Custom toggle/switch UI built from non-semantic elements instead of native inputs
|
|
113
116
|
|
|
114
117
|
**Configuration & hardcoding**
|
|
115
|
-
- Hardcoded values when a config field or env var already exists; dead config fields nothing consumes; unused function parameters creating false API contracts
|
|
118
|
+
- Hardcoded values when a config field or env var already exists; dead config fields nothing consumes; unused function parameters creating false API contracts; resource names (table names, queue names, bucket names) hardcoded without accounting for environment prefixes — lookups on response objects using the wrong key silently return undefined
|
|
116
119
|
- Duplicated config/constants/utilities across modules — extract to shared module to prevent drift
|
|
117
120
|
- CI pipelines installing without lockfile pinning or version constraints — non-deterministic builds
|
|
118
121
|
|
package/package.json
CHANGED