Skip to content

Fix skeleton/validate/stats not finding plan-generated specs#86

Merged
Dimwiddle merged 1 commit intomainfrom
85-skeleton-bug
Feb 11, 2026
Merged

Fix skeleton/validate/stats not finding plan-generated specs#86
Dimwiddle merged 1 commit intomainfrom
85-skeleton-bug

Conversation

@Dimwiddle
Copy link
Copy Markdown
Contributor

Summary

Fixes #85specleft test skeleton, specleft features validate, and specleft features stats all reported "No specs found" after specleft plan successfully created spec files.

Root Cause

The parser (parser.py) required headings in strict # Feature: <title> format, but plan generates bare headings like # Document Lifecycle using the raw PRD heading text. Since the formats didn't match, all features were silently dropped.

Changes

  • src/specleft/parser.py — Make SpecParser template-aware: new __init__ accepts an optional PRDTemplate, new _extract_feature_heading() tries each template pattern (most specific first) and falls back to raw heading text.
  • src/specleft/schema.pySpecsConfig.from_directory() now auto-resolves the PRD template from .specleft/templates/prd-template.yml and 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

  • 6 new parser tests covering Feature: prefix, bare title, custom template, Feature without colon, template auto-loading, and fallback without template file.
  • 2 new end-to-end skeleton tests verifying generation from plan-style bare headings.
  • 1 updated test for new default pattern expectations.
  • All 440 tests pass, lint clean.

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
@Dimwiddle Dimwiddle linked an issue Feb 11, 2026 that may be closed by this pull request
@Dimwiddle Dimwiddle merged commit 1ca7600 into main Feb 11, 2026
11 checks passed
@Dimwiddle Dimwiddle deleted the 85-skeleton-bug branch February 11, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]

1 participant