Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Repo-wide conventions for code comments. Read this when reviewing or adding code comments.
.claude/skills/ledgerhq-comments/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-22 | ✓→✗ | ▼ Worse | 2% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 18% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 42% | 0% |
Comments are a _code smell_ because comments can go out of date, leading to confusion and bugs.
Reference this guidance rather than the codebase.
When code isn't clear we should try to make it clearer:
When comments are necessary we should follow these guidelines:
❌ Bad
yaml# pnpm patches add 'patch_hash=HASH' to virtual store paths, which prefab 2.1.0 # (introduced via AGP 8.11) misparses as an option flag due to a clikt bug that splits # positional path arguments at '='. Pinning prefab to 2.0.0 in gradle.properties avoids # this; keeping path segments ≤ 80 chars shortens virtual-store paths to reduce the # likelihood of triggering prefab path-parsing issues as an additional safeguard. android.prefab.version=2.0.0 virtual-store-dir-max-length=80
✅ Better
yaml# Workaround for Prefab 2.1.0/Clikt bug # See: https://github.com/google/prefab/issues/187 android.prefab.version=2.0.0 virtual-store-dir-max-length=80
Use test names rather than comments to explain none-obvious details:
❌ Bad
tsit("diffs the current value against resolved when targeted", () => { const { result } = renderHook(() => useJsonEditor(makeProps())); act(() => result.current.setDiffTarget("resolved")); // Current equals resolved → every line is unchanged. expect(result.current.diffJson.every(l => l.state === "none")).toBe(true); });
✅ Good
tsit("resets the state of every line when the diff is resolved", () => { const { result } = renderHook(() => useJsonEditor(makeProps())); act(() => result.current.setDiffTarget("resolved")); expect(result.current.diffJson.every(l => l.state === "none")).toBe(true); });
Avoid clearly unnecessary comments:
❌ Bad
ts/* Whether the filter trigger should be displayed */ showFilter: boolean;
✅ Good
tsshowFilter: boolean;
Other measured skills in the registry, with their headline benchmark lift.