deuk-agent-rule 2.4.1 → 2.4.3

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/CHANGELOG.ko.md CHANGED
@@ -6,6 +6,17 @@
6
6
 
7
7
  형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 기반으로 하며, 이 프로젝트는 [유의적 버전(Semantic Versioning)](https://semver.org/spec/v2.0.0.html)을 준수합니다.
8
8
 
9
+ ## [2.4.3] - 2026-04-18
10
+
11
+ ### 변경됨 (Changed)
12
+ - **ticket:** 티켓 ID 포맷을 `NNN-topic-hostname` (예: `001-add-feature-joy-nucb`)으로 변경. 레거시 `ticket_NNN_hostname_topic` 형식 대체
13
+ - **ticket:** INDEX.json 파싱 시 기존 포맷과 신규 포맷 모두 역호환 지원
14
+
15
+ ## [2.4.2] - 2026-04-18
16
+
17
+ ### 수정됨 (Fixed)
18
+ - **ticket:** 파일명(File name)과 본문 내 티켓 ID 생성 로직 간의 불일치(Discrepancy) 해결 (단일 출처로 통합)
19
+
9
20
  ## [2.4.1] - 2026-04-18
10
21
 
11
22
  ### 추가됨 (Added)
package/CHANGELOG.md CHANGED
@@ -4,48 +4,74 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [2.4.1] - 2026-04-18
8
-
9
-
10
- ### Added
11
-
12
- - **cli:** add update notifier for checking latest npm version
13
-
14
-
15
- ### Fixed
16
-
17
- - **ticket:** strictly enforce 8-character limit on hostname slug
18
-
19
-
20
- ### Changed
21
-
22
- - add reasons for global installation
23
- - **changelog:** sync korean changelog with v2.4.0
24
-
25
- ## [2.4.0] - 2026-04-18
26
-
27
-
28
- ### Added
29
-
30
- - **init:** add obsolete template cleanup for cleaner migration
31
- - **rules:** add TICKET VERIFICATION RULE to original agents.md
32
- - **ticket:** add priority property to tickets
33
- - **ticket:** add sequential hostname-aware ticket naming (NNN-hostname-topic)
34
- - **ticket:** auto-sequence numbering and hostname-based naming (limit 8 chars)
35
-
36
-
37
- ### Fixed
38
-
39
- - **rules:** force use of local latest deuk-agent-rule to avoid npx cache issues
40
- - **scripts:** correct log output for OSS repository url example
41
-
42
-
43
- ### Changed
44
-
45
- - add Step 4 (Ticket Verification) to README files
46
- - clarify global installation and OS-specific permissions
47
- - enforce ticket reference in implementation artifacts
48
-
7
+ ## [2.4.3] - 2026-04-18
8
+
9
+ ### Changed
10
+
11
+ - **ticket:** new ID format `NNN-topic-hostname` (e.g. `001-add-feature-joy-nucb`) replacing legacy `ticket_NNN_hostname_topic` format
12
+ - **ticket:** backward-compatible parsing supports both old and new formats in INDEX.json
13
+
14
+ ## [2.4.2] - 2026-04-18
15
+
16
+
17
+ ### Added
18
+
19
+ - **cli:** add update notifier for checking latest npm version
20
+
21
+
22
+ ### Fixed
23
+
24
+ - **ticket:** resolve discrepancy between filename and ticket ID generation
25
+ - **ticket:** strictly enforce 8-character limit on hostname slug
26
+
27
+
28
+ ### Changed
29
+
30
+ - add reasons for global installation
31
+ - **changelog:** sync korean changelog with v2.4.0
32
+
33
+ ## [2.4.1] - 2026-04-18
34
+
35
+
36
+ ### Added
37
+
38
+ - **cli:** add update notifier for checking latest npm version
39
+
40
+
41
+ ### Fixed
42
+
43
+ - **ticket:** strictly enforce 8-character limit on hostname slug
44
+
45
+
46
+ ### Changed
47
+
48
+ - add reasons for global installation
49
+ - **changelog:** sync korean changelog with v2.4.0
50
+
51
+ ## [2.4.0] - 2026-04-18
52
+
53
+
54
+ ### Added
55
+
56
+ - **init:** add obsolete template cleanup for cleaner migration
57
+ - **rules:** add TICKET VERIFICATION RULE to original agents.md
58
+ - **ticket:** add priority property to tickets
59
+ - **ticket:** add sequential hostname-aware ticket naming (NNN-hostname-topic)
60
+ - **ticket:** auto-sequence numbering and hostname-based naming (limit 8 chars)
61
+
62
+
63
+ ### Fixed
64
+
65
+ - **rules:** force use of local latest deuk-agent-rule to avoid npx cache issues
66
+ - **scripts:** correct log output for OSS repository url example
67
+
68
+
69
+ ### Changed
70
+
71
+ - add Step 4 (Ticket Verification) to README files
72
+ - clarify global installation and OS-specific permissions
73
+ - enforce ticket reference in implementation artifacts
74
+
49
75
  ## [2.3.2] - 2026-04-17
50
76
 
51
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deuk-agent-rule",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "DeukAgentRules: generic AGENTS.md + .cursor rule templates with init/merge CLI (npm name: deuk-agent-rule).",
5
5
  "keywords": [
6
6
  "agents-md",
@@ -33,31 +33,14 @@ export async function runTicketCreate(opts) {
33
33
  // Find nearest or create in CWD if missing
34
34
  const ticketDir = detectConsumerTicketDir(opts.cwd, { createIfMissing: true });
35
35
 
36
- // Calculate next sequence number by scanning existing files
37
- let maxSeq = 0;
38
- const allFiles = [];
39
- const scanDirs = [join(ticketDir, "sub"), join(ticketDir, "main"), join(ticketDir, "archive/sub"), join(ticketDir, "archive/main")];
40
- for (const d of scanDirs) {
41
- if (existsSync(d)) {
42
- const files = readdirSync(d);
43
- for (const f of files) {
44
- const match = f.match(/^(\d+)-/);
45
- if (match) {
46
- const num = parseInt(match[1], 10);
47
- if (num > maxSeq) maxSeq = num;
48
- }
49
- }
50
- }
51
- }
52
- const nextSeq = String(maxSeq + 1).padStart(3, "0");
53
- const hName = hostname().toLowerCase().slice(0, 8);
54
- const finalFileName = `${nextSeq}-${hName}-ticket-${topic}.md`;
36
+ const indexJson = readTicketIndexJson(opts.cwd);
37
+ const ticketId = generateTicketId(topic, indexJson.entries);
38
+ const finalFileName = `${ticketId}.md`;
55
39
 
56
40
  const abs = join(ticketDir, group, finalFileName);
57
41
  mkdirSync(join(ticketDir, group), { recursive: true });
58
42
  path = toRepoRelativePath(opts.cwd, abs);
59
43
 
60
- const ticketId = generateTicketId(title);
61
44
  const meta = {
62
45
  id: ticketId,
63
46
  title,
@@ -190,7 +190,7 @@ export function performUpgradeMigration(cwd, opts = {}) {
190
190
  const project = meta.project || detectProjectFromBody(content);
191
191
 
192
192
  const newMeta = {
193
- id: meta.id || `ticket_${statSync(abs).mtimeMs}`,
193
+ id: meta.id || `000-legacy-${statSync(abs).mtimeMs}`,
194
194
  title,
195
195
  status,
196
196
  submodule: meta.submodule || (content.includes("DeukPack") ? "DeukPack" : ""),
@@ -486,20 +486,23 @@ export function getHostnameSlug() {
486
486
 
487
487
  /**
488
488
  * Computes next sequential 3-digit ticket number by scanning all entries
489
- * in the current INDEX.json for IDs matching `ticket_NNN_*`.
490
- * Safe to call cross-device: each hostname produces an independent sequence,
491
- * but the number is always calculated from the current local INDEX state.
489
+ * in the current INDEX.json. Parses both legacy (`ticket_NNN_*`) and
490
+ * new (`NNN-topic-hostname`) formats for backward compatibility.
492
491
  *
493
492
  * @param {object[]} existingEntries - entries array from INDEX.json
494
493
  * @returns {{ num: number, hostname: string }}
495
494
  */
496
495
  export function computeNextTicketNumber(existingEntries) {
497
496
  const hostname = getHostnameSlug();
498
- // Match both old format `ticket_NNN_hostname_*` and new `ticket_NNN_*`
499
- const numRe = /^ticket_(\d{3,})_/;
497
+ // Legacy: ticket_NNN_* | New: NNN-*
498
+ const legacyRe = /^ticket_(\d{3,})_/;
499
+ const newRe = /^(\d{3,})-/;
500
500
  let max = 0;
501
501
  for (const e of (existingEntries || [])) {
502
- const m = String(e.id || '').match(numRe);
502
+ const id = String(e.id || '');
503
+ const mLegacy = id.match(legacyRe);
504
+ const mNew = id.match(newRe);
505
+ const m = mLegacy || mNew;
503
506
  if (m) {
504
507
  const n = parseInt(m[1], 10);
505
508
  if (n > max) max = n;
@@ -510,7 +513,8 @@ export function computeNextTicketNumber(existingEntries) {
510
513
 
511
514
  /**
512
515
  * Sequential hostname-aware ticket ID.
513
- * Format: ticket_NNN_<hostname>_<topic-slug>
516
+ * Format: NNN-<topic-slug>-<hostname>
517
+ * Example: 001-add-feature-joy-nucb
514
518
  * NNN starts at 001 and increments per local INDEX.json state.
515
519
  *
516
520
  * @param {string} topicSlug
@@ -520,7 +524,7 @@ export function generateTicketId(topicSlug, existingEntries) {
520
524
  const { num, hostname } = computeNextTicketNumber(existingEntries);
521
525
  const numStr = String(num).padStart(3, '0');
522
526
  const slug = toSlug(topicSlug || 'ticket').slice(0, 32);
523
- return `ticket_${numStr}_${hostname}_${slug}`;
527
+ return `${numStr}-${slug}-${hostname}`;
524
528
  }
525
529
 
526
530
  /**
@@ -73,7 +73,7 @@ export function formatTimestampForFile(d = new Date()) {
73
73
  }
74
74
 
75
75
  export function makeEntryId() {
76
- return `ticket_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
76
+ return `000-fallback-${Date.now().toString(36)}`;
77
77
  }
78
78
 
79
79
  export function detectProjectFromBody(body) {