jioogen 0.2.9 → 0.2.11

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/dist/index.js CHANGED
@@ -7382,6 +7382,7 @@ var VERIFICATION_HEADING_RE = /^#{1,6}\s*verification(?:\s*command)?\s*$/im;
7382
7382
  var TARGET_FILES_LABEL_RE = /^\s*(?:[-*]\s*)?\*{0,2}(?:targetFiles|target\s*files)\*{0,2}\s*:\s*(.*)$/im;
7383
7383
  var TARGET_FILES_HEADING_RE = /^#{1,6}\s*target\s*files\s*$/im;
7384
7384
  var ACCEPTANCE_HEADING_RE = /^#{1,6}\s*acceptance(?:\s*criteria)?\s*$/im;
7385
+ var SUBTASKS_HEADING_RE = /^#{1,6}\s*subtasks\s*$/im;
7385
7386
  function isCommandLike(cmd) {
7386
7387
  if (cmd === null || cmd === void 0) return false;
7387
7388
  const cleaned = cleanCommand(cmd);
@@ -7640,7 +7641,7 @@ function parsePrd(prd) {
7640
7641
  }
7641
7642
  return { sections, requirementIds, acceptanceIds, featureIds, contractIds, subfeatureIds };
7642
7643
  }
7643
- var TASK_FIELD_LABELS = "id|layer|phase|checkpoint|foundation|dependsOn|dependencies|featureId|feature|cap|subtasks|acceptance|specRef|contracts|moduleId|concernIds|isolationRefs|lifecycleRefs|engineRef|flowRef|tracesTo|subfeatures|subfeatureIds|targetFiles|verificationCommand";
7644
+ var TASK_FIELD_LABELS = "id|layer|phase|checkpoint|foundation|dependsOn|dependencies|featureId|feature|cap|subtasks|acceptance|specRef|contracts|moduleId|concernIds|isolationRefs|lifecycleRefs|engineRef|flowRef|tracesTo|subfeatures|subfeatureIds|targetFiles|verificationCommand|surface|uiStates|responsive|mockSource|mockupRef";
7644
7645
  function normalizeTaskLabels(content) {
7645
7646
  const re = new RegExp(`^\\s*(?:[-*]\\s*)?\\*{0,2}(${TASK_FIELD_LABELS})\\*{0,2}\\s*:`, "gim");
7646
7647
  return content.replace(re, "$1:");
@@ -7700,12 +7701,21 @@ function parseTaskContext(content, taskId2) {
7700
7701
  const contracts = readListField("contracts");
7701
7702
  const concernIds = readListField("concernIds");
7702
7703
  const isolationRefs = readListField("isolationRefs");
7704
+ const flowRef = readListField("flowRef");
7705
+ const lifecycleRefs = readListField("lifecycleRefs");
7706
+ const engineRef = readListField("engineRef");
7707
+ const uiStates = readListField("uiStates");
7703
7708
  const subfeatures = readListField("subfeatures") ?? readListField("subfeatureIds") ?? void 0;
7709
+ const surfaceMatch = normalized.match(/surface:\s*([^\n]+)/i);
7710
+ const surface = surfaceMatch?.[1]?.trim();
7704
7711
  const parsedTargetFiles = taskTargetFiles(content);
7705
7712
  const parsedVerificationCommand = taskVerificationCommand(content);
7706
7713
  const featureMatch = normalized.match(/(?:featureId|feature):\s*([^\n]+)/i);
7707
7714
  const capMatch = normalized.match(/cap:\s*([^\n]+)/i);
7708
- const subtasks = readListField("subtasks");
7715
+ let subtasks = readListField("subtasks");
7716
+ if (subtasks === void 0) {
7717
+ subtasks = followingBlock(content, SUBTASKS_HEADING_RE).split(/\r?\n/).map((line) => /^\s*[-*]\s*(?:\[[ x]\]\s*)?(?:SUB-\d+\s*—\s*)?(.+)$/i.exec(line)?.[1]?.trim()).filter((item) => item !== void 0 && item.length > 0);
7718
+ }
7709
7719
  const moduleIdMatch = normalized.match(/moduleId:\s*([^\n]+)/i);
7710
7720
  const moduleId = moduleIdMatch?.[1]?.trim();
7711
7721
  return {
@@ -7729,6 +7739,11 @@ function parseTaskContext(content, taskId2) {
7729
7739
  ...moduleId && { moduleId },
7730
7740
  ...concernIds && concernIds.length > 0 && { concernIds },
7731
7741
  ...isolationRefs && isolationRefs.length > 0 && { isolationRefs },
7742
+ ...flowRef && flowRef.length > 0 && { flowRef },
7743
+ ...lifecycleRefs && lifecycleRefs.length > 0 && { lifecycleRefs },
7744
+ ...engineRef && engineRef.length > 0 && { engineRef },
7745
+ ...uiStates && uiStates.length > 0 && { uiStates },
7746
+ ...surface !== void 0 && surface.length > 0 && { surface },
7732
7747
  ...tracesTo !== void 0 && { tracesTo },
7733
7748
  ...subfeatures && subfeatures.length > 0 && { subfeatures }
7734
7749
  };
@@ -9564,7 +9579,7 @@ Urutan otoritas: keamanan/a11y inti > PRD/specs > file di sini > default generik
9564
9579
  var EXECUTION_SIDECAR_PATH = "tasks/.execution/state.json";
9565
9580
  var EXECUTION_SIDECAR_VERSION = 1;
9566
9581
  var EXECUTION_SIDECAR_VERSION_V2 = 2;
9567
- var HANDOFF_PROMPT_VERSION = 20;
9582
+ var HANDOFF_PROMPT_VERSION = 22;
9568
9583
  var HANDOFF_AGENT_TOKEN_TTL_SECONDS = 30 * 24 * 3600;
9569
9584
  var HandoffPayloadSchema = external_exports.object({
9570
9585
  promptVersion: external_exports.literal(HANDOFF_PROMPT_VERSION),
@@ -9784,7 +9799,7 @@ var ApiClient = class {
9784
9799
 
9785
9800
  // src/commands.ts
9786
9801
  import { spawn } from "node:child_process";
9787
- import { readdir as readdir7, readFile as readFile10, writeFile as writeFile8 } from "node:fs/promises";
9802
+ import { mkdir as mkdir8, readdir as readdir7, readFile as readFile10, writeFile as writeFile8 } from "node:fs/promises";
9788
9803
  import { join as join10, resolve as resolve6 } from "node:path";
9789
9804
 
9790
9805
  // src/authoring.ts
@@ -10103,6 +10118,12 @@ function formatBundleCheck(check) {
10103
10118
  import { chmod, mkdir as mkdir2, readFile as readFile3, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
10104
10119
  import { homedir } from "node:os";
10105
10120
  import { dirname as dirname2, join as join3, resolve as resolve2 } from "node:path";
10121
+
10122
+ // src/types.ts
10123
+ var UI_QUALITY_MODES = ["auto", "on", "off"];
10124
+
10125
+ // src/config.ts
10126
+ var DEFAULT_UI_QUALITY = "auto";
10106
10127
  var CONFIG_DIR_ENV = "JIOOGEN_CONFIG_DIR";
10107
10128
  var LEGACY_CONFIG_DIR_ENV = "JIOOCODE_CONFIG_DIR";
10108
10129
  var CREDENTIALS_FILE = "credentials.json";
@@ -10194,7 +10215,24 @@ function parseProjectLink(value, bundleDir) {
10194
10215
  const { projectId, apiUrl } = value;
10195
10216
  if (typeof projectId !== "string" || projectId.length === 0) return null;
10196
10217
  if (typeof apiUrl !== "string" || apiUrl.length === 0) return null;
10197
- return { projectId, apiUrl, bundleDir, taskMode: parseTaskMode(value.taskMode) };
10218
+ const execution = isRecord(value.execution) ? value.execution : {};
10219
+ return {
10220
+ projectId,
10221
+ apiUrl,
10222
+ bundleDir,
10223
+ taskMode: parseTaskMode(value.taskMode),
10224
+ execution: {
10225
+ // Legacy links may store the flag at the top level; prefer the nested form.
10226
+ uiQuality: parseUiQuality(execution.uiQuality ?? value.uiQuality)
10227
+ }
10228
+ };
10229
+ }
10230
+ function parseUiQuality(value) {
10231
+ if (value === void 0) return DEFAULT_UI_QUALITY;
10232
+ if (typeof value === "string" && UI_QUALITY_MODES.includes(value)) {
10233
+ return value;
10234
+ }
10235
+ throw new Error(`Project link execution.uiQuality tidak valid: ${String(value)}`);
10198
10236
  }
10199
10237
  function parseTaskMode(value) {
10200
10238
  if (value === void 0) return DEFAULT_TASK_MODE;
@@ -10245,7 +10283,8 @@ async function writeProjectLink(bundleDir, link) {
10245
10283
  {
10246
10284
  projectId: link.projectId,
10247
10285
  apiUrl: link.apiUrl,
10248
- taskMode: link.taskMode ?? DEFAULT_TASK_MODE
10286
+ taskMode: link.taskMode ?? DEFAULT_TASK_MODE,
10287
+ execution: { uiQuality: link.execution?.uiQuality ?? DEFAULT_UI_QUALITY }
10249
10288
  },
10250
10289
  null,
10251
10290
  2
@@ -10254,6 +10293,10 @@ async function writeProjectLink(bundleDir, link) {
10254
10293
  "utf8"
10255
10294
  );
10256
10295
  }
10296
+ async function readUiQuality(bundleDir) {
10297
+ const link = await readProjectLink(resolve2(bundleDir));
10298
+ return link?.execution.uiQuality ?? DEFAULT_UI_QUALITY;
10299
+ }
10257
10300
  async function readTaskMode(bundleDir) {
10258
10301
  const link = await readProjectLink(resolve2(bundleDir));
10259
10302
  return link?.taskMode ?? DEFAULT_TASK_MODE;
@@ -10285,7 +10328,13 @@ var LAYER_RANK = {
10285
10328
  };
10286
10329
  var IN_PROGRESS = ["in_progress", "verifying"];
10287
10330
  var QUALITY_HEADING = "## KUALITAS WAJIB (ringkas; detail di skill bila tersedia)";
10331
+ var BREAKDOWN_HEADING = "## BREAKDOWN WAJIB \u2014 SEBELUM CODING";
10288
10332
  var MAX_CHECKLIST_LINES = 12;
10333
+ var BREAKDOWN_RULES = [
10334
+ "Breakdown ini mengikat: tulis/centang setiap item sebelum mulai edit, dan jangan `task complete` selama ada item tanpa bukti.",
10335
+ "Ini checklist kerja, bukan task baru; task baru hanya diizinkan pada `--mode seed`.",
10336
+ "Pratinjau ulang: `npx jioogen task expand <ref>`."
10337
+ ];
10289
10338
  var UI_SKILLS = ["ui-ux-pro-max", "impeccable"];
10290
10339
  var LAYER_CHECKLISTS = {
10291
10340
  frontend_mock: [
@@ -10425,9 +10474,59 @@ function renderActiveTask(task, context) {
10425
10474
  );
10426
10475
  const checklist = renderQualityChecklist(task.layer, context);
10427
10476
  if (checklist.length > 0) lines.push("", ...checklist);
10477
+ const breakdown = buildTaskBreakdown(task);
10478
+ const breakdownLines = [...breakdown.authored, ...breakdown.derived];
10479
+ if (breakdownLines.length > 0) {
10480
+ lines.push("", BREAKDOWN_HEADING, ...BREAKDOWN_RULES);
10481
+ for (const item of breakdownLines) lines.push(`- [ ] ${item}`);
10482
+ }
10428
10483
  lines.push("", "--- ISI TASK (otoritas scope) ---", task.content, "--- AKHIR ISI TASK ---");
10429
10484
  return lines.join("\n");
10430
10485
  }
10486
+ function buildTaskBreakdown(task) {
10487
+ const context = parseTaskContext(task.content, task.id);
10488
+ const authored = (context.subtasks ?? []).filter((item) => !/^N\/A\b/i.test(item));
10489
+ const derived = [];
10490
+ const seen = /* @__PURE__ */ new Set();
10491
+ const push = (item) => {
10492
+ const key = item.trim().toLowerCase();
10493
+ if (key.length === 0 || seen.has(key)) return;
10494
+ seen.add(key);
10495
+ derived.push(item);
10496
+ };
10497
+ for (const subfeature of context.subfeatures ?? []) {
10498
+ push(`${subfeature} \u2014 petakan ke AC, flow/state, dan targetFiles`);
10499
+ }
10500
+ for (const acceptance of context.acceptance ?? []) {
10501
+ if (/^N\/A\b/i.test(acceptance)) continue;
10502
+ push(`${acceptance} \u2014 penuhi + catat bukti`);
10503
+ }
10504
+ for (const flow of context.flowRef ?? []) {
10505
+ push(`${flow} \u2014 implement alur sampai outcome`);
10506
+ }
10507
+ for (const lifecycle of context.lifecycleRefs ?? []) {
10508
+ push(`Lifecycle ${lifecycle} \u2014 state/transition yang relevan`);
10509
+ }
10510
+ for (const engine of context.engineRef ?? []) {
10511
+ push(`Engine ${engine} \u2014 invariant/keputusan yang dijaga`);
10512
+ }
10513
+ for (const state of context.uiStates ?? []) {
10514
+ push(`UI state ${state} \u2014 render + verifikasi`);
10515
+ }
10516
+ for (const isolation of context.isolationRefs ?? []) {
10517
+ push(`${isolation} \u2014 tegakkan boundary + AC penolakan akses`);
10518
+ }
10519
+ for (const file of context.targetFiles ?? []) {
10520
+ push(`File ${file} \u2014 buat/edit + test terkait`);
10521
+ }
10522
+ if (context.verificationCommand !== null && context.verificationCommand !== void 0) {
10523
+ push(`Verifikasi: \`${context.verificationCommand}\` (wajib exit 0)`);
10524
+ }
10525
+ if (authored.length === 0 && derived.length === 0) {
10526
+ push("Baca task + PRD/specs, lalu tulis langkah kerja eksplisit sebelum edit");
10527
+ }
10528
+ return { authored, derived };
10529
+ }
10431
10530
  function renderQualityChecklist(layer, context) {
10432
10531
  if (context === void 0 || layer === void 0) return [];
10433
10532
  const items = [...LAYER_CHECKLISTS[layer] ?? []];
@@ -11211,6 +11310,7 @@ var SKILL_PACKS = {
11211
11310
  "backend-rules": []
11212
11311
  };
11213
11312
  var HARNESS_MANIFEST_PATH = ".jioogen/harness.json";
11313
+ var CUSTOM_SKILLS_DIR = ".jioogen/custom/skills";
11214
11314
  var HARNESS_SCHEMA_VERSION = 1;
11215
11315
  var FRONTEND_MOCK_LAYER_RE = /^[ \t]*(?:[-*][ \t]+)?layer[ \t]*[:=][ \t]*[`"']?frontend_mock\b/im;
11216
11316
  var MARKER_PREFIX = "<!-- jioogen-execution-skill:";
@@ -11275,12 +11375,13 @@ var JIOOGEN_AGENTS_MD = `${MARKER}
11275
11375
  - Jangan mengubah \`PRD.md\` atau \`specs/\`; itu kontrak, bukan hasil eksekusi.
11276
11376
 
11277
11377
  ## 2. Alur per giliran
11278
- 1. \`npx jioogen task next\` \u2014 baca blok **TASK AKTIF** + isi file task.
11279
- 2. \`npx jioogen task start <ref>\`.
11280
- 3. Implementasikan **hanya** task itu sampai semua Acceptance Criteria terpenuhi.
11281
- 4. Jalankan \`npx jioogen task verify <ref>\` \u2014 CLI menjalankan \`verificationCommand\` dan mencatat bukti exit code.
11282
- 5. \`npx jioogen task complete <ref>\` (ditolak bila belum ada bukti exit 0), lalu buat satu commit git kecil.
11283
- 6. \`npx jioogen sync\`, lalu kembali ke langkah 1.
11378
+ 1. \`npx jioogen task next\` \u2014 baca blok **TASK AKTIF**, **BREAKDOWN WAJIB**, + isi file task.
11379
+ 2. Tulis/centang breakdown (atau simpan dengan \`npx jioogen task expand <ref> --write\`).
11380
+ 3. \`npx jioogen task start <ref>\`.
11381
+ 4. Implementasikan **hanya** task itu sampai semua Acceptance Criteria dan item breakdown terpenuhi.
11382
+ 5. Jalankan \`npx jioogen task verify <ref>\` \u2014 CLI menjalankan \`verificationCommand\` dan mencatat bukti exit code.
11383
+ 6. \`npx jioogen task complete <ref>\` (ditolak bila belum ada bukti exit 0), lalu buat satu commit git kecil.
11384
+ 7. \`npx jioogen sync\`, lalu kembali ke langkah 1.
11284
11385
 
11285
11386
  ## 2b. Pekerjaan yang dibangun di luar harness
11286
11387
 
@@ -11327,13 +11428,18 @@ Catat di \`task complete --note "micro-fix: <ringkas>"\` dan commit message.
11327
11428
  Jika fix mengubah kontrak/scope/data model/keamanan: STOP dan laporkan satu
11328
11429
  ringkasan; jangan dipecah menjadi banyak task.
11329
11430
 
11330
- ## 3d. Breakdown runtime (naratif \u2192 lokal)
11431
+ ## 3d. Breakdown runtime \u2014 WAJIB sebelum coding
11331
11432
 
11332
- Task parent bersifat naratif. Sebelum coding, baca \`PRD.md\`/\`specs/\` + task aktif
11333
- lalu pecah sendiri menjadi checklist lokal.
11334
- - Checklist tidak perlu ditulis ke bundle; \`npx jioogen task expand <ref>\` hanya preview.
11335
- - Jangan menambah task baru atau mengubah \`PRD.md\`/\`specs/\`/\`tasks/\`.
11336
- - Selesai bila \`targetFiles\`, seluruh Acceptance Criteria, dan \`verificationCommand\` parent terpenuhi.
11433
+ Task parent bersifat naratif. \`task next\` menyuntik \`## BREAKDOWN WAJIB\` yang
11434
+ diturunkan dari AC, subfeature, flow/step, lifecycle, engine, UI states,
11435
+ \`targetFiles\`, dan \`verificationCommand\`. Wajib:
11436
+ - Tulis/centang setiap item di breakdown kerja sebelum mulai edit; item tidak boleh dilewati.
11437
+ - \`npx jioogen task expand <ref>\` menampilkan scaffold; \`--write\` menyimpannya
11438
+ (task authored: \`## Subtasks\` di file task; scaffold: \`.jioogen/breakdown/<ref>.md\`).
11439
+ - Breakdown bukan task baru; jangan menambah task atau mengubah
11440
+ \`PRD.md\`/\`specs/\`/\`tasks/\` (task baru hanya pada \`--mode seed\`).
11441
+ - Jangan \`task complete\` selama ada item breakdown tanpa bukti. Selesai bila semua
11442
+ item, \`targetFiles\`, AC, dan \`verificationCommand\` terpenuhi.
11337
11443
 
11338
11444
  ## 4. Verifikasi jujur
11339
11445
  - Pakai test runner yang dideklarasikan di \`specs/\` atau dibuat task scaffold.
@@ -11341,13 +11447,19 @@ lalu pecah sendiri menjadi checklist lokal.
11341
11447
  - Kalau test belum ada, task belum selesai.
11342
11448
  - Bukti verifikasi dicatat CLI lewat \`npx jioogen task verify <ref>\`; \`task complete\` menolak tanpa bukti exit 0.
11343
11449
 
11344
- ## 5. Checkpoint
11345
- Berhenti dan minta konfirmasi user bila task berikutnya berpindah layer, nomor
11346
- \`phase\` naik, task bertanda \`checkpoint: true\`, atau task tergolong berisiko
11347
- (migrasi/schema/akses/izin/integrasi-eksternal/secret/deploy/infra). Jangan lanjut
11348
- sebelum user memutuskan. Setelah user memutuskan, jalankan salah satu:
11349
- \`npx jioogen review --approve\`, \`npx jioogen review --request-changes "<teks>"\`,
11350
- atau \`npx jioogen review --stop\`, lalu \`npx jioogen sync\`.
11450
+ ## 5. Berhenti sebentar untuk konfirmasi
11451
+ Berhenti setelah satu bagian besar selesai, sebelum beralih ke bagian berikutnya,
11452
+ atau sebelum pekerjaan sensitif (data, akses, integrasi eksternal, rahasia,
11453
+ deploy/infra). Jangan pakai istilah teknis saat bertanya. Tanyakan dengan bahasa
11454
+ sehari-hari: "Bagian ini selesai. Silakan cek hasilnya. Mau lanjut, perbaiki dulu,
11455
+ atau batalkan dulu?"
11456
+ - **Lanjut** \u2014 kerjakan bagian berikutnya.
11457
+ - **Perbaiki dulu** \u2014 dengarkan bagian yang salah, perbaiki, lalu tanya lagi.
11458
+ - **Batalkan dulu** \u2014 jangan lanjut; laporkan kondisi saat ini.
11459
+
11460
+ Setelah user memilih, catat di sistem dengan \`npx jioogen review --approve\`,
11461
+ \`--request-changes "<teks>"\`, atau \`--stop\`, lalu \`npx jioogen sync\`. Jangan
11462
+ menampilkan perintah itu sebagai pertanyaan ke user.
11351
11463
 
11352
11464
  ## 6. Skill eksekusi
11353
11465
  Baca skill \`${EXECUTION_SKILL_NAME}\` di awal prompt
@@ -11405,13 +11517,14 @@ atas ide, refactor, perbaikan, atau fitur lain.
11405
11517
 
11406
11518
  ## 2. Siklus per giliran
11407
11519
 
11408
- 1. \`npx jioogen task next\` \u2014 baca TASK AKTIF + isi file task.
11409
- 2. \`npx jioogen task start <ref>\`.
11410
- 3. Implementasikan **hanya** task itu sampai semua Acceptance Criteria terpenuhi.
11411
- 4. Jalankan \`npx jioogen task verify <ref>\` sampai exit 0; CLI mencatat buktinya.
11412
- 5. \`npx jioogen task complete <ref>\` (wajib bukti), lalu buat **satu commit git kecil** untuk
11520
+ 1. \`npx jioogen task next\` \u2014 baca TASK AKTIF, BREAKDOWN WAJIB, + isi file task.
11521
+ 2. Tulis/centang breakdown (atau simpan dengan \`npx jioogen task expand <ref> --write\`).
11522
+ 3. \`npx jioogen task start <ref>\`.
11523
+ 4. Implementasikan **hanya** task itu sampai semua Acceptance Criteria dan item breakdown terpenuhi.
11524
+ 5. Jalankan \`npx jioogen task verify <ref>\` sampai exit 0; CLI mencatat buktinya.
11525
+ 6. \`npx jioogen task complete <ref>\` (wajib bukti), lalu buat **satu commit git kecil** untuk
11413
11526
  task itu (lewati bila folder bukan repo git).
11414
- 6. \`npx jioogen sync\`, lalu kembali ke langkah 1.
11527
+ 7. \`npx jioogen sync\`, lalu kembali ke langkah 1.
11415
11528
 
11416
11529
  ## 2b. Pekerjaan yang dibangun di luar harness
11417
11530
 
@@ -11464,13 +11577,18 @@ Catat di \`task complete --note "micro-fix: <ringkas>"\` dan commit message.
11464
11577
  Jika fix mengubah kontrak/scope/data model/keamanan: STOP dan laporkan satu
11465
11578
  ringkasan; jangan dipecah menjadi banyak task.
11466
11579
 
11467
- ## 3d. Breakdown runtime (naratif \u2192 lokal)
11580
+ ## 3d. Breakdown runtime \u2014 WAJIB sebelum coding
11468
11581
 
11469
- Task parent bersifat naratif. Sebelum coding, baca \`PRD.md\`/\`specs/\` + task aktif
11470
- lalu pecah sendiri menjadi checklist lokal.
11471
- - Checklist tidak perlu ditulis ke bundle; \`npx jioogen task expand <ref>\` hanya preview.
11472
- - Jangan menambah task baru atau mengubah \`PRD.md\`/\`specs/\`/\`tasks/\`.
11473
- - Selesai bila \`targetFiles\`, seluruh Acceptance Criteria, dan \`verificationCommand\` parent terpenuhi.
11582
+ Task parent bersifat naratif. \`task next\` menyuntik \`## BREAKDOWN WAJIB\` yang
11583
+ diturunkan dari AC, subfeature, flow/step, lifecycle, engine, UI states,
11584
+ \`targetFiles\`, dan \`verificationCommand\`. Wajib:
11585
+ - Tulis/centang setiap item di breakdown kerja sebelum mulai edit; item tidak boleh dilewati.
11586
+ - \`npx jioogen task expand <ref>\` menampilkan scaffold; \`--write\` menyimpannya
11587
+ (task authored: \`## Subtasks\` di file task; scaffold: \`.jioogen/breakdown/<ref>.md\`).
11588
+ - Breakdown bukan task baru; jangan menambah task atau mengubah
11589
+ \`PRD.md\`/\`specs/\`/\`tasks/\` (task baru hanya pada \`--mode seed\`).
11590
+ - Jangan \`task complete\` selama ada item breakdown tanpa bukti. Selesai bila semua
11591
+ item, \`targetFiles\`, AC, dan \`verificationCommand\` terpenuhi.
11474
11592
 
11475
11593
  ## 3e. Anti-Bloat & Code Health
11476
11594
 
@@ -11501,18 +11619,21 @@ Tanya: "Apakah senior engineer bilang ini overcomplicated?" Bila ya, sederhanaka
11501
11619
  - Task \`layer: verification\` menjalankan semua \`verificationCommand\`, smoke test
11502
11620
  route/navigasi, cek UI states + responsive, dan verifikasi AC.
11503
11621
 
11504
- ## 5. Checkpoint
11622
+ ## 5. Berhenti sebentar untuk konfirmasi
11505
11623
 
11506
- Berhenti dan minta konfirmasi user bila:
11507
- - task berikutnya berpindah \`layer\` (mis. \`frontend_mock\` \u2192 \`backend_api\`/\`database\`),
11508
- - nomor \`phase\` naik,
11509
- - task bertanda \`checkpoint: true\`,
11510
- - task tergolong berisiko (migrasi/schema/akses/izin/integrasi-eksternal/secret/deploy/infra).
11624
+ Berhenti setelah satu bagian besar selesai, sebelum beralih ke bagian berikutnya,
11625
+ atau sebelum pekerjaan sensitif (data, akses, integrasi eksternal, rahasia,
11626
+ deploy/infra). Jangan pakai istilah teknis saat bertanya. Tanyakan dengan bahasa
11627
+ sehari-hari: "Bagian ini selesai. Silakan cek hasilnya. Mau lanjut, perbaiki dulu,
11628
+ atau batalkan dulu?"
11629
+ - **Lanjut** \u2014 kerjakan bagian berikutnya.
11630
+ - **Perbaiki dulu** \u2014 dengarkan bagian yang salah, perbaiki, lalu tanya lagi.
11631
+ - **Batalkan dulu** \u2014 jangan lanjut; laporkan kondisi saat ini.
11511
11632
 
11512
- Jangan lanjut sebelum user memutuskan. Set \`current.awaitingCheckpoint = true\` di
11513
- sidecar saat berhenti, lalu setelah user memutuskan jalankan
11514
- \`npx jioogen review --approve\` / \`--request-changes "<teks>"\` / \`--stop\`,
11515
- diikuti \`npx jioogen sync\`.
11633
+ Set \`current.awaitingCheckpoint = true\` di sidecar saat berhenti. Setelah user
11634
+ memilih, catat di sistem dengan \`npx jioogen review --approve\`,
11635
+ \`--request-changes "<teks>"\`, atau \`--stop\`, lalu \`npx jioogen sync\`. Jangan
11636
+ menampilkan perintah itu sebagai pertanyaan ke user.
11516
11637
 
11517
11638
  ## 6. Larangan ringkas
11518
11639
 
@@ -11604,7 +11725,7 @@ function parsePack(value) {
11604
11725
  }
11605
11726
  function parseHarnessManifest(value) {
11606
11727
  if (!isRecord2(value)) return null;
11607
- const { schemaVersion, productKind, packs, updatedAt } = value;
11728
+ const { schemaVersion, productKind, packs, custom: custom2, updatedAt } = value;
11608
11729
  if (schemaVersion !== HARNESS_SCHEMA_VERSION) return null;
11609
11730
  if (!isProductKind(productKind)) return null;
11610
11731
  if (!Array.isArray(packs)) return null;
@@ -11614,8 +11735,22 @@ function parseHarnessManifest(value) {
11614
11735
  if (parsed === null) return null;
11615
11736
  parsedPacks.push(parsed);
11616
11737
  }
11738
+ const parsedCustom = [];
11739
+ if (Array.isArray(custom2)) {
11740
+ for (const entry of custom2) {
11741
+ const parsed = parseSkillEntry(entry);
11742
+ if (parsed === null) return null;
11743
+ parsedCustom.push(parsed);
11744
+ }
11745
+ }
11617
11746
  if (typeof updatedAt !== "string" || updatedAt.length === 0) return null;
11618
- return { schemaVersion: HARNESS_SCHEMA_VERSION, productKind, packs: parsedPacks, updatedAt };
11747
+ return {
11748
+ schemaVersion: HARNESS_SCHEMA_VERSION,
11749
+ productKind,
11750
+ packs: parsedPacks,
11751
+ custom: parsedCustom,
11752
+ updatedAt
11753
+ };
11619
11754
  }
11620
11755
  async function readHarnessManifest(bundleDir) {
11621
11756
  const path = join7(resolve3(bundleDir), HARNESS_MANIFEST_PATH);
@@ -11655,8 +11790,15 @@ async function detectProductKind(bundleDir) {
11655
11790
  }
11656
11791
  return "non-ui";
11657
11792
  }
11658
- function packsForProduct(productKind) {
11659
- return productKind === "ui" ? ["baseline", "ui-quality", "backend-rules"] : ["baseline", "backend-rules"];
11793
+ function packsForProduct(productKind, uiQuality = "auto") {
11794
+ const packs = productKind === "ui" ? ["baseline", "ui-quality", "backend-rules"] : ["baseline", "backend-rules"];
11795
+ if (uiQuality === "on" && !packs.includes("ui-quality")) {
11796
+ return [...packs, "ui-quality"];
11797
+ }
11798
+ if (uiQuality === "off") {
11799
+ return packs.filter((pack) => pack !== "ui-quality");
11800
+ }
11801
+ return packs;
11660
11802
  }
11661
11803
  function cliPackageRoot2() {
11662
11804
  return resolve3(dirname5(fileURLToPath2(import.meta.url)), "..");
@@ -11753,8 +11895,85 @@ async function provisionPack(root, pack, prior, written, preserved) {
11753
11895
  }
11754
11896
  return { name: pack, skills, missing };
11755
11897
  }
11756
- function sameManifestBody(manifest, productKind, packs) {
11757
- return manifest.productKind === productKind && JSON.stringify(manifest.packs) === JSON.stringify(packs);
11898
+ async function provisionCustomSkills(root, prior) {
11899
+ const written = [];
11900
+ const preserved = [];
11901
+ const custom2 = [];
11902
+ const conflicts = [];
11903
+ const removed = [];
11904
+ const sources = /* @__PURE__ */ new Set();
11905
+ const base = join7(root, CUSTOM_SKILLS_DIR);
11906
+ const reserved = /* @__PURE__ */ new Set([EXECUTION_SKILL_NAME, ...Object.values(SKILL_PACKS).flat()]);
11907
+ let entries = [];
11908
+ try {
11909
+ entries = await readdir5(base, { withFileTypes: true });
11910
+ } catch (error) {
11911
+ if (!isMissingFile4(error)) throw error;
11912
+ }
11913
+ const names = entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort();
11914
+ for (const name of names) {
11915
+ const source = join7(base, name);
11916
+ if (!await isFile(join7(source, "SKILL.md"))) continue;
11917
+ sources.add(name);
11918
+ if (reserved.has(name)) {
11919
+ conflicts.push(name);
11920
+ continue;
11921
+ }
11922
+ const sha256 = await hashSkillDirectory(source);
11923
+ const previous = prior.find((entry) => entry.name === name);
11924
+ let owned = previous !== void 0;
11925
+ for (const dir of AGENT_SKILL_DIRS) {
11926
+ const targetDir = join7(root, dir, name);
11927
+ const skillMd = join7(targetDir, "SKILL.md");
11928
+ if (await isFile(skillMd)) {
11929
+ const targetHash = await hashSkillDirectory(targetDir);
11930
+ if (previous === void 0) {
11931
+ preserved.push(`${dir}/${name}/SKILL.md`);
11932
+ continue;
11933
+ }
11934
+ if (targetHash === sha256) {
11935
+ owned = true;
11936
+ continue;
11937
+ }
11938
+ if (targetHash === previous.sha256) {
11939
+ await replaceDirectory(source, targetDir);
11940
+ written.push(`${dir}/${name}/SKILL.md`);
11941
+ owned = true;
11942
+ continue;
11943
+ }
11944
+ preserved.push(`${dir}/${name}/SKILL.md`);
11945
+ continue;
11946
+ }
11947
+ await replaceDirectory(source, targetDir);
11948
+ written.push(`${dir}/${name}/SKILL.md`);
11949
+ owned = true;
11950
+ }
11951
+ if (owned) {
11952
+ custom2.push({ name, source: `custom/${name}`, sha256 });
11953
+ } else if (previous !== void 0) {
11954
+ custom2.push(previous);
11955
+ }
11956
+ }
11957
+ for (const entry of prior) {
11958
+ if (sources.has(entry.name) && !reserved.has(entry.name)) continue;
11959
+ if (reserved.has(entry.name)) continue;
11960
+ for (const dir of AGENT_SKILL_DIRS) {
11961
+ const targetDir = join7(root, dir, entry.name);
11962
+ const skillMd = join7(targetDir, "SKILL.md");
11963
+ if (!await isFile(skillMd)) continue;
11964
+ const targetHash = await hashSkillDirectory(targetDir);
11965
+ if (targetHash !== entry.sha256) {
11966
+ preserved.push(`${dir}/${entry.name}/SKILL.md`);
11967
+ continue;
11968
+ }
11969
+ await rm5(targetDir, { recursive: true, force: true });
11970
+ removed.push(`${dir}/${entry.name}/SKILL.md`);
11971
+ }
11972
+ }
11973
+ return { custom: custom2, conflicts, removed, written, preserved };
11974
+ }
11975
+ function sameManifestBody(manifest, productKind, packs, custom2) {
11976
+ return manifest.productKind === productKind && JSON.stringify(manifest.packs) === JSON.stringify(packs) && JSON.stringify(manifest.custom) === JSON.stringify(custom2);
11758
11977
  }
11759
11978
  async function provisionSkillPacks(bundleDir, packNames, productKind) {
11760
11979
  const root = resolve3(bundleDir);
@@ -11766,20 +11985,27 @@ async function provisionSkillPacks(bundleDir, packNames, productKind) {
11766
11985
  const prior = existing?.packs.find((entry) => entry.name === pack);
11767
11986
  packs.push(await provisionPack(root, pack, prior, written, preserved));
11768
11987
  }
11769
- const changed = existing === null || !sameManifestBody(existing, productKind, packs);
11988
+ const custom2 = await provisionCustomSkills(root, existing?.custom ?? []);
11989
+ written.push(...custom2.written);
11990
+ preserved.push(...custom2.preserved);
11991
+ const changed = existing === null || !sameManifestBody(existing, productKind, packs, custom2.custom);
11770
11992
  const manifest = {
11771
11993
  schemaVersion: HARNESS_SCHEMA_VERSION,
11772
11994
  productKind,
11773
11995
  packs,
11996
+ custom: custom2.custom,
11774
11997
  updatedAt: changed ? (/* @__PURE__ */ new Date()).toISOString() : existing?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString()
11775
11998
  };
11776
11999
  const harnessPath = await writeHarnessManifest(root, manifest);
11777
12000
  return {
11778
12001
  written,
11779
12002
  preserved,
12003
+ removed: custom2.removed,
11780
12004
  productKind,
11781
12005
  packs,
12006
+ custom: custom2.custom,
11782
12007
  missing: packs.flatMap((pack) => pack.missing),
12008
+ conflicts: custom2.conflicts,
11783
12009
  harnessPath
11784
12010
  };
11785
12011
  }
@@ -11823,20 +12049,35 @@ async function installAgentSkills(bundleDir, options = {}) {
11823
12049
  if (gitignore !== null) written.push(gitignore);
11824
12050
  written.push(...await ensureCustomScaffold(root));
11825
12051
  if (options.noSkills === true) {
11826
- return { written, preserved, productKind, packs: [], missing: [], harnessPath };
12052
+ return {
12053
+ written,
12054
+ preserved,
12055
+ removed: [],
12056
+ productKind,
12057
+ packs: [],
12058
+ custom: [],
12059
+ missing: [],
12060
+ conflicts: [],
12061
+ harnessPath
12062
+ };
11827
12063
  }
12064
+ const uiQuality = options.uiQuality ?? await readUiQuality(root);
11828
12065
  const current = await readHarnessManifest(root);
12066
+ const priorPacks = current?.packs.map((pack) => pack.name) ?? [];
11829
12067
  const requested = options.packs ?? packNamesInCanonicalOrder([
11830
- ...packsForProduct(productKind),
11831
- ...current?.packs.map((pack) => pack.name) ?? []
12068
+ ...packsForProduct(productKind, uiQuality),
12069
+ ...priorPacks.filter((pack) => !(uiQuality === "off" && pack === "ui-quality"))
11832
12070
  ]);
11833
12071
  const provision = await provisionSkillPacks(root, requested, productKind);
11834
12072
  return {
11835
12073
  written: [...written, ...provision.written],
11836
12074
  preserved: [...preserved, ...provision.preserved],
12075
+ removed: provision.removed,
11837
12076
  productKind,
11838
12077
  packs: provision.packs,
12078
+ custom: provision.custom,
11839
12079
  missing: provision.missing,
12080
+ conflicts: provision.conflicts,
11840
12081
  harnessPath: provision.harnessPath
11841
12082
  };
11842
12083
  }
@@ -12979,8 +13220,17 @@ async function pullCommand(projectId, options) {
12979
13220
  const written = await extractBundle(bytes, target);
12980
13221
  await clearBaseline(target).catch(() => {
12981
13222
  });
12982
- const skills = await installAgentSkills(target, { noSkills: skillsDisabled(options) });
12983
- await writeProjectLink(target, { projectId, apiUrl, taskMode: options.taskMode });
13223
+ const uiQuality = options.uiQuality ?? await readUiQuality(target);
13224
+ const skills = await installAgentSkills(target, {
13225
+ noSkills: skillsDisabled(options),
13226
+ uiQuality
13227
+ });
13228
+ await writeProjectLink(target, {
13229
+ projectId,
13230
+ apiUrl,
13231
+ taskMode: options.taskMode,
13232
+ execution: { uiQuality }
13233
+ });
12984
13234
  if (options.json === true) {
12985
13235
  console.log(JSON.stringify({ projectId, target, files: written, skills }, null, 2));
12986
13236
  return;
@@ -12988,7 +13238,7 @@ async function pullCommand(projectId, options) {
12988
13238
  console.log(`Pulled ${written.length} file ke ${target}`);
12989
13239
  console.log("Project ter-bind lewat .jioogen/project.json.");
12990
13240
  console.log(`Skills eksekusi terpasang: ${skills.written.length} file.`);
12991
- printSkillPacks(skills.packs, skills.missing);
13241
+ printSkillPacks(skills.packs, skills.missing, skills.custom, skills.conflicts);
12992
13242
  }
12993
13243
  async function linkCommand(projectId, options) {
12994
13244
  const { apiUrl, client } = await resolveApi(options);
@@ -12996,8 +13246,17 @@ async function linkCommand(projectId, options) {
12996
13246
  await assertLinkTarget(target, projectId);
12997
13247
  await verifyProjectAccess(client, projectId);
12998
13248
  const taskMode = options.taskMode ?? await readTaskMode(target);
12999
- await writeProjectLink(target, { projectId, apiUrl, taskMode });
13000
- const skills = await installAgentSkills(target, { noSkills: skillsDisabled(options) });
13249
+ const uiQuality = options.uiQuality ?? await readUiQuality(target);
13250
+ await writeProjectLink(target, {
13251
+ projectId,
13252
+ apiUrl,
13253
+ taskMode,
13254
+ execution: { uiQuality }
13255
+ });
13256
+ const skills = await installAgentSkills(target, {
13257
+ noSkills: skillsDisabled(options),
13258
+ uiQuality
13259
+ });
13001
13260
  const linkedFile = join10(target, ".jioogen", "project.json");
13002
13261
  if (options.json === true) {
13003
13262
  console.log(JSON.stringify({ projectId, target, apiUrl, linkedFile, skills }, null, 2));
@@ -13006,7 +13265,7 @@ async function linkCommand(projectId, options) {
13006
13265
  console.log(`Project ${projectId} ter-bind ke ${target}.`);
13007
13266
  console.log(`File link: ${linkedFile} (API ${apiUrl}).`);
13008
13267
  console.log(`Skills eksekusi terpasang: ${skills.written.length} file.`);
13009
- printSkillPacks(skills.packs, skills.missing);
13268
+ printSkillPacks(skills.packs, skills.missing, skills.custom, skills.conflicts);
13010
13269
  await printPreExistingScope(target, projectId);
13011
13270
  }
13012
13271
  async function printPreExistingScope(bundleDir, projectId) {
@@ -13027,7 +13286,11 @@ async function printPreExistingScope(bundleDir, projectId) {
13027
13286
  }
13028
13287
  async function skillsInstallCommand(options) {
13029
13288
  const bundleDir = await resolveSkillsBundleDir(options);
13030
- const skills = await installAgentSkills(bundleDir, { noSkills: skillsDisabled(options) });
13289
+ const uiQuality = options.uiQuality ?? await readUiQuality(bundleDir);
13290
+ const skills = await installAgentSkills(bundleDir, {
13291
+ noSkills: skillsDisabled(options),
13292
+ uiQuality
13293
+ });
13031
13294
  if (options.json === true) {
13032
13295
  console.log(JSON.stringify({ bundleDir, ...skills }, null, 2));
13033
13296
  return;
@@ -13035,15 +13298,17 @@ async function skillsInstallCommand(options) {
13035
13298
  console.log(`Skills eksekusi terpasang di ${bundleDir}:`);
13036
13299
  for (const file of skills.written) console.log(`- ${file}`);
13037
13300
  for (const file of skills.preserved) console.log(`- ${file} (dilewati: milik user)`);
13038
- printSkillPacks(skills.packs, skills.missing);
13301
+ printSkillPacks(skills.packs, skills.missing, skills.custom, skills.conflicts);
13039
13302
  }
13040
13303
  async function skillsListCommand(options) {
13041
13304
  const bundleDir = await resolveSkillsBundleDir(options);
13042
13305
  const manifest = await readHarnessManifest(bundleDir);
13306
+ const uiQuality = await readUiQuality(bundleDir);
13043
13307
  if (options.json === true) {
13044
- console.log(JSON.stringify({ bundleDir, harness: manifest }, null, 2));
13308
+ console.log(JSON.stringify({ bundleDir, uiQuality, harness: manifest }, null, 2));
13045
13309
  return;
13046
13310
  }
13311
+ console.log(`UI/UX quality: ${uiQuality}`);
13047
13312
  if (manifest === null) {
13048
13313
  console.log(`Belum ada skill pack terpasang di ${bundleDir}.`);
13049
13314
  return;
@@ -13058,6 +13323,12 @@ async function skillsListCommand(options) {
13058
13323
  for (const name of pack.missing) console.log(`- ${name} (missing)`);
13059
13324
  if (pack.skills.length === 0 && pack.missing.length === 0) console.log("- (tidak ada skill)");
13060
13325
  }
13326
+ if (manifest.custom.length > 0) {
13327
+ console.log("custom:");
13328
+ for (const skill of manifest.custom) {
13329
+ console.log(`- ${skill.name} (installed, ${skill.sha256.slice(0, 12)})`);
13330
+ }
13331
+ }
13061
13332
  }
13062
13333
  async function skillsAddCommand(packArgument, options) {
13063
13334
  const packNames = parseSkillPackArgument(packArgument);
@@ -13071,7 +13342,7 @@ async function skillsAddCommand(packArgument, options) {
13071
13342
  return;
13072
13343
  }
13073
13344
  console.log(`Skill pack ditambahkan ke ${bundleDir}: ${result.added.join(", ")}`);
13074
- printSkillPacks(result.packs, result.missing);
13345
+ printSkillPacks(result.packs, result.missing, result.custom, result.conflicts);
13075
13346
  }
13076
13347
  async function skillsUpdateCommand(options) {
13077
13348
  const bundleDir = await resolveSkillsBundleDir(options);
@@ -13089,7 +13360,7 @@ async function skillsUpdateCommand(options) {
13089
13360
  return;
13090
13361
  }
13091
13362
  console.log(`Skill pack diperbarui di ${bundleDir}.`);
13092
- printSkillPacks(result.packs, result.missing);
13363
+ printSkillPacks(result.packs, result.missing, result.custom, result.conflicts);
13093
13364
  }
13094
13365
  async function skillsRemoveCommand(packArgument, options) {
13095
13366
  const packNames = parseSkillPackArgument(packArgument);
@@ -13112,13 +13383,21 @@ async function resolveSkillsBundleDir(options) {
13112
13383
  const link = await findProjectLink(options.dir ?? process.cwd());
13113
13384
  return resolve6(link?.bundleDir ?? options.dir ?? process.cwd());
13114
13385
  }
13115
- function printSkillPacks(packs, missing) {
13116
- if (packs.length === 0 && missing.length === 0) return;
13386
+ function printSkillPacks(packs, missing, custom2 = [], conflicts = []) {
13387
+ if (packs.length === 0 && missing.length === 0 && custom2.length === 0) return;
13117
13388
  const installed = packs.filter((pack) => pack.skills.length > 0).map((pack) => `${pack.name} (${pack.skills.map((skill) => skill.name).join(", ")})`);
13118
13389
  if (installed.length > 0) console.log(`Skill pack: ${installed.join("; ")}.`);
13390
+ if (custom2.length > 0) {
13391
+ console.log(`Skill custom: ${custom2.map((entry) => entry.name).join(", ")}.`);
13392
+ }
13119
13393
  if (missing.length > 0) {
13120
13394
  console.warn(`Peringatan: skill tidak ditemukan (dilewati): ${missing.join(", ")}.`);
13121
13395
  }
13396
+ if (conflicts.length > 0) {
13397
+ console.warn(
13398
+ `Peringatan: skill custom bentrok dengan skill bawaan (dilewati): ${conflicts.join(", ")}.`
13399
+ );
13400
+ }
13122
13401
  }
13123
13402
  async function checkCommand(options) {
13124
13403
  const link = await findProjectLink(options.dir ?? process.cwd());
@@ -13336,34 +13615,6 @@ Status: ${next.state.status} \u2014 silakan ulangi.`);
13336
13615
  Progress: ${written.counts?.done ?? 0}/${definitions.length} task selesai.`);
13337
13616
  for (const finding of drift) console.warn(formatDrift(finding));
13338
13617
  }
13339
- function extractSubtasks(content) {
13340
- const inline = /^\s*subtasks\s*:\s*\[([^\]]*)\]/im.exec(content)?.[1];
13341
- if (inline !== void 0) {
13342
- return inline.split(",").map((item) => item.trim().replace(/^["']|["']$/g, "")).filter((item) => item.length > 0);
13343
- }
13344
- const block = /^\s*subtasks\s*:\s*(?:\r?\n)((?:\s*-\s*[^\n]+\r?\n?)+)/im.exec(content)?.[1];
13345
- if (block !== void 0) {
13346
- return block.split(/\r?\n/).map((line) => line.replace(/^\s*-\s*/, "").trim()).filter((item) => item.length > 0);
13347
- }
13348
- const section3 = /^##\s+Subtasks\s*$([\s\S]*?)(?=^##\s|$)/im.exec(content)?.[1];
13349
- if (section3 !== void 0) {
13350
- return section3.split(/\r?\n/).map((line) => /^\s*-\s*\[[ x]\]\s*(?:SUB-\d+\s*—\s*)?(.+)$/i.exec(line)?.[1]?.trim()).filter((item) => item !== void 0 && item.length > 0);
13351
- }
13352
- const plain = /^\s*Subtasks\s*:\s*$/im.exec(content);
13353
- if (plain === null) return [];
13354
- const after = content.slice((plain.index ?? 0) + plain[0].length);
13355
- const items = [];
13356
- for (const line of after.split(/\r?\n/)) {
13357
- const item = /^\s*[-*]\s*(?:\[[ x]\]\s*)?(.+)$/i.exec(line)?.[1]?.trim();
13358
- if (item !== void 0 && item.length > 0) {
13359
- items.push(item);
13360
- continue;
13361
- }
13362
- if (line.trim().length === 0) continue;
13363
- break;
13364
- }
13365
- return items;
13366
- }
13367
13618
  async function taskExpandCommand(ref, options) {
13368
13619
  const local = await withLocalState(options, async (value) => value);
13369
13620
  const key = ref.trim().toUpperCase();
@@ -13372,32 +13623,55 @@ async function taskExpandCommand(ref, options) {
13372
13623
  );
13373
13624
  if (definition === void 0) throw new Error(`Task ${ref} tidak ditemukan.`);
13374
13625
  const cap = /^\s*cap:\s*(CAP-[A-Z0-9-]+)/im.exec(definition.content)?.[1];
13375
- const subtasks = extractSubtasks(definition.content);
13376
- if (subtasks.length === 0) {
13626
+ const breakdown = buildTaskBreakdown(definition);
13627
+ const authored = breakdown.authored;
13628
+ const items = authored.length > 0 ? authored : breakdown.derived;
13629
+ if (items.length === 0) {
13377
13630
  console.log(
13378
- `Task ${definition.id} belum punya subtasks. Tambahkan \`subtasks: [...]\` atau \`## Subtasks\`.`
13631
+ `Task ${definition.id} belum punya metadata breakdown. Tambahkan \`subtasks\`, \`acceptance\`, atau \`targetFiles\`.`
13379
13632
  );
13380
13633
  return;
13381
13634
  }
13382
- const section3 = `## Subtasks
13635
+ const prefix = authored.length > 0 ? "SUB" : "BD";
13636
+ const section3 = `## ${authored.length > 0 ? "Subtasks" : "Breakdown"}
13383
13637
 
13384
- ${subtasks.map((item, index) => `- [ ] SUB-${String(index + 1).padStart(2, "0")} \u2014 ${item}`).join("\n")}
13638
+ ${items.map((item, index) => `- [ ] ${prefix}-${String(index + 1).padStart(2, "0")} \u2014 ${item}`).join("\n")}
13385
13639
  `;
13386
13640
  console.log(`Task ${definition.id} \u2014 ${definition.title}`);
13387
13641
  if (cap !== void 0) console.log(`CAP: ${cap}`);
13388
13642
  console.log(section3);
13389
13643
  if (options.write !== true) {
13390
- console.log("Preview saja. Tambahkan `--write` untuk menulis checklist ke file task.");
13644
+ console.log(
13645
+ "Preview saja. Tambahkan `--write` untuk menyimpan checklist (task authored: ke file task; scaffold: ke `.jioogen/breakdown/`)."
13646
+ );
13391
13647
  return;
13392
13648
  }
13393
- const path = join10(local.bundleDir, "tasks", definition.file);
13394
- const current = await readFile10(path, "utf8");
13395
- const stripped = current.replace(/\n##\s+Subtasks\b[\s\S]*?(?=\n##\s|$)/i, "").replace(/\n{3,}/g, "\n\n");
13396
- await writeFile8(path, `${stripped.trimEnd()}
13649
+ if (authored.length > 0) {
13650
+ const path2 = join10(local.bundleDir, "tasks", definition.file);
13651
+ const current = await readFile10(path2, "utf8");
13652
+ const stripped = current.replace(/\n##\s+Subtasks\b[\s\S]*?(?=\n##\s|$)/i, "").replace(/\n{3,}/g, "\n\n");
13653
+ await writeFile8(path2, `${stripped.trimEnd()}
13397
13654
 
13398
13655
  ${section3}`, "utf8");
13656
+ console.log(
13657
+ `Ditulis ke tasks/${definition.file}. Parent task tetap satu; checklist tidak menambah task count.`
13658
+ );
13659
+ return;
13660
+ }
13661
+ const dir = join10(local.bundleDir, ".jioogen", "breakdown");
13662
+ const path = join10(dir, `${definition.id}.md`);
13663
+ await mkdir8(dir, { recursive: true });
13664
+ await writeFile8(
13665
+ path,
13666
+ `# Breakdown ${definition.id} \u2014 ${definition.title}
13667
+
13668
+ ${section3}
13669
+ > Scaffold deterministik dari metadata task. Boleh ditambah detail, tapi item di atas tidak boleh dilewati.
13670
+ `,
13671
+ "utf8"
13672
+ );
13399
13673
  console.log(
13400
- `Ditulis ke tasks/${definition.file}. Parent task tetap satu; checklist tidak menambah task count.`
13674
+ `Ditulis ke .jioogen/breakdown/${definition.id}.md. Ini checklist lokal; task count tidak berubah.`
13401
13675
  );
13402
13676
  }
13403
13677
  async function taskStartCommand(ref, options) {
@@ -14150,7 +14424,7 @@ async function authoringRemoveCommand(options) {
14150
14424
  }
14151
14425
 
14152
14426
  // src/index.ts
14153
- var VERSION = "0.2.9";
14427
+ var VERSION = "0.2.11";
14154
14428
  function parseTaskModeOption(value) {
14155
14429
  if (value === void 0) return void 0;
14156
14430
  const parsed = TaskModeSchema.safeParse(value);
@@ -14159,6 +14433,11 @@ function parseTaskModeOption(value) {
14159
14433
  }
14160
14434
  return parsed.data;
14161
14435
  }
14436
+ function parseUiQualityOption(value) {
14437
+ if (value === void 0) return void 0;
14438
+ if (UI_QUALITY_MODES.includes(value)) return value;
14439
+ throw new UsageError(`--ui-quality harus salah satu: ${UI_QUALITY_MODES.join(", ")}`);
14440
+ }
14162
14441
  var USAGE = `jioogen \u2014 CLI JiooGen (task selection lokal, server read-only)
14163
14442
 
14164
14443
  Usage:
@@ -14167,9 +14446,9 @@ Usage:
14167
14446
  jioogen logout
14168
14447
  jioogen whoami
14169
14448
  jioogen projects
14170
- jioogen pull <projectId> [--dir <dir>] [--force] [--no-skills] [--mode <mode>]
14171
- jioogen link <projectId> [--dir <dir>] [--no-skills] [--mode <mode>]
14172
- jioogen skills install [--dir <dir>] [--no-skills]
14449
+ jioogen pull <projectId> [--dir <dir>] [--force] [--no-skills] [--mode <mode>] [--ui-quality <auto|on|off>]
14450
+ jioogen link <projectId> [--dir <dir>] [--no-skills] [--mode <mode>] [--ui-quality <auto|on|off>]
14451
+ jioogen skills install [--dir <dir>] [--no-skills] [--ui-quality <auto|on|off>]
14173
14452
  jioogen skills list [--dir <dir>] [--json]
14174
14453
  jioogen skills add <baseline|ui-quality|backend-rules|all> [--dir <dir>]
14175
14454
  jioogen skills update [--dir <dir>]
@@ -14209,6 +14488,7 @@ async function main() {
14209
14488
  let raw = {};
14210
14489
  let positionals = [];
14211
14490
  let taskMode;
14491
+ let uiQuality;
14212
14492
  try {
14213
14493
  const parsed = parseArgs({
14214
14494
  args: process.argv.slice(2),
@@ -14225,6 +14505,7 @@ async function main() {
14225
14505
  force: { type: "boolean" },
14226
14506
  "no-skills": { type: "boolean" },
14227
14507
  mode: { type: "string" },
14508
+ "ui-quality": { type: "string" },
14228
14509
  "no-sync": { type: "boolean" },
14229
14510
  files: { type: "string" },
14230
14511
  note: { type: "string" },
@@ -14243,6 +14524,7 @@ async function main() {
14243
14524
  raw = parsed.values;
14244
14525
  positionals = parsed.positionals;
14245
14526
  taskMode = parseTaskModeOption(text(raw.mode));
14527
+ uiQuality = parseUiQualityOption(text(raw["ui-quality"]));
14246
14528
  } catch (error) {
14247
14529
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}
14248
14530
  `);
@@ -14272,7 +14554,8 @@ async function main() {
14272
14554
  json: flag(raw.json),
14273
14555
  write: flag(raw.write),
14274
14556
  visual: text(raw.visual),
14275
- taskMode
14557
+ taskMode,
14558
+ uiQuality
14276
14559
  };
14277
14560
  if (flag(raw.version)) {
14278
14561
  console.log(`jioogen ${VERSION}`);