Turborepo
This skill explains how Turborepo is used throughout the hr-skills monorepo. It covers workspace orchestration, task execution, caching, package filtering, and development workflows.
Turborepo coordinates tasks across every workspace package while Bun provides the runtime and package management.
Supported tasks
- Explain how Turborepo is used within this repository
- Run workspace tasks from the repository root
- Build workspace packages
- Validate HR skills and repository metadata
- Synchronize generated repository artifacts
- Generate the skill maturity matrix
- Run tests and TypeScript type checking
- Execute filtered workspace tasks
- Recommend efficient development workflows
- Explain Turborepo caching behavior
- Generate CI workflows using Turborepo
Repository usage
This repository uses Turborepo to orchestrate workspace tasks.
Current pipeline tasks include:
- build
- dev
- test
- typecheck
- validate
- sync
- matrix
Repository scripts invoke Turborepo from the workspace root while package-level scripts provide the implementation.
Workspace orchestration
Workspace packages define their own scripts.
Examples include:
packages/hr-skills-buildpackages/hr-skills-ref
Turborepo automatically coordinates task execution, dependency ordering, and caching across these packages.
Common commands
Run all workspace builds.
bun run build
Run development tasks.
bun run dev
Run repository validation.
bun run validate
Synchronize repository metadata.
bun run sync
Generate the skill maturity matrix.
bun run matrix
Generate the machine-readable skill registry.
bun run registry
Generate usage-informed relevance signals from evaluation golden fixtures.
bun run signals
Search the generated registry by text or domain.
bun run discover "<query>"
Get related-skill recommendations for a skill ID.
bun run recommend <skill-id>
Generate an execution plan for a user intent.
bun run plan "<intent>"
Generate a plan and run it through the workflow runtime.
bun run execute "<intent>"
Run the evaluation framework against eval/datasets.
bun run evaluate
Run every test suite.
bun run test
Run TypeScript type checking.
bun run typecheck
Execute a task directly with Turborepo.
turbo run build
Run a task for a single package.
turbo run build --filter=hr-skills-ref
Run validation for the build package only.
turbo run validate --filter=hr-skills-build
Key prompts
Repository workflows
- "Explain how Turborepo is used in this repository."
- "Describe the workspace task pipeline."
- "Explain how Bun and Turborepo work together."
- "List the repository tasks managed by Turborepo."
Development
- "Run every workspace build."
- "Run validation for the repository."
- "Synchronize generated repository artifacts."
- "Run tests across every workspace package."
Filtering
- "Run a task for a single workspace package."
- "Explain how
--filterworks." - "Recommend the correct package filter."
- "Generate filtered Turborepo commands."
CI
- "Generate a Turborepo CI workflow."
- "Recommend a validation pipeline."
- "Explain Turborepo caching."
- "Optimize workspace builds for CI."
Pipeline overview
Current repository tasks include:
| Task | Purpose |
|---|---|
build |
Build workspace packages |
dev |
Run development tasks |
test |
Execute package test suites |
typecheck |
Run TypeScript type checking |
validate |
Validate HR skills and repository metadata |
sync |
Synchronize generated repository artifacts |
matrix |
Generate docs/engineering/skill-matrix.md skill maturity snapshot |
registry |
Generate the machine-readable skill registry (registry/skills.json) |
signals |
Generate usage-informed relevance signals from evaluation golden fixtures |
discover |
Search the generated registry by text or domain |
recommend |
Get related-skill recommendations for a skill ID |
plan |
Generate an execution plan for a user intent |
execute |
Generate a plan and run it through the workflow runtime |
evaluate |
Run the evaluation framework against eval/datasets |
Examples
Build every workspace package.
bun run build
Validate the repository.
bun run validate
Synchronize generated files.
bun run sync
Generate the skill maturity matrix.
bun run matrix
Build only one package.
turbo run build --filter=hr-skills-ref
Run validation only for the build package.
turbo run validate --filter=hr-skills-build
CI recommendations
A typical validation workflow is:
bun install --frozen-lockfile
bun run typecheck
bun run validate
bun run matrix
bun run test
bun run build
Use Turborepo caching to avoid rebuilding unchanged packages.
Tasks such as sync and matrix intentionally disable caching because they
always operate on the latest repository state and write files as a side
effect. validate is cacheable (it only depends on ^build) — a repeat run
with no source changes replays cached results instead of re-validating.
Tips
- Execute workspace tasks from the repository root.
- Prefer repository scripts (
bun run ...) over invoking package scripts directly. - Use
--filterduring development to reduce execution time. - Let Turborepo determine task execution order.
- Keep task outputs deterministic to maximize cache effectiveness.
Common issues
- Running package scripts directly instead of using repository commands.
- Forgetting to use
--filterfor package-specific development. - Expecting cached results from tasks that explicitly disable caching.
- Running Turborepo outside the repository root.
- Defining inconsistent task names across workspace packages.
Best practices
- Use repository scripts for everyday development.
- Reserve direct
turbo runcommands for advanced workflows. - Keep task names consistent across every workspace package.
- Enable caching only for deterministic tasks.
- Use package filters to shorten development feedback loops.
- Allow Turborepo to manage workspace execution and dependency ordering.