-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
algorithmAlgorithmic and grouping logicAlgorithmic and grouping logicnew featureIssues or PRs for a new feature that doesn't currently existIssues or PRs for a new feature that doesn't currently existphase-2Phase 2 spec generationPhase 2 spec generation
Description
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:
reactdependency and/or.tsxcomponent patterns. - Angular signals:
angular.json,@angular/coredependency, and/or*.component.tsstyle patterns.
- React signals:
- Keep existing
FrameworkDetectoroutputs for test frameworks stable. - Add a separate UI-framework signal channel (do not overload existing
ctx.frameworkstest-framework semantics).
Grouping
- Update
group_items()to:- split items by
ui_frameworkpartition (react,angular,none) - run current grouping heuristics per partition
- avoid cross-framework merges by default
- split items by
- Optional naming rule (if needed): include framework prefix in
feature_idonly 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
- React and Angular are detectable as UI frameworks from manifest/pattern signals in mixed TS repos.
- Existing test framework detection (
jest,vitest) remains unchanged. - Grouping partitions items by UI framework before path/API/name/git heuristics.
- Items from React and Angular areas with identical names do not merge into the same
DraftFeature. - Repositories with no UI framework signal keep current grouping behavior.
-
group_items()remains deterministic for the same input set. - Unit tests added for detection + grouping partition behavior.
-
features/feature-spec-discovery.mdupdated with scenarios and acceptance criteria for UI framework-aware grouping.
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
algorithmAlgorithmic and grouping logicAlgorithmic and grouping logicnew featureIssues or PRs for a new feature that doesn't currently existIssues or PRs for a new feature that doesn't currently existphase-2Phase 2 spec generationPhase 2 spec generation