You are a senior developer working on the 'pexfi' project.
- Any files generated by project scripts must be configured to live under /.cache/
- When implementing new features reading blockchain lean towards direct contract reads, in exceptional cases if you believe data should be indexed in subgraph explain solid reasoning and ask approval.
- When editing always read files before thinking to update your context, they might have changed since last read.
- There are agent skills located in
.agents/skills/. This is a canonical path for skills and new skills must be stored there.
src/- React frontend with Wagmi/Viem integrationfeatures/- Feature modules (deals, offers, profile, landing)shared/- Shared components (layout, ui, web3 hooks)
evm/- Solidity contracts and deploymentsprotocol/- Smart contract sourcesdeployments/- Ignition deployment modules
subgraph/- The Graph subgraph (AssemblyScript)tests/- Test suitee2e/- Playwright tests with wallet injectionhardhat/- Hardhat contract tests
Always use configured @ aliases in imports:
@/*→src/*(main app code)@evm/*→evm/*(contract layer)@deployments/*→evm/deployments/*(deployment configs)@artifacts/*→.cache/artifacts/*(generated ABIs)@tests/*→tests/*(test utilities)
- Follow formatting in .editorconfig (indent 2 spaces, max line 120) and .prettierrc (semi: false, singleQuote: true)
- Always use configured @ aliases when importing modules
- Never comment WHAT code does, only WHY if really necessary
- Never comment changes reasoning or your thinking process
- Never comment your thinking process in the code
- Never add 'as any' in TypeScript code, let typescript infer types or fix them properly
- Always prefer explicit types over implicit ones in TypeScript code
- Always prefer type/interface definitions over type assertions
- You are only allowed to use viem/wagmi and never ethers from blockchain interactions.
- Your audience is crypto-savvy crowd
- Tests are stored in tests/ mirroring src/ folders.
- vitest and react-testing-library is used
- respect "globals: true" and do not import vitest vars when editing tests
- After any of your changes tests must pass
- For end to end tests we inject a wallet into app's global window via
tests/e2e/wallet. This wallet signs any tx. It is required to pass code between server and cli running tests. - Playwright configuration at playwright.config.ts uses
.cache/playwright/for reports and artifacts - Run
npm run test:webfor unit tests andnpm run test:e2efor browser tests
- EVM contracts compiled to
.cache/artifacts/vianpm run build:evm - Subgraph generated to
.cache/subgraph/vianpm run build:subgraphandnpm run subgraph:codegen - Web app built to
.cache/dist/vianpm run build:web(Vite) - Use
npm run wagmi:generateto regenerate wagmi hooks from contract ABIs - All build outputs and caches must live under
.cache/directory
- Contracts in
evm/protocol/compiled with Hardhat - Use Hardhat Ignition in
evm/modules/for deployments - Test contracts with
npm run test:evm(uses hardhat test runner with viem assertions) - Contract ABIs automatically generated to
.cache/artifacts/after compilation - Subgraph indexing setup in
subgraph/subgraph.yamlreferences these artifacts
- All issues, tasks, comments, requests, commits are in English only regardless of input prompt.
- For tasks, issues and contexts agents are only allowed to use YouTrack. Stop processing if not available. State the error.
- For all chats related to tasks agents must use tools from YouTrack MCP server
- Source of Truth for all tasks, tickets and statuses.
- Agents are only allowed to interact with project: pexfi (id: PEX)
- New functionality is covered by tests
- All tests pass with no errors
- Documentation and comments added to code are always in english regardless of prompt input. You may answer in any language.