Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/commands/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Run this command when:
2. **If docs changed or `$ARGUMENTS` includes `force`:**
Run the generator script:
```bash
node scripts/generate-agents-md.js
node scripts/agents.js
```

3. **Report the result:**
Expand Down
59 changes: 59 additions & 0 deletions .github/.githooks/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/sh
# Regenerates docs/agents.md after each commit (when commit message contains "agents.md").
# If the index changed, creates a follow-up commit.
#
# Debug: DEBUG_AGENTS_HOOK=1 git commit ... (or export it for the session)

log() {
[ -n "$DEBUG_AGENTS_HOOK" ] && echo "[post-commit] $*" >&2
}

log "fired (pid=$$)"

# Guard against recursion: this hook re-fires on the follow-up commit below.
if [ -n "$AGENTS_MD_HOOK_RUNNING" ]; then
log "recursion guard hit; exiting"
exit 0
fi
export AGENTS_MD_HOOK_RUNNING=1

REPO_ROOT=$(git rev-parse --show-toplevel) || exit 0
cd "$REPO_ROOT" || exit 0
log "repo root: $REPO_ROOT"

# Only run when the commit message opts in with the trigger token (case-insensitive).
MSG=$(git log -1 --pretty=%B)
log "last commit msg: $MSG"
if ! printf '%s' "$MSG" | grep -qi 'agents\.md'; then
log "trigger 'agents.md' NOT in commit message; exiting"
exit 0
fi
log "trigger matched"

if [ ! -f scripts/agents.js ]; then
log "scripts/agents.js NOT FOUND; exiting"
exit 0
fi

log "running: node scripts/agents.js"
if [ -n "$DEBUG_AGENTS_HOOK" ]; then
node scripts/agents.js
rc=$?
else
node scripts/agents.js >/dev/null 2>&1
rc=$?
fi
if [ $rc -ne 0 ]; then
echo "post-commit: agents.js failed (exit $rc); skipping" >&2
exit 0
fi

if git diff --quiet -- docs/agents.md 2>/dev/null; then
log "docs/agents.md unchanged; nothing to commit"
exit 0
fi
log "docs/agents.md changed; creating follow-up commit"

git add docs/agents.md
git commit -m "chore: regenerate docs/agents.md" --no-verify >/dev/null
log "follow-up commit created"
42 changes: 38 additions & 4 deletions docs/agents.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
# Base Docs Index
IMPORTANT: Prefer retrieval-led reasoning. Read relevant docs before generating code.
Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainKit, MiniKit.
---
title: Base Docs Index
description: Look up Base documentation with a compact directory-grouped index built for AI coding agents. Lists every markdown page by parent directory so agents find context before generating code.
---
# https://docs.base.org/llms.txt

## Base Documentation — LLM Entry Point

> High-signal index of section guides. Jump to a section's llms.txt for concise intros, curated links, and fast navigation.

- [AI Agents](./ai-agents/llms.txt) — Build AI agents that trade, earn, and transact autonomously on Base
- [Apps](./apps/llms.txt) — A step-by-step guide to building a Next.js tally app on Base using wagmi and viem, with wallet connection, contract reads and writes, and batch transaction support.
- [Base Account](./base-account/llms.txt)
- [Base Chain](./base-chain/llms.txt) — Bridge tokens and messages between Base and Solana Mainnet
- [Get Started](./get-started/llms.txt)

## Tools available for AI assistants

These resources give AI assistants direct access to Base documentation and reusable workflows.

### Base MCP server

`https://docs.base.org/mcp`

### Base skills

AI agents can use Base skills to perform onchain actions directly from their tool loop — no custom integration required. Available skills include:

[https://github.com/base/skills](https://github.com/base/skills)

Install Base skills for your AI assistant:

```
npx skills add base/base-skills
```

## Compact docs index

[Docs]|root:./docs
|ai-agents:index
|ai-agents/payments:accepting-payments,pay-for-services-with-x402
Expand Down Expand Up @@ -69,5 +104,4 @@ Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainK
|base-chain/specs/upgrades/jovian:derivation,exec-engine,l1-attributes,overview,system-config
|base-chain/specs/upgrades/pectra-blob-schedule:derivation,overview
|get-started:base-mentorship-program,base-services-hub,base,block-explorers,concepts,country-leads-and-ambassadors,data-indexers,deploy-smart-contracts,docs-llms,docs-mcp,get-funded,launch-token,learning-resources,prompt-library,resources-for-ai-agents
|onchainkit:migrate-from-onchainkit
|root:agents,changes,cookie-policy,privacy-policy,terms-of-service,tone_of_voice
2 changes: 1 addition & 1 deletion docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Cross-links updated in **non-hidden** docs only, e.g. [`get-started/learning-res
- [`docs/apps/**`](apps/) — **Visible** pages (e.g. `guides/migrate-to-standard-web-app`, `growth/rewards`, `technical-guides/base-notifications`) plus `llms.txt` / `llms-full.txt`.
- [`docs/llms.txt`](llms.txt), [`docs/llms-full.txt`](llms-full.txt).
- [`claude.md`](../claude.md) — repo structure diagram.
- [`scripts/generate-agents-md.js`](../scripts/generate-agents-md.js) — comments.
- [`scripts/agents.js`](../scripts/agents.js) — comments.
- [`docs/agents.md`](agents.md) — regenerated.

## Verification
Expand Down
63 changes: 0 additions & 63 deletions docs/onchainkit/migrate-from-onchainkit.mdx

This file was deleted.

13 changes: 13 additions & 0 deletions githooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Hooks

To enable git hooks for this repo, run the following from the repo root:

```sh
# 1. Register the hooks directory
git config core.hooksPath githooks

# 2. Make the post-commit hook executable
chmod +x githooks/post-commit
```

Once installed, any commit message containing `agents.md` will automatically regenerate `docs/agents.md`.
59 changes: 59 additions & 0 deletions githooks/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/sh
# Regenerates docs/agents.md after each commit (when commit message contains "agents.md").
# If the index changed, creates a follow-up commit.
#
# Debug: DEBUG_AGENTS_HOOK=1 git commit ... (or export it for the session)

log() {
[ -n "$DEBUG_AGENTS_HOOK" ] && echo "[post-commit] $*" >&2
}

log "fired (pid=$$)"

# Guard against recursion: this hook re-fires on the follow-up commit below.
if [ -n "$AGENTS_MD_HOOK_RUNNING" ]; then
log "recursion guard hit; exiting"
exit 0
fi
export AGENTS_MD_HOOK_RUNNING=1

REPO_ROOT=$(git rev-parse --show-toplevel) || exit 0
cd "$REPO_ROOT" || exit 0
log "repo root: $REPO_ROOT"

# Only run when the commit message opts in with the trigger token (case-insensitive).
MSG=$(git log -1 --pretty=%B)
log "last commit msg: $MSG"
if ! printf '%s' "$MSG" | grep -qi 'agents\.md'; then
log "trigger 'agents.md' NOT in commit message; exiting"
exit 0
fi
log "trigger matched"

if [ ! -f scripts/agents.js ]; then
log "scripts/agents.js NOT FOUND; exiting"
exit 0
fi

log "running: node scripts/agents.js"
if [ -n "$DEBUG_AGENTS_HOOK" ]; then
node scripts/agents.js
rc=$?
else
node scripts/agents.js >/dev/null 2>&1
rc=$?
fi
if [ $rc -ne 0 ]; then
echo "post-commit: agents.js failed (exit $rc); skipping" >&2
exit 0
fi

if git diff --quiet -- docs/agents.md 2>/dev/null; then
log "docs/agents.md unchanged; nothing to commit"
exit 0
fi
log "docs/agents.md changed; creating follow-up commit"

git add docs/agents.md
git commit -m "chore: regenerate docs/agents.md" --no-verify >/dev/null
log "follow-up commit created"
Loading
Loading