create-anpunkit 2.0.1 → 2.0.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-anpunkit",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Scaffold the anpunkit AI-coding workflow (Claude Code + Cursor) into a project. Upgrade-safe, non-destructive.",
5
5
  "bin": {
6
6
  "create-anpunkit": "bin/cli.js"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.1",
2
+ "version": "2.0.3",
3
3
  "files": [
4
4
  {
5
5
  "path": "AGENTS.md",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  {
13
13
  "path": "README.md",
14
- "sha256": "56a76a3fefacbf5ffc37d5b1f43748a628e0e4a8142ce2d6058957f8a22781a0"
14
+ "sha256": "0335a0cecb86b57d01e63f564206cdf6d189ac873fce5c69d0f5081facfec964"
15
15
  },
16
16
  {
17
17
  "path": ".gitattributes",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  {
21
21
  "path": "setup.sh",
22
- "sha256": "b6b2f2adbff866f8ed0398006ab2eefb346d9a81b50dc9bccbb3a8a22f6a1b04"
22
+ "sha256": "85c4aab58c83bf7b62344bbc04b94a4b49f90df0840b5e20660546b540889d6e"
23
23
  },
24
24
  {
25
25
  "path": ".claude/agents/debugger.md",
@@ -231,7 +231,7 @@
231
231
  },
232
232
  {
233
233
  "path": "create-anpunkit/package.json",
234
- "sha256": "3fa34141b9698d4ceb6a17d036e86d115de8cd5371c63df3f25705fe2b518d14"
234
+ "sha256": "4b16cdfd4d9a22379147338664530fd7ce7f0e7566bf63d097f7b8f8f76dcdd8"
235
235
  },
236
236
  {
237
237
  "path": "create-anpunkit/bin/cli.js",
@@ -26,7 +26,7 @@ npx create-anpunkit # non-destructive: never clobbers your files
26
26
  /overview # bootstrap the project (includes Phase 0 infra)
27
27
  ```
28
28
  Useful flags: `--dry-run` (print the plan, write nothing), `--force` (overwrite
29
- user-modified kit files), `--kb-path <dir>` / `--kb-remote <url>` / `--no-kb`.
29
+ user-modified kit files), `--kb-path <dir>` (your pre-cloned KB repo; remote auto-recorded from its origin) / `--no-kb`.
30
30
 
31
31
  Upgrading an existing anpunkit project? Re-run `npx create-anpunkit`. It refreshes
32
32
  kit-owned files, preserves anything you modified as `<file>.anpunkit-new`, merges
@@ -157,14 +157,20 @@ re-discovering the same Azure/Databricks gotchas project after project.
157
157
  **Setup (one-time per machine):**
158
158
 
159
159
  ```bash
160
- # 1. Create a GitHub repo: anpunkit-kb (empty)
161
- # 2. Clone it somewhere permanent on your machine
162
- git clone git@github.com:your-username/anpunkit-kb.git ~/anpunkit-kb
160
+ # 1. Create a GitHub repo: anpunkit-kb (empty is fine)
161
+ # 2. Clone it yourself, somewhere permanent you own the git auth
162
+ git clone git@github.com:<you>/anpunkit-kb.git ~/anpunkit-kb
163
163
 
164
- # 3. During setup.sh, provide the path when prompted
165
- bash setup.sh
164
+ # 3. Point anpunkit at it
165
+ npx create-anpunkit --kb-path ~/anpunkit-kb
166
+ # (or paste the path at the interactive prompt)
166
167
  ```
167
168
 
169
+ That's the last manual git you'll run against the KB. From then on the
170
+ **session-start hook pulls** each session and **`/store-wisdom` commits and
171
+ pushes** (always with your approval). The remote URL is recorded automatically
172
+ from the clone's `origin`; `--kb-remote <url>` overrides it if needed.
173
+
168
174
  **Usage:**
169
175
 
170
176
  ```
@@ -17,6 +17,17 @@
17
17
 
18
18
  Newest first. One entry per architectural change. Appended by `/log-decision`.
19
19
 
20
+ - **(v2.0.2)** — KB setup stays PATH-FIRST: the user clones the KB repo
21
+ themselves (`git clone ... ~/anpunkit-kb`) and passes `--kb-path` (or the
22
+ interactive prompt). New: the remote URL is auto-recorded from the clone's
23
+ `origin`, so `--kb-remote` is optional metadata. After setup, no manual git:
24
+ the session-start hook pulls; `/store-wisdom` commits and pushes (human-gated).
25
+ REJECTED: URL-first setup where anpunkit runs `git clone` itself — it was built
26
+ and tested, then dropped: it entangles a fresh install with the user's GitHub
27
+ authentication (SSH keys / gh auth), and a clone failure mid-setup is a worse
28
+ failure mode than asking a developer to run one clone command they already
29
+ understand. Setup records state; it does not acquire credentials.
30
+
20
31
  - **(v2.0.1)** — Windows portability fix for the npx installer. (1) `cli.js` no
21
32
  longer trusts bare `bash` on win32: PowerShell resolves it to the System32 WSL
22
33
  relay, which fails with `execvpe(/bin/bash)` when no distro is installed. The
package/template/setup.sh CHANGED
@@ -207,23 +207,41 @@ say ""; say "[6/6] shared KB:"
207
207
  configure_kb() {
208
208
  local cfg="$DEST/.claude/kb-config.json"
209
209
  if [ "$NO_KB" = 1 ]; then say " --no-kb: skipping KB."; return 0; fi
210
- if [ -z "$KB_PATH" ] && [ -z "$KB_REMOTE" ]; then
210
+
211
+ # Path-first by design: YOU clone the KB repo (you own the git auth);
212
+ # anpunkit only records where it lives. After that, the session-start hook
213
+ # pulls and /store-wisdom commits+pushes (human-gated) — no manual git needed.
214
+ if [ -z "$KB_PATH" ]; then
211
215
  if [ -t 0 ]; then
212
- printf " Local path to cloned anpunkit-kb repo (blank to skip): "; read -r KB_PATH || true
213
- [ -z "$KB_PATH" ] && { say " skipped KB (no path given)."; return 0; }
216
+ printf " Local path to your cloned anpunkit-kb repo (blank to skip): "
217
+ read -r KB_PATH || true
218
+ [ -z "$KB_PATH" ] && { say " skipped KB."; return 0; }
214
219
  else
215
- say " no KB flags + no TTY -> skipping KB (re-run with --kb-path / --kb-remote)."; return 0
220
+ say " no KB flags + no TTY -> skipping KB (re-run with --kb-path <dir>)."; return 0
216
221
  fi
217
222
  fi
218
- if [ -n "$KB_PATH" ] && [ ! -d "$KB_PATH" ]; then
219
- echo " ! KB path '$KB_PATH' not a directory. Clone your anpunkit-kb repo first."; return 0; fi
223
+ if [ ! -d "$KB_PATH" ]; then
224
+ echo " ! KB path '$KB_PATH' is not a directory. Clone your KB repo first, e.g.:"
225
+ echo " git clone git@github.com:<you>/anpunkit-kb.git ~/anpunkit-kb"
226
+ echo " then re-run with --kb-path ~/anpunkit-kb"
227
+ return 0
228
+ fi
229
+
230
+ # remote is metadata: explicit --kb-remote wins, else read the clone's origin
231
+ if [ -z "$KB_REMOTE" ] && [ -d "$KB_PATH/.git" ]; then
232
+ KB_REMOTE=$(git -C "$KB_PATH" remote get-url origin 2>/dev/null || echo "")
233
+ fi
220
234
  if [ -n "$KB_REMOTE" ]; then
221
- git ls-remote "$KB_REMOTE" >/dev/null 2>&1 || say " ! warning: cannot reach KB remote '$KB_REMOTE' (configuring anyway)."; fi
222
- [ "$DRY" = 1 ] && { act "write .claude/kb-config.json"; return 0; }
235
+ git ls-remote "$KB_REMOTE" >/dev/null 2>&1 \
236
+ || say " ! warning: cannot reach KB remote '$KB_REMOTE' right now (recording anyway; pull/push will need it)."
237
+ fi
238
+
239
+ [ "$DRY" = 1 ] && { act "write .claude/kb-config.json (path: $KB_PATH)"; return 0; }
223
240
  mkdir -p "$DEST/.claude"
224
241
  node -e "require('fs').writeFileSync(process.argv[1],JSON.stringify({path:process.argv[2],remote:process.argv[3]},null,2)+'\n')" "$cfg" "$KB_PATH" "$KB_REMOTE"
225
- say " wrote .claude/kb-config.json"
242
+ say " wrote .claude/kb-config.json (path: $KB_PATH${KB_REMOTE:+, remote: $KB_REMOTE})"
226
243
  }
244
+
227
245
  configure_kb
228
246
 
229
247
  # ---- finalize: stamp the installed manifest (copy the new one)