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,240 @@
1
+ #!/usr/bin/env bash
2
+ # install.sh — global symlink install for bigpowers skills
3
+ #
4
+ # Supported tools:
5
+ # Claude Code → ~/.claude/skills/<name>/ (one symlink per skill)
6
+ # Gemini CLI → ~/.gemini/extensions/bigpowers/ (one dir symlink)
7
+ # Cursor → ~/.cursor/rules/ (one dir symlink; per-project note printed)
8
+ # OpenCode → instructions printed (no standard global path)
9
+ #
10
+ # Usage:
11
+ # ./scripts/install.sh # install
12
+ # ./scripts/install.sh --dry-run # show what would be linked
13
+ # ./scripts/install.sh --uninstall # remove all managed symlinks
14
+ set -euo pipefail
15
+
16
+ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
17
+
18
+ DRY_RUN=false
19
+ UNINSTALL=false
20
+
21
+ for arg in "$@"; do
22
+ case "$arg" in
23
+ --dry-run) DRY_RUN=true ;;
24
+ --uninstall) UNINSTALL=true ;;
25
+ *) echo "Unknown flag: $arg" >&2; exit 1 ;;
26
+ esac
27
+ done
28
+
29
+ # ── helpers ──────────────────────────────────────────────────────────────────
30
+
31
+ run() {
32
+ if $DRY_RUN; then
33
+ echo " [dry-run] $*"
34
+ else
35
+ "$@"
36
+ fi
37
+ }
38
+
39
+ link() {
40
+ local src="$1" dst="$2"
41
+ local dst_dir; dst_dir="$(dirname "$dst")"
42
+ run mkdir -p "$dst_dir"
43
+ run ln -sfn "$src" "$dst"
44
+ echo " linked: $dst → $src"
45
+ }
46
+
47
+ unlink_if_managed() {
48
+ local dst="$1" src_prefix="$2"
49
+ if [[ -L "$dst" ]]; then
50
+ local target; target="$(readlink "$dst")"
51
+ if [[ "$target" == "$src_prefix"* ]]; then
52
+ run rm "$dst"
53
+ echo " removed: $dst"
54
+ fi
55
+ fi
56
+ }
57
+
58
+ # ── Claude Code ───────────────────────────────────────────────────────────────
59
+
60
+ CLAUDE_CONFIG_DIR="$HOME/.claude"
61
+ CLAUDE_SKILLS_DIR="$CLAUDE_CONFIG_DIR/skills"
62
+ CLAUDE_HOOKS_DIR="$CLAUDE_CONFIG_DIR/hooks"
63
+ CLAUDE_SETTINGS="$CLAUDE_CONFIG_DIR/settings.json"
64
+
65
+ install_claude() {
66
+ echo ""
67
+ echo "Claude Code → $CLAUDE_SKILLS_DIR/"
68
+ local count=0
69
+ for skill_dir in "$REPO_ROOT"/*/; do
70
+ [[ -f "$skill_dir/SKILL.md" ]] || continue
71
+ local name; name="$(basename "$skill_dir")"
72
+ link "$skill_dir" "$CLAUDE_SKILLS_DIR/$name"
73
+ count=$((count + 1))
74
+ done
75
+ echo " $count skills installed"
76
+
77
+ echo "Claude Code Hooks → $CLAUDE_HOOKS_DIR/"
78
+ link "$REPO_ROOT/.gemini/extensions/bigpowers/hooks/session-start" "$CLAUDE_HOOKS_DIR/session-start"
79
+ link "$REPO_ROOT/.gemini/extensions/bigpowers/hooks/run-hook.cmd" "$CLAUDE_HOOKS_DIR/run-hook.cmd"
80
+ link "$REPO_ROOT/guard-git/scripts/block-dangerous-git.sh" "$CLAUDE_HOOKS_DIR/block-dangerous-git.sh"
81
+ link "$REPO_ROOT/guard-git/scripts/lib" "$CLAUDE_HOOKS_DIR/lib"
82
+
83
+ if [[ -f "$CLAUDE_SETTINGS" ]]; then
84
+ echo " Configuring global hooks in $CLAUDE_SETTINGS..."
85
+ # Robustly add hooks to settings.json if not already present
86
+ if command -v jq >/dev/null; then
87
+ local tmp; tmp=$(mktemp)
88
+ cat "$CLAUDE_SETTINGS" | jq '
89
+ .hooks.SessionStart += [{"matcher":"startup|clear|compact","hooks":[{"type":"command","command":"\"'"$CLAUDE_HOOKS_DIR/run-hook.cmd"'\" session-start","async":false}]}] |
90
+ .hooks.PreToolUse += [{"matcher":"Bash","hooks":[{"type":"command","command":"\"'"$CLAUDE_HOOKS_DIR/block-dangerous-git.sh"'\""}]}] |
91
+ # deduplicate
92
+ .hooks.SessionStart |= unique |
93
+ .hooks.PreToolUse |= unique
94
+ ' > "$tmp" && run mv "$tmp" "$CLAUDE_SETTINGS"
95
+ else
96
+ echo " WARNING: jq not found. Manual setup required in $CLAUDE_SETTINGS"
97
+ fi
98
+ fi
99
+ }
100
+
101
+ uninstall_claude() {
102
+ echo ""
103
+ echo "Claude Code → removing management from $CLAUDE_CONFIG_DIR/"
104
+ if [[ -d "$CLAUDE_SKILLS_DIR" ]]; then
105
+ for dst in "$CLAUDE_SKILLS_DIR"/*/; do
106
+ [[ -L "${dst%/}" ]] || continue
107
+ unlink_if_managed "${dst%/}" "$REPO_ROOT/"
108
+ done
109
+ fi
110
+ if [[ -d "$CLAUDE_HOOKS_DIR" ]]; then
111
+ unlink_if_managed "$CLAUDE_HOOKS_DIR/session-start" "$REPO_ROOT/"
112
+ unlink_if_managed "$CLAUDE_HOOKS_DIR/run-hook.cmd" "$REPO_ROOT/"
113
+ unlink_if_managed "$CLAUDE_HOOKS_DIR/block-dangerous-git.sh" "$REPO_ROOT/"
114
+ unlink_if_managed "$CLAUDE_HOOKS_DIR/lib" "$REPO_ROOT/"
115
+ fi
116
+ }
117
+
118
+ # ── Gemini CLI ────────────────────────────────────────────────────────────────
119
+
120
+ GEMINI_CONFIG_DIR="$HOME/.gemini"
121
+ GEMINI_EXT_SRC="$REPO_ROOT/.gemini/extensions/bigpowers"
122
+ GEMINI_EXT_DST="$GEMINI_CONFIG_DIR/extensions/bigpowers"
123
+ GEMINI_HOOKS_DIR="$GEMINI_CONFIG_DIR/hooks"
124
+ GEMINI_SETTINGS="$GEMINI_CONFIG_DIR/settings.json"
125
+
126
+ install_gemini() {
127
+ echo ""
128
+ echo "Gemini CLI → $GEMINI_EXT_DST"
129
+ if [[ ! -d "$GEMINI_EXT_SRC" ]]; then
130
+ echo " WARNING: $GEMINI_EXT_SRC not found — run sync-skills.sh first"
131
+ return
132
+ fi
133
+ link "$GEMINI_EXT_SRC" "$GEMINI_EXT_DST"
134
+
135
+ echo "Gemini CLI Hooks → $GEMINI_HOOKS_DIR/"
136
+ link "$REPO_ROOT/.gemini/extensions/bigpowers/hooks/session-start" "$GEMINI_HOOKS_DIR/session-start"
137
+ link "$REPO_ROOT/.gemini/extensions/bigpowers/hooks/run-hook.cmd" "$GEMINI_HOOKS_DIR/run-hook.cmd"
138
+ link "$REPO_ROOT/guard-git/scripts/block-dangerous-git.sh" "$GEMINI_HOOKS_DIR/block-dangerous-git.sh"
139
+ link "$REPO_ROOT/guard-git/scripts/lib" "$GEMINI_HOOKS_DIR/lib"
140
+
141
+ if [[ -f "$GEMINI_SETTINGS" ]]; then
142
+ echo " Configuring global hooks in $GEMINI_SETTINGS..."
143
+ if command -v jq >/dev/null; then
144
+ local tmp; tmp=$(mktemp)
145
+ cat "$GEMINI_SETTINGS" | jq '
146
+ .hooks.SessionStart += [{"matcher":"startup|clear|compact","hooks":[{"type":"command","command":"\"'"$GEMINI_HOOKS_DIR/run-hook.cmd"'\" session-start","async":false}]}] |
147
+ .hooks.BeforeTool += [{"matcher":"run_shell_command","hooks":[{"name":"git-guardrails","type":"command","command":"GIT_GUARDRAILS_MODE=gemini \"'"$GEMINI_HOOKS_DIR/block-dangerous-git.sh"'\""}]}] |
148
+ # deduplicate
149
+ .hooks.SessionStart |= unique |
150
+ .hooks.BeforeTool |= unique
151
+ ' > "$tmp" && run mv "$tmp" "$GEMINI_SETTINGS"
152
+ else
153
+ echo " WARNING: jq not found. Manual setup required in $GEMINI_SETTINGS"
154
+ fi
155
+ fi
156
+ }
157
+
158
+ uninstall_gemini() {
159
+ echo ""
160
+ echo "Gemini CLI → removing management from $GEMINI_CONFIG_DIR/"
161
+ unlink_if_managed "$GEMINI_EXT_DST" "$REPO_ROOT/"
162
+ if [[ -d "$GEMINI_HOOKS_DIR" ]]; then
163
+ unlink_if_managed "$GEMINI_HOOKS_DIR/session-start" "$REPO_ROOT/"
164
+ unlink_if_managed "$GEMINI_HOOKS_DIR/run-hook.cmd" "$REPO_ROOT/"
165
+ unlink_if_managed "$GEMINI_HOOKS_DIR/block-dangerous-git.sh" "$REPO_ROOT/"
166
+ unlink_if_managed "$GEMINI_HOOKS_DIR/lib" "$REPO_ROOT/"
167
+ fi
168
+ }
169
+
170
+ # ── Cursor ────────────────────────────────────────────────────────────────────
171
+
172
+ CURSOR_RULES_SRC="$REPO_ROOT/.cursor/rules"
173
+ CURSOR_RULES_DST="$HOME/.cursor/rules"
174
+
175
+ install_cursor() {
176
+ echo ""
177
+ echo "Cursor → $CURSOR_RULES_DST"
178
+ if [[ ! -d "$CURSOR_RULES_SRC" ]]; then
179
+ echo " WARNING: $CURSOR_RULES_SRC not found — run sync-skills.sh first"
180
+ return
181
+ fi
182
+ link "$CURSOR_RULES_SRC" "$CURSOR_RULES_DST"
183
+ echo ""
184
+ echo " NOTE: Cursor does not scan ~/.cursor/rules/ globally."
185
+ echo " For per-project access, run in your project root:"
186
+ echo " ln -sfn $CURSOR_RULES_SRC .cursor/rules"
187
+ }
188
+
189
+ uninstall_cursor() {
190
+ echo ""
191
+ echo "Cursor → removing $CURSOR_RULES_DST"
192
+ unlink_if_managed "$CURSOR_RULES_DST" "$REPO_ROOT/"
193
+ }
194
+
195
+ # ── OpenCode ──────────────────────────────────────────────────────────────────
196
+
197
+ install_opencode() {
198
+ local opencode_config="$REPO_ROOT/opencode.json"
199
+ if [[ ! -f "$opencode_config" ]]; then
200
+ echo "Creating opencode.json..."
201
+ {
202
+ echo "{"
203
+ echo " \"\$schema\": \"https://opencode.ai/config.json\","
204
+ echo " \"instructions\": [\".cursor/rules/*.mdc\"]"
205
+ echo "}"
206
+ } > "$opencode_config"
207
+ else
208
+ echo "opencode.json already exists, skipping."
209
+ fi
210
+ }
211
+
212
+ print_opencode_instructions() {
213
+ echo ""
214
+ echo "OpenCode — integration active:"
215
+ echo " - opencode.json created (points to .cursor/rules/*.mdc)"
216
+ echo " - Add AGENTS.md for project-specific rules if needed"
217
+ }
218
+
219
+ # ── main ──────────────────────────────────────────────────────────────────────
220
+
221
+ echo "bigpowers install.sh — REPO: $REPO_ROOT"
222
+ $DRY_RUN && echo "(dry-run mode — no changes written)"
223
+ $UNINSTALL && echo "(uninstall mode)"
224
+
225
+ if $UNINSTALL; then
226
+ uninstall_claude
227
+ uninstall_gemini
228
+ uninstall_cursor
229
+ echo ""
230
+ echo "bigpowers uninstalled."
231
+ else
232
+ install_claude
233
+ install_gemini
234
+ install_cursor
235
+ install_opencode
236
+ print_opencode_instructions
237
+ echo ""
238
+ echo "bigpowers installed. Future updates:"
239
+ echo " git pull && ./scripts/sync-skills.sh"
240
+ fi
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env bash
2
+ # project-survey.sh — automated project status for session-start hooks
3
+
4
+ set -euo pipefail
5
+
6
+ # 1. Gather file existence info
7
+ has_conventions=$([[ -f "CONVENTIONS.md" ]] && echo "true" || echo "false")
8
+ has_claude=$([[ -f "CLAUDE.md" ]] && echo "true" || echo "false")
9
+ has_specs=$([[ -d "specs" ]] && echo "true" || echo "false")
10
+
11
+ # 2. Scan specs/
12
+ specs_files=""
13
+ if [[ "$has_specs" == "true" ]]; then
14
+ specs_files=$(ls specs/*.md 2>/dev/null | xargs -n1 basename | tr '\n' ',' | sed 's/,$//')
15
+ fi
16
+
17
+ # 3. Git state
18
+ current_branch=$(git branch --show-current 2>/dev/null || echo "not-a-repo")
19
+ git_status=$(git status --short 2>/dev/null | head -n 5 | tr '\n' ' ' | sed 's/"/\\"/g')
20
+ recent_logs=$(git log --oneline -3 2>/dev/null | tr '\n' ' ' | sed 's/"/\\"/g')
21
+
22
+ # 4. Phase mapping logic (simplified for script)
23
+ phase="Discover"
24
+ if [[ -f "specs/PLAN.md" ]]; then
25
+ phase="Execute"
26
+ elif [[ -f "specs/TASKS.md" ]]; then
27
+ phase="Plan"
28
+ elif [[ -f "specs/SCOPE.md" ]]; then
29
+ phase="Design"
30
+ elif [[ "$current_branch" != "main" && "$current_branch" != "master" ]]; then
31
+ phase="Initiate"
32
+ fi
33
+
34
+ if [[ -f "specs/DIAGNOSIS.md" ]]; then
35
+ phase="Bug"
36
+ fi
37
+
38
+ # 5. Output concise text for context injection
39
+ cat <<EOF
40
+ [PROJECT SURVEY]
41
+ Phase: $phase
42
+ Branch: $current_branch
43
+ Files: CONVENTIONS=$has_conventions, CLAUDE=$has_claude, SPECS=$has_specs
44
+ Specs Found: $specs_files
45
+ Git Status: $git_status
46
+ Recent Logs: $recent_logs
47
+
48
+ Welcome to Bigpowers. I have analyzed the project state.
49
+ You are currently in the '$phase' phase on the '$current_branch' branch.
50
+ EOF
51
+
52
+ if [[ -f "specs/PLAN.md" ]]; then
53
+ echo "Current PLAN.md found. I am ready to implement the next step."
54
+ fi
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env bash
2
+ # sync-skills.sh — generate Cursor and Gemini CLI artifacts from SKILL.md source files
3
+ # Run this after adding or updating any skill. Symlinks carry changes through automatically.
4
+ set -euo pipefail
5
+
6
+ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7
+ CURSOR_RULES="$REPO_ROOT/.cursor/rules"
8
+ GEMINI_EXT_DIR="$REPO_ROOT/.gemini/extensions/bigpowers"
9
+ GEMINI_SKILLS="$GEMINI_EXT_DIR/skills"
10
+ GEMINI_COMMANDS="$GEMINI_EXT_DIR/commands"
11
+ GEMINI_MANIFEST="$GEMINI_EXT_DIR/gemini-extension.json"
12
+
13
+ mkdir -p "$CURSOR_RULES" "$GEMINI_SKILLS" "$GEMINI_COMMANDS"
14
+
15
+ # Clear old artifacts to ensure a clean sync
16
+ rm -rf "${GEMINI_SKILLS:?}"/*
17
+ rm -rf "${GEMINI_COMMANDS:?}"/*
18
+
19
+ # We'll collect metadata for the manifest if needed,
20
+ # though skills/commands are auto-discovered.
21
+ # Manifest is still good for extension-level name/version.
22
+
23
+ skill_count=0
24
+
25
+ for skill_dir in "$REPO_ROOT"/*/; do
26
+ skill_md="$skill_dir/SKILL.md"
27
+ [[ -f "$skill_md" ]] || continue
28
+
29
+ # Extract name and description from YAML frontmatter
30
+ name=$(awk '/^---/{f++} f==1 && /^name:/{print; exit}' "$skill_md" | sed 's/^name:[[:space:]]*//')
31
+ description=$(awk '/^---/{f++} f==1 && /^description:/{p=1} p && !/^---/{print} f==2{exit}' "$skill_md" \
32
+ | sed 's/^description:[[:space:]]*//' \
33
+ | tr -d '\n' \
34
+ | sed 's/[[:space:]]\+/ /g')
35
+
36
+ [[ -z "$name" ]] && continue
37
+
38
+ # Build concatenated content: SKILL.md body + all other *.md files alphabetically
39
+ # Strip frontmatter from SKILL.md (content between second --- and EOF)
40
+ body=$(awk '/^---/{f++; next} f>=2{print}' "$skill_md")
41
+
42
+ for extra_md in $(find "$skill_dir" -maxdepth 1 -name "*.md" ! -name "SKILL.md" | sort); do
43
+ body="$body"$'\n\n'"---"$'\n\n'"$(cat "$extra_md")"
44
+ done
45
+
46
+ # Strip disable-model-invocation lines
47
+ body=$(echo "$body" | grep -v 'disable-model-invocation')
48
+
49
+ # 1. Write .cursor/rules/<name>.mdc
50
+ cursor_file="$CURSOR_RULES/$name.mdc"
51
+ {
52
+ echo "---"
53
+ echo "description: \"$description\""
54
+ echo "alwaysApply: false"
55
+ echo "---"
56
+ echo ""
57
+ echo "$body"
58
+ } > "$cursor_file"
59
+
60
+ # 2. Write Gemini Agent Skill: .gemini/extensions/bigpowers/skills/<name>/SKILL.md
61
+ mkdir -p "$GEMINI_SKILLS/$name"
62
+ {
63
+ echo "---"
64
+ echo "name: $name"
65
+ echo "description: \"$description\""
66
+ echo "---"
67
+ echo ""
68
+ echo "$body"
69
+ } > "$GEMINI_SKILLS/$name/SKILL.md"
70
+
71
+ # 3. Write Gemini Slash Command: .gemini/extensions/bigpowers/commands/<name>.toml
72
+ # We use a dedicated prompt file to keep the TOML clean
73
+ mkdir -p "$GEMINI_COMMANDS/prompts"
74
+ prompt_file="commands/prompts/$name.md"
75
+ echo "$body" > "$GEMINI_EXT_DIR/$prompt_file"
76
+
77
+ # Escape double quotes and backslashes for TOML
78
+ description_toml=$(echo "$description" | sed 's/\\/\\\\/g; s/"/\\"/g')
79
+
80
+ {
81
+ echo "description = \"$description_toml\""
82
+ echo "prompt = \"@{$prompt_file}\""
83
+ } > "$GEMINI_COMMANDS/$name.toml"
84
+
85
+ skill_count=$((skill_count + 1))
86
+ done
87
+
88
+ # Assemble final gemini-extension.json
89
+ pkg_version=$(grep '"version":' "$REPO_ROOT/package.json" | sed 's/.*: "\(.*\)".*/\1/')
90
+ pkg_desc=$(grep '"description":' "$REPO_ROOT/package.json" | sed 's/.*: "\(.*\)".*/\1/')
91
+
92
+ jq -n --arg name "bigpowers" \
93
+ --arg version "$pkg_version" \
94
+ --arg desc "$skill_count+ $pkg_desc" \
95
+ '{name: $name, version: $version, description: $desc}' > "$GEMINI_MANIFEST"
96
+
97
+ # 4. Write OpenCode configuration: opencode.json
98
+ {
99
+ echo "{"
100
+ echo " \"\$schema\": \"https://opencode.ai/config.json\","
101
+ echo " \"instructions\": [\".cursor/rules/*.mdc\"]"
102
+ echo "}"
103
+ } > "$REPO_ROOT/opencode.json"
104
+
105
+ echo "sync-skills: $skill_count skills synced"
106
+ echo " → .cursor/rules/ ($skill_count .mdc files)"
107
+ echo " → .gemini/extensions/bigpowers/skills/ (Agent Skills)"
108
+ echo " → .gemini/extensions/bigpowers/commands/ (Slash Commands)"
109
+ echo " → .gemini/extensions/bigpowers/gemini-extension.json"
110
+ echo " → opencode.json"
@@ -0,0 +1,185 @@
1
+ ---
2
+ name: seed-conventions
3
+ description: Generate CLAUDE.md and CONVENTIONS.md for a brand-new project through a brief interview, and create the specs/ directory. Entry point for greenfield projects. Use when starting a new project from scratch, when user asks to set up AI agent conventions, or when there is no CLAUDE.md yet.
4
+ ---
5
+
6
+ # Seed Conventions
7
+
8
+ Bootstrap a new project with the AI agent conventions it needs. Run this once at the start of a greenfield project.
9
+
10
+ ## What this creates
11
+
12
+ - `CLAUDE.md` — Claude Code session config (project-specific)
13
+ - `CONVENTIONS.md` — shared rules for all AI agents
14
+ - `specs/` — the specs directory where all planning output will live
15
+ - `AGENTS.md` — for OpenCode and other agents (optional)
16
+ - `GEMINI.md` — for Gemini CLI (optional)
17
+
18
+ ## Interview
19
+
20
+ Ask the user these questions (one at a time, wait for each answer):
21
+
22
+ 1. **Project name and one-sentence description** — "What is this project? One sentence."
23
+
24
+ 2. **Stack** — "What language, framework, and runtime? (e.g. TypeScript / Next.js / Node 22)"
25
+
26
+ 3. **Commands** — "What commands do you use for: run, test, build, lint? I'll document them so agents know how to verify their work."
27
+
28
+ 4. **Architecture** — "Describe the key modules and their relationships in 1–2 sentences. What are the main moving parts?"
29
+
30
+ 5. **Conventions** — "Any naming conventions, file organization rules, or patterns that every contributor (human or agent) must follow?"
31
+
32
+ 6. **Never-do list** — "What are the hard stops? Things an agent must never touch or do in this project?"
33
+
34
+ 7. **Defensive code categories** — "Which of these apply to your project? (Rate limit / Retry with backoff / Circuit breaker / Timeout / Graceful degradation)"
35
+
36
+ ## Generate files
37
+
38
+ After the interview, generate:
39
+
40
+ ### `CLAUDE.md`
41
+
42
+ ```markdown
43
+ # [Project Name] — Claude Code
44
+
45
+ Read CONVENTIONS.md before any GitHub or git operation.
46
+
47
+ ## Project
48
+ [One sentence description]
49
+ Stack: [language, framework, runtime]
50
+
51
+ ## Commands
52
+ | Action | Command |
53
+ |--------|---------|
54
+ | Run | `[cmd]` |
55
+ | Test | `[cmd]` |
56
+ | Build | `[cmd]` |
57
+ | Lint | `[cmd]` |
58
+
59
+ ## Architecture
60
+ [1–2 sentences. Key modules and their relationships.]
61
+
62
+ ## Conventions
63
+ - [convention 1]
64
+ - [convention 2]
65
+
66
+ ## Never
67
+ - [hard stop 1]
68
+ - [hard stop 2]
69
+
70
+ ## Agent Rules
71
+ - **Workflow Mandate:** You MUST use the bigpowers skills (e.g. `plan-work`, `develop-tdd`, `orchestrate-project`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
72
+ - Read specs/ before writing code.
73
+ - All planning and specifications MUST be written to `specs/` (e.g. `specs/PLAN.md`) before any code is generated.
74
+ - Write the minimum code that solves the stated problem. Nothing extra.
75
+ - Never refactor, rename, or reorganize code outside the task scope.
76
+ - Run tests after every change. Show evidence before declaring done.
77
+ - One clarifying question beats a wrong assumption baked into 200 lines.
78
+ ```
79
+
80
+ ### `GEMINI.md`
81
+
82
+ ```markdown
83
+ # [Project Name] — Gemini CLI
84
+
85
+ Read CONVENTIONS.md before any GitHub or git operation.
86
+
87
+ ## Project
88
+ [One sentence description]
89
+ Stack: [language, framework, runtime]
90
+
91
+ ## Commands
92
+ | Action | Command |
93
+ |--------|---------|
94
+ | Run | `[cmd]` |
95
+ | Test | `[cmd]` |
96
+ | Build | `[cmd]` |
97
+ | Lint | `[cmd]` |
98
+
99
+ ## Architecture
100
+ [1–2 sentences. Key modules and their relationships.]
101
+
102
+ ## Conventions
103
+ - [convention 1]
104
+ - [convention 2]
105
+
106
+ ## Never
107
+ - [hard stop 1]
108
+ - [hard stop 2]
109
+
110
+ ## Agent Rules
111
+ - **Workflow Mandate:** You MUST use the bigpowers skills (e.g. `plan-work`, `develop-tdd`, `orchestrate-project`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
112
+ - Read specs/ before writing code.
113
+ - All planning and specifications MUST be written to `specs/` (e.g. `specs/PLAN.md`) before any code is generated.
114
+ - Write the minimum code that solves the stated problem. Nothing extra.
115
+ - Never refactor, rename, or reorganize code outside the task scope.
116
+ - Run tests after every change. Show evidence before declaring done.
117
+ - One clarifying question beats a wrong assumption baked into 200 lines.
118
+ ```
119
+
120
+ ### `AGENTS.md`
121
+
122
+ ```markdown
123
+ # [Project Name] — OpenCode
124
+
125
+ Read CONVENTIONS.md before any GitHub or git operation.
126
+
127
+ ## Project
128
+ [One sentence description]
129
+ Stack: [language, framework, runtime]
130
+
131
+ ## Commands
132
+ | Action | Command |
133
+ |--------|---------|
134
+ | Run | `[cmd]` |
135
+ | Test | `[cmd]` |
136
+ | Build | `[cmd]` |
137
+ | Lint | `[cmd]` |
138
+
139
+ ## Architecture
140
+ [1–2 sentences. Key modules and their relationships.]
141
+
142
+ ## Conventions
143
+ - [convention 1]
144
+ - [convention 2]
145
+
146
+ ## Never
147
+ - [hard stop 1]
148
+ - [hard stop 2]
149
+
150
+ ## Agent Rules
151
+ - **Workflow Mandate:** You MUST use the bigpowers skills (e.g. `plan-work`, `develop-tdd`, `orchestrate-project`) to perform tasks. DO NOT write code directly in response to a user prompt like "build this feature".
152
+ - Read specs/ before writing code.
153
+ - All planning and specifications MUST be written to `specs/` (e.g. `specs/PLAN.md`) before any code is generated.
154
+ - Write the minimum code that solves the stated problem. Nothing extra.
155
+ - Never refactor, rename, or reorganize code outside the task scope.
156
+ - Run tests after every change. Show evidence before declaring done.
157
+ - One clarifying question beats a wrong assumption baked into 200 lines.
158
+ ```
159
+
160
+ ### `opencode.json`
161
+
162
+ ```json
163
+ {
164
+ "$schema": "https://opencode.ai/config.json",
165
+ "instructions": [".cursor/rules/*.mdc"]
166
+ }
167
+ ```
168
+
169
+ ### `CONVENTIONS.md`
170
+
171
+ Use the standard bigpowers CONVENTIONS.md template, filling in the project-specific defensive code categories from the interview.
172
+
173
+ ### `specs/` directory
174
+
175
+ ```bash
176
+ mkdir -p specs
177
+ echo "# Specs\n\nAll planning documents for this project." > specs/README.md
178
+ ```
179
+
180
+ ### Verify
181
+
182
+ - [ ] CLAUDE.md exists and is populated
183
+ - [ ] CONVENTIONS.md exists and includes specs/ output convention
184
+ - [ ] specs/ directory exists
185
+ - [ ] Confirm with user: "Does CLAUDE.md accurately describe your project?"
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: session-state
3
+ description: Track implementation decisions and progress in specs/STATE.md to prevent context rot. Use at the start of a session to load context, and whenever a significant decision is made or a milestone is reached.
4
+ ---
5
+
6
+ # Session State
7
+
8
+ Track the current state of implementation, including decisions made, pending tasks, and open questions, to ensure continuity across session boundaries and prevent "context rot."
9
+
10
+ ## Goal
11
+
12
+ Maintain a single source of truth for the *current* state of the work in `specs/STATE.md`. This file acts as the project's short-term memory, complementing the long-term memory of `specs/CONTEXT.md` and the task-specific instructions in `specs/PLAN.md`.
13
+ ## Workflow
14
+
15
+ ### 1. Initialize (Session Start)
16
+
17
+ If `specs/STATE.md` does not exist, or if starting a new major phase:
18
+
19
+ - [ ] Read `specs/PLAN.md` and `specs/SCOPE.md`.
20
+ - [ ] Get git metadata: `git branch --show-current` and `git rev-parse HEAD`.
21
+ - [ ] Create `specs/STATE.md` with the current milestone, git metadata, pending tasks, and any active decisions.
22
+
23
+ ### 2. Load (Context Refresh)
24
+
25
+ When starting a new session or after a significant context flush:
26
+
27
+ - [ ] Read `specs/STATE.md` to understand where the previous agent left off.
28
+ - [ ] Verify the current state matches the actual codebase (run `git branch` and `git diff`).
29
+ - [ ] Surface any discrepancies between recorded git hash and current hash.
30
+
31
+ ### 3. Update (Decision Point/Milestone)
32
+
33
+ Whenever a significant decision is made or a milestone is reached:
34
+
35
+ - [ ] Update git metadata if the branch or hash has changed.
36
+ - [ ] Update the `Active Decisions` section with the rationale for the choice.
37
+ - [ ] Mark completed tasks as done.
38
+ - [ ] Add new pending tasks discovered during implementation.
39
+ - [ ] Record any "Open Questions" that need user clarification.
40
+
41
+ ## File Format: specs/STATE.md
42
+
43
+ ```markdown
44
+ # Session State: [Feature Name]
45
+
46
+ ## Current Milestone
47
+ [What is being worked on right now]
48
+
49
+ ## Git Metadata
50
+ - **Branch**: [branch-name]
51
+ - **Hash**: [commit-hash]
52
+
53
+ ## Pending Tasks
54
+ ...
55
+ ```
56
+ - [ ] Task 2
57
+
58
+ ## Active Decisions
59
+ - **Decision Name**: [Rationale and impact]
60
+
61
+ ## Open Questions
62
+ - [Question for the user]
63
+ ```
64
+
65
+ ## Anti-Patterns
66
+
67
+ - **Duplicate Plan**: Don't just copy `specs/PLAN.md`. The plan is the *intended* path; the state is the *actual* progress and the deviations from that path.
68
+ - **Stale State**: Forgetting to update `specs/STATE.md` after a major refactor or decision.
69
+ - **Verbose History**: Keep it focused on the *current* state. Use git history for the past.