claudeos-core 1.0.4 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudeos-core",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
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,9 @@
1
+ ⚠️ CRITICAL INSTRUCTION: 이것은 대화가 아닙니다. 아래 지시를 즉시 실행하세요.
2
+ - 질문하지 마세요. "무엇을 도와드릴까요?" 같은 응답을 하지 마세요.
3
+ - 프로젝트 구조 설명을 하지 마세요.
4
+ - 아래 분석 항목을 모두 수행하고, 결과를 지정된 JSON 파일에 저장하세요.
5
+ - 반드시 파일을 생성해야 합니다. 대화형 응답은 실패로 간주됩니다.
6
+
1
7
  프로젝트 루트 경로: {{PROJECT_ROOT}}
2
8
  이 경로를 기준으로 모든 파일 경로를 해석해줘.
3
9
 
@@ -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
  }
@@ -350,6 +350,51 @@ async function scanStructure(stack) {
350
350
  domainMap[d].xmlMappers = xml.length;
351
351
  backendDomains.push({ name: d, type: "backend", ...domainMap[d], totalFiles: svc.length + mpr.length + dto.length + xml.length + domainMap[d].controllers });
352
352
  }
353
+
354
+ // ── Java 폴백: 위 글로브가 0개일 때 전체 .java 파일에서 직접 도메인 추출 ──
355
+ if (backendDomains.length === 0) {
356
+ const allJava = await glob("**/*.java", { cwd: ROOT, ignore: ["**/node_modules/**", "**/build/**", "**/target/**", "**/test/**", "**/generated/**"] });
357
+ const javaDomains = {};
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+$/;
360
+ const layerNames = ["controller", "service", "mapper", "repository", "dao", "dto", "vo", "entity", "aggregator", "adapter"];
361
+
362
+ for (const f of allJava) {
363
+ const parts = f.replace(/\\/g, "/").split("/");
364
+ for (let i = 0; i < parts.length - 1; i++) {
365
+ if (layerNames.includes(parts[i]) && i > 0) {
366
+ // Pattern A 감지: .../{domain}/controller/... 또는 .../controller/{domain}/...
367
+ const prevDir = parts[i - 1];
368
+ const nextDir = parts[i + 1];
369
+
370
+ // {domain}/layer/ 패턴 (도메인이 레이어 앞에)
371
+ if (!skipNames.includes(prevDir) && !layerNames.includes(prevDir) && !prevDir.includes(".") && !versionPattern.test(prevDir)) {
372
+ if (!javaDomains[prevDir]) javaDomains[prevDir] = { controllers: 0, services: 0, mappers: 0, dtos: 0, xmlMappers: 0, pattern: "B" };
373
+ if (parts[i] === "controller") javaDomains[prevDir].controllers++;
374
+ else if (parts[i] === "service") javaDomains[prevDir].services++;
375
+ else if (["mapper", "repository", "dao"].includes(parts[i])) javaDomains[prevDir].mappers++;
376
+ else if (["dto", "vo"].includes(parts[i])) javaDomains[prevDir].dtos++;
377
+ }
378
+ // layer/{domain}/ 패턴 (레이어가 도메인 앞에)
379
+ if (nextDir && !nextDir.endsWith(".java") && !skipNames.includes(nextDir) && !layerNames.includes(nextDir) && !versionPattern.test(nextDir)) {
380
+ if (!javaDomains[nextDir]) javaDomains[nextDir] = { controllers: 0, services: 0, mappers: 0, dtos: 0, xmlMappers: 0, pattern: "A" };
381
+ if (parts[i] === "controller") javaDomains[nextDir].controllers++;
382
+ else if (parts[i] === "service") javaDomains[nextDir].services++;
383
+ else if (["mapper", "repository", "dao"].includes(parts[i])) javaDomains[nextDir].mappers++;
384
+ else if (["dto", "vo"].includes(parts[i])) javaDomains[nextDir].dtos++;
385
+ }
386
+ break;
387
+ }
388
+ }
389
+ }
390
+
391
+ for (const [d, data] of Object.entries(javaDomains)) {
392
+ const total = data.controllers + data.services + data.mappers + data.dtos;
393
+ if (total > 0) {
394
+ backendDomains.push({ name: d, type: "backend", ...data, totalFiles: total });
395
+ }
396
+ }
397
+ }
353
398
  }
354
399
 
355
400
  // ── Node.js 백엔드 (Express/NestJS) — 프론트엔드 존재 여부와 무관하게 스캔 ──
@@ -421,6 +466,67 @@ async function scanStructure(stack) {
421
466
  frontendDomains.push({ name: `comp-${name}`, type: "frontend", components: files.length, totalFiles: files.length });
422
467
  }
423
468
  }
469
+
470
+ // ── 폴백: 위 스캐너로 0개일 때 page.tsx/index.tsx 위치에서 직접 도메인 추출 ──
471
+ if (frontendDomains.length === 0) {
472
+ const pageFiles = await glob("**/page.{tsx,jsx}", { cwd: ROOT, ignore: ["**/node_modules/**", "**/.next/**"] });
473
+ const domainSet = {};
474
+ const skipNames = ["app", "src", "pages", "api", "_app", "_document"];
475
+ for (const f of pageFiles) {
476
+ const parts = f.replace(/\\/g, "/").split("/");
477
+ const appIdx = parts.indexOf("app");
478
+ const pagesIdx = parts.indexOf("pages");
479
+ const baseIdx = appIdx >= 0 ? appIdx : pagesIdx;
480
+ if (baseIdx >= 0 && baseIdx + 1 < parts.length - 1) {
481
+ const domain = parts[baseIdx + 1];
482
+ if (!skipNames.includes(domain) && !domain.startsWith("_") && !domain.startsWith("(") && !domain.startsWith(".")) {
483
+ if (!domainSet[domain]) domainSet[domain] = { pages: 0, clientFiles: 0, totalFiles: 0 };
484
+ domainSet[domain].pages++;
485
+ domainSet[domain].totalFiles++;
486
+ }
487
+ }
488
+ }
489
+ // client.tsx도 카운트
490
+ const clientFiles = await glob("**/client.{tsx,jsx}", { cwd: ROOT, ignore: ["**/node_modules/**", "**/.next/**"] });
491
+ for (const f of clientFiles) {
492
+ const parts = f.replace(/\\/g, "/").split("/");
493
+ const appIdx = parts.indexOf("app");
494
+ const baseIdx = appIdx >= 0 ? appIdx : -1;
495
+ if (baseIdx >= 0 && baseIdx + 1 < parts.length - 1) {
496
+ const domain = parts[baseIdx + 1];
497
+ if (domainSet[domain]) {
498
+ domainSet[domain].clientFiles++;
499
+ domainSet[domain].totalFiles++;
500
+ }
501
+ }
502
+ }
503
+ for (const [name, data] of Object.entries(domainSet)) {
504
+ frontendDomains.push({
505
+ name, type: "frontend", pages: data.pages, clientFiles: data.clientFiles, totalFiles: data.totalFiles,
506
+ rscPattern: data.clientFiles > 0 ? "RSC+Client split" : "default",
507
+ });
508
+ }
509
+
510
+ // widgets/features/entities도 직접 스캔 (글로브 폴백)
511
+ for (const layer of ["widgets", "features", "entities"]) {
512
+ const layerFiles = await glob(`**/${layer}/*/**/*.{tsx,jsx,ts,js}`, { cwd: ROOT, ignore: ["**/node_modules/**", "**/.next/**", "**/*.spec.*", "**/*.test.*"] });
513
+ const layerDomains = {};
514
+ for (const f of layerFiles) {
515
+ const parts = f.replace(/\\/g, "/").split("/");
516
+ const layerIdx = parts.indexOf(layer);
517
+ if (layerIdx >= 0 && layerIdx + 1 < parts.length) {
518
+ const domain = parts[layerIdx + 1];
519
+ if (!["ui", "common", "shared", "lib", "config"].includes(domain)) {
520
+ if (!layerDomains[domain]) layerDomains[domain] = 0;
521
+ layerDomains[domain]++;
522
+ }
523
+ }
524
+ }
525
+ for (const [name, count] of Object.entries(layerDomains)) {
526
+ frontendDomains.push({ name: `${layer}/${name}`, type: "frontend", totalFiles: count });
527
+ }
528
+ }
529
+ }
424
530
  }
425
531
 
426
532
  // ── Python/Django ──