Skip to content

Commit 5510743

Browse files
authored
[enhancement](agent) Add more agent behavior calibration instructions (#63395)
1. clarify correct pod array usage 2. clang-format version specific
1 parent 1891f71 commit 5510743

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.claude/skills/be-code-style/SKILL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ Fix C++ code formatting issues in the BE and Cloud modules using the project's c
1414
- When CI reports clang-format failures
1515
- When you need to check or fix C++ code style
1616

17+
## Prerequisites
18+
19+
You need to confirm that the major version of the called clang-format is 16. If the current environment's default does not meet this requirement, try the following:
20+
21+
1. If `.vscode/settings.json` exists, use the clang-format.executable item in it.
22+
2. If it is a worktree directory, use the `.vscode/settings.json` from the main directory.
23+
3. Check the path to the compiler toolchain by trying to find it from the `PATH` environment variable, the current directory, and the main directory's `custom_env.sh`. Look for a clang-format with the major version number 16 in that path and its parent directory.
24+
1725
## Procedure
1826

1927
### Step 1: Auto-fix formatting
@@ -53,6 +61,7 @@ After running `clang-format.sh`, review the changes with `git diff` to verify on
5361
## Excluded Directories
5462

5563
The following are excluded from formatting (see `.clang-format-ignore`):
64+
5665
- `be/src/apache-orc/*`, `be/src/clucene/*`, `be/src/gutil/*`
5766
- `be/src/glibc-compatibility/*`
5867
- Specific third-party vendored files (mustache, sse2neon, utf8_check)

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ When working in worktree mode, all operations must be confined to the current wo
1212

1313
Assert correctness only—never use defensive programming with `if` or similar constructs. Any `if` check for errors must have a clearly known inevitable failure path (not speculation). If no such scenario is found, strictly avoid using `if(valid)` checks. However, you may use the `DORIS_CHECK` macro for precondition assertions (if inside performance-sensitive areas like loops, it can only be `DCHECK`). For example, if logically A=true should always imply B=true, then strictly avoid `if (A && B)` and instead use `if (A) { DORIS_CHECK(B); ... }`. In short, the principle is: upon discovering errors or unexpected situations, report errors or crash—never allow the process to continue.
1414

15+
For `PaddedPODArray` and its peripheral packaging types, such as some certain Column, negative alignment allows the use of -1 as a valid index. No additional special handling is needed when the index may be -1.
16+
1517
When adding code, strictly follow existing similar code in similar contexts, including interface usage, error handling, and locking patterns. When adding any code, first try to reference existing functionality. Second, examine the relevant context paragraphs to fully understand the logic.
1618

1719
After adding code, conduct self-review and refactoring attempts to ensure good abstraction and reuse as much as possible.

0 commit comments

Comments
 (0)