Skip to content

docs: update CLAUDE.md to instruct AI to run install.sh and TestFromTestdata locally #638

@xgopilot

Description

@xgopilot

Problem

When AI assistants (like Claude Code / xgopilot) modify llcppg components (e.g., _xtool/internal/parser), they currently mark TestFromTestdata tests as "requires llcppsigfetch tool via CI" in PR descriptions:

- [ ] TestFromTestdata tests pass (requires llcppsigfetch tool via CI)

This is incorrect — the AI assistant can and should install these tools locally by running bash ./install.sh, then run the tests to verify changes.

Requested Change

Update CLAUDE.md to explicitly instruct AI assistants that:

  1. After modifying llcppg components (especially _xtool/ code or anything affecting TestFromTestdata), they should run bash ./install.sh to install/rebuild llcppsigfetch, llcppsymg, and other LLGo-compiled tools locally.
  2. Then run TestFromTestdata tests via go test -v ./cl/internal/convert -run TestFromTestdata to verify changes, rather than deferring to CI.
  3. Update the expected test data if the output format changes — use gen:true to regenerate gogensig.expect files, verify correctness, then switch back to gen:false.

Suggested CLAUDE.md Addition

Add a section like:

### After Modifying LLGo-Compiled Components

When you modify code under `_xtool/` (e.g., `_xtool/internal/parser`), you MUST:

1. Run `bash ./install.sh` to rebuild and install the LLGo-compiled tools (`llcppsigfetch`, `llcppsymg`, etc.)
2. Run `go test -v ./cl/internal/convert -run TestFromTestdata` to verify the changes
3. If test output changes are expected, temporarily set `gen:true` in the test to regenerate expected output, verify it, then set back to `gen:false`
4. Do NOT skip these tests or mark them as "requires CI" — they can and should be run locally after `install.sh`

Context

Raised by @luoliwoshang in PR #637.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions