@bhargavvc/sdd-cc 1.42.3 → 1.42.4

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.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: sdd:commit
3
+ description: Stage and commit current changes interactively with a conventional commit message.
4
+ argument-hint: "[<commit message> | --all]"
5
+ allowed-tools:
6
+ - Bash
7
+ - Read
8
+ - AskUserQuestion
9
+ requires: [fast, quick]
10
+ ---
11
+
12
+ <objective>
13
+ Interactive git commit for the working tree. Surveys what is changed, suggests a conventional
14
+ commit message based on the diff, asks the user to confirm, then stages the selected files and
15
+ commits.
16
+
17
+ This is the fork-added counterpart to the auto-commit step that was stripped from `/sdd:fast`.
18
+ Use it after any task — `/sdd:fast`, `/sdd:quick`, manual edits, anything — when you are ready
19
+ to checkpoint work without invoking a full phase workflow.
20
+
21
+ **Never auto-stages with `git add -A` or `git add .` without explicit user consent** — those
22
+ can sweep up `.env`, secrets, or build artifacts.
23
+ </objective>
24
+
25
+ <execution_context>
26
+ @~/.claude/sdd/workflows/commit.md
27
+ </execution_context>
28
+
29
+ <process>
30
+ Execute the workflow end-to-end.
31
+
32
+ If the user passed a message as the first argument, use it verbatim and skip the message-suggestion
33
+ step. If they passed `--all`, stage every tracked modification AND every untracked file (still
34
+ asks for a final confirmation). Otherwise, run the full interactive flow.
35
+
36
+ Set TEXT_MODE=true when `--text` is present in $ARGUMENTS or when `workflow.text_mode` is true.
37
+ In TEXT_MODE every AskUserQuestion call is replaced with a plain-text numbered list and the user
38
+ is asked to type their choice.
39
+ </process>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bhargavvc/sdd-cc",
3
- "version": "1.42.3",
3
+ "version": "1.42.4",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code, OpenCode, Gemini and Codex by TÂCHES.",
5
5
  "bin": {
6
6
  "sdd-cc": "bin/install.js",
@@ -97,6 +97,7 @@ const CLUSTERS = Object.freeze({
97
97
  'undo',
98
98
  'fast',
99
99
  'quick',
100
+ 'commit',
100
101
  'autonomous',
101
102
  'config',
102
103
  'progress',
@@ -0,0 +1,166 @@
1
+ # /sdd:commit — Manual Conventional Commit
2
+
3
+ Interactive git commit. Surveys the working tree, suggests a conventional commit message
4
+ from the diff, asks the user to confirm, then stages + commits **specific files only**.
5
+
6
+ This is the fork-added replacement for the auto-commit step previously embedded in `/sdd:fast`.
7
+ Team policy: never auto-stage with `git add -A` / `git add .` without explicit consent.
8
+
9
+ ## Argument parsing
10
+
11
+ Set TEXT_MODE=true if `--text` appears in `$ARGUMENTS` OR `workflow.text_mode` is true in the
12
+ init JSON. When TEXT_MODE is active, replace every AskUserQuestion call below with a plain-text
13
+ numbered list and ask the user to type their choice — every runtime can handle that, including
14
+ non-Claude runtimes (Codex, Gemini) that render AskUserQuestion as inert markdown.
15
+
16
+ ## Process
17
+
18
+ <step name="check_repo">
19
+ Verify a git repository:
20
+
21
+ ```bash
22
+ git rev-parse --show-toplevel
23
+ ```
24
+
25
+ If this errors, STOP and tell the user: "Not in a git repository — nothing to commit."
26
+ </step>
27
+
28
+ <step name="survey_changes">
29
+ Show the user what's changed:
30
+
31
+ ```bash
32
+ echo "=== Tracked modifications ==="
33
+ git status --short | grep -Ev "^\?\?" || echo "(none)"
34
+ echo
35
+ echo "=== Untracked files ==="
36
+ git status --short | grep "^??" || echo "(none)"
37
+ echo
38
+ echo "=== Diff summary ==="
39
+ git diff --stat HEAD 2>/dev/null
40
+ ```
41
+
42
+ If working tree is clean (`git status --porcelain` empty), STOP and tell the user
43
+ "Nothing to commit — working tree is clean."
44
+ </step>
45
+
46
+ <step name="select_files">
47
+ Default behavior: **stage only tracked modifications** — never untracked, never `-A`.
48
+
49
+ If untracked files exist, ask the user (via AskUserQuestion, or a plain-text numbered list
50
+ when TEXT_MODE is active) which they want included:
51
+
52
+ - **Tracked changes only** (recommended — safest)
53
+ - **Also stage these untracked files: [list]** (only if user confirms each one is intentional)
54
+ - **Cancel** — abort the commit
55
+
56
+ If the user invoked the command with `--all`, skip the question but **still echo the file list
57
+ back and ask one final yes/no confirmation** before proceeding — `--all` is not a license to
58
+ commit secrets without showing the user.
59
+
60
+ Refuse to stage files matching common secret patterns. If a candidate file matches any of these
61
+ patterns, omit it from the stage list and warn the user:
62
+
63
+ - `*.env`, `.env.*` (env files)
64
+ - `*.pem`, `*.key`, `*.crt`, `*.p12`, `*.pfx` (keys / certs)
65
+ - `*credentials*`, `*secret*`, `*token*` (credential-like names)
66
+ - `node_modules/`, `dist/`, `build/`, `coverage/` (build artifacts — already gitignored, but defense-in-depth)
67
+
68
+ The user can override per-file by re-running with the file explicitly named in their message.
69
+ </step>
70
+
71
+ <step name="suggest_message">
72
+ If the user passed a message as the first argument, **use it verbatim** and skip to the next step.
73
+
74
+ Otherwise, generate a conventional commit message from the staged diff:
75
+
76
+ ```bash
77
+ git diff --cached # primary source — only the files about to be committed
78
+ ```
79
+
80
+ If nothing is staged yet (because we're previewing before staging), use:
81
+
82
+ ```bash
83
+ git diff # working-tree diff for the files we plan to stage
84
+ ```
85
+
86
+ Pick a type from this table — choose the **dominant** change type, not the loudest:
87
+
88
+ | Type | When |
89
+ | ---------- | ------------------------------------------------ |
90
+ | `feat` | New user-facing feature, endpoint, component |
91
+ | `fix` | Bug fix, error correction |
92
+ | `refactor` | Internal cleanup, no behavior change |
93
+ | `test` | Test-only changes (TDD RED, missing coverage) |
94
+ | `docs` | Documentation only |
95
+ | `chore` | Config, tooling, deps, build scripts |
96
+ | `perf` | Performance improvement, no behavior change |
97
+ | `style` | Formatting, whitespace, no logic change |
98
+
99
+ Format: `<type>(<scope>): <subject>`
100
+ - `<scope>` is optional — use it when changes are localized to one module (e.g., `feat(auth):`).
101
+ - `<subject>` must be ≤ 72 chars, lowercase, no trailing period, imperative mood ("add X" not "added X").
102
+
103
+ If the change is large enough to warrant a body, include 2-4 bullet lines beneath the subject
104
+ explaining the *why* (not the *what* — the diff shows what).
105
+
106
+ Show the user the proposed message + the staged file list. Ask (via AskUserQuestion, or a
107
+ plain-text numbered list when TEXT_MODE is active):
108
+
109
+ - **Commit with this message**
110
+ - **Edit the message** — user types a replacement; you re-show + re-confirm
111
+ - **Cancel** — abort, leave the working tree as-is
112
+ </step>
113
+
114
+ <step name="stage_and_commit">
115
+ Stage the approved files explicitly — never `-A`, never `.`:
116
+
117
+ ```bash
118
+ git add path/to/file1 path/to/file2 …
119
+ ```
120
+
121
+ Commit using a HEREDOC for multi-line-message safety:
122
+
123
+ ```bash
124
+ git commit -m "$(cat <<'EOF'
125
+ <approved message>
126
+ EOF
127
+ )"
128
+ ```
129
+
130
+ If a pre-commit hook fails:
131
+ - Show the hook's output to the user
132
+ - Do NOT pass `--no-verify` to bypass it
133
+ - Stop and let the user fix the underlying issue, then re-run `/sdd:commit`
134
+
135
+ Never `git commit --amend` an existing commit unless the user explicitly asked. Amend rewrites
136
+ history and surprises co-authors.
137
+ </step>
138
+
139
+ <step name="report">
140
+ Print the short hash and what landed:
141
+
142
+ ```
143
+ ✅ Committed {short-hash}: <type>(<scope>): <subject>
144
+ Files: <file1>, <file2>, …
145
+
146
+ Run `git push` when ready (this skill does not push).
147
+ ```
148
+
149
+ No next-step suggestions. No workflow routing. Done.
150
+ </step>
151
+
152
+ ## Guardrails
153
+
154
+ - NEVER `git add -A` or `git add .` without an explicit confirmation step that lists every file going in.
155
+ - NEVER `git push` from this skill — pushing is a separate, riskier action; user runs it manually.
156
+ - NEVER `--amend` unless the user explicitly asked.
157
+ - NEVER pass `--no-verify` to bypass hooks — surface the failure and stop.
158
+ - NEVER stage files matching the secret-pattern allowlist above without an explicit per-file confirmation.
159
+
160
+ ## Success criteria
161
+
162
+ - [ ] User saw the proposed message before commit
163
+ - [ ] User saw every file going into the commit
164
+ - [ ] Commit landed on the current branch (not detached HEAD, not main without intent)
165
+ - [ ] No `.env` / credentials / build artifacts were staged
166
+ - [ ] No `--amend`, no `--no-verify`, no `git push`
@@ -51,12 +51,13 @@ Do the work directly:
51
51
  **No PLAN.md.** Just do it.
52
52
  </step>
53
53
 
54
- <step name="commit">
55
- Commit the change atomically:
54
+ <step name="halt_for_manual_commit">
55
+ **FORK NOTE — this fork disables auto-commit.** Do NOT run `git add` or `git commit`. Stop here and tell the user:
56
56
 
57
- ```bash
58
- git add -A
59
- git commit -m "fix: {concise description of what changed}"
57
+ ```
58
+ Changes applied. Review the diff and commit manually:
59
+ git add -A
60
+ git commit -m "fix: <concise description>"
60
61
  ```
61
62
 
62
63
  Use conventional commit format: `fix:`, `feat:`, `docs:`, `chore:`, `refactor:` as appropriate.
@@ -80,8 +81,8 @@ Report completion:
80
81
 
81
82
  ```
82
83
  ✅ Done: {what was changed}
83
- Commit: {short hash}
84
84
  Files: {list of changed files}
85
+ Manual git: review diff and commit when ready (this fork does not auto-commit).
85
86
  ```
86
87
 
87
88
  No next-step suggestions. No workflow routing. Just done.
@@ -99,7 +100,7 @@ No next-step suggestions. No workflow routing. Just done.
99
100
 
100
101
  <success_criteria>
101
102
  - [ ] Task completed in current context (no subagents)
102
- - [ ] Atomic git commit with conventional message
103
+ - [ ] Changes staged for user to commit manually (fork policy — no auto-commit)
103
104
  - [ ] STATE.md updated if it exists
104
105
  - [ ] Total operation under 2 minutes wall time
105
106
  </success_criteria>
@@ -191,6 +191,23 @@ For tasks too small to justify planning: typo fixes, config changes, forgotten c
191
191
  Usage: `/sdd:fast "fix the typo in README"`
192
192
  Usage: `/sdd:fast "add .env to gitignore"`
193
193
 
194
+ ---
195
+
196
+ **`/sdd:commit [<message> | --all]`**
197
+ Stage and commit current changes interactively with a conventional commit message.
198
+
199
+ For when you have changes ready to checkpoint outside a phase workflow: review the diff, approve a suggested conventional message, commit specific files. Never `git add -A` without explicit user consent.
200
+
201
+ - Surveys tracked vs untracked changes before staging
202
+ - Suggests a conventional commit message from the diff (`feat`, `fix`, `refactor`, …)
203
+ - Refuses common secret patterns (`.env`, `*.pem`, `*credentials*`) without per-file confirmation
204
+ - Never `--amend`, never `--no-verify`, never `git push`
205
+ - Replaces the auto-commit step previously embedded in `/sdd:fast`
206
+
207
+ Usage: `/sdd:commit`
208
+ Usage: `/sdd:commit "fix(auth): correct token refresh"`
209
+ Usage: `/sdd:commit --all`
210
+
194
211
  ### Roadmap Management
195
212
 
196
213
  **`/sdd:phase <description>`**