Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
92 changes: 92 additions & 0 deletions .github/workflows/ai-on-demand.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: AI On-Demand Assistant
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
issues:
types: [opened]

jobs:
ai-response:
# Only run if the app is mentioned and it's not the app itself commenting
if: |
(
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@efp-dev-ops')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@efp-dev-ops')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@efp-dev-ops')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '@efp-dev-ops'))
) && contains(fromJSON(vars.ALLOWED_USER_LIST), github.actor)
runs-on: ubuntu-latest
Comment on lines +17 to +22
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

Guard against missing ALLOWED_USER_LIST – add a default fallback and trim trailing space

If vars.ALLOWED_USER_LIST is not defined the workflow fails at expression-evaluation time.
Also, line 21 has a lone trailing space flagged by YAML-lint.

-      ) && contains(fromJSON(vars.ALLOWED_USER_LIST), github.actor) 
+      ) && contains(fromJSON(coalesce(vars.ALLOWED_USER_LIST, '[]')), github.actor)

(remove the trailing space at line 21 as well)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@efp-dev-ops')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@efp-dev-ops')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@efp-dev-ops')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '@efp-dev-ops'))
) && contains(fromJSON(vars.ALLOWED_USER_LIST), github.actor)
runs-on: ubuntu-latest
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@efp-dev-ops')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@efp-dev-ops')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@efp-dev-ops')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '@efp-dev-ops'))
) && contains(fromJSON(coalesce(vars.ALLOWED_USER_LIST, '[]')), github.actor)
runs-on: ubuntu-latest
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 21-21: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In .github/workflows/ai-on-demand.yaml around lines 17 to 22, the expression
uses vars.ALLOWED_USER_LIST without a default fallback, causing workflow failure
if the variable is undefined. Update the expression to provide a default empty
list fallback for ALLOWED_USER_LIST using fromJSON(vars.ALLOWED_USER_LIST ||
'[]'). Also, remove the trailing space at the end of line 21 to fix the YAML
lint warning.

permissions:
contents: read
issues: write
pull-requests: write

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Generate Custom App Token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- name: Extract Instruction from Comment
id: extract-instruction
env:
ISSUE_COMMENT_BODY: ${{ github.event.comment.body }}
PR_REVIEW_COMMENT_BODY: ${{ github.event.comment.body }}
PR_REVIEW_BODY: ${{ github.event.review.body }}
ISSUE_BODY: ${{ github.event.issue.body }}
run: |
# Get the comment body based on event type
if [ "${{ github.event_name }}" = "issue_comment" ]; then
COMMENT_BODY="$ISSUE_COMMENT_BODY"
elif [ "${{ github.event_name }}" = "pull_request_review_comment" ]; then
COMMENT_BODY="$PR_REVIEW_COMMENT_BODY"
elif [ "${{ github.event_name }}" = "pull_request_review" ]; then
COMMENT_BODY="$PR_REVIEW_BODY"
elif [ "${{ github.event_name }}" = "issues" ]; then
COMMENT_BODY="$ISSUE_BODY"
else
COMMENT_BODY=""
fi

# Remove the @mention and get the instruction
INSTRUCTION=$(echo "$COMMENT_BODY" | sed 's/@efp-dev-ops[[:space:]]*//' | sed 's/^[[:space:]]*//')

# Add input validation
if [ ${#INSTRUCTION} -gt 4000 ]; then
echo "Instruction too long, truncating..."
INSTRUCTION=$(echo "$INSTRUCTION" | head -c 4000)
fi

# Set as output for next step
echo "instruction<<EOF" >> $GITHUB_OUTPUT
echo "$INSTRUCTION" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

echo "Extracted instruction: $INSTRUCTION"

- name: AI Response
uses: 0xthrpw/claude-code-action@v0.0.1
continue-on-error: true
timeout-minutes: 10
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ steps.generate-token.outputs.token }}
direct_prompt: |
You are an AI assistant for our development team. A team member has requested help with the following:

**User Request:** ${{ steps.extract-instruction.outputs.instruction }}

Please provide a helpful, accurate response. If the request involves code analysis, focus on the current repository context. If it's a general question, provide clear and actionable guidance.

Keep your response concise but thorough, and format it nicely for GitHub comments.
77 changes: 77 additions & 0 deletions .github/workflows/ai-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Custom AI Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
# issue_comment:
# types: [created]

jobs:
ai-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history for better context

- name: Generate Custom App Token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- name: AI Code Quality Review
uses: anthropics/claude-code-action@v0
Comment on lines +18 to +30
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Tag-only action references – pin to immutable SHAs

actions/checkout@v4, actions/create-github-app-token@v1, and anthropics/claude-code-action@v0 are all tag refs.
Security best-practice is to lock each to a commit SHA.

uses: actions/checkout@v4 # → actions/checkout@<sha>

Repeat for the other two.

🤖 Prompt for AI Agents
In .github/workflows/ai-review.yaml around lines 18 to 30, the GitHub Actions
use tag references like actions/checkout@v4, actions/create-github-app-token@v1,
and anthropics/claude-code-action@v0, which are mutable. To improve security,
replace these tag references with their corresponding immutable commit SHAs by
looking up the latest commit SHA for each action at the specified tag and
updating the uses field accordingly.

continue-on-error: true
timeout-minutes: 10
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ steps.generate-token.outputs.token }}
direct_prompt: |
You are the AI code quality reviewer for our organization.

Please analyze this pull request for:

## 🔍 Code Quality Assessment
- Overall code quality rating (1-10)
- Code maintainability and readability
- Adherence to best practices
- Performance considerations

## 📚 Documentation Review
- Comment quality and completeness
- Function/method documentation
- README updates if needed

## 🎯 Specific Recommendations
- Actionable improvements with priorities
- Code refactoring suggestions
- Testing recommendations

Format your response as a professional code review.

- name: Post Summary Comment
continue-on-error: true
run: |
gh pr comment ${{ github.event.number }} --body "
## 🤖 AI Code Review Complete

Your custom AI assistant has completed the automated code review process.
Comment on lines +61 to +65
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

Incorrect event field – github.event.number is empty on PR events

For a pull_request trigger the PR number lives at github.event.pull_request.number.
The current path yields an empty string and the gh CLI call fails.

-gh pr comment ${{ github.event.number }} --body "
+gh pr comment ${{ github.event.pull_request.number }} --body "
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: |
gh pr comment ${{ github.event.number }} --body "
## 🤖 AI Code Review Complete
Your custom AI assistant has completed the automated code review process.
run: |
gh pr comment ${{ github.event.pull_request.number }} --body "
## 🤖 AI Code Review Complete
Your custom AI assistant has completed the automated code review process.
🤖 Prompt for AI Agents
In .github/workflows/ai-review.yaml around lines 61 to 65, the code uses the
incorrect event field github.event.number to get the PR number, which is empty
for pull_request events. Replace github.event.number with
github.event.pull_request.number to correctly reference the PR number and ensure
the gh CLI command works as intended.


✅ Security analysis finished
✅ Code quality assessment complete
✅ Documentation review done

Please review the detailed feedback above and address any high-priority items before merging.

---
*This automated review was performed by EFP-DEV-OPS*
"
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
158 changes: 158 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# CLAUDE.md - Ethereum Follow Protocol Documentation

## Overview
This is the documentation repository for the Ethereum Follow Protocol (EFP), an onchain social graph protocol for Ethereum accounts. The repository contains comprehensive technical documentation built with Astro and Starlight.

## Tech Stack
- **Framework**: Astro (v4.2.4) with Starlight documentation theme
- **Language**: TypeScript
- **Styling**: Tailwind CSS with custom styles
- **Package Manager**: Bun (v1.0.25)
- **Build Tool**: Astro build system
- **Deployment**: Static site generation

## Key Scripts
- `bun run dev` - Start development server
- `bun run build` - Build production site
- `bun run preview` - Preview built site
- `bun run lint` - Run ESLint with auto-fix
- `bun run format` - Format code with Prettier
- `bun run typecheck` - Run TypeScript type checking
- `bun run clean` - Clean build artifacts and dependencies

## Repository Structure

### Core Configuration
- `astro.config.ts` - Main Astro configuration with Starlight setup
- `package.json` - Dependencies and scripts
- `tsconfig.json` - TypeScript configuration
- `tailwind.config.ts` - Tailwind CSS configuration

### Content Structure
- `src/content/docs/` - All documentation MDX files
- `src/content/config.ts` - Content collection configuration
- `public/` - Static assets (images, logos, etc.)

### Documentation Sections

#### Introduction (`src/content/docs/intro/`)
- Core protocol concepts
- EFP List NFT system
- Roles (Owner, Manager, User)
- Tags and social graph mechanics

#### Specification (`src/content/docs/design/`)
- `list-registry.mdx` - ERC-721 List Registry contract
- `roles.mdx` - Role definitions and permissions
- `account-metadata.mdx` - Account metadata system
- `list-metadata.mdx` - List metadata structure
- `list-storage-location.mdx` - Storage location specifications
- `list-records.mdx` - List record structure
- `tags.mdx` - Tagging system (block, mute, top8, custom)
- `list-ops.mdx` - List operations structure
- `glossary.mdx` - Protocol terminology

#### Production (`src/content/docs/production/`)
- `deployments.mdx` - Smart contract addresses (Base, OP Mainnet, Ethereum)
- `interpreting-state.mdx` - Data interpretation guide
- `multisig.mdx` - Multisig wallet information
- `infra.mdx` - Infrastructure overview
- `silo.mdx` - Railway deployment template
- `follow-bot.mdx` - Telegram bot functionality
- `emergency-response.mdx` - Emergency procedures

#### Additional Content
- `faq.mdx` - Frequently asked questions
- `bugbounty.mdx` - Bug bounty program
- `translationbounty.mdx` - Translation bounty program
- `llmstxt.mdx` - LLM-friendly protocol documentation
- `playground/` - Interactive examples

### Design Components
- `design-components/colors.mdx` - Color specifications
- `design-components/logos.mdx` - Logo assets and usage

## Key Features

### Protocol Concepts
- **EFP List NFT**: Free-to-mint NFTs representing social lists
- **Three-Role System**: Owner, Manager, User with distinct permissions
- **Multi-Chain Support**: Base, OP Mainnet, Ethereum deployments
- **Tag System**: Standard tags (block, mute, top8) + custom tags
- **Primary List**: Account's designated main social graph

### Technical Infrastructure
- **Smart Contracts**: ERC-721 registry, list records, account metadata
- **API**: Comprehensive REST API via ethidentitykit.com
- **Indexer**: Open-source indexing system
- **Multi-Chain**: L1 and L2 deployments

### Content Management
- **MDX Support**: Rich documentation with embedded components
- **Version Control**: Git-based documentation workflow
- **Starlight**: Advanced documentation features (search, navigation, theming)

## Development Workflow

### Adding Documentation
1. Create MDX files in appropriate `src/content/docs/` subdirectory
2. Update `astro.config.ts` sidebar configuration if needed
3. Use frontmatter for page metadata
4. Test locally with `bun run dev`

### Code Quality
- **ESLint**: Configured with TypeScript, Astro, and MDX support
- **Prettier**: Code formatting with Tailwind plugin
- **TypeScript**: Strict type checking
- **Link Validation**: Automated internal link checking

### Assets
- **Public Directory**: Static assets accessible at root
- **Logo Assets**: Multiple formats (PNG, SVG) for different use cases
- **Images**: Protocol diagrams, screenshots, QR codes

## External Resources

### API Documentation
- Comprehensive API docs at ethidentitykit.com
- Endpoints for users, lists, stats, leaderboards
- Real-time data via indexer

### Related Repositories
- `app` - Main EFP web application
- `api` - Public API service
- `contracts` - Smart contract implementations
- `indexer` - Data indexing service
- `services` - Backend services
- `follow-bot` - Telegram bot

### Community
- **Discord**: https://discord.efp.app
- **Twitter**: https://x.com/efp
- **Forum**: https://forum.ethfollow.xyz/

## Deployment Information

### Production Contracts
- **Base**: Full deployment with all contracts
- **OP Mainnet**: List Records only
- **Ethereum**: List Records only

### Development Environment
- **Base Sepolia**: Full testnet deployment
- **OP Sepolia**: List Records testnet
- **Ethereum Sepolia**: List Records testnet

## Security Considerations
- Bug bounty program active
- Emergency response procedures documented
- Multisig wallet governance
- Open-source codebase for transparency

## Contributing
- Simple contribution guidelines: "good vibes only"
- Open to community contributions
- Translation bounty program available
- GitHub-based workflow with PR previews

This documentation serves as the canonical technical reference for the Ethereum Follow Protocol, providing comprehensive coverage of the protocol's design, implementation, and operational aspects.
4 changes: 4 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ export default defineConfig({
label: 'List Records',
link: '/design/list-records'
},
{
label: 'List Records Namespace',
link: '/design/list-record-namespace'
},
{
label: 'Tags',
link: '/design/tags'
Expand Down
Loading
Loading