Repository navigation
Add a write-code skill for code conventions - #1517
Merged
Merged
Conversation
Writes down the conventions that Biome, knip and tsc don't check: class and helper layout, function size, waits and startup timeouts in modules, and reusing core. AGENTS.md, review-pr and add-module point to it.
The pointers in AGENTS.md, review-pr and add-module now only name the skill. The skill defines what a helper is and covers duplication within a file, across a package and across modules.
Follows #1514, where Couchbase gives each wait in containerStarted what is left of the startup timeout.
Lint-style conventions are left to Biome. The skill keeps what a linter can't see: look for existing code first, refactor instead of copying, and use core's building blocks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
write-codeskill for the review finding a linter can't catch: new code that repeats something the project already has. It tells the agent to look for existing code first, to refactor shared code instead of copying it, and to use core's building blocks.AGENTS.md("Code"),review-prandadd-moduleeach get a one-line pointer that only names the skill. The skill names no module, file or method, so it does not go stale as they change.Lint-style conventions are left to Biome. #1585 and #1590 enable function length, cognitive complexity,
??, noconsole, no shadowing, block statements, no uselesselseandreadonly. An earlier version of this skill also listed layout, typing and naming conventions. They were removed because Biome has a rule for them, or they were too minor to be worth a rule.What remains, with the evidence for it (survey of the 191 non-test source files, taken on
mainbefore #1514 merged):waitForContainer" appears 5 times across core, Kafka and Redpanda; the two module hooks repeat the same 10-line block. #364testcontainers(enforced by Biome), so cross-module reuse has to live in corecouchbase-container.tswith*methods rather thancreateOptsorhostConfigWaitStrategythroughwaitForContainerwaitUntilReadydirectly and is the only module that polls withIntervalRetry. #723StartupDeadlinefor itWhen #1584 merges, the timeout bullet should name the argument it adds to
containerStarted.Verification
npx biome check .: no fixes applied.npm run knip: no findings.The change is Markdown plus the
.claude/skills/write-codesymlink, so there are no tests to run.Not breaking
Agent guidance only. No package code or manifests change.