Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
125 changes: 125 additions & 0 deletions .agentos/agents/:researcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Research Agent β€” Usage Notes

---

## Purpose

Investigate bugs and implementation questions, providing evidence-backed recommendations that align with the constitution and tech stack.

---

## Invocation

- Default research depth: pragmatic (2–3 primary sources).
- Request a deeper dive if needed.

---

## Tooling Options

**Primary Steps (Context7 MCP):**
1. `resolve-library-id <library-name>`
2. `get-library-docs <resolved-id> --topic <focus> --tokens 4000`
- *Always* call `resolve-library-id` before `get-library-docs` unless you have an exact Context7 ID.

**Alternative Research Tools:**
- General web search:
- Perplexity or Exa (`exa_web_search`, `exa_web_view_page`) for authoritative docs, RFCs, READMEs.
- Browser/search MCP:
- `chrome_get_web_content` (snapshots)
- `chrome_network_request` (API docs)
- `search_tabs_content` (pivot within existing tabs)
- If no tools are available:
- Rely on local repository context and framework knowledge.
- Cite local files and well-known framework behavior.

---

## Safety

- **Never** print secrets; use placeholders like `{{API_TOKEN}}` or `{{SECRET_NAME}}`.
- Prefer read-only commands; ask for confirmation before performing risky actions.

---

## Role & Goal

You are the Research Agent for Lambda AgentOS.

**Goal:**
Investigate bugs and technical implementation questions using available research tools (Context7 MCP, Perplexity/Exa, browser/search MCP), then synthesize findings into actionable guidance that aligns with the constitution and tech stack.

---

## Operating Principles

- **Constitution:** Honor simplicity, contract-first, typed data flow, spec traceability, and review gates.
- **Evidence-driven:** Prefer authoritative docs; cite sources with versions/anchors; avoid speculation.
- **Safety and privacy:** Never reveal secrets; always use `{{SECRET_NAME}}` placeholders.

---

## Task Workflow

### 1. Classify Scope

- Determine: Bug triage, Implementation design, or Unknown.
- Extract key terms (libraries, APIs, error codes, file paths) and hypotheses.

### 2. Local Context Pass (Read Only)

- Read:
- `AGENTS.md`
- `.agentos/memory/constitution.md`
- `.agentos/standards/tech-stack.md`
- `README.md`
- Any task-linked spec under `.agentos/specs/*` (if provided)
- Identify likely involved repo components (e.g., RR7 routes/loaders/actions, `packages/ui`, `packages/utils`).

### 3. Plan Your Research

- List 3–6 concise bullets: what to confirm, where to look, expected outcomes.
- Select tools based on availability and the question:
- Context7 MCP (if accessible)
- General web search (Perplexity/Exa)
- Browser/search MCP tools
- Otherwise, rely on local repository context and framework knowledge

### 4. Execute Research (Use Available Tools)

- **If a library/framework is in scope:**
- Context7 MCP: `resolve-library-id` β†’ `get-library-docs` (topic focus, tokens β‰ˆ 4000)
- General web search: Perplexity/Exa for official docs, RFCs, release notes, GitHub READMEs
- **If unknown or ambiguous:**
- Use browser/search MCP tools or general web search to locate authoritative docs and references
- Collect 2–5 relevant sources; capture brief quotes/snippets and versions.

### 5. Synthesize and Recommend

- **Summary:** 3–5 sentences on what’s going on and what matters.
- **Findings:** Bullet list with inline citations [#].
- **Tradeoffs:** Options with pros/cons.
- **Recommendation:** Single best path and rationale.
- **Repo Next Steps:** Target files, tests, contracts to add, gate impacts (pre/post-flight).
- **Risks & Mitigations.**

### 6. Output Format

1. Title
2. Classification and Assumptions
3. Research Plan
4. Sources (with links and versions)
5. Findings and Tradeoffs
6. Recommendation
7. Repo Next Steps (checklist)
8. Risks & Open Questions

---

## Guidelines and Constraints

- Always call `resolve-library-id` before `get-library-docs` unless you have an exact Context7 library ID.
- Prefer ≀ 3 primary sources; add secondary links sparingly.
- Mark missing context with `[NEEDS CLARIFICATION: question]`.
- Redact secrets or tokens; use placeholders like `{{API_TOKEN}}`.
- If tools are unavailable, produce a best-effort plan and ask for authorization to proceed.
9 changes: 0 additions & 9 deletions .cursor/rules/versioning-with-npm.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,3 @@ Guidelines:
- Keep it under ~100 chars; list 2–3 highlights separated by semicolons
- Focus on user-visible changes first; include critical fixes
- Avoid noisy implementation detail; link to PR/issue in the PR body

## Coordination With Changesets
- Use this npm CLI flow for quick, low-risk patches.
- For multi-package changes, coordinated releases, or richer changelogs, prefer Changesets (`yarn changeset`) and follow the existing repo workflow.


## Coordination With Changesets
- Use this npm CLI flow for quick, low-risk patches.
- For multi-package changes, coordinated releases, or richer changelogs, prefer Changesets (`yarn changeset`) and follow the existing repo workflow.
7 changes: 5 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- `yarn build`: Build all packages/apps.
- `yarn serve`: Serve built Storybook (`apps/docs`).
- `yarn test`: Run workspace tests (Storybook test-runner in `apps/docs`).
- `yarn format-and-lint` | `:fix`: Check/auto-fix with Biome.
- `yarn lint` | `:fix`: Check/auto-fix with Biome.
- Per workspace (examples):
- `yarn workspace @lambdacurry/forms build`
- `yarn workspace @lambdacurry/forms-docs dev`
Expand All @@ -34,7 +34,7 @@
- Commits: short imperative subject, optional scope, concise body explaining rationale.
- Example: `Fix: remove deprecated dropdown select`.
- PRs: clear description, linked issues, screenshots or Storybook links, notes on testing.
- Required checks: `yarn format-and-lint` passes; build succeeds; tests updated/added.
- Required checks: `yarn lint` passes; build succeeds; tests updated/added.
- Versioning: when changing published package(s), add a Changeset (`yarn changeset`) before merge.

## Security & Configuration
Expand All @@ -50,6 +50,9 @@
- `.cursor/rules/monorepo-organization.mdc`: Imports/exports, package boundaries, Turbo/Vite/TS paths.
- `.cursor/rules/versioning-with-npm.mdc`: npm CLI version bumps (patch-first), CI publishes on merge.

## AI Agent Workflows
- `:researcher` - Investigate bugs/implementation questions and produce evidence-backed recommendations aligned with the constitution and tech stack.

When to review before starting work
- Building/refactoring UI components: react-typescript-patterns + ui-component-patterns.
- Form-aware components or validation: form-component-patterns.
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/examples/middleware-example.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { TextField } from '@lambdacurry/forms/remix-hook-form';
import type { ActionFunctionArgs } from 'react-router';
// Example of using the new middleware feature in remix-hook-form v7.0.0
import { Form } from 'react-router';
import type { ActionFunctionArgs } from 'react-router';
import { RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData } from 'remix-hook-form/middleware';
import * as zod from 'zod';
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/lib/storybook/react-router-stub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { Decorator } from '@storybook/react-vite';
import type { ComponentType } from 'react';
import {
type ActionFunction,
createRoutesStub,
type LinksFunction,
type LoaderFunction,
type MetaFunction,
createRoutesStub,
} from 'react-router';

export interface StubRouteObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import * as React from 'react';
import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, createFormData, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { createFormData, getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/checkbox-custom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { expect, userEvent, within } from '@storybook/test';
import type * as React from 'react';
import type { ActionFunctionArgs } from 'react-router';
import { useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/checkbox-list.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, type within } from '@storybook/test';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Invalid type within import breaks types

within is a value export; importing it as a type is invalid. Either import the value or use a typeof import in the type.

-import { expect, userEvent, type within } from '@storybook/test';
+import { expect, userEvent, within } from '@storybook/test';

And keep the type use as ReturnType<typeof within> (now valid). If you prefer to avoid a value import purely for types:

type StoryContext = {
  canvas: ReturnType<typeof import('@storybook/test').within>;
};
πŸ€– Prompt for AI Agents
In apps/docs/src/remix-hook-form/checkbox-list.stories.tsx around line 6, the
import incorrectly imports "within" as a type which is a runtime value; change
the import to import { expect, userEvent, within } from '@storybook/test'
(remove the "type" qualifier) and update any type usages to use
ReturnType<typeof within> (or, if you must avoid a value import, switch the type
to: canvas: ReturnType<typeof import('@storybook/test').within>).

import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, createFormData, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { createFormData, getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { columnConfigs, columns } from './data-table-stories.components';
import {
DataTable,
DataTableFilter,
type MockIssue,
type OnChangeFn,
type PaginationState,
type SortingState,
getCoreRowModel,
getPaginationRowModel,
getSortedRowModel,
type MockIssue,
mockDatabase,
type OnChangeFn,
type PaginationState,
type SortingState,
useDataTableFilters,
useFilterSync,
useReactTable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
args: {} as any, // Args for DataTableRouterForm if needed, handled by Example component
args: {} satisfies Record<string, unknown>, // Args for DataTableRouterForm if needed, handled by Example component
render: () => <DataTableRouterFormExample />,
parameters: {
docs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { useMemo } from 'react';
import { type LoaderFunctionArgs, useLoaderData, useSearchParams } from 'react-router';
import { columnConfigs, columns } from './data-table-stories.components';
import {
calculateFacetedCounts,
type DataResponse,
DataTable,
DataTableFilter,
type MockIssue,
type OnChangeFn,
type PaginationState,
type SortingState,
calculateFacetedCounts,
dataTableRouterParsers,
filtersArraySchema,
getCoreRowModel,
getPaginationRowModel,
getSortedRowModel,
type MockIssue,
mockDatabase,
type OnChangeFn,
type PaginationState,
type SortingState,
useDataTableFilters,
useFilterSync,
useReactTable,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { ColumnDef } from '@tanstack/react-table';
import {
assigneeOptions,
CalendarIcon,
CheckCircledIcon,
createColumnConfigHelper,
DataTableColumnHeader,
type MockIssue,
PersonIcon,
StarIcon,
TextIcon,
assigneeOptions,
createColumnConfigHelper,
priorityOptions,
StarIcon,
statusOptions,
TextIcon,
} from './data-table-stories.helpers';

// --- Column Configuration ---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,16 @@ export const priorityOptions = [

// --- Shared Imports (for re-export) ---
export { dataTableRouterParsers } from '@lambdacurry/forms/remix-hook-form/data-table-router-parsers';
export { DataTable } from '@lambdacurry/forms/ui/data-table/data-table';
export { DataTableColumnHeader } from '@lambdacurry/forms/ui/data-table/data-table-column-header';
export { DataTableFilter } from '@lambdacurry/forms/ui/data-table-filter/components/data-table-filter';
export { createColumnConfigHelper } from '@lambdacurry/forms/ui/data-table-filter/core/filters';
export { useDataTableFilters } from '@lambdacurry/forms/ui/data-table-filter/hooks/use-data-table-filters';
export { DataTable } from '@lambdacurry/forms/ui/data-table/data-table';
export { DataTableColumnHeader } from '@lambdacurry/forms/ui/data-table/data-table-column-header';
export type { FiltersState } from '@lambdacurry/forms/ui/utils/filters';
export { filtersArraySchema } from '@lambdacurry/forms/ui/utils/filters';
export { useFilterSync } from '@lambdacurry/forms/ui/utils/use-filter-sync';
export { CalendarIcon, CheckCircledIcon, PersonIcon, StarIcon, TextIcon } from '@radix-ui/react-icons';
export type { ColumnDef, PaginationState, SortingState, OnChangeFn } from '@tanstack/react-table';
export type { ColumnDef, OnChangeFn, PaginationState, SortingState } from '@tanstack/react-table';
export { getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
export { useMemo } from 'react';
export { type LoaderFunctionArgs, useLoaderData, useLocation, useNavigate, useSearchParams } from 'react-router';
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/date-picker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, createFormData, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { createFormData, getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/form-error-basic.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
11 changes: 9 additions & 2 deletions apps/docs/src/remix-hook-form/form-error-custom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand All @@ -19,7 +19,14 @@ type FormData = z.infer<typeof formSchema>;
// Custom error message component with icon
const AlertErrorMessage = (props: React.ComponentProps<typeof FormMessage>) => (
<div className="flex items-center p-4 bg-red-50 border-l-4 border-red-400 rounded-md">
<svg className="h-5 w-5 text-red-400 mr-3" viewBox="0 0 20 20" fill="currentColor">
<svg
className="h-5 w-5 text-red-400 mr-3"
viewBox="0 0 20 20"
fill="currentColor"
role="img"
aria-labelledby="alert-icon-title"
>
<title id="alert-icon-title">Error</title>
<path
fillRule="evenodd"
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/form-error-mixed.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/form-error.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FormError, TextField } from '@lambdacurry/forms';
import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
Loading