Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/vinilana/dotcontext --skill refactoring명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| type | skill |
| name | Refactoring |
| description | Safe code refactoring with step-by-step approach |
| skillSlug | refactoring |
| phases | ["E"] |
| generated | "2026-03-18T00:00:00.000Z" |
| status | filled |
| scaffoldVersion | 2.0.0 |
Safe, systematic refactoring procedures for the @dotcontext/cli codebase.
any usageBefore starting any refactoring:
npm testnpm run buildThe project follows a directory-per-service pattern. To extract logic into a new service:
src/services/<name>/ directory// src/services/cache/cacheService.ts
export interface CacheServiceOptions {
repoPath: string;
cacheDir?: string;
}
export class CacheService {
private readonly repoPath: string;
private readonly cacheDir: string;
constructor(options: CacheServiceOptions) {
this.repoPath = options.repoPath;
this.cacheDir = options.cacheDir || '.context/.cache';
}
async get(key: string): Promise<string | null> { /* ... */ }
async set(key: string, value: string): Promise<void> { /* ... */ }
}
src/services/<name>/index.ts barrel:export { CacheService, CacheServiceOptions } from './cacheService';
src/services/<name>/cacheService.test.tsGateway handlers in src/services/mcp/gateway/ can grow large. To split:
export async function handleContext(params: ContextParams, options: ContextOptions): Promise<MCPToolResponse> {
switch (params.action) {
case 'check': return handleCheck(options);
case 'init': return handleInit(params, options);
// Each case delegates to a focused function
}
}
Common type improvements:
any with unknown: Then add type guards:// Before
function process(data: any) { return data.value; }
// After
function process(data: unknown): string {
if (typeof data === 'object' && data !== null && 'value' in data) {
return String((data as { value: unknown }).value);
}
throw new Error('Invalid data shape');
}
type ContextParams =
| { action: 'check'; repoPath?: string }
| { action: 'init'; repoPath?: string; type?: string }
| { action: 'fill'; repoPath?: string; target?: string };
AIContextMCPServer with contextBuilder).Common duplication spots in this project:
repoPath + outputDir. Extract to src/services/shared/.src/utils/frontMatter.ts.src/services/shared/ for existing utilities.createErrorResponse() from response.ts.When moving or renaming files, update the export chain:
src/services/mcp/gateway/<file>.ts -- implementation
-> src/services/mcp/gateway/index.ts -- gateway barrel
-> src/services/mcp/gatewayTools.ts -- compatibility barrel
-> src/services/mcp/mcpServer.ts -- consumer
npm test and npm run buildrefactor(<scope>): prefixnpx jest --testPathPattern="<area>" after each step.npm run build will catch broken imports, type mismatches, and missing exports.noUnusedLocals temporarily to find dead code after extraction.