bigpowers 2.87.8 → 2.88.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/.agents/skills/commit-message/SKILL.md +4 -2
  2. package/.agents/skills/kickoff-branch/SKILL.md +12 -7
  3. package/.agents/skills/release-branch/SKILL.md +12 -6
  4. package/.agents/skills/survey-context/SKILL.md +11 -6
  5. package/.cline/skills/commit-message/SKILL.md +4 -2
  6. package/.cline/skills/kickoff-branch/SKILL.md +12 -7
  7. package/.cline/skills/release-branch/SKILL.md +12 -6
  8. package/.cline/skills/survey-context/SKILL.md +11 -6
  9. package/.codebuddy/skills/commit-message/SKILL.md +4 -2
  10. package/.codebuddy/skills/kickoff-branch/SKILL.md +12 -7
  11. package/.codebuddy/skills/release-branch/SKILL.md +12 -6
  12. package/.codebuddy/skills/survey-context/SKILL.md +11 -6
  13. package/.codex/skills/commit-message/SKILL.md +4 -2
  14. package/.codex/skills/kickoff-branch/SKILL.md +12 -7
  15. package/.codex/skills/release-branch/SKILL.md +12 -6
  16. package/.codex/skills/survey-context/SKILL.md +11 -6
  17. package/.copilot/skills/commit-message/SKILL.md +4 -2
  18. package/.copilot/skills/kickoff-branch/SKILL.md +12 -7
  19. package/.copilot/skills/release-branch/SKILL.md +12 -6
  20. package/.copilot/skills/survey-context/SKILL.md +11 -6
  21. package/.cursor/rules/commit-message.mdc +4 -2
  22. package/.cursor/rules/kickoff-branch.mdc +12 -7
  23. package/.cursor/rules/release-branch.mdc +12 -6
  24. package/.cursor/rules/survey-context.mdc +11 -6
  25. package/.gemini/extensions/bigpowers/commands/prompts/commit-message.md +4 -2
  26. package/.gemini/extensions/bigpowers/commands/prompts/kickoff-branch.md +12 -7
  27. package/.gemini/extensions/bigpowers/commands/prompts/release-branch.md +12 -6
  28. package/.gemini/extensions/bigpowers/commands/prompts/survey-context.md +11 -6
  29. package/.gemini/extensions/bigpowers/gemini-extension.json +1 -1
  30. package/.gemini/extensions/bigpowers/skills/commit-message/SKILL.md +4 -2
  31. package/.gemini/extensions/bigpowers/skills/kickoff-branch/SKILL.md +12 -7
  32. package/.gemini/extensions/bigpowers/skills/release-branch/SKILL.md +12 -6
  33. package/.gemini/extensions/bigpowers/skills/survey-context/SKILL.md +11 -6
  34. package/.hermes/skills/commit-message/SKILL.md +4 -2
  35. package/.hermes/skills/kickoff-branch/SKILL.md +12 -7
  36. package/.hermes/skills/release-branch/SKILL.md +12 -6
  37. package/.hermes/skills/survey-context/SKILL.md +11 -6
  38. package/.kilocode/rules/commit-message.md +4 -2
  39. package/.kilocode/rules/kickoff-branch.md +12 -7
  40. package/.kilocode/rules/release-branch.md +12 -6
  41. package/.kilocode/rules/survey-context.md +11 -6
  42. package/.mimocode/skills/commit-message/SKILL.md +4 -2
  43. package/.mimocode/skills/kickoff-branch/SKILL.md +12 -7
  44. package/.mimocode/skills/release-branch/SKILL.md +12 -6
  45. package/.mimocode/skills/survey-context/SKILL.md +11 -6
  46. package/.opencode/skills/commit-message/SKILL.md +4 -2
  47. package/.opencode/skills/kickoff-branch/SKILL.md +12 -7
  48. package/.opencode/skills/release-branch/SKILL.md +12 -6
  49. package/.opencode/skills/survey-context/SKILL.md +11 -6
  50. package/.pi/package.json +1 -1
  51. package/.pi/prompts/commit-message.md +4 -2
  52. package/.pi/prompts/kickoff-branch.md +12 -7
  53. package/.pi/prompts/release-branch.md +12 -6
  54. package/.pi/prompts/survey-context.md +11 -6
  55. package/.pi/skills/commit-message/SKILL.md +4 -2
  56. package/.pi/skills/kickoff-branch/SKILL.md +12 -7
  57. package/.pi/skills/release-branch/SKILL.md +12 -6
  58. package/.pi/skills/survey-context/SKILL.md +11 -6
  59. package/.qwen/skills/commit-message/SKILL.md +4 -2
  60. package/.qwen/skills/kickoff-branch/SKILL.md +12 -7
  61. package/.qwen/skills/release-branch/SKILL.md +12 -6
  62. package/.qwen/skills/survey-context/SKILL.md +11 -6
  63. package/.trae/skills/commit-message/SKILL.md +4 -2
  64. package/.trae/skills/kickoff-branch/SKILL.md +12 -7
  65. package/.trae/skills/release-branch/SKILL.md +12 -6
  66. package/.trae/skills/survey-context/SKILL.md +11 -6
  67. package/.windsurf/rules/commit-message.md +4 -2
  68. package/.windsurf/rules/kickoff-branch.md +12 -7
  69. package/.windsurf/rules/release-branch.md +12 -6
  70. package/.windsurf/rules/survey-context.md +11 -6
  71. package/.zcode/skills/commit-message/SKILL.md +4 -2
  72. package/.zcode/skills/kickoff-branch/SKILL.md +12 -7
  73. package/.zcode/skills/release-branch/SKILL.md +12 -6
  74. package/.zcode/skills/survey-context/SKILL.md +11 -6
  75. package/CHANGELOG.md +14 -0
  76. package/CONTRIBUTORS.md +48 -0
  77. package/README.md +8 -0
  78. package/SKILL-INDEX.md +1 -1
  79. package/extensions/omp-hooks.ts +416 -0
  80. package/hooks/pre/bash.sh +47 -0
  81. package/package.json +6 -2
  82. package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
  83. package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
  84. package/scripts/lib/golden-suite-gates.sh +2 -0
  85. package/scripts/lib/project-runtime.sh +110 -0
  86. package/scripts/omp-smoke.ts +116 -0
  87. package/scripts/test-project-runtime.sh +91 -0
  88. package/scripts/validate-omp-extension.sh +126 -0
  89. package/skills/commit-message/SKILL.md +4 -2
  90. package/skills/kickoff-branch/SKILL.md +12 -7
  91. package/skills/release-branch/SKILL.md +12 -6
  92. package/skills/survey-context/SKILL.md +11 -6
  93. package/skills-lock.json +5 -5
@@ -0,0 +1,416 @@
1
+ // story: e82s03
2
+ // extensions/omp-hooks.ts
3
+ // bigpowers — Single OMP extension entry exposing every source skill as a
4
+ // slash command, a bigpowers_skill LLM tool, and safety policy guards.
5
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
+ import { Type } from "typebox";
7
+ import { execSync } from "node:child_process";
8
+ import { readdirSync, readFileSync, statSync } from "node:fs";
9
+ import { dirname, join } from "node:path";
10
+ import { fileURLToPath } from "node:url";
11
+
12
+ // ---------------------------------------------------------------------------
13
+ // Constants
14
+ // ---------------------------------------------------------------------------
15
+
16
+ // Skills live at skills/<name>/SKILL.md — scan inside that directory, so
17
+ // only truly foreign entries (e.g. a stray node_modules symlink) need exclusion.
18
+ const EXCLUDED_DIRS = new Set([".git", "node_modules"]);
19
+
20
+ const DANGEROUS_PATTERNS = [
21
+ /git\s+reset\s+--hard/,
22
+ /git\s+clean\s+-f/,
23
+ /git\s+branch\s+-D/,
24
+ /git\s+checkout\s+\./,
25
+ /git\s+restore\s+\./,
26
+ /push\s+--force/,
27
+ /push\s+-f(?:\s|$)/,
28
+ ];
29
+
30
+ const CONVENTIONAL_RE =
31
+ /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([^)]+\))?!?:\s.+/;
32
+
33
+ const PROTECTED_BRANCH_RE = /(?:^|\s|[:])(?:main|master)(?:\s|$)/;
34
+ const PROTECTED_BRANCHES = ["main", "master"] as const;
35
+
36
+ // ---------------------------------------------------------------------------
37
+ // Types
38
+ // ---------------------------------------------------------------------------
39
+
40
+ interface SkillMeta {
41
+ name: string;
42
+ description: string;
43
+ /** Filesystem path to the skill's SKILL.md. */
44
+ path: string;
45
+ /** Full SKILL.md content (body only, frontmatter stripped). */
46
+ markdown: string;
47
+ }
48
+
49
+ // ---------------------------------------------------------------------------
50
+ // YAML frontmatter
51
+ // ---------------------------------------------------------------------------
52
+
53
+ /**
54
+ * Conservatively reads the `name` and `description` keys from YAML-style
55
+ * frontmatter delimited by `---`. Only single-line values are handled;
56
+ * a multi-line YAML value silently yields the directory name as fallback.
57
+ */
58
+ function parseFrontmatter(
59
+ content: string,
60
+ dirName: string,
61
+ ): { name: string; description: string } {
62
+ const lines = content.split("\n");
63
+ if (lines[0]?.trim() !== "---") {
64
+ return { name: dirName, description: "" };
65
+ }
66
+
67
+ const endIdx = lines.indexOf("---", 1);
68
+ if (endIdx === -1) {
69
+ return { name: dirName, description: "" };
70
+ }
71
+
72
+ let name = dirName;
73
+ let description = "";
74
+
75
+ for (let i = 1; i < endIdx; i++) {
76
+ const line = lines[i];
77
+ const nameMatch = line.match(/^name:\s*(.+)$/);
78
+ if (nameMatch) {
79
+ name = nameMatch[1].trim();
80
+ continue;
81
+ }
82
+ const descMatch = line.match(/^description:\s*(.+)$/);
83
+ if (descMatch) {
84
+ description = descMatch[1].trim();
85
+ continue;
86
+ }
87
+ }
88
+
89
+ return { name, description };
90
+ }
91
+
92
+ /** Returns the SKILL.md body below the closing `---` frontmatter line. */
93
+ function stripFrontmatter(content: string): string {
94
+ const lines = content.split("\n");
95
+ if (lines[0]?.trim() !== "---") return content;
96
+ const endIdx = lines.indexOf("---", 1);
97
+ if (endIdx === -1) return content;
98
+ // Skip both `---` lines and one blank line if present.
99
+ let start = endIdx + 1;
100
+ if (lines[start]?.trim() === "") start++;
101
+ return lines.slice(start).join("\n");
102
+ }
103
+
104
+ // ---------------------------------------------------------------------------
105
+ // Skill discovery
106
+ // ---------------------------------------------------------------------------
107
+
108
+ function collectSkillMd(dirPath: string): string | null {
109
+ const mdPath = join(dirPath, "SKILL.md");
110
+ try {
111
+ const st = statSync(mdPath);
112
+ if (!st.isFile()) return null;
113
+ return readFileSync(mdPath, "utf-8");
114
+ } catch {
115
+ return null;
116
+ }
117
+ }
118
+
119
+ /**
120
+ * Scans `skillsRoot` (expected: `<package-root>/skills/`) for immediate
121
+ * subdirectories that contain a SKILL.md file.
122
+ */
123
+ function discoverSkills(skillsRoot: string): SkillMeta[] {
124
+ const entries = readdirSync(skillsRoot);
125
+ const result: SkillMeta[] = [];
126
+
127
+ for (const entry of entries) {
128
+ if (EXCLUDED_DIRS.has(entry)) continue;
129
+
130
+ const absPath = join(skillsRoot, entry);
131
+ let st;
132
+ try {
133
+ st = statSync(absPath);
134
+ } catch {
135
+ continue;
136
+ }
137
+ if (!st.isDirectory()) continue;
138
+
139
+ const content = collectSkillMd(absPath);
140
+ if (content === null) continue;
141
+
142
+ const { name, description } = parseFrontmatter(content, entry);
143
+ const markdown = stripFrontmatter(content);
144
+
145
+ result.push({ name, description, path: join(absPath, "SKILL.md"), markdown });
146
+ }
147
+
148
+ return result;
149
+ }
150
+
151
+ function pluginRoot(): string {
152
+ return dirname(dirname(fileURLToPath(import.meta.url)));
153
+ }
154
+
155
+ // ---------------------------------------------------------------------------
156
+ // Git safety helpers
157
+ // ---------------------------------------------------------------------------
158
+
159
+ function currentBranch(): string {
160
+ try {
161
+ return execSync("git rev-parse --abbrev-ref HEAD", {
162
+ encoding: "utf-8",
163
+ timeout: 3000,
164
+ }).trim();
165
+ } catch {
166
+ return "unknown";
167
+ }
168
+ }
169
+
170
+ function protectedPushTarget(command: string, branch: string): boolean {
171
+ if (PROTECTED_BRANCH_RE.test(command)) return true;
172
+ const trimmed = command.trim();
173
+ return (
174
+ branch === "main" &&
175
+ (trimmed === "git push" || trimmed === "git push origin")
176
+ );
177
+ }
178
+
179
+ function extractCommitMessage(command: string): string | null {
180
+ const dq = command.match(/-m\s+"([^"]+)"/);
181
+ if (dq) return dq[1];
182
+ const sq = command.match(/-m\s+'([^']+)'/);
183
+ return sq ? sq[1] : null;
184
+ }
185
+
186
+ // ---------------------------------------------------------------------------
187
+ // Prompt builder
188
+ // ---------------------------------------------------------------------------
189
+
190
+ function buildSkillPrompt(skill: SkillMeta, args: string): string {
191
+ const header = [
192
+ `Activate skill: ${skill.name}`,
193
+ `Description: ${skill.description}`,
194
+ "",
195
+ "--- SKILL.md ---",
196
+ ].join("\n");
197
+
198
+ const body = skill.markdown;
199
+
200
+ let footer = "";
201
+ if (args.trim()) {
202
+ footer = `\n\n--- USER ARGUMENTS ---\n${args.trim()}`;
203
+ }
204
+
205
+ return `${header}\n${body}${footer}`;
206
+ }
207
+
208
+ // ---------------------------------------------------------------------------
209
+
210
+ async function injectSkillPrompt(
211
+ pi: ExtensionAPI,
212
+ prompt: string,
213
+ ): Promise<{ injected: boolean; via: "sendUserMessage" | "sendMessage" | "none" }> {
214
+ try {
215
+ await pi.sendUserMessage(prompt);
216
+ return { injected: true, via: "sendUserMessage" };
217
+ } catch {
218
+ try {
219
+ await pi.sendMessage(
220
+ {
221
+ customType: "bigpowers.skill",
222
+ content: prompt,
223
+ display: true,
224
+ attribution: "user",
225
+ },
226
+ { deliverAs: "nextTurn", triggerTurn: true },
227
+ );
228
+ return { injected: true, via: "sendMessage" };
229
+ } catch {
230
+ return { injected: false, via: "none" };
231
+ }
232
+ }
233
+ }
234
+
235
+ // ---------------------------------------------------------------------------
236
+ // Extension factory
237
+ // ---------------------------------------------------------------------------
238
+
239
+ export default function bigpowers(pi: ExtensionAPI) {
240
+ // NOTE: Do not call action methods (setLabel, sendUserMessage, setModel, …)
241
+ // in the factory body. pi installs throwing stubs for them during extension
242
+ // loading and only binds real implementations afterward — a load-time call
243
+ // aborts the whole pi startup (BUG-2026-09-05, #119). Only registration
244
+ // methods (registerCommand/registerTool/on/registerFlag) are valid here;
245
+ // perform actions inside event/command handlers via the runtime-bound `pi`.
246
+
247
+ // Discover skills from skills/ in the installed plugin package root.
248
+ const skills = discoverSkills(join(pluginRoot(), "skills"));
249
+
250
+ // ----- Slash commands --------------------------------------------------
251
+
252
+ for (const skill of skills) {
253
+ pi.registerCommand(skill.name, {
254
+ description: skill.description,
255
+ handler: async (args, _ctx) => {
256
+ const prompt = buildSkillPrompt(skill, args);
257
+ await injectSkillPrompt(pi, prompt);
258
+ },
259
+ });
260
+ }
261
+
262
+ // ----- bigpowers_skill tool --------------------------------------------
263
+
264
+ pi.registerTool({
265
+ name: "bigpowers_skill",
266
+ label: "Bigpowers Skill",
267
+ description:
268
+ "Interact with bigpowers source skills. Use 'list' to enumerate available skills, 'get' to retrieve a skill's full markdown, and 'run' to activate a skill with arguments.",
269
+ parameters: Type.Object({
270
+ action: Type.Union(
271
+ [Type.Literal("list"), Type.Literal("get"), Type.Literal("run")],
272
+ {
273
+ description:
274
+ "Operation: list all skills, get one skill, or run a skill with arguments",
275
+ },
276
+ ),
277
+ skill: Type.Optional(
278
+ Type.String({
279
+ description: "Skill name — required for 'get' and 'run' actions",
280
+ }),
281
+ ),
282
+ args: Type.Optional(
283
+ Type.String({
284
+ description: "User arguments passed to the skill — only used with 'run'",
285
+ }),
286
+ ),
287
+ }),
288
+ async execute(_id, params, _signal, _onUpdate, _ctx) {
289
+ const { action, skill: skillName, args } = params;
290
+
291
+ switch (action) {
292
+ case "list": {
293
+ const listing = skills.map((s) => ({
294
+ name: s.name,
295
+ description: s.description,
296
+ }));
297
+ return {
298
+ content: [{ type: "text", text: JSON.stringify(listing, null, 2) }],
299
+ details: { skills: listing },
300
+ };
301
+ }
302
+
303
+ case "get": {
304
+ if (!skillName) {
305
+ return {
306
+ content: [{ type: "text", text: "Error: 'skill' parameter is required for 'get' action." }],
307
+ details: { error: "missing_skill_param" },
308
+ };
309
+ }
310
+ const found = skills.find((s) => s.name === skillName);
311
+ if (!found) {
312
+ return {
313
+ content: [
314
+ {
315
+ type: "text",
316
+ text: `Error: skill '${skillName}' not found. Use 'list' to see available skills.`,
317
+ },
318
+ ],
319
+ details: { error: "skill_not_found", skill: skillName },
320
+ };
321
+ }
322
+ return {
323
+ content: [
324
+ { type: "text", text: `# ${found.name}\n\n${found.description}\n\n---\n\n${found.markdown}` },
325
+ ],
326
+ details: { name: found.name, description: found.description },
327
+ };
328
+ }
329
+
330
+ case "run": {
331
+ if (!skillName) {
332
+ return {
333
+ content: [{ type: "text", text: "Error: 'skill' parameter is required for 'run' action." }],
334
+ details: { error: "missing_skill_param" },
335
+ };
336
+ }
337
+ const found = skills.find((s) => s.name === skillName);
338
+ if (!found) {
339
+ return {
340
+ content: [
341
+ {
342
+ type: "text",
343
+ text: `Error: skill '${skillName}' not found. Use 'list' to see available skills.`,
344
+ },
345
+ ],
346
+ details: { error: "skill_not_found", skill: skillName },
347
+ };
348
+ }
349
+ const prompt = buildSkillPrompt(found, args ?? "");
350
+ const { injected, via } = await injectSkillPrompt(pi, prompt);
351
+ return {
352
+ content: [{ type: "text", text: prompt }],
353
+ details: { skill: found.name, injected, via },
354
+ };
355
+ }
356
+ }
357
+ },
358
+ });
359
+
360
+ // ----- Event handlers --------------------------------------------------
361
+
362
+ pi.on("session_start", async (_event, ctx) => {
363
+ const count = skills.length;
364
+ ctx.ui.notify(`bigpowers: ${count} skills loaded`, "info");
365
+ });
366
+
367
+ pi.on("tool_call", (event) => {
368
+ if (event.toolName !== "bash") return;
369
+ const { command } = event.input as { command?: string };
370
+ if (!command) return;
371
+
372
+ for (const pat of DANGEROUS_PATTERNS) {
373
+ if (pat.test(command)) {
374
+ return {
375
+ block: true,
376
+ reason: `BLOCKED: '${command}' matches dangerous pattern '${pat}'.`,
377
+ };
378
+ }
379
+ }
380
+
381
+ const branch = currentBranch();
382
+
383
+ if (/git\s+push/.test(command) && protectedPushTarget(command, branch)) {
384
+ return {
385
+ block: true,
386
+ reason:
387
+ "BLOCKED: Direct push to protected branch. Use kickoff-branch + release-branch.",
388
+ };
389
+ }
390
+
391
+ if (/git\s+commit/.test(command)) {
392
+ if ((PROTECTED_BRANCHES as readonly string[]).includes(branch)) {
393
+ return {
394
+ block: true,
395
+ reason: `BLOCKED: Direct commits to '${branch}' are forbidden. Use a feature branch.`,
396
+ };
397
+ }
398
+ const msg = extractCommitMessage(command);
399
+ if (msg) {
400
+ if (!CONVENTIONAL_RE.test(msg)) {
401
+ return {
402
+ block: true,
403
+ reason:
404
+ "BLOCKED: Commit message must follow Conventional Commits: <type>(<scope>): <subject>.",
405
+ };
406
+ }
407
+ if (msg.split("\n")[0].length > 72) {
408
+ return {
409
+ block: true,
410
+ reason: "BLOCKED: Commit subject line must be ≤72 characters.",
411
+ };
412
+ }
413
+ }
414
+ }
415
+ });
416
+ }
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env bash
2
+ # story: e82s03
3
+ # bigpowers — pre-tool-use hook for OMP bash tool
4
+ # Shell fallback for runtimes that invoke hooks as processes rather than
5
+ # calling the TypeScript extension directly. Blocks dangerous git commands
6
+ # and enforces Conventional Commits. Primary implementation lives in
7
+ # extensions/omp-hooks.ts (ExtensionAPI tool_call handler).
8
+ set -euo pipefail
9
+
10
+ INPUT=$(cat)
11
+ COMMAND=$(echo "$INPUT" | jq -r '.command // .tool_input.command // empty' 2>/dev/null || true)
12
+ [ -z "$COMMAND" ] && exit 0
13
+
14
+ DANGEROUS_PATTERNS=(
15
+ "git reset --hard"
16
+ "git clean -f"
17
+ "git branch -D"
18
+ "push --force"
19
+ "push -f"
20
+ )
21
+ PROTECTED_BRANCHES=("main" "master")
22
+ CONVENTIONAL_RE='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([^)]+\))?!?:[[:space:]].+'
23
+
24
+ for p in "${DANGEROUS_PATTERNS[@]}"; do
25
+ if echo "$COMMAND" | grep -qE "$p"; then
26
+ printf '{"decision":"block","reason":"BLOCKED: dangerous pattern %q"}\n' "$p"
27
+ exit 0
28
+ fi
29
+ done
30
+
31
+ if [[ "$COMMAND" =~ git[[:space:]]+commit ]]; then
32
+ MSG=""
33
+ if [[ "$COMMAND" =~ -m[[:space:]]+"([^"]+)" ]]; then MSG="${BASH_REMATCH[1]}"; fi
34
+ if [ -n "$MSG" ] && [[ ! "$MSG" =~ $CONVENTIONAL_RE ]]; then
35
+ echo '{"decision":"block","reason":"BLOCKED: Conventional Commits required"}'
36
+ exit 0
37
+ fi
38
+ BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown")
39
+ for b in "${PROTECTED_BRANCHES[@]}"; do
40
+ if [[ "$BRANCH" == "$b" ]]; then
41
+ printf '{"decision":"block","reason":"BLOCKED: direct commit to %q"}\n' "$b"
42
+ exit 0
43
+ fi
44
+ done
45
+ fi
46
+
47
+ exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.87.8",
3
+ "version": "2.88.1",
4
4
  "description": "73 agent skills synthesizing 17 years of software engineering discipline into a prescriptive methodology for solo developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,6 +29,9 @@
29
29
  "pi-package"
30
30
  ],
31
31
  "pi": {
32
+ "extensions": [
33
+ "extensions/omp-hooks.ts"
34
+ ],
32
35
  "skills": [
33
36
  "./.pi/skills"
34
37
  ],
@@ -64,6 +67,7 @@
64
67
  "@semantic-release/git": "^10.0.1",
65
68
  "@semantic-release/github": "^11.0.1",
66
69
  "@semantic-release/npm": "^12.0.1",
67
- "semantic-release": "^24.2.0"
70
+ "semantic-release": "^24.2.0",
71
+ "typebox": "^1.3.7"
68
72
  }
69
73
  }
@@ -64,6 +64,8 @@ GOLDEN_GATES=(
64
64
  "epics-wiki-zero-stories:bash scripts/test-generate-epics-wiki-zero-stories.sh:false"
65
65
  "golden-g11-worktree-venv:bash scripts/test-golden-g11-worktree-venv.sh:false"
66
66
  "install-helpers:bash scripts/test-install-helpers.sh:false"
67
+ "project-runtime:bash scripts/test-project-runtime.sh:false"
68
+ "omp-extension:bash scripts/validate-omp-extension.sh:false"
67
69
  "import-boundaries:bash scripts/check-import-boundaries.sh:false"
68
70
  "skill-catalog:bash scripts/validate-skill-catalog.sh:false"
69
71
  "specs-parse:bash scripts/validate-specs-yaml.sh:false"
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env bash
2
+ # story: e82s01
3
+ # Resolve consumer-project runtime settings without external YAML dependencies.
4
+
5
+ if [[ -n "${BIGPOWERS_PROJECT_RUNTIME_LOADED:-}" ]]; then
6
+ return 0
7
+ fi
8
+ BIGPOWERS_PROJECT_RUNTIME_LOADED=1
9
+
10
+ _bp_config_value() {
11
+ local project_root="$1" key="$2"
12
+ local config_file="$project_root/.bigpowers/config.yaml"
13
+ [[ -f "$config_file" ]] || return 1
14
+
15
+ awk -v key="$key" '
16
+ /^[[:space:]]*#/ { next }
17
+ {
18
+ separator = index($0, ":")
19
+ if (!separator) next
20
+ candidate = substr($0, 1, separator - 1)
21
+ gsub(/^[[:space:]]+|[[:space:]]+$/, "", candidate)
22
+ if (candidate != key) next
23
+ value = substr($0, separator + 1)
24
+ sub(/[[:space:]]+#.*$/, "", value)
25
+ gsub(/^[[:space:]]+|[[:space:]]+$/, "", value)
26
+ if ((substr(value, 1, 1) == "\"" && substr(value, length(value), 1) == "\"") ||
27
+ (substr(value, 1, 1) == "\047" && substr(value, length(value), 1) == "\047")) {
28
+ value = substr(value, 2, length(value) - 2)
29
+ }
30
+ print value
31
+ found = 1
32
+ exit
33
+ }
34
+ END { if (!found) exit 1 }
35
+ ' "$config_file"
36
+ }
37
+
38
+ _bp_specs_dir_value() {
39
+ local project_root="$1"
40
+ if [[ -n "${BIGPOWERS_SPECS_DIR+x}" ]]; then
41
+ printf '%s\n' "$BIGPOWERS_SPECS_DIR"
42
+ elif _bp_config_value "$project_root" specs_dir; then
43
+ return 0
44
+ else
45
+ printf '%s\n' specs
46
+ fi
47
+ }
48
+
49
+ bp_specs_dir() {
50
+ local project_root="${1:-$PWD}"
51
+ local specs_dir
52
+ specs_dir="$(_bp_specs_dir_value "$project_root")"
53
+ if [[ -z "$specs_dir" ]]; then
54
+ echo "bigpowers config: specs_dir must not be empty; set it to specs, .specs, or another directory" >&2
55
+ return 2
56
+ fi
57
+ printf '%s\n' "$specs_dir"
58
+ }
59
+
60
+ bp_specs_path() {
61
+ local project_root="${1:-$PWD}" relative_path="${2:-}"
62
+ local specs_dir
63
+ specs_dir="$(bp_specs_dir "$project_root")" || return
64
+
65
+ if [[ "$specs_dir" == /* ]]; then
66
+ if [[ -n "$relative_path" ]]; then
67
+ printf '%s/%s\n' "${specs_dir%/}" "${relative_path#/}"
68
+ else
69
+ printf '%s\n' "${specs_dir%/}"
70
+ fi
71
+ elif [[ -n "$relative_path" ]]; then
72
+ printf '%s/%s/%s\n' "${project_root%/}" "${specs_dir%/}" "${relative_path#/}"
73
+ else
74
+ printf '%s/%s\n' "${project_root%/}" "${specs_dir%/}"
75
+ fi
76
+ }
77
+
78
+ _bp_vcs_value() {
79
+ local project_root="$1"
80
+ if [[ -n "${BIGPOWERS_VCS+x}" ]]; then
81
+ printf '%s\n' "$BIGPOWERS_VCS"
82
+ elif _bp_config_value "$project_root" vcs; then
83
+ return 0
84
+ else
85
+ printf '%s\n' auto
86
+ fi
87
+ }
88
+
89
+ bp_vcs_kind() {
90
+ local project_root="${1:-$PWD}"
91
+ local configured_vcs
92
+ configured_vcs="$(_bp_vcs_value "$project_root")"
93
+
94
+ case "$configured_vcs" in
95
+ git|jj) printf '%s\n' "$configured_vcs" ;;
96
+ auto)
97
+ if [[ -d "$project_root/.jj" ]]; then
98
+ printf '%s\n' jj
99
+ elif [[ -e "$project_root/.git" ]]; then
100
+ printf '%s\n' git
101
+ else
102
+ printf '%s\n' none
103
+ fi
104
+ ;;
105
+ *)
106
+ echo "bigpowers config: invalid vcs '$configured_vcs'. Expected one of: auto, git, jj" >&2
107
+ return 2
108
+ ;;
109
+ esac
110
+ }