projectops 4.104.6 → 4.104.8

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 (85) hide show
  1. package/README.md +1 -1
  2. package/bin/projectops.js +4 -4
  3. package/package.json +1 -1
  4. package/src/cli/args.js +43 -43
  5. package/src/cli/errors.js +8 -8
  6. package/src/cli/help.js +4 -4
  7. package/src/commands/doctor.js +39 -39
  8. package/src/commands/full.js +29 -29
  9. package/src/commands/interactive.js +86 -86
  10. package/src/commands/issues.js +5 -5
  11. package/src/commands/skills.js +13 -13
  12. package/src/commands/version.js +8 -8
  13. package/src/commands/workflows.js +23 -22
  14. package/src/context.js +24 -24
  15. package/src/core/agent-guide.js +5 -5
  16. package/src/core/assets.js +11 -11
  17. package/src/core/baseline.js +24 -24
  18. package/src/core/branch-sub.js +23 -23
  19. package/src/core/breaking-check.js +21 -21
  20. package/src/core/breaking.js +6 -6
  21. package/src/core/ci-minutes-sub.js +13 -13
  22. package/src/core/constants.js +17 -17
  23. package/src/core/copy/coderabbit.js +10 -10
  24. package/src/core/copy/gitignore.js +9 -9
  25. package/src/core/copy/readme.js +7 -7
  26. package/src/core/copy/simple.js +35 -35
  27. package/src/core/copy/util.js +9 -9
  28. package/src/core/copy/workflows.js +99 -99
  29. package/src/core/detect-fs.js +21 -21
  30. package/src/core/detect.js +12 -12
  31. package/src/core/development-branch.js +11 -11
  32. package/src/core/exclusions.js +12 -12
  33. package/src/core/fsutil.js +9 -9
  34. package/src/core/git-branch.js +11 -11
  35. package/src/core/ide/adapter.js +23 -23
  36. package/src/core/ide/adapters/claude.js +12 -12
  37. package/src/core/ide/adapters/codex.js +4 -4
  38. package/src/core/ide/adapters/copilot.js +12 -12
  39. package/src/core/ide/adapters/cursor.js +7 -7
  40. package/src/core/ide/adapters/gemini.js +5 -5
  41. package/src/core/ide/adapters/pi-common.js +12 -12
  42. package/src/core/ide/adapters/pi-harness.js +7 -7
  43. package/src/core/ide/adapters/pi.js +3 -3
  44. package/src/core/ide/home-skills.js +6 -6
  45. package/src/core/ide/legacy.js +8 -8
  46. package/src/core/ide/registry.js +6 -6
  47. package/src/core/ide/runner.js +15 -15
  48. package/src/core/ide/skills-copy.js +34 -34
  49. package/src/core/ide/stable-entry.js +11 -11
  50. package/src/core/ide/util.js +4 -4
  51. package/src/core/incoming.js +13 -13
  52. package/src/core/label-style.js +12 -12
  53. package/src/core/migration-guide.js +19 -19
  54. package/src/core/migrations/index.js +16 -16
  55. package/src/core/migrations/registry.js +39 -39
  56. package/src/core/migrations/rules/legacy-dirs.js +6 -6
  57. package/src/core/migrations/rules/obsolete-workflows.js +4 -4
  58. package/src/core/migrations/rules/root-files.js +3 -3
  59. package/src/core/migrations/rules/settings-extractors.js +8 -8
  60. package/src/core/options-ask.js +104 -104
  61. package/src/core/options-schema.js +23 -23
  62. package/src/core/orphan-workflows.js +14 -14
  63. package/src/core/paths-resolve.js +54 -54
  64. package/src/core/paths.js +2 -2
  65. package/src/core/placeholder-triggers.js +10 -10
  66. package/src/core/repo-language.js +10 -10
  67. package/src/core/resolve-options.js +30 -30
  68. package/src/core/run-trace.js +54 -54
  69. package/src/core/store-locales-hint.js +13 -13
  70. package/src/core/verify.js +27 -27
  71. package/src/core/version-yml.js +117 -116
  72. package/src/core/wizard-env.js +42 -42
  73. package/src/core/wizard-labels.js +31 -31
  74. package/src/core/workflow-groups.js +14 -14
  75. package/src/i18n/core.en.js +1 -1
  76. package/src/i18n/doctor.en.js +1 -1
  77. package/src/i18n/ide.en.js +1 -1
  78. package/src/i18n/migrate.en.js +1 -1
  79. package/src/i18n/options.en.js +1 -1
  80. package/src/index.js +60 -60
  81. package/src/ui/ansi.js +5 -5
  82. package/src/ui/env-plan.js +44 -44
  83. package/src/ui/prompts.js +21 -21
  84. package/src/ui/readline-engine.js +38 -38
  85. package/src/ui/skills-prompts.js +4 -4
@@ -1,5 +1,5 @@
1
- // breaking-changes 확인 흐름 배선.
2
- // collectBreaking(순수 비교)은 breaking.js — 이 모듈은 로드(원격→clone본 폴백)·표시·확인 게이트.
1
+ // Wiring for the breaking-changes check flow.
2
+ // collectBreaking (pure comparison) lives in breaking.js — this module handles loading (remote → cloned copy fallback), display and the confirm gate.
3
3
  import { readFileSync, existsSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { collectBreaking, localizeBreakingEntry } from "./breaking.js";
@@ -9,33 +9,33 @@ import { TEMPLATE_RAW_URL } from "./paths.js";
9
9
 
10
10
  const BC_URL = `${TEMPLATE_RAW_URL}/.github/config/breaking-changes.json`;
11
11
 
12
- // 원격 우선(3초 타임아웃) → clone된 템플릿의 번들본 폴백 → 둘 다 실패 시 null(조용히 스킵)
12
+ // Remote first (3s timeout) → bundled copy in the cloned template → null if both fail (skip silently)
13
13
  export async function loadBreakingJson(tempDir) {
14
14
  try {
15
15
  const res = await fetch(BC_URL, { signal: AbortSignal.timeout(3000) });
16
16
  if (res.ok) return await res.json();
17
- } catch { /* 원격 실패 — 폴백 */ }
17
+ } catch { /* Remote failed — fall back */ }
18
18
  try {
19
19
  const p = join(tempDir, ".github", "config", "breaking-changes.json");
20
20
  if (existsSync(p)) return JSON.parse(readFileSync(p, "utf8"));
21
- } catch { /* 폴백 실패 — 스킵 */ }
21
+ } catch { /* Fallback failed — skip */ }
22
22
  return null;
23
23
  }
24
24
 
25
- // 반환: true=진행, false=사용자 취소.
25
+ // Returns true = proceed, false = cancelled by the user.
26
26
  // opts:
27
- // cwd - 통합 대상 루트 (기존 version.yml에서 현재 템플릿 버전 읽음)
28
- // tempDir - clone된 템플릿 (번들 폴백용)
29
- // templateVersion - 설치하려는 템플릿 버전 (고정 DEFAULT_VERSION 아님 — 설계 D2)
30
- // askYesNo - async(message, defaultYes)→bool. null이면 비대화형: 경고만 출력 후 진행
31
- // loader - 테스트 주입용 (기본 loadBreakingJson)
32
- // onItems - (#493) 통과 구간 항목 콜백 ({current, target, critical, warnings}) —
33
- // 마이그레이션 가이드가 조치 방법 전문을 임베드하는 데 쓴다 (표시 여부와 무관하게 호출)
27
+ // cwd - integration target root (reads the current template version from the existing version.yml)
28
+ // tempDir - cloned template (for the bundled fallback)
29
+ // templateVersion - template version being installed (not the fixed DEFAULT_VERSION — design D2)
30
+ // askYesNo - async(message, defaultYes)→bool. null means non-interactive: print a warning and proceed
31
+ // loader - test injection (default loadBreakingJson)
32
+ // onItems - (#493) callback with the entries in range ({current, target, critical, warnings}) —
33
+ // the migration guide embeds the full action steps from it (called whether or not shown)
34
34
  export async function runBreakingCheck({ cwd, tempDir, templateVersion, askYesNo = null, loader = loadBreakingJson, onItems = null }) {
35
35
  const vy = join(cwd, "version.yml");
36
- if (!existsSync(vy)) return true; // 신규 통합 — 비교 기준 없음
36
+ if (!existsSync(vy)) return true; // New integration — nothing to compare with
37
37
  const { templateVersion: current } = parseExisting(readFileSync(vy, "utf8"));
38
- if (!current) return true; // 템플릿 메타 없음(unknown) — 스킵
38
+ if (!current) return true; // No template metadata (unknown) — skip
39
39
 
40
40
  const json = await loader(tempDir);
41
41
  if (!json) return true;
@@ -44,10 +44,10 @@ export async function runBreakingCheck({ cwd, tempDir, templateVersion, askYesNo
44
44
  if (critical.length || warnings.length) onItems?.({ current, target: templateVersion, critical, warnings });
45
45
  if (critical.length === 0 && warnings.length === 0) return true;
46
46
 
47
- // 요약 리스트 표시 (#473 — 전문 통덤프는 벽글이 되어 정작 CRITICAL이 안 읽혔고,
48
- // 긴 본문 래핑이 ║ 박스 경계를 붕괴시켰다. 버전·제목만 한 줄씩, 전문은 선택 열람.)
47
+ // Show a summary list (#473 — dumping the full text made a wall of text so CRITICAL went unread,
48
+ // and wrapping long bodies broke the ║ box borders. One line per version and title; full text on request.)
49
49
  const e = (s = "") => process.stderr.write(s + "\n");
50
- // 화면은 화면 언어 문구 (onItems 로 넘긴 가이드용 항목은 영어 원문 그대로 — 실행 기록은 영어)
50
+ // Screen text uses the screen language (entries passed to onItems for the guide stay in English — the run log is English)
51
51
  const localized = (item) => localizeBreakingEntry(item, getLang());
52
52
  e("");
53
53
  e(t("breaking.title", { current, target: templateVersion, critical: critical.length, warnings: warnings.length }));
@@ -57,7 +57,7 @@ export async function runBreakingCheck({ cwd, tempDir, templateVersion, askYesNo
57
57
  e("");
58
58
 
59
59
  if (askYesNo) {
60
- // 대화형: 전문(조치 방법)은 원할 때만 펼친다
60
+ // Interactive: expand the full text (action steps) only when asked
61
61
  const detail = await askYesNo(t("breaking.askDetail"), false);
62
62
  if (detail === true) {
63
63
  for (const it of [...critical, ...warnings]) {
@@ -76,11 +76,11 @@ export async function runBreakingCheck({ cwd, tempDir, templateVersion, askYesNo
76
76
 
77
77
  if (critical.length > 0) {
78
78
  if (askYesNo) {
79
- // 대화형: 명시 확인 없으면 중단 (기본 N)
79
+ // Interactive: stop without explicit confirmation (default N)
80
80
  const ok = await askYesNo(t("breaking.askContinue"), false);
81
81
  if (ok !== true) return false;
82
82
  } else {
83
- // 비대화형(--force): 게이트로 CI를 죽이지 않고 경고 후 진행 (CI 친화)
83
+ // Non-interactive (--force): warn and proceed instead of killing CI at the gate (CI friendly)
84
84
  e(t("breaking.nonInteractive"));
85
85
  }
86
86
  }
@@ -1,4 +1,4 @@
1
- // 버전 비교: v 접두 제거, 3자리 숫자 비교, 누락 자리=0
1
+ // Version compare: strip v prefix, compare 3 numeric parts, missing part = 0
2
2
  export function compareVersions(a, b) {
3
3
  const parse = (v) => String(v).replace(/^v/, "").split(".").map((n) => parseInt(n, 10) || 0);
4
4
  const pa = parse(a), pb = parse(b);
@@ -10,9 +10,9 @@ export function compareVersions(a, b) {
10
10
  return 0;
11
11
  }
12
12
 
13
- // breaking-changes.json에서 current < ver <= target 범위 항목 수집.
14
- // ⚠️ target은 하드코딩 1.3.14가 아니라 실제 templateVersion을 넘긴다 (D2).
15
- // _ 로 시작하는 키(메타) 제외. severity critical / 그 외(warning).
13
+ // Collect breaking-changes.json entries in the range current < ver <= target.
14
+ // ⚠️ target is the real templateVersion, not a hardcoded 1.3.14 (D2).
15
+ // Skip keys starting with _ (meta). severity: critical / anything else (warning).
16
16
  export function collectBreaking(json, current, target) {
17
17
  const critical = [], warnings = [];
18
18
  for (const [ver, entry] of Object.entries(json || {})) {
@@ -25,8 +25,8 @@ export function collectBreaking(json, current, target) {
25
25
  return { critical, warnings };
26
26
  }
27
27
 
28
- // 항목 문구 > 화면 언어: ko면 title_ko/message_ko, 없거나 그 외 언어면 영어 원문(title/message)
29
- // 영어 키가 정본 — 구버전 CLI는 main의 이 파일에서 title/message만 읽음 (#988)
28
+ // Entry text > screen language: ko uses title_ko/message_ko; missing or other languages use the English original (title/message)
29
+ // English keys are the source of truth — old CLIs read only title/message from this file on main (#988)
30
30
  export function localizeBreakingEntry(entry, lang) {
31
31
  const pickField = (field) => {
32
32
  const koreanText = lang === "ko" ? entry?.[`${field}_ko`] : null;
@@ -1,15 +1,15 @@
1
- // CI 사용 시간 절약 치환 (#1114) — version.yml options.ci_minutes_saver: true 일 때만.
2
- // 비공개 레포는 Actions 분이 과금된다. 같은 커밋에 두 번 도는 CI·문서 변경 CI·macOS 러너(분당 10배)를 줄인다.
3
- // 꺼져 있으면 호출되지 않는다 (설치 결과 바이트 동일). 패턴을 못 찾으면(사용자 수정본) 그 변환만 건너뛴다.
4
- // 브랜치 치환보다 먼저 돈다 — 템플릿 원문(develop) 기준으로 패턴을 맞춘다.
1
+ // CI minutes saver substitution (#1114) — only with version.yml options.ci_minutes_saver: true.
2
+ // Private repos pay for Actions minutes. Cuts CI that runs twice on the same commit, CI on doc-only changes, and macOS runners (10x per minute).
3
+ // Not called when off (install output byte-identical). If a pattern is not found (user-edited file), only that transform is skipped.
4
+ // Runs before branch substitution — patterns match the raw template (develop).
5
5
 
6
- // PR 에서 문서만 바뀐 경우 CI 생략 (코드 경로를 고르는 paths 는 레포마다 달라 템플릿이 정할 수 없다)
6
+ // Skip CI for PRs that change only docs (paths that select code differ per repo, so the template cannot decide them)
7
7
  const DOCS_ONLY_PATHS_IGNORE = ` paths-ignore: ["**/*.md", "docs/**", "LICENSE"] # ci_minutes_saver: docs-only changes skip CI\n`;
8
8
 
9
- // on: 아래 push: 이벤트 블록 (자식 줄 4칸 이상). branches 필터만 있는 블록일 때만 지운다
9
+ // push: event block under on: (child lines indented 4+). Removed only when the block holds just a branches filter
10
10
  const PUSH_BLOCK_RE = /^ {2}push:[ \t]*\n((?: {4,}.*\n|[ \t]*\n)*)/m;
11
11
 
12
- // 같은 변경에 PR 과 push 로 두 번 도는 CI > push 제거 (PR 만)
12
+ // CI running twice for the same change via PR and push > drop push (PR only)
13
13
  function dropPushTrigger(s) {
14
14
  const pushBlock = s.match(PUSH_BLOCK_RE);
15
15
  if (!pushBlock) return s;
@@ -18,27 +18,27 @@ function dropPushTrigger(s) {
18
18
  return isBranchFilterOnly ? s.replace(PUSH_BLOCK_RE, "") : s;
19
19
  }
20
20
 
21
- // 이벤트(pull_request · push) 바로 아래에 문서 경로 제외 추가
21
+ // Add doc path exclusions right under the events (pull_request · push)
22
22
  function addDocsPathsIgnore(s, event) {
23
23
  const re = new RegExp(`^( {2}${event}:[ \\t]*\\n)`, "m");
24
24
  if (!re.test(s) || s.includes("ci_minutes_saver: docs-only")) return s;
25
25
  return s.replace(re, `$1${DOCS_ONLY_PATHS_IGNORE}`);
26
26
  }
27
27
 
28
- // iOS(macOS 러너) 빌드 자동 실행 끔 — 수동 실행 입력 enable_ios 로만 켠다
28
+ // Turn off automatic iOS (macOS runner) builds — enabled only via the manual input enable_ios
29
29
  function disableIosByDefault(s) {
30
- // 한 글자 늘어난 만큼 뒤 공백 하나를 먹어 주석 열을 맞춘다
30
+ // Eat one trailing space for each added character to keep the comment column aligned
31
31
  return s.replace(/^( {2}ENABLE_IOS: )"true" ?/m, `$1"false"`);
32
32
  }
33
33
 
34
- // 파일 이름(정확 일치) > 적용할 변환 목록. 스토어 배포·댓글 트리거 빌드는 넣지 않는다
34
+ // File name (exact match) > transforms to apply. Store deploys and comment-triggered builds are not included
35
35
  export const CI_MINUTES_SAVER_RULES = new Map([
36
36
  ["PROJECT-FLUTTER-CI.yaml", [dropPushTrigger, (s) => addDocsPathsIgnore(s, "pull_request"), disableIosByDefault]],
37
37
  ["PROJECT-PYTHON-CI.yaml", [dropPushTrigger, (s) => addDocsPathsIgnore(s, "pull_request")]],
38
38
  ["PROJECT-SPRING-NEXUS-CI.yml", [dropPushTrigger, (s) => addDocsPathsIgnore(s, "pull_request")]],
39
- // PR 트리거가 없어 push 는 남기고 문서 변경만 거른다
39
+ // No PR trigger, so keep push and filter only doc changes
40
40
  ["PROJECT-REACT-CI.yaml", [(s) => addDocsPathsIgnore(s, "push")]],
41
- // 푸시와 무관한 작업 > 수동 실행만
41
+ // Jobs unrelated to pushes > manual runs only
42
42
  ["PROJECT-COMMON-SECRET-FILE-UPLOAD.yaml", [dropPushTrigger]],
43
43
  ]);
44
44
 
@@ -1,35 +1,35 @@
1
- // 여러 파일이 함께 써야 하는 값 목록의 정본.
1
+ // Source of truth for value lists that several files must share.
2
2
  //
3
- // 왜 한 곳인가: deploy·publish 목록이 CLI 인자 검사(args.js), 마법사 질문(options-ask.js),
4
- // 복사 엔진(copy/workflows.js), version.yml 파서(version-yml.js), 옵션 표(options-schema.js)
5
- // 다섯 곳에 따로 적혀 있었다. 하나만 고치면 "CLI 는 받는데 파서가 버린다" 같은 조용한 불일치가 생긴다.
6
- // 값을 추가할 때는 여기 한 줄만 고치고, 그 값에 해당하는 워크플로우 폴더를 만든다
7
- // (deploy: project-types/common/deploy/<값>/ · publish: project-types/<type>/publish/<값>/).
3
+ // Why one place: the deploy/publish lists were written separately in five places: CLI arg checks (args.js), wizard questions (options-ask.js),
4
+ // the copy engine (copy/workflows.js), the version.yml parser (version-yml.js) and the option table (options-schema.js).
5
+ // Fixing only one causes silent mismatches like "the CLI accepts it but the parser drops it".
6
+ // To add a value, change one line here and create the workflow folder for that value
7
+ // (deploy: project-types/common/deploy/<value>/ · publish: project-types/<type>/publish/<value>/).
8
8
  //
9
- // 이 파일은 아무것도 import 하지 않는다 — 어디서 불러도 순환 import 가 생기지 않게.
10
- // 레포 문구 언어 목록은 repo-language.js 의 REPO_LANGUAGES 가 정본이다 (번역 파일과 같이 검사된다).
9
+ // This file imports nothing — so it never causes a circular import wherever it is loaded.
10
+ // The repo text language list is owned by REPO_LANGUAGES in repo-language.js (checked together with the translation files).
11
11
 
12
- /** 실행물을 어디에 배포하나 — 택1 (#439) */
12
+ /** Where the build output is deployed — pick one (#439) */
13
13
  export const DEPLOY_TARGETS = Object.freeze(["docker-ssh", "vercel", "none"]);
14
14
 
15
- /** 라이브러리를 어느 레지스트리에 내나 — 0..n (#439) */
15
+ /** Which registries a library is published to — 0..n (#439) */
16
16
  export const PUBLISH_TARGETS = Object.freeze(["nexus", "npm", "github-packages"]);
17
17
 
18
- /** 프로젝트 성격 — deploy/publish 질문을 유도한다 (#485) */
18
+ /** Project nature — drives the deploy/publish questions (#485) */
19
19
  export const INTENT_VALUES = Object.freeze(["app", "library", "both", "none", "manual"]);
20
20
 
21
- /** 상태 라벨 표기 — en: `status: todo`, ko: 기존 한글 `작업전` (#776) */
21
+ /** Status label style — en: `status: todo`, ko: legacy Korean `작업전` (#776) */
22
22
  export const LABEL_STYLES = Object.freeze(["en", "ko"]);
23
23
 
24
24
  /**
25
- * 저장값이 없을 때 CodeRabbit 코드 리뷰 설정을 설치할지의 기본값 (#832).
26
- * 꺼 둔다 — CodeRabbit 은 별도 GitHub 앱을 설치해야 동작하므로, 설치 없이 켜 두면 설정 파일만 있고 아무도 리뷰하지 않는다.
27
- * 대화형(질문하지 않는 version·issues 모드)과 비대화형이 각자 기본값을 가져 `true`/`false` 로 갈려 있던 것을 한 곳으로 모았다.
25
+ * Default for installing the CodeRabbit code review config when nothing is saved (#832).
26
+ * Off — CodeRabbit needs a separate GitHub app, so turning it on without that leaves a config file and no reviewer.
27
+ * Interactive (version/issues modes that do not ask) and non-interactive each had their own default and split into `true`/`false`; now in one place.
28
28
  */
29
29
  export const DEFAULT_CODE_REVIEW_CODERABBIT = false;
30
30
 
31
31
  /**
32
- * 릴리스 노트 생성기 (#455, #566). 기본값은 commit — 외부 의존이 없어 어디서나 결과가 나온다.
33
- * 실제 구현은 .github/scripts/changelog_providers/ 에 있고, 그쪽 목록과의 정합은 테스트가 본다.
32
+ * Release note generator (#455, #566). Default is commit — no external dependency, so it produces a result anywhere.
33
+ * The implementations live in .github/scripts/changelog_providers/; a test checks this list matches them.
34
34
  */
35
35
  export const CHANGELOG_PROVIDERS = Object.freeze(["copilot", "coderabbit", "openai", "gemini", "claude", "groq", "mistral", "ollama", "commit"]);
@@ -1,12 +1,12 @@
1
- // .coderabbit.yaml 복사 (force 경로).
2
- // SP2-B는 force/비대화형 경로만 구현. 대화형 덮어쓰기/건너뛰기 메뉴는 SP2-C.
1
+ // Copy .coderabbit.yaml (force path).
2
+ // SP2-B implements only the force/non-interactive path. The interactive overwrite/skip menu is SP2-C.
3
3
  import { join } from "node:path";
4
4
  import { exists, copyFileSync } from "../fsutil.js";
5
5
 
6
- // 반환: 'skip-disabled' | 'skip-no-src' | 'copied-new' | 'overwritten-backup' | 'skip-non-tty'
7
- // opts: { force, tty, enabled } — SP2-B 검증은 force:true 경로.
8
- // enabled=false면(#457 CodeRabbit 미사용 선택) 파일을 아예 복사하지 않는다.
9
- // enabled 미지정(undefined)이면 기존 동작(복사) 유지 — 구 호출부 하위호환.
6
+ // Returns 'skip-disabled' | 'skip-no-src' | 'copied-new' | 'overwritten-backup' | 'skip-non-tty'
7
+ // opts: { force, tty, enabled } — SP2-B verification uses the force:true path.
8
+ // enabled=false (#457, CodeRabbit not used) does not copy the file at all.
9
+ // enabled unset (undefined) keeps the old behavior (copy) — backward compat for old callers.
10
10
  export function copyCoderabbit(tempDir, { force = false, tty = false, enabled } = {}, targetRoot = ".") {
11
11
  if (enabled === false) return "skip-disabled";
12
12
  const src = join(tempDir, ".coderabbit.yaml");
@@ -15,14 +15,14 @@ export function copyCoderabbit(tempDir, { force = false, tty = false, enabled }
15
15
 
16
16
  if (exists(dst)) {
17
17
  if (force) {
18
- copyFileSync(dst, dst + ".bak"); // 백업 후 덮어쓰기
18
+ copyFileSync(dst, dst + ".bak"); // Back up, then overwrite
19
19
  copyFileSync(src, dst);
20
20
  return "overwritten-backup";
21
21
  }
22
- if (!tty) return "skip-non-tty"; // 비TTY & !force → 유지
23
- // 대화형 메뉴는 SP2-C — 여기서는 force가 아니면 유지
22
+ if (!tty) return "skip-non-tty"; // Non-TTY & !force → keep
23
+ // The interactive menu is SP2-C — here, keep unless force
24
24
  return "skip-non-tty";
25
25
  }
26
- copyFileSync(src, dst); // 신규
26
+ copyFileSync(src, dst); // New file
27
27
  return "copied-new";
28
28
  }
@@ -1,17 +1,17 @@
1
- // .gitignore 보장 (항목 정규화 > 누락 확인 > 추가).
1
+ // Ensure .gitignore (normalize entries > check missing > add).
2
2
  import { join } from "node:path";
3
3
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
4
4
 
5
5
  const REQUIRED_ENTRIES = ["/.idea", "/.claude/settings.local.json"];
6
6
 
7
- // 항목 정규화: 주석 제거·트림·앞 / 제거·앞 ./ 제거·뒤 / 제거. 빈값이면 원본.
7
+ // Normalize an entry: strip comment, trim, drop leading /, leading ./ and trailing /. Original if empty.
8
8
  export function normalizeGitignoreEntry(entry) {
9
9
  let e = String(entry);
10
- e = e.replace(/#.*$/, ""); // 주석 제거
11
- e = e.trim(); // 앞뒤 공백
12
- e = e.replace(/^\//, ""); // 앞 /
13
- e = e.replace(/^\.\//, ""); // 앞 ./
14
- e = e.replace(/\/$/, ""); // 뒤 /
10
+ e = e.replace(/#.*$/, ""); // Strip comment
11
+ e = e.trim(); // Trim whitespace
12
+ e = e.replace(/^\//, ""); // Leading /
13
+ e = e.replace(/^\.\//, ""); // Leading ./
14
+ e = e.replace(/\/$/, ""); // Trailing /
15
15
  return e === "" ? String(entry) : e;
16
16
  }
17
17
 
@@ -32,7 +32,7 @@ const NEW_FILE_CONTENT =
32
32
  "# Claude AI Settings\n" +
33
33
  "/.claude/settings.local.json\n";
34
34
 
35
- // 반환: {created, added:[...]}
35
+ // Returns {created, added:[...]}
36
36
  export function ensureGitignore(targetRoot = ".") {
37
37
  const p = join(targetRoot, ".gitignore");
38
38
  if (!existsSync(p)) {
@@ -43,7 +43,7 @@ export function ensureGitignore(targetRoot = ".") {
43
43
  const toAdd = REQUIRED_ENTRIES.filter((e) => !entryExists(e, content));
44
44
  if (toAdd.length === 0) return { created: false, added: [] };
45
45
 
46
- // 파일 끝에 개행 없으면 추가
46
+ // Add a newline if the file does not end with one
47
47
  if (content.length > 0 && !content.endsWith("\n")) content += "\n";
48
48
  content += "\n";
49
49
  content += "# ====================================================================\n";
@@ -1,20 +1,20 @@
1
- // README 버전 섹션 추가.
1
+ // Add the README version section.
2
2
  import { join } from "node:path";
3
3
  import { existsSync, readFileSync, appendFileSync } from "node:fs";
4
4
 
5
5
  const MARKER = "<!-- AUTO-VERSION-SECTION";
6
- // ## (최신 버전|최신버전|Latest version|Version|버전) : vX.Y.Z (대소문자 무시)
6
+ // ## (최신 버전|최신버전|Latest version|Version|버전) : vX.Y.Z (case-insensitive)
7
7
  const VERSION_LINE_RE = /##\s*(최신\s*버전|최신버전|Latest\s+version|Version|버전)\s*:\s*v[0-9]+\.[0-9]+\.[0-9]+/i;
8
8
 
9
- // 레포 언어별 섹션 문구 (.github/scripts/i18n 의 readme.version_heading 과 같은 값)
9
+ // Section text per repo language (same values as readme.version_heading in .github/scripts/i18n)
10
10
  const SECTION_TEXT = {
11
11
  en: { heading: "Latest version", changelogLink: "View the full version history" },
12
12
  ko: { heading: "최신 버전", changelogLink: "전체 버전 기록 보기" },
13
13
  };
14
14
 
15
- // README.md 없으면 스킵. 마커 또는 버전 라인 있으면 스킵. 없으면 파일 끝에 append.
16
- // 반환: 'skip-no-readme' | 'skip-marker' | 'skip-version-line' | 'added'
17
- // language 미지정은 ko — 언어를 넘기지 않는 기존 호출부의 결과를 바꾸지 않기 위함
15
+ // Skip if README.md is missing. Skip if the marker or a version line exists. Otherwise append at the end of the file.
16
+ // Returns 'skip-no-readme' | 'skip-marker' | 'skip-version-line' | 'added'
17
+ // language defaults to ko — keeps results unchanged for existing callers that pass no language
18
18
  export function addVersionSectionToReadme(version, targetRoot = ".", language = "ko") {
19
19
  const p = join(targetRoot, "README.md");
20
20
  if (!existsSync(p)) return "skip-no-readme";
@@ -23,7 +23,7 @@ export function addVersionSectionToReadme(version, targetRoot = ".", language =
23
23
  if (VERSION_LINE_RE.test(content)) return "skip-version-line";
24
24
 
25
25
  const text = SECTION_TEXT[language] ?? SECTION_TEXT.ko;
26
- // append 본문은 빈 줄 + "---"로 시작 (원본 파일이 개행으로 끝난다는 전제).
26
+ // The appended body starts with a blank line + "---" (assumes the original file ends with a newline).
27
27
  const section =
28
28
  "\n" +
29
29
  "---\n" +
@@ -1,47 +1,47 @@
1
- // 단순 복사 함수 (무조건 덮어쓰기류): scripts, config, issue, discussion, setup guide.
1
+ // Simple copy functions (always-overwrite kind): scripts, config, issue, discussion, setup guide.
2
2
  import { join, basename } from "node:path";
3
3
  import { chmodSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
4
4
  import { PATHS } from "../paths.js";
5
5
  import { exists, copyFileSync, copyDirSync } from "../fsutil.js";
6
6
 
7
- // 버전관리/릴리스노트 스크립트만 무조건 덮어쓰기 + chmod +x.
8
- // version_manager는 .sh(위임 shim) + .py(실 로직) 한 쌍 — 둘 다 복사해야 동작 (#448).
9
- // changelog provider 사다리(.py 5종, #455)는 RELEASE-CHANGELOG 워크플로우 fallback-summary가
10
- // 호출하므로 함께 복사해야 사용자 프로젝트에서 릴리스 노트 생성이 동작한다.
11
- // issue_helper.py는 SUH-ISSUE-HELPER 워크플로우가 호출 — 함께 복사 필수 (#478).
7
+ // Always overwrite only the version management/release note scripts + chmod +x.
8
+ // version_manager is a .sh (delegating shim) + .py (real logic) pair — both must be copied to work (#448).
9
+ // The changelog provider ladder (5 .py files, #455) is called by the RELEASE-CHANGELOG workflow fallback-summary,
10
+ // so it must be copied too for release note generation to work in user projects.
11
+ // issue_helper.py is called by the SUH-ISSUE-HELPER workflow — must be copied with it (#478).
12
12
  export function copyScripts(tempDir, targetRoot = ".") {
13
13
  const scripts = [
14
14
  "version_manager.sh", "version_manager.py",
15
15
  "changelog_manager.py",
16
16
  "truncate_release_notes.sh", "truncate_release_notes.py",
17
17
  "issue_helper.py",
18
- // GitHub REST 호출 공통 (#914). issue_helper·changelog_notice·pr_summary_comment·dispatch_downstream·
19
- // close_issues_on_release·store_deploy_config 가 import 하므로 빠지면 그 워크플로가 모두 죽는다.
18
+ // Shared GitHub REST calls (#914). issue_helper, changelog_notice, pr_summary_comment, dispatch_downstream,
19
+ // close_issues_on_release and store_deploy_config import it, so without it all those workflows break.
20
20
  "github_api.py",
21
- // 릴리스 워크플로우가 PAT 없이 머지한 뒤 후속 워크플로우를 깨울 때 호출 (#551).
21
+ // Called when the release workflow merges without a PAT and then wakes follow-up workflows (#551).
22
22
  "dispatch_downstream.py",
23
- // AI PR SUMMARY 워크플로우가 요약 댓글을 작성·갱신할 때 호출 (#553).
23
+ // Called when the AI PR SUMMARY workflow writes or updates the summary comment (#553).
24
24
  "pr_summary_comment.py",
25
- // QA 이슈 생성 봇이 게시 문구를 만들 때 호출 (#787). 언어는 version.yml 의 options.language.
25
+ // Called when the QA issue bot builds its post text (#787). Language is options.language in version.yml.
26
26
  "qa_bot_messages.py",
27
- // 릴리스 노트가 어떤 경로로 만들어졌는지 알리고, AI를 못 썼을 때 대안을 안내 (#566).
27
+ // Reports how the release notes were made and suggests alternatives when AI was unavailable (#566).
28
28
  "changelog_notice.py",
29
- // Flutter 빌드 워크플로우가 .env와 dart-define을 한 곳에서 정할 때 호출 (#603).
30
- // 설정(.github/config/build-profile.json)이 없는 저장소에서는 아무 일도 하지 않는다.
29
+ // Called when the Flutter build workflow settles .env and dart-define in one place (#603).
30
+ // Does nothing in repos without the config (.github/config/build-profile.json).
31
31
  "apply_build_profile.py",
32
- // iOS/Android 테스트 빌드와 iOS 릴리스의 빌드 번호 규칙 (#643). 번호 규칙의 유일한 위치.
32
+ // Build number rules for iOS/Android test builds and iOS releases (#643). The only home of the numbering rules.
33
33
  "build_number.py",
34
- // App Store Connect 조회 (#643). ios_release.py가 사용하므로 함께 복사해야 한다.
34
+ // App Store Connect lookups (#643). Used by ios_release.py, so it must be copied with it.
35
35
  "asc_client.py",
36
- // iOS 버전 사전 점검, 업로드 거부 분류, 아카이브부터 업로드까지 재시도 (#643).
36
+ // iOS version pre-check, upload rejection classification, retries from archive to upload (#643).
37
37
  "ios_release.py",
38
- // Flutter iOS 빌드의 Xcode 선택(빈 값 = 러너 최신)과 SDK 누락 진단 (#758). 선택 규칙의 유일한 위치.
38
+ // Xcode selection for Flutter iOS builds (empty = latest on the runner) and missing SDK diagnosis (#758). The only home of the selection rules.
39
39
  "select_xcode.py",
40
- // 릴리스 머지 때 완료 라벨이 붙은 이슈를 닫는다 (#771). close_on_release 옵션이 켜진 레포에서만 동작한다.
40
+ // Closes issues labelled done when a release is merged (#771). Works only in repos with the close_on_release option on.
41
41
  "close_issues_on_release.py",
42
- // Play Store/TestFlight 배포 모드를 코드 설정(.github/config/store-deploy.json)에서 읽는다 (#767).
42
+ // Reads the Play Store/TestFlight deploy mode from the code config (.github/config/store-deploy.json) (#767).
43
43
  "store_deploy_config.py",
44
- // 스토어 릴리스 노트를 언어별로 준비 (#829). version.yml 의 store_locales 가 없으면 아무것도 하지 않는다.
44
+ // Prepares store release notes per language (#829). Does nothing without store_locales in version.yml.
45
45
  "store_notes.py",
46
46
  "changelog_providers/_common.py", "changelog_providers/ladder.py",
47
47
  "changelog_providers/commit.py", "changelog_providers/copilot.py",
@@ -53,16 +53,16 @@ export function copyScripts(tempDir, targetRoot = ".") {
53
53
  if (exists(src)) {
54
54
  const dst = join(targetRoot, PATHS.scriptsDir, s);
55
55
  copyFileSync(src, dst);
56
- try { chmodSync(dst, 0o755); } catch { /* Windows 등 chmod 무의미 */ }
56
+ try { chmodSync(dst, 0o755); } catch { /* chmod is meaningless on Windows etc. */ }
57
57
  copied++;
58
58
  }
59
59
  }
60
- // 메시지 카탈로그(#787): 런타임에 스크립트가 읽는다. 목록 대신 폴더 단위로 복사해야
61
- // 번역가가 json 한 파일만 추가해도 다른 곳을 고치지 않고 따라간다.
60
+ // Message catalog (#787): scripts read it at runtime. Copying the whole folder instead of a list
61
+ // lets a translator add a single json file without changing anything else.
62
62
  const i18nSrc = join(tempDir, PATHS.scriptsDir, "i18n");
63
63
  if (exists(i18nSrc)) {
64
64
  for (const f of readdirSync(i18nSrc)) {
65
- if (!/\.(py|json|cjs)$/.test(f)) continue; // __pycache__ 등은 제외 (cjs: 워크플로우 댓글 런타임)
65
+ if (!/\.(py|json|cjs)$/.test(f)) continue; // Skip __pycache__ etc. (cjs: workflow comment runtime)
66
66
  copyFileSync(join(i18nSrc, f), join(targetRoot, PATHS.scriptsDir, "i18n", f));
67
67
  copied++;
68
68
  }
@@ -70,7 +70,7 @@ export function copyScripts(tempDir, targetRoot = ".") {
70
70
  return copied;
71
71
  }
72
72
 
73
- // .github/config 폴더 전체 덮어쓰기. 없으면 스킵.
73
+ // Overwrite the whole .github/config folder. Skip if missing.
74
74
  export function copyConfigFolder(tempDir, targetRoot = ".") {
75
75
  const src = join(tempDir, ".github", "config");
76
76
  if (!exists(src)) return false;
@@ -78,11 +78,11 @@ export function copyConfigFolder(tempDir, targetRoot = ".") {
78
78
  return true;
79
79
  }
80
80
 
81
- // 사용자 레포로 복사된 이슈 템플릿에서 담당자(assignees) 줄을 지운다 (#782).
82
- // 원본에는 이 저장소 소유자가 박혀 있는데, 남의 레포에서 새 이슈를 만들 때 그 사람이 담당자로
83
- // 지정되면 안 된다. 담당자는 이슈 헬퍼와 QA 봇이 version.yml 설정으로 정한다.
84
- // frontmatter(첫 --- 와 둘째 --- 사이)의 줄만 대상이다 — 본문에 같은 문구가 있어도 건드리지 않는다.
85
- // 반환: 바뀐 파일의 레포 루트 기준 상대경로. 오버레이 적용 뒤에 불러야 한다(오버레이가 다시 넣는다).
81
+ // Remove the assignees line from issue templates copied into the user repo (#782).
82
+ // The source names this repo's owner, who must not become the assignee of new issues in someone else's repo.
83
+ // Assignees are set by the issue helper and QA bot from version.yml settings.
84
+ // Only lines in the front matter (between the first and second ---) — the same text in the body is left alone.
85
+ // Returns repo-root relative paths of changed files. Must be called after the overlay is applied (the overlay puts it back).
86
86
  export function stripIssueTemplateAssignees(targetRoot = ".") {
87
87
  const dir = join(targetRoot, ".github", "ISSUE_TEMPLATE");
88
88
  if (!exists(dir)) return [];
@@ -100,16 +100,16 @@ export function stripIssueTemplateAssignees(targetRoot = ".") {
100
100
  return changed;
101
101
  }
102
102
 
103
- // .github/ISSUE_TEMPLATE/ 전체 + PULL_REQUEST_TEMPLATE.md 덮어쓰기.
103
+ // Overwrite all of .github/ISSUE_TEMPLATE/ + PULL_REQUEST_TEMPLATE.md.
104
104
  export function copyIssueTemplates(tempDir, targetRoot = ".") {
105
105
  const srcIssue = join(tempDir, ".github", "ISSUE_TEMPLATE");
106
- // `projectops-` 로 시작하는 파일은 이 저장소(projectops 자체)의 이슈 양식이라 사용자 레포로 복사하지 않는다 (#797).
106
+ // Files starting with `projectops-` are this repo's (projectops itself) issue forms and are not copied to user repos (#797).
107
107
  if (exists(srcIssue)) copyDirSync(srcIssue, join(targetRoot, ".github", "ISSUE_TEMPLATE"), { filter: (src) => !basename(src).startsWith("projectops-") });
108
108
  const srcPr = join(tempDir, ".github", "PULL_REQUEST_TEMPLATE.md");
109
109
  if (exists(srcPr)) copyFileSync(srcPr, join(targetRoot, ".github", "PULL_REQUEST_TEMPLATE.md"));
110
110
  }
111
111
 
112
- // .github/DISCUSSION_TEMPLATE/ 전체. 없으면 스킵.
112
+ // All of .github/DISCUSSION_TEMPLATE/. Skip if missing.
113
113
  export function copyDiscussionTemplates(tempDir, targetRoot = ".") {
114
114
  const src = join(tempDir, ".github", "DISCUSSION_TEMPLATE");
115
115
  if (!exists(src)) return false;
@@ -117,7 +117,7 @@ export function copyDiscussionTemplates(tempDir, targetRoot = ".") {
117
117
  return true;
118
118
  }
119
119
 
120
- // PROJECTOPS-SETUP-GUIDE.md 루트로 덮어쓰기. 없으면 스킵.
120
+ // Overwrite PROJECTOPS-SETUP-GUIDE.md at the root. Skip if missing.
121
121
  export const SETUP_GUIDE_NAME = "PROJECTOPS-SETUP-GUIDE.md";
122
122
  export function copySetupGuide(tempDir, targetRoot = ".") {
123
123
  const src = join(tempDir, SETUP_GUIDE_NAME);
@@ -1,23 +1,23 @@
1
- // util 모듈 복사 (force 경로).
2
- // tempDir/.github/util/<type>/ 있으면 (force) .github/util/<type>/로 전체 복사, 모듈 수 카운트.
1
+ // Copy util modules (force path).
2
+ // If tempDir/.github/util/<type>/ exists, (force) copy all of it to .github/util/<type>/ and count modules.
3
3
  import { join } from "node:path";
4
4
  import { readdirSync } from "node:fs";
5
5
  import { exists, copyDirSync } from "../fsutil.js";
6
6
 
7
- // 반환: {copied:bool, moduleCount:number}. force가 아니면(비TTY) 스킵.
8
- // ⚠️ overlay 복사다 — 템플릿에서 삭제/리네임된 구 파일은 여기서 지우지 않는다.
9
- // 구 util 파일 정리는 migrations registry(util-file 카테고리)가 담당한다 (#500).
7
+ // Returns {copied:bool, moduleCount:number}. Skipped when not force (non-TTY).
8
+ // ⚠️ This is an overlay copy — old files deleted/renamed in the template are not removed here.
9
+ // Cleaning up old util files is the job of the migrations registry (util-file category) (#500).
10
10
  export function copyUtilModules(tempDir, type, { force = false } = {}, targetRoot = ".") {
11
11
  const src = join(tempDir, ".github", "util", type);
12
12
  if (!exists(src)) return { copied: false, moduleCount: 0 };
13
- if (!force) return { copied: false, moduleCount: 0 }; // SP2-B: force 경로만
13
+ if (!force) return { copied: false, moduleCount: 0 }; // SP2-B: force path only
14
14
 
15
15
  const dst = join(targetRoot, ".github", "util", type);
16
16
  copyDirSync(src, dst);
17
17
 
18
- // 하위 디렉토리 개수 = 모듈 수
19
- // `_` 로 시작하는 폴더는 모듈이 아니라 모듈들이 공유하는 자산이다
20
- // (예: flutter/_shared — 마법사 3종 공통 CSS/JS). 개수에서 제외한다.
18
+ // Number of subdirectories = number of modules
19
+ // Folders starting with `_` are not modules but assets shared by modules
20
+ // (e.g. flutter/_shared — CSS/JS shared by the 3 wizards). Excluded from the count.
21
21
  let moduleCount = 0;
22
22
  for (const e of readdirSync(dst, { withFileTypes: true })) {
23
23
  if (e.isDirectory() && !e.name.startsWith("_")) moduleCount++;