skills/resolve-repo-context/SKILL.md
Use when a manager agent needs to determine the correct context root for a task and the repo type is not a plain project — workspaces, monorepos, and multi-module repos all require this resolution before delegating to sub-agents.
npx skillsauth add maestria-co/ai-playbook resolve-repo-contextInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill maps a task description to the correct sub-project root, context path, and skills directory before any implementation work begins. It detects repository topology from filesystem signals, matches the task to the right sub-project, and returns a structured result.
Run this skill as an isolated explore sub-agent — never inline in the manager's main context.
monorepo, workspace, or multi-module layout.context/, copilot-instructions.md, and project root govern the taskPassed via prompt from the manager:
| Field | Required | Description |
|-------|----------|-------------|
| cwd | Yes | Absolute path where the manager agent is running |
| task_description | Yes | Natural language description of the task |
Inspect the filesystem at cwd to determine repo_type:
| Signal | Repo type |
|--------|-----------|
| nx.json, turbo.json, go.work present | monorepo |
| *.code-workspace file present | workspace |
| package.json with "workspaces" field | monorepo |
| Root pom.xml with <modules> and no src/ | multi-module |
| Any single build manifest (package.json, go.mod, *.csproj, etc.) | project |
| No manifest found | project (fallback) |
If repo_type is project: return immediately with root = cwd. This skill is unnecessary for plain project repos.
For monorepo, workspace, or multi-module repos, scan for sub-projects:
*.code-workspace, root package.json#workspaces, nx.json)package.json, go.mod, Cargo.toml, *.csproj, pom.xml) in immediate subdirectories{ name, root } — name from the manifest's name field or directory nameMatch the task description to a sub-project using these signals in priority order. Stop at the first confident match.
Priority 1 — Explicit path or file reference in task description
Priority 2 — Domain or module keyword in task description
Priority 3 — Filesystem fallback
scope: cross-project and resolve root to git root or lowest common ancestorReturn exactly this schema:
{
"repo_type": "monorepo | workspace | multi-module | project",
"resolved_context": {
"scope": "sub-project | repo-root | cross-project",
"root": "/absolute/path",
"git_root": "/absolute/path",
"instructions": "/absolute/path/.github/copilot-instructions.md",
"context": "/absolute/path/.context/",
"rationale": "human-readable explanation of why this root was chosen"
},
"available_skills": [
{
"name": "skill-name",
"description": "...",
"path": "/absolute/path/SKILL.md",
"user-invocable": true
}
],
"projects": [
{
"name": "sub-project-name",
"root": "/absolute/path",
"is_resolved_context": true
}
]
}
instructions: path to the canonical instructions file — use .claude/claude.md if present, otherwise .github/copilot-instructions.md.
available_skills: populated from the resolved context's skill directory. Return [] if no skill directory exists at the resolved root.
projects: list all discovered sub-projects. Set is_resolved_context: true on the matched project. For cross-project scope, mark all touched projects as true.
All paths must be absolute.
| Situation | Behavior |
|-----------|----------|
| repo_type: project detected in Step 1 | Return immediately with root = cwd, scope: sub-project, available_skills: [] |
| Task spans multiple sub-projects | scope: cross-project; root = git root or common ancestor; mark all touched projects |
| No .context/ in resolved sub-project | Return available_skills: []; root and path fields still resolve normally |
| Sub-project names conflict (two projects share a keyword) | Fall through to Priority 3; document ambiguity in rationale |
| Mistake | Fix | |---------|-----| | Running inline in the manager's context | Always dispatch as an isolated explore sub-agent | | Returning relative paths | Every path in the return schema must be absolute | | Invoking this skill for plain project repos | Check repo type first (Step 1); project repos return immediately | | Accepting an ambiguous keyword match as confident | Priority 2 only applies to confident matches; ambiguity falls through to Priority 3 |
development
Writes and runs a test suite for a piece of code, covering happy path, edge cases, error cases, and security cases. Use when: implementation is complete and needs test coverage, a bug needs a reproduction test and fix validation, or code needs coverage before a refactor. Do not use when: the code under test is not yet implemented, or the spec is still unclear.
testing
Use when creating a new skill, editing an existing skill, or helping a user author a skill for this system. Covers structure, discoverability, quality, and discipline hardening.
development
Evidence-based verification process to run before marking any task complete. Use this skill every time you're about to report that work is done — for features, bug fixes, refactoring, or any code change. This catches the most common failure mode: declaring "done" without proof. If you're finishing up and about to tell the user the task is complete, run this checklist first.
development
Teaches agents how to discover, select, and invoke skills from the skill library. Use this skill whenever you're uncertain which skill applies to a task, when composing multiple skills for complex work, or when you need to understand what skills are available. This is your go-to when facing an ambiguous task and need to figure out the right approach before diving into implementation.