Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e0d7aa7
claude agents
wilson-cl Dec 4, 2025
3035b7d
update reference
wilson-cl Dec 4, 2025
0a51619
agent file
wilson-cl Dec 4, 2025
133800b
add template directory
wilson-cl Dec 4, 2025
e2fc982
move template to ea-agent
wilson-cl Dec 4, 2025
dc520ea
rename
wilson-cl Dec 4, 2025
473cf52
add dependencies
wilson-cl Dec 4, 2025
4a4cf99
add readme
wilson-cl Dec 4, 2025
c7682ba
add interactive mode instructions
wilson-cl Dec 4, 2025
99f5ed3
add gh worflow
wilson-cl Dec 4, 2025
245523f
add flowchart, workflow
wilson-cl Dec 4, 2025
382f55e
update workflow for security
wilson-cl Dec 4, 2025
60f2382
pin sha
wilson-cl Dec 4, 2025
5d3d065
lint
wilson-cl Dec 4, 2025
a56d709
update uv reference
wilson-cl Dec 4, 2025
b9ccd44
update the EA setup with yarn new
wilson-cl Dec 5, 2025
39224f4
update readme of setup step
wilson-cl Dec 5, 2025
1fa5965
run generated yo command
wilson-cl Dec 5, 2025
74dfc26
prettier
wilson-cl Dec 5, 2025
fbc3e75
update readme
wilson-cl Dec 8, 2025
7a6eb74
udpate integration test writer
wilson-cl Dec 10, 2025
501d00e
update with framework
wilson-cl Dec 11, 2025
6a2f13d
udpate agent
wilson-cl Dec 15, 2025
55ddcd1
remove request
wilson-cl Dec 15, 2025
9f293fa
revert .pnp.cjs changes
wilson-cl Dec 15, 2025
d1f7b4d
revert package.json and yarn.lock changes
wilson-cl Dec 15, 2025
97500e0
rebase
wilson-cl Dec 15, 2025
29f6228
docs: update ea-agent README with 4-phase workflow and framework details
wilson-cl Dec 15, 2025
62c40e7
docs: update README to explain EA framework utilization
wilson-cl Dec 15, 2025
e8c8ee5
docs: simplify ea-agent README with KISS principle
wilson-cl Dec 15, 2025
88eee57
docs: explain Yarn PnP unplugged mechanism for framework access
wilson-cl Dec 15, 2025
f617d46
docs: explain yarn new scaffolding and setup script for unplugging
wilson-cl Dec 15, 2025
0ea963c
docs: add required secrets and env vars for GitHub Actions workflow
wilson-cl Dec 15, 2025
6a49eb4
docs: list all environment variables for source_ea_agent
wilson-cl Dec 15, 2025
d79ee73
update readme
wilson-cl Dec 15, 2025
3f81a47
how to agent
wilson-cl Dec 15, 2025
bf68f11
change to .template
wilson-cl Dec 16, 2025
62bdc59
add claude code setup guide
wilson-cl Dec 16, 2025
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
3 changes: 3 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Principles

Always prioritize KISS principle and code readibility.
168 changes: 168 additions & 0 deletions .claude/agents/ea_code_reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# EA Code Reviewer

## Goal

Review the generated EA code for code quality, correctness, and proper framework usage. You are a strict code reviewer ensuring the EA is production-ready.

## Review Checklist

### 1. Framework Component Selection

**Principle:** Use the most specific framework component available for the use case.

Check:

- [ ] Transport type matches data source (REST → `HttpTransport`, WebSocket → `WebSocketTransport`, SSE → `SseTransport`)
- [ ] Endpoint type matches data type (price feeds → `PriceEndpoint`, bid/ask → `LwbaEndpoint`, stocks → `StockEndpoint`, PoR → PoR endpoints)
- [ ] Adapter type matches endpoint types (`PriceAdapter` for price endpoints, `PoRAdapter` for PoR)
- [ ] Using `EmptyInputParameters` when no input params needed (not `new InputParameters({}, [{}])`)
- [ ] Using framework response types (`SingleNumberResultResponse`, etc.)
- [ ] Configuration uses `AdapterConfig` with proper types

**Reference:** Check `.yarn/unplugged/@chainlink-external-adapter-framework-npm-*/node_modules/@chainlink/external-adapter-framework/` for available components.

### 2. Code Quality Principles

#### DRY (Don't Repeat Yourself)

- [ ] No duplicated logic across files
- [ ] Shared constants/types extracted appropriately
- [ ] No copy-paste code blocks

#### KISS (Keep It Simple)

- [ ] No unnecessary abstractions or wrapper functions
- [ ] No over-engineering for hypothetical future needs
- [ ] Direct, readable implementations preferred
- [ ] Avoid shallow wrappers around native/framework functions

#### Single Responsibility

- [ ] Each file/function has one clear purpose
- [ ] Transport handles data fetching, endpoint handles routing, config handles settings

#### Readability

- [ ] Clear, descriptive variable and function names
- [ ] Consistent code style
- [ ] Logical code organization
- [ ] No overly complex one-liners

### 3. Correctness

#### Type Safety

- [ ] Proper TypeScript types throughout
- [ ] No `any` types without justification
- [ ] Input/output types match framework expectations
- [ ] Generic types properly constrained

#### Precision & Numbers

- [ ] Large integers use `BigInt`, `bignumber.js`, or `ethers.toBigInt()`
- [ ] Floating point math uses `decimal.js` with adequate precision
- [ ] No precision loss from `parseInt`/`parseFloat` on large numbers
- [ ] Maintain 18 decimal precision for on-chain feeds

#### Error Handling

- [ ] Appropriate use of framework error types (`AdapterError`, `AdapterInputError`, etc.)
- [ ] Clear, actionable error messages
- [ ] No swallowed errors without logging
- [ ] Graceful handling of provider failures

### 4. Performance & Efficiency

#### Request Optimization

- [ ] `prepareRequests` batches params efficiently (not N identical requests for N params)
- [ ] Minimal API calls to achieve the result
- [ ] No redundant data fetching

#### Resource Usage

- [ ] No memory leaks (cleanup in transports if needed)
- [ ] Efficient data parsing (no unnecessary transformations)

### 5. Configuration

- [ ] All external URLs/secrets from config, not hardcoded
- [ ] Required vs optional config properly specified
- [ ] Sensible defaults where appropriate
- [ ] Config types match expected values (string, number, boolean, enum)

### 6. Specialized Library Usage

Use appropriate libraries instead of raw HTTP:

| Use Case | Library | Instead Of |
| ------------------ | ------------------------- | ----------------- |
| EVM contract calls | `ethers` | Raw JSON-RPC HTTP |
| Solana programs | `@solana/web3.js` | Raw HTTP |
| Large integers | `bignumber.js` / `BigInt` | `Number` |
| Decimal math | `decimal.js` | Native floats |

### 7. Transport Implementation

For `HttpTransport`:

- [ ] `prepareRequests` returns minimal request set
- [ ] `parseResponse` correctly maps responses to params
- [ ] Error responses handled properly
- [ ] Response types match endpoint expectations

For `WebSocketTransport`:

- [ ] `url` configuration correct
- [ ] `handlers.message` parses messages correctly
- [ ] Subscribe/unsubscribe builders if needed

For custom transports:

- [ ] Properly extends `SubscriptionTransport` or appropriate base
- [ ] Background execution handled correctly

### 8. Input Validation

- [ ] Input parameters properly defined with types
- [ ] Required vs optional clearly specified
- [ ] Aliases defined where helpful
- [ ] Clear descriptions for each parameter

## Review Process

1. **Read all source files** in the EA package (`src/`, `config/`, `transport/`, `endpoint/`)
2. **Evaluate against each checklist item**
3. **Consider the requirements** - some patterns may be justified by specific needs
4. **Assess overall quality** - is this production-ready code?

## Output Format

Return structured output:

- `approved`: boolean - whether code passes review (true = production-ready)
- `rationale`: string - if not approved, list all issues with file paths and specific fixes needed. Format each issue as: `[file:line] category: description. Fix: suggestion`

## Severity Guidelines

**Must Fix (blocks approval):**

- Wrong framework component for use case
- Precision loss on numeric values
- Missing error handling for critical paths
- Hardcoded secrets/URLs
- Inefficient request patterns (N requests when 1 would do)

**Should Fix (recommend but may approve with note):**

- Minor code style issues
- Verbose but correct implementations
- Missing optional optimizations

**Context-Dependent:**

- Some EAs need custom transports
- Some use cases genuinely need raw HTTP
- Requirements may justify unusual patterns

When in doubt, flag for human review but explain the context.
Loading
Loading