lens-discover

Reconciles local TargetProjects repository clones with the governance repo-inventory.yaml file.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/crisweber2600/Lens.Core.Src --skill lens-discover-crisweber2600
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lens-discover
Source: https://github.com/crisweber2600/Lens.Core.Src/tree/main/_bmad/lens-work/skills/lens-discover
Command: npx skills add https://github.com/crisweber2600/Lens.Core.Src --skill lens-discover-crisweber2600

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml, and includes scripts (resource) components.

What problem does it solve? Local repository clones under TargetProjects drift out of sync with the governance repo-inventory.yaml file, leaving untracked repos unregistered and inventory entries pointing at missing clones. This Skill scans both sides, reports the drift, and repairs it with validated, auditable changes. ## Core Features & Use Cases - Drift Scanning: Compares inventory entries against git repositories on disk up to three levels deep, reporting missing clones, untracked repos, and already-cloned paths with summary counts. - Idempotent Registration: Adds untracked repositories to repo-inventory.yaml by remote_url, recording additional local_paths when the same remote exists at multiple locations without duplicating entries. - Validated Governance Commits: Validates required inventory fields, enforces domain/service path rules, and runs a hash-gated auto-commit that only pushes when the inventory actually changed. - Use Case: After cloning several service repositories manually, run discover to detect the untracked repos, register them in the governance inventory, and commit the update with the exact message "[discover] Sync repo-inventory.yaml". ## Quick Start Ask the assistant to run discover to scan TargetProjects against the governance repo inventory and clone or register any drift it finds.

Frequently Asked Questions about lens-discover

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

FAQPage Schema
How do I sync local git repositories with a YAML inventory file?

Run the discover scan to compare repo-inventory.yaml entries against git repositories found under TargetProjects. The scan reports missing clones and untracked repos, then you can confirm cloning missing entries and registering untracked ones with their origin remote URL.

How do I run repo discovery without confirmation prompts?

Use headless mode with the --headless or -H flag to skip all confirmation prompts. It validates the inventory first, clones every missing entry, registers untracked repos, revalidates, and runs the auto-commit guard automatically.

Can I preview inventory changes without modifying files?

Yes, dry-run mode with --dry-run scans and prints the planned clone and registration actions without mutating files, cloning repositories, or running any git add, commit, or push commands.

What happens when the same remote URL exists at multiple local paths?

The add-entry operation is idempotent by remote_url and local path pair. When the same remote_url exists at a different local path, it records the new path in the entry's local_paths list instead of creating a duplicate entry.

Why does discover skip registering some local repositories?

Repositories without an origin remote are out of scope because the skill never guesses a remote_url. They are surfaced as skipped registrations with a follow-up note so you can add a remote manually first.

When does discover commit changes to the governance repository?

It commits only when the SHA-256 hash of repo-inventory.yaml changes between pre-mutation and post-mutation snapshots. Equal hashes skip the commit entirely, and the commit message is always exactly "[discover] Sync repo-inventory.yaml".