Agent skill
fix-hardcoded-workspaceid-pages
Use when asked to remove hardcoded workspaceId values from client pages and replace them with useWorkspace() + friendly loading/error states.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/fix-hardcoded-workspaceid-pages
SKILL.md
Goal: remove hardcoded workspaceId values from client-side pages and use useWorkspace() instead.
Workflow:
-
Locate hardcoded workspace IDs
- Search for
workspaceId =and the sentinel UUID00000000-0000-0000-0000-000000000000.
- Search for
-
Replace with
useWorkspace()- Import
useWorkspacefrom@/hooks/useWorkspace. - Destructure
{ workspaceId, loading: workspaceLoading, error: workspaceError }.
- Import
-
Ensure safe fetch execution
- Guard data loads: do not call APIs until
workspaceIdis available. - Add dependencies so effects re-run when
workspaceIdchanges.
- Guard data loads: do not call APIs until
-
Add friendly UI states
- While
workspaceLoading: show "Loading workspace…" - If
workspaceErroror missingworkspaceId: show a clear error card/message
- While
-
Validate
- Run
npm run typecheck. - Run the smallest tests that exercise the changed pages or helper logic.
- Run
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?