Commit 338c362
committed
fix(step-7,step-8,step-final): tighten MCP match, atomic SHA verify, guard python3, clean sed .bak
- step-7: tighten all 'claude mcp list | grep' checks from loose substring
('github') to anchored prefix ('^github:') so user MCPs named 'github-mirror'
or 'my-github-fork' don't produce false positives in the non-interactive
autodetect, install_github idempotency guard, install_github verification,
and check_registered self-test helper.
- step-7: always install /gitfix even when user skips the GitHub MCP prompt
(empty selection at choose_tools) — /gitfix requires no credentials and is
a canonical Step 7 deliverable. Non-interactive curl-pipe path also now
installs /gitfix + runs self-test + summary before exit.
- step-7: guard the apt keyring install against a curl failure poisoning
/usr/share/keyrings/ with an empty file — download to mktemp, verify
non-empty, then 'sudo install -m 0644' into place.
- step-7: hard-check python3 presence before the token-injection heredoc.
Without python3 the MCP server registers but with no GITHUB_PERSONAL_ACCESS_TOKEN
— surface that as a soft_fail with a manual-fix pointer instead of silently
shipping a broken MCP entry. Also change '[saved]' -> '[captured]' after
the token read since the token is only in memory at that point.
- step-8: stage the skill download to a mktemp temp file and verify SHA-256
BEFORE moving it to $SKILL_FILE. Previously a tampered/corrupted file was
written directly to the skill path and only flagged post-hoc — Claude
would have loaded the bad skill until re-install. Now: download -> verify
non-empty -> verify sha256 against pinned digest -> verify keyword ->
atomic mv. Tampered content never lands on disk.
- step-final: clean up the '.bak' file that sed -i.bak leaves behind when
removing the stale 'alias ctg=' line from $SHELL_RC, so we don't litter
~/.zshrc.bak in every user's home directory.
All four step scripts pass bash -n and shellcheck (default severity).1 parent 79d24f1 commit 338c362
3 files changed
Lines changed: 93 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
106 | 121 | | |
107 | 122 | | |
108 | 123 | | |
| |||
133 | 148 | | |
134 | 149 | | |
135 | 150 | | |
136 | | - | |
137 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
138 | 155 | | |
139 | 156 | | |
140 | 157 | | |
| |||
143 | 160 | | |
144 | 161 | | |
145 | 162 | | |
| 163 | + | |
146 | 164 | | |
147 | | - | |
148 | | - | |
| 165 | + | |
| 166 | + | |
149 | 167 | | |
150 | 168 | | |
151 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
152 | 173 | | |
153 | 174 | | |
154 | 175 | | |
| |||
167 | 188 | | |
168 | 189 | | |
169 | 190 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
173 | 195 | | |
174 | 196 | | |
175 | 197 | | |
| |||
179 | 201 | | |
180 | 202 | | |
181 | 203 | | |
182 | | - | |
| 204 | + | |
183 | 205 | | |
184 | 206 | | |
185 | 207 | | |
| |||
202 | 224 | | |
203 | 225 | | |
204 | 226 | | |
205 | | - | |
| 227 | + | |
206 | 228 | | |
207 | 229 | | |
208 | 230 | | |
| |||
224 | 246 | | |
225 | 247 | | |
226 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
227 | 254 | | |
228 | 255 | | |
229 | 256 | | |
| |||
245 | 272 | | |
246 | 273 | | |
247 | 274 | | |
248 | | - | |
| 275 | + | |
249 | 276 | | |
250 | 277 | | |
251 | 278 | | |
| |||
307 | 334 | | |
308 | 335 | | |
309 | 336 | | |
310 | | - | |
311 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
312 | 341 | | |
313 | 342 | | |
314 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
163 | 174 | | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
167 | 178 | | |
168 | 179 | | |
169 | 180 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
173 | 184 | | |
| 185 | + | |
174 | 186 | | |
175 | 187 | | |
176 | 188 | | |
177 | 189 | | |
178 | 190 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
183 | 195 | | |
184 | 196 | | |
185 | 197 | | |
186 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
187 | 201 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 202 | + | |
194 | 203 | | |
195 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
196 | 208 | | |
197 | 209 | | |
198 | 210 | | |
199 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
200 | 214 | | |
| 215 | + | |
| 216 | + | |
201 | 217 | | |
202 | 218 | | |
203 | | - | |
204 | | - | |
205 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
206 | 230 | | |
207 | | - | |
| 231 | + | |
208 | 232 | | |
| 233 | + | |
209 | 234 | | |
210 | 235 | | |
211 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
351 | 354 | | |
| 355 | + | |
352 | 356 | | |
353 | 357 | | |
354 | 358 | | |
| |||
0 commit comments