﻿# Claude Code-Mediated Install (Zero PowerShell)

> v1.3.1+ feature. Staff IT non-programmer install lintasAI 100% via Claude Code chat tanpa buka PowerShell/CMD.

## Untuk Owner: Persiapan 1x per Project (~5 menit)

### Step 1: Buat basic settings.local.json di project repo

Lokasi: <project>/.claude/settings.local.json

Minimum content (allow install + basic dev ops):

```json
{
  "permissions": {
    "allow": [
      "Bash(npx @ojokesusu/lintasai:*)",
      "Bash(pnpm install:*)",
      "Bash(pnpm dev:*)",
      "Bash(git status)",
      "Bash(git diff:*)",
      "Bash(git log:*)",
      "Bash(git config user.email:*)",
      "Bash(git config user.name:*)"
    ]
  }
}
```

### Step 2: Commit + push ke repo

```
git add .claude/settings.local.json
git commit -m "chore: claude code allow rules untuk lintasAI install"
git push
```

### Step 3: Verify .gitignore tidak exclude settings.local.json

WAJIB: settings.local.json HARUS ter-commit (shared dengan tim). Berbeda dengan ~/.claude/settings.json (user-global, JANGAN commit).

## Untuk Staff IT Non-Programmer: Install Day 0

### Step 1: Clone project (owner kirim link)

Owner DM Discord: "Clone link ini: https://github.com/owner/project"

Staff buka VS Code → Source Control → Clone Repository → paste URL.

### Step 2: Buka project + buka Claude Code

File → Open Folder → pilih folder project hasil clone.
Claude Code panel terbuka (kalau extension aktif).

> **Catatan**: semua "popup" di dokumen ini merujuk ke **Tipe B (jendela Windows terpisah, klik tombol mouse)**. Beda dengan **Popup #1/#2/#3 di `JALANKAN_KIT.md` yang Tipe A (kotak pilihan klik DI DALAM chat; kalau fitur klik tak tersedia, tampil sebagai teks ketik-angka)**. Definisi lengkap: `JALANKAN_KIT.md` > section "Klarifikasi Terminologi Popup".

### Step 3: Chat ke AI

Ketik di chat:

> halo aku staff baru, install lintasAI dong

AI akan respond:

1. Detect kamu staff baru → run npx @ojokesusu/lintasai@latest init (permission OK karena settings.local.json)
2. Popup Windows muncul (AGENTS.md choice) - klik [Skip RECOMMENDED]
3. Popup email input - ketik email kamu
4. Popup [Buka VS Code?] - klik [Yes]
5. Popup [Tip] - klik [OK]
6. AI auto-trigger Phase 1-6 Guided onboarding (~90 menit)

### Yang Staff Lakukan:

- 1x ketik chat AI (1 kalimat)
- 5x klik popup
- 1x ketik email
- Tidak buka PowerShell/CMD
- Tidak edit settings.json
- Tidak install Node.js manual (kalau Owner sudah pre-install di laptop staff)

## Apa yang Auto-Terjadi di Belakang Layar

- Kit ter-install di project/.claude-kit/
- AGENTS.md preserved (existing tidak ke-overwrite)
- Git identity ter-set (email + auto-derive nama)
- settings.local.json auto-merge tambahan allow rules (post-install ops)
- VS Code restart prompt untuk apply new settings
- AI Auto-Health-Check aktif (section 7.6 CLAUDE_universal_v1.md)

## Troubleshooting

### "AI bilang permission denied untuk npx"

Owner belum commit basic settings.local.json. Cek Step 1-3 owner section.

### "Popup tidak muncul"

Staff laptop headless (Server Core / SSH). Kit auto-fallback ke -NoGui console mode. AI akan tampil prompt di chat sebagai opsi.

### "Reinstall di project sama"

Aman, kit detect existing → AGENTS.md skip default → settings.local.json idempotent (no duplicate allow rules).

## Komparasi Cara Install

| Cara | Friction Staff | Recommend? |
|------|----------------|------------|
| Claude-Code-mediated (v1.3.1+) | 1 chat + 5 klik popup | 🟢 RECOMMENDED untuk non-programmer |
| PowerShell-first | 1 paste perintah + popup | 🟡 OK kalau staff pernah pakai PS |
| Git clone | 5+ langkah + GitHub auth | 🔴 TIDAK - repo private |
