bigpowers 2.92.0 → 2.93.1
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/.gemini/extensions/bigpowers/gemini-extension.json +1 -1
- package/.pi/package.json +1 -1
- package/AGENTS.md +98 -0
- package/CHANGELOG.md +14 -0
- package/CONVENTIONS.md +47 -427
- package/bin/bigpowers.js +9 -6
- package/bin/setup.js +11 -5
- package/package.json +1 -1
- package/scripts/lib/__pycache__/atomic_write.cpython-310.pyc +0 -0
- package/scripts/lib/__pycache__/link_utils.cpython-310.pyc +0 -0
- package/scripts/lib/__pycache__/srp_engine_links.cpython-310.pyc +0 -0
- package/scripts/lib/__pycache__/srp_engine_okf.cpython-310.pyc +0 -0
- package/scripts/lib/cli-version.js +29 -0
- package/scripts/lib/golden-suite-gates.sh +4 -0
- package/scripts/test-bigpowers-cli-version.sh +104 -0
- package/CLAUDE.md +0 -400
- package/GEMINI.md +0 -75
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// story: BUG-2026-11-03-cli-update-stale-version
|
|
2
|
+
// cli-version.js — read the installed version from disk, never from a require cache.
|
|
3
|
+
//
|
|
4
|
+
// `bigpowers update` runs `npm install -g bigpowers@latest` inside a *running*
|
|
5
|
+
// process. bin/bigpowers.js has already require()d package.json by then, so when
|
|
6
|
+
// bin/setup.js (required after the reinstall) reads the same resolved path, Node
|
|
7
|
+
// hands back the cached object: the banner printed v2.88.5 while v2.92.0 was what
|
|
8
|
+
// had just been installed, and `bigpowers install` — a fresh process — correctly
|
|
9
|
+
// reported 2.92.0.
|
|
10
|
+
//
|
|
11
|
+
// readFileSync always sees the new file, so every user-facing version string goes
|
|
12
|
+
// through here.
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
/** Version of the package rooted at `root`, read fresh from disk. */
|
|
20
|
+
function readPackageVersion(root) {
|
|
21
|
+
try {
|
|
22
|
+
const text = fs.readFileSync(path.join(root, 'package.json'), 'utf8');
|
|
23
|
+
return JSON.parse(text).version || 'unknown';
|
|
24
|
+
} catch {
|
|
25
|
+
return 'unknown';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = { readPackageVersion };
|
|
@@ -53,6 +53,10 @@ GOLDEN_GATES=(
|
|
|
53
53
|
"target-contracts:bash scripts/test-target-contracts.sh:false"
|
|
54
54
|
# Registry-driven replacements for the 25 hand-written per-target scripts.
|
|
55
55
|
"install-hub:bash scripts/test-install-hub.sh:false"
|
|
56
|
+
# `bigpowers update` runs `npm install -g @latest` inside a live process; a
|
|
57
|
+
# version captured by require() at startup then reports the release that was
|
|
58
|
+
# just replaced (BUG-2026-11-03-cli-update-stale-version).
|
|
59
|
+
"bigpowers-cli-version:bash scripts/test-bigpowers-cli-version.sh:false"
|
|
56
60
|
"adapter-render:bash scripts/test-adapter-render.sh:false"
|
|
57
61
|
"adapters:bash scripts/test-adapters.sh:false"
|
|
58
62
|
# Previously orphaned: present in scripts/ but reachable from no gate.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: BUG-2026-11-03-cli-update-stale-version
|
|
3
|
+
# test-bigpowers-cli-version.sh — `update` must report the version it just installed.
|
|
4
|
+
#
|
|
5
|
+
# Reproduces the reported symptom without touching npm or the real HOME:
|
|
6
|
+
# bigpowers update → banner v2.88.5 (wrong: a require() cache captured at startup,
|
|
7
|
+
# before `npm install -g bigpowers@latest`)
|
|
8
|
+
# bigpowers install → banner v2.92.0 (right: a fresh process reads package.json)
|
|
9
|
+
#
|
|
10
|
+
# Three assertions:
|
|
11
|
+
# 1. readPackageVersion() sees the on-disk version even after package.json was
|
|
12
|
+
# already require()d and then rewritten (the exact mechanism).
|
|
13
|
+
# 2. the installer's banner renders that fresh value — end to end, from a copy
|
|
14
|
+
# of bin/ whose version changes between process start and banner render.
|
|
15
|
+
# 3. neither CLI entry point still interpolates a cached `pkg.version` into a
|
|
16
|
+
# user-facing line (static guard: the cache is invisible at runtime until
|
|
17
|
+
# the day a self-update happens).
|
|
18
|
+
#
|
|
19
|
+
# Usage: bash scripts/test-bigpowers-cli-version.sh
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/skill-common.sh"
|
|
22
|
+
resolve_repo_root
|
|
23
|
+
cd "$REPO_ROOT"
|
|
24
|
+
|
|
25
|
+
source scripts/lib/test-assertions.sh
|
|
26
|
+
TA_PASS=0
|
|
27
|
+
TA_FAIL=0
|
|
28
|
+
TA_TMPDIR="$(mktemp -d)"
|
|
29
|
+
trap ta_cleanup EXIT
|
|
30
|
+
|
|
31
|
+
echo "=== test-bigpowers-cli-version.sh ==="
|
|
32
|
+
|
|
33
|
+
# ── 1. readPackageVersion ignores the require cache ─────────────────────────
|
|
34
|
+
mkdir -p "$TA_TMPDIR/pkgver"
|
|
35
|
+
if [ ! -f scripts/lib/cli-version.js ]; then
|
|
36
|
+
ta_fail "(1) scripts/lib/cli-version.js is missing — nothing reads the version from disk"
|
|
37
|
+
CACHE_OUT=""
|
|
38
|
+
else
|
|
39
|
+
CACHE_OUT="$(node -e '
|
|
40
|
+
const fs = require("fs"), path = require("path");
|
|
41
|
+
const dir = process.argv[1];
|
|
42
|
+
fs.writeFileSync(path.join(dir, "package.json"), JSON.stringify({ version: "2.88.5" }));
|
|
43
|
+
const cached = require(path.join(dir, "package.json")); // what bin/bigpowers.js does at startup
|
|
44
|
+
fs.writeFileSync(path.join(dir, "package.json"), JSON.stringify({ version: "2.92.0" })); // npm install -g @latest
|
|
45
|
+
const { readPackageVersion } = require(process.argv[2]);
|
|
46
|
+
process.stdout.write(`${cached.version}|${readPackageVersion(dir)}`);
|
|
47
|
+
' "$TA_TMPDIR/pkgver" "$REPO_ROOT/scripts/lib/cli-version.js")"
|
|
48
|
+
fi
|
|
49
|
+
if [ "$CACHE_OUT" = "2.88.5|2.92.0" ]; then
|
|
50
|
+
ta_pass "(1) readPackageVersion sees the on-disk version after package.json is rewritten"
|
|
51
|
+
else
|
|
52
|
+
ta_fail "(1) version read followed the require cache: got '$CACHE_OUT' (want '2.88.5|2.92.0')"
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
# ── 2. the banner an `update` run prints carries the new version ────────────
|
|
56
|
+
# Drive the exact sequence bin/bigpowers.js uses: read package.json at startup,
|
|
57
|
+
# let `npm install -g bigpowers@latest` replace it, then require bin/setup.js —
|
|
58
|
+
# which renders the banner. stdin at EOF makes setup draw the banner and exit, so
|
|
59
|
+
# nothing is installed and no prompt is answered.
|
|
60
|
+
FAKE_PKG="$TA_TMPDIR/fakepkg"
|
|
61
|
+
mkdir -p "$FAKE_PKG"
|
|
62
|
+
cp -R "$REPO_ROOT/bin" "$FAKE_PKG/bin"
|
|
63
|
+
cp -R "$REPO_ROOT/scripts" "$FAKE_PKG/scripts"
|
|
64
|
+
ln -sfn "$REPO_ROOT/node_modules" "$FAKE_PKG/node_modules"
|
|
65
|
+
printf '{"name":"bigpowers-fake","version":"2.88.5"}\n' > "$FAKE_PKG/package.json"
|
|
66
|
+
cat > "$FAKE_PKG/driver.js" <<'DRIVER'
|
|
67
|
+
// Mimics `bigpowers update`: snapshot at startup, reinstall over it, then render.
|
|
68
|
+
const { execFileSync } = require('child_process');
|
|
69
|
+
const fs = require('fs');
|
|
70
|
+
const path = require('path');
|
|
71
|
+
|
|
72
|
+
const root = __dirname;
|
|
73
|
+
const pkg = require(path.join(root, 'package.json')); // 2.88.5 — the version the process booted with
|
|
74
|
+
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: 'bigpowers-fake', version: '2.92.0' }));
|
|
75
|
+
process.stdout.write(`startup=${pkg.version}\n`);
|
|
76
|
+
require(path.join(root, 'bin', 'setup.js')); // prints the banner
|
|
77
|
+
DRIVER
|
|
78
|
+
BANNER_OUT="$(
|
|
79
|
+
cd "$FAKE_PKG"
|
|
80
|
+
HOME="$TA_TMPDIR/home" perl -e 'alarm 25; exec @ARGV' node driver.js < /dev/null 2>&1 || true
|
|
81
|
+
)"
|
|
82
|
+
if printf '%s' "$BANNER_OUT" | grep -q "startup=2.88.5" && printf '%s' "$BANNER_OUT" | grep -q "v2.92.0"; then
|
|
83
|
+
ta_pass "(2) the banner after a self-update reports the installed version (2.92.0), not the startup one (2.88.5)"
|
|
84
|
+
elif printf '%s' "$BANNER_OUT" | grep -q "v2.88.5"; then
|
|
85
|
+
ta_fail "(2) the banner reported the startup version (v2.88.5) after 2.92.0 was installed"
|
|
86
|
+
else
|
|
87
|
+
ta_fail "(2) no banner version found in the update flow"
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
# ── 3. no user-facing line interpolates the startup snapshot ────────────────
|
|
91
|
+
# `pkg.version` is the value captured when the process started. Anywhere it
|
|
92
|
+
# reaches the user after a self-update, it is the version that was replaced.
|
|
93
|
+
STALE=0
|
|
94
|
+
for f in bin/setup.js bin/bigpowers.js; do
|
|
95
|
+
grep -nE 'pkg\.version' "$f" | grep -vE '^\s*[0-9]+:\s*//' >/dev/null 2>&1 && STALE=1
|
|
96
|
+
done
|
|
97
|
+
if [ "$STALE" -eq 0 ]; then
|
|
98
|
+
ta_pass "(3) neither bin/setup.js nor bin/bigpowers.js prints a cached pkg.version"
|
|
99
|
+
else
|
|
100
|
+
ta_fail "(3) a CLI entry point still interpolates pkg.version (stale after self-update)"
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
echo "$TA_PASS passed, $TA_FAIL failed"
|
|
104
|
+
[[ "$TA_FAIL" -eq 0 ]]
|
package/CLAUDE.md
DELETED
|
@@ -1,400 +0,0 @@
|
|
|
1
|
-
# story: e38s08
|
|
2
|
-
# story: e51s05
|
|
3
|
-
# story: e45s22
|
|
4
|
-
# story: e45s23
|
|
5
|
-
# story: e55s03
|
|
6
|
-
|
|
7
|
-
# bigpowers — Claude Code
|
|
8
|
-
|
|
9
|
-
Read CONVENTIONS.md before any GitHub or git operation.
|
|
10
|
-
|
|
11
|
-
[`constitution.md`](constitution.md) is a consolidated entry point synthesizing
|
|
12
|
-
this project's doctrine (this file, CONVENTIONS.md, docs/PRINCIPLES.md,
|
|
13
|
-
docs/references/*.md) into bigspec's B0-B10 + Capstone blocks, with citations
|
|
14
|
-
back to the fuller text. It's a starting point for a reader, not a
|
|
15
|
-
replacement — this file remains fully authoritative for its own content today.
|
|
16
|
-
|
|
17
|
-
<!-- BEGIN bigpowers:context-routing -->
|
|
18
|
-
## Context Routing
|
|
19
|
-
|
|
20
|
-
Load subdirectory context **by file glob** — do not read the full doc tree up front.
|
|
21
|
-
|
|
22
|
-
| Glob / trigger | Load first | Fallback |
|
|
23
|
-
|----------------|------------|----------|
|
|
24
|
-
| `skills/**` | Active skill's `SKILL.md` + sibling `REFERENCE.md` if linked | `SKILL-INDEX.md` |
|
|
25
|
-
| `specs/epics/**` | Capsule `epic.yaml` + active story `-tasks.yaml` | `specs/release-plan.yaml` |
|
|
26
|
-
| `specs/product/**` | `SCOPE_LATEST.yaml`, `VISION_LATEST.yaml` | `specs/README.md` |
|
|
27
|
-
| `specs/tech-architecture/**` | `tech-stack.md` + epic `eNN-TEST_PLAN_LATEST.md` if present | `CONVENTIONS.md` |
|
|
28
|
-
| `scripts/**` | `CONVENTIONS.md` § Generated artifact targets | This file § Commands |
|
|
29
|
-
| `website/**` | `website/README.md` if present | Never edit `website/src/content/docs/` (generated) |
|
|
30
|
-
| `docs/**` | Matching doc under `docs/` | `docs/references/` |
|
|
31
|
-
| Default / session start | This file → `CONVENTIONS.md` → `specs/state.yaml` | `survey-context` |
|
|
32
|
-
|
|
33
|
-
Sub-AGENTS.md files (when present in consumer projects) override this table for their directory only.
|
|
34
|
-
<!-- END bigpowers:context-routing -->
|
|
35
|
-
|
|
36
|
-
<!-- BEGIN bigpowers:learned-preferences -->
|
|
37
|
-
## Learned User Preferences
|
|
38
|
-
|
|
39
|
-
_Durable preferences discovered across sessions. Update via `session-state` — do not infer from chat alone._
|
|
40
|
-
|
|
41
|
-
- Prefer `rtk`-prefixed shell commands for git, test, and build output (token savings).
|
|
42
|
-
- Run Preflight before forward work; never dismiss red gates as pre-existing.
|
|
43
|
-
- Edit `skills/*/SKILL.md` sources only — never `.cursor/rules/` or `.gemini/` artifacts.
|
|
44
|
-
|
|
45
|
-
## Workspace Facts
|
|
46
|
-
|
|
47
|
-
_Stable repo facts — prefer these over re-discovery._
|
|
48
|
-
|
|
49
|
-
- Stack: Markdown / Bash documentation project; skills sync via `bash scripts/sync-skills.sh`.
|
|
50
|
-
- Planning SoT: `specs/state.yaml`, `specs/release-plan.yaml`, `specs/execution-status.yaml`.
|
|
51
|
-
- Story traceability: `# story: eNNsNN` tags in implementing files; `bash scripts/trace-stories.sh --strict` in CI.
|
|
52
|
-
- Rule matrix: `bash scripts/compile-rule-matrix.sh` → `specs/rule-matrix.json` (P0–P3 tiers from CONVENTIONS.md).
|
|
53
|
-
<!-- END bigpowers:learned-preferences -->
|
|
54
|
-
|
|
55
|
-
## Project
|
|
56
|
-
|
|
57
|
-
bigpowers — agent skills for spec-driven, test-first software development by solo developers (skill count and catalog are auto-generated in `SKILL-INDEX.md`; never hardcode the count in docs).
|
|
58
|
-
Stack: Markdown / Bash (documentation-based; skills integrate with Claude Code, Cursor, Gemini CLI)
|
|
59
|
-
|
|
60
|
-
## Commands
|
|
61
|
-
|
|
62
|
-
| Action | Command |
|
|
63
|
-
|---------|---------|
|
|
64
|
-
| Install | `npm install -g bigpowers && bigpowers setup` |
|
|
65
|
-
| Run | `bash scripts/sync-skills.sh` |
|
|
66
|
-
| Test | N/A (documentation project) |
|
|
67
|
-
| Build | `bash scripts/install.sh` (from source) |
|
|
68
|
-
| Lint | `bash scripts/sync-skills.sh` (validates SKILL.md syntax) |
|
|
69
|
-
| Validate specs YAML | `bash scripts/validate-specs-yaml.sh` |
|
|
70
|
-
| Typecheck | N/A (Markdown / Bash project) |
|
|
71
|
-
| CI platform | GitHub Actions — one pipeline `.github/workflows/test-build-release.yml` (sync, verification-gates, skill-verify, story-verify → release, and → pages-build → pages-deploy when docs paths change); plus `publish-wiki.yml` |
|
|
72
|
-
| Compliance | `npm run compliance` |
|
|
73
|
-
| Verification Gates | `bash scripts/run-verification-gates.sh` |
|
|
74
|
-
| Traceability | `bash scripts/trace-stories.sh --strict` | grep for story tags (traceability check) |
|
|
75
|
-
| Preflight | `npm run compliance && bash scripts/run-verification-gates.sh && bash scripts/sync-skills.sh && bash scripts/trace-stories.sh --strict` | Full local green stack before forward work. Chain ends on `--strict` traceability — no trailing always-exit-0 step. |
|
|
76
|
-
| Catalog drift (advisory) | `bash scripts/check-catalog-drift.sh` | e54s02 Confirm gate during catalog freeze — always exits 0; run manually when changing skills, not part of Preflight. |
|
|
77
|
-
| CI | `gh pr checks` | Remote CI green when a PR is open |
|
|
78
|
-
|
|
79
|
-
### Pre-Merge Checklist
|
|
80
|
-
|
|
81
|
-
Before opening a PR or landing a branch, run:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
npm run compliance && bash scripts/run-verification-gates.sh
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
If any gate fails, fix before merging. Run `--baseline` after any intentional increase in skill count or structure.
|
|
88
|
-
|
|
89
|
-
**BCP Plus:** For stories sized with the 13-dimension BCP Plus methodology, confirm the `bcp_plus_breakdown` is present in the epic YAML and carried into `state.yaml` as `epic_cycle.bcp_plus`. See `docs/references/bcp-plus.md` for the NFR Gate pattern.
|
|
90
|
-
|
|
91
|
-
## Architecture
|
|
92
|
-
|
|
93
|
-
Collection of verb-noun skills under `skills/`, each with a SKILL.md source file and supporting documentation. Runtime specs live in `specs/state.yaml`, `specs/release-plan.yaml`, and `specs/execution-status.yaml`; intent in `specs/product/`; epic shards in `specs/epics/`. The sync-skills.sh script auto-generates artifacts for Cursor (.cursor/rules) and Gemini CLI (.gemini/extensions/bigpowers/) from SKILL.md sources. All planning output goes to specs/ at the project root.
|
|
94
|
-
|
|
95
|
-
## Conventions
|
|
96
|
-
|
|
97
|
-
- Skill directories under `skills/` use verb-noun naming (two words, kebab-case)
|
|
98
|
-
- Every skill has a single SKILL.md file as its source of truth
|
|
99
|
-
- All planning/spec output goes to specs/ at project root
|
|
100
|
-
- Artifacts in .cursor/rules and .gemini/ are auto-generated; edit SKILL.md, not artifacts
|
|
101
|
-
- Run sync-skills.sh after any SKILL.md changes to regenerate artifacts
|
|
102
|
-
- Website content in website/src/content/docs/ is auto-generated by prebuild; edit repo sources, not site files
|
|
103
|
-
|
|
104
|
-
## Never
|
|
105
|
-
|
|
106
|
-
- Never edit .cursor/rules or .gemini/extensions/ directly — these are generated files
|
|
107
|
-
- Never edit website/src/content/docs/ directly — these are generated files; website/ is the fourth generated artifact target (alongside .cursor/, .gemini/, .pi/)
|
|
108
|
-
- Never create a skill without a SKILL.md file and proper verb-noun naming
|
|
109
|
-
- Never push changes without running sync-skills.sh first
|
|
110
|
-
|
|
111
|
-
## Token Management
|
|
112
|
-
|
|
113
|
-
**Mechanical backstop (e45s03):** `scripts/hooks/token-mgmt-pre-tool-use.sh` blocks oversized tool calls when prose rules are ignored. Wire as a `PreToolUse` hook for `Read`, `Grep`, and `Bash` (alongside `hooks/pre-tool-use.sh` for git safety). Thresholds: Read >100KB, Grep >200 matches without `head_limit`, Bash commands likely to exceed 500 output lines without `rtk`/`sqz compress`. Install snippet:
|
|
114
|
-
|
|
115
|
-
```json
|
|
116
|
-
{
|
|
117
|
-
"hooks": {
|
|
118
|
-
"PreToolUse": [
|
|
119
|
-
{ "matcher": "Read|Grep|Bash", "hooks": [{ "type": "command", "command": "bash scripts/hooks/token-mgmt-pre-tool-use.sh" }] }
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Context engineering (write/select/compress/isolate — see `docs/references/context-engineering.md`):
|
|
126
|
-
|
|
127
|
-
- **Write (token-efficient content):** Short functions (4-20 lines), unique symbol names, headless tests. Don't restate code in comments.
|
|
128
|
-
- **Select (include only what's relevant):** Use `bts_map` for ranked file lists, `survey-context` for phase bootstrap. Don't read files you don't need.
|
|
129
|
-
- **Compress (reduce without losing structure):** Use `bts_compress` or pipe through `sqz compress`. Use `rtk` for build/test/git output (60-99% savings). Prefer `terse-mode` when context is heavy.
|
|
130
|
-
- **Isolate (partition work):** Use `kickoff-branch` for isolated worktrees, `dispatch-agents` for parallel tasks with disjoint scopes, `session-state` for cold-start handoff.
|
|
131
|
-
|
|
132
|
-
**Effort classification:** Skills carry an `effort:` frontmatter field (`light` | `standard` | `heavy`). Prefer `light` skills for bootstrap/status checks; reserve `heavy` for epic builds and multi-phase planning.
|
|
133
|
-
|
|
134
|
-
- **Auto-Terse**: When a session exceeds 20 turns or the context window feels "heavy" (latency increasing), you MUST switch to `terse-mode` to save tokens.
|
|
135
|
-
- **Context Compaction**: Every 10 turns, summarize the current session state and implementation decisions into a short, high-density note.
|
|
136
|
-
- **Minimal Output**: Prefer text-only output for simple status; use `web_fetch` or `run_shell_command` only for evidence.
|
|
137
|
-
- **Stream Stability**: When writing large files or long documents, output continuously in chunks of ~200 lines. Do not pause. If you need time to process, emit a placeholder comment rather than going silent.
|
|
138
|
-
|
|
139
|
-
## Session Start
|
|
140
|
-
|
|
141
|
-
Before any task, run this sequence — not optional:
|
|
142
|
-
|
|
143
|
-
1. Read `CLAUDE.md` (this file)
|
|
144
|
-
2. Read `CONVENTIONS.md`
|
|
145
|
-
3. Read `specs/state.yaml` if it exists — current session and active epic
|
|
146
|
-
4. Read `specs/release-plan.yaml` if it exists — active release context
|
|
147
|
-
|
|
148
|
-
## Agent Rules
|
|
149
|
-
|
|
150
|
-
- **Workflow Mandate:** You MUST use the bigpowers skills (e.g., `plan-work`, `develop-tdd`, `craft-skill`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
|
|
151
|
-
- **Always Green / fix-or-log:** Preflight and CI must be green before forward work. Any reproducible gate failure during unrelated work requires **quick-fix** or **fix-bug** — see CONVENTIONS § Discovered Defects. Never dismiss failures as pre-existing or out of scope.
|
|
152
|
-
- Read specs/ and CONVENTIONS.md before writing code.
|
|
153
|
-
- Write the minimum code that solves the stated problem. Nothing extra.
|
|
154
|
-
- Run tests after every change. Show evidence before declaring done.
|
|
155
|
-
- One clarifying question beats a wrong assumption baked into 200 lines.
|
|
156
|
-
- All written output (plans, specs, investigations) goes in specs/.
|
|
157
|
-
|
|
158
|
-
## bts toolchain
|
|
159
|
-
|
|
160
|
-
`bts` is installed. Prefer its verbs over ad-hoc shell commands.
|
|
161
|
-
|
|
162
|
-
| Task | Command | Avoid |
|
|
163
|
-
|------|---------|-------|
|
|
164
|
-
| Search code | `bts find --print <pattern>` | grep / find / cat |
|
|
165
|
-
| Interactive search | `bts find <pattern>` | manual grep pipes |
|
|
166
|
-
| Compress for context | `bts compress <file>` or `cmd \| bts compress` | summarising by hand |
|
|
167
|
-
| Repo map | `bts map` | listing files by hand |
|
|
168
|
-
| Library docs | `bts docs <lib>` | guessing from training data |
|
|
169
|
-
| Package source | `bts src <pkg>` | git clone |
|
|
170
|
-
| Toolchain health | `bts doctor` | which / command -v |
|
|
171
|
-
|
|
172
|
-
**Rules**
|
|
173
|
-
- Search with `bts find` before opening files to locate a symbol or pattern.
|
|
174
|
-
- Pipe anything > 200 lines through `bts compress` before adding to context.
|
|
175
|
-
- Run `bts map` when asked for a repo overview.
|
|
176
|
-
- Use `bts docs <lib>` before answering questions about library APIs. Doc fetches use `scripts/lib/doc-fetch-cache.sh` (ETag-revalidated, 300s TTL).
|
|
177
|
-
- If a tool is missing, say so and run `bts doctor` — do not silently substitute.
|
|
178
|
-
|
|
179
|
-
<!-- BEGIN rtk-pretooluse-hook (e45s16 — mechanical PreToolUse backstop; remove block to disable) -->
|
|
180
|
-
|
|
181
|
-
**RTK hook (installed):** `scripts/hooks/rtk-rewrite.sh` is symlinked into `~/.claude/hooks/` by `bash scripts/install.sh` and registered as a Bash `PreToolUse` hook. It delegates to `rtk hook claude` — prose rules below are a fallback only when the hook is absent.
|
|
182
|
-
|
|
183
|
-
<!-- END rtk-pretooluse-hook -->
|
|
184
|
-
|
|
185
|
-
<!-- BEGIN sqz-claude-guidance (auto-installed by sqz init; remove this block to disable) -->
|
|
186
|
-
|
|
187
|
-
## sqz — Context Compression (READ FIRST)
|
|
188
|
-
|
|
189
|
-
sqz is installed in this project. It compresses tool output so large
|
|
190
|
-
files, long logs, and verbose command output cost far fewer tokens.
|
|
191
|
-
There are **two ways** sqz is wired in, and you should prefer each
|
|
192
|
-
one in the situations below.
|
|
193
|
-
|
|
194
|
-
### Preferred tools (MCP)
|
|
195
|
-
|
|
196
|
-
The `sqz-mcp` server is registered in this project's MCP config. It
|
|
197
|
-
exposes three read-only tools that compress their output through the
|
|
198
|
-
sqz pipeline:
|
|
199
|
-
|
|
200
|
-
- **`sqz_read_file`** — read a file from disk and return a compressed
|
|
201
|
-
view. **PREFER this over the built-in `Read` tool** for any file
|
|
202
|
-
larger than ~2KB or any file you might read more than once in the
|
|
203
|
-
same session. Repeat reads return a 13-token `§ref:HASH§` reference
|
|
204
|
-
instead of the full content.
|
|
205
|
-
|
|
206
|
-
- **`sqz_grep`** — search files for a literal string or regex.
|
|
207
|
-
**PREFER this over the built-in `Grep`** for anything that might
|
|
208
|
-
match more than a handful of lines. Caps at 200 matches by default;
|
|
209
|
-
raise with `max_matches` if needed.
|
|
210
|
-
|
|
211
|
-
- **`sqz_list_dir`** — list a directory. Skips `.git`, `node_modules`,
|
|
212
|
-
`target`, `dist`, `build`, `vendor`, `__pycache__` so the output
|
|
213
|
-
stays focused. **PREFER this over `ls -la` via Bash** when you want
|
|
214
|
-
to see a project layout.
|
|
215
|
-
|
|
216
|
-
The built-in `Read`, `Grep`, `Glob` tools remain available. Use them for:
|
|
217
|
-
- Tiny config files (<1KB) where compression can't help.
|
|
218
|
-
- Byte-exact reads you'll hash or diff (lockfiles, signatures).
|
|
219
|
-
- Globbing (sqz has no glob tool; `Glob` is still the right choice).
|
|
220
|
-
|
|
221
|
-
### Bash commands (hooked automatically)
|
|
222
|
-
|
|
223
|
-
When you run a shell command through the `Bash` tool, a PreToolUse hook
|
|
224
|
-
rewrites it to pipe output through `sqz compress`. This is transparent:
|
|
225
|
-
you don't need to remember to add anything, but it's useful to know
|
|
226
|
-
that these commands get compressed automatically:
|
|
227
|
-
|
|
228
|
-
```bash
|
|
229
|
-
git status # → git status 2>&1 | sqz compress --cmd git
|
|
230
|
-
cargo test # → cargo test 2>&1 | sqz compress --cmd cargo
|
|
231
|
-
docker ps # → docker ps 2>&1 | sqz compress --cmd docker
|
|
232
|
-
kubectl get pods # → kubectl get pods 2>&1 | sqz compress --cmd kubectl
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
The rewrite is skipped for interactive commands (`vim`, `ssh`,
|
|
236
|
-
`python`), compound commands (`a && b`, `a > file.txt`), and anything
|
|
237
|
-
already going through sqz.
|
|
238
|
-
|
|
239
|
-
### Escape hatch — when you see a `§ref:HASH§` token
|
|
240
|
-
|
|
241
|
-
If tool output contains a `§ref:a1b2c3d4§` token and you need the full
|
|
242
|
-
content it points at, resolve it. Three equivalent ways:
|
|
243
|
-
|
|
244
|
-
- Shell: `/Users/danielvm/.local/bin/sqz expand a1b2c3d4` (or paste the whole token
|
|
245
|
-
`/Users/danielvm/.local/bin/sqz expand §ref:a1b2c3d4§`).
|
|
246
|
-
- MCP tool: call `expand` with `{ "prefix": "a1b2c3d4" }`.
|
|
247
|
-
- To get uncompressed output for one command: prefix it with
|
|
248
|
-
`SQZ_NO_DEDUP=1` (e.g. `SQZ_NO_DEDUP=1 git log | sqz compress`).
|
|
249
|
-
|
|
250
|
-
If the compressed output is actively making the task harder (looping
|
|
251
|
-
on refs, small retries replacing one big read), call the `passthrough`
|
|
252
|
-
MCP tool to get raw text.
|
|
253
|
-
|
|
254
|
-
### When NOT to use sqz tools
|
|
255
|
-
|
|
256
|
-
- Writing or editing files — use the built-in `Write`/`Edit` tools.
|
|
257
|
-
sqz has no write tools (by design; see issue #5 follow-up).
|
|
258
|
-
- Running commands interactively or in watch mode.
|
|
259
|
-
- Reading very small files (<1KB) where compression can't help.
|
|
260
|
-
|
|
261
|
-
<!-- END sqz-claude-guidance -->
|
|
262
|
-
|
|
263
|
-
<!-- rtk-instructions v2 -->
|
|
264
|
-
# RTK (Rust Token Killer) - Token-Optimized Commands
|
|
265
|
-
|
|
266
|
-
## Golden Rule
|
|
267
|
-
|
|
268
|
-
**Always prefix commands with `rtk`**. If RTK has a dedicated filter, it uses it. If not, it passes through unchanged. This means RTK is always safe to use.
|
|
269
|
-
|
|
270
|
-
**Important**: Even in command chains with `&&`, use `rtk`:
|
|
271
|
-
```bash
|
|
272
|
-
# ❌ Wrong
|
|
273
|
-
git add . && git commit -m "msg" && git push
|
|
274
|
-
|
|
275
|
-
# ✅ Correct
|
|
276
|
-
rtk git add . && rtk git commit -m "msg" && rtk git push
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
## RTK Commands by Workflow
|
|
280
|
-
|
|
281
|
-
### Build & Compile (80-90% savings)
|
|
282
|
-
```bash
|
|
283
|
-
rtk cargo build # Cargo build output
|
|
284
|
-
rtk cargo check # Cargo check output
|
|
285
|
-
rtk cargo clippy # Clippy warnings grouped by file (80%)
|
|
286
|
-
rtk tsc # TypeScript errors grouped by file/code (83%)
|
|
287
|
-
rtk lint # ESLint/Biome violations grouped (84%)
|
|
288
|
-
rtk prettier --check # Files needing format only (70%)
|
|
289
|
-
rtk next build # Next.js build with route metrics (87%)
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
### Test (60-99% savings)
|
|
293
|
-
```bash
|
|
294
|
-
rtk cargo test # Cargo test failures only (90%)
|
|
295
|
-
rtk go test # Go test failures only (90%)
|
|
296
|
-
rtk jest # Jest failures only (99.5%)
|
|
297
|
-
rtk vitest # Vitest failures only (99.5%)
|
|
298
|
-
rtk playwright test # Playwright failures only (94%)
|
|
299
|
-
rtk pytest # Python test failures only (90%)
|
|
300
|
-
rtk rake test # Ruby test failures only (90%)
|
|
301
|
-
rtk rspec # RSpec test failures only (60%)
|
|
302
|
-
rtk test <cmd> # Generic test wrapper - failures only
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
### Git (59-80% savings)
|
|
306
|
-
```bash
|
|
307
|
-
rtk git status # Compact status
|
|
308
|
-
rtk git log # Compact log (works with all git flags)
|
|
309
|
-
rtk git diff # Compact diff (80%)
|
|
310
|
-
rtk git show # Compact show (80%)
|
|
311
|
-
rtk git add # Ultra-compact confirmations (59%)
|
|
312
|
-
rtk git commit # Ultra-compact confirmations (59%)
|
|
313
|
-
rtk git push # Ultra-compact confirmations
|
|
314
|
-
rtk git pull # Ultra-compact confirmations
|
|
315
|
-
rtk git branch # Compact branch list
|
|
316
|
-
rtk git fetch # Compact fetch
|
|
317
|
-
rtk git stash # Compact stash
|
|
318
|
-
rtk git worktree # Compact worktree
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
Note: Git passthrough works for ALL subcommands, even those not explicitly listed.
|
|
322
|
-
|
|
323
|
-
### GitHub (26-87% savings)
|
|
324
|
-
```bash
|
|
325
|
-
rtk gh pr view <num> # Compact PR view (87%)
|
|
326
|
-
rtk gh pr checks # Compact PR checks (79%)
|
|
327
|
-
rtk gh run list # Compact workflow runs (82%)
|
|
328
|
-
rtk gh issue list # Compact issue list (80%)
|
|
329
|
-
rtk gh api # Compact API responses (26%)
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
### JavaScript/TypeScript Tooling (70-90% savings)
|
|
333
|
-
```bash
|
|
334
|
-
rtk pnpm list # Compact dependency tree (70%)
|
|
335
|
-
rtk pnpm outdated # Compact outdated packages (80%)
|
|
336
|
-
rtk pnpm install # Compact install output (90%)
|
|
337
|
-
rtk npm run <script> # Compact npm script output
|
|
338
|
-
rtk npx <cmd> # Compact npx command output
|
|
339
|
-
rtk prisma # Prisma without ASCII art (88%)
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
### Files & Search (60-75% savings)
|
|
343
|
-
```bash
|
|
344
|
-
rtk ls <path> # Tree format, compact (65%)
|
|
345
|
-
rtk read <file> # Code reading with filtering (60%)
|
|
346
|
-
rtk grep <pattern> # Search grouped by file (75%). Format flags (-c, -l, -L, -o, -Z) run raw.
|
|
347
|
-
rtk find <pattern> # Find grouped by directory (70%)
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
### Analysis & Debug (70-90% savings)
|
|
351
|
-
```bash
|
|
352
|
-
rtk err <cmd> # Filter errors only from any command
|
|
353
|
-
rtk log <file> # Deduplicated logs with counts
|
|
354
|
-
rtk json <file> # JSON structure without values
|
|
355
|
-
rtk deps # Dependency overview
|
|
356
|
-
rtk env # Environment variables compact
|
|
357
|
-
rtk summary <cmd> # Smart summary of command output
|
|
358
|
-
rtk diff # Ultra-compact diffs
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
### Infrastructure (85% savings)
|
|
362
|
-
```bash
|
|
363
|
-
rtk docker ps # Compact container list
|
|
364
|
-
rtk docker images # Compact image list
|
|
365
|
-
rtk docker logs <c> # Deduplicated logs
|
|
366
|
-
rtk kubectl get # Compact resource list
|
|
367
|
-
rtk kubectl logs # Deduplicated pod logs
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
### Network (65-70% savings)
|
|
371
|
-
```bash
|
|
372
|
-
rtk curl <url> # Compact HTTP responses (70%)
|
|
373
|
-
rtk wget <url> # Compact download output (65%)
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
### Meta Commands
|
|
377
|
-
```bash
|
|
378
|
-
rtk gain # View token savings statistics
|
|
379
|
-
rtk gain --history # View command history with savings
|
|
380
|
-
rtk discover # Analyze Claude Code sessions for missed RTK usage
|
|
381
|
-
rtk proxy <cmd> # Run command without filtering (for debugging)
|
|
382
|
-
rtk init # Add RTK instructions to CLAUDE.md
|
|
383
|
-
rtk init --global # Add RTK to ~/.claude/CLAUDE.md
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
## Token Savings Overview
|
|
387
|
-
|
|
388
|
-
| Category | Commands | Typical Savings |
|
|
389
|
-
|----------|----------|-----------------|
|
|
390
|
-
| Tests | vitest, playwright, cargo test | 90-99% |
|
|
391
|
-
| Build | next, tsc, lint, prettier | 70-87% |
|
|
392
|
-
| Git | status, log, diff, add, commit | 59-80% |
|
|
393
|
-
| GitHub | gh pr, gh run, gh issue | 26-87% |
|
|
394
|
-
| Package Managers | pnpm, npm, npx | 70-90% |
|
|
395
|
-
| Files | ls, read, grep, find | 60-75% |
|
|
396
|
-
| Infrastructure | docker, kubectl | 85% |
|
|
397
|
-
| Network | curl, wget | 65-70% |
|
|
398
|
-
|
|
399
|
-
Overall average: **60-90% token reduction** on common development operations.
|
|
400
|
-
<!-- /rtk-instructions -->
|
package/GEMINI.md
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# bigpowers — Gemini CLI
|
|
2
|
-
|
|
3
|
-
> **Auto-generated** by `sync-skills.sh` from `CLAUDE.md`. Edit CLAUDE.md, not this file.
|
|
4
|
-
|
|
5
|
-
Read CONVENTIONS.md before any GitHub or git operation.
|
|
6
|
-
|
|
7
|
-
## Project
|
|
8
|
-
|
|
9
|
-
bigpowers — 58 agent skills for spec-driven, test-first software development by solo developers.
|
|
10
|
-
Stack: Markdown / Bash (documentation-based; skills integrate with Claude Code, Cursor, Gemini CLI)
|
|
11
|
-
|
|
12
|
-
## Commands
|
|
13
|
-
|
|
14
|
-
| Action | Command |
|
|
15
|
-
|---------|---------|
|
|
16
|
-
| Install | `npm install -g bigpowers && bigpowers setup` |
|
|
17
|
-
| Run | `bash scripts/sync-skills.sh` |
|
|
18
|
-
| Test | N/A (documentation project) |
|
|
19
|
-
| Build | `bash scripts/install.sh` (from source) |
|
|
20
|
-
| Lint | `bash scripts/sync-skills.sh` (validates SKILL.md syntax) |
|
|
21
|
-
|
|
22
|
-
## Architecture
|
|
23
|
-
|
|
24
|
-
Collection of 58 verb-noun skills, each with a SKILL.md source file and supporting documentation. Includes Verify phase and profiles/. The sync-skills.sh script auto-generates artifacts for Cursor (.cursor/rules) and Gemini CLI (.gemini/extensions/bigpowers/) from SKILL.md sources. All planning and spec output goes to specs/ at the project root.
|
|
25
|
-
|
|
26
|
-
## Conventions
|
|
27
|
-
|
|
28
|
-
- Skill directories use verb-noun naming (two words, kebab-case)
|
|
29
|
-
- Every skill has a single SKILL.md file as its source of truth
|
|
30
|
-
- All planning/spec output goes to specs/ at project root
|
|
31
|
-
- Artifacts in .cursor/rules and .gemini/ are auto-generated; edit SKILL.md, not artifacts
|
|
32
|
-
- Run sync-skills.sh after any SKILL.md changes to regenerate artifacts
|
|
33
|
-
|
|
34
|
-
## Never
|
|
35
|
-
|
|
36
|
-
- Never edit .cursor/rules or .gemini/extensions/ directly — these are generated files
|
|
37
|
-
- Never create a skill without a SKILL.md file and proper verb-noun naming
|
|
38
|
-
- Never push changes without running sync-skills.sh first
|
|
39
|
-
|
|
40
|
-
## Token Management
|
|
41
|
-
|
|
42
|
-
- **Auto-Terse**: When a session exceeds 20 turns or the context window feels "heavy" (latency increasing), you MUST switch to `terse-mode` to save tokens.
|
|
43
|
-
- **Context Compaction**: Every 10 turns, summarize the current session state and implementation decisions into a short, high-density note.
|
|
44
|
-
- **Minimal Output**: Prefer text-only output for simple status; use `web_fetch` or `run_shell_command` only for evidence.
|
|
45
|
-
|
|
46
|
-
## Agent Rules
|
|
47
|
-
|
|
48
|
-
- **Workflow Mandate:** You MUST use the bigpowers skills (e.g., `plan-work`, `develop-tdd`, `craft-skill`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
|
|
49
|
-
- Read specs/ and CONVENTIONS.md before writing code.
|
|
50
|
-
- Write the minimum code that solves the stated problem. Nothing extra.
|
|
51
|
-
- Never refactor, rename, or reorganize code outside the task scope.
|
|
52
|
-
- Run tests after every change. Show evidence before declaring done.
|
|
53
|
-
- One clarifying question beats a wrong assumption baked into 200 lines.
|
|
54
|
-
- All written output (plans, specs, investigations) goes in specs/.
|
|
55
|
-
|
|
56
|
-
## bts toolchain
|
|
57
|
-
|
|
58
|
-
`bts` is installed. Prefer its verbs over ad-hoc shell commands.
|
|
59
|
-
|
|
60
|
-
| Task | Command | Avoid |
|
|
61
|
-
|------|---------|-------|
|
|
62
|
-
| Search code | `bts find --print <pattern>` | grep / find / cat |
|
|
63
|
-
| Interactive search | `bts find <pattern>` | manual grep pipes |
|
|
64
|
-
| Compress for context | `bts compress <file>` or `cmd \| bts compress` | summarising by hand |
|
|
65
|
-
| Repo map | `bts map` | listing files by hand |
|
|
66
|
-
| Library docs | `bts docs <lib>` | guessing from training data |
|
|
67
|
-
| Package source | `bts src <pkg>` | git clone |
|
|
68
|
-
| Toolchain health | `bts doctor` | which / command -v |
|
|
69
|
-
|
|
70
|
-
**Rules**
|
|
71
|
-
- Search with `bts find` before opening files to locate a symbol or pattern.
|
|
72
|
-
- Pipe anything > 200 lines through `bts compress` before adding to context.
|
|
73
|
-
- Run `bts map` when asked for a repo overview.
|
|
74
|
-
- Use `bts docs <lib>` before answering questions about library APIs.
|
|
75
|
-
- If a tool is missing, say so and run `bts doctor` — do not silently substitute.
|