bigpowers 1.0.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.
Files changed (96) hide show
  1. package/.gitmessage +5 -0
  2. package/.releaserc.json +17 -0
  3. package/CHANGELOG.md +61 -0
  4. package/CLAUDE.md +61 -0
  5. package/CONVENTIONS.md +140 -0
  6. package/GEMINI.md +53 -0
  7. package/LICENSE +21 -0
  8. package/README.md +116 -0
  9. package/RELEASE.md +108 -0
  10. package/SKILL-INDEX.md +146 -0
  11. package/assess-impact/SKILL.md +76 -0
  12. package/audit-code/HEURISTICS.md +43 -0
  13. package/audit-code/SKILL.md +81 -0
  14. package/bin/bigpowers.js +27 -0
  15. package/change-request/REFERENCE.md +60 -0
  16. package/change-request/SKILL.md +42 -0
  17. package/commit-message/REFERENCE.md +81 -0
  18. package/commit-message/SKILL.md +39 -0
  19. package/countable-story-format.md +293 -0
  20. package/craft-skill/REFERENCE.md +88 -0
  21. package/craft-skill/SKILL.md +55 -0
  22. package/deepen-architecture/DEEPENING.md +37 -0
  23. package/deepen-architecture/INTERFACE-DESIGN.md +44 -0
  24. package/deepen-architecture/LANGUAGE.md +53 -0
  25. package/deepen-architecture/SKILL.md +76 -0
  26. package/define-language/SKILL.md +75 -0
  27. package/define-success/SKILL.md +60 -0
  28. package/delegate-task/SKILL.md +70 -0
  29. package/design-interface/SKILL.md +94 -0
  30. package/develop-tdd/SKILL.md +160 -0
  31. package/develop-tdd/deep-modules.md +33 -0
  32. package/develop-tdd/interface-design.md +31 -0
  33. package/develop-tdd/mocking.md +59 -0
  34. package/develop-tdd/refactoring.md +10 -0
  35. package/develop-tdd/tests.md +71 -0
  36. package/dispatch-agents/SKILL.md +72 -0
  37. package/edit-document/SKILL.md +14 -0
  38. package/elaborate-spec/SKILL.md +79 -0
  39. package/enforce-first/SKILL.md +75 -0
  40. package/execute-plan/SKILL.md +84 -0
  41. package/grill-me/REFERENCE.md +63 -0
  42. package/grill-me/SKILL.md +25 -0
  43. package/guard-git/REFERENCE.md +136 -0
  44. package/guard-git/SKILL.md +39 -0
  45. package/guard-git/scripts/block-dangerous-git.sh +41 -0
  46. package/guard-git/scripts/lib/git-guardrails-core.sh +29 -0
  47. package/hook-commits/SKILL.md +91 -0
  48. package/hooks/pre-tool-use.sh +130 -0
  49. package/index.js +6 -0
  50. package/inspect-quality/SKILL.md +101 -0
  51. package/investigate-bug/SKILL.md +111 -0
  52. package/kickoff-branch/SKILL.md +87 -0
  53. package/map-codebase/SKILL.md +66 -0
  54. package/migrate-spec/REFERENCE-GSD.md +137 -0
  55. package/migrate-spec/REFERENCE.md +186 -0
  56. package/migrate-spec/SKILL.md +150 -0
  57. package/model-domain/ADR-FORMAT.md +47 -0
  58. package/model-domain/CONTEXT-FORMAT.md +77 -0
  59. package/model-domain/SKILL.md +82 -0
  60. package/opencode.json +4 -0
  61. package/orchestrate-project/REFERENCE.md +89 -0
  62. package/orchestrate-project/SKILL.md +59 -0
  63. package/organize-workspace/REFERENCE.md +80 -0
  64. package/organize-workspace/SKILL.md +74 -0
  65. package/package.json +45 -0
  66. package/plan-refactor/SKILL.md +75 -0
  67. package/plan-release/SKILL.md +75 -0
  68. package/plan-work/SKILL.md +124 -0
  69. package/playwright.config.ts +56 -0
  70. package/release-branch/SKILL.md +116 -0
  71. package/request-review/SKILL.md +70 -0
  72. package/respond-review/SKILL.md +68 -0
  73. package/scripts/audit-compliance.sh +256 -0
  74. package/scripts/cleanup-worktrees.sh +44 -0
  75. package/scripts/install-cursor-skills-local.sh +13 -0
  76. package/scripts/install-cursor-skills.sh +34 -0
  77. package/scripts/install.sh +240 -0
  78. package/scripts/project-survey.sh +54 -0
  79. package/scripts/sync-skills.sh +110 -0
  80. package/seed-conventions/SKILL.md +185 -0
  81. package/session-state/SKILL.md +69 -0
  82. package/skills-lock.json +157 -0
  83. package/spike-prototype/SKILL.md +92 -0
  84. package/survey-context/SKILL.md +93 -0
  85. package/terse-mode/SKILL.md +35 -0
  86. package/trace-requirement/SKILL.md +68 -0
  87. package/using-bigpowers/SKILL.md +65 -0
  88. package/validate-fix/SKILL.md +93 -0
  89. package/visual-dashboard/SKILL.md +49 -0
  90. package/visual-dashboard/scripts/frame-template.html +189 -0
  91. package/visual-dashboard/scripts/helper.js +83 -0
  92. package/visual-dashboard/scripts/server.cjs +345 -0
  93. package/visual-dashboard/scripts/start-server.sh +121 -0
  94. package/visual-dashboard/scripts/stop-server.sh +46 -0
  95. package/wire-observability/SKILL.md +90 -0
  96. package/write-document/SKILL.md +63 -0
@@ -0,0 +1,121 @@
1
+ #!/usr/bin/env bash
2
+ # Start the bigpowers dashboard server and output connection info
3
+ # Usage: start-server.sh [--project-dir <path>] [--host <bind-host>] [--url-host <display-host>] [--foreground] [--background]
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
+
7
+ PROJECT_DIR=""
8
+ FOREGROUND="false"
9
+ FORCE_BACKGROUND="false"
10
+ BIND_HOST="127.0.0.1"
11
+ URL_HOST=""
12
+ while [[ $# -gt 0 ]]; do
13
+ case "$1" in
14
+ --project-dir)
15
+ PROJECT_DIR="$2"
16
+ shift 2
17
+ ;;
18
+ --host)
19
+ BIND_HOST="$2"
20
+ shift 2
21
+ ;;
22
+ --url-host)
23
+ URL_HOST="$2"
24
+ shift 2
25
+ ;;
26
+ --foreground|--no-daemon)
27
+ FOREGROUND="true"
28
+ shift
29
+ ;;
30
+ --background|--daemon)
31
+ FORCE_BACKGROUND="true"
32
+ shift
33
+ ;;
34
+ *)
35
+ echo "{\"error\": \"Unknown argument: $1\"}"
36
+ exit 1
37
+ ;;
38
+ esac
39
+ done
40
+
41
+ if [[ -z "$URL_HOST" ]]; then
42
+ if [[ "$BIND_HOST" == "127.0.0.1" || "$BIND_HOST" == "localhost" ]]; then
43
+ URL_HOST="localhost"
44
+ else
45
+ URL_HOST="$BIND_HOST"
46
+ fi
47
+ fi
48
+
49
+ if [[ -n "${CODEX_CI:-}" && "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "true" ]]; then
50
+ FOREGROUND="true"
51
+ fi
52
+
53
+ if [[ "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "true" ]]; then
54
+ case "${OSTYPE:-}" in
55
+ msys*|cygwin*|mingw*) FOREGROUND="true" ;;
56
+ esac
57
+ if [[ -n "${MSYSTEM:-}" ]]; then
58
+ FOREGROUND="true"
59
+ fi
60
+ fi
61
+
62
+ SESSION_ID="$$-$(date +%s)"
63
+
64
+ if [[ -n "$PROJECT_DIR" ]]; then
65
+ SESSION_DIR="${PROJECT_DIR}/.bigpowers/dashboard/${SESSION_ID}"
66
+ else
67
+ SESSION_DIR="/tmp/bigpowers-dashboard-${SESSION_ID}"
68
+ fi
69
+
70
+ STATE_DIR="${SESSION_DIR}/state"
71
+ PID_FILE="${STATE_DIR}/server.pid"
72
+ LOG_FILE="${STATE_DIR}/server.log"
73
+
74
+ mkdir -p "${SESSION_DIR}/content" "$STATE_DIR"
75
+
76
+ if [[ -f "$PID_FILE" ]]; then
77
+ old_pid=$(cat "$PID_FILE")
78
+ kill "$old_pid" 2>/dev/null
79
+ rm -f "$PID_FILE"
80
+ fi
81
+
82
+ cd "$SCRIPT_DIR"
83
+
84
+ OWNER_PID="$(ps -o ppid= -p "$PPID" 2>/dev/null | tr -d ' ')"
85
+ if [[ -z "$OWNER_PID" || "$OWNER_PID" == "1" ]]; then
86
+ OWNER_PID="$PPID"
87
+ fi
88
+
89
+ if [[ "$FOREGROUND" == "true" ]]; then
90
+ echo "$$" > "$PID_FILE"
91
+ env BIGPOWERS_DASHBOARD_DIR="$SESSION_DIR" BIGPOWERS_DASHBOARD_HOST="$BIND_HOST" BIGPOWERS_DASHBOARD_URL_HOST="$URL_HOST" BIGPOWERS_DASHBOARD_OWNER_PID="$OWNER_PID" node server.cjs
92
+ exit $?
93
+ fi
94
+
95
+ nohup env BIGPOWERS_DASHBOARD_DIR="$SESSION_DIR" BIGPOWERS_DASHBOARD_HOST="$BIND_HOST" BIGPOWERS_DASHBOARD_URL_HOST="$URL_HOST" BIGPOWERS_DASHBOARD_OWNER_PID="$OWNER_PID" node server.cjs > "$LOG_FILE" 2>&1 &
96
+ SERVER_PID=$!
97
+ disown "$SERVER_PID" 2>/dev/null
98
+ echo "$SERVER_PID" > "$PID_FILE"
99
+
100
+ for i in {1..50}; do
101
+ if grep -q "server-started" "$LOG_FILE" 2>/dev/null; then
102
+ alive="true"
103
+ for _ in {1..20}; do
104
+ if ! kill -0 "$SERVER_PID" 2>/dev/null; then
105
+ alive="false"
106
+ break
107
+ fi
108
+ sleep 0.1
109
+ done
110
+ if [[ "$alive" != "true" ]]; then
111
+ echo "{\"error\": \"Server started but was killed. Retry in a persistent terminal with: $SCRIPT_DIR/start-server.sh${PROJECT_DIR:+ --project-dir $PROJECT_DIR} --host $BIND_HOST --url-host $URL_HOST --foreground\"}"
112
+ exit 1
113
+ fi
114
+ grep "server-started" "$LOG_FILE" | head -1
115
+ exit 0
116
+ fi
117
+ sleep 0.1
118
+ done
119
+
120
+ echo '{"error": "Server failed to start within 5 seconds"}'
121
+ exit 1
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env bash
2
+ # Stop the bigpowers dashboard server and clean up
3
+ # Usage: stop-server.sh <session_dir>
4
+
5
+ SESSION_DIR="$1"
6
+
7
+ if [[ -z "$SESSION_DIR" ]]; then
8
+ echo '{"error": "Usage: stop-server.sh <session_dir>"}'
9
+ exit 1
10
+ fi
11
+
12
+ STATE_DIR="${SESSION_DIR}/state"
13
+ PID_FILE="${STATE_DIR}/server.pid"
14
+
15
+ if [[ -f "$PID_FILE" ]]; then
16
+ pid=$(cat "$PID_FILE")
17
+
18
+ kill "$pid" 2>/dev/null || true
19
+
20
+ for i in {1..20}; do
21
+ if ! kill -0 "$pid" 2>/dev/null; then
22
+ break
23
+ fi
24
+ sleep 0.1
25
+ done
26
+
27
+ if kill -0 "$pid" 2>/dev/null; then
28
+ kill -9 "$pid" 2>/dev/null || true
29
+ sleep 0.1
30
+ fi
31
+
32
+ if kill -0 "$pid" 2>/dev/null; then
33
+ echo '{"status": "failed", "error": "process still running"}'
34
+ exit 1
35
+ fi
36
+
37
+ rm -f "$PID_FILE" "${STATE_DIR}/server.log"
38
+
39
+ if [[ "$SESSION_DIR" == /tmp/* ]]; then
40
+ rm -rf "$SESSION_DIR"
41
+ fi
42
+
43
+ echo '{"status": "stopped"}'
44
+ else
45
+ echo '{"status": "not_running"}'
46
+ fi
@@ -0,0 +1,90 @@
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
+
8
+ 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.
9
+
10
+ ## What this sets up
11
+
12
+ 1. **Structured JSON logging** — machine-readable logs for debugging and observability
13
+ 2. **Observability commands** — how to check the system's health documented in CLAUDE.md
14
+ 3. **Idempotent setup scripts** — scripts that can be run repeatedly without side effects
15
+
16
+ ## Process
17
+
18
+ ### 1. Assess current state
19
+
20
+ Check what's already in place:
21
+ - Is there a logging library? (pino, winston, structlog, zap, slog, etc.)
22
+ - Is logging JSON or plain text?
23
+ - Is there a health check endpoint or command?
24
+ - Are there setup scripts? Are they idempotent?
25
+
26
+ ### 2. Add structured JSON logging
27
+
28
+ **For user-facing CLI output:** plain text is fine.
29
+ **For everything else:** structured JSON.
30
+
31
+ Structured log entry format:
32
+ ```json
33
+ {
34
+ "level": "info",
35
+ "timestamp": "2025-01-15T10:23:45.123Z",
36
+ "message": "User created",
37
+ "userId": "usr_abc123",
38
+ "requestId": "req_xyz789"
39
+ }
40
+ ```
41
+
42
+ Guidelines:
43
+ - Include `level`, `timestamp`, `message` in every entry
44
+ - Add context fields relevant to the operation (userId, requestId, traceId)
45
+ - Log at boundaries: HTTP requests in/out, DB queries, external API calls, background job start/end
46
+ - Log errors with stack traces: `logger.error({ err, context }, "Operation failed")`
47
+ - **Never log secrets, passwords, tokens, or PII**
48
+
49
+ ### 3. Document observability commands in CLAUDE.md
50
+
51
+ Add an "Observability" section to the project's CLAUDE.md:
52
+
53
+ ```markdown
54
+ ## Observability
55
+
56
+ | What | Command |
57
+ |------|---------|
58
+ | View logs | `<log tail command>` |
59
+ | Health check | `<health check command>` |
60
+ | Check DB connection | `<db ping command>` |
61
+ | View metrics | `<metrics command>` |
62
+ ```
63
+
64
+ ### 4. Write idempotent setup scripts
65
+
66
+ An idempotent script can be run multiple times and always produces the same result (no errors on re-run).
67
+
68
+ Pattern: check if the thing already exists before creating it.
69
+
70
+ ```bash
71
+ #!/usr/bin/env bash
72
+ set -euo pipefail
73
+
74
+ # Idempotent: only create if not exists
75
+ if ! psql -c "SELECT 1 FROM pg_database WHERE datname = 'myapp'" | grep -q 1; then
76
+ createdb myapp
77
+ echo "Database created"
78
+ else
79
+ echo "Database already exists, skipping"
80
+ fi
81
+ ```
82
+
83
+ Place setup scripts in `scripts/setup.sh` (or language-appropriate equivalent). Document the command in CLAUDE.md under Commands.
84
+
85
+ ### 5. Verify
86
+
87
+ - [ ] Run the app and confirm JSON logs appear in the correct format
88
+ - [ ] Run `scripts/setup.sh` twice — second run should produce no errors
89
+ - [ ] Health check command returns success
90
+ - [ ] No sensitive data in log output
@@ -0,0 +1,63 @@
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
+ > **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.
11
+
12
+ ## The BMAD Principles
13
+
14
+ | Principle | Execution |
15
+ | :--- | :--- |
16
+ | **B**old | Make strong assertions. Define clear boundaries and "Never" rules. No "it might" or "usually." |
17
+ | **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. |
18
+ | **A**ctionable | Link every doc to a verifiable outcome. **Architectural Docs**: Verify via Gherkin features (`specs/audit/features/`) or grep-based structure checks (`grep -c "pattern" file`) that prove the design's *constraints* are present. |
19
+ | **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. |
20
+
21
+ ## Process
22
+
23
+ ### 1. Identify the Artifact Type & Scope
24
+
25
+ Choose the correct BMAD-BigPowers artifact:
26
+ - **Decision Record (ADR)**: For "Why" decisions (saved to `specs/adr/`).
27
+ - **Context Map**: For system-wide architectural mapping (`specs/CONTEXT.md`).
28
+ - **Technical Guide**: For "How-to" with verification (saved to `<module>/REFERENCE.md`).
29
+ - **Behavioral Feature**: Gherkin-style compliance specs (saved to `specs/audit/features/`).
30
+
31
+ **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.
32
+
33
+ ### 2. Draft with Semantic Velocity
34
+
35
+ > **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.
36
+
37
+ Write the document focusing on "Expert Collaboration":
38
+ - **Instructions over Descriptions**: Tell the reader (human or AI) exactly how to interact with the system.
39
+ - **Provenance Links**: Link to ADRs, Issues, or Commits to preserve intent.
40
+ - **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.
41
+
42
+ ### 3. Apply the 94% Quality Gate
43
+
44
+ Before finalizing, audit the document against these red flags:
45
+ - [ ] **Filler Language**: Are there pleasantries or "I hope this helps"? (Delete them).
46
+ - [ ] **Ambiguity**: Are there "usually," "often," or "it depends" without specific conditions?
47
+ - [ ] **Dead Ends**: Does the document end without a "Next Step" or "Verification" command?
48
+ - [ ] **Shallow Content**: Does it restate the code without explaining the *intent* or *contracts*?
49
+
50
+ ### 4. Sync and Organize
51
+
52
+ - **Big Powers Hierarchy**: Place the document in the correct tier (Global -> Project -> Sub-directory).
53
+ - **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`.
54
+ - **Sync**: Run `scripts/sync-skills.sh` if the document is a `SKILL.md` or affects generated artifacts.
55
+
56
+ ## Rules
57
+
58
+ - **Minimalism is a requirement**: If a document can be a 5-line table, do not make it a 5-line essay.
59
+ - **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.
60
+ - **No speculative docs**: Do not write documentation for features that do not exist yet unless explicitly doing `elaborate-spec`.
61
+
62
+
63
+ Suggest next skill: `audit-code` or `sync-skills.sh`.