feat(workspace-id): workspace-id を mutils から独立プラグインへ分離#68
Conversation
mutils 内の workspace-id スキルと workspace-id-persist フックを、新規 workspace-id プラグインへ移設する。進捗管理系の機能をプラグイン単位で 切り離せるようにし、利用者がプラグイン導入の可否で取捨選択できる状態にする。 workspace-id フォーマットの判定ロジックは cc-plugin-lib へ集約し、mutils の ccs-handoff と新プラグインの双方が単一の定義を共有する(プラグイン跨ぎの コード重複を排除)。 - cc-plugin-lib: isValidFeatureName / parseWorkspaceId を追加、0.0.5 へ - mutils: workspace-id 関連を削除、cc-plugin-lib 0.0.5 を参照、version 0.21.0 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
draw-diagram スキルの workspace-id 参照更新に伴い、repository-lint の require-version-bump ルールに従って plugin.json を 0.0.7 へ更新する。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR extracts workspace-id validation and persistence logic from mutils into a shared library and standalone plugin. A new ChangesWorkspace-ID Library and Plugin Migration
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
plugins/workspace-id/skills/workspace-id/generate.ts (1)
57-59: ⚡ Quick winConsider logging DB persistence failures.
The empty catch block silently ignores all DB errors. While the comment explains this is intentional, it may hide configuration issues or permission problems that would be useful to debug.
📝 Suggested improvement to add minimal error logging
- } catch { + } catch (err) { // Fail silently - workspace-id generation should still work + process.stderr.write(`Warning: Failed to persist workspace-id to DB: ${err}\n`); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/workspace-id/skills/workspace-id/generate.ts` around lines 57 - 59, The empty catch in plugins/workspace-id/skills/workspace-id/generate.ts swallows DB persistence errors; change it to log a minimal error message with the caught exception so failures are visible but do not interrupt workspace-id generation (e.g., in the catch block after the DB write, call console.warn or the module's logger with a short contextual message like "workspace-id DB persistence failed" and include the error object). Ensure you only add logging and do not rethrow so the existing behaviour of continuing generation remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/workspace-id/package.json`:
- Around line 10-13: The package.json in the workspace-id plugin is missing the
required prerequisite dependency mutils; update the "dependencies" object in
plugins/workspace-id/package.json to include "mutils" (the repository
prerequisite) alongside "`@r_masseater/cc-plugin-lib`" and "cc-hooks-ts" so the
plugin declares mutils as a dependency; ensure the version spec matches the repo
convention used by other plugins (e.g., same version string format used in other
plugins' package.json).
---
Nitpick comments:
In `@plugins/workspace-id/skills/workspace-id/generate.ts`:
- Around line 57-59: The empty catch in
plugins/workspace-id/skills/workspace-id/generate.ts swallows DB persistence
errors; change it to log a minimal error message with the caught exception so
failures are visible but do not interrupt workspace-id generation (e.g., in the
catch block after the DB write, call console.warn or the module's logger with a
short contextual message like "workspace-id DB persistence failed" and include
the error object). Ensure you only add logging and do not rethrow so the
existing behaviour of continuing generation remains.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4297e0c6-3154-45f8-a308-7cb61bbbb0b3
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (28)
.claude-plugin/marketplace.json.claude/rules/ai-generated/project-context.mdAGENTS.mdknip.jsonpackages/cc-plugin-lib/package.jsonpackages/cc-plugin-lib/src/index.tspackages/cc-plugin-lib/src/workspace-id.test.tspackages/cc-plugin-lib/src/workspace-id.tsplugins/diagram-render/plugin.jsonplugins/diagram-render/skills/draw-diagram/SKILL.mdplugins/mutils/AGENTS.mdplugins/mutils/README.mdplugins/mutils/hooks/hooks.jsonplugins/mutils/package.jsonplugins/mutils/plugin.jsonplugins/mutils/skills/ccs-handoff/ccs-handoff.tsplugins/mutils/skills/workspace-id/patterns.tsplugins/workspace-id/.oxlintrc.jsonplugins/workspace-id/AGENTS.mdplugins/workspace-id/CLAUDE.mdplugins/workspace-id/README.mdplugins/workspace-id/hooks/entry/workspace-id-persist.tsplugins/workspace-id/hooks/hooks.jsonplugins/workspace-id/package.jsonplugins/workspace-id/plugin.jsonplugins/workspace-id/skills/workspace-id/SKILL.mdplugins/workspace-id/skills/workspace-id/generate.tsplugins/workspace-id/tsconfig.json
💤 Files with no reviewable changes (4)
- plugins/mutils/AGENTS.md
- plugins/mutils/hooks/hooks.json
- plugins/mutils/skills/workspace-id/patterns.ts
- plugins/mutils/README.md
| "dependencies": { | ||
| "@r_masseater/cc-plugin-lib": "0.0.5", | ||
| "cc-hooks-ts": "2.1.94" | ||
| }, |
There was a problem hiding this comment.
Add the required mutils prerequisite dependency.
Line 10–Line 13 define plugin dependencies, but the required mutils prerequisite is missing. Please add the repository’s mutils package as the mandated prerequisite dependency for this plugin.
As per coding guidelines plugins/**/package.json: All plugins must have mutils as a prerequisite dependency.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/workspace-id/package.json` around lines 10 - 13, The package.json in
the workspace-id plugin is missing the required prerequisite dependency mutils;
update the "dependencies" object in plugins/workspace-id/package.json to include
"mutils" (the repository prerequisite) alongside "`@r_masseater/cc-plugin-lib`"
and "cc-hooks-ts" so the plugin declares mutils as a dependency; ensure the
version spec matches the repo convention used by other plugins (e.g., same
version string format used in other plugins' package.json).
Summary
mutils内のworkspace-idスキルとworkspace-id-persistフックを、新規workspace-idプラグインへ分離。進捗管理系の機能をプラグイン単位で取捨選択(導入可否)できるようにするisValidFeatureName/parseWorkspaceId)を@r_masseater/cc-plugin-libに集約。mutils(ccs-handoff) と新プラグインが単一定義を共有し、プラグイン跨ぎのコード重複を排除mutils:workspace-id→workspace-id)変更詳細
plugins/workspace-id/workspace-id+ hookworkspace-id-persist一式mutils0.0.5参照、plugin.json0.20.0→0.21.0cc-plugin-libsrc/workspace-id.ts(+ テスト)追加、0.0.4→0.0.5diagram-renderplugin.json0.0.6→0.0.7(repository-lint の require-version-bump 対応)リリース上の注意
monorepo(dev / CI)は workspace リンクで解決されるため green。ただしプラグインを 単体配布 する場合、
@r_masseater/cc-plugin-lib@0.0.5の npm 公開が前提となる。マージ後に cc-plugin-lib をリリースし、公開バージョンへプラグインの依存を揃える follow-up が必要。関連 issue:
gh issue listで検索したが該当なし。Test plan
turbo typecheck/turbo check全 workspace greenturbo test— cc-plugin-lib(workspace-id.test.ts含む)/ mutils / ops-harbor 系すべて passknip/check:lockfile/check:plugin-list/check:docs(0 errors)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
workspace-idplugin for workspace directory naming conventions and auto-compact/resume restorationUpdates
diagram-renderplugin to version 0.0.7mutilsplugin to version 0.21.0 with reorganized hook configurationDocumentation