@yuaone/core 0.3.3 → 0.4.0
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/agent-loop.d.ts +62 -0
- package/dist/agent-loop.d.ts.map +1 -1
- package/dist/agent-loop.js +705 -18
- package/dist/agent-loop.js.map +1 -1
- package/dist/background-agent.d.ts +110 -0
- package/dist/background-agent.d.ts.map +1 -0
- package/dist/background-agent.js +255 -0
- package/dist/background-agent.js.map +1 -0
- package/dist/coding-standards.d.ts +45 -0
- package/dist/coding-standards.d.ts.map +1 -0
- package/dist/coding-standards.js +1152 -0
- package/dist/coding-standards.js.map +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -6
- package/dist/constants.js.map +1 -1
- package/dist/context-manager.d.ts +6 -0
- package/dist/context-manager.d.ts.map +1 -1
- package/dist/context-manager.js +23 -4
- package/dist/context-manager.js.map +1 -1
- package/dist/index.d.ts +28 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/llm-client.d.ts +8 -3
- package/dist/llm-client.d.ts.map +1 -1
- package/dist/llm-client.js +64 -13
- package/dist/llm-client.js.map +1 -1
- package/dist/plugin-auto-loader.d.ts +108 -0
- package/dist/plugin-auto-loader.d.ts.map +1 -0
- package/dist/plugin-auto-loader.js +743 -0
- package/dist/plugin-auto-loader.js.map +1 -0
- package/dist/plugin-registry.d.ts +112 -0
- package/dist/plugin-registry.d.ts.map +1 -0
- package/dist/plugin-registry.js +319 -0
- package/dist/plugin-registry.js.map +1 -0
- package/dist/plugin-types.d.ts +388 -0
- package/dist/plugin-types.d.ts.map +1 -0
- package/dist/plugin-types.js +8 -0
- package/dist/plugin-types.js.map +1 -0
- package/dist/plugin-validator.d.ts +54 -0
- package/dist/plugin-validator.d.ts.map +1 -0
- package/dist/plugin-validator.js +129 -0
- package/dist/plugin-validator.js.map +1 -0
- package/dist/repo-knowledge-graph.d.ts +112 -0
- package/dist/repo-knowledge-graph.d.ts.map +1 -0
- package/dist/repo-knowledge-graph.js +561 -0
- package/dist/repo-knowledge-graph.js.map +1 -0
- package/dist/role-registry.js +1 -1
- package/dist/role-registry.js.map +1 -1
- package/dist/self-debug-loop.d.ts +257 -0
- package/dist/self-debug-loop.d.ts.map +1 -0
- package/dist/self-debug-loop.js +870 -0
- package/dist/self-debug-loop.js.map +1 -0
- package/dist/skill-learner.d.ts +136 -0
- package/dist/skill-learner.d.ts.map +1 -0
- package/dist/skill-learner.js +382 -0
- package/dist/skill-learner.js.map +1 -0
- package/dist/skill-loader.d.ts +90 -0
- package/dist/skill-loader.d.ts.map +1 -0
- package/dist/skill-loader.js +309 -0
- package/dist/skill-loader.js.map +1 -0
- package/dist/specialist-registry.d.ts +132 -0
- package/dist/specialist-registry.d.ts.map +1 -0
- package/dist/specialist-registry.js +413 -0
- package/dist/specialist-registry.js.map +1 -0
- package/dist/sub-agent-prompts.d.ts +45 -0
- package/dist/sub-agent-prompts.d.ts.map +1 -0
- package/dist/sub-agent-prompts.js +177 -0
- package/dist/sub-agent-prompts.js.map +1 -0
- package/dist/sub-agent-router.d.ts +75 -0
- package/dist/sub-agent-router.d.ts.map +1 -0
- package/dist/sub-agent-router.js +174 -0
- package/dist/sub-agent-router.js.map +1 -0
- package/dist/sub-agent.d.ts +48 -0
- package/dist/sub-agent.d.ts.map +1 -1
- package/dist/sub-agent.js +108 -5
- package/dist/sub-agent.js.map +1 -1
- package/dist/system-prompt.d.ts +26 -0
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +177 -7
- package/dist/system-prompt.js.map +1 -1
- package/dist/task-classifier.d.ts +25 -1
- package/dist/task-classifier.d.ts.map +1 -1
- package/dist/task-classifier.js +171 -1
- package/dist/task-classifier.js.map +1 -1
- package/dist/tool-planner.d.ts +160 -0
- package/dist/tool-planner.d.ts.map +1 -0
- package/dist/tool-planner.js +501 -0
- package/dist/tool-planner.js.map +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/plugins/git/patterns/branch-patterns.json +101 -0
- package/plugins/git/patterns/commit-patterns.json +186 -0
- package/plugins/git/plugin.yaml +128 -0
- package/plugins/git/skills/branch-strategy.md +172 -0
- package/plugins/git/skills/commit-conv.md +178 -0
- package/plugins/git/skills/conflict-resolve.md +159 -0
- package/plugins/git/skills/history-clean.md +199 -0
- package/plugins/git/skills/pr-review.md +196 -0
- package/plugins/git/strategies/conflict-resolve.json +244 -0
- package/plugins/git/strategies/release-flow.json +292 -0
- package/plugins/git/validators/rules.json +348 -0
- package/plugins/react/patterns/anti-patterns.json +88 -0
- package/plugins/react/patterns/components.json +80 -0
- package/plugins/react/patterns/hooks.json +72 -0
- package/plugins/react/plugin.yaml +229 -0
- package/plugins/react/skills/bugfix.md +208 -0
- package/plugins/react/skills/component-gen.md +206 -0
- package/plugins/react/skills/hook-extract.md +208 -0
- package/plugins/react/skills/ssr.md +256 -0
- package/plugins/react/skills/test.md +273 -0
- package/plugins/react/strategies/build-fix.json +43 -0
- package/plugins/react/strategies/hook-loop-fix.json +36 -0
- package/plugins/react/strategies/hydration-fix.json +42 -0
- package/plugins/react/validators/rules.json +92 -0
- package/plugins/typescript/patterns/best-practices.json +25 -0
- package/plugins/typescript/patterns/common-errors.json +32 -0
- package/plugins/typescript/plugin.yaml +74 -0
- package/plugins/typescript/skills/debug.md +23 -0
- package/plugins/typescript/skills/migration.md +24 -0
- package/plugins/typescript/skills/refactor.md +22 -0
- package/plugins/typescript/skills/strict-mode.md +23 -0
- package/plugins/typescript/strategies/strict-migration.json +37 -0
- package/plugins/typescript/strategies/type-error-fix.json +37 -0
- package/plugins/typescript/validators/rules.json +28 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://yuaone.com/schemas/validators.json",
|
|
3
|
+
"name": "React Validation Rules",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Post-edit and quality validation rules for React code",
|
|
6
|
+
"validators": [
|
|
7
|
+
{
|
|
8
|
+
"id": "react-build-check",
|
|
9
|
+
"stage": "post",
|
|
10
|
+
"name": "React Build Verification",
|
|
11
|
+
"check": "pnpm build || next build || react-scripts build",
|
|
12
|
+
"severity": "error"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "react-typecheck",
|
|
16
|
+
"stage": "post",
|
|
17
|
+
"name": "TypeScript Type Check",
|
|
18
|
+
"check": "tsc --noEmit",
|
|
19
|
+
"severity": "error"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "react-lint-hooks",
|
|
23
|
+
"stage": "post",
|
|
24
|
+
"name": "React Hooks Lint",
|
|
25
|
+
"check": "eslint --rule 'react-hooks/rules-of-hooks: error' --rule 'react-hooks/exhaustive-deps: warn'",
|
|
26
|
+
"severity": "error"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "react-test-pass",
|
|
30
|
+
"stage": "post",
|
|
31
|
+
"name": "Test Suite Pass",
|
|
32
|
+
"check": "pnpm test --passWithNoTests || vitest run || jest --passWithNoTests",
|
|
33
|
+
"severity": "warning"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "no-prop-drilling-deep",
|
|
37
|
+
"stage": "quality",
|
|
38
|
+
"name": "No Deep Prop Drilling",
|
|
39
|
+
"check": "grep -rn '...props' --include='*.tsx' --include='*.jsx' | awk -F: '{print $1}' | sort | uniq -c | sort -rn | awk '$1 > 3 {print \"WARN: Deep prop drilling in \" $2 \" (\" $1 \" levels)\"}' ",
|
|
40
|
+
"severity": "warning"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "no-use-effect-in-render",
|
|
44
|
+
"stage": "quality",
|
|
45
|
+
"name": "No Side Effects in Render Body",
|
|
46
|
+
"check": "grep -rn 'fetch\\|axios\\|XMLHttpRequest' --include='*.tsx' --include='*.jsx' | grep -v 'useEffect\\|useCallback\\|useMemo\\|import\\|require\\|//\\|\\*'",
|
|
47
|
+
"severity": "warning"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "no-any-types",
|
|
51
|
+
"stage": "quality",
|
|
52
|
+
"name": "No Untyped Any",
|
|
53
|
+
"check": "grep -rn ': any\\b\\|as any\\b' --include='*.ts' --include='*.tsx' | grep -v 'node_modules\\|.d.ts\\|// eslint-disable'",
|
|
54
|
+
"severity": "warning"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "no-dangerous-inner-html-unsanitized",
|
|
58
|
+
"stage": "safety",
|
|
59
|
+
"name": "No Unsanitized dangerouslySetInnerHTML",
|
|
60
|
+
"check": "grep -rn 'dangerouslySetInnerHTML' --include='*.tsx' --include='*.jsx' | grep -v 'DOMPurify\\|sanitize\\|purify\\|xss'",
|
|
61
|
+
"severity": "critical"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "no-eval-usage",
|
|
65
|
+
"stage": "safety",
|
|
66
|
+
"name": "No eval() or new Function()",
|
|
67
|
+
"check": "grep -rn 'eval(\\|new Function(' --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' | grep -v 'node_modules\\|.d.ts'",
|
|
68
|
+
"severity": "critical"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "no-exposed-secrets",
|
|
72
|
+
"stage": "safety",
|
|
73
|
+
"name": "No Exposed Secrets in Client Code",
|
|
74
|
+
"check": "grep -rn 'NEXT_PUBLIC_.*SECRET\\|NEXT_PUBLIC_.*KEY.*=\\|process\\.env\\.' --include='*.tsx' --include='*.jsx' | grep -v 'NEXT_PUBLIC_\\|node_modules'",
|
|
75
|
+
"severity": "critical"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "accessible-interactive-elements",
|
|
79
|
+
"stage": "quality",
|
|
80
|
+
"name": "Interactive Elements Have Accessible Names",
|
|
81
|
+
"check": "grep -rn '<button\\|<a \\|role=\"button\"' --include='*.tsx' --include='*.jsx' | grep -v 'aria-label\\|aria-labelledby\\|>.*</'",
|
|
82
|
+
"severity": "warning"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "no-index-key",
|
|
86
|
+
"stage": "quality",
|
|
87
|
+
"name": "No Array Index as Key",
|
|
88
|
+
"check": "grep -rn 'key={.*index\\|}' --include='*.tsx' --include='*.jsx' | grep -v 'node_modules'",
|
|
89
|
+
"severity": "warning"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"patterns": [
|
|
3
|
+
{
|
|
4
|
+
"id": "prefer-const",
|
|
5
|
+
"name": "Prefer Const",
|
|
6
|
+
"detect": "let\\s+\\w+\\s*=",
|
|
7
|
+
"action": "suggest",
|
|
8
|
+
"template": "Use `const` unless reassigned"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "explicit-return-type",
|
|
12
|
+
"name": "Explicit Return Type",
|
|
13
|
+
"detect": "export\\s+(async\\s+)?function\\s+\\w+\\([^)]*\\)\\s*\\{",
|
|
14
|
+
"action": "suggest",
|
|
15
|
+
"template": "Add explicit return type annotation for exported functions"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "avoid-any",
|
|
19
|
+
"name": "Avoid Any Type",
|
|
20
|
+
"detect": ":\\s*any\\b",
|
|
21
|
+
"action": "warn",
|
|
22
|
+
"template": "Replace `any` with a specific type or `unknown`"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"patterns": [
|
|
3
|
+
{
|
|
4
|
+
"id": "implicit-any",
|
|
5
|
+
"name": "Implicit Any Parameter",
|
|
6
|
+
"detect": "Parameter '\\w+' implicitly has an 'any' type",
|
|
7
|
+
"action": "auto-fix",
|
|
8
|
+
"template": "Add explicit type annotation: `{param}: {suggestedType}`"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "null-assignment",
|
|
12
|
+
"name": "Null Assignment",
|
|
13
|
+
"detect": "Type 'null' is not assignable",
|
|
14
|
+
"action": "auto-fix",
|
|
15
|
+
"template": "Use optional type: `{type} | null` or `{type} | undefined`"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "missing-property",
|
|
19
|
+
"name": "Missing Object Property",
|
|
20
|
+
"detect": "Property '\\w+' does not exist on type",
|
|
21
|
+
"action": "suggest",
|
|
22
|
+
"template": "Extend interface or use type assertion"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "module-not-found",
|
|
26
|
+
"name": "Module Not Found",
|
|
27
|
+
"detect": "Cannot find module '.*'",
|
|
28
|
+
"action": "auto-fix",
|
|
29
|
+
"template": "Install missing dependency: `pnpm add {module}` or `pnpm add -D @types/{module}`"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: "@yuaone/plugin-typescript"
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: "TypeScript 전문 에이전트 스킬팩 — 타입 에러 해결, strict 모드 마이그레이션, 리팩토링"
|
|
4
|
+
author: "yuaone"
|
|
5
|
+
license: "MIT"
|
|
6
|
+
yuan_version: ">=0.1.0"
|
|
7
|
+
|
|
8
|
+
detect:
|
|
9
|
+
files:
|
|
10
|
+
- "tsconfig.json"
|
|
11
|
+
dependencies:
|
|
12
|
+
- "typescript"
|
|
13
|
+
|
|
14
|
+
type: "hybrid"
|
|
15
|
+
trustLevel: "official"
|
|
16
|
+
category: "coding"
|
|
17
|
+
|
|
18
|
+
skills:
|
|
19
|
+
- id: "ts-strict"
|
|
20
|
+
name: "TypeScript Strict Mode"
|
|
21
|
+
description: "strict 모드 활성화 + 기존 코드 마이그레이션"
|
|
22
|
+
trigger:
|
|
23
|
+
kind: "command"
|
|
24
|
+
command: "/skill ts-strict"
|
|
25
|
+
|
|
26
|
+
- id: "ts-migrate"
|
|
27
|
+
name: "JS → TS Migration"
|
|
28
|
+
description: "JavaScript 프로젝트를 TypeScript로 점진적 마이그레이션"
|
|
29
|
+
trigger:
|
|
30
|
+
kind: "command"
|
|
31
|
+
command: "/skill ts-migrate"
|
|
32
|
+
|
|
33
|
+
- id: "ts-refactor"
|
|
34
|
+
name: "Type-Safe Refactoring"
|
|
35
|
+
description: "타입 안전성을 보장하면서 리팩토링"
|
|
36
|
+
trigger:
|
|
37
|
+
kind: "file_pattern"
|
|
38
|
+
pattern: "*.ts"
|
|
39
|
+
|
|
40
|
+
- id: "ts-debug"
|
|
41
|
+
name: "TypeScript Error Debug"
|
|
42
|
+
description: "TS 컴파일 에러 자동 진단 + 수정"
|
|
43
|
+
trigger:
|
|
44
|
+
kind: "auto"
|
|
45
|
+
confidence: 0.8
|
|
46
|
+
|
|
47
|
+
triggers:
|
|
48
|
+
- id: "ts-compile-error"
|
|
49
|
+
errorPattern: "TS\\d{4}:"
|
|
50
|
+
skillId: "ts-debug"
|
|
51
|
+
priority: 90
|
|
52
|
+
- id: "ts-type-mismatch"
|
|
53
|
+
errorPattern: "Type '.*' is not assignable to type"
|
|
54
|
+
skillId: "ts-debug"
|
|
55
|
+
priority: 85
|
|
56
|
+
|
|
57
|
+
tools:
|
|
58
|
+
- name: "tsc-check"
|
|
59
|
+
description: "TypeScript 컴파일 체크 (tsc --noEmit)"
|
|
60
|
+
inputSchema:
|
|
61
|
+
type: "object"
|
|
62
|
+
properties:
|
|
63
|
+
project:
|
|
64
|
+
type: "string"
|
|
65
|
+
description: "tsconfig.json 경로"
|
|
66
|
+
requiresApproval: false
|
|
67
|
+
riskLevel: "low"
|
|
68
|
+
|
|
69
|
+
permissions:
|
|
70
|
+
fileRead: true
|
|
71
|
+
fileWrite: true
|
|
72
|
+
shellExec: true
|
|
73
|
+
networkAccess: false
|
|
74
|
+
gitOps: false
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Identity
|
|
2
|
+
TypeScript 컴파일 에러 진단 전문가. TS 에러 코드(TS2xxx)를 해석하고 최적 수정안을 제시.
|
|
3
|
+
|
|
4
|
+
## Known Error Patterns
|
|
5
|
+
- `TS2304: Cannot find name` → import 누락, 타입 정의 설치 필요 (@types/xxx)
|
|
6
|
+
- `TS2339: Property does not exist on type` → 타입 단언, 옵셔널 체이닝, 인터페이스 확장
|
|
7
|
+
- `TS2322: Type not assignable` → 타입 좁히기 (narrowing), type guard, as const
|
|
8
|
+
- `TS2345: Argument type mismatch` → 오버로드, 제네릭, 유니온 타입
|
|
9
|
+
- `TS2769: No overload matches` → 함수 시그니처 확인, 타입 파라미터 명시
|
|
10
|
+
- `TS1005: expected` → 구문 에러, 세미콜론/괄호 누락
|
|
11
|
+
- `TS18046: is of type unknown` → type guard 또는 as assertion
|
|
12
|
+
|
|
13
|
+
## Tool Sequence
|
|
14
|
+
1. `shell_exec` — `tsc --noEmit 2>&1` 로 전체 에러 수집
|
|
15
|
+
2. `grep` — 에러 코드별 분류 (TS2322, TS2339 등)
|
|
16
|
+
3. `file_read` — 에러 발생 파일 + 관련 타입 정의 확인
|
|
17
|
+
4. `file_edit` — 에러 수정 (가장 빈도 높은 것부터)
|
|
18
|
+
5. `shell_exec` — 수정 후 재검증
|
|
19
|
+
|
|
20
|
+
## Validation Checklist
|
|
21
|
+
- [ ] tsc --noEmit 에러 0개
|
|
22
|
+
- [ ] 새로운 @ts-ignore 없음
|
|
23
|
+
- [ ] 기존 타입 안전성 유지 (any 추가 없음)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## Identity
|
|
2
|
+
JavaScript → TypeScript 마이그레이션 전문가. 점진적 변환 전략으로 기존 JS 프로젝트를 TS로 안전하게 전환.
|
|
3
|
+
|
|
4
|
+
## Known Error Patterns
|
|
5
|
+
- `.js` 파일에서 import 실패 → allowJs: true, declaration: true 설정
|
|
6
|
+
- `require()` 사용 → ES module import로 변환
|
|
7
|
+
- `module.exports` → export default/named export
|
|
8
|
+
- JSDoc 타입 → TypeScript 타입 주석
|
|
9
|
+
- any 타입 남용 → 점진적 타입 강화
|
|
10
|
+
|
|
11
|
+
## Tool Sequence
|
|
12
|
+
1. `glob` — 프로젝트 내 .js/.jsx 파일 목록 수집
|
|
13
|
+
2. `file_read` — package.json, 기존 설정 파일 확인
|
|
14
|
+
3. `shell_exec` — `npx tsc --init` 또는 tsconfig.json 생성/수정
|
|
15
|
+
4. `file_edit` — .js → .ts 확장자 변경 (점진적, 의존성 순서)
|
|
16
|
+
5. `shell_exec` — 각 변환 후 `tsc --noEmit` 검증
|
|
17
|
+
6. `file_edit` — import 경로 업데이트
|
|
18
|
+
|
|
19
|
+
## Validation Checklist
|
|
20
|
+
- [ ] tsconfig.json 적절히 설정됨
|
|
21
|
+
- [ ] 핵심 파일 .ts로 변환 완료
|
|
22
|
+
- [ ] 타입 에러 0개 (또는 @ts-ignore로 표시된 의도적 무시만)
|
|
23
|
+
- [ ] 빌드 성공
|
|
24
|
+
- [ ] 기존 테스트 통과
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Identity
|
|
2
|
+
TypeScript 타입 안전 리팩토링 전문가. 타입 시스템을 활용하여 안전하게 코드 구조를 개선.
|
|
3
|
+
|
|
4
|
+
## Known Error Patterns
|
|
5
|
+
- 리팩토링 후 타입 불일치 → 제네릭/유니온 타입으로 해결
|
|
6
|
+
- 인터페이스 변경 시 구현체 미반영 → 모든 implements 검색 후 업데이트
|
|
7
|
+
- 함수 시그니처 변경 → 모든 호출처 업데이트 (grep + file_edit)
|
|
8
|
+
- 네임스페이스 충돌 → re-export 또는 alias
|
|
9
|
+
|
|
10
|
+
## Tool Sequence
|
|
11
|
+
1. `code_search` — 리팩토링 대상 심볼의 모든 참조 찾기
|
|
12
|
+
2. `file_read` — 대상 파일과 의존 파일 분석
|
|
13
|
+
3. `file_edit` — 인터페이스/타입 먼저 수정 (SSOT)
|
|
14
|
+
4. `file_edit` — 구현체 수정
|
|
15
|
+
5. `shell_exec` — `tsc --noEmit` 타입 체크
|
|
16
|
+
6. `shell_exec` — 테스트 실행
|
|
17
|
+
|
|
18
|
+
## Validation Checklist
|
|
19
|
+
- [ ] tsc --noEmit 에러 0개
|
|
20
|
+
- [ ] 모든 참조 업데이트됨 (grep 결과 0건)
|
|
21
|
+
- [ ] 테스트 통과
|
|
22
|
+
- [ ] 코드 라인 수 동일 또는 감소
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Identity
|
|
2
|
+
TypeScript strict 모드 전문가. tsconfig.json의 strict 옵션을 활성화하고 기존 코드를 마이그레이션.
|
|
3
|
+
|
|
4
|
+
## Known Error Patterns
|
|
5
|
+
- `TS7006: Parameter 'x' implicitly has an 'any' type` → 명시적 타입 주석 추가
|
|
6
|
+
- `TS2322: Type 'null' is not assignable` → strict null checks, optional chaining 적용
|
|
7
|
+
- `TS2532: Object is possibly 'undefined'` → null guard 추가 또는 non-null assertion
|
|
8
|
+
- `TS7053: Element implicitly has an 'any' type` → Record<string, T> 또는 index signature
|
|
9
|
+
- `TS2345: Argument of type 'string' is not assignable to parameter of type 'never'` → union type 확인
|
|
10
|
+
|
|
11
|
+
## Tool Sequence
|
|
12
|
+
1. `file_read` — tsconfig.json 현재 strict 설정 확인
|
|
13
|
+
2. `shell_exec` — `tsc --noEmit --strict 2>&1` 로 에러 목록 수집
|
|
14
|
+
3. `grep` — 에러 파일별 그룹핑
|
|
15
|
+
4. `file_edit` — 가장 빈도 높은 에러부터 수정
|
|
16
|
+
5. `shell_exec` — `tsc --noEmit` 재검증
|
|
17
|
+
|
|
18
|
+
## Validation Checklist
|
|
19
|
+
- [ ] tsconfig.json strict: true 설정됨
|
|
20
|
+
- [ ] noImplicitAny: true
|
|
21
|
+
- [ ] strictNullChecks: true
|
|
22
|
+
- [ ] tsc --noEmit 에러 0개
|
|
23
|
+
- [ ] 기존 런타임 동작 변경 없음
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "strict-migration",
|
|
3
|
+
"name": "TypeScript Strict Mode Migration",
|
|
4
|
+
"description": "점진적 strict 모드 활성화 전략",
|
|
5
|
+
"phases": [
|
|
6
|
+
{
|
|
7
|
+
"name": "audit",
|
|
8
|
+
"tools": ["file_read", "shell_exec"],
|
|
9
|
+
"maxIterations": 2,
|
|
10
|
+
"successCriteria": "현재 strict 설정 파악 + 에러 수 측정"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "enable-noImplicitAny",
|
|
14
|
+
"tools": ["file_edit", "shell_exec"],
|
|
15
|
+
"maxIterations": 20,
|
|
16
|
+
"successCriteria": "noImplicitAny 에러 0개"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "enable-strictNullChecks",
|
|
20
|
+
"tools": ["file_edit", "shell_exec"],
|
|
21
|
+
"maxIterations": 20,
|
|
22
|
+
"successCriteria": "strictNullChecks 에러 0개"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "enable-full-strict",
|
|
26
|
+
"tools": ["file_edit", "shell_exec"],
|
|
27
|
+
"maxIterations": 10,
|
|
28
|
+
"successCriteria": "strict: true, 에러 0개"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "verify",
|
|
32
|
+
"tools": ["shell_exec"],
|
|
33
|
+
"maxIterations": 1,
|
|
34
|
+
"successCriteria": "tsc --noEmit --strict 에러 0개 + 테스트 통과"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "type-error-fix",
|
|
3
|
+
"name": "TypeScript Type Error Fix Strategy",
|
|
4
|
+
"description": "TS 타입 에러를 체계적으로 수정하는 전략",
|
|
5
|
+
"phases": [
|
|
6
|
+
{
|
|
7
|
+
"name": "collect",
|
|
8
|
+
"tools": ["shell_exec"],
|
|
9
|
+
"maxIterations": 1,
|
|
10
|
+
"successCriteria": "tsc --noEmit 출력 수집 완료"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "categorize",
|
|
14
|
+
"tools": ["grep"],
|
|
15
|
+
"maxIterations": 2,
|
|
16
|
+
"successCriteria": "에러를 TS 코드별로 분류"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "fix-critical",
|
|
20
|
+
"tools": ["file_read", "file_edit"],
|
|
21
|
+
"maxIterations": 10,
|
|
22
|
+
"successCriteria": "TS2304 (missing), TS1005 (syntax) 에러 0개"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "fix-types",
|
|
26
|
+
"tools": ["file_read", "file_edit"],
|
|
27
|
+
"maxIterations": 15,
|
|
28
|
+
"successCriteria": "TS2322, TS2339, TS2345 에러 0개"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "verify",
|
|
32
|
+
"tools": ["shell_exec"],
|
|
33
|
+
"maxIterations": 1,
|
|
34
|
+
"successCriteria": "tsc --noEmit 에러 0개"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"validators": [
|
|
3
|
+
{
|
|
4
|
+
"id": "tsc-noEmit",
|
|
5
|
+
"stage": "post",
|
|
6
|
+
"name": "TypeScript Compile Check",
|
|
7
|
+
"check": "tsc --noEmit"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "no-any-added",
|
|
11
|
+
"stage": "quality",
|
|
12
|
+
"name": "No New Any Types",
|
|
13
|
+
"check": "git diff --cached | grep '+.*: any' | wc -l"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "no-ts-ignore",
|
|
17
|
+
"stage": "quality",
|
|
18
|
+
"name": "No New @ts-ignore",
|
|
19
|
+
"check": "git diff --cached | grep '+.*@ts-ignore' | wc -l"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "strict-deps",
|
|
23
|
+
"stage": "safety",
|
|
24
|
+
"name": "Dependencies Type Safety",
|
|
25
|
+
"check": "tsc --noEmit --strict"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|