Trae CN分析问题提示词示例

Trae CN分析问题提示词示例 1. 前言最近在搭建了Openharmony Arkcompiler开发环境后在开发新特性之后执行测试套进行验证有失败的用例出现。借助Trae CN个人版来进行辅助分析总结了一套问题分析的提示词提高了问题分析的速度和质量。另外对于Trae CN 个人版这个AI IDE请理性对待不要盲目信任。它还未到人脑地步因此提示词需要不断优化精准避免无效修改。我使用的智能体是builder。Trae的代码修改要反复审核切勿盲从。我修改的主要是C、ets代码。2. 配置当前用户sudo免密在wsl中执行sudo visudo,在root ALL(ALL:ALL) ALL后增加fbb ALL(ALL:ALL) ALL作用是在trae cn分析过程中有些操作是需要root权限提示用户输入密码。配置后就会忽略该操作提高分析速度。3. 提示词3.1 提示词内容1). 工程编译指令cd/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_coresudo/home/fbb/ohos/arkcompiler/arkts_20260324/build.sh r2). 测试用例执行用例验证指令cd/home/fbb/ohos/arkts0205/arkcompiler/runtime_core/static_coresudo/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/tests/tests-u-runner/runner.sh --ets-runtime --build-dir/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/release_out--processes18--show-progress --compare-files-iterations2--test-file override_interface_method.ets3). 特别注意以下文件不能做任何修改ets_frontend/ets2panda/checker/types/ets/etsFunctionType.cppets2panda/test/compiler/ets/lambda_param_type_unverified.etsets2panda/test/compiler/ets/lambda_param_type_unverified_foreach.etsets2panda/test/runtime/ets/lambda_n/lambda_arg_ignored.etsets2panda/test/runtime/ets/lambda_n/lambda_arg_ignored2.ets4). 编译报错ALL OPTIONS: --ets-runtime --build-dir/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/release_out--processes18--show-progress --compare-files-iterations2--test-file override_interface_method.ets Loading excludedtestlists:[/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/tools/es2panda/test/test-lists/ets-runtime/ets-runtime-excluded.txt]Loading ignoredtestlists:[/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/tools/es2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt,/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/tools/es2panda/test/test-lists/ets-runtime/ets-runtime-ignored-INT.txt,/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/tools/es2panda/test/test-lists/ets-runtime/ets-runtime-ignored-AMD64-OL2.txt]Loaded1valid tests from the folder/tmp/ets/ets-runtime/gen.Excluded0tests are not loaded.0%||0/1[00:00?, ?it/s]Finished override_interface_method.ets -0.13sec - NEW FAILURE override_interface_method.ets: steps: Run es2panda: /home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/release_out/bin/es2panda--arktsconfig/home/fbb/ohos/arkcompiler/arkts_20260324/runtime_core/static_core/release_out/tools/es2panda/generated/arktsconfig.json --gen-stdlibfalse--extensionets --opt-level2--output/tmp/ets/ets-runtime/intermediate/override_interface_method.ets.abc /tmp/ets/ets-runtime/gen/override_interface_method.ets Output:Error: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ es2panda unexpectedly terminated.5). 请分析。修改测试用例。并使用编译指令来验证代码修改。用例执行成功后请按以下函数优化要求优化改动的函数。函数优化要求分析改动的函数的代码行数不能超过50行改动的函数代码长度不能超过120字符改动的函数包括函数签名嵌套层次不能超过4层不能包含任何调试代码工程编译通过3.2 提示词说明trae cn的智能体Builder默认是自动修改代码以测试用例代码为基准修改业务代码。如果你认为业务代码正确需要修改测试用例。那就需要显示说明不能修改的文件说明要修改的是测试用例代码。