lens-feature-yaml

Read, validate, update, and persist Lens feature.yaml governance state via CLI.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Managing Lens governance feature.yaml files by hand risks invalid phase transitions, lost fields during rewrites, and uncommitted governance changes. This Skill provides a single sanctioned CLI boundary for reading, validating, surgically updating, and committing feature.yaml state. ## Core Features & Use Cases - Structured Reads: Load a feature by ID or path and get JSON with identity, phase, track, docs paths, target repos, dependencies, milestones, and transition history. - Phase Validation & Surgical Updates: Validate phase transitions against the lifecycle contract and update only requested fields (phase, docs paths, target_repos, milestones) without rebuilding the file, with automatic feature-index.yaml sync on phase changes. - Dirty-State Persistence: Detect dirty governance changes, pull with autostash, stage, commit, push, and report the resulting SHA. - Use Case: When moving a feature from techplan to dev, validate the transition, update the phase field, sync the feature index, and commit the governance repo changes in one workflow. ## Quick Start Ask the AI to read the feature.yaml state for a given feature ID from the governance repo and return it as structured JSON.

Frequently Asked Questions about lens-feature-yaml

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

FAQPage Schema
How do I read a feature.yaml file as structured JSON?

Run the feature-yaml-ops.py script with the read subcommand, passing --feature-id or --feature-path plus --governance-repo. It returns JSON containing identity fields, phase, track, docs paths, target_repos, dependencies, milestones, and transition history.

How do I validate a phase transition in a feature.yaml?

Use the validate subcommand with --to-phase to check the target phase against the lifecycle contract and feature track. Invalid transitions return a fail payload listing allowed next phases, while missing target_repos on implementation-impacting tracks returns a non-blocking warning.

Can I update feature.yaml fields without rewriting the whole file?

Yes, the update subcommand surgically modifies only requested fields: phase, docs.path, docs.governance_docs_path, target_repos, and milestones. Unknown and untouched fields remain in place, and writes are atomic via a temporary file replace.

Does the script commit governance repo changes automatically?

The commit-dirty subcommand detects dirty state, pulls with rebase and autostash, stages requested paths, commits with a message, pushes, and reports the resulting SHA. If nothing relevant is dirty, it just pulls and reports no commit.

What happens when a phase transition is invalid?

The script emits a JSON fail payload with the error code invalid_phase_transition, the current and target phases, and the list of allowed next phases. It exits with a non-zero code so callers can block the workflow.

What are the limitations of the update command?

Only a fixed set of fields can be updated: phase, docs paths, target_repos, milestones, and links.pull_request. Other fields are rejected as unsupported, and phase changes must still pass lifecycle transition validation.