mono-detect
Detect pnpm workspace structure, optional Turborepo overlay, package metadata, and internal dependency graph for monorepo-aware skills
SKILL.mdpacks/monorepo/claude/mono-detect/SKILL.md
GitHubMono 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
$ARGUMENTSas the root when provided. - Otherwise use the current working directory.
- Use
- Locate the pack script relative to this skill:
../../scripts/mono-detect.shfrom the monorepo pack root. - Check whether
.agents/monorepo.jsonis 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.
- Run
- If detection fails because
pnpm-workspace.yamlis missing:- Report that the project is not a detected pnpm monorepo.
- Suggest
/mono-migrateas a future V2 migration route when the user wants to convert a single-app project. - Do not create
.agents/monorepo.jsonby hand.
- Read
.agents/monorepo.jsonand summarize:- Workspace manager.
- Build orchestrator (
turborepowhenturbo.jsonis 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 workspacepackage.jsonfiles are newer than.agents/monorepo.json.
- Mention that the artifact is regenerated when
- 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-migrateas the V2 advisory route.
- If detection passed and the user is preparing execution, recommend
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
nonewhen no internal edges exist. - Turbo pipelines: pipeline names when present; say
nonewhen Turborepo is absent. - Artifact:
.agents/monorepo.jsonpath 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.jsonmanually; usemono-detect.sh. - Treat
mono-detectas an augmentation foundation formono-exec,mono-ship, andmono-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.