Copilot instructions
.github/copilot-instructions.mdCopilot instructions
Quality
89/100
Scores the file, not the repository.Length
932 words
15 headings · 7 code blocksRepository
79k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# Copilot Onboarding Instructions for DeerFlow23Use this file as the default operating guide for this repository. Follow it first, and only search the codebase when this file is incomplete or incorrect.45## 1) Repository Summary67DeerFlow is a full-stack "super agent harness".89- Backend: Python 3.12, LangGraph + FastAPI gateway, sandbox/tool system, memory, MCP integration.10- Frontend: Next.js 16 + React 19 + TypeScript + pnpm.11- Local dev entrypoint: root `Makefile` starts backend + frontend + nginx on `http://localhost:2026`.12- Docker dev entrypoint: `make docker-*` (mode-aware provisioner startup from `config.yaml`).1314Current repo footprint is medium-large (backend service, frontend app, docker stack, skills library, docs).1516## 2) Runtime and Toolchain Requirements1718Validated in this repo on macOS:1920- Node.js `>=22` (validated with Node `23.11.0`)21- pnpm (repo expects lockfile generated by pnpm 10; validated with pnpm `10.26.2` and `10.15.0`)22- Python `>=3.12` (CI uses `3.12`)23- `uv` (validated with `0.7.20`)24- `nginx` (required for `make dev` unified local endpoint)2526Always run from repo root unless a command explicitly says otherwise.2728## 3) Build/Test/Lint/Run - Verified Command Sequences2930These were executed and validated in this repository.3132### A. Bootstrap and install33341. Check prerequisites:3536```bash37make check38```3940Observed: passes when required tools are installed.41422. Install dependencies (recommended order: backend then frontend, as implemented by `make install`):4344```bash45make install46```4748### B. Backend CI-equivalent validation4950Run from `backend/`:5152```bash53make lint54make test55```5657Validated results:5859- `make lint`: pass (`ruff check .`)60- `make test`: pass (`277 passed, 15 warnings in ~76.6s`)6162CI parity:6364- `.github/workflows/backend-unit-tests.yml` runs on pull requests.65- CI executes `uv sync --group dev`, then `make lint`, then `make test` in `backend/`.6667### C. Frontend validation6869Run from `frontend/`.7071Recommended reliable sequence:7273```bash74pnpm lint75pnpm typecheck76BETTER_AUTH_SECRET=local-dev-secret pnpm build77```7879Observed failure modes and workarounds:8081- `pnpm build` fails without `BETTER_AUTH_SECRET` in production-mode env validation.82- Workaround: set `BETTER_AUTH_SECRET` (best) or set `SKIP_ENV_VALIDATION=1`.83- Even with `SKIP_ENV_VALIDATION=1`, Better Auth can still warn/error in logs about default secret; prefer setting a real non-default secret.84- `pnpm check` currently fails (`next lint` invocation is incompatible here and resolves to an invalid directory). Do not rely on `pnpm check`; run `pnpm lint` and `pnpm typecheck` explicitly.8586### D. Run locally (all services)8788From root:8990```bash91make dev92```9394Behavior:9596- Stops existing local services first.97- Starts Gateway (`8001`, with the embedded LangGraph-compatible runtime), Frontend (`3000`), nginx (`2026`). There is no standalone LangGraph service.98- Unified app endpoint: `http://localhost:2026`.99- Logs: `logs/gateway.log`, `logs/frontend.log`, `logs/nginx.log`.100101Stop services:102103```bash104make stop105```106107If tool sessions/timeouts interrupt `make dev`, run `make stop` again to ensure cleanup.108109### E. Config bootstrap110111From root:112113```bash114make config115```116117Important behavior:118119- This intentionally aborts if `config.yaml` (or `config.yml`/`configure.yml`) already exists.120- Use `make config` only for first-time setup in a clean clone.121122## 4) Command Order That Minimizes Failures123124Use this exact order for local code changes:1251261. `make check`1272. `make install` (if frontend fails with proxy errors, rerun frontend install with proxy vars unset)1283. Backend checks: `cd backend && make lint && make test`1294. Frontend checks: `cd frontend && pnpm lint && pnpm typecheck`1305. Frontend build (if UI changes or release-sensitive changes): `BETTER_AUTH_SECRET=... pnpm build`131132Always run backend lint/tests before opening PRs because that is what CI enforces.133134## 5) Project Layout and Architecture (High-Value Paths)135136Root-level orchestration and config:137138- `Makefile` - main local/dev/docker command entrypoints139- `config.example.yaml` - primary app config template140- `config.yaml` - local active config (gitignored)141- `docker/docker-compose-dev.yaml` - Docker dev topology142- `.github/workflows/backend-unit-tests.yml` - PR validation workflow143144Backend core:145146- `backend/packages/harness/deerflow/agents/` - lead agent, middleware chain, memory147- `backend/app/gateway/` - FastAPI gateway API148- `backend/packages/harness/deerflow/sandbox/` - sandbox provider + tool wrappers149- `backend/packages/harness/deerflow/subagents/` - subagent registry/execution150- `backend/packages/harness/deerflow/mcp/` - MCP integration151- `backend/langgraph.json` - graph entrypoint (`deerflow.agents:make_lead_agent`)152- `backend/pyproject.toml` - Python deps and `requires-python`153- `backend/ruff.toml` - lint/format policy154- `backend/tests/` - backend unit and integration-like tests155156Frontend core:157158- `frontend/src/app/` - Next.js routes/pages159- `frontend/src/components/` - UI components160- `frontend/src/core/` - app logic (threads, tools, API, models)161- `frontend/src/env.js` - env schema/validation (critical for build behavior)162- `frontend/package.json` - scripts/deps163- `frontend/eslint.config.js` - lint rules164- `frontend/tsconfig.json` - TS config165166Skills and assets:167168- `skills/public/` - built-in skill packs loaded by agent runtime169170## 6) Pre-Checkin / Validation Expectations171172Before submitting changes, run at minimum:173174- Backend: `cd backend && make lint && make test`175- Frontend (if touched): `cd frontend && pnpm lint && pnpm typecheck`176- Frontend build when changing env/auth/routing/build-sensitive files: `BETTER_AUTH_SECRET=... pnpm build`177178If touching orchestration/config (`Makefile`, `docker/*`, `config*.yaml`), also run `make dev` and verify the four services start.179180## 7) Non-Obvious Dependencies and Gotchas181182- Proxy env vars can silently break frontend network operations (`pnpm install`/registry access).183- `BETTER_AUTH_SECRET` is effectively required for reliable frontend production build validation.184- Next.js may warn about multiple lockfiles and workspace root inference; this is currently a warning, not a build blocker.185- `make config` is non-idempotent by design when config already exists.186- `make dev` includes process cleanup and can emit shutdown logs/noise if interrupted; this is expected.187188## 8) Root Inventory (quick reference)189190Important root entries:191192- `.github/`193- `backend/`194- `frontend/`195- `docker/`196- `skills/`197- `scripts/`198- `docs/`199- `README.md`200- `CONTRIBUTING.md`201- `Makefile`202- `config.example.yaml`203- `extensions_config.example.json`204205## 9) Instruction Priority206207Trust this onboarding guide first.208209Only do broad repo searches (`grep/find/code search`) when:210211- you need file-level implementation details not listed here,212- a command here fails and you need updated replacement behavior,213- or CI/workflow definitions have changed since this file was written.214
Also in bytedance/deer-flow
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bytedance/deer-flowAGENTS.md · 79k | AGENTS.md | testlint-formatstyle | 94/100 | 3 days ago | |
| bytedance/deer-flowbackend/AGENTS.md · 79k | AGENTS.md | testlint-formatstylearch+12 | 84/100 | 2 days ago | |
| bytedance/deer-flowfrontend/AGENTS.md · 79k | AGENTS.md | setuptestlint-formatstyle+4 | 69/100 | 2 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 3 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 3 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 2 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 3 days ago |
