@ojokesusu/lintasai 1.1.2

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.
Files changed (86) hide show
  1. package/.github/workflows/publish-npm.yml +40 -0
  2. package/.github/workflows/validate.yml +93 -0
  3. package/AUDIT_POST_SETUP_PROMPT_v1.md +280 -0
  4. package/BOOTSTRAP_PROJECT_DOCS_PROMPT_v1.md +3 -0
  5. package/CHANGELOG.md +313 -0
  6. package/CLAUDE_universal_v1.md +1021 -0
  7. package/CONTRIBUTING.md +101 -0
  8. package/FIRST_SESSION_PROMPT_v1.md +7 -0
  9. package/JALANKAN_KIT.md +188 -0
  10. package/LICENSE +21 -0
  11. package/MULAI_DI_SINI.md +145 -0
  12. package/PROJECT_KICKOFF_PROMPT_v1.md +3 -0
  13. package/PROJECT_LIFECYCLE_PROMPT_v1.md +536 -0
  14. package/PROJECT_MIGRATION_PROMPT_v1.md +3 -0
  15. package/README.md +505 -0
  16. package/SETUP_POLA_B_PROMPT_v1.md +5 -0
  17. package/SPLIT_REPO_MIGRATION_PROMPT_v1.md +485 -0
  18. package/TEAM_ROLLOUT_GUIDE_v1.md +172 -0
  19. package/UPDATE_DOCS_PROMPT_v1.md +3 -0
  20. package/UPDATE_KIT_PROMPT_v1.md +213 -0
  21. package/bin/lintasai.js +81 -0
  22. package/docs/SIGNED_RELEASE.md +162 -0
  23. package/install-windows.ps1 +225 -0
  24. package/kit.ps1 +508 -0
  25. package/lib/agents-md.ps1 +174 -0
  26. package/lib/git-helpers.ps1 +104 -0
  27. package/lib/kit-files.psd1 +133 -0
  28. package/lib/manifest-signing.ps1 +65 -0
  29. package/lib/manifest.ps1 +267 -0
  30. package/lib/rollback.ps1 +241 -0
  31. package/lib/safety.ps1 +193 -0
  32. package/lib/template-deploy.ps1 +242 -0
  33. package/lib/version-detect.ps1 +161 -0
  34. package/package.json +36 -0
  35. package/setup-pola-b.ps1 +687 -0
  36. package/templates/ANALOGI_LIBRARY.md +7 -0
  37. package/templates/CLAUDE_TEAM_GUIDE.md +505 -0
  38. package/templates/CROSS_REPO_TYPES_PIPELINE.md +473 -0
  39. package/templates/DB_SCHEMA_SCAN_PROMPT.md +194 -0
  40. package/templates/DISCORD_BOT_INTEGRATION.md +187 -0
  41. package/templates/GLOSSARY_NON_PROGRAMMER.md +361 -0
  42. package/templates/INDEX.md +157 -0
  43. package/templates/MCP_SETUP.md +1145 -0
  44. package/templates/MIGRATE_TO_SUBFOLDER_PROMPT_v1.md +220 -0
  45. package/templates/ONBOARDING.md +172 -0
  46. package/templates/PROJECT_STARTER_TEMPLATES.md +264 -0
  47. package/templates/PROMPT_LIBRARY.md +790 -0
  48. package/templates/RLS_SETUP_PROMPT.md +167 -0
  49. package/templates/SECURITY_INCIDENT_PLAYBOOK.md +191 -0
  50. package/templates/SPLIT_REPO_AGENTS_TEMPLATES.md +32 -0
  51. package/templates/SPLIT_REPO_NON_PROGRAMMER_PROMPTS.md +604 -0
  52. package/templates/SPLIT_REPO_TOOLS_SETUP.md +388 -0
  53. package/templates/STACK_DETECTION_PATTERN.md +261 -0
  54. package/templates/STACK_GUIDE.md +564 -0
  55. package/templates/STACK_MIGRATION_GUIDE.md +154 -0
  56. package/templates/STACK_VERSIONS.md +31 -0
  57. package/templates/UPDATE_GUIDE.md +246 -0
  58. package/templates/_EXAMPLE.md +110 -0
  59. package/templates/_PATTERNS.md +173 -0
  60. package/templates/architecture.md +180 -0
  61. package/templates/architecture_auto.md +61 -0
  62. package/templates/decisions/README.md +108 -0
  63. package/templates/decisions/_TEMPLATE.md +84 -0
  64. package/templates/feature-flags-advanced.md +171 -0
  65. package/templates/github/CODEOWNERS.template +61 -0
  66. package/templates/github/GENERATE_TYPES_SCRIPT.md +77 -0
  67. package/templates/github/PUBLISH_SHARED_WORKFLOW.yml +52 -0
  68. package/templates/github/RECEIVE_BACKEND_UPDATE.yml +106 -0
  69. package/templates/github/RENOVATE_FRONTEND.json +28 -0
  70. package/templates/github/TRIGGER_FRONTEND_UPDATE.yml +29 -0
  71. package/templates/github/pull_request_template.md +44 -0
  72. package/templates/github/scripts/ai-review.js +153 -0
  73. package/templates/github/workflows/ai-review.yml +61 -0
  74. package/templates/github/workflows/backup-schemas.yml +169 -0
  75. package/templates/glossary.md +110 -0
  76. package/templates/split-agents/BACKEND.md +149 -0
  77. package/templates/split-agents/FRONTEND.md +141 -0
  78. package/templates/split-agents/SHARED.md +82 -0
  79. package/templates/split-agents/TOOLS.md +77 -0
  80. package/tests/Run-Tests.ps1 +19 -0
  81. package/tests/lib-safety.Tests.ps1 +66 -0
  82. package/tests/rollback.Tests.ps1 +66 -0
  83. package/tests/uninstall.Tests.ps1 +265 -0
  84. package/tests/update-kit.Tests.ps1 +78 -0
  85. package/uninstall.ps1 +794 -0
  86. package/update-kit.ps1 +907 -0
@@ -0,0 +1,167 @@
1
+ # templates/RLS_SETUP_PROMPT.md — Setup Row-Level Security per Schema
2
+
3
+ > Versi 1 · 2026-06-01
4
+ > Untuk staff IT / developer schema-scoped yang akses Supabase pakai role `creative_<dev>.<project-ref>`.
5
+
6
+ ---
7
+
8
+ ## 1. Untuk OWNER — Template pesan announcement ke staff IT
9
+
10
+ Copy template ini, ganti placeholder `{{DEV}}`, `{{SCHEMA}}`, `{{PASSWORD-KAMU}}`, `{{PROJECT_REF}}`, `{{POOLER_HOST}}`:
11
+
12
+ ```
13
+ Halo {{DEV}}, ada update KEAMANAN database. Kita rapikan akses supaya tiap orang HANYA bisa ke
14
+ schema-nya sendiri (isolasi antar-tenant).
15
+
16
+ PERUBAHAN PENTING:
17
+ - Mulai sekarang pakai koneksi role KHUSUS kamu: username `creative_{{DEV}}.{{PROJECT_REF}}`.
18
+ - JANGAN pakai lagi string yang usernamanya `postgres.` — itu akses penuh ke SEMUA tenant, ditutup demi keamanan.
19
+ - Password kamu TIDAK aku ubah: pakai password `creative_{{DEV}}` yang lama. Kalau tidak punya/lupa, balas ini, nanti aku kirim yang baru.
20
+
21
+ Koneksi kamu (schema: {{SCHEMA}}):
22
+ App/runtime (6543): postgresql://creative_{{DEV}}.{{PROJECT_REF}}:[PASSWORD-KAMU]@{{POOLER_HOST}}:6543/postgres
23
+ DDL/migrasi (5432): postgresql://creative_{{DEV}}.{{PROJECT_REF}}:[PASSWORD-KAMU]@{{POOLER_HOST}}:5432/postgres?sslmode=require
24
+
25
+ TUGAS (kerjakan via Claude Code kamu, yang sudah buka project app kamu) — paste prompt RLS_SETUP di bawah.
26
+
27
+ Kalau ragu, tanya aku dulu sebelum REVOKE/ENABLE di tabel yang dipakai app.
28
+ ```
29
+
30
+ **Cara pakai**:
31
+ 1. Ganti placeholder per-dev (mis. `{{DEV}}` → `sandi`, `{{SCHEMA}}` → `pbn`).
32
+ 2. Kirim via password manager (1Password / Bitwarden Send) atau encrypted DM yang auto-delete.
33
+ 3. JANGAN kirim password actual di body pesan; kirim password via password manager terpisah.
34
+
35
+ ---
36
+
37
+ ## 2. Untuk STAFF IT — Prompt RLS Setup (paste ke Claude Code)
38
+
39
+ **Persiapan dulu** (sebelum paste prompt):
40
+ - Pastikan Claude Code sudah dibuka di folder project app kamu (mis. `D:\projects\<your-app>\`).
41
+ - Pastikan kamu sudah dapat connection string dari owner (jangan paste password ke chat).
42
+ - Update `.env.local` proyek dengan connection string baru (port 6543, username `creative_<dev>.<project-ref>`).
43
+
44
+ **Paste prompt ini ke Claude Code**:
45
+
46
+ ```
47
+ Saya developer schema `{{SCHEMA}}` di database Supabase yang dipakai bersama banyak tenant (PRODUCTION).
48
+ Tugas: amankan schema `{{SCHEMA}}` dengan Row Level Security (RLS) supaya pemegang anon/publishable key
49
+ (PUBLIK) tidak bisa baca/tulis data atau melewati cek role app.
50
+
51
+ ATURAN WAJIB:
52
+ 1) Jangan ENABLE RLS tanpa bikin policy dulu (RLS tanpa policy = app error semua query gagal).
53
+ 2) Tes lewat APP asli (login tiap role), bukan psql — koneksi langsung saya bypass RLS karena saya owner tabel.
54
+ 3) Jangan pakai USING(true) untuk operasi TULIS; policy tulis harus cek role app yang authoritative.
55
+ 4) Hanya sentuh schema {{SCHEMA}}. JANGAN touch schema lain.
56
+
57
+ LANGKAH:
58
+ 1. Baca kode app saya (folder `src/`, `app/`, `lib/`, dst.) untuk pahami:
59
+ - Role app apa saja yang dipakai (mis. `admin_access`, `pic`, `staff`, `anon`).
60
+ - Tabel mana yang public-readable (mis. landing page data) vs auth-required.
61
+ - JWT claim path yang dipakai app (mis. `request.jwt.claims->>'role'` atau header custom).
62
+ 2. List semua tabel di schema {{SCHEMA}}:
63
+ ```sql
64
+ SELECT table_name FROM information_schema.tables
65
+ WHERE table_schema = '{{SCHEMA}}' AND table_type = 'BASE TABLE'
66
+ ORDER BY table_name;
67
+ ```
68
+ 3. Untuk SETIAP tabel, urutan eksekusi:
69
+ a. Bikin policy SELECT (read) — cek role yang boleh baca.
70
+ b. Bikin policy INSERT/UPDATE/DELETE (write) — cek role app authoritative.
71
+ c. Verify policy syntax bener (DROP POLICY IF EXISTS sebelum CREATE biar idempotent).
72
+ d. ENABLE RLS: `ALTER TABLE {{SCHEMA}}.<tabel> ENABLE ROW LEVEL SECURITY;`
73
+ e. REVOKE anon: `REVOKE ALL ON {{SCHEMA}}.<tabel> FROM anon;` (kalau app wajib login).
74
+ f. Test via APP asli — login → action → verify behavior.
75
+ g. Test anon access — pakai publishable_key, harus 401/403 atau empty.
76
+ 4. Setelah SEMUA tabel selesai:
77
+ a. Bikin docs/db-rls.md ringkas: per tabel, role apa yang boleh apa.
78
+ b. Update docs/architecture_auto.md dengan entry [db-rls.md](db-rls.md).
79
+ c. Commit ke git: `chore(db): setup RLS for schema {{SCHEMA}}`.
80
+
81
+ PENTING:
82
+ - Kerjakan tabel per tabel, HATI-HATI, tes setiap selesai sekelompok (3-5 tabel).
83
+ - Kalau ragu di salah satu tabel, STOP dan tanya owner sebelum lanjut.
84
+ - Kalau test app gagal setelah ENABLE RLS, DISABLE dulu (`ALTER TABLE ... DISABLE ROW LEVEL SECURITY`),
85
+ debug policy, baru ENABLE lagi.
86
+ - JANGAN run `DROP POLICY` untuk policy app existing tanpa konfirmasi owner.
87
+
88
+ Mulai dari langkah 1 (baca kode app) sekarang.
89
+ ```
90
+
91
+ ---
92
+
93
+ ## 3. Verifikasi setelah RLS aktif
94
+
95
+ Setelah staff IT selesai, owner verify dengan checklist ini:
96
+
97
+ - [ ] Semua tabel di schema `{{SCHEMA}}` punya RLS enabled (`SELECT relname, relrowsecurity FROM pg_class WHERE relnamespace = '{{SCHEMA}}'::regnamespace AND relkind = 'r';`).
98
+ - [ ] Semua tabel punya minimal 1 policy (`SELECT tablename, policyname FROM pg_policies WHERE schemaname = '{{SCHEMA}}';`).
99
+ - [ ] Test app dari browser tanpa login → menu / data terkunci.
100
+ - [ ] Test curl dengan publishable_key ke endpoint tabel sensitif → 401/403.
101
+ - [ ] Test login sebagai role app yang valid → semua fitur jalan.
102
+ - [ ] `docs/db-rls.md` ada di repo dengan ringkasan per tabel.
103
+
104
+ ---
105
+
106
+ ## 4. Anti-pattern (LARANGAN)
107
+
108
+ ### 4.1. ENABLE RLS sebelum policy lengkap
109
+ ```sql
110
+ -- SALAH — app langsung 500 error semua query
111
+ ALTER TABLE pbn.posts ENABLE ROW LEVEL SECURITY;
112
+ -- belum ada policy → default deny → semua query gagal
113
+ ```
114
+ **Yang benar**: bikin policy dulu (SELECT + INSERT + UPDATE + DELETE), baru ENABLE.
115
+
116
+ ### 4.2. Pakai USING(true) untuk write policy
117
+ ```sql
118
+ -- SALAH — semua user (termasuk anon) bisa update apapun
119
+ CREATE POLICY posts_update ON pbn.posts FOR UPDATE USING (true);
120
+ ```
121
+ **Yang benar**: cek role app authoritative.
122
+ ```sql
123
+ CREATE POLICY posts_update ON pbn.posts FOR UPDATE
124
+ USING (current_setting('request.jwt.claims', true)::json->>'role' = 'admin_access')
125
+ WITH CHECK (current_setting('request.jwt.claims', true)::json->>'role' = 'admin_access');
126
+ ```
127
+
128
+ ### 4.3. Tes RLS via psql owner
129
+ ```bash
130
+ # SALAH — psql sebagai owner tabel BYPASS RLS otomatis
131
+ psql "postgresql://creative_a.ref:pwd@...:6543/postgres"
132
+ SELECT * FROM pbn.posts; -- jalan, padahal RLS aktif
133
+ ```
134
+ **Yang benar**: tes via app asli yang pakai JWT app role. PostgreSQL native role (`creative_a`) BUKAN role app.
135
+
136
+ ### 4.4. Sentuh schema orang lain
137
+ ```sql
138
+ -- SALAH — staff IT touch schema yang bukan miliknya
139
+ ALTER TABLE rtp.bets ENABLE ROW LEVEL SECURITY;
140
+ ```
141
+ **Yang benar**: hanya sentuh schema sendiri (`pbn` kalau kamu creative_a di tim PBN).
142
+
143
+ ---
144
+
145
+ ## 5. Troubleshooting
146
+
147
+ ### "permission denied for table X" setelah ENABLE RLS
148
+ - Cek `SELECT * FROM pg_policies WHERE tablename = 'X';` — ada policy belum?
149
+ - Cek JWT claim app — apakah role-nya match dengan policy `USING` clause?
150
+ - Cek apakah connection string app pakai role yang BUKAN tabel owner (RLS skip owner).
151
+
152
+ ### App jalan tapi data kosong setelah RLS
153
+ - Policy SELECT terlalu strict (mis. cek role yang tidak ada di JWT user current).
154
+ - DISABLE sementara untuk debug: `ALTER TABLE X DISABLE ROW LEVEL SECURITY;`
155
+ - Cek query asli yang app jalankan vs claim JWT yang dikirim.
156
+
157
+ ### Migration Prisma gagal setelah RLS
158
+ - Prisma migrate jalan sebagai owner tabel = bypass RLS, tapi pakai DDL connection (port 5432).
159
+ - Pastikan connection string DDL pakai `?sslmode=require`.
160
+ - Kalau masih gagal, owner perlu `GRANT ALL ON SCHEMA <schema> TO postgres;` sementara untuk migrate.
161
+
162
+ ---
163
+
164
+ ## Referensi
165
+ - Supabase RLS docs: https://supabase.com/docs/guides/database/postgres/row-level-security
166
+ - PostgreSQL CREATE POLICY: https://www.postgresql.org/docs/current/sql-createpolicy.html
167
+ - JWT claim helper Supabase: https://supabase.com/docs/guides/auth/server-side/creating-a-client
@@ -0,0 +1,191 @@
1
+ # Security Incident Playbook — Untuk Staff IT Non-Programmer
2
+
3
+ > Wajib baca **sebelum** mulai kerja task pertama.
4
+ > File ini cuma dipakai saat **ADA SIGNAL** keamanan. Tidak perlu di-eksekusi rutin.
5
+
6
+ ---
7
+
8
+ ## 🚨 Kapan Playbook Ini Dipakai?
9
+
10
+ Pakai langkah di bawah kalau kamu lihat **salah satu** signal berikut:
11
+
12
+ | Signal | Sumber | Contoh |
13
+ |---|---|---|
14
+ | 🚨 Email "Secret Detected" | GitHub | *"GitGuardian detected token in commit abc123 by @bagus"* |
15
+ | 🚨 AI Reviewer warning di PR | `.github/scripts/ai-review.js` | Comment: *"⚠️ Possible token leak at line 42: pattern matches `sk-ant-`"* |
16
+ | 🚨 Email anomaly | Vercel / Supabase / Anthropic | *"Unusual usage spike detected: 5000 requests in last hour from IP X"* |
17
+ | 🚨 File `.env.local` muncul di `git status` | Terminal lokal | `git status` show `.env.local: untracked` — tapi seharusnya di `.gitignore` |
18
+ | 🚨 Token ter-paste tidak sengaja | Channel chat tim, screenshot | Tanpa sengaja kamu/teman paste isi `.env.local` di Slack/Discord |
19
+ | 🚨 Akses tidak diakui | Email "New device login" | *"Login dari IP 1.2.3.4 di Russia"* — bukan kamu |
20
+
21
+ **TIDAK termasuk security incident**:
22
+ - Bug kode biasa (pakai workflow PR normal)
23
+ - Performance issue (DB slow, halaman lambat)
24
+ - UI typo
25
+
26
+ ---
27
+
28
+ ## 📞 Step-by-Step (URUTAN WAJIB — Jangan Skip)
29
+
30
+ ### Step 1 — STOP coding sekarang juga (10 detik)
31
+
32
+ Jangan commit, jangan push, jangan close terminal. Biarkan semua state apa adanya.
33
+
34
+ **Kenapa**: kalau token bocor, tiap detik = window untuk attacker pakai token. Tapi kamu juga jangan rush — tindakan salah bisa hapus jejak forensik.
35
+
36
+ ### Step 2 — JANGAN buka channel chat publik (30 detik)
37
+
38
+ Token bocor itu **sensitive info**. Jangan:
39
+ - ❌ Post di `#tasks-akses` (semua staff lihat + screenshot bisa)
40
+ - ❌ Reply thread PR yang affected (token mungkin keulang di reply)
41
+ - ❌ Email "to all" — multiplier risk
42
+
43
+ ### Step 3 — DM Owner LANGSUNG (1 menit)
44
+
45
+ Kirim **DM private** ke owner dengan template ini:
46
+
47
+ ```
48
+ 🚨 SECURITY ALERT
49
+
50
+ Signal: <tempel email/screenshot/copy text exact yang trigger>
51
+ Sumber: <GitHub Secret Scanning / AI Reviewer / email Vercel / dll>
52
+ PR/commit terkait: <link kalau ada>
53
+ Waktu deteksi: <jam>
54
+
55
+ Status: saya STOP coding, nunggu instruksi.
56
+ ```
57
+
58
+ Contoh:
59
+ ```
60
+ 🚨 SECURITY ALERT
61
+
62
+ Signal: Email GitHub "GitGuardian detected token in commit 7f8a9d2"
63
+ Sumber: GitHub Secret Scanning
64
+ PR/commit terkait: https://github.com/ojokesusu/akses/pull/42
65
+ Waktu deteksi: 14:23 WIB
66
+
67
+ Status: saya STOP coding, nunggu instruksi.
68
+ ```
69
+
70
+ ### Step 4 — Tunggu instruksi owner (max 30 menit)
71
+
72
+ Owner akan eksekusi salah satu (kamu tidak perlu lakukan ini sendiri):
73
+ - **Rotate token affected** (generate token baru, invalidate yang bocor)
74
+ - **Force-push history rewrite** kalau token sudah di-commit ke main (cuma owner punya akses)
75
+ - **Audit log** Vercel/Supabase — cek ada akses tidak sah selama window bocor?
76
+ - **Update env var** di semua environment (Production, Preview, Development)
77
+
78
+ ### Step 5 — Setelah owner kasih sinyal AMAN
79
+
80
+ Owner DM kamu: *"Resolved. Token sudah di-rotate. Kamu boleh lanjut coding."*
81
+
82
+ Lakukan:
83
+ 1. Pull `main` terbaru (kalau history di-rewrite, force-pull diperlukan)
84
+ 2. Update `.env.local` lokal dengan token baru (owner kirim via DM)
85
+ 3. Lanjut task yang tadi di-pause
86
+
87
+ ### Step 6 — Post-Mortem (dalam 24 jam)
88
+
89
+ Owner / kamu tulis post-mortem di `docs/incidents/<YYYY-MM-DD>-<slug>.md`:
90
+
91
+ ```markdown
92
+ # Incident: Token Anthropic bocor di PR #42
93
+
94
+ ## Tanggal
95
+ 2026-06-15
96
+
97
+ ## Durasi terpapar
98
+ 14:23 - 14:38 WIB (15 menit dari commit sampai rotate)
99
+
100
+ ## Apa yang terjadi
101
+ Saat copy `.env.example` jadi `.env.local`, tidak sengaja juga commit `.env.local`
102
+ ke branch `feat/inbox-filter`. GitHub Secret Scanning detect token Anthropic
103
+ `sk-ant-...` di file `.env.local` baris 12.
104
+
105
+ ## Kenapa lolos review?
106
+ - `.gitignore` ada `.env.local`, tapi pre-commit hook tidak aktif.
107
+ - AI Reviewer tidak konfigurasi pattern Anthropic token.
108
+ - Staff (saya) tidak cek `git status` sebelum push.
109
+
110
+ ## Action items
111
+ - [ ] (Owner) Setup pre-commit hook `.env*` block
112
+ - [ ] (Owner) Tambah pattern `sk-ant-` di AI Reviewer warning rules
113
+ - [ ] (Staff) Tambah ke onboarding: WAJIB `git status` cek sebelum push pertama kali
114
+ - [ ] (Owner) Audit Anthropic usage log selama 14:23-14:38 — ada akses tidak sah?
115
+
116
+ ## Lesson learned
117
+ Staff baru hire WAJIB tau `.env.local` tidak boleh di-commit.
118
+ Tambah micro-win Day 0 task: simulasi staging .env biar staff hands-on cek `git status`.
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 🚫 Yang TIDAK BOLEH Dilakukan
124
+
125
+ 1. ❌ **Jangan rotate token sendiri** — owner only operation. Staff coba rotate bisa break production.
126
+ 2. ❌ **Jangan delete commit dari history sendiri** (`git reset --hard`, `git push --force`) — bisa destructive, hilang work tim lain.
127
+ 3. ❌ **Jangan post screenshot di channel chat** — token visible di screenshot = bocor lagi.
128
+ 4. ❌ **Jangan diam tanpa lapor** — 30 menit silence = window besar buat attacker.
129
+ 5. ❌ **Jangan panik continue coding** — tiap commit tambahan = makin susah forensik.
130
+
131
+ ---
132
+
133
+ ## 📋 Template Decision Matrix untuk Owner
134
+
135
+ Owner pakai matrix ini saat terima alert dari staff:
136
+
137
+ | Tipe Token | Severity | Action |
138
+ |---|---|---|
139
+ | Anthropic API key | 🔴 High | Rotate via console.anthropic.com → Settings → Keys → revoke + create new. Update Vercel env vars. |
140
+ | Supabase Service Role Key | 🔴 Critical | Rotate via Supabase Dashboard → Settings → API → Reset. Update Vercel + audit DB access log. |
141
+ | GitHub Personal Access Token | 🟠 Medium | Revoke di GitHub Settings → Developer settings → Personal access tokens. |
142
+ | Vercel deploy token | 🟠 Medium | Vercel Dashboard → Settings → Tokens → revoke + create new. |
143
+ | Database password (creative_<dev>) | 🔴 High | Supabase Dashboard → Database → Roles → reset password user affected. Update `.env.local` semua dev. |
144
+ | `.env.local` file ter-commit | 🔴 High | Rotate SEMUA token di file (asumsi semua bocor). Force-push history rewrite. |
145
+ | Sensitive PII di code/log | 🟠 Medium | Cek scope leak, notify legal kalau >1 user PII. GDPR/UU PDP compliance check. |
146
+
147
+ ---
148
+
149
+ ## 🔐 Preventive Measures (Owner Setup, Bukan Staff)
150
+
151
+ Setup ini sekali, otomatis protect kedepan:
152
+
153
+ | Layer | Tool | Setup |
154
+ |---|---|---|
155
+ | GitHub Secret Scanning | Settings → Code security & analysis | Enable "Secret scanning" + "Push protection" (block push kalau detect secret) |
156
+ | GitGuardian (alternatif) | gitguardian.com → connect GitHub | Auto-scan tiap commit, lebih banyak pattern |
157
+ | Pre-commit hook | `.husky/pre-commit` | Check `.env*` not staged: `git diff --cached --name-only \| grep -E '^\.env' && exit 1` |
158
+ | AI Reviewer custom rules | `.github/scripts/ai-review.js` | Tambah pattern: `sk-ant-`, `eyJ\\w+`, `xoxb-`, `ghp_`, `postgres://.*:.*@` |
159
+ | Vercel anomaly alert | Vercel Settings → Notifications | Enable usage spike notification |
160
+ | Supabase activity log | Supabase Dashboard → Logs | Review weekly untuk unusual queries |
161
+
162
+ ---
163
+
164
+ ## 📞 Eskalasi (Kalau Owner Tidak Reply >1 Jam)
165
+
166
+ Kalau alert serius (data breach, multiple token bocor) dan owner tidak reply >1 jam:
167
+
168
+ 1. **Cek channel emergency**: `#emergency` atau nomor HP owner
169
+ 2. **Cek backup owner** (kalau ada deputi/co-founder)
170
+ 3. **Untuk Anthropic API**: minimal kamu bisa email `support@anthropic.com` lapor token compromise (mereka revoke dari sisi mereka)
171
+ 4. **Untuk Supabase**: email `support@supabase.io` dengan project ref + nature of leak
172
+ 5. **Untuk GitHub**: report di Security tab repo
173
+
174
+ ---
175
+
176
+ ## ✅ Quick Checklist Kalau Kamu Encounter
177
+
178
+ ```
179
+ [ ] Step 1: STOP coding
180
+ [ ] Step 2: TIDAK post di channel publik
181
+ [ ] Step 3: DM owner dengan template Security Alert
182
+ [ ] Step 4: Tunggu instruksi (max 30 menit)
183
+ [ ] Step 5: Lanjut coding setelah owner sinyal aman
184
+ [ ] Step 6: Post-mortem dalam 24 jam
185
+ ```
186
+
187
+ Print checklist ini, tempel di laptop. Saat panik, baca checklist > improvise.
188
+
189
+ ---
190
+
191
+ > **Filosofi**: security incident BUKAN ujian skill — semua orang bisa salah klik atau tidak sengaja commit file rahasia. Yang membedakan tim profesional vs amatir = **cara handle saat ada incident**. Playbook ini cuma tools — yang penting **kamu PERTAMA-TAMA lapor owner**, bukan sembunyiin atau coba fix sendiri tanpa expertise.
@@ -0,0 +1,32 @@
1
+ # AGENTS.md Templates - Split Repo (INDEX)
2
+
3
+ > 3 AGENTS.md template DEFAULT untuk 3 repo split (OPT-IN: 4th template untuk tools repo kalau team >20 staff).
4
+ > File ini cuma index. Detail per repo ada di split-agents/ subfolder.
5
+
6
+ ## Templates Available
7
+
8
+ 1. [Frontend Repo AGENTS.md](split-agents/FRONTEND.md) - Untuk <project>-frontend (Frontend staff: dapat edit data CRUD, tidak DDL)
9
+ 2. [Backend Repo AGENTS.md](split-agents/BACKEND.md) - Untuk <project>-backend (Backend staff + owner: full DB control termasuk DDL)
10
+ 3. [Shared Repo AGENTS.md](split-agents/SHARED.md) - Untuk <project>-shared (types only; both Frontend & Backend dapat akses read)
11
+ 4. [Tools Repo AGENTS.md](split-agents/TOOLS.md) - Untuk <project>-tools (owner + Backend staff kalau pakai 4-repo split) **(OPT-IN)**
12
+
13
+ ## Cara AI Pakai
14
+
15
+ Saat split repo migration:
16
+ 1. Owner pilih untuk deploy template (Y/N)
17
+ 2. AI read template per file (FRONTEND.md, BACKEND.md, dst)
18
+ 3. AI customize dengan project name + GitHub username staff
19
+ 4. AI deploy ke masing-masing repo:
20
+ - <project>-frontend/AGENTS.md
21
+ - <project>-backend/AGENTS.md
22
+ - <project>-shared/AGENTS.md
23
+ - <project>-tools/AGENTS.md
24
+ 5. Commit per repo dengan message: "feat: add AGENTS.md from lintasAI v1.0.0 template"
25
+
26
+ ## Customization Variables
27
+
28
+ Saat deploy, replace placeholder:
29
+ - `<project>` -> nama project user (e.g., "akses")
30
+ - `<project>-frontend` -> nama repo frontend
31
+ - `<project>-backend` -> nama repo backend
32
+ - `<owner>` -> GitHub username owner