Repository navigation
feat(cli): detect project languages and select rule guides with --lang - #69
Conversation
Detect languages from root markers: package.json/tsconfig.json, pubspec.yaml, Cargo.toml, build.gradle(.kts)/pom.xml, go.mod, and pyproject.toml. --lang <list> overrides detection; an unknown value exits 1 and lists the accepted languages. init pre-selects the detected languages. update keeps the languages the existing AGENTS.md block already links. The block links the general guide plus each selected guide, and shows the TS bullets only for typescript. doctor reports the detected languages. Refs #65
There was a problem hiding this comment.
Code Review
This pull request introduces programming language detection and language-specific rule linking to the CLI. It adds a --lang <list> flag, implements automatic language detection from root marker files, and updates the init, update, and doctor commands to support these languages. The AGENTS.md generation is refactored to dynamically link the general guide and the selected language guides, conditionally including TypeScript rules. Feedback suggests moving TypeScript-specific test mirroring examples and framework mentions from the general block (AGENTS_GENERAL) to the TypeScript-specific block (AGENTS_TYPESCRIPT) to prevent irrelevant noise in non-TypeScript projects.
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 1 high |
🟢 Metrics 67 complexity · 0 duplication
Metric Results Complexity 67 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryAdds root-level language detection and
Reviews (3) · Last reviewed commit: "chore(cli): apply AI code review suggest..." · Reviewed by Greptile |
Move the TypeScript test-layout bullet out of the general AGENTS.md block, and cover the v0.1.1 block falling back to language detection. Refs #65
Deploying code-style with
|
| Latest commit: |
a3aa56b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cdc9c345.code-style.pages.dev |
| Branch Preview URL: | https://amondnet-65-lang-detection.code-style.pages.dev |
|
/gemini review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
doctor reports --lang languages as selected rather than detected, the --lang ko|en warnings stop promising a future --lang, and the docs describe the update default. Refs #65
|



Summary
Adds project language detection to the CLI and a
--langflag that selects which language rule guidesinit,update, anddoctoruse. This covers section 2 (language detection) of #65.package.json/tsconfig.json→ typescript,pubspec.yaml→ dart,Cargo.toml→ rust,build.gradle(.kts)/pom.xml→ java (no Kotlin guide ships),go.mod→ go,pyproject.toml→ python. Several languages can match at once. Detection depth decision: root only, no workspace walking.--lang <list>. A comma-separated list of ids (therules/<id>.mdnames) overrides detection. An unknown value exits 1 and lists the accepted languages.--lang ko|enstays as the deprecated locale alias, and a mix such asko,dartis rejected.init. Detected languages are pre-selected in a multiselect.--yesuses the detection result.update. Keeps the languages the existing AGENTS.md block already links, which answers the feat(cli): detect languages, run without package.json, and split rules into rules/<lang>.md #65 open question "where to record the selected languages".--langoverrides it. A legacy or missing block falls back to detection.doctor. Prints the detected languages.cli.mdxpages, and therules.mdindex.Related issue
Refs #65 (stays open: this is one step of it).
Notes for reviewers
--lang dartis an error was replaced, because dart is now a valid language.flagfield.package.jsonfixture so the TypeScript expectations still hold.package.json, and writing guides into the project instead ofnode_modules.Verification
tscclean, eslint clean, docs build andlint:docsclean.init,update, anddoctorin a project withpackage.jsonandpubspec.yaml.Checklist
bun run build)bun run lint)BREAKING CHANGE:note is includedSummary by cubic
Adds project language detection to the CLI and a
--langflag that selects which language rule guidesinit,update, anddoctoruse.New Features
package.json/tsconfig.json,pubspec.yaml,Cargo.toml,build.gradle(.kts)/pom.xml,go.mod,pyproject.toml)--lang <list>overrides detection; unknown values exit 1 and list accepted languagesinitpre-selects detected languages;updatekeeps the languages the existing AGENTS.md block links, falling back to detection for legacy or missing blocksdoctorreports detected languages, or the--langselection when givenBehavior Changes
--lang ko|enstays a deprecated locale alias and now selects no languages; mixes likeko,dartare rejectedWritten for commit a3aa56b. Summary will update on new commits.
Demo