Mono Detect
Invoke as $mono-detect.
Use this skill to detect a pnpm workspace monorepo and generate the .agents/monorepo.json artifact consumed by the monorepo pack.
mono-detect is the foundation skill for mono-exec, mono-ship, and mono-guard. Those skills use its output to inject monorepo-aware pre/post steps into the standard $exec and $ship contracts without duplicating the base workflow.
Augmentation Injection Pattern
mono-detect is the pack's detection foundation for the augmentation injection pattern. It does not replace $exec, $ship, or base monorepo planning skills; it supplies .agents/monorepo.json so mono-exec, mono-ship, and mono-guard can inject monorepo-aware pre-flight and post-integration checks around those existing workflows.
Process
- Resolve the target repository root.
- Use
$ARGUMENTS as the root when provided.
- Otherwise use the current working directory.
- Locate the pack script relative to this skill:
../../scripts/mono-detect.sh from the monorepo pack root.
- Check whether
.agents/monorepo.json is fresh:
- Run
packs/monorepo/scripts/mono-detect.sh <root> --check-stale.
- If it prints
fresh: .agents/monorepo.json, keep the existing artifact.
- If the file is missing, stale, or the check does not report fresh, run
packs/monorepo/scripts/mono-detect.sh <root> to regenerate it.
- If detection fails because
pnpm-workspace.yaml is missing:
- Report that the project is not a detected pnpm monorepo.
- Suggest
$mono-migrate as a future V2 migration route when the user wants to convert a single-app project.
- Do not create
.agents/monorepo.json by hand.
- Read
.agents/monorepo.json and summarize:
- Workspace manager.
- Build orchestrator (
turborepo when turbo.json is present, otherwise none).
- Package count and package paths.
- Internal dependency graph edges.
- Turborepo pipeline names.
- Report staleness behavior:
- Mention that the artifact is regenerated when
pnpm-workspace.yaml, turbo.json, or workspace package.json files are newer than .agents/monorepo.json.
- Route the next step:
- If detection passed and the user is preparing execution, recommend
$mono-exec.
- If detection passed and the user is checking lane safety, recommend
$mono-guard.
- If detection failed because this is not a pnpm monorepo, recommend
$mono-migrate as the V2 advisory route.
Output
- Detection: detected, fresh, regenerated, or not detected.
- Workspace: manager, build orchestrator, root path.
- Packages: count plus package name/path list.
- Dependency graph: internal dependency edges; say
none when no internal edges exist.
- Turbo pipelines: pipeline names when present; say
none when Turborepo is absent.
- Artifact:
.agents/monorepo.json path and whether it was reused or regenerated.
- Next work: concrete follow-up.
- Recommended next command: one command.
Constraints
- Do not edit task files.
- Do not run package manager install/add commands.
- Do not infer non-pnpm workspace managers in V1.
- Do not modify
.agents/monorepo.json manually; use mono-detect.sh.
- Treat
mono-detect as an augmentation foundation for mono-exec, mono-ship, and mono-guard, not as a replacement for $exec, $ship, or base monorepo planning skills.
Default Shipping Contract
Follow the shared shipping contract convention in CLAUDE.md.
1---2name: mono-detect3description: Detect pnpm workspace structure, optional Turborepo overlay, package metadata, and internal dependency graph for monorepo-aware skills4---56# Mono Detect78Invoke as `$mono-detect`.910Use this skill to detect a pnpm workspace monorepo and generate the `.agents/monorepo.json` artifact consumed by the monorepo pack.1112`mono-detect` is the foundation skill for `mono-exec`, `mono-ship`, and `mono-guard`. Those skills use its output to inject monorepo-aware pre/post steps into the standard `$exec` and `$ship` contracts without duplicating the base workflow.1314## Augmentation Injection Pattern1516`mono-detect` is the pack's detection foundation for the augmentation injection pattern. It does not replace `$exec`, `$ship`, or base monorepo planning skills; it supplies `.agents/monorepo.json` so `mono-exec`, `mono-ship`, and `mono-guard` can inject monorepo-aware pre-flight and post-integration checks around those existing workflows.1718## Process19201. Resolve the target repository root.21 - Use `$ARGUMENTS` as the root when provided.22 - Otherwise use the current working directory.232. Locate the pack script relative to this skill: `../../scripts/mono-detect.sh` from the monorepo pack root.243. Check whether `.agents/monorepo.json` is fresh:25 - Run `packs/monorepo/scripts/mono-detect.sh <root> --check-stale`.26 - If it prints `fresh: .agents/monorepo.json`, keep the existing artifact.27 - If the file is missing, stale, or the check does not report fresh, run `packs/monorepo/scripts/mono-detect.sh <root>` to regenerate it.284. If detection fails because `pnpm-workspace.yaml` is missing:29 - Report that the project is not a detected pnpm monorepo.30 - Suggest `$mono-migrate` as a future V2 migration route when the user wants to convert a single-app project.31 - Do not create `.agents/monorepo.json` by hand.325. Read `.agents/monorepo.json` and summarize:33 - Workspace manager.34 - Build orchestrator (`turborepo` when `turbo.json` is present, otherwise none).35 - Package count and package paths.36 - Internal dependency graph edges.37 - Turborepo pipeline names.386. Report staleness behavior:39 - Mention that the artifact is regenerated when `pnpm-workspace.yaml`, `turbo.json`, or workspace `package.json` files are newer than `.agents/monorepo.json`.407. Route the next step:41 - If detection passed and the user is preparing execution, recommend `$mono-exec`.42 - If detection passed and the user is checking lane safety, recommend `$mono-guard`.43 - If detection failed because this is not a pnpm monorepo, recommend `$mono-migrate` as the V2 advisory route.4445## Output4647- **Detection:** detected, fresh, regenerated, or not detected.48- **Workspace:** manager, build orchestrator, root path.49- **Packages:** count plus package name/path list.50- **Dependency graph:** internal dependency edges; say `none` when no internal edges exist.51- **Turbo pipelines:** pipeline names when present; say `none` when Turborepo is absent.52- **Artifact:** `.agents/monorepo.json` path and whether it was reused or regenerated.53- **Next work:** concrete follow-up.54- **Recommended next command:** one command.5556## Constraints5758- Do not edit task files.59- Do not run package manager install/add commands.60- Do not infer non-pnpm workspace managers in V1.61- Do not modify `.agents/monorepo.json` manually; use `mono-detect.sh`.62- Treat `mono-detect` as an augmentation foundation for `mono-exec`, `mono-ship`, and `mono-guard`, not as a replacement for `$exec`, `$ship`, or base monorepo planning skills.6364## Default Shipping Contract6566Follow the shared shipping contract convention in CLAUDE.md.