Skip to content

feat(cli): --guide — task-oriented help so a new agent knows how to use CodeLens (closes #319)#320

Merged
Wolfvin merged 1 commit into
mainfrom
feat/issue-319-agent-guide
Jul 18, 2026
Merged

feat(cli): --guide — task-oriented help so a new agent knows how to use CodeLens (closes #319)#320
Wolfvin merged 1 commit into
mainfrom
feat/issue-319-agent-guide

Conversation

@Wolfvin

@Wolfvin Wolfvin commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Closes #319. Arahan Wolfvin: help yang membuat agent baru langsung paham.

Yang dibangun

codelens --guide (flag, count tetap 12) → guide task-oriented:

## Tasks → commands
- Who calls this function (callers):
    codelens context <ws> --check trace --name FN --direction up --domain backend
- Read one function's source (skip reading the whole file):
    codelens context <ws> --check source --name FN
- Blast radius before changing a symbol:
    codelens impact <ws> --name FN
- Find a symbol by name:
    codelens search FN --mode symbol
    note: PATTERN is the first positional (workspace optional second) — the reverse of every other command.

--guide --format json → machine-parseable untuk agent. Sub-check di-derive live dari _CHECKS (tak drift).

Jebakan dogfood tertanam

Yang kutemukan saat memakai CodeLens sendiri, kini di guide supaya agent lain tak terjebak: search positional = pattern (bukan workspace); trace butuh --domain backend; CLI error muncul di stdout (#315) jadi empty benar-benar empty.

Guard anti-bohong

Test mem-parse tiap task command → assert umbrella-nya command nyata + --check-nya ada di _CHECKS umbrella itu. Guide tak pernah bisa diam-diam kasih agent invocation salah.

Verifikasi (dijalankan)

  • Guide render (human + json); 15 task command semua referensi command/check nyata.
  • 7 test; jebakan terdokumentasi; checks live (source/flow/flow-diff muncul tanpa edit).
  • 19 gagal = 19 di main — nol regresi. Command count 12.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…se CodeLens (closes #319)

`codelens --help` lists commands; a new agent still has to guess how to invoke
them. `codelens --guide` answers "I want to do X — what do I run?" with a
task→command map, copy-paste examples, explicit positional conventions, and
sub-checks derived live from each umbrella's _CHECKS. `--format json` gives a
machine-parseable form. A flag like --command-count, so command count stays 12.

The traps found by dogfooding are baked in: search's positional is the PATTERN
(first; workspace optional second) — the reverse of every other command; trace
resolves backend symbols best with --domain backend; a machine-format arg error
lands on stdout as {"s":"error"} (#315), so empty is really empty.

A test guard parses every task command and asserts its umbrella is a real
command and its --check exists in that umbrella's _CHECKS — the guide can never
silently hand an agent a wrong invocation.

Verified: guide renders (human + json), all 15 task commands reference real
commands/checks, dogfood traps documented. 7 tests. Full suite 19 = 19 on main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Wolfvin
Wolfvin merged commit 6ffec50 into main Jul 18, 2026
0 of 6 checks passed
@Wolfvin
Wolfvin deleted the feat/issue-319-agent-guide branch July 18, 2026 02:31
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): --guide — task-oriented help so a new agent knows how to use CodeLens immediately

1 participant