project-detection

Resolve a project's root directory from nested paths with safety checks.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ai-sand-castles/local-marketplace --skill project-detection-ai-sand-castles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: project-detection
Source: https://github.com/ai-sand-castles/local-marketplace/tree/main/test-automation-plugin/skills/project-detection
Command: npx skills add https://github.com/ai-sand-castles/local-marketplace --skill project-detection-ai-sand-castles

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Locating the correct project root from any path within a project is error-prone and risky when executed from the wrong location. This skill provides reliable root resolution with safeguards to prevent writing to the plugin directory or outside the intended project.

Core Features & Use Cases

  • Language-aware root discovery using language-specific markers (e.g., pyproject.toml, package.json, pom.xml, go.mod) and boundaries such as version-control roots.
  • Safety validations including existence, writability, and exclusions for the plugin repository to prevent accidental writes to system or plugin directories.
  • Works across multi-language projects and monorepos, resolving the closest appropriate root from nested paths and guiding downstream tooling for test placement and build interactions.

Quick Start

Provide a path inside your project and receive the detected root, marker, and language for downstream tooling.

Frequently Asked Questions about project-detection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find the project root directory from a nested file path?

To find the project root directory from a nested path, this skill locates the closest language-specific marker file like package.json or go.mod and validates boundaries to ensure accurate resolution across various project structures.

Does project root detection work for monorepos with multiple programming languages?

Project root detection works effectively for monorepos by resolving the closest appropriate root from nested paths across multi-language projects, guiding downstream tooling for test placement and build interactions.

How can I prevent file operations from writing outside the intended project boundaries?

To prevent writing outside intended project boundaries, this skill enforces safety validations including existence and writability checks, explicitly excluding plugin repositories and system directories from root resolution.

What marker files are used to identify the root of a Python or JavaScript project?

Marker files used to identify the root of a Python or JavaScript project include language-specific manifests like pyproject.toml and package.json, alongside version-control boundaries to resolve the correct directory.

Why does root directory detection fail and return an error in my build system?

Root directory detection fails and returns an actionable error when safety checks for existence or writability are not met, providing specific guidance when a valid project root cannot be determined from the given path.

Can I use this root resolution logic for a Go or Java project structure?

You can use this root resolution logic for Go or Java project structures because it applies language-aware discovery using specific markers like go.mod and pom.xml to accurately resolve the project root.