claudeos-core 1.0.5 → 1.0.7

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/bin/cli.js CHANGED
@@ -54,6 +54,29 @@ function run(cmd, options = {}) {
54
54
  }
55
55
  }
56
56
 
57
+ // claude -p 실행: 프롬프트를 파일에 저장 후 파이프로 전달 (Windows 8191자 제한 우회)
58
+ function runClaudePrompt(prompt, options = {}) {
59
+ const tmpFile = path.join(GENERATED_DIR, "_tmp_prompt.md");
60
+ fs.writeFileSync(tmpFile, prompt, "utf-8");
61
+ try {
62
+ const catCmd = process.platform === "win32" ? "type" : "cat";
63
+ const escaped = escapeShellArg(tmpFile);
64
+ const cmd = `${catCmd} ${escaped} | claude -p --dangerously-skip-permissions`;
65
+ execSync(cmd, {
66
+ cwd: options.cwd || PROJECT_ROOT,
67
+ stdio: "inherit",
68
+ encoding: "utf-8",
69
+ shell: true,
70
+ });
71
+ return true;
72
+ } catch (e) {
73
+ if (options.ignoreError) return false;
74
+ throw e;
75
+ } finally {
76
+ try { fs.unlinkSync(tmpFile); } catch {}
77
+ }
78
+ }
79
+
57
80
  function ensureDir(dir) {
58
81
  if (!fs.existsSync(dir)) {
59
82
  fs.mkdirSync(dir, { recursive: true });
@@ -197,10 +220,7 @@ async function cmdInit() {
197
220
  .replace(/\{\{PASS_NUM\}\}/g, String(i));
198
221
  prompt = injectProjectRoot(prompt);
199
222
 
200
- const ok = run(
201
- `claude -p ${escapeShellArg(prompt)} --dangerously-skip-permissions`,
202
- { ignoreError: true }
203
- );
223
+ const ok = runClaudePrompt(prompt, { ignoreError: true });
204
224
 
205
225
  if (!ok) {
206
226
  log(` ❌ Pass 1-${i} failed. Aborting.`);
@@ -227,10 +247,7 @@ async function cmdInit() {
227
247
  readFile(path.join(GENERATED_DIR, "pass2-prompt.md"))
228
248
  );
229
249
 
230
- const ok = run(
231
- `claude -p ${escapeShellArg(prompt)} --dangerously-skip-permissions`,
232
- { ignoreError: true }
233
- );
250
+ const ok = runClaudePrompt(prompt, { ignoreError: true });
234
251
 
235
252
  if (!ok) {
236
253
  log(" ❌ Pass 2 failed. Aborting.");
@@ -253,10 +270,7 @@ async function cmdInit() {
253
270
  readFile(path.join(GENERATED_DIR, "pass3-prompt.md"))
254
271
  );
255
272
 
256
- const ok = run(
257
- `claude -p ${escapeShellArg(prompt)} --dangerously-skip-permissions`,
258
- { ignoreError: true }
259
- );
273
+ const ok = runClaudePrompt(prompt, { ignoreError: true });
260
274
 
261
275
  if (!ok) {
262
276
  log(" ❌ Pass 3 failed. Aborting.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudeos-core",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Auto-generate Claude Code documentation from your actual source code — Standards, Rules, Skills, and Guides tailored to your project",
5
5
  "main": "health-checker/index.js",
6
6
  "bin": {
@@ -1,3 +1,6 @@
1
+ 당신은 코드 분석 도구입니다. 아래 지시에 따라 프로젝트 소스 코드를 분석하고, 결과를 JSON 파일로 저장하세요.
2
+ 대화하지 말고, 분석 결과만 JSON으로 출력하세요.
3
+
1
4
  프로젝트 루트 경로: {{PROJECT_ROOT}}
2
5
  이 경로를 기준으로 모든 파일 경로를 해석해줘.
3
6
 
@@ -301,12 +301,12 @@ async function scanStructure(stack) {
301
301
  const serviceDirs = await glob("src/main/java/**/*/service/*.java", { cwd: ROOT });
302
302
  const mapperDirs = await glob("src/main/java/**/*/{mapper,repository}/*.java", { cwd: ROOT });
303
303
  const allServiceFiles = [...serviceDirs, ...mapperDirs];
304
- const skipDomains = ["common", "config", "util", "utils", "base", "core", "shared", "global", "framework", "infra"];
304
+ const skipDomains = ["common", "config", "util", "utils", "base", "core", "shared", "global", "framework", "infra", "front", "admin", "back", "internal", "external", "web", "app", "test", "tests", "main", "generated", "build"];
305
305
  for (const f of allServiceFiles) {
306
306
  const m = f.match(/\/([^/]+)\/(service|mapper|repository)\/[^/]+\.java$/);
307
307
  if (m) {
308
308
  const d = m[1];
309
- if (!domainMap[d] && !skipDomains.includes(d)) {
309
+ if (!domainMap[d] && !skipDomains.includes(d) && !/^v\d+$/.test(d)) {
310
310
  domainMap[d] = { controllers: 0, services: 0, mappers: 0, dtos: 0, xmlMappers: 0, pattern: detectedPattern || "B" };
311
311
  }
312
312
  }
@@ -355,7 +355,8 @@ async function scanStructure(stack) {
355
355
  if (backendDomains.length === 0) {
356
356
  const allJava = await glob("**/*.java", { cwd: ROOT, ignore: ["**/node_modules/**", "**/build/**", "**/target/**", "**/test/**", "**/generated/**"] });
357
357
  const javaDomains = {};
358
- const skipNames = ["common", "config", "util", "utils", "base", "shared", "global", "framework", "infra", "api", "main"];
358
+ const skipNames = ["common", "config", "util", "utils", "base", "shared", "global", "framework", "infra", "api", "main", "front", "admin", "back", "internal", "external", "web", "app", "test", "tests", "generated", "build"];
359
+ const versionPattern = /^v\d+$/;
359
360
  const layerNames = ["controller", "service", "mapper", "repository", "dao", "dto", "vo", "entity", "aggregator", "adapter"];
360
361
 
361
362
  for (const f of allJava) {
@@ -367,7 +368,7 @@ async function scanStructure(stack) {
367
368
  const nextDir = parts[i + 1];
368
369
 
369
370
  // {domain}/layer/ 패턴 (도메인이 레이어 앞에)
370
- if (!skipNames.includes(prevDir) && !layerNames.includes(prevDir) && !prevDir.includes(".")) {
371
+ if (!skipNames.includes(prevDir) && !layerNames.includes(prevDir) && !prevDir.includes(".") && !versionPattern.test(prevDir)) {
371
372
  if (!javaDomains[prevDir]) javaDomains[prevDir] = { controllers: 0, services: 0, mappers: 0, dtos: 0, xmlMappers: 0, pattern: "B" };
372
373
  if (parts[i] === "controller") javaDomains[prevDir].controllers++;
373
374
  else if (parts[i] === "service") javaDomains[prevDir].services++;
@@ -375,7 +376,7 @@ async function scanStructure(stack) {
375
376
  else if (["dto", "vo"].includes(parts[i])) javaDomains[prevDir].dtos++;
376
377
  }
377
378
  // layer/{domain}/ 패턴 (레이어가 도메인 앞에)
378
- if (nextDir && !nextDir.endsWith(".java") && !skipNames.includes(nextDir) && !layerNames.includes(nextDir)) {
379
+ if (nextDir && !nextDir.endsWith(".java") && !skipNames.includes(nextDir) && !layerNames.includes(nextDir) && !versionPattern.test(nextDir)) {
379
380
  if (!javaDomains[nextDir]) javaDomains[nextDir] = { controllers: 0, services: 0, mappers: 0, dtos: 0, xmlMappers: 0, pattern: "A" };
380
381
  if (parts[i] === "controller") javaDomains[nextDir].controllers++;
381
382
  else if (parts[i] === "service") javaDomains[nextDir].services++;