bigpowers 2.61.4 → 2.62.0
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/.pi/package.json +1 -1
- package/.pi/prompts/audit-code.md +1 -1
- package/.pi/prompts/enforce-first.md +9 -52
- package/.pi/skills/audit-code/SKILL.md +1 -1
- package/.pi/skills/enforce-first/SKILL.md +9 -52
- package/CHANGELOG.md +7 -0
- package/SKILL-INDEX.md +1 -1
- package/package.json +1 -1
- package/scripts/install.sh +27 -22
- package/scripts/lib/skill-common.sh +73 -0
- package/skills/audit-code/SKILL.md +1 -1
- package/skills/enforce-first/SKILL.md +9 -52
- package/skills-lock.json +3 -3
package/.pi/package.json
CHANGED
|
@@ -68,7 +68,7 @@ Run this self-review before asking anyone else to look at the code. The goal is
|
|
|
68
68
|
- [ ] Every new function has at least one test
|
|
69
69
|
- [ ] Every bug fix has a regression test
|
|
70
70
|
- [ ] Tests verify behavior through public interfaces (not implementation details)
|
|
71
|
-
- [ ] Tests are F.I.R.S.T compliant (use `enforce-first` if unsure)
|
|
71
|
+
- [ ] Tests are F.I.R.S.T compliant (per CONVENTIONS.md §Tests; use `enforce-first` if unsure)
|
|
72
72
|
|
|
73
73
|
### SOLID and Heuristics
|
|
74
74
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Apply the F.I.R.S.T test quality rubric (
|
|
2
|
+
description: Apply the F.I.R.S.T test quality rubric (per CONVENTIONS.md §Tests) to a test suite or individual tests. Use when develop-tdd is writing tests, when test quality needs to be checked, or when user mentions F.I.R.S.T or "test quality".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ description: Apply the F.I.R.S.T test quality rubric (Fast, Independent, Repeata
|
|
|
7
7
|
> **HARD GATE** — **HARD GATE** — Before shipping, ALL enforcement checks must pass: lint, typecheck, tests, coverage gates. Do NOT disable or skip checks to get to green.
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
Apply the F.I.R.S.T rubric
|
|
10
|
+
Apply the F.I.R.S.T rubric per CONVENTIONS.md §Tests to evaluate and improve tests.
|
|
11
11
|
|
|
12
12
|
This skill is typically invoked internally by `develop-tdd` during the test-writing phase. It can also be run standalone on an existing test suite.
|
|
13
13
|
|
|
@@ -18,58 +18,15 @@ This skill is typically invoked internally by `develop-tdd` during the test-writ
|
|
|
18
18
|
|
|
19
19
|
## The F.I.R.S.T Rubric
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The canonical F.I.R.S.T definition lives in CONVENTIONS.md §Tests. This skill operationalizes each criterion:
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
- **F (Fast):** No real I/O; suite target < 30s
|
|
24
|
+
- **I (Independent):** No shared state; any order, same result
|
|
25
|
+
- **R (Repeatable):** No machine deps; passes identically on CI and locally
|
|
26
|
+
- **S (Self-Validating):** Assertions, not console.log; descriptive failures
|
|
27
|
+
- **T (Timely):** Written with code; regression tests for every fix
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
- [ ] No real database (use in-memory or transaction-rollback strategies)
|
|
27
|
-
- [ ] No `sleep` or arbitrary timeouts in test code
|
|
28
|
-
- [ ] The full suite runs in under 30 seconds (target; adjust to project size)
|
|
29
|
-
|
|
30
|
-
**Fix:** Replace slow I/O with named fake classes. Never inline anonymous stubs.
|
|
31
|
-
|
|
32
|
-
### I — Independent
|
|
33
|
-
|
|
34
|
-
Tests must not depend on each other. Running in any order must produce the same result.
|
|
35
|
-
|
|
36
|
-
- [ ] No shared mutable state between tests
|
|
37
|
-
- [ ] Each test sets up its own data and tears it down
|
|
38
|
-
- [ ] No test assumes another test ran first
|
|
39
|
-
- [ ] Tests can be run individually (e.g. `npm test -- mytest.test.ts`) and pass
|
|
40
|
-
|
|
41
|
-
**Fix:** Move setup into `beforeEach`. Use factory functions to build test data.
|
|
42
|
-
|
|
43
|
-
### R — Repeatable
|
|
44
|
-
|
|
45
|
-
Tests must pass consistently in any environment.
|
|
46
|
-
|
|
47
|
-
- [ ] No dependency on machine-specific paths, ports, or environment variables (unless explicitly injected)
|
|
48
|
-
- [ ] No dependency on current time without mocking the clock
|
|
49
|
-
- [ ] No flakiness — a test that sometimes fails is worse than no test
|
|
50
|
-
- [ ] Tests pass on CI the same way they pass locally
|
|
51
|
-
|
|
52
|
-
**Fix:** Inject time, randomness, and environment as parameters. Pin seeds for anything random.
|
|
53
|
-
|
|
54
|
-
### S — Self-Validating
|
|
55
|
-
|
|
56
|
-
Tests must report pass or fail automatically. No human inspection required.
|
|
57
|
-
|
|
58
|
-
- [ ] Tests use assertions (`expect`, `assert`, etc.) — not just `console.log`
|
|
59
|
-
- [ ] Failure messages are descriptive enough to diagnose without reading the test body
|
|
60
|
-
- [ ] No tests that "pass" by default when the feature is broken
|
|
61
|
-
|
|
62
|
-
**Fix:** Add assertion messages. Use matchers that describe the expected behavior.
|
|
63
|
-
|
|
64
|
-
### T — Timely
|
|
65
|
-
|
|
66
|
-
Tests must be written at the right time — before or immediately with the code they test.
|
|
67
|
-
|
|
68
|
-
- [ ] Tests are written in the same commit as the code (or the commit before, if TDD)
|
|
69
|
-
- [ ] No "I'll add tests later" patterns
|
|
70
|
-
- [ ] Bug fixes include a regression test that would have caught the bug
|
|
71
|
-
|
|
72
|
-
**Fix:** Run `develop-tdd` — it enforces the timely principle by design.
|
|
29
|
+
For the full rubric with checklists and fix patterns, see CONVENTIONS.md §Tests.
|
|
73
30
|
|
|
74
31
|
## Applying the rubric
|
|
75
32
|
|
|
@@ -70,7 +70,7 @@ Run this self-review before asking anyone else to look at the code. The goal is
|
|
|
70
70
|
- [ ] Every new function has at least one test
|
|
71
71
|
- [ ] Every bug fix has a regression test
|
|
72
72
|
- [ ] Tests verify behavior through public interfaces (not implementation details)
|
|
73
|
-
- [ ] Tests are F.I.R.S.T compliant (use `enforce-first` if unsure)
|
|
73
|
+
- [ ] Tests are F.I.R.S.T compliant (per CONVENTIONS.md §Tests; use `enforce-first` if unsure)
|
|
74
74
|
|
|
75
75
|
### SOLID and Heuristics
|
|
76
76
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: enforce-first
|
|
3
|
-
description: "Apply the F.I.R.S.T test quality rubric (
|
|
3
|
+
description: "Apply the F.I.R.S.T test quality rubric (per CONVENTIONS.md §Tests) to a test suite or individual tests. Use when develop-tdd is writing tests, when test quality needs to be checked, or when user mentions F.I.R.S.T or \"test quality\"."
|
|
4
4
|
model: haiku
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ model: haiku
|
|
|
9
9
|
> **HARD GATE** — **HARD GATE** — Before shipping, ALL enforcement checks must pass: lint, typecheck, tests, coverage gates. Do NOT disable or skip checks to get to green.
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
Apply the F.I.R.S.T rubric
|
|
12
|
+
Apply the F.I.R.S.T rubric per CONVENTIONS.md §Tests to evaluate and improve tests.
|
|
13
13
|
|
|
14
14
|
This skill is typically invoked internally by `develop-tdd` during the test-writing phase. It can also be run standalone on an existing test suite.
|
|
15
15
|
|
|
@@ -20,58 +20,15 @@ This skill is typically invoked internally by `develop-tdd` during the test-writ
|
|
|
20
20
|
|
|
21
21
|
## The F.I.R.S.T Rubric
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The canonical F.I.R.S.T definition lives in CONVENTIONS.md §Tests. This skill operationalizes each criterion:
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
- **F (Fast):** No real I/O; suite target < 30s
|
|
26
|
+
- **I (Independent):** No shared state; any order, same result
|
|
27
|
+
- **R (Repeatable):** No machine deps; passes identically on CI and locally
|
|
28
|
+
- **S (Self-Validating):** Assertions, not console.log; descriptive failures
|
|
29
|
+
- **T (Timely):** Written with code; regression tests for every fix
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
- [ ] No real database (use in-memory or transaction-rollback strategies)
|
|
29
|
-
- [ ] No `sleep` or arbitrary timeouts in test code
|
|
30
|
-
- [ ] The full suite runs in under 30 seconds (target; adjust to project size)
|
|
31
|
-
|
|
32
|
-
**Fix:** Replace slow I/O with named fake classes. Never inline anonymous stubs.
|
|
33
|
-
|
|
34
|
-
### I — Independent
|
|
35
|
-
|
|
36
|
-
Tests must not depend on each other. Running in any order must produce the same result.
|
|
37
|
-
|
|
38
|
-
- [ ] No shared mutable state between tests
|
|
39
|
-
- [ ] Each test sets up its own data and tears it down
|
|
40
|
-
- [ ] No test assumes another test ran first
|
|
41
|
-
- [ ] Tests can be run individually (e.g. `npm test -- mytest.test.ts`) and pass
|
|
42
|
-
|
|
43
|
-
**Fix:** Move setup into `beforeEach`. Use factory functions to build test data.
|
|
44
|
-
|
|
45
|
-
### R — Repeatable
|
|
46
|
-
|
|
47
|
-
Tests must pass consistently in any environment.
|
|
48
|
-
|
|
49
|
-
- [ ] No dependency on machine-specific paths, ports, or environment variables (unless explicitly injected)
|
|
50
|
-
- [ ] No dependency on current time without mocking the clock
|
|
51
|
-
- [ ] No flakiness — a test that sometimes fails is worse than no test
|
|
52
|
-
- [ ] Tests pass on CI the same way they pass locally
|
|
53
|
-
|
|
54
|
-
**Fix:** Inject time, randomness, and environment as parameters. Pin seeds for anything random.
|
|
55
|
-
|
|
56
|
-
### S — Self-Validating
|
|
57
|
-
|
|
58
|
-
Tests must report pass or fail automatically. No human inspection required.
|
|
59
|
-
|
|
60
|
-
- [ ] Tests use assertions (`expect`, `assert`, etc.) — not just `console.log`
|
|
61
|
-
- [ ] Failure messages are descriptive enough to diagnose without reading the test body
|
|
62
|
-
- [ ] No tests that "pass" by default when the feature is broken
|
|
63
|
-
|
|
64
|
-
**Fix:** Add assertion messages. Use matchers that describe the expected behavior.
|
|
65
|
-
|
|
66
|
-
### T — Timely
|
|
67
|
-
|
|
68
|
-
Tests must be written at the right time — before or immediately with the code they test.
|
|
69
|
-
|
|
70
|
-
- [ ] Tests are written in the same commit as the code (or the commit before, if TDD)
|
|
71
|
-
- [ ] No "I'll add tests later" patterns
|
|
72
|
-
- [ ] Bug fixes include a regression test that would have caught the bug
|
|
73
|
-
|
|
74
|
-
**Fix:** Run `develop-tdd` — it enforces the timely principle by design.
|
|
31
|
+
For the full rubric with checklists and fix patterns, see CONVENTIONS.md §Tests.
|
|
75
32
|
|
|
76
33
|
## Applying the rubric
|
|
77
34
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [2.62.0](https://github.com/danielvm-git/bigpowers/compare/v2.61.4...v2.62.0) (2026-07-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **install:** add pi global install support, remove broken OpenCode step ([d91c86e](https://github.com/danielvm-git/bigpowers/commit/d91c86e46fd85d8fe6a7013484f4dd5ce6bc201f))
|
|
7
|
+
|
|
1
8
|
## [2.61.4](https://github.com/danielvm-git/bigpowers/compare/v2.61.3...v2.61.4) (2026-07-04)
|
|
2
9
|
|
|
3
10
|
|
package/SKILL-INDEX.md
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
| 42 | Build | `wire-observability` | Add structured JSON logging, observability commands, and idempotent setup script | ✅ Active |
|
|
71
71
|
| 43 | Verify | `audit-code` | Self-review checklist for the coding agent to run before dispatching a reviewer. | ✅ Active |
|
|
72
72
|
| 44 | Verify | `diagnose-root` | Run 4-phase root cause analysis — reproduce, isolate, hypothesize, verify. Use | ✅ Active |
|
|
73
|
-
| 45 | Verify | `enforce-first` | Apply the F.I.R.S.T test quality rubric (
|
|
73
|
+
| 45 | Verify | `enforce-first` | Apply the F.I.R.S.T test quality rubric (per CONVENTIONS.md §Tests) to a test s | ✅ Active |
|
|
74
74
|
| 46 | Verify | `fix-bug` | Bug fix orchestrator — active_flow fix_bug; reads specs/bugs/BUG-*.md; chains | ✅ Active |
|
|
75
75
|
| 47 | Verify | `inspect-quality` | Interactive QA session where user reports bugs or issues conversationally, and t | ✅ Active |
|
|
76
76
|
| 48 | Verify | `investigate-bug` | Investigate a bug or issue by exploring the codebase to find root cause, then wr | ✅ Active |
|
package/package.json
CHANGED
package/scripts/install.sh
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
# Supported tools:
|
|
5
5
|
# Claude Code → ~/.claude/skills/<name>/ (one symlink per skill)
|
|
6
6
|
# Gemini CLI → ~/.gemini/extensions/bigpowers/ (one dir symlink)
|
|
7
|
+
# pi → ~/.pi/agent/skills/<name>/ (one symlink per skill)
|
|
7
8
|
# Cursor → ~/.cursor/rules/ (one dir symlink; per-project note printed)
|
|
8
|
-
# OpenCode → instructions printed (no standard global path)
|
|
9
9
|
#
|
|
10
10
|
# Usage:
|
|
11
11
|
# ./scripts/install.sh # install
|
|
@@ -195,28 +195,33 @@ uninstall_cursor() {
|
|
|
195
195
|
unlink_if_managed "$CURSOR_RULES_DST" "$REPO_ROOT/"
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
# ──
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
198
|
+
# ── pi ────────────────────────────────────────────────────────────────────────
|
|
199
|
+
|
|
200
|
+
PI_CONFIG_DIR="$HOME/.pi"
|
|
201
|
+
PI_SKILLS_DIR="$PI_CONFIG_DIR/agent/skills"
|
|
202
|
+
|
|
203
|
+
install_pi() {
|
|
204
|
+
echo ""
|
|
205
|
+
echo "pi → $PI_SKILLS_DIR/"
|
|
206
|
+
local count=0
|
|
207
|
+
for skill_dir in "$SKILLS_ROOT"/*/; do
|
|
208
|
+
[[ -f "$skill_dir/SKILL.md" ]] || continue
|
|
209
|
+
local name; name="$(basename "$skill_dir")"
|
|
210
|
+
link "$skill_dir" "$PI_SKILLS_DIR/$name"
|
|
211
|
+
count=$((count + 1))
|
|
212
|
+
done
|
|
213
|
+
echo " $count skills installed"
|
|
213
214
|
}
|
|
214
215
|
|
|
215
|
-
|
|
216
|
+
uninstall_pi() {
|
|
216
217
|
echo ""
|
|
217
|
-
echo "
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
echo "pi → removing management from $PI_CONFIG_DIR/"
|
|
219
|
+
if [[ -d "$PI_SKILLS_DIR" ]]; then
|
|
220
|
+
for dst in "$PI_SKILLS_DIR"/*/; do
|
|
221
|
+
[[ -L "${dst%/}" ]] || continue
|
|
222
|
+
unlink_if_managed "${dst%/}" "$REPO_ROOT/"
|
|
223
|
+
done
|
|
224
|
+
fi
|
|
220
225
|
}
|
|
221
226
|
|
|
222
227
|
# ── main ──────────────────────────────────────────────────────────────────────
|
|
@@ -228,15 +233,15 @@ $UNINSTALL && echo "(uninstall mode)"
|
|
|
228
233
|
if $UNINSTALL; then
|
|
229
234
|
uninstall_claude
|
|
230
235
|
uninstall_gemini
|
|
236
|
+
uninstall_pi
|
|
231
237
|
uninstall_cursor
|
|
232
238
|
echo ""
|
|
233
239
|
echo "bigpowers uninstalled."
|
|
234
240
|
else
|
|
235
241
|
install_claude
|
|
236
242
|
install_gemini
|
|
243
|
+
install_pi
|
|
237
244
|
install_cursor
|
|
238
|
-
install_opencode
|
|
239
|
-
print_opencode_instructions
|
|
240
245
|
echo ""
|
|
241
246
|
echo "bigpowers installed. Future updates:"
|
|
242
247
|
if [[ -d "$REPO_ROOT/.git" ]]; then
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: e28s01
|
|
3
|
+
# scripts/lib/skill-common.sh — Shared bash library for skill pipeline scripts
|
|
4
|
+
# Provides: resolve_repo_root, parse_frontmatter, iterate_skills
|
|
5
|
+
# Safe to source under set -euo pipefail; double-source is a no-op.
|
|
6
|
+
|
|
7
|
+
# Double-source guard
|
|
8
|
+
if [[ -n "${_SKILL_COMMON_SOURCED:-}" ]]; then
|
|
9
|
+
return 0
|
|
10
|
+
fi
|
|
11
|
+
_SKILL_COMMON_SOURCED=1
|
|
12
|
+
|
|
13
|
+
# ── resolve_repo_root ───────────────────────────────────────────────
|
|
14
|
+
# Resolves REPO_ROOT to the repository root (two levels up from this
|
|
15
|
+
# library at scripts/lib/skill-common.sh). Also sets SKILLS_ROOT:
|
|
16
|
+
# skills/ subdirectory when it exists, repo root fallback.
|
|
17
|
+
resolve_repo_root() {
|
|
18
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
19
|
+
SKILLS_ROOT="$REPO_ROOT"
|
|
20
|
+
[[ -d "$REPO_ROOT/skills" ]] && SKILLS_ROOT="$REPO_ROOT/skills"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Resolve at source time so callers don't need to
|
|
24
|
+
resolve_repo_root
|
|
25
|
+
|
|
26
|
+
# ── parse_frontmatter ───────────────────────────────────────────────
|
|
27
|
+
# Usage: parse_frontmatter <SKILL.md>
|
|
28
|
+
# Extracts YAML frontmatter into globals: _PF_NAME, _PF_MODEL, _PF_DESCRIPTION
|
|
29
|
+
# Returns 0 on success, non-zero if file missing or no name in frontmatter.
|
|
30
|
+
parse_frontmatter() {
|
|
31
|
+
local file="$1"
|
|
32
|
+
_PF_NAME=""
|
|
33
|
+
_PF_MODEL=""
|
|
34
|
+
_PF_DESCRIPTION=""
|
|
35
|
+
|
|
36
|
+
if [[ ! -f "$file" ]]; then
|
|
37
|
+
echo "parse_frontmatter: file not found: $file" >&2
|
|
38
|
+
return 1
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Verify YAML frontmatter exists (at least one --- delimiter)
|
|
42
|
+
if ! grep -q '^---$' "$file"; then
|
|
43
|
+
echo "parse_frontmatter: no YAML frontmatter in $file" >&2
|
|
44
|
+
return 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
# Extract name (single-line, first match in frontmatter)
|
|
48
|
+
_PF_NAME=$(awk '/^---/{f++} f==1 && /^name:/{print; exit}' "$file" | sed 's/^name:[[:space:]]*//')
|
|
49
|
+
|
|
50
|
+
# Extract model (single-line, first match in frontmatter)
|
|
51
|
+
_PF_MODEL=$(awk '/^---/{f++} f==1 && /^model:/{print; exit}' "$file" | sed 's/^model:[[:space:]]*//')
|
|
52
|
+
|
|
53
|
+
# Extract description (potentially multiline, from "description:" to next YAML key or closing ---)
|
|
54
|
+
_PF_DESCRIPTION=$(awk '/^---/{f++; next} f==1 && /^description:/{p=1; sub(/^description:[[:space:]]*/,""); print; next} f==1 && p && /^[a-z]+:/{exit} f==1 && p{print}' "$file" \
|
|
55
|
+
| tr -d '\n' \
|
|
56
|
+
| sed -E 's/[[:space:]]+/ /g')
|
|
57
|
+
|
|
58
|
+
[[ -z "$_PF_NAME" ]] && return 1
|
|
59
|
+
return 0
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# ── iterate_skills ──────────────────────────────────────────────────
|
|
63
|
+
# Usage: iterate_skills
|
|
64
|
+
# Outputs one absolute path per skill directory under SKILLS_ROOT that
|
|
65
|
+
# contains a SKILL.md file, in stable sorted order (no trailing slash).
|
|
66
|
+
iterate_skills() {
|
|
67
|
+
local dir
|
|
68
|
+
for dir in "$SKILLS_ROOT"/*/; do
|
|
69
|
+
[[ -d "$dir" ]] || continue
|
|
70
|
+
[[ -f "$dir/SKILL.md" ]] || continue
|
|
71
|
+
echo "${dir%/}"
|
|
72
|
+
done
|
|
73
|
+
}
|
|
@@ -70,7 +70,7 @@ Run this self-review before asking anyone else to look at the code. The goal is
|
|
|
70
70
|
- [ ] Every new function has at least one test
|
|
71
71
|
- [ ] Every bug fix has a regression test
|
|
72
72
|
- [ ] Tests verify behavior through public interfaces (not implementation details)
|
|
73
|
-
- [ ] Tests are F.I.R.S.T compliant (use `enforce-first` if unsure)
|
|
73
|
+
- [ ] Tests are F.I.R.S.T compliant (per CONVENTIONS.md §Tests; use `enforce-first` if unsure)
|
|
74
74
|
|
|
75
75
|
### SOLID and Heuristics
|
|
76
76
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
name: enforce-first
|
|
3
3
|
model: haiku
|
|
4
4
|
effort: standard
|
|
5
|
-
description: Apply the F.I.R.S.T test quality rubric (
|
|
5
|
+
description: Apply the F.I.R.S.T test quality rubric (per CONVENTIONS.md §Tests) to a test suite or individual tests. Use when develop-tdd is writing tests, when test quality needs to be checked, or when user mentions F.I.R.S.T or "test quality".
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Enforce FIRST
|
|
9
9
|
> **HARD GATE** — **HARD GATE** — Before shipping, ALL enforcement checks must pass: lint, typecheck, tests, coverage gates. Do NOT disable or skip checks to get to green.
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
Apply the F.I.R.S.T rubric
|
|
12
|
+
Apply the F.I.R.S.T rubric per CONVENTIONS.md §Tests to evaluate and improve tests.
|
|
13
13
|
|
|
14
14
|
This skill is typically invoked internally by `develop-tdd` during the test-writing phase. It can also be run standalone on an existing test suite.
|
|
15
15
|
|
|
@@ -20,58 +20,15 @@ This skill is typically invoked internally by `develop-tdd` during the test-writ
|
|
|
20
20
|
|
|
21
21
|
## The F.I.R.S.T Rubric
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The canonical F.I.R.S.T definition lives in CONVENTIONS.md §Tests. This skill operationalizes each criterion:
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
- **F (Fast):** No real I/O; suite target < 30s
|
|
26
|
+
- **I (Independent):** No shared state; any order, same result
|
|
27
|
+
- **R (Repeatable):** No machine deps; passes identically on CI and locally
|
|
28
|
+
- **S (Self-Validating):** Assertions, not console.log; descriptive failures
|
|
29
|
+
- **T (Timely):** Written with code; regression tests for every fix
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
- [ ] No real database (use in-memory or transaction-rollback strategies)
|
|
29
|
-
- [ ] No `sleep` or arbitrary timeouts in test code
|
|
30
|
-
- [ ] The full suite runs in under 30 seconds (target; adjust to project size)
|
|
31
|
-
|
|
32
|
-
**Fix:** Replace slow I/O with named fake classes. Never inline anonymous stubs.
|
|
33
|
-
|
|
34
|
-
### I — Independent
|
|
35
|
-
|
|
36
|
-
Tests must not depend on each other. Running in any order must produce the same result.
|
|
37
|
-
|
|
38
|
-
- [ ] No shared mutable state between tests
|
|
39
|
-
- [ ] Each test sets up its own data and tears it down
|
|
40
|
-
- [ ] No test assumes another test ran first
|
|
41
|
-
- [ ] Tests can be run individually (e.g. `npm test -- mytest.test.ts`) and pass
|
|
42
|
-
|
|
43
|
-
**Fix:** Move setup into `beforeEach`. Use factory functions to build test data.
|
|
44
|
-
|
|
45
|
-
### R — Repeatable
|
|
46
|
-
|
|
47
|
-
Tests must pass consistently in any environment.
|
|
48
|
-
|
|
49
|
-
- [ ] No dependency on machine-specific paths, ports, or environment variables (unless explicitly injected)
|
|
50
|
-
- [ ] No dependency on current time without mocking the clock
|
|
51
|
-
- [ ] No flakiness — a test that sometimes fails is worse than no test
|
|
52
|
-
- [ ] Tests pass on CI the same way they pass locally
|
|
53
|
-
|
|
54
|
-
**Fix:** Inject time, randomness, and environment as parameters. Pin seeds for anything random.
|
|
55
|
-
|
|
56
|
-
### S — Self-Validating
|
|
57
|
-
|
|
58
|
-
Tests must report pass or fail automatically. No human inspection required.
|
|
59
|
-
|
|
60
|
-
- [ ] Tests use assertions (`expect`, `assert`, etc.) — not just `console.log`
|
|
61
|
-
- [ ] Failure messages are descriptive enough to diagnose without reading the test body
|
|
62
|
-
- [ ] No tests that "pass" by default when the feature is broken
|
|
63
|
-
|
|
64
|
-
**Fix:** Add assertion messages. Use matchers that describe the expected behavior.
|
|
65
|
-
|
|
66
|
-
### T — Timely
|
|
67
|
-
|
|
68
|
-
Tests must be written at the right time — before or immediately with the code they test.
|
|
69
|
-
|
|
70
|
-
- [ ] Tests are written in the same commit as the code (or the commit before, if TDD)
|
|
71
|
-
- [ ] No "I'll add tests later" patterns
|
|
72
|
-
- [ ] Bug fixes include a regression test that would have caught the bug
|
|
73
|
-
|
|
74
|
-
**Fix:** Run `develop-tdd` — it enforces the timely principle by design.
|
|
31
|
+
For the full rubric with checklists and fix patterns, see CONVENTIONS.md §Tests.
|
|
75
32
|
|
|
76
33
|
## Applying the rubric
|
|
77
34
|
|
package/skills-lock.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"audit-code": {
|
|
15
15
|
"description": "Self-review checklist for the coding agent to run before dispatching a reviewer. Checks CONVENTIONS.md compliance, Boy Scout Rule, test coverage, types, and SOLID. Produces a pass/fail checklist. Use before request-review, before committing, or when user asks for a code quality check.",
|
|
16
|
-
"sha256": "
|
|
16
|
+
"sha256": "9a4afa72a83882d6",
|
|
17
17
|
"path": "skills/audit-code/SKILL.md"
|
|
18
18
|
},
|
|
19
19
|
"audit-plan": {
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"path": "skills/elaborate-spec/SKILL.md"
|
|
103
103
|
},
|
|
104
104
|
"enforce-first": {
|
|
105
|
-
"description": "Apply the F.I.R.S.T test quality rubric (
|
|
106
|
-
"sha256": "
|
|
105
|
+
"description": "Apply the F.I.R.S.T test quality rubric (per CONVENTIONS.md §Tests) to a test suite or individual tests. Use when develop-tdd is writing tests, when test quality needs to be checked, or when user mentions F.I.R.S.T or \"test quality\".",
|
|
106
|
+
"sha256": "20f717d0496ca20f",
|
|
107
107
|
"path": "skills/enforce-first/SKILL.md"
|
|
108
108
|
},
|
|
109
109
|
"evolve-skill": {
|