$npx -y skills add testdouble/han --skill project-discoveryDiscovers the core attributes of the current code repository and its projects — languages, frameworks, tooling, and where things live — and writes a concise reference section directly into the project's AGENTS.md or CLAUDE.md for other skills, agents, and hooks to consume. Use wh
| 1 | ## Project Context |
| 2 | |
| 3 | - Default branch: !`git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || echo unknown` |
| 4 | - AGENTS.md: !`find . -maxdepth 1 -name "AGENTS.md" -type f` |
| 5 | - CLAUDE.md: !`find . -maxdepth 1 -name "CLAUDE.md" -type f` |
| 6 | - README: !`find . -maxdepth 1 -name "README*" -type f` |
| 7 | |
| 8 | # Project Discovery |
| 9 | |
| 10 | This skill discovers the project's core attributes and writes them as a concise |
| 11 | `## Project Discovery` section **directly into the project's AGENTS.md or |
| 12 | CLAUDE.md** — not a separate file. The output is small by design: a few notes on |
| 13 | where things live, the languages and frameworks, and the commands to run, so an |
| 14 | AI agent working in the repo can find its way around. It is not an exhaustive |
| 15 | inventory. |
| 16 | |
| 17 | ## Step 1: Choose and read the target file |
| 18 | |
| 19 | Pick the single file this discovery is written into, by priority: |
| 20 | |
| 21 | 1. If **AGENTS.md** exists (the label above is non-empty), the target is AGENTS.md. |
| 22 | 2. Otherwise, if **CLAUDE.md** exists, the target is CLAUDE.md. |
| 23 | 3. If neither exists, the target is a new **CLAUDE.md** at the repository root, which you will create in Step 4. |
| 24 | |
| 25 | If the target file already exists, read it in full and build the **deduplication |
| 26 | baseline**: a list of everything the file already documents that this skill would |
| 27 | otherwise write — directory and folder locations, languages, frameworks, package |
| 28 | manager, build/test/lint/dev commands, and the docs, ADR, and coding-standards |
| 29 | directories. Note whether the file already has a `## Project Discovery` section. |
| 30 | |
| 31 | If the target is a new CLAUDE.md, there is nothing to deduplicate against. |
| 32 | |
| 33 | ## Step 2: Discover repository structure |
| 34 | |
| 35 | Launch a `han-core:project-scanner` agent to determine whether the repository contains one project or many, and what each project's boundaries are. Wait for the agent to complete. |
| 36 | |
| 37 | From the agent's results, build a project list. Each entry has a project name (directory name, or repository name for a root-level project), root path, and dependency manifest path. |
| 38 | |
| 39 | ## Step 3: Explore project attributes |
| 40 | |
| 41 | Launch 3 `han-core:project-scanner` agents in parallel, each with a different focus area. Include the project list from Step 2 in each agent's prompt so they know which roots to explore. Keep each agent on the core facts an AI agent needs to navigate and run the project — not an exhaustive catalog of every config file. |
| 42 | |
| 43 | **Agent 1 — Languages and Frameworks:** For each project, read the dependency manifest to identify languages and version constraints. Determine the package manager from the lock file type. From dependencies, identify the structural/architectural frameworks that define how the project is built (web, frontend, test, ORM/database). Ignore utility packages. Note runtime version requirements. |
| 44 | |
| 45 | **Agent 2 — Commands:** For each project, find the task runner or build definition and extract the actual commands for installing dependencies, running tests, linting, building, and the dev server. Only record commands that actually exist — no guesses. |
| 46 | |
| 47 | **Agent 3 — Layout:** Map where the important things live: the main source directory or directories, the test location, and the documentation, ADR, and coding-standards directories — do not assume names like "docs". Capture only the handful of directories someone needs to know to find their way around the repo; skip incidental files. |
| 48 | |
| 49 | After all 3 agents complete, merge their findings, deduplicate across agents, and organize by project. Separate repository-level items (default branch, docs, ADRs, coding standards, layout) from project-level items (language, frameworks, package manager, commands). |
| 50 | |
| 51 | ## Step 4: Write the discovery into the target file |
| 52 | |
| 53 | Build a concise `## Project Discovery` section using the template at [template.md](./references/template.md) as the structural guide. |
| 54 | |
| 55 | Apply two filters before writing anything: |
| 56 | |
| 57 | - **Deduplicate.** Drop every fact already present in the target file (the Step 1 baseline). Do not restate what the file already says, even in different words. |
| 58 | - **Drop empties.** Omit any line with no discovered value. Never leave a `{placeholder}` behind, and never invent a command or path that was not discovered. |
| 59 | |
| 60 | If a discovered fact **contradicts** what the file already states (for example, the file says `make test` but no Makefile was discovered), use `AskUserQuestion` to surface the contradiction and ask wh |