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,116 @@
1
+ ---
2
+ name: release-branch
3
+ description: Make the merge/PR/keep/discard decision for a feature branch, verify coverage gates, create the PR with gh, and clean up the worktree. Use when a feature is done and ready to ship, or when user says "release", "merge", or "open a PR".
4
+ ---
5
+
6
+ # Release Branch
7
+
8
+ > **HARD GATE** — Do NOT merge or release if tests fail or if coverage gates are not met. If the branch is red, return to `develop-tdd` to fix regressions or add missing tests before proceeding.
9
+
10
+ Finalize a completed feature branch: verify coverage gates, open a PR, and clean up the worktree.
11
+
12
+ ## Process
13
+
14
+ ### 1. Final verification
15
+
16
+ Run the full suite one last time on the feature branch:
17
+
18
+ ```bash
19
+ <full test command>
20
+ <typecheck command>
21
+ <lint command>
22
+ # Verify Conventional Commits history
23
+ git log main...HEAD --oneline | grep -vE "^[a-f0-9]+ (feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+$" && echo "❌ ERROR: Non-conventional commits found" || echo "✅ Commits verified"
24
+ ```
25
+
26
+ - [ ] All tests pass
27
+ - [ ] No type errors
28
+ - [ ] No lint violations
29
+ - [ ] All commits in branch history follow Conventional Commits 1.0.0
30
+
31
+ ### 2. Coverage check
32
+
33
+ Verify coverage meets the project gates:
34
+
35
+ - [ ] Overall coverage ≥ 80%
36
+ - [ ] Business logic / domain layer coverage ≥ 95%
37
+
38
+ If coverage is below the gate, stop and return to `develop-tdd` to add missing tests.
39
+
40
+ ### 3. Diff review
41
+
42
+ ```bash
43
+ git diff main...HEAD --stat
44
+ git log main...HEAD --oneline
45
+ ```
46
+
47
+ Confirm:
48
+ - [ ] All commits are intentional — no debug commits, no "WIP" commits
49
+ - [ ] No secrets, credentials, or personal data in the diff
50
+ - [ ] CONVENTIONS.md compliance across all changes
51
+
52
+ ### 5. Decision
53
+
54
+ Present the user with the options:
55
+
56
+ | Option | When to choose |
57
+ |--------|---------------|
58
+ | **Open PR for Release** | Feature is complete, tests pass, ready to trigger automated release |
59
+ | **Keep branch** | More work needed; preserve for later |
60
+ | **Discard** | Approach was wrong; start over |
61
+
62
+ ### 6. Create PR (Triggers Automated Release)
63
+
64
+ The PR title is the **single source of truth** for the version bump. It MUST follow Conventional Commits.
65
+
66
+ ```bash
67
+ # Verify PR Title first
68
+ PR_TITLE="<type>(<scope>): <description>"
69
+ echo "$PR_TITLE" | grep -vE "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+$" && echo "❌ ERROR: PR Title must follow Conventional Commits"
70
+
71
+ gh pr create \
72
+ --title "$PR_TITLE" \
73
+ --body "$(cat <<'EOF'
74
+ ## Summary
75
+ - [What this PR does]
76
+ - [Key decisions made]
77
+
78
+ ## Verify
79
+ - [ ] All tests pass
80
+ - [ ] Coverage gates met (≥80% overall, ≥95% business logic)
81
+ - [ ] CONVENTIONS.md compliance verified
82
+ - [ ] PR Title follows Conventional Commits (for automated release)
83
+
84
+ ## specs/ artifacts
85
+ - [List any specs/ files produced or updated]
86
+ EOF
87
+ )"
88
+ ```
89
+
90
+ ### 7. Merge (Automated)
91
+
92
+ Wait for CI to pass. Merge using **Squash and Merge** to ensure the PR title becomes the commit message on `main`.
93
+
94
+ ```bash
95
+ gh pr merge --squash --delete-branch
96
+ ```
97
+
98
+ `semantic-release` will now automatically:
99
+ 1. Detect the commit on `main`.
100
+ 2. Determine the SemVer bump from the commit type.
101
+ 3. Tag the repo (e.g., `v2.1.0`).
102
+ 4. Generate release notes.
103
+
104
+ ### 8. Clean up worktree (if using git worktree)
105
+
106
+ ```bash
107
+ # From the main repo root
108
+ git worktree prune # clear stale metadata
109
+ git worktree remove ../<branch-name> 2>/dev/null || true
110
+ git branch -d <branch-name>
111
+ ```
112
+
113
+ - If `git worktree remove` fails due to uncommitted changes, ask the user: "There are uncommitted changes in the worktree. Force remove? (y/n)". If yes: `git worktree remove -f ../<branch-name>`.
114
+ - If the directory `../<branch-name>` is already missing, `git worktree remove` might fail; the `|| true` ensures the process continues to branch deletion.
115
+
116
+ Report: "Branch released. PR: <URL>. Worktree cleaned up."
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: request-review
3
+ description: Dispatch a fresh reviewer agent with a clean context to critique the code after audit-code passes. The reviewer has no shared state with the coding agent and gives a genuine second opinion. Use after audit-code passes, before committing, or when user wants an independent code review.
4
+ ---
5
+
6
+ # Request Review
7
+
8
+ Dispatch a fresh reviewer agent with a clean context. The reviewer has no shared state — it can give a genuine second opinion because it hasn't been involved in writing the code.
9
+
10
+ **Distinct from `audit-code`:** `audit-code` is the coding agent checking its own work (internal). This skill dispatches an external agent whose job is to find what the coding agent missed.
11
+
12
+ **Solo developer note:** This replaces the human reviewer. The reviewer agent IS the reviewer.
13
+
14
+ **Run `audit-code` first.** This skill assumes `audit-code` has already passed. Don't waste a reviewer's attention on hygiene issues you could have caught yourself.
15
+
16
+ ## Process
17
+
18
+ ### 1. Prepare the review brief
19
+
20
+ Write a self-contained brief for the reviewer agent. Include:
21
+
22
+ - What was built (feature description, not implementation)
23
+ - Which files changed (the diff context)
24
+ - What `specs/` artifacts are relevant (PLAN.md, DIAGNOSIS.md, SCOPE.md)
25
+ - What CONVENTIONS.md requires
26
+ - What the verify command is
27
+ - What you're most uncertain about (where you want fresh eyes)
28
+
29
+ ### 2. Dispatch the reviewer agent
30
+
31
+ Use the Agent tool with a completely fresh context. The agent prompt must be self-contained — no references to "our conversation" or "what we discussed."
32
+
33
+ ```
34
+ You are a code reviewer. Review the following code changes.
35
+
36
+ Context: [feature description]
37
+ CONVENTIONS.md rules: [paste relevant sections]
38
+ specs/PLAN.md: [paste or summarize]
39
+
40
+ Diff: [paste git diff or describe changed files]
41
+
42
+ Verify command: [runnable command]
43
+
44
+ Review for:
45
+ 1. Correctness — does the code do what was intended?
46
+ 2. CONVENTIONS.md compliance — are all rules followed?
47
+ 3. Test quality — do tests verify behavior (not implementation)?
48
+ 4. Design — are there simpler or more robust approaches?
49
+ 5. Edge cases — what inputs or states could cause failures?
50
+ 6. Security — any injection, auth, or data exposure risks?
51
+
52
+ For each finding, categorize as: must-fix / should-fix / consider.
53
+ Run the verify command and report the result.
54
+ ```
55
+
56
+ ### 3. Collect the report
57
+
58
+ When the reviewer returns:
59
+ - Read every finding before acting on any
60
+ - Note the verify command result
61
+ - Compute the quality score: `100 × (total_items − must_fix − should_fix) / total_items`
62
+ - Report the score to the user
63
+
64
+ > **HARD GATE** — If score < 94%, do NOT merge. Run `respond-review` to resolve must-fix and should-fix findings first.
65
+
66
+ ### 4. Hand off to respond-review
67
+
68
+ Pass the reviewer's report to `respond-review` to categorize findings and apply fixes.
69
+
70
+ Report to user: "Review complete. [N] findings: [X] must-fix, [Y] should-fix, [Z] consider. Running respond-review."
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: respond-review
3
+ description: Act on a reviewer agent's feedback systematically — categorize findings, apply fixes, verify tests still pass. Use after request-review returns a report, or when user wants to work through code review findings.
4
+ ---
5
+
6
+ # Respond Review
7
+
8
+ Work through reviewer findings systematically. Don't apply changes blindly — categorize first, then decide, then fix, then verify.
9
+
10
+ ## Process
11
+
12
+ ### 1. Read the full review report
13
+
14
+ Read every finding before acting on any of them. Get the full picture first.
15
+
16
+ ### 2. Categorize findings
17
+
18
+ For each finding, assign a category:
19
+
20
+ | Category | Meaning | Action |
21
+ |----------|---------|--------|
22
+ | **must-fix** | Correctness bug, security issue, test failure, CONVENTIONS.md violation | Fix before proceeding |
23
+ | **should-fix** | Code quality issue, naming, clarity — worth fixing but not blocking | Fix if time allows |
24
+ | **consider** | Architectural suggestion, alternative approach — may or may not apply | Discuss with user |
25
+
26
+ Create a numbered list of all findings with their categories.
27
+
28
+ ### 3. Confirm with user (for consider-category items)
29
+
30
+ For each "consider" item, briefly describe the trade-off and ask: "Apply, skip, or discuss?"
31
+
32
+ ### 4. Apply must-fix items first
33
+
34
+ Fix every must-fix item. For each one:
35
+ - Describe what you're changing and why
36
+ - Make the change
37
+ - Run the verify command if one exists for this area
38
+
39
+ ### 5. Apply should-fix items
40
+
41
+ Apply should-fix items. If any are large enough to warrant their own commit, note them separately.
42
+
43
+ ### 6. Run the full suite
44
+
45
+ After all changes are applied:
46
+
47
+ ```bash
48
+ <full test command>
49
+ <typecheck command>
50
+ <lint command>
51
+ ```
52
+
53
+ - [ ] All tests pass
54
+ - [ ] No type errors
55
+ - [ ] No lint violations
56
+
57
+ ### 7. Report
58
+
59
+ Summarize what was applied and what was skipped:
60
+
61
+ ```
62
+ Applied (must-fix): #1, #2, #3
63
+ Applied (should-fix): #4
64
+ Skipped (consider): #5 — agreed with user to defer
65
+ All tests pass.
66
+ ```
67
+
68
+ Suggest next skill: `commit-message`.
@@ -0,0 +1,256 @@
1
+ #!/usr/bin/env bash
2
+ # audit-compliance.sh — Agentic Gherkin Compliance Harness (LLM-Judge Upgrade)
3
+
4
+ # --- Help Message ---
5
+ show_help() {
6
+ cat <<EOF
7
+ Usage: bash scripts/audit-compliance.sh [feature-file|directory] [options]
8
+
9
+ Options:
10
+ --help Show this help message
11
+ --dry-run Parse the feature file without starting the judge loop
12
+ --scenario [name] Run only a specific scenario
13
+ --judge [type] Judge type: 'binary' (exit code, default) or 'gemini' (LLM-judged)
14
+ --model [name] Model name to use for judging
15
+
16
+ If a directory is provided, all .feature files in that directory will be processed.
17
+ EOF
18
+ }
19
+
20
+ # --- Arguments Parsing ---
21
+ DRY_RUN=false
22
+ SCENARIO_FILTER=""
23
+ JUDGE="binary"
24
+ MODEL=""
25
+ INPUTS=()
26
+
27
+ while [[ $# -gt 0 ]]; do
28
+ case "$1" in
29
+ --help)
30
+ show_help
31
+ exit 0
32
+ ;;
33
+ --dry-run)
34
+ DRY_RUN=true
35
+ shift
36
+ ;;
37
+ --scenario)
38
+ SCENARIO_FILTER="$2"
39
+ shift 2
40
+ ;;
41
+ --judge)
42
+ JUDGE="$2"
43
+ shift 2
44
+ ;;
45
+ --model)
46
+ MODEL="$2"
47
+ shift 2
48
+ ;;
49
+ -*)
50
+ echo "Unknown option: $1"
51
+ show_help
52
+ exit 1
53
+ ;;
54
+ *)
55
+ INPUTS+=("$1")
56
+ shift
57
+ ;;
58
+ esac
59
+ done
60
+
61
+ if [[ ${#INPUTS[@]} -eq 0 ]]; then
62
+ echo "Error: No feature file or directory specified."
63
+ show_help
64
+ exit 1
65
+ fi
66
+
67
+ # --- Global Stats ---
68
+ TOTAL_GLOBAL_PASS=0
69
+ TOTAL_GLOBAL_FAIL=0
70
+
71
+ # --- Judging Logic ---
72
+
73
+ judge_with_gemini() {
74
+ local step="$1"
75
+ local feature_name="$2"
76
+ local scenario_name="$3"
77
+ local evidence="$4"
78
+ local report_file="$5"
79
+
80
+ echo " [JUDGE] Sending evidence to Gemini CLI..."
81
+
82
+ local prompt="You are the Master Test Architect judging a compliance audit.
83
+ Benchmark Feature: $feature_name
84
+ Scenario: $scenario_name
85
+ Compliance Step: $step
86
+
87
+ Evidence gathered from the codebase:
88
+ ---
89
+ $evidence
90
+ ---
91
+
92
+ Based on the benchmark principles, does this evidence demonstrate compliance?
93
+ Respond strictly in the following format:
94
+ VERDICT: [PASS/FAIL]
95
+ RATIONALE: [One sentence explanation]"
96
+
97
+ local model_output
98
+ local gemini_cmd="gemini --approval-mode plan"
99
+ if [[ -n "$MODEL" ]]; then
100
+ gemini_cmd="$gemini_cmd -m $MODEL"
101
+ fi
102
+
103
+ model_output=$($gemini_cmd -p "$prompt" 2>&1)
104
+ local exit_code=$?
105
+
106
+ if [[ $exit_code -eq 0 ]]; then
107
+ local verdict
108
+ verdict=$(echo "$model_output" | grep "VERDICT:" | cut -d' ' -f2)
109
+ local rationale
110
+ rationale=$(echo "$model_output" | grep "RATIONALE:" | cut -d' ' -f2-)
111
+
112
+ if [[ "$verdict" == "PASS" ]]; then
113
+ echo " Result: PASS"
114
+ echo "- [x] $step (PASS) - $rationale" >> "$report_file"
115
+ return 0
116
+ else
117
+ echo " Result: FAIL"
118
+ echo "- [ ] $step (FAIL) - $rationale" >> "$report_file"
119
+ return 1
120
+ fi
121
+ else
122
+ echo " Result: ERROR (Gemini CLI failed)"
123
+ echo "- [ ] $step (ERROR) - Gemini CLI exit code $exit_code. Output: $model_output" >> "$report_file"
124
+ return 1
125
+ fi
126
+ }
127
+
128
+ judge_binary() {
129
+ local step="$1"
130
+ local exit_code="$2"
131
+ local evidence="$3"
132
+ local report_file="$4"
133
+
134
+ if [[ $exit_code -eq 0 ]]; then
135
+ echo " Result: PASS"
136
+ echo "- [x] $step (PASS)" >> "$report_file"
137
+ return 0
138
+ else
139
+ echo " Result: FAIL"
140
+ echo "- [ ] $step (FAIL) - $evidence" >> "$report_file"
141
+ return 1
142
+ fi
143
+ }
144
+
145
+ # --- Core Execution ---
146
+
147
+ process_step() {
148
+ local step="$1"
149
+ local feature_name="$2"
150
+ local scenario_name="$3"
151
+ local report_file="$4"
152
+ echo " [STEP] $step"
153
+
154
+ if [[ "$DRY_RUN" == "true" ]]; then
155
+ return 0
156
+ fi
157
+
158
+ local sanitized_step
159
+ sanitized_step=$(echo "$step" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
160
+ local step_script="specs/audit/steps/${sanitized_step}.sh"
161
+
162
+ if [[ -f "$step_script" ]]; then
163
+ echo " [EXEC] Gathering evidence: $step_script"
164
+ local evidence
165
+ evidence=$(bash "$step_script" 2>&1)
166
+ local exit_code=$?
167
+
168
+ if [[ "$JUDGE" == "gemini" ]]; then
169
+ judge_with_gemini "$step" "$feature_name" "$scenario_name" "$evidence" "$report_file"
170
+ else
171
+ judge_binary "$step" "$exit_code" "$evidence" "$report_file"
172
+ fi
173
+ else
174
+ echo " Result: FAIL (Missing evidence: $step_script)"
175
+ echo "- [ ] $step (FAIL) - No verification script found at $step_script" >> "$report_file"
176
+ return 1
177
+ fi
178
+ }
179
+
180
+ run_audit_file() {
181
+ local FEATURE_FILE="$1"
182
+ echo "------------------------------------------------------------"
183
+ echo "FEATURE: $FEATURE_FILE"
184
+
185
+ local REPORT_FILE="specs/audit/reports/audit-$(basename "$FEATURE_FILE" .feature)-$(date +%Y%m%d-%H%M%S).md"
186
+ mkdir -p specs/audit/reports
187
+
188
+ echo "# Audit Report: $FEATURE_FILE" > "$REPORT_FILE"
189
+ echo "Date: $(date)" >> "$REPORT_FILE"
190
+ echo "Mode: Autonomous Verification (Judge: $JUDGE)" >> "$REPORT_FILE"
191
+ echo "" >> "$REPORT_FILE"
192
+
193
+ local TOTAL_PASS=0
194
+ local TOTAL_FAIL=0
195
+ local CURRENT_FEATURE=""
196
+ local CURRENT_SCENARIO=""
197
+ local IN_SCENARIO=false
198
+
199
+ while IFS= read -r line; do
200
+ line=$(echo "$line" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
201
+
202
+ if [[ "$line" =~ ^Feature: ]]; then
203
+ CURRENT_FEATURE="${line#Feature: }"
204
+ echo "FEATURE: $CURRENT_FEATURE"
205
+ echo "## Feature: $CURRENT_FEATURE" >> "$REPORT_FILE"
206
+ elif [[ "$line" =~ ^Scenario: ]]; then
207
+ CURRENT_SCENARIO="${line#Scenario: }"
208
+ if [[ -n "$SCENARIO_FILTER" && "$CURRENT_SCENARIO" != "$SCENARIO_FILTER" ]]; then
209
+ IN_SCENARIO=false
210
+ continue
211
+ fi
212
+ IN_SCENARIO=true
213
+ echo " SCENARIO: $CURRENT_SCENARIO"
214
+ echo "### Scenario: $CURRENT_SCENARIO" >> "$REPORT_FILE"
215
+ elif [[ "$line" =~ ^(Given|When|Then|And|But)\ ]]; then
216
+ if [[ "$IN_SCENARIO" == "true" ]]; then
217
+ if process_step "$line" "$CURRENT_FEATURE" "$CURRENT_SCENARIO" "$REPORT_FILE"; then
218
+ ((TOTAL_PASS++))
219
+ ((TOTAL_GLOBAL_PASS++))
220
+ else
221
+ ((TOTAL_FAIL++))
222
+ ((TOTAL_GLOBAL_FAIL++))
223
+ fi
224
+ fi
225
+ fi
226
+ done < "$FEATURE_FILE"
227
+
228
+ echo ""
229
+ echo "File Summary: PASS: $TOTAL_PASS, FAIL: $TOTAL_FAIL"
230
+ echo "Report saved to: $REPORT_FILE"
231
+ }
232
+
233
+ # --- Main Execution ---
234
+ for input in "${INPUTS[@]}"; do
235
+ if [[ -d "$input" ]]; then
236
+ for f in "$input"/*.feature; do
237
+ if [[ -f "$f" ]]; then
238
+ run_audit_file "$f"
239
+ fi
240
+ done
241
+ elif [[ -f "$input" ]]; then
242
+ run_audit_file "$input"
243
+ else
244
+ echo "Warning: Input not found: $input"
245
+ fi
246
+ done
247
+
248
+ echo "============================================================"
249
+ echo "Global Audit Summary:"
250
+ echo " TOTAL PASS: $TOTAL_GLOBAL_PASS"
251
+ echo " TOTAL FAIL: $TOTAL_GLOBAL_FAIL"
252
+ echo "============================================================"
253
+
254
+ if [[ $TOTAL_GLOBAL_FAIL -gt 0 ]]; then
255
+ exit 1
256
+ fi
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+ # cleanup-worktrees.sh — Identify and remove stale git worktrees
3
+ set -euo pipefail
4
+
5
+ # 1. Prune stale metadata (ghost worktrees where directory was manually deleted)
6
+ echo "Pruning stale worktree metadata..."
7
+ git worktree prune
8
+
9
+ # 2. List current worktrees
10
+ echo "Current worktrees:"
11
+ git worktree list --porcelain | grep "^worktree" | awk '{print $2}'
12
+
13
+ # 3. Identify worktrees whose branches are merged or deleted
14
+ echo ""
15
+ echo "Checking for stale worktrees (merged branches)..."
16
+ MAIN_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
17
+
18
+ git worktree list --porcelain | while read -r line; do
19
+ if [[ $line =~ ^worktree\ (.*) ]]; then
20
+ WT_PATH="${BASH_REMATCH[1]}"
21
+ elif [[ $line =~ ^branch\ refs/heads/(.*) ]]; then
22
+ WT_BRANCH="${BASH_REMATCH[1]}"
23
+
24
+ # Skip main branch
25
+ if [[ "$WT_BRANCH" == "$MAIN_BRANCH" ]]; then
26
+ continue
27
+ fi
28
+
29
+ # Check if branch is merged into main
30
+ if git merge-base --is-ancestor "$WT_BRANCH" "$MAIN_BRANCH" 2>/dev/null; then
31
+ echo "MERGED: $WT_BRANCH at $WT_PATH"
32
+ echo " Run: git worktree remove $WT_PATH && git branch -d $WT_BRANCH"
33
+ else
34
+ # Check if branch still exists (might have been deleted elsewhere)
35
+ if ! git show-ref --verify --quiet "refs/heads/$WT_BRANCH"; then
36
+ echo "MISSING BRANCH: $WT_BRANCH at $WT_PATH (branch was deleted)"
37
+ echo " Run: git worktree remove $WT_PATH"
38
+ fi
39
+ fi
40
+ fi
41
+ done
42
+
43
+ echo ""
44
+ echo "Cleanup complete."
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # Install skills into a project: <install-root>/.cursor/skills (not ~/.cursor/skills).
3
+ # Usage: ./scripts/install-cursor-skills-local.sh [INSTALL_ROOT]
4
+ # INSTALL_ROOT defaults to the current working directory. Skills are read from
5
+ # this skills repository unless SOURCE_DIR is set.
6
+ set -euo pipefail
7
+
8
+ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
9
+ INSTALL_ROOT="$(cd "${1:-"$PWD"}" && pwd)"
10
+ export TARGET_DIR="${TARGET_DIR:-"$INSTALL_ROOT/.cursor/skills"}"
11
+ export SOURCE_DIR="${SOURCE_DIR:-$REPO_ROOT}"
12
+
13
+ exec "$REPO_ROOT/scripts/install-cursor-skills.sh"
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5
+ SOURCE_DIR="${SOURCE_DIR:-$REPO_ROOT}"
6
+ TARGET_DIR="${TARGET_DIR:-"$HOME/.cursor/skills"}"
7
+
8
+ if [[ ! -d "$SOURCE_DIR" ]]; then
9
+ echo "SOURCE_DIR is not a directory: $SOURCE_DIR" >&2
10
+ exit 1
11
+ fi
12
+
13
+ mkdir -p "$TARGET_DIR"
14
+
15
+ shopt -s nullglob
16
+ count=0
17
+ for item in "$SOURCE_DIR"/*; do
18
+ [[ -d "$item" ]] || continue
19
+ name="$(basename "$item")"
20
+ [[ -f "$item/SKILL.md" ]] || continue
21
+ if [[ "$name" == .?* ]]; then
22
+ continue
23
+ fi
24
+ echo "Syncing <${name}>"
25
+ rsync -a --delete "$item/" "$TARGET_DIR/${name}/"
26
+ count=$((count + 1))
27
+ done
28
+
29
+ if [[ "$count" -eq 0 ]]; then
30
+ echo "No top-level skill directories with SKILL.md found in $SOURCE_DIR" >&2
31
+ exit 1
32
+ fi
33
+
34
+ echo "Done. Installed $count skills under $TARGET_DIR"