Problem Statement
The StandardLayoutAssessor in structure.py contains Python-specific logic (pyproject.toml parsing, __init__.py detection, PEP 621/Poetry support) mixed with generic assessor code. As we add support for more languages (JavaScript, Java, Go, Rust), this file will become increasingly difficult to maintain.
This was identified in PR #322 review comment.
Proposed Solution
Extract language-specific detection logic into dedicated modules:
src/agentready/assessors/ ├── langs/ │ ├── init.py │ ├── python.py # pyproject.toml parsing,
init.py detection │ ├── javascript.py # package.json parsing,
node_modules detection │ └── java.py # Maven/Gradle detection,
src/main/java structure ├── structure.py # Generic StandardLayoutAssessor (delegates to langs/) └── ...
The StandardLayoutAssessor would become an orchestrator that:
- Detects primary language from
repository.languages
- Delegates to appropriate language module
- Falls back to generic heuristics if no language module exists
Alternatives Considered
- Keep everything in structure.py — Simpler but doesn't scale
- Use strategy pattern with language classes — More OOP but similar outcome
- Configuration-driven detection — Too complex for initial implementation
Use Cases
- Adding JavaScript/TypeScript project detection (package.json, index.js)
- Adding Java/Kotlin detection (pom.xml, build.gradle, src/main/java)
- Adding Go detection (go.mod, main.go)
- Adding Rust detection (Cargo.toml, src/lib.rs)
Additional Context
Related to the .arsrc configuration file work in PR #322, which externalizes the blocklist. This refactoring would pair well with that change by making language-specific blocklists possible (e.g., Python.arsrc, JavaScript.arsrc).
Acceptance Criteria
Priority
Problem Statement
The
StandardLayoutAssessorinstructure.pycontains Python-specific logic (pyproject.toml parsing,__init__.pydetection, PEP 621/Poetry support) mixed with generic assessor code. As we add support for more languages (JavaScript, Java, Go, Rust), this file will become increasingly difficult to maintain.This was identified in PR #322 review comment.
Proposed Solution
Extract language-specific detection logic into dedicated modules:
The
StandardLayoutAssessorwould become an orchestrator that:repository.languagesAlternatives Considered
Use Cases
Additional Context
Related to the
.arsrcconfiguration file work in PR #322, which externalizes the blocklist. This refactoring would pair well with that change by making language-specific blocklists possible (e.g.,Python.arsrc,JavaScript.arsrc).Acceptance Criteria
src/agentready/assessors/langs/directory structurelangs/python.pyStandardLayoutAssessordelegates to language modulesPriority