bigpowers 2.87.3 → 2.87.5
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/.cursor/rules/align-grid.mdc +109 -0
- package/.cursor/rules/assess-impact.mdc +90 -0
- package/.cursor/rules/audit-code.mdc +183 -0
- package/.cursor/rules/audit-plan.mdc +88 -0
- package/.cursor/rules/build-epic.mdc +104 -0
- package/.cursor/rules/change-request.mdc +120 -0
- package/.cursor/rules/commit-message.mdc +139 -0
- package/.cursor/rules/compose-workflow.mdc +81 -0
- package/.cursor/rules/context7-mcp.mdc +54 -0
- package/.cursor/rules/craft-skill.mdc +195 -0
- package/.cursor/rules/deepen-architecture.mdc +259 -0
- package/.cursor/rules/define-language.mdc +79 -0
- package/.cursor/rules/define-success.mdc +11 -0
- package/.cursor/rules/delegate-task.mdc +90 -0
- package/.cursor/rules/deploy.mdc +197 -0
- package/.cursor/rules/design-interface.mdc +96 -0
- package/.cursor/rules/develop-tdd.mdc +415 -0
- package/.cursor/rules/diagnose-root.mdc +23 -0
- package/.cursor/rules/diagnose-stall.mdc +53 -0
- package/.cursor/rules/dispatch-agents.mdc +117 -0
- package/.cursor/rules/edit-document.mdc +22 -0
- package/.cursor/rules/elaborate-spec.mdc +100 -0
- package/.cursor/rules/enforce-first.mdc +44 -0
- package/.cursor/rules/evolve-skill.mdc +54 -0
- package/.cursor/rules/execute-plan.mdc +60 -0
- package/.cursor/rules/extract-design.mdc +131 -0
- package/.cursor/rules/find-way.mdc +190 -0
- package/.cursor/rules/fix-bug.mdc +66 -0
- package/.cursor/rules/gate-trace.mdc +91 -0
- package/.cursor/rules/generate-allure-report.mdc +284 -0
- package/.cursor/rules/grill-me.mdc +107 -0
- package/.cursor/rules/grill-with-docs.mdc +52 -0
- package/.cursor/rules/guard-git.mdc +230 -0
- package/.cursor/rules/harden-vps.mdc +290 -0
- package/.cursor/rules/hook-commits.mdc +93 -0
- package/.cursor/rules/inspect-quality.mdc +105 -0
- package/.cursor/rules/investigate-bug.mdc +126 -0
- package/.cursor/rules/kickoff-branch.mdc +142 -0
- package/.cursor/rules/maintain-wiki.mdc +63 -0
- package/.cursor/rules/map-codebase.mdc +70 -0
- package/.cursor/rules/migrate-spec.mdc +907 -0
- package/.cursor/rules/model-domain.mdc +231 -0
- package/.cursor/rules/orchestrate-project.mdc +173 -0
- package/.cursor/rules/organize-workspace.mdc +163 -0
- package/.cursor/rules/plan-refactor.mdc +86 -0
- package/.cursor/rules/plan-release.mdc +144 -0
- package/.cursor/rules/plan-tests.mdc +74 -0
- package/.cursor/rules/plan-work.mdc +271 -0
- package/.cursor/rules/publish-package.mdc +337 -0
- package/.cursor/rules/quick-fix.mdc +113 -0
- package/.cursor/rules/release-branch.mdc +301 -0
- package/.cursor/rules/request-review.mdc +112 -0
- package/.cursor/rules/research-first.mdc +86 -0
- package/.cursor/rules/reset-baseline.mdc +20 -0
- package/.cursor/rules/respond-review.mdc +70 -0
- package/.cursor/rules/run-benchmark.mdc +84 -0
- package/.cursor/rules/run-evals.mdc +79 -0
- package/.cursor/rules/run-planning.mdc +100 -0
- package/.cursor/rules/scope-work.mdc +62 -0
- package/.cursor/rules/search-skills.mdc +72 -0
- package/.cursor/rules/security-review.mdc +383 -0
- package/.cursor/rules/seed-conventions.mdc +311 -0
- package/.cursor/rules/session-state.mdc +145 -0
- package/.cursor/rules/setup-environment.mdc +38 -0
- package/.cursor/rules/simple-english.mdc +345 -0
- package/.cursor/rules/simulate-agents.mdc +25 -0
- package/.cursor/rules/slice-tasks.mdc +67 -0
- package/.cursor/rules/smoke-test.mdc +260 -0
- package/.cursor/rules/spike-prototype.mdc +94 -0
- package/.cursor/rules/stocktake-skills.mdc +73 -0
- package/.cursor/rules/survey-context.mdc +134 -0
- package/.cursor/rules/terse-mode.mdc +41 -0
- package/.cursor/rules/trace-requirement.mdc +68 -0
- package/.cursor/rules/using-bigpowers.mdc +110 -0
- package/.cursor/rules/validate-contracts.mdc +285 -0
- package/.cursor/rules/validate-fix.mdc +146 -0
- package/.cursor/rules/verify-work.mdc +190 -0
- package/.cursor/rules/visual-dashboard.mdc +49 -0
- package/.cursor/rules/wire-ci.mdc +380 -0
- package/.cursor/rules/wire-observability.mdc +96 -0
- package/.cursor/rules/write-document.mdc +280 -0
- package/.gemini/extensions/bigpowers/commands/prompts/align-grid.md +109 -0
- package/.gemini/extensions/bigpowers/commands/prompts/assess-impact.md +90 -0
- package/.gemini/extensions/bigpowers/commands/prompts/audit-code.md +183 -0
- package/.gemini/extensions/bigpowers/commands/prompts/audit-plan.md +88 -0
- package/.gemini/extensions/bigpowers/commands/prompts/build-epic.md +104 -0
- package/.gemini/extensions/bigpowers/commands/prompts/change-request.md +120 -0
- package/.gemini/extensions/bigpowers/commands/prompts/commit-message.md +139 -0
- package/.gemini/extensions/bigpowers/commands/prompts/compose-workflow.md +81 -0
- package/.gemini/extensions/bigpowers/commands/prompts/context7-mcp.md +54 -0
- package/.gemini/extensions/bigpowers/commands/prompts/craft-skill.md +195 -0
- package/.gemini/extensions/bigpowers/commands/prompts/deepen-architecture.md +259 -0
- package/.gemini/extensions/bigpowers/commands/prompts/define-language.md +79 -0
- package/.gemini/extensions/bigpowers/commands/prompts/define-success.md +11 -0
- package/.gemini/extensions/bigpowers/commands/prompts/delegate-task.md +90 -0
- package/.gemini/extensions/bigpowers/commands/prompts/deploy.md +197 -0
- package/.gemini/extensions/bigpowers/commands/prompts/design-interface.md +96 -0
- package/.gemini/extensions/bigpowers/commands/prompts/develop-tdd.md +415 -0
- package/.gemini/extensions/bigpowers/commands/prompts/diagnose-root.md +23 -0
- package/.gemini/extensions/bigpowers/commands/prompts/diagnose-stall.md +53 -0
- package/.gemini/extensions/bigpowers/commands/prompts/dispatch-agents.md +117 -0
- package/.gemini/extensions/bigpowers/commands/prompts/edit-document.md +22 -0
- package/.gemini/extensions/bigpowers/commands/prompts/elaborate-spec.md +100 -0
- package/.gemini/extensions/bigpowers/commands/prompts/enforce-first.md +44 -0
- package/.gemini/extensions/bigpowers/commands/prompts/evolve-skill.md +54 -0
- package/.gemini/extensions/bigpowers/commands/prompts/execute-plan.md +60 -0
- package/.gemini/extensions/bigpowers/commands/prompts/extract-design.md +131 -0
- package/.gemini/extensions/bigpowers/commands/prompts/find-way.md +190 -0
- package/.gemini/extensions/bigpowers/commands/prompts/fix-bug.md +66 -0
- package/.gemini/extensions/bigpowers/commands/prompts/gate-trace.md +91 -0
- package/.gemini/extensions/bigpowers/commands/prompts/generate-allure-report.md +284 -0
- package/.gemini/extensions/bigpowers/commands/prompts/grill-me.md +107 -0
- package/.gemini/extensions/bigpowers/commands/prompts/grill-with-docs.md +52 -0
- package/.gemini/extensions/bigpowers/commands/prompts/guard-git.md +230 -0
- package/.gemini/extensions/bigpowers/commands/prompts/harden-vps.md +290 -0
- package/.gemini/extensions/bigpowers/commands/prompts/hook-commits.md +93 -0
- package/.gemini/extensions/bigpowers/commands/prompts/inspect-quality.md +105 -0
- package/.gemini/extensions/bigpowers/commands/prompts/investigate-bug.md +126 -0
- package/.gemini/extensions/bigpowers/commands/prompts/kickoff-branch.md +142 -0
- package/.gemini/extensions/bigpowers/commands/prompts/maintain-wiki.md +63 -0
- package/.gemini/extensions/bigpowers/commands/prompts/map-codebase.md +70 -0
- package/.gemini/extensions/bigpowers/commands/prompts/migrate-spec.md +907 -0
- package/.gemini/extensions/bigpowers/commands/prompts/model-domain.md +231 -0
- package/.gemini/extensions/bigpowers/commands/prompts/orchestrate-project.md +173 -0
- package/.gemini/extensions/bigpowers/commands/prompts/organize-workspace.md +163 -0
- package/.gemini/extensions/bigpowers/commands/prompts/plan-refactor.md +86 -0
- package/.gemini/extensions/bigpowers/commands/prompts/plan-release.md +144 -0
- package/.gemini/extensions/bigpowers/commands/prompts/plan-tests.md +74 -0
- package/.gemini/extensions/bigpowers/commands/prompts/plan-work.md +271 -0
- package/.gemini/extensions/bigpowers/commands/prompts/publish-package.md +337 -0
- package/.gemini/extensions/bigpowers/commands/prompts/quick-fix.md +113 -0
- package/.gemini/extensions/bigpowers/commands/prompts/release-branch.md +301 -0
- package/.gemini/extensions/bigpowers/commands/prompts/request-review.md +112 -0
- package/.gemini/extensions/bigpowers/commands/prompts/research-first.md +86 -0
- package/.gemini/extensions/bigpowers/commands/prompts/reset-baseline.md +20 -0
- package/.gemini/extensions/bigpowers/commands/prompts/respond-review.md +70 -0
- package/.gemini/extensions/bigpowers/commands/prompts/run-benchmark.md +84 -0
- package/.gemini/extensions/bigpowers/commands/prompts/run-evals.md +79 -0
- package/.gemini/extensions/bigpowers/commands/prompts/run-planning.md +100 -0
- package/.gemini/extensions/bigpowers/commands/prompts/scope-work.md +62 -0
- package/.gemini/extensions/bigpowers/commands/prompts/search-skills.md +72 -0
- package/.gemini/extensions/bigpowers/commands/prompts/security-review.md +383 -0
- package/.gemini/extensions/bigpowers/commands/prompts/seed-conventions.md +311 -0
- package/.gemini/extensions/bigpowers/commands/prompts/session-state.md +145 -0
- package/.gemini/extensions/bigpowers/commands/prompts/setup-environment.md +38 -0
- package/.gemini/extensions/bigpowers/commands/prompts/simple-english.md +345 -0
- package/.gemini/extensions/bigpowers/commands/prompts/simulate-agents.md +25 -0
- package/.gemini/extensions/bigpowers/commands/prompts/slice-tasks.md +67 -0
- package/.gemini/extensions/bigpowers/commands/prompts/smoke-test.md +260 -0
- package/.gemini/extensions/bigpowers/commands/prompts/spike-prototype.md +94 -0
- package/.gemini/extensions/bigpowers/commands/prompts/stocktake-skills.md +73 -0
- package/.gemini/extensions/bigpowers/commands/prompts/survey-context.md +134 -0
- package/.gemini/extensions/bigpowers/commands/prompts/terse-mode.md +41 -0
- package/.gemini/extensions/bigpowers/commands/prompts/trace-requirement.md +68 -0
- package/.gemini/extensions/bigpowers/commands/prompts/using-bigpowers.md +110 -0
- package/.gemini/extensions/bigpowers/commands/prompts/validate-contracts.md +285 -0
- package/.gemini/extensions/bigpowers/commands/prompts/validate-fix.md +146 -0
- package/.gemini/extensions/bigpowers/commands/prompts/verify-work.md +190 -0
- package/.gemini/extensions/bigpowers/commands/prompts/visual-dashboard.md +49 -0
- package/.gemini/extensions/bigpowers/commands/prompts/wire-ci.md +380 -0
- package/.gemini/extensions/bigpowers/commands/prompts/wire-observability.md +96 -0
- package/.gemini/extensions/bigpowers/commands/prompts/write-document.md +280 -0
- package/.gemini/extensions/bigpowers/gemini-extension.json +16 -0
- package/.gemini/extensions/bigpowers/hooks/HOOKS.md +43 -0
- package/.gemini/extensions/bigpowers/hooks/before-tool-git-guard.sh +26 -0
- package/.gemini/extensions/bigpowers/hooks/before-tool-rtk.sh +14 -0
- package/.gemini/extensions/bigpowers/hooks/before-tool-token-mgmt.sh +19 -0
- package/.gemini/extensions/bigpowers/hooks/hooks-manifest.json +36 -0
- package/.gemini/extensions/bigpowers/hooks/run-hook.cmd +29 -0
- package/.gemini/extensions/bigpowers/hooks/session-start +48 -0
- package/.gemini/extensions/bigpowers/hooks/settings.json.example +41 -0
- package/.gemini/extensions/bigpowers/skills/align-grid/SKILL.md +111 -0
- package/.gemini/extensions/bigpowers/skills/assess-impact/SKILL.md +92 -0
- package/.gemini/extensions/bigpowers/skills/audit-code/SKILL.md +185 -0
- package/.gemini/extensions/bigpowers/skills/audit-plan/SKILL.md +90 -0
- package/.gemini/extensions/bigpowers/skills/build-epic/SKILL.md +106 -0
- package/.gemini/extensions/bigpowers/skills/change-request/SKILL.md +122 -0
- package/.gemini/extensions/bigpowers/skills/commit-message/SKILL.md +141 -0
- package/.gemini/extensions/bigpowers/skills/compose-workflow/SKILL.md +83 -0
- package/.gemini/extensions/bigpowers/skills/context7-mcp/SKILL.md +56 -0
- package/.gemini/extensions/bigpowers/skills/craft-skill/SKILL.md +197 -0
- package/.gemini/extensions/bigpowers/skills/deepen-architecture/SKILL.md +261 -0
- package/.gemini/extensions/bigpowers/skills/define-language/SKILL.md +81 -0
- package/.gemini/extensions/bigpowers/skills/define-success/SKILL.md +13 -0
- package/.gemini/extensions/bigpowers/skills/delegate-task/SKILL.md +92 -0
- package/.gemini/extensions/bigpowers/skills/deploy/SKILL.md +199 -0
- package/.gemini/extensions/bigpowers/skills/design-interface/SKILL.md +98 -0
- package/.gemini/extensions/bigpowers/skills/develop-tdd/SKILL.md +417 -0
- package/.gemini/extensions/bigpowers/skills/diagnose-root/SKILL.md +25 -0
- package/.gemini/extensions/bigpowers/skills/diagnose-stall/SKILL.md +55 -0
- package/.gemini/extensions/bigpowers/skills/dispatch-agents/SKILL.md +119 -0
- package/.gemini/extensions/bigpowers/skills/edit-document/SKILL.md +24 -0
- package/.gemini/extensions/bigpowers/skills/elaborate-spec/SKILL.md +102 -0
- package/.gemini/extensions/bigpowers/skills/enforce-first/SKILL.md +46 -0
- package/.gemini/extensions/bigpowers/skills/evolve-skill/SKILL.md +56 -0
- package/.gemini/extensions/bigpowers/skills/execute-plan/SKILL.md +62 -0
- package/.gemini/extensions/bigpowers/skills/extract-design/SKILL.md +133 -0
- package/.gemini/extensions/bigpowers/skills/find-way/SKILL.md +192 -0
- package/.gemini/extensions/bigpowers/skills/fix-bug/SKILL.md +68 -0
- package/.gemini/extensions/bigpowers/skills/gate-trace/SKILL.md +93 -0
- package/.gemini/extensions/bigpowers/skills/generate-allure-report/SKILL.md +286 -0
- package/.gemini/extensions/bigpowers/skills/grill-me/SKILL.md +109 -0
- package/.gemini/extensions/bigpowers/skills/grill-with-docs/SKILL.md +54 -0
- package/.gemini/extensions/bigpowers/skills/guard-git/SKILL.md +232 -0
- package/.gemini/extensions/bigpowers/skills/harden-vps/SKILL.md +292 -0
- package/.gemini/extensions/bigpowers/skills/hook-commits/SKILL.md +95 -0
- package/.gemini/extensions/bigpowers/skills/inspect-quality/SKILL.md +107 -0
- package/.gemini/extensions/bigpowers/skills/investigate-bug/SKILL.md +128 -0
- package/.gemini/extensions/bigpowers/skills/kickoff-branch/SKILL.md +144 -0
- package/.gemini/extensions/bigpowers/skills/maintain-wiki/SKILL.md +65 -0
- package/.gemini/extensions/bigpowers/skills/map-codebase/SKILL.md +72 -0
- package/.gemini/extensions/bigpowers/skills/migrate-spec/SKILL.md +909 -0
- package/.gemini/extensions/bigpowers/skills/model-domain/SKILL.md +233 -0
- package/.gemini/extensions/bigpowers/skills/orchestrate-project/SKILL.md +175 -0
- package/.gemini/extensions/bigpowers/skills/organize-workspace/SKILL.md +165 -0
- package/.gemini/extensions/bigpowers/skills/plan-refactor/SKILL.md +88 -0
- package/.gemini/extensions/bigpowers/skills/plan-release/SKILL.md +146 -0
- package/.gemini/extensions/bigpowers/skills/plan-tests/SKILL.md +76 -0
- package/.gemini/extensions/bigpowers/skills/plan-work/SKILL.md +273 -0
- package/.gemini/extensions/bigpowers/skills/publish-package/SKILL.md +339 -0
- package/.gemini/extensions/bigpowers/skills/quick-fix/SKILL.md +115 -0
- package/.gemini/extensions/bigpowers/skills/release-branch/SKILL.md +303 -0
- package/.gemini/extensions/bigpowers/skills/request-review/SKILL.md +114 -0
- package/.gemini/extensions/bigpowers/skills/research-first/SKILL.md +88 -0
- package/.gemini/extensions/bigpowers/skills/reset-baseline/SKILL.md +22 -0
- package/.gemini/extensions/bigpowers/skills/respond-review/SKILL.md +72 -0
- package/.gemini/extensions/bigpowers/skills/run-benchmark/SKILL.md +86 -0
- package/.gemini/extensions/bigpowers/skills/run-evals/SKILL.md +81 -0
- package/.gemini/extensions/bigpowers/skills/run-planning/SKILL.md +102 -0
- package/.gemini/extensions/bigpowers/skills/scope-work/SKILL.md +64 -0
- package/.gemini/extensions/bigpowers/skills/search-skills/SKILL.md +74 -0
- package/.gemini/extensions/bigpowers/skills/security-review/SKILL.md +385 -0
- package/.gemini/extensions/bigpowers/skills/seed-conventions/SKILL.md +313 -0
- package/.gemini/extensions/bigpowers/skills/session-state/SKILL.md +147 -0
- package/.gemini/extensions/bigpowers/skills/setup-environment/SKILL.md +40 -0
- package/.gemini/extensions/bigpowers/skills/simple-english/SKILL.md +347 -0
- package/.gemini/extensions/bigpowers/skills/simulate-agents/SKILL.md +27 -0
- package/.gemini/extensions/bigpowers/skills/slice-tasks/SKILL.md +69 -0
- package/.gemini/extensions/bigpowers/skills/smoke-test/SKILL.md +262 -0
- package/.gemini/extensions/bigpowers/skills/spike-prototype/SKILL.md +96 -0
- package/.gemini/extensions/bigpowers/skills/stocktake-skills/SKILL.md +75 -0
- package/.gemini/extensions/bigpowers/skills/survey-context/SKILL.md +136 -0
- package/.gemini/extensions/bigpowers/skills/terse-mode/SKILL.md +43 -0
- package/.gemini/extensions/bigpowers/skills/trace-requirement/SKILL.md +70 -0
- package/.gemini/extensions/bigpowers/skills/using-bigpowers/SKILL.md +112 -0
- package/.gemini/extensions/bigpowers/skills/validate-contracts/SKILL.md +287 -0
- package/.gemini/extensions/bigpowers/skills/validate-fix/SKILL.md +148 -0
- package/.gemini/extensions/bigpowers/skills/verify-work/SKILL.md +192 -0
- package/.gemini/extensions/bigpowers/skills/visual-dashboard/SKILL.md +51 -0
- package/.gemini/extensions/bigpowers/skills/wire-ci/SKILL.md +382 -0
- package/.gemini/extensions/bigpowers/skills/wire-observability/SKILL.md +98 -0
- package/.gemini/extensions/bigpowers/skills/write-document/SKILL.md +282 -0
- package/.pi/package.json +1 -1
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
- package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
- package/scripts/lib/install-helpers.js +147 -20
- package/scripts/test-install-helpers.js +141 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wire-observability
|
|
3
|
+
description: "Add structured JSON logging, observability commands, and idempotent setup scripts to a project. Use when a project needs production-readiness instrumentation, when user wants structured logging, or as a production-readiness gate at any phase of development."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Wire Observability
|
|
7
|
+
> **HARD GATE** — **HARD GATE** — Observability is not optional. Before shipping, verify: structured logging is in place, key metrics are instrumented, error cases emit signals. 'We'll add metrics later' becomes 'never.'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Add structured logging, observability commands, and idempotent setup scripts. Can be invoked at any phase — recommended at the end of the first working slice, before the first deploy.
|
|
11
|
+
|
|
12
|
+
## What this sets up
|
|
13
|
+
|
|
14
|
+
1. **Structured JSON logging** — machine-readable logs for debugging and observability
|
|
15
|
+
2. **Observability commands** — how to check the system's health documented in CLAUDE.md
|
|
16
|
+
3. **Idempotent setup scripts** — scripts that can be run repeatedly without side effects
|
|
17
|
+
|
|
18
|
+
## Process
|
|
19
|
+
|
|
20
|
+
### 1. Assess current state
|
|
21
|
+
|
|
22
|
+
Check what's already in place:
|
|
23
|
+
- Is there a logging library? (pino, winston, structlog, zap, slog, etc.)
|
|
24
|
+
- Is logging JSON or plain text?
|
|
25
|
+
- Is there a health check endpoint or command?
|
|
26
|
+
- Are there setup scripts? Are they idempotent?
|
|
27
|
+
|
|
28
|
+
### 2. Add structured JSON logging
|
|
29
|
+
|
|
30
|
+
**For user-facing CLI output:** plain text is fine.
|
|
31
|
+
**For everything else:** structured JSON.
|
|
32
|
+
|
|
33
|
+
Structured log entry format:
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"level": "info",
|
|
37
|
+
"timestamp": "2025-01-15T10:23:45.123Z",
|
|
38
|
+
"message": "User created",
|
|
39
|
+
"userId": "usr_abc123",
|
|
40
|
+
"requestId": "req_xyz789"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Guidelines:
|
|
45
|
+
- Include `level`, `timestamp`, `message` in every entry
|
|
46
|
+
- Add context fields relevant to the operation (userId, requestId, traceId)
|
|
47
|
+
- Log at boundaries: HTTP requests in/out, DB queries, external API calls, background job start/end
|
|
48
|
+
- Log errors with stack traces: `logger.error({ err, context }, "Operation failed")`
|
|
49
|
+
- **Never log secrets, passwords, tokens, or PII**
|
|
50
|
+
|
|
51
|
+
### 3. Document observability commands in CLAUDE.md
|
|
52
|
+
|
|
53
|
+
Add an "Observability" section to the project's CLAUDE.md:
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
## Observability
|
|
57
|
+
|
|
58
|
+
| What | Command |
|
|
59
|
+
|------|---------|
|
|
60
|
+
| View logs | `<log tail command>` |
|
|
61
|
+
| Health check | `<health check command>` |
|
|
62
|
+
| Check DB connection | `<db ping command>` |
|
|
63
|
+
| View metrics | `<metrics command>` |
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 4. Write idempotent setup scripts
|
|
67
|
+
|
|
68
|
+
An idempotent script can be run multiple times and always produces the same result (no errors on re-run).
|
|
69
|
+
|
|
70
|
+
Pattern: check if the thing already exists before creating it.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
#!/usr/bin/env bash
|
|
74
|
+
set -euo pipefail
|
|
75
|
+
|
|
76
|
+
# Idempotent: only create if not exists
|
|
77
|
+
if ! psql -c "SELECT 1 FROM pg_database WHERE datname = 'myapp'" | grep -q 1; then
|
|
78
|
+
createdb myapp
|
|
79
|
+
echo "Database created"
|
|
80
|
+
else
|
|
81
|
+
echo "Database already exists, skipping"
|
|
82
|
+
fi
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Place setup scripts in `scripts/setup.sh` (or language-appropriate equivalent). Document the command in CLAUDE.md under Commands.
|
|
86
|
+
|
|
87
|
+
### 5. Verify
|
|
88
|
+
|
|
89
|
+
- [ ] Run the app and confirm JSON logs appear in the correct format
|
|
90
|
+
- [ ] Run `scripts/setup.sh` twice — second run should produce no errors
|
|
91
|
+
- [ ] Health check command returns success
|
|
92
|
+
- [ ] No sensitive data in log output
|
|
93
|
+
|
|
94
|
+
## BCP Plus Integration
|
|
95
|
+
|
|
96
|
+
This skill maps to **BCP Plus dimension 11 (Quality Attributes)** — specifically performance, reliability, and availability instrumentation. Structured logging, health checks, and idempotent setup scripts are observable manifestations of quality-attribute requirements. The NFR Gate rule applies: standard-expectation items (e.g., "the app should log errors") score 0 with a one-line rationale; only above-standard quality requirements (e.g., p99 latency tracking, SLO-based alerting) contribute to the dimension 11 count. See `docs/references/bcp-plus.md` for the full 13-dimension framework and NFR Gate pattern.
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-document
|
|
3
|
+
description: "Write, organize, and sync high-integrity technical documents using the BMAD methodology. Ensures every document is Bold, Minimal, Actionable, and Durable. Use when creating architectural docs, technical guides, or organizing the specs/ directory."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write Document (BMAD)
|
|
7
|
+
|
|
8
|
+
Create high-signal technical documentation that serves as an expert collaborator for both humans and AI. This skill enforces the BMAD principles to prevent context rot and ensure architectural durability.
|
|
9
|
+
|
|
10
|
+
**Distinct from `edit-document`:** Use this skill to create a document that does not yet exist. Use `edit-document` when a document already exists and needs restructuring, clarity, or prose improvements.
|
|
11
|
+
|
|
12
|
+
> **HARD GATE** — Every document must have a clear "Reason for Existence." If a document doesn't provide actionable leverage for a caller or test, do not create it.
|
|
13
|
+
|
|
14
|
+
## The BMAD Principles
|
|
15
|
+
|
|
16
|
+
| Principle | Execution |
|
|
17
|
+
| :--- | :--- |
|
|
18
|
+
| **B**old | Make strong assertions. Define clear boundaries and "Never" rules. No "it might" or "usually." |
|
|
19
|
+
| **M**inimal | High-density, low-filler. **Circuit Breaker**: If the file exceeds 300 lines or the session exceeds 20 turns, you MUST run `terse-mode` and compact state before saving. |
|
|
20
|
+
| **A**ctionable | Link every doc to a verifiable outcome. **Architectural Docs**: Verify via Gherkin features (`specs/verifications/features/`) or grep-based structure checks (`grep -c "pattern" file`) that prove the design's *constraints* are present. |
|
|
21
|
+
| **D**urable | Design for the long-term. **Scalability**: Use "Nested Indexing"—root files link to module-level `GEMINI.md` indexes; do not list individual sub-files in the root. |
|
|
22
|
+
|
|
23
|
+
## Process
|
|
24
|
+
|
|
25
|
+
### 1. Identify the Artifact Type & Scope
|
|
26
|
+
|
|
27
|
+
Choose the correct BMAD-BigPowers artifact:
|
|
28
|
+
- **Decision Record (ADR)**: For "Why" decisions (saved to `specs/adr/`).
|
|
29
|
+
- **Context Map**: For system-wide architectural mapping (`specs/tech-architecture/tech-stack.md`).
|
|
30
|
+
- **Technical Guide**: For "How-to" with verification (saved to `<module>/REFERENCE.md`).
|
|
31
|
+
- **Behavioral Feature**: Gherkin-style compliance specs (saved to `specs/verifications/features/`).
|
|
32
|
+
- **Project README**: Project-facing documentation (saved to `README.md` at project root).
|
|
33
|
+
|
|
34
|
+
**Cross-Cutting Concerns**: If a doc affects multiple modules, place the authoritative source in the lowest common ancestor directory and use "Delegates" (one-line pointers) in sub-directories to maintain the Single Source of Truth without violating the Stepdown Rule.
|
|
35
|
+
|
|
36
|
+
### 2. Draft with Semantic Velocity
|
|
37
|
+
|
|
38
|
+
> **STREAM CONTINUITY** — When writing file content, output in continuous chunks of ~200 lines. Do not pause. Continue immediately until complete. If you need time, emit a placeholder comment rather than going silent.
|
|
39
|
+
|
|
40
|
+
Write the document focusing on "Expert Collaboration":
|
|
41
|
+
- **Instructions over Descriptions**: Tell the reader (human or AI) exactly how to interact with the system.
|
|
42
|
+
- **Provenance Links**: Link to ADRs, Issues, or Commits to preserve intent.
|
|
43
|
+
- **The Stepdown Rule**: Information should descend exactly one level of abstraction. If a root doc needs to explain a leaf-level detail, it must point to a sub-index first.
|
|
44
|
+
|
|
45
|
+
### Quick README (Project READMEs only)
|
|
46
|
+
|
|
47
|
+
1. Ask: "Project name? One-sentence description?"
|
|
48
|
+
2. Generate `README.md` at project root using the template in [REFERENCE.md](REFERENCE.md) — no TOC, no second interview round.
|
|
49
|
+
3. Fill gaps from `CLAUDE.md` / `AGENTS.md` commands if available (prefer `AGENTS.md`); use `TODO` markers otherwise.
|
|
50
|
+
4. Output and suggest `edit-document` for polish.
|
|
51
|
+
|
|
52
|
+
→ verify: `test -f README.md && [ "$(grep -c '^## ' README.md)" -ge 7 ]`
|
|
53
|
+
|
|
54
|
+
### 3. Apply the 94% Quality Gate
|
|
55
|
+
|
|
56
|
+
Before finalizing, audit the document against these red flags:
|
|
57
|
+
- [ ] **Filler Language**: Are there pleasantries or "I hope this helps"? (Delete them).
|
|
58
|
+
- [ ] **Ambiguity**: Are there "usually," "often," or "it depends" without specific conditions?
|
|
59
|
+
- [ ] **Dead Ends**: Does the document end without a "Next Step" or "Verification" command?
|
|
60
|
+
- [ ] **Shallow Content**: Does it restate the code without explaining the *intent* or *contracts*?
|
|
61
|
+
|
|
62
|
+
### 4. Sync and Organize
|
|
63
|
+
|
|
64
|
+
- **Big Powers Hierarchy**: Place the document in the correct tier (Global -> Project -> Sub-directory). Project READMEs are an exception — they go to project root (`README.md`), not `specs/`.
|
|
65
|
+
- **Nested Indexing**: If adding a module-level doc, ensure the module's `GEMINI.md` is updated. If the module's index is new, add it to the root `GEMINI.md`.
|
|
66
|
+
- **Sync**: Run `scripts/sync-skills.sh` if the document is a `SKILL.md` or affects generated artifacts.
|
|
67
|
+
|
|
68
|
+
## Rules
|
|
69
|
+
|
|
70
|
+
- **Minimalism is a requirement**: If a document can be a 5-line table, do not make it a 5-line essay.
|
|
71
|
+
- **Verifiable outcomes**: Every technical document must include at least one `verify:` command. For architecture, this can be a `grep` or `run_shell_command` that validates the existence of required files or patterns.
|
|
72
|
+
- **No speculative docs**: Do not write documentation for features that do not exist yet unless explicitly doing `elaborate-spec`.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
Suggest next skill: `audit-code` or `sync-skills.sh`.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
# Project README Template
|
|
80
|
+
|
|
81
|
+
Combined from dbader/readme-template and jehna/readme-best-practices. No TOC.
|
|
82
|
+
|
|
83
|
+
## Navigation
|
|
84
|
+
|
|
85
|
+
| Lines | Section |
|
|
86
|
+
|-------|---------|
|
|
87
|
+
| 1 | Title |
|
|
88
|
+
| 5–40 | Navigation |
|
|
89
|
+
| 41–42 | Sections |
|
|
90
|
+
| 43–54 | 1. Title + Badges |
|
|
91
|
+
| 55–60 | 2. Tagline |
|
|
92
|
+
| 61–64 | 3. Description |
|
|
93
|
+
| 65–67 | 4. Prerequisites |
|
|
94
|
+
| 68–75 | Prerequisites |
|
|
95
|
+
| 76–78 | 5. Installation |
|
|
96
|
+
| 79–89 | Installation |
|
|
97
|
+
| 90–92 | 6. Usage |
|
|
98
|
+
| 93–102 | Usage |
|
|
99
|
+
| 103–105 | 7. Features |
|
|
100
|
+
| 106–113 | Features |
|
|
101
|
+
| 114–116 | 8. Configuration |
|
|
102
|
+
| 117–125 | Configuration |
|
|
103
|
+
| 126–128 | 9. Development Setup |
|
|
104
|
+
| 129–139 | Development |
|
|
105
|
+
| 140–142 | 10. Running Tests |
|
|
106
|
+
| 143–152 | Tests |
|
|
107
|
+
| 153–155 | 11. Contributing |
|
|
108
|
+
| 156–164 | Contributing |
|
|
109
|
+
| 165–167 | 12. Changelog |
|
|
110
|
+
| 168–172 | Changelog |
|
|
111
|
+
| 173–175 | 13. Links |
|
|
112
|
+
| 176–181 | Links |
|
|
113
|
+
| 182–184 | 14. License |
|
|
114
|
+
| 185–191 | License |
|
|
115
|
+
| 192–194 | 15. Credits (optional) |
|
|
116
|
+
| 195–199 | Credits |
|
|
117
|
+
| 200–202 | Verify |
|
|
118
|
+
|
|
119
|
+
## Sections
|
|
120
|
+
|
|
121
|
+
### 1. Title + Badges
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
# Project Name
|
|
125
|
+
|
|
126
|
+

|
|
127
|
+

|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Fill badges from CLAUDE.md stack info if available. Default to license + version badges.
|
|
132
|
+
|
|
133
|
+
### 2. Tagline
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
> One-line description of what this project does and why it matters.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 3. Description
|
|
140
|
+
|
|
141
|
+
2-3 paragraphs: what problem it solves, who it's for, and what makes it different.
|
|
142
|
+
|
|
143
|
+
### 4. Prerequisites
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
## Prerequisites
|
|
147
|
+
|
|
148
|
+
- **Runtime**: Node.js v18+ (from CLAUDE.md)
|
|
149
|
+
- **Package manager**: npm (or pnpm/yarn)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Auto-fill from CLAUDE.md commands section when possible.
|
|
153
|
+
|
|
154
|
+
### 5. Installation
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
## Installation
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm install -g your-package
|
|
161
|
+
# or
|
|
162
|
+
npx your-package
|
|
163
|
+
```
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Prefer npx one-shot if applicable; list global install as alternative.
|
|
167
|
+
|
|
168
|
+
### 6. Usage
|
|
169
|
+
|
|
170
|
+
```markdown
|
|
171
|
+
## Usage
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
your-command --help
|
|
175
|
+
your-command do-something
|
|
176
|
+
```
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Include the most common 1-2 commands. Link to full docs if they exist.
|
|
180
|
+
|
|
181
|
+
### 7. Features
|
|
182
|
+
|
|
183
|
+
```markdown
|
|
184
|
+
## Features
|
|
185
|
+
|
|
186
|
+
- Feature 1: short description
|
|
187
|
+
- Feature 2: short description
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
3-6 bullet points of what the project does. Derived from the project's purpose.
|
|
191
|
+
|
|
192
|
+
### 8. Configuration
|
|
193
|
+
|
|
194
|
+
```markdown
|
|
195
|
+
## Configuration
|
|
196
|
+
|
|
197
|
+
| Variable | Default | Description |
|
|
198
|
+
|----------|---------|-------------|
|
|
199
|
+
| `VAR_NAME` | `value` | What it controls |
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Use `TODO` markers if unknown.
|
|
203
|
+
|
|
204
|
+
### 9. Development Setup
|
|
205
|
+
|
|
206
|
+
```markdown
|
|
207
|
+
## Development
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
git clone <repo-url>
|
|
211
|
+
cd project
|
|
212
|
+
npm install
|
|
213
|
+
```
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Auto-fill from CLAUDE.md `Run` and `Build` commands.
|
|
217
|
+
|
|
218
|
+
### 10. Running Tests
|
|
219
|
+
|
|
220
|
+
```markdown
|
|
221
|
+
## Tests
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
npm test
|
|
225
|
+
npm run lint
|
|
226
|
+
```
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Auto-fill from CLAUDE.md `Test` and `Lint` commands.
|
|
230
|
+
|
|
231
|
+
### 11. Contributing
|
|
232
|
+
|
|
233
|
+
```markdown
|
|
234
|
+
## Contributing
|
|
235
|
+
|
|
236
|
+
1. Fork the repo.
|
|
237
|
+
2. Create a feature branch (`git checkout -b feature/my-thing`).
|
|
238
|
+
3. Commit changes (`git commit -am 'Add my thing'`).
|
|
239
|
+
4. Push (`git push origin feature/my-thing`).
|
|
240
|
+
5. Open a Pull Request.
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### 12. Changelog
|
|
244
|
+
|
|
245
|
+
```markdown
|
|
246
|
+
## Changelog
|
|
247
|
+
|
|
248
|
+
See [CHANGELOG.md](../../CHANGELOG.md) or [Releases](https://github.com/user/repo/releases).
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### 13. Links
|
|
252
|
+
|
|
253
|
+
```markdown
|
|
254
|
+
## Links
|
|
255
|
+
|
|
256
|
+
- Repository: https://github.com/user/repo
|
|
257
|
+
- Issue tracker: https://github.com/user/repo/issues
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### 14. License
|
|
261
|
+
|
|
262
|
+
```markdown
|
|
263
|
+
## License
|
|
264
|
+
|
|
265
|
+
MIT — see [LICENSE](../../LICENSE) for details.
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Detect from CLAUDE.md or project LICENSE file.
|
|
269
|
+
|
|
270
|
+
### 15. Credits (optional)
|
|
271
|
+
|
|
272
|
+
```markdown
|
|
273
|
+
## Credits
|
|
274
|
+
|
|
275
|
+
Built with [bigpowers](https://www.npmjs.com/package/bigpowers).
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Verify
|
|
279
|
+
|
|
280
|
+
After generation, run: `grep -c "^## " README.md` — expect ≥ 7 section headings.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bigpowers",
|
|
3
|
+
"version": "2.87.5",
|
|
4
|
+
"description": "81 skills — 73 agent skills synthesizing 17 years of software engineering discipline into a prescriptive methodology for solo developers",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"gemini-extension"
|
|
7
|
+
],
|
|
8
|
+
"gemini": {
|
|
9
|
+
"skills": [
|
|
10
|
+
"./skills"
|
|
11
|
+
],
|
|
12
|
+
"commands": [
|
|
13
|
+
"./commands"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Gemini CLI Hook Events — bigpowers Extension
|
|
2
|
+
|
|
3
|
+
**Config path:** `~/.gemini/settings.json` (global) or `.gemini/settings.json` (project)
|
|
4
|
+
**Hook scripts (installed):** `~/.gemini/hooks/` — symlinked from this directory in Wave B via `install_gemini()`
|
|
5
|
+
**Naming:** Gemini uses `BeforeTool`/`AfterTool` (not Claude's `PreToolUse`/`PostToolUse`).
|
|
6
|
+
|
|
7
|
+
## All 11 events
|
|
8
|
+
|
|
9
|
+
| Event | Fires when | bigpowers status |
|
|
10
|
+
|-------|------------|------------------|
|
|
11
|
+
| `BeforeTool` | Before a tool executes | **Shipped** — git guard, RTK, token-mgmt wrappers |
|
|
12
|
+
| `AfterTool` | After a tool completes | Documented — no default hook |
|
|
13
|
+
| `BeforeAgent` | Before agent loop iteration | Documented — no default hook |
|
|
14
|
+
| `AfterAgent` | After agent loop iteration | Documented — no default hook |
|
|
15
|
+
| `BeforeModel` | Before model call | Documented — no default hook |
|
|
16
|
+
| `BeforeToolSelection` | Before tool selection | Documented — no default hook |
|
|
17
|
+
| `AfterModel` | After model response | Documented — no default hook |
|
|
18
|
+
| `SessionStart` | Session startup / clear / compact | **Shipped** — `session-start` |
|
|
19
|
+
| `SessionEnd` | Session ends | Documented — no default hook |
|
|
20
|
+
| `Notification` | User notification | Documented — no default hook |
|
|
21
|
+
| `PreCompress` | Before context compression | Documented — no default hook |
|
|
22
|
+
|
|
23
|
+
## Shipped templates (this directory)
|
|
24
|
+
|
|
25
|
+
| Script | Event | Matcher | Purpose |
|
|
26
|
+
|--------|-------|---------|---------|
|
|
27
|
+
| `session-start` | SessionStart | `startup\|clear\|compact` | Project survey + using-bigpowers bootstrap |
|
|
28
|
+
| `run-hook.cmd` | (polyglot launcher) | — | Windows + Unix hook runner |
|
|
29
|
+
| `before-tool-git-guard.sh` | BeforeTool | `run_shell_command` | Delegates to `guard-git` with `GIT_GUARDRAILS_MODE=gemini` |
|
|
30
|
+
| `before-tool-rtk.sh` | BeforeTool | `run_shell_command` | RTK passthrough when installed (optional) |
|
|
31
|
+
| `before-tool-token-mgmt.sh` | BeforeTool | `read_file`, `glob`, `run_shell_command` | Token backstop (optional) |
|
|
32
|
+
|
|
33
|
+
See `settings.json.example` for wiring snippets. Machine-readable list: `hooks-manifest.json`.
|
|
34
|
+
|
|
35
|
+
## Wave B (install hub)
|
|
36
|
+
|
|
37
|
+
Hub install (`scripts/install.sh` → `install_gemini()`) symlinks these scripts to `~/.gemini/hooks/` and merges hook entries into `~/.gemini/settings.json`. See `scripts/test-gemini-hub.sh` for regression checks.
|
|
38
|
+
|
|
39
|
+
## Verify locally
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
bash scripts/test-gemini-adapter.sh
|
|
43
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: e64s01
|
|
3
|
+
# BeforeTool wrapper — git guardrails for Gemini CLI (GIT_GUARDRAILS_MODE=gemini).
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
find_repo_root() {
|
|
7
|
+
local d
|
|
8
|
+
d="$(cd "$(dirname "$0")" && pwd)"
|
|
9
|
+
while [[ "$d" != "/" && ! -d "$d/scripts" ]]; do
|
|
10
|
+
d="$(dirname "$d")"
|
|
11
|
+
done
|
|
12
|
+
if [[ ! -d "$d/scripts" ]]; then
|
|
13
|
+
echo "before-tool-git-guard: repo root not found" >&2
|
|
14
|
+
echo '{"decision":"allow"}'
|
|
15
|
+
exit 0
|
|
16
|
+
fi
|
|
17
|
+
echo "$d"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
ROOT="$(find_repo_root)"
|
|
21
|
+
GUARD="$ROOT/skills/guard-git/scripts/block-dangerous-git.sh"
|
|
22
|
+
if [[ ! -x "$GUARD" && ! -f "$GUARD" ]]; then
|
|
23
|
+
echo '{"decision":"allow"}'
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
exec env GIT_GUARDRAILS_MODE=gemini bash "$GUARD"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: e64s01
|
|
3
|
+
# BeforeTool wrapper — RTK command rewrite (optional; passthrough when rtk absent).
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
if command -v rtk >/dev/null 2>&1; then
|
|
7
|
+
if rtk hook gemini 2>/dev/null; then
|
|
8
|
+
exit 0
|
|
9
|
+
fi
|
|
10
|
+
if rtk hook claude 2>/dev/null; then
|
|
11
|
+
exit 0
|
|
12
|
+
fi
|
|
13
|
+
fi
|
|
14
|
+
exit 0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: e64s01
|
|
3
|
+
# BeforeTool wrapper — token management backstop (delegates to repo hook when present).
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
find_repo_root() {
|
|
7
|
+
local d
|
|
8
|
+
d="$(cd "$(dirname "$0")" && pwd)"
|
|
9
|
+
while [[ "$d" != "/" && ! -d "$d/scripts" ]]; do
|
|
10
|
+
d="$(dirname "$d")"
|
|
11
|
+
done
|
|
12
|
+
[[ -d "$d/scripts" ]] && echo "$d" && return 0
|
|
13
|
+
return 1
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
ROOT="$(find_repo_root)" || exit 0
|
|
17
|
+
HOOK="$ROOT/scripts/hooks/token-mgmt-pre-tool-use.sh"
|
|
18
|
+
[[ -f "$HOOK" ]] || exit 0
|
|
19
|
+
exec bash "$HOOK"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"target": "gemini",
|
|
4
|
+
"config_path": "~/.gemini/settings.json",
|
|
5
|
+
"events_total": 11,
|
|
6
|
+
"events": [
|
|
7
|
+
"BeforeTool",
|
|
8
|
+
"AfterTool",
|
|
9
|
+
"BeforeAgent",
|
|
10
|
+
"AfterAgent",
|
|
11
|
+
"BeforeModel",
|
|
12
|
+
"BeforeToolSelection",
|
|
13
|
+
"AfterModel",
|
|
14
|
+
"SessionStart",
|
|
15
|
+
"SessionEnd",
|
|
16
|
+
"Notification",
|
|
17
|
+
"PreCompress"
|
|
18
|
+
],
|
|
19
|
+
"shipped_hooks": [
|
|
20
|
+
{
|
|
21
|
+
"event": "SessionStart",
|
|
22
|
+
"script": "session-start",
|
|
23
|
+
"matcher": "startup|clear|compact",
|
|
24
|
+
"wave": "a",
|
|
25
|
+
"status": "shipped"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"event": "BeforeTool",
|
|
29
|
+
"script": "before-tool-git-guard.sh",
|
|
30
|
+
"matcher": "run_shell_command",
|
|
31
|
+
"wave": "a",
|
|
32
|
+
"status": "template"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"polyglot_launcher": "run-hook.cmd"
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
: << 'CMDBLOCK'
|
|
2
|
+
@echo off
|
|
3
|
+
REM Cross-platform polyglot wrapper for hook scripts.
|
|
4
|
+
REM On Windows: cmd.exe runs the batch portion, which finds and calls bash.
|
|
5
|
+
REM On Unix: the shell interprets this as a script (: is a no-op in bash).
|
|
6
|
+
|
|
7
|
+
if "%~1"=="" (
|
|
8
|
+
echo run-hook.cmd: missing script name >&2
|
|
9
|
+
exit /b 1
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
set "HOOK_DIR=%~dp0"
|
|
13
|
+
|
|
14
|
+
REM Try bash on PATH
|
|
15
|
+
where bash >nul 2>nul
|
|
16
|
+
if %ERRORLEVEL% equ 0 (
|
|
17
|
+
bash "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
|
|
18
|
+
exit /b %ERRORLEVEL%
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
REM No bash found - exit silently
|
|
22
|
+
exit /b 0
|
|
23
|
+
CMDBLOCK
|
|
24
|
+
|
|
25
|
+
# Unix: run the named script directly
|
|
26
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
27
|
+
SCRIPT_NAME="$1"
|
|
28
|
+
shift
|
|
29
|
+
exec bash "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# session-start hook for bigpowers
|
|
3
|
+
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
# 1. Find the project root (contains scripts/ and .gemini/)
|
|
7
|
+
FIND_ROOT="$(cd "$(dirname "$0")" && pwd)"
|
|
8
|
+
while [[ "$FIND_ROOT" != "/" && ! -d "$FIND_ROOT/scripts" ]]; do
|
|
9
|
+
FIND_ROOT="$(dirname "$FIND_ROOT")"
|
|
10
|
+
done
|
|
11
|
+
|
|
12
|
+
if [[ ! -d "$FIND_ROOT/scripts" ]]; then
|
|
13
|
+
# Fallback to a relative guess if we can't find it by walking up
|
|
14
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
15
|
+
FIND_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# 2. Run the project survey
|
|
19
|
+
survey_content=$("${FIND_ROOT}/scripts/project-survey.sh" 2>&1 || echo "Error running project survey at ${FIND_ROOT}")
|
|
20
|
+
|
|
21
|
+
# 3. Read the Bigpowers bootstrap skill
|
|
22
|
+
bootstrap_content=$(cat "${FIND_ROOT}/.gemini/extensions/bigpowers/commands/using-bigpowers.md" 2>/dev/null || echo "Bigpowers skills system active.")
|
|
23
|
+
|
|
24
|
+
# Escape string for JSON embedding
|
|
25
|
+
escape_for_json() {
|
|
26
|
+
local s="$1"
|
|
27
|
+
s="${s//\\/\\\\}"
|
|
28
|
+
s="${s//\"/\\\"}"
|
|
29
|
+
s="${s//$'\n'/\\n}"
|
|
30
|
+
s="${s//$'\r'/\\r}"
|
|
31
|
+
s="${s//$'\t'/\\t}"
|
|
32
|
+
printf '%s' "$s"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
survey_escaped=$(escape_for_json "$survey_content")
|
|
36
|
+
bootstrap_escaped=$(escape_for_json "$bootstrap_content")
|
|
37
|
+
|
|
38
|
+
# Combined context
|
|
39
|
+
session_context="<BIGPOWERS_BOOTSTRAP>\n${survey_escaped}\n\n---\n\n${bootstrap_escaped}\n</BIGPOWERS_BOOTSTRAP>"
|
|
40
|
+
|
|
41
|
+
# Output based on platform
|
|
42
|
+
if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
|
|
43
|
+
printf '{\n "additional_context": "%s"\n}\n' "$session_context"
|
|
44
|
+
elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ]; then
|
|
45
|
+
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
|
|
46
|
+
else
|
|
47
|
+
printf '{\n "additionalContext": "%s"\n}\n' "$session_context"
|
|
48
|
+
fi
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "startup|clear|compact",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "\"$HOME/.gemini/hooks/run-hook.cmd\" session-start",
|
|
10
|
+
"async": false
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"BeforeTool": [
|
|
16
|
+
{
|
|
17
|
+
"matcher": "run_shell_command",
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"name": "git-guardrails",
|
|
21
|
+
"type": "command",
|
|
22
|
+
"command": "GIT_GUARDRAILS_MODE=gemini \"$HOME/.gemini/hooks/before-tool-git-guard.sh\"",
|
|
23
|
+
"timeout": 5000
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"matcher": "run_shell_command",
|
|
29
|
+
"hooks": [
|
|
30
|
+
{
|
|
31
|
+
"name": "rtk-rewrite",
|
|
32
|
+
"type": "command",
|
|
33
|
+
"command": "\"$HOME/.gemini/hooks/before-tool-rtk.sh\"",
|
|
34
|
+
"timeout": 3000
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"_comment": "Example only — Wave B install_gemini() merges into ~/.gemini/settings.json. Copy paths after install.sh symlinks hooks."
|
|
41
|
+
}
|