Skip to content

Commit 410a2d1

Browse files
authored
Merge pull request #55 from ethereumfollowprotocol/automation
automation
2 parents ba7342b + baf2f5c commit 410a2d1

File tree

5 files changed

+460
-0
lines changed

5 files changed

+460
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: AI On-Demand Assistant
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_review_comment:
6+
types: [created]
7+
pull_request_review:
8+
types: [submitted]
9+
issues:
10+
types: [opened]
11+
12+
jobs:
13+
ai-response:
14+
# Only run if the app is mentioned and it's not the app itself commenting
15+
if: |
16+
(
17+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@efp-dev-ops')) ||
18+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@efp-dev-ops')) ||
19+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@efp-dev-ops')) ||
20+
(github.event_name == 'issues' && contains(github.event.issue.body, '@efp-dev-ops'))
21+
) && contains(fromJSON(vars.ALLOWED_USER_LIST), github.actor)
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
issues: write
26+
pull-requests: write
27+
28+
steps:
29+
- name: Checkout Code
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Generate Custom App Token
35+
id: generate-token
36+
uses: actions/create-github-app-token@v1
37+
with:
38+
app-id: ${{ secrets.APP_ID }}
39+
private-key: ${{ secrets.PRIVATE_KEY }}
40+
41+
- name: Extract Instruction from Comment
42+
id: extract-instruction
43+
env:
44+
ISSUE_COMMENT_BODY: ${{ github.event.comment.body }}
45+
PR_REVIEW_COMMENT_BODY: ${{ github.event.comment.body }}
46+
PR_REVIEW_BODY: ${{ github.event.review.body }}
47+
ISSUE_BODY: ${{ github.event.issue.body }}
48+
run: |
49+
# Get the comment body based on event type
50+
if [ "${{ github.event_name }}" = "issue_comment" ]; then
51+
COMMENT_BODY="$ISSUE_COMMENT_BODY"
52+
elif [ "${{ github.event_name }}" = "pull_request_review_comment" ]; then
53+
COMMENT_BODY="$PR_REVIEW_COMMENT_BODY"
54+
elif [ "${{ github.event_name }}" = "pull_request_review" ]; then
55+
COMMENT_BODY="$PR_REVIEW_BODY"
56+
elif [ "${{ github.event_name }}" = "issues" ]; then
57+
COMMENT_BODY="$ISSUE_BODY"
58+
else
59+
COMMENT_BODY=""
60+
fi
61+
62+
# Remove the @mention and get the instruction
63+
INSTRUCTION=$(echo "$COMMENT_BODY" | sed 's/@efp-dev-ops[[:space:]]*//' | sed 's/^[[:space:]]*//')
64+
65+
# Add input validation
66+
if [ ${#INSTRUCTION} -gt 4000 ]; then
67+
echo "Instruction too long, truncating..."
68+
INSTRUCTION=$(echo "$INSTRUCTION" | head -c 4000)
69+
fi
70+
71+
# Set as output for next step
72+
echo "instruction<<EOF" >> $GITHUB_OUTPUT
73+
echo "$INSTRUCTION" >> $GITHUB_OUTPUT
74+
echo "EOF" >> $GITHUB_OUTPUT
75+
76+
echo "Extracted instruction: $INSTRUCTION"
77+
78+
- name: AI Response
79+
uses: 0xthrpw/claude-code-action@v0.0.1
80+
continue-on-error: true
81+
timeout-minutes: 10
82+
with:
83+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
84+
github_token: ${{ steps.generate-token.outputs.token }}
85+
direct_prompt: |
86+
You are an AI assistant for our development team. A team member has requested help with the following:
87+
88+
**User Request:** ${{ steps.extract-instruction.outputs.instruction }}
89+
90+
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.
91+
92+
Keep your response concise but thorough, and format it nicely for GitHub comments.

.github/workflows/ai-review.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Custom AI Code Review
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
# issue_comment:
6+
# types: [created]
7+
8+
jobs:
9+
ai-review:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
issues: write
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Get full history for better context
21+
22+
- name: Generate Custom App Token
23+
id: generate-token
24+
uses: actions/create-github-app-token@v1
25+
with:
26+
app-id: ${{ secrets.APP_ID }}
27+
private-key: ${{ secrets.PRIVATE_KEY }}
28+
29+
- name: AI Code Quality Review
30+
uses: anthropics/claude-code-action@v0
31+
continue-on-error: true
32+
timeout-minutes: 10
33+
with:
34+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
35+
github_token: ${{ steps.generate-token.outputs.token }}
36+
direct_prompt: |
37+
You are the AI code quality reviewer for our organization.
38+
39+
Please analyze this pull request for:
40+
41+
## 🔍 Code Quality Assessment
42+
- Overall code quality rating (1-10)
43+
- Code maintainability and readability
44+
- Adherence to best practices
45+
- Performance considerations
46+
47+
## 📚 Documentation Review
48+
- Comment quality and completeness
49+
- Function/method documentation
50+
- README updates if needed
51+
52+
## 🎯 Specific Recommendations
53+
- Actionable improvements with priorities
54+
- Code refactoring suggestions
55+
- Testing recommendations
56+
57+
Format your response as a professional code review.
58+
59+
- name: Post Summary Comment
60+
continue-on-error: true
61+
run: |
62+
gh pr comment ${{ github.event.number }} --body "
63+
## 🤖 AI Code Review Complete
64+
65+
Your custom AI assistant has completed the automated code review process.
66+
67+
✅ Security analysis finished
68+
✅ Code quality assessment complete
69+
✅ Documentation review done
70+
71+
Please review the detailed feedback above and address any high-priority items before merging.
72+
73+
---
74+
*This automated review was performed by EFP-DEV-OPS*
75+
"
76+
env:
77+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

CLAUDE.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# CLAUDE.md - Ethereum Follow Protocol Documentation
2+
3+
## Overview
4+
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.
5+
6+
## Tech Stack
7+
- **Framework**: Astro (v4.2.4) with Starlight documentation theme
8+
- **Language**: TypeScript
9+
- **Styling**: Tailwind CSS with custom styles
10+
- **Package Manager**: Bun (v1.0.25)
11+
- **Build Tool**: Astro build system
12+
- **Deployment**: Static site generation
13+
14+
## Key Scripts
15+
- `bun run dev` - Start development server
16+
- `bun run build` - Build production site
17+
- `bun run preview` - Preview built site
18+
- `bun run lint` - Run ESLint with auto-fix
19+
- `bun run format` - Format code with Prettier
20+
- `bun run typecheck` - Run TypeScript type checking
21+
- `bun run clean` - Clean build artifacts and dependencies
22+
23+
## Repository Structure
24+
25+
### Core Configuration
26+
- `astro.config.ts` - Main Astro configuration with Starlight setup
27+
- `package.json` - Dependencies and scripts
28+
- `tsconfig.json` - TypeScript configuration
29+
- `tailwind.config.ts` - Tailwind CSS configuration
30+
31+
### Content Structure
32+
- `src/content/docs/` - All documentation MDX files
33+
- `src/content/config.ts` - Content collection configuration
34+
- `public/` - Static assets (images, logos, etc.)
35+
36+
### Documentation Sections
37+
38+
#### Introduction (`src/content/docs/intro/`)
39+
- Core protocol concepts
40+
- EFP List NFT system
41+
- Roles (Owner, Manager, User)
42+
- Tags and social graph mechanics
43+
44+
#### Specification (`src/content/docs/design/`)
45+
- `list-registry.mdx` - ERC-721 List Registry contract
46+
- `roles.mdx` - Role definitions and permissions
47+
- `account-metadata.mdx` - Account metadata system
48+
- `list-metadata.mdx` - List metadata structure
49+
- `list-storage-location.mdx` - Storage location specifications
50+
- `list-records.mdx` - List record structure
51+
- `tags.mdx` - Tagging system (block, mute, top8, custom)
52+
- `list-ops.mdx` - List operations structure
53+
- `glossary.mdx` - Protocol terminology
54+
55+
#### Production (`src/content/docs/production/`)
56+
- `deployments.mdx` - Smart contract addresses (Base, OP Mainnet, Ethereum)
57+
- `interpreting-state.mdx` - Data interpretation guide
58+
- `multisig.mdx` - Multisig wallet information
59+
- `infra.mdx` - Infrastructure overview
60+
- `silo.mdx` - Railway deployment template
61+
- `follow-bot.mdx` - Telegram bot functionality
62+
- `emergency-response.mdx` - Emergency procedures
63+
64+
#### Additional Content
65+
- `faq.mdx` - Frequently asked questions
66+
- `bugbounty.mdx` - Bug bounty program
67+
- `translationbounty.mdx` - Translation bounty program
68+
- `llmstxt.mdx` - LLM-friendly protocol documentation
69+
- `playground/` - Interactive examples
70+
71+
### Design Components
72+
- `design-components/colors.mdx` - Color specifications
73+
- `design-components/logos.mdx` - Logo assets and usage
74+
75+
## Key Features
76+
77+
### Protocol Concepts
78+
- **EFP List NFT**: Free-to-mint NFTs representing social lists
79+
- **Three-Role System**: Owner, Manager, User with distinct permissions
80+
- **Multi-Chain Support**: Base, OP Mainnet, Ethereum deployments
81+
- **Tag System**: Standard tags (block, mute, top8) + custom tags
82+
- **Primary List**: Account's designated main social graph
83+
84+
### Technical Infrastructure
85+
- **Smart Contracts**: ERC-721 registry, list records, account metadata
86+
- **API**: Comprehensive REST API via ethidentitykit.com
87+
- **Indexer**: Open-source indexing system
88+
- **Multi-Chain**: L1 and L2 deployments
89+
90+
### Content Management
91+
- **MDX Support**: Rich documentation with embedded components
92+
- **Version Control**: Git-based documentation workflow
93+
- **Starlight**: Advanced documentation features (search, navigation, theming)
94+
95+
## Development Workflow
96+
97+
### Adding Documentation
98+
1. Create MDX files in appropriate `src/content/docs/` subdirectory
99+
2. Update `astro.config.ts` sidebar configuration if needed
100+
3. Use frontmatter for page metadata
101+
4. Test locally with `bun run dev`
102+
103+
### Code Quality
104+
- **ESLint**: Configured with TypeScript, Astro, and MDX support
105+
- **Prettier**: Code formatting with Tailwind plugin
106+
- **TypeScript**: Strict type checking
107+
- **Link Validation**: Automated internal link checking
108+
109+
### Assets
110+
- **Public Directory**: Static assets accessible at root
111+
- **Logo Assets**: Multiple formats (PNG, SVG) for different use cases
112+
- **Images**: Protocol diagrams, screenshots, QR codes
113+
114+
## External Resources
115+
116+
### API Documentation
117+
- Comprehensive API docs at ethidentitykit.com
118+
- Endpoints for users, lists, stats, leaderboards
119+
- Real-time data via indexer
120+
121+
### Related Repositories
122+
- `app` - Main EFP web application
123+
- `api` - Public API service
124+
- `contracts` - Smart contract implementations
125+
- `indexer` - Data indexing service
126+
- `services` - Backend services
127+
- `follow-bot` - Telegram bot
128+
129+
### Community
130+
- **Discord**: https://discord.efp.app
131+
- **Twitter**: https://x.com/efp
132+
- **Forum**: https://forum.ethfollow.xyz/
133+
134+
## Deployment Information
135+
136+
### Production Contracts
137+
- **Base**: Full deployment with all contracts
138+
- **OP Mainnet**: List Records only
139+
- **Ethereum**: List Records only
140+
141+
### Development Environment
142+
- **Base Sepolia**: Full testnet deployment
143+
- **OP Sepolia**: List Records testnet
144+
- **Ethereum Sepolia**: List Records testnet
145+
146+
## Security Considerations
147+
- Bug bounty program active
148+
- Emergency response procedures documented
149+
- Multisig wallet governance
150+
- Open-source codebase for transparency
151+
152+
## Contributing
153+
- Simple contribution guidelines: "good vibes only"
154+
- Open to community contributions
155+
- Translation bounty program available
156+
- GitHub-based workflow with PR previews
157+
158+
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.

astro.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ export default defineConfig({
9090
label: 'List Records',
9191
link: '/design/list-records'
9292
},
93+
{
94+
label: 'List Records Namespace',
95+
link: '/design/list-record-namespace'
96+
},
9397
{
9498
label: 'Tags',
9599
link: '/design/tags'

0 commit comments

Comments
 (0)