Skip to content

feat(rules): add code comment placement rule - #190

Merged
shunkakinoki merged 3 commits into
mainfrom
feat/code-comments-rule
Aug 9, 2026
Merged

feat(rules): add code comment placement rule#190
shunkakinoki merged 3 commits into
mainfrom
feat/code-comments-rule

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Adds a compact code-comments rule to rules/, propagated to all agent instruction files via ruler.

  • Comments carry only non-obvious WHY (hidden constraints, workarounds, surprising behavior)
  • No WHAT comments, change history, or task ID references - those belong in git log, the PR, or the issue
  • Uncertainty goes in the PR body, not comment padding
  • Docs/README: current behavior snapshot only

Based on the placement test: not "is this information useful?" but "is the code the right place for it?"

🤖 Generated with Claude Code


Summary by cubic

Adds a clear code comment rule: write only non‑obvious WHY; keep WHAT, history, and task IDs out of source. Also switches skills tasks to the project‑local CLI and bumps skills to ^1.5.22 for consistent installs.

  • New Features

    • Added rules/code-comments.md with concise guidance; propagated via @intellectronica/ruler.
  • Dependencies

    • Upgraded skills to ^1.5.22; updated bun.lock (includes tar and related deps).
    • Makefile: use local $(SKILLS_CLI) instead of bun x; run bun install --frozen-lockfile --minimum-release-age 0 before skills tasks.
    • Added UPGRADE_LOG.md with verification steps.

Written for commit f587962. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Improvements

    • Improved skill installation and update workflows for more reliable local execution and clearer error messages.
    • Updated the skills tooling to the latest supported release.
  • Documentation

    • Added upgrade records with verification steps.
    • Added guidelines for writing focused, useful code comments.

Walkthrough

The Skills dependency now uses version ^1.5.22. Makefile targets install frozen Bun dependencies and invoke the local Skills CLI. The upgrade is documented, and new rules define acceptable code comments.

Changes

Skills CLI workflow

Layer / File(s) Summary
Local CLI installation and upgrade
Makefile, package.json, UPGRADE_LOG.md
The project pins skills to ^1.5.22. Skills installation and updates install frozen dependencies, invoke the local CLI, and update related messages and documentation.

Comment guidance

Layer / File(s) Summary
Code-comment writing rules
rules/code-comments.md
The new rules limit comments to non-obvious rationale and exclude descriptive, historical, task-related, and uncertain content.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit checks the local tool,
Bun installs by one clear rule.
Skills now bloom from pinned ground,
While useful comments gather round.
Hop, hop—clean paths all around!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: adding a code comment placement rule.
Description check ✅ Passed The description directly explains the new code comment rule and also summarizes related skills installation changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/code-comments-rule

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shunkakinoki
shunkakinoki merged commit 294c047 into main Aug 9, 2026
2 of 3 checks passed
@shunkakinoki
shunkakinoki deleted the feat/code-comments-rule branch August 9, 2026 14:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Line 118: Quote the SKILLS_CLI expansion at every command site in the
Makefile, including the add command and the commands around lines 141 and 161,
so paths containing spaces execute correctly and printed commands remain
copy-safe.
- Around line 92-95: Remove the --minimum-release-age 0 override from both bun
install --frozen-lockfile commands in the Makefile, including the commands near
the skills SDK installation and the other installation flow, so Bun’s configured
minimumReleaseAge protection remains active.

In `@package.json`:
- Line 20: Declare the required Node.js runtime for the skills dependency by
adding a repository runtime marker such as .node-version set to 22.20.0, or
documenting Node.js 22.20.0+ in the README. Ensure the contract clearly applies
to supported checkouts using skills@1.5.22.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f13810d-d209-40da-bd7c-fb8a1a468eb9

📥 Commits

Reviewing files that changed from the base of the PR and between 42e3689 and f587962.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • Makefile
  • UPGRADE_LOG.md
  • package.json
  • rules/code-comments.md

Comment thread Makefile
Comment on lines +92 to +95
if ! (cd "$(SKILLS_PROJECT_DIR)" && bun install --frozen-lockfile --minimum-release-age 0 --no-progress >/dev/null); then \
echo "Error: failed to install the skills SDK from bun.lock"; \
exit 1; \
fi; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

command -v bun
bun --version
bun install --help | rg -n -- '--minimum-release-age|--frozen-lockfile'

rg -n --hidden --glob 'Makefile' --glob 'bunfig.toml' \
  'minimumReleaseAge|--minimum-release-age|--frozen-lockfile' . || true

Repository: shunkakinoki/dotagents

Length of output: 160


🌐 Web query:

Bun publish minimumReleaseAge lockfile minimum-release-age bunfig.toml

💡 Result:

The minimumReleaseAge setting is a feature for bun install designed to prevent the installation of recently published packages (to protect against supply chain attacks) [1][2]. It is not a feature related to bun publish [3][4]. For bun install, minimumReleaseAge can be configured in your bunfig.toml file under the [install] section [1][2]. Configuration in bunfig.toml: [install] # Accepts a number of seconds (e.g., 259200 for 3 days) or an ms-style duration string (e.g., "3d", "1 week") minimumReleaseAge = "3d" # Optional: List packages to bypass this check minimumReleaseAgeExcludes = ["@types/bun", "typescript"] Key details regarding minimumReleaseAge: - Scope: This setting affects dependency resolution during bun install and bun add, not the publishing process [1][5]. - Input format: It supports both a raw number of seconds or a duration string (e.g., "3d", "48h", "1 week") [6]. - Exclusion: You can use minimumReleaseAgeExcludes to exempt specific packages from this age gate [2]. - bun publish: This command does not use minimumReleaseAge [3][4]. When running bun publish, you can control lockfile behavior using flags like --no-lockfile (to not update the lockfile) or --disallow-lockfile-changes [3][4]. If you are seeing issues with this setting, note that it should be defined in a project-local bunfig.toml [7]. There have been reports of global $HOME/.bunfig.toml configurations being ignored in certain environments [7].

Citations:


🌐 Web query:

Bun install minimumReleaseAge frozen lockfile does not fail

💡 Result:

In earlier versions of Bun, the minimumReleaseAge configuration was only enforced during dependency resolution (e.g., when adding new packages or updating dependencies) [1]. Historically, this meant that if a package version was already pinned in the bun.lock file, bun install and bun install --frozen-lockfile would silently install that version, even if it violated the minimumReleaseAge cooldown, essentially bypassing the protection [1]. However, this behavior has been addressed to ensure better security [1]. A fix was implemented (referenced in Bun issue #30525) where bun install --frozen-lockfile now performs a pre-install gate check [1]. This check walks the bun.lock file, verifies the publication timestamps of the pinned versions against the minimumReleaseAge threshold, and will fail (exit with an error) if any pinned version violates the cooldown [1]. If you find that your minimumReleaseAge is being ignored, ensure you are running a version of Bun that includes this fix [1]. Additionally, note that minimumReleaseAge is intended to gate resolution; if you are encountering issues where it appears ignored, check that you are not accidentally bypassing it via minimumReleaseAgeExcludes or by setting the age to 0 [1][2][3]. If a lockfile was generated before a strict minimumReleaseAge was enforced, bun install --frozen-lockfile should now correctly identify and error on those previously-allowed, now-blocked versions [1].

Citations:


Remove the release-age override if supply-chain protection is desired.

Lines 92 and 140 pass --minimum-release-age 0, which disables Bun’s minimumReleaseAge pre-install gate. If this is not intentional, remove the flag from both bun install --frozen-lockfile commands so pinned lockfile entries are still age-checked.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 92 - 95, Remove the --minimum-release-age 0 override
from both bun install --frozen-lockfile commands in the Makefile, including the
commands near the skills SDK installation and the other installation flow, so
Bun’s configured minimumReleaseAge protection remains active.

Source: MCP tools

Comment thread Makefile
count=$$(printf '%s\n' "$$names" | wc -l | tr -d ' '); \
echo "Installing $$count skill(s) from $$source..."; \
bun x skills add "$$source" --global --yes $$skill_args </dev/null; \
$(SKILLS_CLI) add "$$source" --global --yes $$skill_args </dev/null; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Quote SKILLS_CLI at every command site.

SKILLS_CLI includes SKILLS_PROJECT_DIR, but Lines 118 and 141 expand it without quotes. A checkout path containing spaces will fail before the CLI starts. The command printed at Line 161 is also not copy-safe.

Proposed fix
-		$(SKILLS_CLI) add "$$source" --global --yes $$skill_args </dev/null; \
+		"$(SKILLS_CLI)" add "$$source" --global --yes $$skill_args </dev/null; \

-	@$(SKILLS_CLI) update --global --yes </dev/null
+	@"$(SKILLS_CLI)" update --global --yes </dev/null

-			echo "warn: no installed skills for install-all repo $$repo; run: bun install --frozen-lockfile --minimum-release-age 0 && $(SKILLS_CLI) add $$repo --global --yes --skill '*'"; \
+			echo "warn: no installed skills for install-all repo $$repo; run: bun install --frozen-lockfile --minimum-release-age 0 && \"$(SKILLS_CLI)\" add $$repo --global --yes --skill '*'"; \

Also applies to: 141-141, 161-161

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` at line 118, Quote the SKILLS_CLI expansion at every command site
in the Makefile, including the add command and the commands around lines 141 and
161, so paths containing spaces execute correctly and printed commands remain
copy-safe.

Comment thread package.json
"@intellectronica/ruler": "^0.3.23",
"lefthook": "^2.0.15",
"skills": "^1.5.20"
"skills": "^1.5.22"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

if [ -e node_modules/.bin/skills ]; then
  readlink node_modules/.bin/skills || true
  head -n 1 node_modules/.bin/skills
fi

command -v node >/dev/null && node --version || echo "node is not on PATH"
command -v bun >/dev/null && bun --version || echo "bun is not on PATH"

fd -H -t f '^(package\.json|\.nvmrc|\.node-version|\.tool-versions|Dockerfile.*)$' . \
  -x sh -c 'printf "\n--- %s ---\n" "$1"; rg -n "engines|node|bun|setup-node|setup-bun" "$1" || true' sh {}

Repository: shunkakinoki/dotagents

Length of output: 523


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- package.json ---\n'
cat -n package.json

printf '\n--- lockfile skills package entry ---\n'
if [ -f bun.lock ]; then
  python3 - <<'PY'
from pathlib import Path
p = Path('bun.lock')
text = p.read_text()
for i,line in enumerate(text.splitlines(), 1):
    if '"skills' in line or 'skills@' in line or 'name": "skills"' in line:
        start=max(1,i-8); end=min(len(text.splitlines()), i+15)
        for n in range(start,end+1):
            print(f"{n:4d}: {text.splitlines()[n-1]}")
        print("...")
PY
fi

printf '\n--- files mentioning runtime/tooling ---\n'
fd -H -t f '^(package\.json|bun\.lock$|\.nvmrc|\.node-version|\.tool-versions|Dockerfile.*|Makefile|\.github/workflows/.*)$' . \
  -x sh -c 'printf "\n--- %s ---\n" "$1"; rg -n "engines|node|bun|setup-node|setup-bun|node_modules/.bin/skills|skills:" "$1" || true' sh {}

Repository: shunkakinoki/dotagents

Length of output: 251


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- package.json ---'
cat -n package.json

printf '%s\n' ''
printf '%s\n' '--- lockfile skills package entry ---'
if [ -f bun.lock ]; then
  python3 - <<'PY'
from pathlib import Path
p = Path('bun.lock')
text = p.read_text()
for i,line in enumerate(text.splitlines(), 1):
    if '"skills' in line or 'skills@' in line or 'name": "skills"' in line:
        start=max(1,i-8); end=min(len(text.splitlines()), i+15)
        for n in range(start,end+1):
            print(f"{n:4d}: {text.splitlines()[n-1]}")
        print("...")
PY
fi

printf '%s\n' ''
printf '%s\n' '--- files mentioning runtime/tooling ---'
find . \( -type f \( -name package.json -o -name bun.lock -o -name .nvmrc -o -name .node-version -o -name .tool-versions -o 'iname Dockerfile*' \) -o -path '.github/workflows/*' \) -print0 2>/dev/null | sort -z | xargs -0 -r sh -c 'printf "%s\n" "--- $1 ---"; rg -n "engines|node|bun|setup-node|setup-bun|node_modules/.bin/skills|skills:" "$1" || true' sh {}

Repository: shunkakinoki/dotagents

Length of output: 5786


🌐 Web query:

vercel-labs skills package.json engines node bin cli.mjs skills@1.5.22

💡 Result:

The vercel-labs/skills package (npm: skills), specifically version 1.5.22, is the CLI tool for the open agent skills ecosystem [1][2][3]. Key details from its package.json and configuration: Node.js Engine Requirements: The package.json for version 1.5.22 declares the following engine requirement [1]: "engines": { "node": ">=22.20.0" } Note that while older documentation and previous versions of the package historically claimed support for Node.js 18+ [4][5][6], the repository has updated its requirements to align with its build and runtime behavior, which relies on features available in newer Node.js versions (specifically those supporting native TypeScript execution or newer ESM exports) [4][5]. Binaries (CLI): The package defines its executable entry points in the bin field of package.json [1]: "bin": { "skills": "./bin/cli.mjs", "add-skill": "./bin/cli.mjs" } Both the primary command, skills, and its alias, add-skill, map to the same file, bin/cli.mjs [1][7][8]. This file acts as a wrapper that manages the execution flow for the CLI [7][8]. General Information: - Package Manager: The project uses pnpm, as specified in package.json by "packageManager": "pnpm@10.17.1" [1][6]. - Module System: The package is configured as an ESM-only package ("type": "module") [1]. - Functionality: The CLI is used to install, manage, and list skills for various AI agents (e.g., Claude Code, OpenCode, Cursor) [2][8][3]. It can be invoked directly via npx skills without local installation [6][7][8].

Citations:


Document or enforce Node 22.20.0+ for skills@1.5.22.

skills@1.5.22 declares node >=22.20.0, and its CLI entry is bin/cli.mjs. This repository does not declare a Node runtime contract, so supported checkouts can still fail if they run an older Node. Add a runtime marker such as .node-version, or update the README with this Node requirement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 20, Declare the required Node.js runtime for the skills
dependency by adding a repository runtime marker such as .node-version set to
22.20.0, or documenting Node.js 22.20.0+ in the README. Ensure the contract
clearly applies to supported checkouts using skills@1.5.22.

Source: MCP tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant