Skip to content

Skills and Agent file - #147

Open
ashtarkb wants to merge 1 commit into
openshift-psap:mainfrom
ashtarkb:add-forge-skills
Open

Skills and Agent file #147
ashtarkb wants to merge 1 commit into
openshift-psap:mainfrom
ashtarkb:add-forge-skills

Conversation

@ashtarkb

@ashtarkb ashtarkb commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

add more instructions in the agent.md file and a reviewer skill, you can use lola to adopt it to your coding agnet

Summary by CodeRabbit

  • New Features

    • Added a pre-commit review skill that checks changes for key coding and security guidelines.
    • Added automated diff collection with staged, unstaged, branch, and untracked file support.
    • Added installation and setup guidance for the FORGE AI Context Module across supported coding assistants.
  • Documentation

    • Expanded contributor guidance for error handling, layer isolation, polling, configuration types, framework behavior, and environment variables.
    • Documented team-based installation and update workflows.

…can use lola to adopt it to your coding agnet
@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kpouget for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds FORGE coding guidance, a pre-commit review skill, a diff-gathering script, and documentation for installing and updating the module through Lola or manually.

Changes

FORGE review workflow

Layer / File(s) Summary
Operational review rules
AGENTS.md
Adds rules covering exception handling, toolbox isolation, polling, configuration types, framework behavior, and environment-variable restoration.
Review skill and diff collection
module/skills/forge-review/SKILL.md, module/skills/forge-review/scripts/gather-diff.sh
Defines the review procedure, findings and verdicts, scope restrictions, and staged/unstaged/remote diff collection.
Module installation documentation
module/README.md
Documents Lola registration, Cursor and Claude Code installation, declarative synchronization, manual setup, and updates.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Agent
  participant gather_diff_sh
  participant AGENTS_md
  Agent->>gather_diff_sh: Gather selected diff and status
  gather_diff_sh-->>Agent: Return structured diff sections
  Agent->>AGENTS_md: Load rule categories
  AGENTS_md-->>Agent: Return review rules
  Agent->>Agent: Analyze changes and produce verdict
Loading

Possibly related PRs

Suggested labels: lgtm, approved

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is very generic and does not clearly describe the added agent instructions and reviewer skill. Use a specific title such as "Add agent guidelines and forge-review skill".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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

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.

@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 `@module/README.md`:
- Around line 111-118: Update the Cursor and Claude Code subsection headings
under Manual installation from level four to level three, preserving the
existing heading text and document hierarchy.

In `@module/skills/forge-review/scripts/gather-diff.sh`:
- Around line 39-55: Update the remote-branch detection flow around HAS_REMOTE
and BRANCH_DIFF to capture the git ls-remote exit status without allowing set -e
to abort, and distinguish probe failures from a genuinely absent remote branch.
Resolve and use the validated remote reference for the branch diff, tracking its
exit status separately; only emit DIFF_TYPE: none when the diff command succeeds
with empty output, while preserving failure information for unsuccessful probes
or diff resolution.

In `@module/skills/forge-review/SKILL.md`:
- Around line 19-25: Update Step 1 in the forge-review skill instructions to
invoke gather-diff.sh from the installed skill directory under
.cursor/skills/forge-review/scripts or .claude/skills/forge-review/scripts,
rather than assuming a project-root ./scripts path. Keep the documented
installation locations consistent with the command so diff gathering works after
installation.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 83b3bad0-cc2d-4745-85d8-f61a877d1bbc

📥 Commits

Reviewing files that changed from the base of the PR and between 68c3880 and 8172236.

📒 Files selected for processing (4)
  • AGENTS.md
  • module/README.md
  • module/skills/forge-review/SKILL.md
  • module/skills/forge-review/scripts/gather-diff.sh

Comment thread module/README.md
Comment on lines +111 to +118
#### Cursor

```bash
mkdir -p .cursor/skills/forge-review
cp -r module/skills/forge-review/* .cursor/skills/forge-review/
```

#### Claude Code

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use level-three headings under manual installation.

## Manual installation is followed by #### Cursor and #### Claude Code, skipping ###. Change both subsections to level-three headings to preserve document navigation and resolve MD001.

🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 111-111: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)

🤖 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 `@module/README.md` around lines 111 - 118, Update the Cursor and Claude Code
subsection headings under Manual installation from level four to level three,
preserving the existing heading text and document hierarchy.

Source: Linters/SAST tools

Comment on lines +39 to +55
HAS_REMOTE=$(git ls-remote --heads origin "${BRANCH}" 2>/dev/null | head -1)
if [[ -n "${HAS_REMOTE}" ]]; then
BRANCH_DIFF=$(git diff "${REMOTE_BRANCH}...HEAD" 2>/dev/null || true)
if [[ -n "${BRANCH_DIFF}" ]]; then
echo ""
echo "=== DIFF_TYPE: branch ==="
echo "${BRANCH_DIFF}"
else
echo ""
echo "=== DIFF_TYPE: none ==="
echo "No changes found between local and remote."
fi
else
echo ""
echo "=== DIFF_TYPE: none ==="
echo "No remote branch and no local changes."
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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
fd -a 'gather-diff\.sh$' . || true

echo "== script excerpt =="
if [ -f module/skills/forge-review/scripts/gather-diff.sh ]; then
  wc -l module/skills/forge-review/scripts/gather-hdiff.sh module/skills/forge-review/scripts/gather-diff.sh 2>/dev/null || true
  sed -n '1,90p' module/skills/forge-review/scripts/gather-diff.sh | cat -n
fi

echo "== git commands in script =="
rg -n "git (ls-remote|diff|checkout|show)" module/skills/forge-review/scripts/gather-diff.sh || true

echo "== changed files/stat =="
git diff --stat HEAD~1..HEAD 2>/dev/null || true
git diff -- module/skills/forge-review/scripts/gather-diff.sh 2>/dev/null | head -120 || true

Repository: openshift-psap/forge

Length of output: 3178


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Behavioral probe for bash -euo pipefail assignment with pipeline command failure =="
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
cat > "$tmpdir/probe.sh" <<'BASH'
#!/usr/bin/env bash
set -euo pipefail
echo "pre ls-remote"
HAS_REMOTE=$(git ls-remote --heads origin nonexistent-branch-1234 2>/dev/null | head -1)
echo "after ls-remote assigned: ${HAS_REMOTE-<unset>}"
echo "pre diff"
BRANCH_DIFF=$(git diff nonexistent-unborn-branch-5678...HEAD 2>/dev/null || true)
echo "after diff assigned: ${BRANCH_DIFF-<empty>}"
echo "end"
BASH
chmod +x "$tmpdir/probe.sh"
bash "$tmpdir/probe.sh"
status=$?
echo "probe status=$status"

echo "== inspect git availability and repo gitdir =="
git --version || true
git rev-parse --git-dir || true
git ls-remote --heads origin nonexistent-branch-1234 || true
git diff nonexistent-unborn-branch-5678...HEAD || true

Repository: openshift-psap/forge

Length of output: 625


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmp=$(mktemp -d)
cd "$tmp"
git init -q
git commit --allow-empty -q -m base

cat > probe.sh <<'BASH'
#!/usr/bin/env bash
set -euo pipefail
echo "pre ls-remote"
HAS_REMOTE=$(git ls-remote --heads origin nonexistent-branch-1234 2>/dev/null | head -1)
echo "after ls-remote assigned: ${HAS_REMOTE-<unset>}"
if [[ "${HAS_REMOTE-}" != "" ]]; then
  echo "has remote"
fi
echo "pre diff"
BRANCH_DIFF=$(git diff nonexistent-unborn-branch-5678...HEAD 2>/dev/null || true)
echo "after diff assigned: ${BRANCH_DIFF-<empty>}"
echo "end"
BASH
chmod +x probe.sh
bash probe.sh
status=$?
echo "status=$status"

Repository: openshift-psap/forge

Length of output: 496


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmp=$(mktemp -d)
cd "$tmp"
git init -q
git config --local user.email test@example.com
git config --local user.name Test
git commit --allow-empty -q -m base

cat > probe.sh <<'BASH'
#!/usr/bin/env bash
set -euo pipefail
echo "pre ls-remote"
HAS_REMOTE=$(git ls-remote --heads origin nonexistent-branch-1234 2>/dev/null | head -1)
echo "after ls-remote assigned: '${HAS_REMOTE-<unset>}'"
if [[ -n "${HAS_REMOTE}" ]]; then
  echo "has remote"
fi
if [[ -z "${HAS_REMOTE}" ]]; then
  echo "no remote fallback taken"
fi
echo "pre diff"
BRANCH_DIFF=$(git diff nonexistent-unborn-branch-5678...HEAD 2>/dev/null || true)
echo "after diff assigned: '${BRANCH_DIFF-<empty>}'"
echo "end"
BASH
chmod +x probe.sh
bash probe.sh
status=$?
echo "status=$status"

Repository: openshift-psap/forge

Length of output: 176


Distinguish remote probe failures from an empty branch diff.

Under set -euo pipefail, a failed git ls-remote exits during the assignment before taking the documented no-remote fallback. Conversely, missing remote references or stale refs can cause git diff origin/${BRANCH}...HEAD to fail and produce DIFF_TYPE: none via || true. Track the probe exit status separately and only report “none” after the branch diff succeeds with no output.

🤖 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 `@module/skills/forge-review/scripts/gather-diff.sh` around lines 39 - 55,
Update the remote-branch detection flow around HAS_REMOTE and BRANCH_DIFF to
capture the git ls-remote exit status without allowing set -e to abort, and
distinguish probe failures from a genuinely absent remote branch. Resolve and
use the validated remote reference for the branch diff, tracking its exit status
separately; only emit DIFF_TYPE: none when the diff command succeeds with empty
output, while preserving failure information for unsuccessful probes or diff
resolution.

Comment on lines +19 to +25
### Step 1: Gather the diff

Run the diff gathering script:

```bash
./scripts/gather-diff.sh
```

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 | 🟠 Major | ⚡ Quick win

Resolve the diff script from the installed skill directory.

The documented installs place the script under .cursor/skills/forge-review/scripts/ or .claude/skills/forge-review/scripts/, but this command resolves ./scripts/gather-diff.sh from the project root. That path is not created by either installation method, so the skill cannot gather diffs after installation. Invoke the skill’s sibling script or install it at the project-level path consistently.

🤖 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 `@module/skills/forge-review/SKILL.md` around lines 19 - 25, Update Step 1 in
the forge-review skill instructions to invoke gather-diff.sh from the installed
skill directory under .cursor/skills/forge-review/scripts or
.claude/skills/forge-review/scripts, rather than assuming a project-root
./scripts path. Keep the documented installation locations consistent with the
command so diff gathering works after installation.

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