{"slug":"project-discovery-2","title":"project-discovery","summary":"Discovers 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","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-15T13:11:54.591042Z","repo":{"url":"https://github.com/testdouble/han","stars":303,"forks":24,"license":"MIT","updatedAt":"2026-10-14T20:22:28Z"},"bodyHtml":"<hr>\n<h2>name: project-discovery\ndescription: &gt;\nDiscovers the core attributes of the current code repository and its projects — languages, frameworks, tooling, and\nwhere things live — and writes a concise reference section directly into the project's AGENTS.md or CLAUDE.md for\nother skills, agents, and hooks to consume. Use when scanning, analyzing, or detecting the project's technology stack,\nbuild tools, or repository structure. Does not create or update project documentation — use project-documentation for\nwriting feature or system docs.\nallowed-tools:\nRead, Write, Edit, Glob, Grep, Agent, Bash(git symbolic-ref *), Bash(find *),\nBash(bash \"$/scripts/han-config-dir.sh\")</h2>\n<h2>Project Context</h2>\n<ul>\n<li>Default branch: !<code>git symbolic-ref --short refs/remotes/origin/HEAD 2&gt;/dev/null || echo unknown</code></li>\n<li>AGENTS.md: !<code>find . -maxdepth 1 -name \"AGENTS.md\" -type f</code></li>\n<li>CLAUDE.md: !<code>find . -maxdepth 1 -name \"CLAUDE.md\" -type f</code></li>\n<li>README: !<code>find . -maxdepth 1 -name \"README*\" -type f</code></li>\n<li>personal config directory: !<code>bash \"${CLAUDE_PLUGIN_ROOT}/scripts/han-config-dir.sh\" 2&gt;/dev/null || echo \"$HOME/.claude\"</code></li>\n<li>project .han/config.md: !<code>cat .han/config.md 2&gt;/dev/null || echo \"\"</code></li>\n</ul>\n<p>As your first action, use the Read tool on <code>.han/config.md</code> inside the <code>personal config directory</code> path above. A read\nthat returns no file is no personal configuration: continue silently. When that file or the <code>project .han/config.md</code>\nprobe supplies content, apply it per <a href=\"../../references/config-rule.md\">config-rule.md</a>, which governs precedence\nbetween the two files, relative-path resolution, and what to do with a file that reads but cannot be used.</p>\n<h1>Project Discovery</h1>\n<p>This skill discovers the project's core attributes and writes them as a concise <code>## Project Discovery</code> section\n<strong>directly into the project's AGENTS.md or CLAUDE.md</strong> — not a separate file. The output is small by design: a few notes\non where things live, the languages and frameworks, and the commands to run, so an AI agent working in the repo can find\nits way around. It is not an exhaustive inventory.</p>\n<h2>Step 1: Choose and read the target file</h2>\n<p>Pick the single file this discovery is written into, by priority:</p>\n<ol>\n<li>If <strong>AGENTS.md</strong> exists (the label above is non-empty), the target is AGENTS.md.</li>\n<li>Otherwise, if <strong>CLAUDE.md</strong> exists, the target is CLAUDE.md.</li>\n<li>If neither exists, the target is a new <strong>CLAUDE.md</strong> at the repository root, which you will create in Step 4.</li>\n</ol>\n<p>If the target file already exists, read it in full and build the <strong>deduplication baseline</strong>: a list of everything the\nfile already documents that this skill would otherwise write — directory and folder locations, languages, frameworks,\npackage manager, build/test/lint/dev commands, and the docs, ADR, and coding-standards directories. Note whether the\nfile already has a <code>## Project Discovery</code> section.</p>\n<p>If the target is a new CLAUDE.md, there is nothing to deduplicate against.</p>\n<h2>Step 2: Discover repository structure</h2>\n<p>Launch a <code>han-core:project-scanner</code> agent to determine whether the repository contains one project or many, and what\neach project's boundaries are. Wait for the agent to complete.</p>\n<p>From the agent's results, build a project list. Each entry has a project name (directory name, or repository name for a\nroot-level project), root path, and dependency manifest path.</p>\n<h2>Step 3: Explore project attributes</h2>\n<p>Launch 3 <code>han-core:project-scanner</code> agents in parallel, each with a different focus area. Include the project list from\nStep 2 in each agent's prompt so they know which roots to explore. Keep each agent on the core facts an AI agent needs\nto navigate and run the project — not an exhaustive catalog of every config file.</p>\n<p><strong>Agent 1 — Languages and Frameworks:</strong> For each project, read the dependency manifest to identify languages and version\nconstraints. Determine the package manager from the lock file type. From dependencies, identify the\nstructural/architectural frameworks that define how the project is built (web, frontend, test, ORM/database). Ignore\nutility packages. Note runtime version requirements.</p>\n<p><strong>Agent 2 — Commands:</strong> For each project, find the task runner or build definition and extract the actual commands for\ninstalling dependencies, running tests, linting, building, and the dev server. Only record commands that actually exist\n— no guesses.</p>\n<p><strong>Agent 3 — Layout:</strong> Map where the important things live: the main source directory or directories, the test location,\nand the documentation, ADR, and coding-standards directories — do not assume names like \"docs\". Capture only the handful\nof directories someone needs to know to find their way around the repo; skip incidental files.</p>\n<p>After all 3 agents complete, merge their findings, deduplicate across agents, and organize by project. Separate\nrepository-level items (default branch, docs, ADRs, coding standards, layout) from project-level items (language,\nframeworks, package manager, commands).</p>\n<h2>Step 4: Write the discovery into the target file</h2>\n<p>Build a concise <code>## Project Discovery</code> section using the template at <a href=\"./references/template.md\">template.md</a> as the\nstructural guide.</p>\n<p>Apply two filters before writing anything:</p>\n<ul>\n<li><strong>Deduplicate.</strong> Drop every fact already present in the target file (the Step 1 baseline). Do not restate what the\nfile already says, even in different words.</li>\n<li><strong>Drop empties.</strong> Omit any line with no discovered value. Never leave a <code>{placeholder}</code> behind, and never invent a\ncommand or path that was not discovered.</li>\n</ul>\n<p>If a discovered fact <strong>contradicts</strong> what the file already states (for example, the file says <code>make test</code> but no\nMakefile was discovered), use <code>AskUserQuestion</code> to surface the contradiction and ask which is correct — the existing\nfile or the filesystem discovery. Update the content based on the answer.</p>\n<p>Then write the result into the target file:</p>\n<ul>\n<li><strong>Target exists, no <code>## Project Discovery</code> section:</strong> append the section at the end of the file (or another sensible\nlocation).</li>\n<li><strong>Target exists, already has a <code>## Project Discovery</code> section:</strong> replace that section's body with the new,\ndeduplicated content. Do not leave the old content alongside the new.</li>\n<li><strong>Neither AGENTS.md nor CLAUDE.md exists:</strong> create CLAUDE.md at the repository root containing the section.</li>\n</ul>\n<p>If, after deduplication, nothing meaningful remains to add, do <strong>not</strong> write an empty section. Tell the user the target\nfile already covers the project's core attributes, and stop.</p>\n<h2>Step 5: Keep the <code>.han/config.md</code> pointer honest</h2>\n<p>Han skills read project-local overrides from the project's <code>.han/config.md</code> when a project carries one (see\n<a href=\"../../references/config-rule.md\">../../references/config-rule.md</a>). This step keeps the target file's pointer to that\nconfig accurate, using the same consent gate and deduplication discipline as Step 4. The Project Context probe above\nshows whether the file exists.</p>\n<ul>\n<li><strong><code>.han/config.md</code> exists and the target file contains no reference to it:</strong> use <code>AskUserQuestion</code> to offer adding a\none-line pointer beside the <code>## Project Discovery</code> section, for example:\n<code>Han skills in this project read overrides from [.han/config.md](./.han/config.md).</code> Never add a pointer when any\nreference to the file is already present, even phrased differently.</li>\n<li><strong><code>.han/config.md</code> does not exist but the target file still references it:</strong> use <code>AskUserQuestion</code> to offer removing\nthe stale pointer.</li>\n<li><strong>Otherwise:</strong> do nothing and say nothing about the config.</li>\n</ul>\n<p>Write or remove the pointer only with the user's consent.</p>\n<h2>Step 6: Verification</h2>\n<p>Read back the target file's <code>## Project Discovery</code> section. Confirm: no <code>{placeholder}</code> text remains, every bullet has a\nreal discovered value, and nothing duplicates content stated elsewhere in the file. Spot-check 2-3 discovered paths or\ndirectories with Glob to confirm they exist.</p>\n<p>Report to the user: the target file written (and whether it was created or updated), the number of projects discovered,\nand the languages and frameworks found.</p>\n","files":[{"path":"references/template.md","sizeBytes":1571,"isText":true},{"path":"SKILL.md","sizeBytes":8038,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-15T13:12:03.959958Z","sha256":"D45C5269F6992230CEE0E78E6918C92DF7EAD65C4E7771C0C342390CF8C657C9","sizeBytes":4111},"review":null,"source":{"repositoryUrl":"https://github.com/testdouble/han","path":"han-core/skills/project-discovery","license":"MIT","commit":"abba73a773528905a8f3d15956029394746e5c7f","subtreeSha":"3F5017F3E689C0CD1A0710A5122CF660DC42F5634E940A7541E6EA8AFE1B7035","lastSyncedAt":"2026-10-15T13:11:53.672149Z"},"reviewedAt":"2026-10-15T13:12:21.28811Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/testdouble/han/tree/main/han-core/skills/project-discovery"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install testdouble-han@llmmart"},{"target":"git","command":"git clone https://github.com/testdouble/han.git"}]}