Skip to content

Add AGENTS.md, shellcheck automation, and version-check.sh#1

Open
ZippyType wants to merge 1 commit into
mainfrom
feat/agents-and-automations-clean
Open

Add AGENTS.md, shellcheck automation, and version-check.sh#1
ZippyType wants to merge 1 commit into
mainfrom
feat/agents-and-automations-clean

Conversation

@ZippyType

@ZippyType ZippyType commented May 22, 2026

Copy link
Copy Markdown
Owner

What

  • AGENTS.md — documents LFS build conventions, required environment variables, build discipline rules, verified host tool versions, and how to use opencode.
  • .ona/automations.yaml — two automation tasks:
    • installShellcheck — installs shellcheck automatically on postDevcontainerStart
    • lintScripts — manually triggered; runs shellcheck -x against every .sh file in the repo and reports a pass/fail summary
  • version-check.sh — script to verify all required LFS host tools are present and print their versions

Why

The repo had no documented conventions for agents or contributors, no automated code quality checks, and no way to quickly verify the host build environment. This adds all three.

Notes

  • A dry run of lintScripts found 7 of 20 scripts with issues — those are pre-existing and can be fixed in follow-up commits.
  • shellcheck (v0.9.0) is installed in the devcontainer via the automation; no manual setup needed.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added automated shell script linting that validates all scripts and provides a summary report
    • Added tool version checking capability to verify installed components
  • Documentation

    • Added comprehensive development environment documentation covering setup, installed tools, automation tasks, and development guidelines

Review Change Stack

- AGENTS.md documents LFS build conventions, environment variables,
  build discipline, and verified host tool versions
- .ona/automations.yaml adds two tasks: installShellcheck (runs on
  postDevcontainerStart) and lintScripts (manual, runs shellcheck
  against all .sh files)
- version-check.sh verifies required LFS host tool versions

Co-authored-by: Ona <no-reply@ona.com>
@vercel

vercel Bot commented May 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aaron-linux Ready Ready Preview, Comment May 22, 2026 6:38am

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR establishes a build environment with automated shell script linting, comprehensive documentation, and version verification. It adds Ona automation to install and run shellcheck over repository scripts, a detailed AGENTS.md guide describing the LFS environment and agent practices, and a version-check utility for toolchain verification.

Changes

Build Environment Setup

Layer / File(s) Summary
Shell script linting automation
.ona/automations.yaml
Ona tasks install shellcheck on startup and run linting across all .sh files, tracking pass/fail counts and failing the task if any checks fail; lintScripts depends on installShellcheck.
Environment and agent guidelines documentation
AGENTS.md
Documents the LFS build environment, verified toolchain versions with re-verification commands, installed tools, Ona linting automation, and detailed agent guidelines covering environment variables, build discipline, filesystem constraints, and tool usage.
Version verification utility
version-check.sh
Bash script that prints version strings for toolchain components (bash, binutils, bison, gcc, g++, glibc, make) to verify build environment compatibility.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops through scripts so fine,
With checks aligned in perfect line,
From version dust to linting rules,
The warren's built with sharpened tools! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes all three main additions in the changeset: AGENTS.md documentation, shellcheck automation configuration, and version-check.sh script.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/agents-and-automations-clean

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 and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28d0252a35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread version-check.sh
export LC_ALL=C
bash --version | head -n1 | cut -d" " -f2-4
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
bison --version | head -n1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make host-tool check fail when a required command is absent

version-check.sh is intended to verify tool availability, but each check is piped through head/cut without pipefail, so a missing tool can still produce a successful pipeline status (e.g., bison --version | head -n1 returns 0 even when bison is not installed). In that case the script can exit successfully and report a false pass, which can let an invalid host environment proceed into later LFS steps and fail much later.

Useful? React with 👍 / 👎.

@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.

🧹 Nitpick comments (2)
AGENTS.md (1)

50-50: 💤 Low value

Consider quoting the find output or using -exec for robustness.

The current command will fail if any .sh filename contains whitespace. While this is just example documentation, a robust alternative would help users avoid issues.

♻️ More robust alternative
-find . -name "*.sh" -not -path "./.git/*" | sort | xargs shellcheck -x
+find . -name "*.sh" -not -path "./.git/*" -print0 | sort -z | xargs -0 shellcheck -x

Using -print0, sort -z, and xargs -0 handles filenames with spaces, newlines, and special characters correctly.

🤖 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 `@AGENTS.md` at line 50, The find + xargs pipeline in the example is unsafe for
filenames with whitespace; update the example command (the line starting with
find . -name "*.sh" -not -path "./.git/*" | sort | xargs shellcheck -x) to a
robust variant that either uses null-separated output (use find with -print0,
sort -z and xargs -0 to pass filenames safely to shellcheck) or replaces xargs
with find -exec to run shellcheck per file safely; pick one approach and update
the documentation string accordingly.
.ona/automations.yaml (1)

21-34: ⚡ Quick win

Use robust filename iteration to handle paths with whitespace.

The unquoted $SCRIPTS expansion on line 26 will word-split on any whitespace in filenames, causing the loop to break or skip files if a .sh file contains spaces or special characters.

♻️ Proposed fix using while-read loop
-      SCRIPTS=$(find . -name "*.sh" -not -path "./.git/*" | sort)
       TOTAL=0
       FAILED=0
       PASSED=0

-      for f in $SCRIPTS; do
+      while IFS= read -r f; do
         TOTAL=$((TOTAL + 1))
         echo "Checking: $f"
         if shellcheck -x "$f"; then
@@ -32,7 +30,7 @@
           FAILED=$((FAILED + 1))
         fi
         echo ""
-      done
+      done < <(find . -name "*.sh" -not -path "./.git/*" | sort)
🤖 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 @.ona/automations.yaml around lines 21 - 34, The loop over SCRIPTS uses an
unquoted expansion of $SCRIPTS which breaks on filenames with whitespace;
replace the `SCRIPTS=$(find ...)` + `for f in $SCRIPTS; do` pattern with a
null-delimited reader: run `find` with `-print0` and iterate using `while IFS=
read -r -d '' f; do` so filenames with spaces/newlines are preserved; keep the
same counters TOTAL/FAILED/PASSED and the `shellcheck -x "$f"` check inside the
new `while` loop and remove the intermediate SCRIPTS variable.
🤖 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.

Nitpick comments:
In @.ona/automations.yaml:
- Around line 21-34: The loop over SCRIPTS uses an unquoted expansion of
$SCRIPTS which breaks on filenames with whitespace; replace the `SCRIPTS=$(find
...)` + `for f in $SCRIPTS; do` pattern with a null-delimited reader: run `find`
with `-print0` and iterate using `while IFS= read -r -d '' f; do` so filenames
with spaces/newlines are preserved; keep the same counters TOTAL/FAILED/PASSED
and the `shellcheck -x "$f"` check inside the new `while` loop and remove the
intermediate SCRIPTS variable.

In `@AGENTS.md`:
- Line 50: The find + xargs pipeline in the example is unsafe for filenames with
whitespace; update the example command (the line starting with find . -name
"*.sh" -not -path "./.git/*" | sort | xargs shellcheck -x) to a robust variant
that either uses null-separated output (use find with -print0, sort -z and xargs
-0 to pass filenames safely to shellcheck) or replaces xargs with find -exec to
run shellcheck per file safely; pick one approach and update the documentation
string accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d4293f26-efb5-4a61-93fb-1cc6022ac3c0

📥 Commits

Reviewing files that changed from the base of the PR and between 6a793af and 28d0252.

📒 Files selected for processing (3)
  • .ona/automations.yaml
  • AGENTS.md
  • version-check.sh

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