Skip to content

Commit b31b981

Browse files
committed
skills: Extend with some more issues my Claude Code keeps running into
1 parent 8a678b9 commit b31b981

5 files changed

Lines changed: 36 additions & 10 deletions

File tree

.agents/skills/mz-commit/SKILL.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,16 @@ Materialize uses squash merging, so the PR title becomes the commit subject on `
3232

3333
Write a thorough PR description explaining the rationale for the change.
3434
Mention which tests were added or modified in the pull request description, but do not list which tests were run.
35-
To auto-close issues, include `Fixes database-issues#NNNN`.
3635
Add release notes for user-visible changes (should complete "This release will...").
3736

37+
## Issue tracking: Linear only for new issues
38+
39+
New issues are filed in Linear, never in the `database-issues` GitHub repo. `database-issues` is legacy. Its open issues are still valid to read, link, and close, so an existing `database-issues#NNNN` reference in code or a comment stays as it is.
40+
41+
Reference the Linear issue by its its key, e.g. `Closes: SQL-450`. Don't include the full URL containing the issue title.
42+
43+
When a change closes a legacy GitHub issue, `Fixes database-issues#NNNN` works for auto-closing.
44+
3845
## Cargo.lock discipline
3946

4047
Never regenerate the entire Cargo.lock — bare `cargo update` bumps every semver-compatible dep and introduces unrelated breakage (e.g., `os_info` pulling in `objc2` on macOS, `chrono-tz` changing timezone data, `serde_path_to_error` changing error formats).

.agents/skills/mz-debug-ci/SKILL.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ Extract from the URL:
7171
**Before diving into logs**, fetch the build annotations. They contain pre-extracted error messages, stack traces, and links to known flaky test issues — this saves significant time compared to grepping through raw logs.
7272

7373
```bash
74-
bk api /pipelines/<PIPELINE>/builds/<BUILD_NUMBER>/annotations --no-pager 2>&1
74+
bk api /pipelines/<PIPELINE>/builds/<BUILD_NUMBER>/annotations --no-pager 2>/dev/null
7575
```
7676

77+
Note that `bk` can't be piped through `2>&1`.
78+
7779
The response is JSON. Each annotation has:
7880
- `style`: `"error"` for failures
7981
- `body_html`: HTML containing the error summary, including:
@@ -97,12 +99,12 @@ Only fetch full logs when annotations don't provide enough detail. Triage in thi
9799

98100
To fetch a job's log:
99101
```bash
100-
bk job log <JOB_ID> -p <PIPELINE> -b <BUILD_NUMBER> --no-timestamps --no-pager 2>&1 | tail -100
102+
bk job log <JOB_ID> -p <PIPELINE> -b <BUILD_NUMBER> --no-timestamps --no-pager 2>/dev/null | tail -100
101103
```
102104

103105
For large logs, first grep for errors to find the relevant section:
104106
```bash
105-
bk job log <JOB_ID> -p <PIPELINE> -b <BUILD_NUMBER> --no-timestamps --no-pager 2>&1 | grep -B2 -A5 'error\|FAIL\|panicked'
107+
bk job log <JOB_ID> -p <PIPELINE> -b <BUILD_NUMBER> --no-timestamps --no-pager 2>/dev/null | grep -B2 -A5 'error\|FAIL\|panicked'
106108
```
107109

108110
Fetch multiple job logs in parallel when they are independent (e.g., clippy + lint at the same time).
@@ -114,9 +116,9 @@ Jobs upload artifacts (junit XML, service logs, coredumps, ...). Use the
114116

115117
```bash
116118
# All artifacts of a build (each entry has id, job_id, path)
117-
bk artifacts list <BUILD_NUMBER> -p <PIPELINE> --no-pager 2>&1
119+
bk artifacts list <BUILD_NUMBER> -p <PIPELINE> --no-pager 2>/dev/null
118120
# Artifacts of a single job
119-
bk artifacts list <BUILD_NUMBER> -p <PIPELINE> --job-uuid <JOB_ID> --no-pager 2>&1
121+
bk artifacts list <BUILD_NUMBER> -p <PIPELINE> --job-uuid <JOB_ID> --no-pager 2>/dev/null
120122
# Download one artifact into the current directory
121123
bk artifacts download <ARTIFACT_ID> --build <BUILD_NUMBER> -p <PIPELINE>
122124
```

.agents/skills/mz-platform-checks/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Both manipulate phases always run. validate() may run multiple times.
8282
```python
8383
from materialize.checks.checks import disabled
8484

85-
@disabled(ignore_reason="due to database-issues#12345")
85+
@disabled(ignore_reason="due to SQL-450")
8686
class MyBrokenCheck(Check):
8787
...
8888
```

.agents/skills/mz-test/SKILL.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Add logging through `log_filter` in the test's `mzcompose.py`:
207207
```python
208208
Materialized(
209209
additional_system_parameter_defaults={
210-
# TODO: Remove when database-issues#NNNN is fixed
210+
# TODO: Remove when SQL-NNN is fixed
211211
"log_filter": "mz_storage::source::postgres=trace"
212212
},
213213
)
@@ -223,7 +223,6 @@ Determine the right framework based on what you're testing:
223223
* **SQL correctness, types, functions** (no external systems, no concurrency): sqllogictest (`.slt` in `test/sqllogictest/`).
224224
Use `mode cockroach`, test NULLs and edge cases.
225225
Do NOT modify files in `test/sqllogictest/sqlite` or `test/sqllogictest/cockroach` (upstream).
226-
When adding new tests to slt files, prefer adding them to an existing slt file rather than creating new slt files, if you are able to quickly find an existing slt file where the new tests fit naturally.
227226
Do NOT drive data-dependent assertions with a `LOAD GENERATOR COUNTER` source plus `mz_unsafe.mz_sleep(...)` to wait for ingestion: the counter emits rows over wall-clock time, so the check races ingestion and flakes in CI. Use a plain `CREATE TABLE` with deterministic `INSERT`s.
228227
When a statically-monotonic operator needs a `FROM SOURCE` load generator (whose row timing is nondeterministic), split coverage: test the plan shape with `EXPLAIN PHYSICAL PLAN` over the `FROM SOURCE` table (no data, non-flaky), and test runtime row correctness with a one-shot `SELECT` over a plain `CREATE TABLE` + `INSERT`.
229228
* **Sources/sinks, Kafka, catalog, pgwire** (external systems): testdrive (`.td` in `test/testdrive/`).
@@ -240,7 +239,19 @@ Determine the right framework based on what you're testing:
240239
* **Performance micro-benchmarks**: Feature Benchmark scenarios in `misc/python/materialize/feature_benchmark/scenarios`.
241240
See `doc/developer/feature-benchmark.md`.
242241

243-
In most cases, appending to an existing `.slt` or `.td` file is sufficient.
244242
For functional issues, aim for at least two different test frameworks that can independently detect the regression.
245243

246244
Read `doc/developer/guide-testing.md` for more detail on test frameworks.
245+
246+
### Extend an existing file, do not create a new one
247+
248+
It is preferred to extend an existing mzcompose-based test, a `.td` file or `.slt` file when appropriate. Write the smallest test that fails without the fix.
249+
250+
A panic is caught by CI automatically. Just run the statement that panics. Do not add an assertion on the panic message.
251+
252+
## Prove a regression test is red before you call it done
253+
254+
A regression test that has never failed proves nothing. Whenever the test is meant to demonstrate a bug, verify both directions before reporting:
255+
256+
1. With the fix removed run the test and confirm it fails, for the expected reason. Read the failure output.
257+
2. Restore the fix, run the test again, and confirm it passes.

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Use the `mz-test` skill before running ANY tests, even mid-task — the canonica
1010
commands aren't the obvious ones (e.g. `bin/sqllogictest --optimized`, not
1111
`cargo build --bin sqllogictest`).
1212

13+
Use the `mz-run` skill before building, running, formatting, or linting. `bin/fmt` and `bin/lint` are the canonical entry points, NOT `cargo fmt`, `rustfmt`, or a bare `cargo clippy`. `bin/environmentd`, not `cargo build --bin environmentd`.
14+
15+
Use the `mz-commit` skill before `git commit`, `git push`, or `gh pr create`.
16+
17+
Use the `mz-debug-ci` skill before the first `bk` or `gh pr checks` command, or when handed a Buildkite URL.
18+
1319
## Code navigation
1420

1521
For operation flow tracing, read first:

0 commit comments

Comments
 (0)