agentleFS
u14appu14app/deep-research/AGENTS.md

deep-research

AGENTS.md4.7k starsChanged 19 months agoMITView on GitHub

This document provides essential guidelines and technical references for AI agents (and human developers) working on the Deep Research repository. Adhere to these patterns to ensure consistency, security, and maintainability. The project uses pnpm as the primary package manager.

  • Reads credentials
  • Deletes or force-pushes

Trending

Quiet since June.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the u14app/deep-research repository that our weekly crawl found: only 6 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about u14app/deep-research

The biggest 5 of 6 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 6

Talked about on GitHub (6 times).

On GitHub · 6

1 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

19 rules. About 1 is common, 4 are distinctive, and 14 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 14

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Guideline: If adding tests, use Vitest or Jest following standard Next.js patterns.

    line 23
  2. Very specific:

    Zod: Use Zod for schema validation, especially for AI response parsing and API request bodies.

    line 50
  3. Very specific:

    Client Components: Use "use client"; at the top of files that require browser APIs or React hooks (state, effects).

    line 55
  4. Very specific:

    Dynamic Imports: Use Next.js dynamic() for heavy components or those that rely on browser-only libraries (e.g., MagicDown, Mermaid).

    line 56
  5. Very specific:

    Hooks: Prefer custom hooks for complex logic (e.g., useDeepResearch, useKnowledge).

    line 57
  6. Distinctive:

    Styling: Use Tailwind CSS. Follow mobile-first responsive design patterns.

    line 62
  7. Very specific:

    I18n: All UI strings must use useTranslation from react-i18next.

    line 64
  8. Very specific:

    Radash: Use radash utilities for common operations like pick, isString, isObject, etc.

    line 70
  9. Very specific:

    Path Alias: Always use the @/ prefix for absolute imports from the src directory.

    line 74
  10. Very specific:

    Use the parseError utility from @/utils/error.ts to standardize error messages.

    line 88
  11. Very specific:

    Never commit .env or .env.local files.

    line 102
  12. Common:

    Secrets: Do not hardcode API keys or credentials.

    line 108
  13. Distinctive:

    Sanitization: Use Zod to sanitize and validate all external inputs (web search results, user input).

    line 109
  14. Very specific:

    Destructive Actions: Avoid rm -rf or history rewriting in git unless explicitly requested.

    line 110
  15. Distinctive:

    Read First: Always read the relevant file and its neighbors before proposing edits.

    line 116
  16. Very specific:

    Follow Patterns: If adding a new component, look at src/components/Research/SearchResult.tsx for a reference implementation.

    line 117
  17. Very specific:

    Validate: Run pnpm lint and pnpm build to ensure your changes don't break the build.

    line 119
  18. Distinctive:

    Clarity: Prefer clarity and simplicity over cleverness.

    line 121
  19. Very specific:

    UI Consistency: Ensure all new UI elements support both light and dark modes using Tailwind dark: classes.

    line 122

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

This document provides essential guidelines and technical references for AI agents (and human developers) working on the Deep Research repository. Adhere to these patterns to ensure consistency, security, and maintainability.


🚀 Development Workflow & Commands

The project uses pnpm as the primary package manager.

Core Commands

  • Install Dependencies: pnpm install
  • Development Server: pnpm dev (Runs at http://localhost:3000)
  • Build Project: pnpm build
  • Static Export: pnpm build:export (Generates out/ directory)
  • Standalone Build: pnpm build:standalone
  • Linting: pnpm lint

Testing

  • Status: Currently, there are no automated tests in the codebase.
  • Guideline: If adding tests, use Vitest or Jest following standard Next.js patterns. Place test files next to the code they test (e.g., ComponentName.test.tsx) or in a __tests__ directory.
  • Single Test: To run a single test (if added), use pnpm vitest run path/to/file.test.ts.

📂 Project Structure

  • src/app: Next.js App Router (Pages, API routes, Layouts).
  • src/components: UI components.
    • ui/: Shadcn primitives.
    • Internal/: Custom shared components.
    • Research/, Knowledge/, etc.: Feature-specific components.
  • src/hooks: Custom React hooks for business logic and state interaction.
  • src/libs: External service integrations (e.g., MCP server logic).
  • src/store: Zustand stores for global state and persistence.
  • src/utils: Helper functions and core deep research logic.
  • src/locales: I18n translation files (JSON).

🎨 Code Style & Conventions

1. TypeScript & Types

  • Strict Mode: strict: true is enabled in tsconfig.json. Always provide explicit types for function parameters and return values.
  • Global Types: Core business logic types (e.g., SearchTask, Knowledge, Source) are defined in src/types.d.ts. Check this file before creating new interfaces.
  • Explicit Any: While @typescript-eslint/no-explicit-any is currently off, avoid any unless absolutely necessary for external library compatibility. Prefer unknown or specific interfaces.
  • Zod: Use Zod for schema validation, especially for AI response parsing and API request bodies. See src/app/api/mcp/server.ts for examples.

2. React & Next.js

  • App Router: This project uses the Next.js App Router.
  • Client Components: Use "use client"; at the top of files that require browser APIs or React hooks (state, effects).
  • Dynamic Imports: Use Next.js dynamic() for heavy components or those that rely on browser-only libraries (e.g., MagicDown, Mermaid).
  • Hooks: Prefer custom hooks for complex logic (e.g., useDeepResearch, useKnowledge).

3. Components & UI

  • Shadcn UI: UI primitives are located in @/components/ui. Do not modify them directly; extend them or create wrappers in src/components/Internal.
  • Styling: Use Tailwind CSS. Follow mobile-first responsive design patterns.
  • Icons: Use lucide-react.
  • I18n: All UI strings must use useTranslation from react-i18next. Use t("key.path") for all labels.

4. State Management

  • Zustand: Used for global state and persistence.
  • Persistence: Most stores use the persist middleware (e.g., useTaskStore in src/store/task.ts) to save research data in localStorage.
  • Radash: Use radash utilities for common operations like pick, isString, isObject, etc.

5. Imports

  • Path Alias: Always use the @/ prefix for absolute imports from the src directory.
  • Ordering:
    1. React/Next.js core
    2. Third-party libraries
    3. Components (Internal/UI)
    4. Hooks & Stores
    5. Utils & Types

🛠 Backend & API Patterns

1. Error Handling

  • Use the parseError utility from @/utils/error.ts to standardize error messages.
  • In async functions, use try...catch...finally to manage loading states and error reporting.
  • Standardized API error format: { isError: true, content: [{ type: "text", text: "..." }] }.

2. API Routes

  • SSE API: Located at src/app/api/sse. Handles real-time streaming research reports.
  • MCP Server: Located at src/app/api/mcp. Implements the Model Context Protocol for tool use by other AI agents.
  • Proxying: The project proxies various AI and search providers via next.config.ts rewrites to avoid CORS issues and manage keys.

3. Environment Variables

  • Refer to env.tpl for all available environment variables.
  • Critical variables include GOOGLE_GENERATIVE_AI_API_KEY, TAVILY_API_BASE_URL, and ACCESS_PASSWORD.
  • Never commit .env or .env.local files.

🔒 Security & Safety

  • Secrets: Do not hardcode API keys or credentials.
  • Sanitization: Use Zod to sanitize and validate all external inputs (web search results, user input).
  • Destructive Actions: Avoid rm -rf or history rewriting in git unless explicitly requested.

🤖 Agent Instructions

  • Read First: Always read the relevant file and its neighbors before proposing edits.
  • Follow Patterns: If adding a new component, look at src/components/Research/SearchResult.tsx for a reference implementation.
  • Keep it Focused: Make small, cohesive changes. Avoid unrelated refactors.
  • Validate: Run pnpm lint and pnpm build to ensure your changes don't break the build.
  • Communication: Summarize what changed, where, and why. Call out tradeoffs, assumptions, and known limitations. If validation could not be run, say so explicitly.
  • Clarity: Prefer clarity and simplicity over cleverness. Preserve existing behavior unless the task explicitly requires changes.
  • UI Consistency: Ensure all new UI elements support both light and dark modes using Tailwind dark: classes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.