Files
BE_CPONE/AGENTS.md

3.6 KiB

Agent Safety Rules

Destructive Actions

  • Never run destructive actions directly when the request is ambiguous.
  • Destructive actions include (not limited to): DELETE, TRUNCATE, DROP, mass UPDATE, file deletion, force-reset, and similar irreversible operations.
  • Before executing destructive actions, the agent must:
    1. Confirm exact target scope (table/file/column/ID/filter).
    2. Show a short preview of affected scope when possible.
    3. Ask for explicit user confirmation.

Ambiguous Instructions

  • If instruction can be interpreted in more than one way, do not execute immediately.
  • Ask a concise clarification first, then proceed after confirmation.

Priority

  • Safety confirmation is mandatory and overrides speed.

Pull Request — Wajib Sebelum Membuat PR

Sebelum membuat PR, selalu jalankan dua perintah ini terlebih dahulu:

git log origin/master..origin/staging --oneline          # lihat semua commit yang belum masuk master
git diff origin/master...origin/staging --stat           # lihat semua file yang berubah

Deskripsi PR harus mencakup semua commit yang ada di staging tapi belum di master — bukan hanya commit terakhir. Jangan sampai ada commit/file yang terlewat.

Pull Request Format

Setiap PR wajib menggunakan struktur berikut:

Title: TASKCODE - deskripsi singkat

Body:

## Latar Belakang Masalah
[Root cause atau kebutuhan yang melatarbelakangi perubahan]

## Perubahan
- [Bullet point perubahan spesifik per fungsi/fitur]

## File yang Diubah
| File | Fungsi/Bagian | Keterangan |
|---|---|---|
| `path/to/file.php` | `nama_fungsi()` | deskripsi singkat |

## Test yang Harus Dilakukan QA
- [ ] Skenario normal: ...
- [ ] Skenario edge case: ...
- [ ] Skenario negatif: ...
- [ ] Regression: pastikan fitur terkait tidak rusak

Commit Message Format

  • Sebelum membuat commit, selalu tanya kode task kepada user.
  • Format commit message wajib: TASKCODE - deskripsi singkat
    • Contoh: 6D9QD6 - buat api baru
  • Jangan buat commit tanpa kode task dari user.
  • Kode task digunakan untuk sinkronisasi timesheet Odoo.
  • Sebelum push branch kerja, jalankan git fetch origin lalu git rebase origin/master agar branch memakai basis master terbaru.
  • Push branch kerja ke remote lalu buat merge request ke master; proses merge ikuti permission dan alur review repo, jangan direct push ke master kecuali diminta eksplisit.
  • Jangan pernah melakukan git push --force atau varian force-push lain.

Devcpone Sync Hook

  • Repo ini memakai core.hooksPath=.githooks.
  • Sync ke devcpone berjalan saat push branch master lewat .githooks/pre-push.
  • Hook memanggil scripts/devcpone_sync.sh untuk upload diff commit terakhir ke /home/one/project/one/one-api.
  • Jika sync atau verifikasi file remote gagal, push harus ikut gagal; jangan anggap git push sukses lokal sebagai bukti file sudah masuk ke devcpone.
  • Saat user minta cek sinkronisasi, verifikasi langsung file di devcpone, bukan hanya status git lokal.

Cpone Upload (Manual)

  • Upload ke cpone hanya dilakukan saat user secara eksplisit meminta ("upload ke cpone", "sync ke cpone", dll).
  • Jalankan script: scripts/cpone_sync.sh
  • Script menggunakan SSH key ~/.ssh/id_rsa ke one@cpone.aplikasi.web.id.
  • Target remote: /home/one/project/one/one-api.
  • Tidak ada hook otomatis untuk cpone — upload selalu manual atas permintaan user.
  • Sebelum upload, script otomatis backup file lama di folder yang sama dengan suffix timestamp, contoh: Transactionv3.php.20260529_195950.
  • Setelah upload, verifikasi file di server remote, bukan hanya lokal.