# AGENTS.md

Instructions for AI coding agents (Claude Code, Codex, Cursor, Copilot and others) working in this repository.

This repo is a project for the **DeFi Hackathon by 4Vision × Team1 Türkiye**, built on Avalanche. Read the hackathon rules at the start of every session: https://hackathon.4visiontalks.com/HACKATHON.md

The jury and an agentic judge tool evaluate the project mainly through `README.md`, `hackathon.json`, the commit history and the onchain deployments. Keeping those accurate is part of the work, not an afterthought.

## Avalanche MCP server

This repo ships MCP configs for the read-only Avalanche MCP server (`https://build.avax.network/api/mcp`): `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor), `.vscode/mcp.json` (VS Code). Use it before guessing:

- `docs_search` / `docs_fetch` for Avalanche docs, academy and integrations
- `cli_lookup_command` for Avalanche CLI / Platform CLI commands (L1 creation, validators)
- `rpc_lookup_method` for RPC methods
- `blockchain_get_contract_info`, `blockchain_get_native_balance` to check deployments
- `github_search_code` / `github_get_file` across ava-labs repos (icm-contracts, subnet-evm, avalanche-cli…)

It is rate-limited to 60 requests per minute. It never executes anything; deploys and transactions are yours, with the human's OK.

## Rules

1. **Keep `README.md` in the template's structure.** Do not remove, rename or renumber its sections. Fill them in as the project takes shape and update them when the code changes.
2. **Write only what is true.** The goal is a real, live product: a deployed frontend that talks to deployed contracts. Avoid mocks; when one is unavoidable, declare it. Never claim a feature works if it is mocked; never invent links, addresses, transaction hashes, metrics or test results. Mocked parts go in README section 13 and `hackathon.json` → `mocked`.
3. **Every deployment, both places.** After each deploy, add the contract to README section 3.1 and to `hackathon.json` → `deployments` with `chainId`, `address` and `deployTx`. Verify the source on the explorer.
4. **Demo transactions.** When the demo flow works on chain, record the transactions in README section 3.2 and `hackathon.json` → `demoTransactions`.
5. **Section 2 (event partner technologies):** whenever code starts to rely on an Avalanche feature (C-Chain specifics, an L1, ICM/ICTT, oracle feeds on Avalanche) or a supporter product (DT Cloud, Boundless), add or update its row: the product, the feature that relies on it and how central it is.
6. **Section 4 (built at the event):** no code from before kickoff and no existing projects; every commit and deployment is after kickoff. List open-source libraries and starter kits there, and keep the "How you used AI" line up to date (`hackathon.json` → `aiTools`). Never rewrite history.
7. **Section 8.1 (security and risks):** every function that moves funds gets a test, including the failure path, and a row in the risk table.
8. **Sections 8, 9 and 11:** keep the Mermaid diagram, the components table, the tech stack table and `.env.example` in sync with the code. New environment variables get a dummy value in `.env.example`.
9. **Never commit secrets:** private keys, seed phrases, API keys, `.env`. Use a fresh Fuji-only deployer key.
10. **Ask the human before:** deploying to mainnet, spending real funds, making the repo public or private, force-pushing, or submitting anything.
11. Before declaring the project ready, run `node scripts/check-submission.mjs` and fix everything it reports.

A filled-in example of the README is in `docs/EXAMPLE_README.md`, and of the manifest in `docs/example.hackathon.json`.
