Summary
Add React/Angular awareness to discovery grouping so features are clustered within UI framework boundaries before existing path/API/name/git heuristics run.
This is a follow-up to #133.
Problem
Current grouping in group_items() is framework-agnostic. In monorepos with both React and Angular code, similarly named modules can be merged into one feature cluster, reducing draft spec accuracy.
Proposed approach
- Detect UI frameworks (
react, angular) independently from test frameworks (jest, vitest).
- Carry UI framework signal into grouping inputs.
- Partition by UI framework first, then apply existing deterministic grouping heuristics inside each partition.
- Keep behavior backward-compatible when no UI framework signal exists.
Scope
Framework detection
- Extend TypeScript detection rules to infer UI frameworks from manifests + file patterns:
- React signals:
react dependency and/or .tsx component patterns.
- Angular signals:
angular.json, @angular/core dependency, and/or *.component.ts style patterns.
- Keep existing
FrameworkDetector outputs for test frameworks stable.
- Add a separate UI-framework signal channel (do not overload existing
ctx.frameworks test-framework semantics).
Grouping
- Update
group_items() to:
- split items by
ui_framework partition (react, angular, none)
- run current grouping heuristics per partition
- avoid cross-framework merges by default
- Optional naming rule (if needed): include framework prefix in
feature_id only when collisions occur (react-authentication, angular-authentication).
Data contracts
- Add a backward-compatible model field for optional framework signal where appropriate (item metadata or context-level structure), with defaults for existing miners.
- Ensure existing miners/tests continue passing without requiring immediate framework annotation updates.
Non-goals
- No changes to route/test/docstring extraction logic beyond carrying framework context.
- No framework-specific scenario generation templates yet.
Acceptance criteria
Suggested tests
tests/discovery/test_framework_detector.py
- React-only detection
- Angular-only detection
- Mixed React+Angular detection
- No regression in Jest/Vitest detection
tests/discovery/test_grouping.py
- same logical domain under React and Angular stays in separate feature groups
- fallback behavior when framework signal is absent
Summary
Add React/Angular awareness to discovery grouping so features are clustered within UI framework boundaries before existing path/API/name/git heuristics run.
This is a follow-up to #133.
Problem
Current grouping in
group_items()is framework-agnostic. In monorepos with both React and Angular code, similarly named modules can be merged into one feature cluster, reducing draft spec accuracy.Proposed approach
react,angular) independently from test frameworks (jest,vitest).Scope
Framework detection
reactdependency and/or.tsxcomponent patterns.angular.json,@angular/coredependency, and/or*.component.tsstyle patterns.FrameworkDetectoroutputs for test frameworks stable.ctx.frameworkstest-framework semantics).Grouping
group_items()to:ui_frameworkpartition (react,angular,none)feature_idonly when collisions occur (react-authentication,angular-authentication).Data contracts
Non-goals
Acceptance criteria
jest,vitest) remains unchanged.DraftFeature.group_items()remains deterministic for the same input set.features/feature-spec-discovery.mdupdated with scenarios and acceptance criteria for UI framework-aware grouping.Suggested tests
tests/discovery/test_framework_detector.pytests/discovery/test_grouping.py