@relipa/ai-flow-kit 0.0.8-beta.0 → 0.0.8-beta.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.
@@ -50,10 +50,6 @@ Create a detailed step-by-step plan based on the requirement document:
50
50
  | 3 | Write test for [scenario] | [test file] | ✅ | Task 2 |
51
51
  | ... | ... | ... | ... | ... |
52
52
 
53
- ### Commit Strategy
54
- - Commit after each test+implementation pair
55
- - Keep commits small and focused
56
-
57
53
  ### Test Commands
58
54
  ```bash
59
55
  [specific test commands for this project]
@@ -71,7 +67,6 @@ Based on the approved requirement document, here is the coding plan:
71
67
  [Show task breakdown summary]
72
68
 
73
69
  **Total tasks:** [N]
74
- **Estimated commits:** [N]
75
70
  **Test-first tasks:** [N]
76
71
 
77
72
  Ready to start coding?
@@ -101,4 +96,4 @@ Type feedback to adjust the plan.
101
96
  - ✅ **MUST** use TDD order: test first, then implementation
102
97
  - ✅ **MUST** invoke `superpowers:writing-plans` for plan creation
103
98
  - ✅ **MUST** show clear task breakdown before getting approval
104
- - **MUST** plan small, focused commits
99
+ - **DO NOT** include `git commit`, `git add`, or any git operations in the plan. The developer manages commits manually.
@@ -7,6 +7,16 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.0.8-beta.1] - 2026-05-14
11
+
12
+ ### Fixed
13
+
14
+ - **Auto-commit bug — actually fixed this time.** v0.0.7 claimed to remove "all automatic `git commit` and `git add` instructions from key AI skills" but the commit (`d490dab`) only added documentation/warning lines and left the active instructions in place. This release does the real work:
15
+ - Removed `4. Commit your work` from [.claude/skills/subagent-driven-development/implementer-prompt.md](.claude/skills/subagent-driven-development/implementer-prompt.md) (synced from upstream which had already been fixed).
16
+ - Removed the `### Commit Strategy` section, `Estimated commits: [N]` line, and `MUST plan small, focused commits` rule from [custom/skills/generate-spec/SKILL.md](custom/skills/generate-spec/SKILL.md) — these were active in Gate 2 every run.
17
+ - Removed `Commit the design document to git` and "and commit"/"committed to" wording from [upstream/skills/brainstorming/SKILL.md](upstream/skills/brainstorming/SKILL.md).
18
+ - **Hard guarantee via PreToolUse hook.** Added [scripts/hooks/block-git-write.js](scripts/hooks/block-git-write.js) that intercepts every Bash tool call and blocks `git commit`, `git add`, `git push`, `git tag`, `git reset`, `git rebase`, `git revert`, `git cherry-pick`, `git am`, and `git merge`. Read operations (`git status`, `git rev-parse`, `git log`, `git diff`) and worktree operations (`git worktree add/list/remove`) remain allowed. `aiflow init`/`update` auto-installs the hook into `.claude/settings.json`. Override with `AIFLOW_ALLOW_GIT_WRITE=1` for kit maintenance scripts. Defense-in-depth: even if a future skill smuggles a commit instruction, the harness blocks it before it reaches git.
19
+
10
20
  ## [0.0.8] - 2026-05-14
11
21
 
12
22
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relipa/ai-flow-kit",
3
- "version": "0.0.8-beta.0",
3
+ "version": "0.0.8-beta.1",
4
4
  "description": "All-in-one AI Flow Kit for team development with Claude AI - skills, templates, and MCP adapters",
5
5
  "author": "Example Team",
6
6
  "publishConfig": {
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * PreToolUse hook for ai-flow-kit
4
+ *
5
+ * Hard-blocks AI from running git-write operations (commit/add/push/tag) via the
6
+ * Bash tool. The developer always controls commits manually in their own terminal.
7
+ *
8
+ * Stdin payload (from Claude Code):
9
+ * { tool_name: "Bash", tool_input: { command: "..." }, ... }
10
+ *
11
+ * Exit codes:
12
+ * 0 — allow (stdout empty)
13
+ * 2 — block (stderr message is fed back to Claude as feedback)
14
+ *
15
+ * Override (for the kit's own maintenance scripts):
16
+ * export AIFLOW_ALLOW_GIT_WRITE=1
17
+ */
18
+
19
+ let raw = '';
20
+ process.stdin.setEncoding('utf-8');
21
+ process.stdin.on('data', (chunk) => { raw += chunk; });
22
+ process.stdin.on('end', () => {
23
+ try {
24
+ if (process.env.AIFLOW_ALLOW_GIT_WRITE === '1') process.exit(0);
25
+
26
+ const payload = raw ? JSON.parse(raw) : {};
27
+ if (payload.tool_name !== 'Bash') process.exit(0);
28
+
29
+ const command = (payload.tool_input && payload.tool_input.command) || '';
30
+ if (!command) process.exit(0);
31
+
32
+ // Match `git <subcommand>` where subcommand is a write operation.
33
+ // Tolerates leading args (e.g. `git -C path commit`, `git --no-pager add`).
34
+ // Captures occurrences inside compound shells: `&&`, `||`, `;`, `|`, `$(...)`, backticks, newline.
35
+ const BLOCK_RE = /(^|[\s;&|`(){}])git(\s+-[^\s]+)*\s+(commit|add|push|tag|reset|rebase|revert|cherry-pick|am|merge)\b/i;
36
+ const match = command.match(BLOCK_RE);
37
+ if (!match) process.exit(0);
38
+
39
+ const verb = match[3].toLowerCase();
40
+ process.stderr.write(
41
+ `[aiflow] BLOCKED: \`git ${verb}\` is not allowed for AI.\n` +
42
+ `Reason: ai-flow-kit forbids AI-driven commits/pushes. The developer manages git state manually.\n` +
43
+ `If this is a legitimate maintenance task (running the kit's own CI), set AIFLOW_ALLOW_GIT_WRITE=1 in the environment.\n` +
44
+ `Otherwise, finish the task without committing; the developer will run \`git ${verb}\` themselves at Gate 5.\n`
45
+ );
46
+ process.exit(2);
47
+ } catch (err) {
48
+ // On parsing error, fail open (don't block) but log to stderr for visibility.
49
+ process.stderr.write(`[aiflow] block-git-write hook error: ${err.message}\n`);
50
+ process.exit(0);
51
+ }
52
+ });
package/scripts/init.js CHANGED
@@ -185,6 +185,10 @@ async function setupSuperpowersHook(_projectDir, claudeDir) {
185
185
  const hookStopDest = path.join(hooksDir, 'session-stop.js');
186
186
  await fs.copy(hookStopSrc, hookStopDest, { overwrite: true });
187
187
 
188
+ const hookBlockGitSrc = path.join(PKG_DIR, 'scripts', 'hooks', 'block-git-write.js');
189
+ const hookBlockGitDest = path.join(hooksDir, 'block-git-write.js');
190
+ await fs.copy(hookBlockGitSrc, hookBlockGitDest, { overwrite: true });
191
+
188
192
  const settingsFile = path.join(claudeDir, 'settings.json');
189
193
  let settings = {};
190
194
  if (await fs.pathExists(settingsFile)) {
@@ -194,6 +198,7 @@ async function setupSuperpowersHook(_projectDir, claudeDir) {
194
198
  if (!settings.hooks) settings.hooks = {};
195
199
  if (!settings.hooks.SessionStart) settings.hooks.SessionStart = [];
196
200
  if (!settings.hooks.SessionStop) settings.hooks.SessionStop = [];
201
+ if (!settings.hooks.PreToolUse) settings.hooks.PreToolUse = [];
197
202
 
198
203
  settings.hooks.SessionStart = settings.hooks.SessionStart.filter(
199
204
  h => !(h._aiflowKit)
@@ -221,8 +226,22 @@ async function setupSuperpowersHook(_projectDir, claudeDir) {
221
226
  ]
222
227
  });
223
228
 
229
+ settings.hooks.PreToolUse = settings.hooks.PreToolUse.filter(
230
+ h => !(h._aiflowKitBlockGitWrite)
231
+ );
232
+ settings.hooks.PreToolUse.push({
233
+ _aiflowKitBlockGitWrite: true,
234
+ matcher: 'Bash',
235
+ hooks: [
236
+ {
237
+ type: 'command',
238
+ command: `node "${hookBlockGitDest.replace(/\\/g, '/')}"`,
239
+ }
240
+ ]
241
+ });
242
+
224
243
  await fs.writeJson(settingsFile, settings, { spaces: 2 });
225
- console.log(chalk.green(`✓ Superpowers hooks (SessionStart, SessionStop) configured`));
244
+ console.log(chalk.green(`✓ Superpowers hooks (SessionStart, SessionStop, PreToolUse:block-git-write) configured`));
226
245
  }
227
246
 
228
247
  async function verifySuperpowersSkills(versionDir) {
@@ -26,7 +26,7 @@ You MUST create a task for each of these items and complete them in order:
26
26
  3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
27
27
  4. **Propose 2-3 approaches** — with trade-offs and your recommendation
28
28
  5. **Present design** — in sections scaled to their complexity, get user approval after each section
29
- 6. **Write design doc** — save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commit
29
+ 6. **Write design doc** — save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`
30
30
  7. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope (see below)
31
31
  8. **User reviews written spec** — ask user to review the spec file before proceeding
32
32
  9. **Transition to implementation** — invoke writing-plans skill to create implementation plan
@@ -111,7 +111,7 @@ digraph brainstorming {
111
111
  - Write the validated design (spec) to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`
112
112
  - (User preferences for spec location override this default)
113
113
  - Use elements-of-style:writing-clearly-and-concisely skill if available
114
- - Commit the design document to git
114
+ - Do NOT run `git add` or `git commit` for the design document the developer commits manually.
115
115
 
116
116
  **Spec Self-Review:**
117
117
  After writing the spec document, look at it with fresh eyes:
@@ -126,7 +126,7 @@ Fix any issues inline. No need to re-review — just fix and move on.
126
126
  **User Review Gate:**
127
127
  After the spec review loop passes, ask the user to review the written spec before proceeding:
128
128
 
129
- > "Spec written and committed to `<path>`. Please review it and let me know if you want to make any changes before we start writing out the implementation plan."
129
+ > "Spec written to `<path>`. Please review it and let me know if you want to make any changes before we start writing out the implementation plan."
130
130
 
131
131
  Wait for the user's response. If they request changes, make them and re-run the spec review loop. Only proceed once the user approves.
132
132