Skip to content

Add AI agent documentation and architecture reference - #4066

Closed
yboaron wants to merge 1 commit into
submariner-io:develfrom
yboaron:add-ai-agent-support
Closed

Add AI agent documentation and architecture reference#4066
yboaron wants to merge 1 commit into
submariner-io:develfrom
yboaron:add-ai-agent-support

Conversation

@yboaron

@yboaron yboaron commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Consolidates project documentation to support AI coding assistants and improve developer onboarding:

  • AGENTS.md: Tool-agnostic entry point for AI assistants (Claude Code, Cursor, Copilot, etc.) following the AGENTS.md standard
  • ARCHITECTURE.md: Complete architectural overview from PR Add project architecture context for AI agents #3956 by aswinsuryan, relocated to root per maintainer feedback
  • CLAUDE.md: Simplified to reference AGENTS.md following industry best practices (Langflow pattern)

Enables AI assistants to answer questions about codebase structure. References submariner-diagnostics for runtime datapath details.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive development guidelines for AI coding assistants via AGENTS.md, including architecture context, patterns, build/test guidance, and troubleshooting references.
    • Added/expanded ARCHITECTURE.md with a fuller overview of Submariner components, roles, APIs, metrics, and build/CI notes.
    • Updated CLAUDE.md to direct agents to AGENTS.md as the primary source of repository guidance.

@submariner-bot

Copy link
Copy Markdown
Contributor

🤖 Created branch: z_pr4066/yboaron/add-ai-agent-support
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds AGENTS.md as a new AI coding agent reference document for the Submariner repository, adds ARCHITECTURE.md as a comprehensive developer architecture reference, and updates CLAUDE.md to redirect agents to AGENTS.md by removing its prior inline development guidelines.

Changes

Repository Documentation for AI Agents and Developers

Layer / File(s) Summary
CLAUDE.md redirect and AGENTS.md agent guide
CLAUDE.md, AGENTS.md
CLAUDE.md removes prior inline development guidelines and adds a pointer to AGENTS.md; AGENTS.md is introduced with a repository overview, architecture navigation pointers, extension patterns for event handlers and cable drivers, code conventions for logging and packet filtering, testing approaches, contributor workflow guidance, build/test make targets, troubleshooting references, and external links.
ARCHITECTURE.md comprehensive system reference
ARCHITECTURE.md
New file documents Submariner's cross-cluster networking model, component responsibilities (Gateway, Route Agent, Globalnet, Await Node Ready), handler and cable driver extension patterns, core CRD and API types, key external dependencies, container image build characteristics, Prometheus metrics, and CI and build make commands.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Actionable Comments Resolved ❌ Error AGENTS.md still contains the problematic submariner-diagnostics links at lines 46-51 and 156 that were flagged in review comments. No changes were made to address the requested resolution. Update or remove the submariner-diagnostics links in lines 46-51 and 156 of AGENTS.md to address the outstanding review comments, or verify and document their validity.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding new AI agent documentation (AGENTS.md) and consolidating architecture reference (ARCHITECTURE.md).
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.

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.

@yboaron
yboaron force-pushed the add-ai-agent-support branch from 14c7a31 to d1a6399 Compare June 15, 2026 08:46

@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 `@AGENTS.md`:
- Around line 46-51: The three documentation links in AGENTS.md for Datapath
Architecture, Tunnel Analysis, and RouteAgent Analysis reference a non-existent
submariner-diagnostics repository on GitHub. Either replace these links with the
correct documentation URLs from https://submariner.io if the referenced analysis
documents are available there, or remove these links entirely if the analysis
documents are no longer maintained. Ensure that any replacement links point to
valid and accessible documentation sources.

In `@CLAUDE.md`:
- Line 3: Replace the non-standard `@AGENTS.md` syntax with proper Markdown link
syntax by converting it to `[AGENTS.md](URL)` format, where URL should be the
appropriate link destination. This change ensures compliance with Markdown
standards and consistency with the proper link format already used elsewhere in
the CLAUDE.md file.
- Around line 5-6: In CLAUDE.md at lines 5-6, replace the broken URL
`[AGENTS.md](https://agents.md/)` with `[AGENTS.md](./AGENTS.md)` to use a
relative link to the actual AGENTS.md file. In AGENTS.md around line 32, add
documentation explaining that the `@filename.md` syntax (used throughout files
like `@AGENTS.md`, `@ARCHITECTURE.md`, `@.agents/commit-templates.md`) is a
custom cross-reference convention for AI agents to navigate the documentation.
In ARCHITECTURE.md at lines 12-14, no direct change is required as the external
GitHub links for Datapath Architecture, Tunnel Analysis, and RouteAgent Analysis
are valid.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9f98cfb2-ea33-4308-8703-f48d41ff369e

📥 Commits

Reviewing files that changed from the base of the PR and between a05e1e3 and d1a6399.

📒 Files selected for processing (3)
  • AGENTS.md
  • ARCHITECTURE.md
  • CLAUDE.md

Comment thread CLAUDE.md Outdated
Comment thread CLAUDE.md Outdated
Comment on lines +5 to +6
This project uses [AGENTS.md](https://agents.md/) as the standard for
providing context to AI coding agents.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Comprehensive verification across all three modified markdown files
cd "$(git rev-parse --show-toplevel)"

echo "=== 1. Checking Markdownlint Configuration ==="
if [ -f ".markdownlintrc" ] || [ -f ".markdownlint.json" ] || [ -f ".markdownlint.yaml" ]; then
  echo "Found markdown linting config:"
  find . -maxdepth 1 -name ".markdownlint*" -type f -exec cat {} \;
else
  echo "No markdown linting config found at root"
fi

echo -e "\n=== 2. Verifying Referenced Workflow Files Exist ==="
workflow_files=(
  ".agents/commit-templates.md"
  ".agents/workflows/cve-fix.md"
  ".agents/workflows/konflux-component-setup.md"
  "ARCHITECTURE.md"
  "AGENTS.md"
)
for f in "${workflow_files[@]}"; do
  if [ -f "$f" ]; then
    echo "$f"
  else
    echo "✗ MISSING: $f"
  fi
done

echo -e "\n=== 3. Checking for Custom @ Reference Patterns in Codebase ==="
echo "Files using @ references:"
rg -l '@[A-Z_]' --type md
echo -e "\nContext of @ usage:"
rg -n '@[A-Z_]' --type md -B1 -A1

Repository: submariner-io/submariner

Length of output: 736


🏁 Script executed:

#!/bin/bash
cd "$(git rev-parse --show-toplevel)"

echo "=== 1. Checking for Makefile markdownlint target ==="
if [ -f "Makefile" ]; then
  grep -n "markdownlint" Makefile || echo "No markdownlint target found"
else
  echo "No Makefile found"
fi

echo -e "\n=== 2. Exact content of CLAUDE.md lines 1-10 ==="
head -10 CLAUDE.md | cat -n

echo -e "\n=== 3. Exact content of AGENTS.md around lines 30-35 ==="
sed -n '30,35p' AGENTS.md | cat -n

echo -e "\n=== 4. Exact content of AGENTS.md around lines 115-120 ==="
sed -n '115,120p' AGENTS.md | cat -n

echo -e "\n=== 5. Exact content of ARCHITECTURE.md lines 12-14 ==="
sed -n '12,14p' ARCHITECTURE.md | cat -n

echo -e "\n=== 6. Searching for @ reference documentation ==="
rg "@" --type md --glob "*.md" | head -20

Repository: submariner-io/submariner

Length of output: 1591


🏁 Script executed:

#!/bin/bash
cd "$(git rev-parse --show-toplevel)"

echo "=== 1. Search for @ reference documentation in README/docs ==="
rg "@ reference|@.*\.md|document reference" --type md -i | head -20

echo -e "\n=== 2. Check for markdownlint config in subdirectories ==="
find . -name ".markdownlint*" -type f 2>/dev/null

echo -e "\n=== 3. Check if makefile or other build config mentions markdownlint ==="
find . -name "Makefile*" -o -name "*.mk" -o -name "Taskfile*" 2>/dev/null | xargs grep -l "markdownlint" 2>/dev/null || echo "No markdownlint in build configs"

echo -e "\n=== 4. Check .github workflows for markdownlint ==="
find .github -name "*.yaml" -o -name "*.yml" 2>/dev/null | xargs grep -l "markdownlint" 2>/dev/null || echo "No markdownlint in GitHub workflows"

echo -e "\n=== 5. Count all @ prefix usages in markdown files ==="
rg "@[A-Za-z_./\-]+" --type md -o | sort | uniq -c | sort -rn

Repository: submariner-io/submariner

Length of output: 955


🏁 Script executed:

#!/bin/bash
cd "$(git rev-parse --show-toplevel)"

echo "=== 1. Content of .markdownlint.yml ==="
cat .markdownlint.yml

echo -e "\n=== 2. Content of .markdownlintignore ==="
cat .markdownlintignore

echo -e "\n=== 3. Content of .github/workflows/linting.yml ==="
cat .github/workflows/linting.yml

echo -e "\n=== 4. Search for @ reference explanation in AGENTS.md and related docs ==="
rg -B5 -A5 "@.*\.md" AGENTS.md CLAUDE.md | head -50

echo -e "\n=== 5. Check if README documents the @ prefix convention ==="
cat README.md | grep -A10 -B10 "@" || echo "No @ documentation in README"

Repository: submariner-io/submariner

Length of output: 8272


🏁 Script executed:

#!/bin/bash
cd "$(git rev-parse --show-toplevel)"

echo "=== 1. Search for markdownlint target in Makefile (verbose) ==="
grep -n "^markdownlint" Makefile || echo "Pattern: ^markdownlint not found"
grep -n "markdownlint" Makefile | head -20 || echo "No markdownlint references"

echo -e "\n=== 2. Check Makefile for includes or sourced files ==="
head -50 Makefile | cat -n

echo -e "\n=== 3. Verify GitHub links are accessible (check response codes) ==="
urls=(
  "https://github.com/submariner-io/submariner-diagnostics/blob/devel/docs/analysis/datapath-architecture.md"
  "https://github.com/submariner-io/submariner-diagnostics/blob/devel/docs/analysis/tunnel-analysis.md"
  "https://github.com/submariner-io/submariner-diagnostics/blob/devel/docs/analysis/routeagent-analysis.md"
)
for url in "${urls[@]}"; do
  echo "Testing: $url"
  curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" "$url" || echo "Could not test (curl may be unavailable)"
done

Repository: submariner-io/submariner

Length of output: 2976


🏁 Script executed:

#!/bin/bash
cd "$(git rev-parse --show-toplevel)"

echo "=== 1. Check if markdownlint is a script in scripts/ directory ==="
ls -la scripts/ | grep -i markdown

echo -e "\n=== 2. Search entire Makefile for markdownlint (not just start of line) ==="
cat Makefile | grep -i markdownlint

echo -e "\n=== 3. Check SHIPYARD_DIR and Makefile.inc for markdownlint ==="
echo "SHIPYARD_DIR value:"
grep "SHIPYARD_DIR" Makefile | head -5
echo -e "\nSearching for markdownlint in common locations:"
find . -name "Makefile.inc" -o -name "*makefile*" | xargs grep -l "markdownlint" 2>/dev/null || echo "Not found in local makefiles"

echo -e "\n=== 4. Verify the exact broken URL in CLAUDE.md ==="
sed -n '5,6p' CLAUDE.md

echo -e "\n=== 5. Check if @ prefix is a dockyard/markdown-it plugin convention ==="
rg "markdown-it|dockyard|@" .markdownlint.yml || echo "No special plugins configured"

echo -e "\n=== 6. Full AGENTS.md to understand @ context ==="
wc -l AGENTS.md

Repository: submariner-io/submariner

Length of output: 743


🏁 Script executed:

#!/bin/bash
cd "$(git rev-parse --show-toplevel)"

echo "=== Final verification: Check complete AGENTS.md for @ usage context ==="
cat AGENTS.md

Repository: submariner-io/submariner

Length of output: 4927


Fix broken URL and document @ reference syntax convention.

  1. Broken URL in CLAUDE.md line 5: Change [AGENTS.md](https://agents.md/) to [AGENTS.md](./AGENTS.md). The domain https://agents.md/ is not a valid reference.

  2. Undocumented @ reference syntax: The @ prefix is used throughout the AI agent context files (@AGENTS.md, @ARCHITECTURE.md, @.agents/commit-templates.md, etc.) but is never documented as a custom convention. Add clarification to AGENTS.md explaining that @filename.md is a custom cross-reference syntax for AI agents to navigate the documentation—or implement actual markdown link conversion if this syntax is meant to be processed.

  3. External GitHub links verified: The three submariner-diagnostics links in ARCHITECTURE.md (Datapath Architecture, Tunnel Analysis, RouteAgent Analysis) are valid and accessible.

  4. Markdownlint is required: The coding guideline is correct—make markdownlint is enforced by the CI pipeline (.github/workflows/linting.yml). Ensure it was run before commit.

📍 Affects 3 files
  • CLAUDE.md#L5-L6 (this comment)
  • AGENTS.md#L32-L32
  • ARCHITECTURE.md#L12-L14
🤖 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 `@CLAUDE.md` around lines 5 - 6, In CLAUDE.md at lines 5-6, replace the broken
URL `[AGENTS.md](https://agents.md/)` with `[AGENTS.md](./AGENTS.md)` to use a
relative link to the actual AGENTS.md file. In AGENTS.md around line 32, add
documentation explaining that the `@filename.md` syntax (used throughout files
like `@AGENTS.md`, `@ARCHITECTURE.md`, `@.agents/commit-templates.md`) is a
custom cross-reference convention for AI agents to navigate the documentation.
In ARCHITECTURE.md at lines 12-14, no direct change is required as the external
GitHub links for Datapath Architecture, Tunnel Analysis, and RouteAgent Analysis
are valid.

Source: Coding guidelines

Consolidates project documentation to support AI coding assistants
and improve developer onboarding:

- AGENTS.md: Tool-agnostic entry point for AI assistants (Claude Code,
  Cursor, Copilot, etc.) following the AGENTS.md standard
- ARCHITECTURE.md: Complete architectural overview from PR submariner-io#3956 by
  aswinsuryan, relocated to root per maintainer feedback
- CLAUDE.md: Simplified to reference AGENTS.md following industry
  best practices (Langflow pattern)

Enables AI assistants to answer questions about codebase structure.
References submariner-diagnostics for runtime datapath details.

Signed-off-by: Yossi Boaron <yboaron@redhat.com>
@yboaron
yboaron force-pushed the add-ai-agent-support branch from d1a6399 to 0911e7f Compare June 15, 2026 12:19

@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: 2

🤖 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 `@AGENTS.md`:
- Around line 152-158: Update the submariner-diagnostics link in the
Troubleshooting section of AGENTS.md (lines 152-158). Verify if the referenced
submariner-diagnostics repository at
github.com/submariner-io/submariner-diagnostics is now available and accessible.
If the repository does not exist or is not available, replace the link with a
reference to subctl's diagnostic capabilities as documented on the Submariner
website. Note that this same non-existent repository link also appears elsewhere
in the file (lines 46-51) and should be updated consistently across both
locations.
- Around line 46-51: The documentation links for Datapath Architecture, Tunnel
Analysis, and RouteAgent Analysis in AGENTS.md reference a non-existent
submariner-diagnostics repository. Verify whether these analysis documents are
available at https://submariner.io or elsewhere, then either replace the GitHub
links with the correct URLs if the documents exist, or remove these three
documentation references entirely if they are no longer maintained. Ensure any
retained links are functional and properly documented.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9085cf72-1c9b-4fe8-a2f9-d18ffd04b73c

📥 Commits

Reviewing files that changed from the base of the PR and between d1a6399 and 0911e7f.

📒 Files selected for processing (3)
  • AGENTS.md
  • ARCHITECTURE.md
  • CLAUDE.md
✅ Files skipped from review due to trivial changes (2)
  • CLAUDE.md
  • ARCHITECTURE.md

Comment thread AGENTS.md
Comment thread AGENTS.md
@yboaron yboaron added the ready-to-test When a PR is ready for full E2E testing label Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further
activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Jun 30, 2026
@github-actions github-actions Bot closed this Jul 8, 2026
@submariner-bot

Copy link
Copy Markdown
Contributor

🤖 Closed branches: [z_pr4066/yboaron/add-ai-agent-support]

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

Labels

ready-to-test When a PR is ready for full E2E testing stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants