Fix skeleton/validate/stats not finding plan-generated specs#86
Merged
Fix skeleton/validate/stats not finding plan-generated specs#86
Conversation
Make SpecParser template-aware so it recognizes bare headings (e.g.
'# Document Lifecycle') produced by the plan command, not just the
rigid '# Feature: <title>' format. Add '{title}' catch-all to default
PRD template patterns and resolve templates automatically in
SpecsConfig.from_directory().
Fixes #85
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #85 —
specleft test skeleton,specleft features validate, andspecleft features statsall reported "No specs found" afterspecleft plansuccessfully created spec files.Root Cause
The parser (
parser.py) required headings in strict# Feature: <title>format, butplangenerates bare headings like# Document Lifecycleusing the raw PRD heading text. Since the formats didn't match, all features were silently dropped.Changes
src/specleft/parser.py— MakeSpecParsertemplate-aware: new__init__accepts an optionalPRDTemplate, new_extract_feature_heading()tries each template pattern (most specific first) and falls back to raw heading text.src/specleft/schema.py—SpecsConfig.from_directory()now auto-resolves the PRD template from.specleft/templates/prd-template.ymland passes it to the parser.src/specleft/templates/prd_template.py— Added"{title}"catch-all to default feature and scenario pattern lists (last position, so more specific patterns are tried first).src/specleft/commands/init.py— Updated the init template content to match the new defaults..specleft/templates/prd-template.yml— Updated project-local template with catch-all patterns.Tests
Feature:prefix, bare title, custom template,Featurewithout colon, template auto-loading, and fallback without template file.