From c7a65af47599f89c0e61b2f7cb7948de1f19ae99 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 9 Dec 2025 16:21:56 +0900 Subject: [PATCH] refactor(features): rename command-loader and skill-loader with claude-code prefix --- notepad.md | 84 +++++++++++++++++++ .../index.ts | 0 .../loader.ts | 0 .../types.ts | 0 .../index.ts | 0 .../loader.ts | 2 +- .../types.ts | 2 +- src/index.ts | 4 +- 8 files changed, 88 insertions(+), 4 deletions(-) rename src/features/{command-loader => claude-code-command-loader}/index.ts (100%) rename src/features/{command-loader => claude-code-command-loader}/loader.ts (100%) rename src/features/{command-loader => claude-code-command-loader}/types.ts (100%) rename src/features/{skill-loader => claude-code-skill-loader}/index.ts (100%) rename src/features/{skill-loader => claude-code-skill-loader}/loader.ts (97%) rename src/features/{skill-loader => claude-code-skill-loader}/types.ts (77%) diff --git a/notepad.md b/notepad.md index 3ede31a..e53266f 100644 --- a/notepad.md +++ b/notepad.md @@ -141,3 +141,87 @@ All tasks execution STARTED: Thu Dec 4 16:52:57 KST 2025 --- +## [2025-12-09 16:13] - Task 1: Add file-based logger to shared module + +### DISCOVERED ISSUES +- None - straightforward file copy and modification task + +### IMPLEMENTATION DECISIONS +- Copied logger.ts from opencode-cc-plugin source +- Changed log file path from `opencode-cc-plugin.log` to `oh-my-opencode.log` +- Added barrel export from `src/shared/index.ts` +- Kept original comment for module description + +### PROBLEMS FOR NEXT TASKS +- None identified - logger is now available for use in all new loaders + +### VERIFICATION RESULTS +- Ran: `bun run typecheck` → exit 0, no errors +- Log file path verified: `/tmp/oh-my-opencode.log` +- Exports verified: `log()` and `getLogFilePath()` now accessible via `src/shared` + +### LEARNINGS +- Source file location: `~/local-workspaces/opencode-cc-plugin/src/shared/logger.ts` +- Logger uses `fs.appendFileSync` for synchronous file writing +- Empty catch block intentionally swallows errors to prevent logging from breaking main operations + +소요 시간: ~1분 + +--- + +## [2025-12-09 16:14] - Task 3: Rename skill-loader to claude-code-skill-loader + +### DISCOVERED ISSUES +- None - straightforward directory rename task + +### IMPLEMENTATION DECISIONS +- Used `mv` command to rename `src/features/skill-loader/` → `src/features/claude-code-skill-loader/` +- Updated import path in `src/index.ts` (lines 19-22) +- Did NOT modify internal imports (`../command-loader/types`) since command-loader still exists (Task 2 runs in parallel) + +### PROBLEMS FOR NEXT TASKS +- If Task 2 renames command-loader to claude-code-command-loader, the internal imports in claude-code-skill-loader will need to be updated as part of Task 2's scope +- The skill-loader's loader.ts:6 and types.ts:1 import from `../command-loader/types` + +### VERIFICATION RESULTS +- Ran: `bun run typecheck` → exit 0, no errors +- Ran: `bun run build` → exit 0, succeeded +- Directory structure verified: `skill-loader/` deleted, `claude-code-skill-loader/` exists + +### LEARNINGS +- This project uses `mv` for directory rename (acceptable per ANTI-PATTERNS - file creation is forbidden, not rename) +- Command: `bun run typecheck` for type check, `bun run build` for build +- skill-loader internal imports use relative paths (`../command-loader/types`) which remain valid after rename + +소요 시간: ~2분 + +--- + +## [2025-12-09 16:16] - Task 2: Rename command-loader to claude-code-command-loader + +### DISCOVERED ISSUES +- skill-loader (now claude-code-skill-loader) was importing `CommandDefinition` from `../command-loader/types` +- After renaming command-loader, these references also needed updating + +### IMPLEMENTATION DECISIONS +- Used `mv` command: `src/features/command-loader/` → `src/features/claude-code-command-loader/` +- Updated import path in `src/index.ts` (lines 13-18) +- Also updated `claude-code-skill-loader/loader.ts:6` and `types.ts:1` to reference new path + +### PROBLEMS FOR NEXT TASKS +- None identified - all dependent imports updated + +### VERIFICATION RESULTS +- Ran: `bun run typecheck` → exit 0, no errors +- Directory structure verified: `command-loader/` deleted, `claude-code-command-loader/` exists +- All imports updated: src/index.ts, claude-code-skill-loader/loader.ts, claude-code-skill-loader/types.ts + +### LEARNINGS +- skill-loader depends on command-loader's `CommandDefinition` type via relative import +- When renaming shared modules, must update ALL dependent modules' imports +- Task 2 and Task 3 have an implicit dependency through the type import + +소요 시간: ~2분 + +--- + diff --git a/src/features/command-loader/index.ts b/src/features/claude-code-command-loader/index.ts similarity index 100% rename from src/features/command-loader/index.ts rename to src/features/claude-code-command-loader/index.ts diff --git a/src/features/command-loader/loader.ts b/src/features/claude-code-command-loader/loader.ts similarity index 100% rename from src/features/command-loader/loader.ts rename to src/features/claude-code-command-loader/loader.ts diff --git a/src/features/command-loader/types.ts b/src/features/claude-code-command-loader/types.ts similarity index 100% rename from src/features/command-loader/types.ts rename to src/features/claude-code-command-loader/types.ts diff --git a/src/features/skill-loader/index.ts b/src/features/claude-code-skill-loader/index.ts similarity index 100% rename from src/features/skill-loader/index.ts rename to src/features/claude-code-skill-loader/index.ts diff --git a/src/features/skill-loader/loader.ts b/src/features/claude-code-skill-loader/loader.ts similarity index 97% rename from src/features/skill-loader/loader.ts rename to src/features/claude-code-skill-loader/loader.ts index 257d4e2..700c677 100644 --- a/src/features/skill-loader/loader.ts +++ b/src/features/claude-code-skill-loader/loader.ts @@ -3,7 +3,7 @@ import { homedir } from "os" import { join, resolve } from "path" import { parseFrontmatter } from "../../shared/frontmatter" import { sanitizeModelField } from "../../shared/model-sanitizer" -import type { CommandDefinition } from "../command-loader/types" +import type { CommandDefinition } from "../claude-code-command-loader/types" import type { SkillScope, SkillMetadata, LoadedSkillAsCommand } from "./types" function loadSkillsFromDir(skillsDir: string, scope: SkillScope): LoadedSkillAsCommand[] { diff --git a/src/features/skill-loader/types.ts b/src/features/claude-code-skill-loader/types.ts similarity index 77% rename from src/features/skill-loader/types.ts rename to src/features/claude-code-skill-loader/types.ts index 03e4c9e..4b7b555 100644 --- a/src/features/skill-loader/types.ts +++ b/src/features/claude-code-skill-loader/types.ts @@ -1,4 +1,4 @@ -import type { CommandDefinition } from "../command-loader/types" +import type { CommandDefinition } from "../claude-code-command-loader/types" export type SkillScope = "user" | "project" diff --git a/src/index.ts b/src/index.ts index 49ab4e1..e617b0e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,11 +15,11 @@ import { loadProjectCommands, loadOpencodeGlobalCommands, loadOpencodeProjectCommands, -} from "./features/command-loader"; +} from "./features/claude-code-command-loader"; import { loadUserSkillsAsCommands, loadProjectSkillsAsCommands, -} from "./features/skill-loader"; +} from "./features/claude-code-skill-loader"; import { updateTerminalTitle } from "./features/terminal"; import { builtinTools } from "./tools"; import { createBuiltinMcps } from "./mcp";