You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently CodeLens is a deep analysis tool (taint, callgraph, secrets, dead-code). There is no command that answers the first questions a developer asks when entering an unfamiliar repo:
What framework/stack is this?
How do I run, build, and test it?
Where do I start reading?
What CI/Docker infrastructure exists?
Codeglance solves exactly this problem — a zero-setup, pure-static "repo orientation brief" in under 1 second. Its approach is fully portable to Python static analysis with no new hard dependencies.
Goal
Add a codelens orient command that produces a single structured brief covering framework detection, run/build/test command extraction, entry point detection, important file ranking, and CI/Docker detection — all in one output.
New file: scripts/orient/file_ranker.py — Start Here scoring logic
New file: scripts/orient/manifest_parser.py — command extraction from package.json, Makefile, pyproject.toml, etc.
Register in scripts/command_registry.py under orient
Run sync_command_count.py --apply after registering
Definition of Done
codelens orient . produces structured output for a Node.js repo, a Python repo, and a Go repo (use repo's own source as test fixture)
--format json and --format compact work (compact = single-line brief ≤300 tokens for LLM context)
Framework detection covers at minimum: Next.js, React, Express, FastAPI, Django, Flask, Gin, Axum, Spring Boot
Start Here ranking returns ≤8 files, skips tests/generated/migrations
CI/Docker detection reads from filesystem only (no subprocess)
sync_command_count.py --apply run after registration
File headers (@WHO, @WHAT, @PART, @ENTRY) on all new files
@FLOW: ORIENT, @CALLS, @MUTATES on entry function
Reference Implementation
mansoor-mamnoon/codeglance — TypeScript, MIT. Framework definitions in src/analyzers/framework-detector.ts. File ranker in src/analyzers/start-here.ts. Port logic, not code — rewrite in Python idioms.
Background
Currently CodeLens is a deep analysis tool (taint, callgraph, secrets, dead-code). There is no command that answers the first questions a developer asks when entering an unfamiliar repo:
Codeglance solves exactly this problem — a zero-setup, pure-static "repo orientation brief" in under 1 second. Its approach is fully portable to Python static analysis with no new hard dependencies.
Goal
Add a
codelens orientcommand that produces a single structured brief covering framework detection, run/build/test command extraction, entry point detection, important file ranking, and CI/Docker detection — all in one output.Sub-Features to Implement
A. Framework Detection
B. Run/Build/Test Command Extraction
C. Entry Point Detection
D. Start Here File Ranking
E. CI/Docker Detection
Output Schema
{ "framework": { "ecosystem": "Node.js", "primary": "Next.js 14", "secondary": ["Prisma", "TailwindCSS", "Jest"], "summary": "Full-stack React app with ORM and CSS framework" }, "commands": [ { "kind": "dev", "command": "npm run dev", "description": "Start development server" }, { "kind": "test", "command": "npm test", "description": "Run test suite" } ], "entry_points": [ { "path": "src/index.ts", "type": "server" }, { "path": "next.config.js", "type": "config" } ], "start_here": [ { "path": "src/app/page.tsx", "score": 87, "reason": "Top-level route, shallow depth, 120 lines" }, { "path": "src/lib/api.ts", "score": 74, "reason": "API surface, lib/ directory" } ], "infra": { "ci": true, "ci_count": 2, "docker": true, "env_file": true, "test_framework": "jest", "linter": "eslint" } }Architecture
scripts/commands/orient.pyscripts/orient/framework_db.py— framework lookup table (ecosystem → package keys → framework name)scripts/orient/file_ranker.py— Start Here scoring logicscripts/orient/manifest_parser.py— command extraction from package.json, Makefile, pyproject.toml, etc.scripts/command_registry.pyunderorientsync_command_count.py --applyafter registeringDefinition of Done
codelens orient .produces structured output for a Node.js repo, a Python repo, and a Go repo (use repo's own source as test fixture)--format jsonand--format compactwork (compact = single-line brief ≤300 tokens for LLM context)sync_command_count.py --applyrun after registration@WHO,@WHAT,@PART,@ENTRY) on all new files@FLOW: ORIENT,@CALLS,@MUTATESon entry functionReference Implementation
mansoor-mamnoon/codeglance — TypeScript, MIT. Framework definitions in
src/analyzers/framework-detector.ts. File ranker insrc/analyzers/start-here.ts. Port logic, not code — rewrite in Python idioms.