Skip to content

chore: ai written CLAUDE.md files#271

Open
pityjllk wants to merge 3 commits into
mainfrom
feat/claude
Open

chore: ai written CLAUDE.md files#271
pityjllk wants to merge 3 commits into
mainfrom
feat/claude

Conversation

@pityjllk

@pityjllk pityjllk commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Documentation
    • Expanded comprehensive developer guides for the NEAR Intents project, including environment setup, build/test/lint commands, integration test procedures, repository layout, and subsystem entry points.
    • Added detailed documentation for individual contracts and components covering purpose, build variants, testing, and architectural invariants.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR establishes a centralized documentation structure for the NEAR Intents project, creating a root .agents/AGENTS.md handbook and adding subsystem-specific guides for each contract and crate, with CLAUDE.md pointers linking local contexts to shared documentation.

Changes

Documentation Structure and Subsystem Guides

Layer / File(s) Summary
Central NEAR Intents documentation guide
.agents/AGENTS.md
Root AGENTS.md expanded into comprehensive handbook covering NEAR Intents/Verifier concept, sandbox setup checklist, build/test/lint command matrix, wasm artifact loading for integration tests, repository layout, subsystem entry points, and Terminology section with NEAR concepts and NEPs (NEP-448, NEP-519, NEP-591, NEP-616) including account-id derivation and refund routing.
Contract and crate subsystem documentation
contracts/defuse/.agents/AGENTS.md, contracts/escrow-swap/.agents/AGENTS.md, contracts/global-deployer/.agents/AGENTS.md, contracts/outlayer-app/.agents/AGENTS.md, contracts/poa/.agents/AGENTS.md, contracts/wallet/.agents/AGENTS.md, crates/outlayer/.agents/AGENTS.md
Subsystem-specific AGENTS.md files document individual components: defuse verifier contract (signature schemes, build variants, deployment), escrow-swap contract (NEP-616 deterministic escrow), global-deployer (NEP-616/NEP-591 account deployment), outlayer-app (on-chain state, address derivation), PoA bridge (factory/token structure, build coupling), wallet (account abstraction invariants), and Outlayer service (on-chain/off-chain split, WIT crypto interface, constants, limits).
CLAUDE.md reference pointers
contracts/defuse/.claude/CLAUDE.md, contracts/escrow-swap/.claude/CLAUDE.md, contracts/global-deployer/.claude/CLAUDE.md, contracts/outlayer-app/.claude/CLAUDE.md, contracts/poa/.claude/CLAUDE.md, contracts/wallet/.claude/CLAUDE.md, crates/outlayer/.claude/CLAUDE.md
CLAUDE.md files in each subsystem are added or updated with a single-line reference to the parent .agents/AGENTS.md, creating a consistent navigation pattern from subsystem-local contexts to shared central documentation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • near/intents#233: Significantly expands and refines the NEAR Intents documentation structure introduced in that PR.
  • near/intents#220: Parallel documentation for the global-deployer contract describing the same NEP-616/NEP-591 account deployment flow.

Suggested reviewers

  • mitinarseny
  • fusede

Poem

🐰 A handbook for Intents, all tidy and bright,
With guides for each contract, from left side to right,
The docs and the pointers now dance hand-in-hand,
Subsystems well-charted across this vast land! 📚✨

🚥 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 describes the main change: adding AI-generated CLAUDE.md documentation files across the codebase.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/claude

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.

@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/AGENTS.md:
- Around line 157-169: The listed CLAUDE documentation links (e.g.,
contracts/defuse/CLAUDE.md, contracts/escrow-swap/CLAUDE.md,
contracts/global-deployer/CLAUDE.md, contracts/outlayer-app/CLAUDE.md,
contracts/poa/CLAUDE.md, contracts/wallet/CLAUDE.md, crates/outlayer/CLAUDE.md)
are pointing to the wrong locations; update each reference to include the hidden
`.claude/` directory (e.g., contracts/defuse/.claude/CLAUDE.md,
contracts/escrow-swap/.claude/CLAUDE.md, etc.) so the links match the PR’s file
layout and are not stale.

In `@crates/outlayer/.agents/AGENTS.md`:
- Around line 9-17: The fenced code block containing the architecture diagram
(the block that begins with "on-chain:  defuse-outlayer-app ..." and ends with
"Executor → vm-runner (wasmtime) + host imports") lacks a language hint; update
the opening triple-backtick to include the text language hint (change ``` to
```text) so the Markdown linter MD040 is satisfied and keep the closing
triple-backtick as-is.
🪄 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

Run ID: 9365f3a3-8325-463a-801e-32f14142107f

📥 Commits

Reviewing files that changed from the base of the PR and between f386af7 and 0c0b641.

📒 Files selected for processing (15)
  • .agents/AGENTS.md
  • contracts/defuse/.agents/AGENTS.md
  • contracts/defuse/.claude/CLAUDE.md
  • contracts/escrow-swap/.agents/AGENTS.md
  • contracts/escrow-swap/.claude/CLAUDE.md
  • contracts/global-deployer/.agents/AGENTS.md
  • contracts/global-deployer/.claude/CLAUDE.md
  • contracts/outlayer-app/.agents/AGENTS.md
  • contracts/outlayer-app/.claude/CLAUDE.md
  • contracts/poa/.agents/AGENTS.md
  • contracts/poa/.claude/CLAUDE.md
  • contracts/wallet/.agents/AGENTS.md
  • contracts/wallet/.claude/CLAUDE.md
  • crates/outlayer/.agents/AGENTS.md
  • crates/outlayer/.claude/CLAUDE.md

Comment thread .agents/AGENTS.md
Comment on lines +157 to +169
- `contracts/defuse/CLAUDE.md` — the **Verifier**, the core of NEAR Intents
(largest contract in the repo, `far` variant available).
- `contracts/escrow-swap/CLAUDE.md` — deterministic escrow-swap (NEP-616,
immutable params).
- `contracts/global-deployer/CLAUDE.md` — two-step approve/deploy manager for
global contract code on NEP-616 accounts (upgrade mechanism for NEP-591).
- `contracts/outlayer-app/CLAUDE.md` — on-chain piece of Outlayer; per-app
`(code_hash, code_url)` reference at a deterministic account.
- `contracts/poa/CLAUDE.md` — Proof-of-Authority bridge factory + token.
- `contracts/wallet/CLAUDE.md` — generic sharded account-abstraction wallet
(**not audited yet**).
- `crates/outlayer/CLAUDE.md` — the off-chain Outlayer runtime
(wasmtime-based component sandbox), spanning 9 subcrates. This is becoming a

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

Fix subsystem CLAUDE paths to include .claude/ directory.

The pointers in this section reference .../CLAUDE.md, but this PR’s structure places these files at .../.claude/CLAUDE.md. As written, these links are stale/misleading (see Line 157 onward).

Suggested patch
-- `contracts/defuse/CLAUDE.md` — the **Verifier**, the core of NEAR Intents
+- `contracts/defuse/.claude/CLAUDE.md` — the **Verifier**, the core of NEAR Intents
...
-- `contracts/escrow-swap/CLAUDE.md` — deterministic escrow-swap (NEP-616,
+- `contracts/escrow-swap/.claude/CLAUDE.md` — deterministic escrow-swap (NEP-616,
...
-- `contracts/global-deployer/CLAUDE.md` — two-step approve/deploy manager for
+- `contracts/global-deployer/.claude/CLAUDE.md` — two-step approve/deploy manager for
...
-- `contracts/outlayer-app/CLAUDE.md` — on-chain piece of Outlayer; per-app
+- `contracts/outlayer-app/.claude/CLAUDE.md` — on-chain piece of Outlayer; per-app
...
-- `contracts/poa/CLAUDE.md` — Proof-of-Authority bridge factory + token.
+- `contracts/poa/.claude/CLAUDE.md` — Proof-of-Authority bridge factory + token.
-- `contracts/wallet/CLAUDE.md` — generic sharded account-abstraction wallet
+- `contracts/wallet/.claude/CLAUDE.md` — generic sharded account-abstraction wallet
...
-- `crates/outlayer/CLAUDE.md` — the off-chain Outlayer runtime
+- `crates/outlayer/.claude/CLAUDE.md` — the off-chain Outlayer runtime
🤖 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/AGENTS.md around lines 157 - 169, The listed CLAUDE documentation
links (e.g., contracts/defuse/CLAUDE.md, contracts/escrow-swap/CLAUDE.md,
contracts/global-deployer/CLAUDE.md, contracts/outlayer-app/CLAUDE.md,
contracts/poa/CLAUDE.md, contracts/wallet/CLAUDE.md, crates/outlayer/CLAUDE.md)
are pointing to the wrong locations; update each reference to include the hidden
`.claude/` directory (e.g., contracts/defuse/.claude/CLAUDE.md,
contracts/escrow-swap/.claude/CLAUDE.md, etc.) so the links match the PR’s file
layout and are not stale.

Comment on lines +9 to +17
```
on-chain: defuse-outlayer-app { admin_id, code_hash, code_url }
AccountId = NEP-616(StateInit)
off-chain: Outlayer service → Resolver (URL → bytes; verify SHA-256)
Cache (moka, keyed by hash)
Executor → vm-runner (wasmtime) + host imports
```

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

Add a language hint to the fenced block to satisfy markdown lint.

The code fence starting at Line 9 has no language, triggering MD040. Use text for the architecture diagram.

Suggested patch
-```
+```text
 on-chain:  defuse-outlayer-app          { admin_id, code_hash, code_url }
                                         AccountId = NEP-616(StateInit)
                        │
                        ▼
 off-chain: Outlayer service →  Resolver (URL → bytes; verify SHA-256)
                                Cache (moka, keyed by hash)
                                Executor → vm-runner (wasmtime) + host imports
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>

[warning] 9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

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

In @crates/outlayer/.agents/AGENTS.md around lines 9 - 17, The fenced code block
containing the architecture diagram (the block that begins with "on-chain:
defuse-outlayer-app ..." and ends with "Executor → vm-runner (wasmtime) + host
imports") lacks a language hint; update the opening triple-backtick to include
the text language hint (change totext) so the Markdown linter MD040 is
satisfied and keep the closing triple-backtick as-is.


</details>

<!-- fingerprinting:phantom:triton:hawk -->

<!-- This is an auto-generated comment by CodeRabbit -->

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