@ojokesusu/lintasai 1.1.2 → 1.2.0

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/.gitignore ADDED
@@ -0,0 +1,55 @@
1
+ # File yang JANGAN di-commit ke repo standar tim
2
+ # (Kit ini sendiri tidak generate file build, tapi standar untuk repo)
3
+
4
+ # OS
5
+ .DS_Store
6
+ Thumbs.db
7
+ desktop.ini
8
+ ehthumbs.db
9
+ ehthumbs_vista.db
10
+
11
+ # Editor / IDE
12
+ .vscode/
13
+ .idea/
14
+ *.swp
15
+ *.swo
16
+ *~
17
+ .history/
18
+ .project
19
+ .classpath
20
+
21
+ # Backup yang dihasilkan install-windows.ps1 saat re-install
22
+ *.backup-*
23
+ *.bak
24
+ *.old
25
+
26
+ # Log
27
+ *.log
28
+ npm-debug.log*
29
+ yarn-debug.log*
30
+
31
+ # Secret — JANGAN PERNAH commit
32
+ .env
33
+ .env.local
34
+ .env.*.local
35
+ *.pem
36
+ *.key
37
+ credentials*
38
+ secrets/
39
+
40
+ # Build / output (kalau kit di-extend dengan tools nantinya)
41
+ node_modules/
42
+ dist/
43
+ build/
44
+ out/
45
+ .next/
46
+ .cache/
47
+
48
+ # Test coverage
49
+ coverage/
50
+ *.lcov
51
+
52
+ # Paket lokal saat zipping/testing
53
+ *.zip
54
+ *.tar.gz
55
+ *.tgz
@@ -0,0 +1,91 @@
1
+ # AGENTS.md — Aturan Proyek <NAMA_PROYEK>
2
+
3
+ > v1 · <TANGGAL_HARI_INI> · ikut standar tim IT (Pola B)
4
+
5
+ <!-- Header di atas auto-isi oleh setup-pola-b.ps1 (nama proyek dari folder root, tanggal dari sistem). Kalau setup manual, isi sendiri. -->
6
+
7
+ ---
8
+
9
+ ## Pengantar
10
+
11
+ Proyek ini ikut **standar kerja tim IT** (kit terpasang di `./.claude-kit/`).
12
+ Aturan utama (cara coding, dokumentasi, larangan) ada di **`./.claude-kit/CLAUDE_universal_v1.md`** — wajib dibaca AI tiap sesi.
13
+ File ini cuma berisi **override khusus proyek** + instruksi resolusi path supaya AI tidak nyasar ke folder global.
14
+
15
+ ---
16
+
17
+ ## Path resolution (PENTING — instruksi untuk AI)
18
+
19
+ Kit ini di-embed di subfolder `./.claude-kit/` (bukan di `%USERPROFILE%\.claude\`).
20
+ Saat baca/merujuk file kit, **kamu (AI) wajib mengganti** path lama jadi path lokal:
21
+
22
+ - `%USERPROFILE%\.claude\<NAMA_FILE>` → `./.claude-kit/<NAMA_FILE>`
23
+ - `~/.claude/<NAMA_FILE>` → `./.claude-kit/<NAMA_FILE>`
24
+
25
+ Kalau install global **dan** `./.claude-kit/` sama-sama ada → **`./.claude-kit/` menang** (version-locked per proyek).
26
+
27
+ ---
28
+
29
+ ## Versi kit aktif
30
+
31
+ - Versi kit di `./.claude-kit/`: **<VERSI_KIT>** <!-- ISI manual setelah cek `./.claude-kit/CHANGELOG.md`. Tulis literal (tanpa kurung siku). -->
32
+ - Sumber kit (repo standar tim): **<URL_REPO_STANDAR>** <!-- ISI: URL repo git tempat kit dirilis. -->
33
+
34
+ ---
35
+
36
+ ## Override khusus proyek
37
+
38
+ Centang `[x]` cuma yang **beda dari default kit**. Yang tidak dicentang = ikut default.
39
+ Contoh: `- [x] Bahasa docs: EN (override dari default ID karena klien minta)`.
40
+
41
+ - [ ] Bahasa docs: <!-- default ID -->
42
+ - [ ] Format commit: <!-- default Conventional Commits -->
43
+ - [ ] Folder `docs/`: <!-- default ikut `./.claude-kit/templates/architecture.md` -->
44
+ - [ ] Tech stack: <!-- default React/Next.js + Tailwind + shadcn -->
45
+ - [ ] Branch utama: <!-- default `main` -->
46
+ - [ ] Pakai GitHub Issue: <!-- default Tidak — pakai chat. Ubah ke `Ya` kalau ada klien eksternal yang tracking via Issue. -->
47
+ - [ ] Channel chat task: <!-- link Slack/Discord/Telegram/WhatsApp tempat staff posting task -->
48
+ - [ ] Lain-lain:
49
+
50
+ ---
51
+
52
+ ## Workflow & Komunikasi Task
53
+
54
+ Tim ini pakai workflow chat-driven (tanpa GitHub Issue by default). Detail di `./.claude-kit/templates/CLAUDE_TEAM_GUIDE.md` section 5b.
55
+
56
+ - **Channel chat task**: <!-- ISI: link Slack/Discord/Telegram/WhatsApp -->
57
+ - **Pakai GitHub Issue?** Tidak (default tim). Ubah ke "Ya" kalau proyek punya klien eksternal yang tracking via Issue.
58
+ - **Format prompt task**: lihat `./.claude-kit/templates/PROMPT_LIBRARY.md` section "Prompts untuk Workflow Chat-Driven Task".
59
+ - **Risk Level decision tree**: lihat `./.claude-kit/templates/CLAUDE_TEAM_GUIDE.md` section 7b (Low/Medium/High klasifikasi task).
60
+ - **Rollback playbook**: lihat `./.claude-kit/templates/CLAUDE_TEAM_GUIDE.md` section 13b (git revert <5 menit).
61
+ - **Feature flag** = advanced/post-launch (kit early-stage default = staging-only). Lihat `./.claude-kit/templates/feature-flags-advanced.md` kalau butuh.
62
+
63
+ ---
64
+
65
+ ## Skenario adopsi (pilih SATU, hapus 3 sisanya)
66
+
67
+ - **(a) Proyek baru / from scratch** → `./.claude-kit/PROJECT_LIFECYCLE_PROMPT_v1.md` (Stage A: Kickoff)
68
+ - **(b) Proyek lama tanpa docs** → `./.claude-kit/PROJECT_LIFECYCLE_PROMPT_v1.md` (Stage B: Bootstrap Docs)
69
+ - **(c) Proyek setengah jadi (sudah ada sebagian docs)** → `./.claude-kit/PROJECT_LIFECYCLE_PROMPT_v1.md` (Stage D: Migration)
70
+ - **(d) Sudah siap kerja task biasa (tidak butuh kickoff/migrasi)** → langsung pakai
71
+
72
+ Sesi pertama tim member baru: jalankan `./.claude-kit/SETUP_POLA_B_PROMPT_v1.md`.
73
+
74
+ ---
75
+
76
+ ## Catatan tim
77
+
78
+ <!-- Kosongkan section ini kalau proyek solo. -->
79
+
80
+ - Owner standar tim: <!-- nama + email/handle PIC kit -->
81
+ - Channel diskusi: <!-- link Slack/Discord/Telegram -->
82
+
83
+ ---
84
+
85
+ ## Riwayat update kit di proyek ini
86
+
87
+ | Versi kit | Tanggal update | Siapa update | Catatan |
88
+ |-----------|--------------------|--------------|----------------------|
89
+ | <VERSI_KIT> | <TANGGAL_HARI_INI> | <NAMA_KAMU> | Setup awal Pola B |
90
+
91
+ <!-- Tambah baris baru tiap update isi `./.claude-kit/` ke versi lebih baru. -->
package/CHANGELOG.md CHANGED
@@ -20,6 +20,70 @@ Slot tambahan untuk perubahan berikutnya sebelum versi v1.0.2.
20
20
 
21
21
  ---
22
22
 
23
+ ## v1.2.0 [2026-06-06]
24
+
25
+ ### Fixed (Critical)
26
+
27
+ #### NPX Wrapper Bugs (v1.1.3 regression discovered via audit)
28
+ - **L1-RUN-001**: `npx lintasai uninstall` hard-fail karena wrapper kirim `-ProjectRoot` ke uninstall.ps1 yang tidak support param
29
+ - Fix: uninstall.ps1 sekarang accept `[string]$ProjectRoot` param + resolve via fallback chain
30
+ - **L1-RUN-002**: `npx lintasai update` hard-fail sama issue
31
+ - Fix: update-kit.ps1 accept `-ProjectRoot` param
32
+ - **L1-RUN-003**: `npx lintasai doctor/version/rollback` inspect kit di npm cache (silent false diagnostic)
33
+ - Fix: kit.ps1 accept `-ProjectRoot`, inspect `.claude-kit/` di user CWD bukan $PSScriptRoot
34
+ - Fix: bin/lintasai.js pass `-ProjectRoot` ke kit.ps1 subcommands juga
35
+
36
+ #### Code Quality
37
+ - **L1-RUN-004**: null comparison style consistency `$null -ne $x` (PSScriptAnalyzer warning eliminated)
38
+
39
+ ### Added (New Features)
40
+
41
+ #### CLI Commands
42
+ - **`lintasai status`**: 1-layar overview kit health (version, install mode, AGENTS.md, manifest signed, last update, tier setup)
43
+ - **`lintasai diff`**: show files yang berubah sejak install (modified/missing/extra) untuk debugging Tier C delegate
44
+
45
+ #### Tests (Regression Coverage)
46
+ - `tests/npx-init.Tests.ps1`: regression test untuk v1.1.3 fix (tarball content + ProjectRoot param + npx-mode copy)
47
+ - `tests/package-bundle.Tests.ps1`: assert npm pack mengandung semua file deployment-needed
48
+ - `tests/setup-pola-b.Tests.ps1`: cover 4 invocation branches (traditional, ProjectRoot valid, ProjectRoot invalid, npx-mode)
49
+
50
+ #### Documentation
51
+ - `docs/NPX_INSTALL.md`: troubleshooting Bahasa Indonesia untuk staff IT non-programmer
52
+ (node version, EACCES/EPERM, ExecutionPolicy, proxy, kit verification, rollback, uninstall, update, status, diff, support contact)
53
+
54
+ ### Removed
55
+ - `FIRST_SESSION_PROMPT_v1.md` (deprecated stub, no active consumers verified)
56
+
57
+ ### Notes
58
+ Ready untuk mass distribution ke 20-30 staff IT. Audit verdict upgraded YELLOW -> GREEN.
59
+
60
+ Deferred to v1.2.1 (lower priority):
61
+ - Remove 5 more deprecated stubs (need cross-ref update first)
62
+ - Security advisory items (HMAC salt, staging dir verify, etc.)
63
+ - Refactor dead variables ($signatureValid, $libSafety, $shouldPreserve)
64
+
65
+ ---
66
+
67
+ ## v1.1.3 [2026-06-06]
68
+
69
+ ### Fixed
70
+
71
+ #### NPX Invocation Bugs (Distribution Blocker)
72
+ - **Bug 1**: AGENTS.md.template tidak ter-bundle ke npm tarball — fix di package.json files array (added "*.template", "AGENTS.md.template", "decisions/", "LICENSE")
73
+ - **Bug 2**: bin/lintasai.js tidak pass user CWD ke setup-pola-b.ps1, sehingga script salah deteksi "Root proyek" sebagai npm cache folder bukan user folder
74
+ - Fix: bin/lintasai.js sekarang pass `-ProjectRoot $process.cwd()` untuk command init/update/uninstall
75
+ - Fix: setup-pola-b.ps1 sekarang accept `-ProjectRoot` parameter
76
+ - Fix: setup-pola-b.ps1 detect "npx mode" (kit source di npm cache vs project) lalu COPY kit ke $ProjectRoot/.claude-kit/
77
+
78
+ ### Migration
79
+ Staff yang baru install via `npx @ojokesusu/lintasai init` sekarang akan dapat behavior yang benar:
80
+ - Kit copy dari npm cache ke <user-project>/.claude-kit/
81
+ - "Root proyek" = folder user CWD
82
+ - "Nama proyek" = nama folder user
83
+ - AGENTS.md.template ada di tarball, deploy berhasil
84
+
85
+ ---
86
+
23
87
  ## v1.1.2 [2026-06-06]
24
88
 
25
89
  ### Changed
package/bin/lintasai.js CHANGED
@@ -18,6 +18,7 @@ const COMMANDS = {
18
18
  "version": ["kit.ps1", "version"],
19
19
  "rollback": ["kit.ps1", "rollback"],
20
20
  "setup": ["kit.ps1", "setup"],
21
+ "status": ["kit.ps1", "status"],
21
22
  };
22
23
 
23
24
  function showHelp() {
@@ -31,6 +32,7 @@ function showHelp() {
31
32
  console.log(" init Setup kit di project (alias setup-pola-b)");
32
33
  console.log(" update Update kit ke versi terbaru");
33
34
  console.log(" doctor Verify kit integrity");
35
+ console.log(" status Show kit status ringkas (1-layar)");
34
36
  console.log(" version Show kit version");
35
37
  console.log(" rollback Rollback ke versi sebelumnya");
36
38
  console.log(" uninstall Remove kit dari project");
@@ -66,16 +68,33 @@ if (!target) {
66
68
  }
67
69
 
68
70
  // Build powershell command
71
+ const userCwd = process.cwd();
72
+ // For init/update/uninstall: pass user CWD explicitly so script knows real project root
73
+ const shouldPassProjectRoot = ["init", "update", "uninstall"].includes(command);
69
74
  let psArgs;
70
75
  if (Array.isArray(target)) {
71
- // kit.ps1 subcommand
72
- psArgs = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", path.join(KIT_ROOT, target[0]), target[1], ...args];
76
+ // kit.ps1 subcommand. Inject -ProjectRoot so kit.ps1 inspects the kit di USER CWD
77
+ // (.claude-kit di project), bukan di npm cache ($PSScriptRoot). L1-RUN-003.
78
+ psArgs = [
79
+ "-NoProfile",
80
+ "-ExecutionPolicy",
81
+ "Bypass",
82
+ "-File",
83
+ path.join(KIT_ROOT, target[0]),
84
+ target[1],
85
+ "-ProjectRoot",
86
+ userCwd,
87
+ ...args,
88
+ ];
89
+ } else if (shouldPassProjectRoot) {
90
+ // Direct script call with -ProjectRoot
91
+ psArgs = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", path.join(KIT_ROOT, target), "-ProjectRoot", userCwd, ...args];
73
92
  } else {
74
93
  // Direct script call
75
94
  psArgs = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", path.join(KIT_ROOT, target), ...args];
76
95
  }
77
96
 
78
- const child = spawn("powershell.exe", psArgs, { stdio: "inherit" });
97
+ const child = spawn("powershell.exe", psArgs, { stdio: "inherit", cwd: userCwd });
79
98
  child.on("close", (code) => {
80
99
  process.exit(code || 0);
81
100
  });
@@ -0,0 +1,217 @@
1
+ # NPX Install Guide - lintasAI Kit
2
+
3
+ ## Untuk Siapa
4
+
5
+ Panduan ini ditujukan untuk **staff IT non-programmer** yang mau install lintasAI Kit ke project menggunakan `npx` (lebih cepat dari `git clone`, tidak perlu paham git, dan otomatis dapat versi terbaru).
6
+
7
+ Kalau kamu sudah familiar dengan terminal & PowerShell, install via npx adalah cara paling singkat: cukup 1 perintah, kit langsung terpasang di folder project.
8
+
9
+ ---
10
+
11
+ ## Cara Install (1 perintah)
12
+
13
+ 1. Buka **PowerShell** (bukan CMD).
14
+ 2. Pindah ke folder project tempat kit mau dipasang:
15
+ ```powershell
16
+ cd D:\Users\Administrator\projects\nama-project
17
+ ```
18
+ 3. Jalankan perintah install:
19
+ ```powershell
20
+ npx @ojokesusu/lintasai init
21
+ ```
22
+ 4. Tunggu sampai muncul pesan `Kit installed successfully`. Biasanya 30 detik - 2 menit tergantung koneksi.
23
+
24
+ Setelah selesai, folder `.claude-kit/` + `AGENTS.md` akan otomatis dibuat di project root.
25
+
26
+ ---
27
+
28
+ ## Verify Install Berhasil
29
+
30
+ Cek status kit:
31
+ ```powershell
32
+ npx @ojokesusu/lintasai status
33
+ ```
34
+
35
+ Output yang **benar** harus menampilkan:
36
+ - `Kit version: v1.x.x`
37
+ - `AGENTS.md present: yes`
38
+ - `Manifest signed: yes`
39
+ - `Files: <jumlah> / <jumlah> OK`
40
+
41
+ Kalau ada `MISSING` atau `MODIFIED` di output, lihat section Troubleshooting di bawah.
42
+
43
+ ---
44
+
45
+ ## Troubleshooting
46
+
47
+ ### Error: "node tidak ditemukan" / "'npx' is not recognized"
48
+
49
+ **Penyebab**: Node.js belum terinstall di PC.
50
+
51
+ **Fix**:
52
+ 1. Download Node.js LTS dari https://nodejs.org/ (versi LTS, BUKAN Current).
53
+ 2. Install dengan opsi default. Pastikan checkbox `Add to PATH` aktif.
54
+ 3. Tutup & buka ulang PowerShell.
55
+ 4. Cek versi: `node --version` (harus muncul `v20.x.x` atau lebih baru).
56
+ 5. Ulangi perintah `npx @ojokesusu/lintasai init`.
57
+
58
+ ### Error: "EACCES" atau "EPERM" di Windows
59
+
60
+ **Penyebab**: Permission ditolak. Biasanya karena Node.js terinstall di `Program Files` (perlu admin), atau folder project read-only.
61
+
62
+ **Fix (pilih salah satu)**:
63
+ - **Opsi A (cepat)**: Klik kanan PowerShell -> `Run as Administrator`, lalu ulangi perintah init.
64
+ - **Opsi B (rekomendasi)**: Uninstall Node.js dari Program Files, install ulang di user folder (`C:\Users\<username>\nodejs\`). Ini menghindari masalah permission permanen.
65
+ - **Opsi C**: Pastikan folder project tidak read-only. Klik kanan folder -> Properties -> uncheck `Read-only`.
66
+
67
+ ### Error: "ExecutionPolicy" PowerShell block
68
+
69
+ **Penyebab**: Windows default block menjalankan script PowerShell yang tidak signed.
70
+
71
+ **Fix**:
72
+ 1. Buka PowerShell sebagai user biasa (tidak perlu admin).
73
+ 2. Jalankan:
74
+ ```powershell
75
+ Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
76
+ ```
77
+ 3. Pilih `Y` saat ditanya konfirmasi.
78
+ 4. Ulangi perintah init.
79
+
80
+ Catatan: `RemoteSigned` aman — hanya allow local script + script remote yang ber-signature. Tidak membuka full security risk.
81
+
82
+ ### Error: Behind corporate proxy / firewall
83
+
84
+ **Penyebab**: Kantor pakai proxy yang block koneksi npm registry langsung.
85
+
86
+ **Fix**:
87
+ 1. Tanya admin IT kantor untuk URL proxy (biasanya `http://proxy.company.local:8080`).
88
+ 2. Set npm config:
89
+ ```powershell
90
+ npm config set proxy http://proxy.company.local:8080
91
+ npm config set https-proxy http://proxy.company.local:8080
92
+ ```
93
+ 3. Kalau proxy butuh auth, format jadi: `http://username:password@proxy.company.local:8080`.
94
+ 4. Ulangi perintah init.
95
+
96
+ Kalau masih gagal, coba registry mirror: `npm config set registry https://registry.npmmirror.com/`.
97
+
98
+ ### Error: "Kit tidak lengkap" / "File hilang"
99
+
100
+ **Penyebab**: Download terputus di tengah jalan, atau cache npm corrupt.
101
+
102
+ **Fix**:
103
+ 1. Clear cache npm:
104
+ ```powershell
105
+ npm cache clean --force
106
+ ```
107
+ 2. Hapus folder `.claude-kit/` yang sudah ada (kalau sebagian terinstall):
108
+ ```powershell
109
+ Remove-Item -Recurse -Force .\.claude-kit\
110
+ ```
111
+ 3. Retry:
112
+ ```powershell
113
+ npx @ojokesusu/lintasai@latest init
114
+ ```
115
+
116
+ ### Error: "Root proyek" salah deteksi (npm cache path)
117
+
118
+ **Penyebab**: Bug di versi kit **pre-v1.1.3** — kit salah deteksi root project ke folder npm cache, bukan ke folder project user.
119
+
120
+ **Tanda**: Folder `.claude-kit/` muncul di `C:\Users\<username>\AppData\Roaming\npm-cache\...` bukan di project folder.
121
+
122
+ **Fix**:
123
+ 1. Hapus install yang salah:
124
+ ```powershell
125
+ npx @ojokesusu/lintasai uninstall
126
+ ```
127
+ 2. Upgrade ke versi terbaru (v1.2.0+):
128
+ ```powershell
129
+ npx @ojokesusu/lintasai@latest init
130
+ ```
131
+ 3. Versi v1.2.0+ sudah fix deteksi root via `process.cwd()` (folder PowerShell aktif).
132
+
133
+ ---
134
+
135
+ ## Rollback ke Versi Sebelumnya
136
+
137
+ Kalau update terbaru bermasalah, rollback ke versi sebelumnya:
138
+
139
+ ```powershell
140
+ npx @ojokesusu/lintasai rollback
141
+ ```
142
+
143
+ Perintah ini akan restore file dari snapshot otomatis yang dibuat saat last update. Snapshot disimpan di `.claude-kit/.snapshots/`.
144
+
145
+ ---
146
+
147
+ ## Uninstall
148
+
149
+ Hapus kit dari project secara aman (sambil keep file user-custom):
150
+
151
+ ```powershell
152
+ npx @ojokesusu/lintasai uninstall
153
+ ```
154
+
155
+ Perintah ini akan:
156
+ - Hapus folder `.claude-kit/`.
157
+ - Hapus `AGENTS.md` (kalau belum dimodifikasi user).
158
+ - **TIDAK** hapus `docs/`, `src/`, atau file project user lain.
159
+
160
+ Kalau `AGENTS.md` sudah dimodifikasi, kit akan tanya konfirmasi sebelum hapus.
161
+
162
+ ---
163
+
164
+ ## Cara Update Kit
165
+
166
+ Update ke versi terbaru:
167
+
168
+ ```powershell
169
+ npx @ojokesusu/lintasai update
170
+ ```
171
+
172
+ Perintah ini akan:
173
+ 1. Buat snapshot dari versi current.
174
+ 2. Download versi terbaru dari npm.
175
+ 3. Merge file yang dimodifikasi user (kalau ada).
176
+ 4. Update manifest signature.
177
+
178
+ Kalau ada konflik merge, kit akan tampilkan diff & tanya pilihan: `keep mine`, `take theirs`, atau `manual merge`.
179
+
180
+ ---
181
+
182
+ ## Cara Cek Apakah Kit Saya Up-to-date
183
+
184
+ Cek status + versi:
185
+ ```powershell
186
+ npx @ojokesusu/lintasai status
187
+ ```
188
+
189
+ Lihat file yang berubah dari versi original:
190
+ ```powershell
191
+ npx @ojokesusu/lintasai diff
192
+ ```
193
+
194
+ Output `diff` akan tampilkan:
195
+ - File yang **MODIFIED** (diubah user setelah install).
196
+ - File yang **MISSING** (terhapus).
197
+ - File yang **ADDED** (file baru di luar manifest).
198
+
199
+ Untuk lihat versi terbaru yang tersedia di npm:
200
+ ```powershell
201
+ npm view @ojokesusu/lintasai version
202
+ ```
203
+
204
+ Bandingkan dengan `Kit version` di output `status`. Kalau beda, jalankan `update`.
205
+
206
+ ---
207
+
208
+ ## Kontak Support
209
+
210
+ - **Discord channel**: `#lintasai-support` (link invite di internal docs tim).
211
+ - **Owner**: dokterbrutal@gmail.com — gunakan Signal/Telegram untuk hal sensitif (kredensial, API key bocor, security incident).
212
+ - **Bug report**: buka issue di GitHub repo `@ojokesusu/lintasai` (link di npm page).
213
+
214
+ Untuk error yang **tidak** ada di troubleshooting di atas:
215
+ 1. Jalankan `npx @ojokesusu/lintasai status --verbose` (output lengkap).
216
+ 2. Screenshot output + share di Discord channel.
217
+ 3. Jangan paste output yang berisi password / API key — mask dulu.
package/kit.ps1 CHANGED
@@ -12,6 +12,7 @@
12
12
  uninstall - Hapus kit dari proyek dengan AMAN (manifest-based, delegate ke uninstall.ps1)
13
13
  doctor - Diagnostic: cek versi + file utuh + broken cross-ref + integrity (sha256)
14
14
  scan - Re-run scan project (tanpa setup) — generate ringkasan kandidat CRITICAL
15
+ status - Ringkasan 1-layar (versi, install mode, AGENTS.md, manifest, tier)
15
16
  version - Print versi kit aktif (dari manifest)
16
17
  rollback - Rollback kit ke snapshot sebelum update (delegate ke lib\rollback.ps1)
17
18
  help - Tampilkan usage
@@ -47,9 +48,11 @@
47
48
  [CmdletBinding()]
48
49
  param(
49
50
  [Parameter(Position = 0)]
50
- [ValidateSet('setup', 'update', 'uninstall', 'doctor', 'scan', 'version', 'rollback', 'help', '')]
51
+ [ValidateSet('setup', 'update', 'uninstall', 'doctor', 'scan', 'version', 'rollback', 'status', 'help', '')]
51
52
  [string]$Command = '',
52
53
 
54
+ [string]$ProjectRoot = $null,
55
+
53
56
  [Parameter(ValueFromRemainingArguments = $true)]
54
57
  [string[]]$ExtraArgs
55
58
  )
@@ -57,12 +60,31 @@ param(
57
60
  $ErrorActionPreference = 'Stop'
58
61
 
59
62
  # ---- Resolve paths ----
60
- $KitDir = if ($PSScriptRoot) { $PSScriptRoot } elseif ($MyInvocation.MyCommand.Path) { Split-Path -Parent $MyInvocation.MyCommand.Path } else { (Get-Location).Path }
61
- $ProjectRoot = Split-Path -Parent $KitDir
63
+ # Script's own location (npm cache when invoked via `npx`, project's .claude-kit when invoked directly).
64
+ $ScriptRoot = if ($PSScriptRoot) { $PSScriptRoot } elseif ($MyInvocation.MyCommand.Path) { Split-Path -Parent $MyInvocation.MyCommand.Path } else { (Get-Location).Path }
65
+
66
+ # Kit-to-inspect: when -ProjectRoot is passed (npx launcher case), inspect the kit di USER CWD
67
+ # (.claude-kit di project), BUKAN script's own location ($ScriptRoot di npm cache). Tanpa
68
+ # -ProjectRoot (direct invocation via .\.claude-kit\kit.ps1), $ScriptRoot SUDAH .claude-kit
69
+ # project, jadi fallback pakai $ScriptRoot.
70
+ if ($ProjectRoot) {
71
+ $KitDir = Join-Path $ProjectRoot '.claude-kit'
72
+ } else {
73
+ $KitDir = $ScriptRoot
74
+ $ProjectRoot = Split-Path -Parent $KitDir
75
+ }
76
+
77
+ # Inform user which kit is being inspected — penting buat differentiate "kit di project" vs
78
+ # "kit di npm cache". Subcommands yang inspect kit (doctor/version/rollback/scan) butuh ini.
79
+ if ($Command -in @('doctor', 'version', 'rollback', 'scan', 'status')) {
80
+ Write-Host ("Inspecting kit at: {0}" -f $KitDir) -ForegroundColor Cyan
81
+ }
62
82
 
63
83
  # ---- Resolve lib paths (optional dependencies) ----
64
- $libRollback = Join-Path $PSScriptRoot 'lib\rollback.ps1'
65
- $libSafety = Join-Path $PSScriptRoot 'lib\safety.ps1'
84
+ # Pakai $KitDir (bukan $PSScriptRoot) supaya respect -ProjectRoot override — saat dipanggil
85
+ # via npx launcher, kit yang di-inspect ada di project (.claude-kit), bukan di npm cache.
86
+ $libRollback = Join-Path $KitDir 'lib\rollback.ps1'
87
+ $libSafety = Join-Path $KitDir 'lib\safety.ps1'
66
88
 
67
89
  # ---- Helper: detect kit version (defense-in-depth fallback chain) ----
68
90
  # Source 1: .install-manifest.json -> metadata.kit_version (PRIMARY — what was installed)
@@ -139,6 +161,9 @@ function Show-Help {
139
161
  Write-Host " scan - Re-run scan project untuk identifikasi kandidat CRITICAL"
140
162
  Write-Host " (tanpa setup ulang)"
141
163
  Write-Host ""
164
+ Write-Host " status - Ringkasan 1-layar: versi, install mode, AGENTS.md, manifest, tier"
165
+ Write-Host " (no args)"
166
+ Write-Host ""
142
167
  Write-Host " version - Print versi kit aktif (dari .install-manifest.json)"
143
168
  Write-Host ""
144
169
  Write-Host " rollback - Rollback kit ke snapshot sebelum update terakhir"
@@ -426,6 +451,111 @@ function Invoke-Scan {
426
451
  return 0
427
452
  }
428
453
 
454
+ # ---- Helper: status ringkas (1-layar) ----
455
+ # Mirror Invoke-Doctor structure tapi output lebih ringkas — fokus pada snapshot cepat,
456
+ # bukan diagnostic mendalam. Kalau user butuh detail (file inti, integrity sha256, dst.),
457
+ # arahkan ke `doctor`.
458
+ function Invoke-Status {
459
+ Write-Host ""
460
+ Write-Host "=== Kit Status (ringkas) ===" -ForegroundColor Cyan
461
+ Write-Host ""
462
+
463
+ # 1. Kit version
464
+ $version = Get-KitVersion
465
+ $versionDisplay = if ($version -match '^v') { $version } elseif ($version -eq 'unknown') { 'unknown' } else { "v$version" }
466
+ Write-Host ("Kit version : {0}" -f $versionDisplay) -ForegroundColor Green
467
+
468
+ # 2. Install mode (npx-mode vs git-clone-mode)
469
+ # Heuristic: kalau $ScriptRoot path mengandung 'node_modules' atau 'npm-cache' atau
470
+ # '_npx' (Windows npx cache), itu npx-mode. Selain itu git-clone-mode (atau direct).
471
+ # Catatan: $ScriptRoot = lokasi kit.ps1 yang lagi running, $KitDir = kit yang di-inspect.
472
+ $installMode = 'git-clone-mode'
473
+ if ($ScriptRoot -match '(node_modules|npm-cache|_npx|AppData[\\/]+Local[\\/]+npm-cache)') {
474
+ $installMode = 'npx-mode'
475
+ }
476
+ Write-Host ("Install mode : {0}" -f $installMode) -ForegroundColor Green
477
+
478
+ # 3. AGENTS.md present (Y/N + last modified)
479
+ $agentsAtRoot = Join-Path $ProjectRoot 'AGENTS.md'
480
+ if (Test-Path $agentsAtRoot) {
481
+ try {
482
+ $agentsMtime = (Get-Item $agentsAtRoot -ErrorAction Stop).LastWriteTime.ToString('yyyy-MM-dd HH:mm:ss')
483
+ Write-Host ("AGENTS.md : Y (last modified: {0})" -f $agentsMtime) -ForegroundColor Green
484
+ } catch {
485
+ Write-Host "AGENTS.md : Y (mtime unavailable)" -ForegroundColor Yellow
486
+ }
487
+ } else {
488
+ Write-Host "AGENTS.md : N (belum di-copy ke project root)" -ForegroundColor Yellow
489
+ }
490
+
491
+ # 4. Manifest signed (Y/N + verify result)
492
+ # "Signed" di sini = manifest punya field 'signature' atau 'sha256_of_manifest' atau
493
+ # equivalent. Sekarang kit pakai per-file sha256 di manifest.files[].sha256 — anggap
494
+ # itu "signed" kalau minimal ada N file dengan sha256 valid.
495
+ $manifestPath = Join-Path $KitDir '.install-manifest.json'
496
+ $manifestSignedDisplay = 'N (manifest hilang)'
497
+ $manifestSignedColor = 'Yellow'
498
+ $lastUpdateDisplay = 'unknown'
499
+ if (Test-Path $manifestPath) {
500
+ try {
501
+ $manifestJson = [System.IO.File]::ReadAllText($manifestPath, [System.Text.Encoding]::UTF8)
502
+ $manifest = ConvertFrom-Json $manifestJson -ErrorAction Stop
503
+
504
+ # Cek "signed": ada signature field, atau minimal entries dengan sha256
505
+ $hasSignature = $false
506
+ if ($manifest.signature) { $hasSignature = $true }
507
+ if (-not $hasSignature) {
508
+ $entries = @()
509
+ if ($manifest.files) { $entries = $manifest.files }
510
+ elseif ($manifest.entries) { $entries = $manifest.entries }
511
+ $shaCount = @($entries | Where-Object { $_.sha256 }).Count
512
+ if ($shaCount -gt 0) {
513
+ $hasSignature = $true
514
+ $manifestSignedDisplay = ("Y ({0} files w/ sha256)" -f $shaCount)
515
+ $manifestSignedColor = 'Green'
516
+ }
517
+ } else {
518
+ $manifestSignedDisplay = 'Y (signature field present)'
519
+ $manifestSignedColor = 'Green'
520
+ }
521
+
522
+ if (-not $hasSignature) {
523
+ $manifestSignedDisplay = 'N (manifest ada tapi tidak signed)'
524
+ $manifestSignedColor = 'Yellow'
525
+ }
526
+
527
+ # Last update timestamp dari manifest
528
+ if ($manifest.metadata -and $manifest.metadata.installed_at) {
529
+ $lastUpdateDisplay = $manifest.metadata.installed_at
530
+ } elseif ($manifest.metadata -and $manifest.metadata.updated_at) {
531
+ $lastUpdateDisplay = $manifest.metadata.updated_at
532
+ } elseif ($manifest.installed_at) {
533
+ $lastUpdateDisplay = $manifest.installed_at
534
+ }
535
+ } catch {
536
+ $manifestSignedDisplay = ("N (gagal parse: {0})" -f $_.Exception.Message)
537
+ $manifestSignedColor = 'Red'
538
+ }
539
+ }
540
+ Write-Host ("Manifest signed: {0}" -f $manifestSignedDisplay) -ForegroundColor $manifestSignedColor
541
+
542
+ # 5. Last update timestamp
543
+ Write-Host ("Last update : {0}" -f $lastUpdateDisplay) -ForegroundColor Green
544
+
545
+ # 6. Tier setup (.staff-profile.md present?)
546
+ $staffProfile = Join-Path $ProjectRoot '.staff-profile.md'
547
+ if (Test-Path $staffProfile) {
548
+ Write-Host "Tier setup : Y (.staff-profile.md ada)" -ForegroundColor Green
549
+ } else {
550
+ Write-Host "Tier setup : N (.staff-profile.md belum dibuat — solo/owner mode)" -ForegroundColor Yellow
551
+ }
552
+
553
+ Write-Host ""
554
+ Write-Host "Untuk detail lebih lengkap: .\.claude-kit\kit.ps1 doctor" -ForegroundColor Cyan
555
+ Write-Host ""
556
+ return 0
557
+ }
558
+
429
559
  # ---- Helper: print version ----
430
560
  # Uses Get-KitVersion fallback chain (manifest -> $script:KIT_VERSION -> CHANGELOG -> "unknown").
431
561
  function Show-Version {
@@ -471,6 +601,10 @@ switch ($Command) {
471
601
  $code = Invoke-Scan
472
602
  exit $code
473
603
  }
604
+ 'status' {
605
+ $code = Invoke-Status
606
+ exit $code
607
+ }
474
608
  'version' {
475
609
  Show-Version
476
610
  exit 0
@@ -81,7 +81,6 @@
81
81
  # Tier 5b: Deprecated stubs (legacy prompts, still on disk, akan dihapus)
82
82
  deprecated_stubs = @(
83
83
  'BOOTSTRAP_PROJECT_DOCS_PROMPT_v1.md',
84
- 'FIRST_SESSION_PROMPT_v1.md',
85
84
  'PROJECT_KICKOFF_PROMPT_v1.md',
86
85
  'PROJECT_MIGRATION_PROMPT_v1.md',
87
86
  'SETUP_POLA_B_PROMPT_v1.md',