Prompt file imported from zotoio/x-fidelity (
.cursor/commands/xfi-build.md). Copyright stays with the author.
xfi-build
Build the X-Fidelity monorepo and diagnose any build failures.
Instructions
-
Run the build from workspace root:
yarn build -
If build succeeds:
- Report success with build summary
- Note any warnings that should be addressed
-
If build fails:
- Use the xfi-build-expert subagent to diagnose the failure
- The subagent is expert in: Turbo, yarn workspaces, esbuild, TypeScript compilation
Build Commands Reference
# Build all packages with Turbo
yarn build
# Clean and rebuild everything
yarn build:clean
# Force rebuild without cache
yarn build:local
# Clean all build artifacts
yarn clean
# Build specific package
yarn workspace @x-fidelity/core build
yarn workspace @x-fidelity/plugins build
yarn workspace x-fidelity build
yarn workspace x-fidelity-vscode build
Package Dependency Order
The build must respect this dependency graph:
@x-fidelity/types
↓
@x-fidelity/core ← @x-fidelity/plugins
↓ ↓
x-fidelity (CLI) x-fidelity-vscode
Common Build Issues
- TypeScript errors: Check type definitions and imports
- Turbo cache issues: Try
yarn build:localto bypass cache - Dependency errors: Check workspace hoisting in root package.json
- esbuild issues: Review externals configuration
- Build order: Ensure dependencies are built first
Key Build Files
turbo.json- Task definitions and dependency graphpackage.json(root) - Workspace configurationpackages/*/package.json- Individual package configspackages/x-fidelity-cli/esbuild.config.js- CLI bundlingpackages/x-fidelity-vscode/esbuild.config.js- VSCode extension bundling
Output Format
## Build Results
### Status: [SUCCESS/FAILED]
### Build Summary
- Packages built: X
- Time: Xs
- Cache hits: X
### Errors (if any)
[Detailed error analysis]
### Warnings
[Any warnings to address]
### Recommended Fixes
[Specific actions to resolve build failures]
