How this skill is triggered — by the user, by Claude, or both
Slash command
/flex-workflow:test-packageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill helps set up local testing environments for monorepo packages by linking them to application repositories using the portal protocol.
This skill helps set up local testing environments for monorepo packages by linking them to application repositories using the portal protocol.
When developing packages locally, you need to test them in actual applications before publishing. This skill automates the process of:
workspace:* to portal: protocolAsk the user for required information:
Which package repository do you want to test?
1. flex-frontend-packages
2. flex-frontend-services
3. flex-frontend-design-system
What is the package name you want to test?
(e.g., @flex-packages/utils, @flex-services/api, @flex-ds/button)
What is the path to your application repository?
(e.g., /Users/hyuntae/Projects/flex/flex-frontend-apps-performance-management)
What is the package name in the application's package.json?
(Usually same as the package name, e.g., @flex-packages/utils)
# Check if package repository exists
if [ -d "/Users/hyuntae/Projects/flex/flex-frontend-packages" ]; then
PACKAGE_REPO="/Users/hyuntae/Projects/flex/flex-frontend-packages"
elif [ -d "/Users/hyuntae/Projects/flex/flex-frontend-services" ]; then
PACKAGE_REPO="/Users/hyuntae/Projects/flex/flex-frontend-services"
elif [ -d "/Users/hyuntae/Projects/flex/flex-frontend-design-system" ]; then
PACKAGE_REPO="/Users/hyuntae/Projects/flex/flex-frontend-design-system"
else
echo "Error: Package repository not found"
exit 1
fi
cd "$PACKAGE_REPO"
# Run full build first
yarn turbo build
This ensures all packages and their dependencies are built.
cd "$PACKAGE_REPO"
# Change workspace:* to portal:path
yarn packages:change-protocol --protocol=portal
This script will:
workspace:* references in package.json filesportal:../relative/path referencesNote: To revert back to workspace protocol:
yarn packages:change-protocol --protocol=workspace
Locate the package in the application's package.json and update its reference:
Before:
{
"dependencies": {
"@flex-packages/utils": "workspace:*"
}
}
After:
{
"dependencies": {
"@flex-packages/utils": "portal:../../flex-frontend-packages/packages/utils"
}
}
Steps:
portal:relative/pathcd "$APPLICATION_REPO"
# Install with new portal reference
yarn install
This will create a symlink from the application's node_modules to the local package.
After making changes to the package, rebuild only that package:
cd "$PACKAGE_REPO"
# Build only the changed package
yarn turbo build --filter={package-name}
Example:
yarn turbo build --filter=@flex-packages/utils
The changes will be immediately reflected in the application since it's symlinked.
Show the user:
Calculate the relative path from application to package:
# Example paths:
# Application: /Users/hyuntae/Projects/flex/flex-frontend-apps-performance-management
# Package: /Users/hyuntae/Projects/flex/flex-frontend-packages/packages/utils
# Relative path: ../../flex-frontend-packages/packages/utils
Algorithm:
../ for each up, then append down pathError: Package repository not found at {path}
Please ensure the repository is cloned and accessible.
Error: Package {name} not found in {repo}
Available packages:
- @flex-packages/utils
- @flex-packages/api
...
Error: Script 'packages:change-protocol' not found in package.json
This script is required for changing workspace protocol.
Error: Turbo not found. Please ensure turbo is installed:
yarn add -D turbo
Error: package.json not found in {application_path}
Please check the application path is correct.
npx claudepluginhub flex-hyuntae/claude-plugins --plugin flex-workflowGuides monorepo workflows including local dev setup with Turborepo/pnpm, cross-package development, watch modes, CI/CD patterns, versioning, publishing, and Vite/Next.js configs.
Set up and optimize monorepos with Turborepo, Nx, pnpm workspaces for shared code, efficient builds, dependency management, and CI/CD.
Guides monorepo setup and optimization with Turborepo, Nx, and pnpm workspaces. Use when structuring multi-package repos, managing shared dependencies, or improving build performance.