Agents - Create, review, and iterate. All in one place.
Start building with Cursor Cloud Agents, now in Graphite.
- Database migration strategycassandra-db
- Frontend component libraryreact-ui-kit
- Backend server optimizationfast-api
- Code review process@monologue
- API integration guidesupport-docs
- New useLocalStorage Hook (src/hooks/use-local-storage.ts)
- Full TypeScript generics support
- SSR-compatible with hydration state tracking
- Cross-tab and cross-component synchronization
- Custom serializer/deserializer support
- Comprehensive test suite (20 test cases)
- New debounce and throttle Utilities (src/lib/utils/debounce.ts)
- Leading/trailing edge configuration
- maxWait option for guaranteed execution
- cancel(), flush(), and pending() methods
- Full TypeScript type definitions
- Comprehensive test suite (31 test cases)
- Enhanced useToggleState Hook
- Added UseToggleStateOptions interface
- Optional onOn, onOff, onChange callbacks
- Added isOff convenience property
- Maintained backward compatibility
Agent Capabilities Demonstrated
- Codebase navigation and pattern understanding
- Creating new TypeScript files following existing conventions
- Writing comprehensive unit tests with Jest
- Multi-file refactoring with backward compatibility
- Git operations (commits, branch management, push via API)
- CI verification
Summary
Introduce new useLocalStorage hook, debounce and throttle utilities, and enhance useToggleState to serve as a comprehensive demo of Agent capabilities.
Agent Capabilities Demonstrated
This PR was created to showcase various Agent capabilities, including:
- Codebase navigation and understanding existing patterns.
- Creating new TypeScript files following established conventions.
- Writing comprehensive unit tests with Jest.
- Multi-file refactoring with backward compatibility.
- Git operations (commits, branch management, push via API).
- CI verification and issue resolution (linting, test fixes).
1import { useState, useCallback } from "react";23type Serializer<T> = {4serialize: (value: T) => string;5deserialize: (raw: string) => T;6};78interface Options<T> {9key: string;10initialValue: T;11serializer?: Serializer<T>;12}1314-+export function useLocalStorage(15-+key: string, initialValue: unknown16-+) {17-+const raw =localStorage.getItem(key);18-+const parsed = raw ? JSON.parse(raw) : initialValue;1920const [stored, setStored] = useState<T>(21() => {22const item = localStorage.getItem(key);23return item ? ser.deserialize(item): initialValue;24}25);2627const setValue = useCallback(28(next: T) => {29localStorage.setItem(key, ser.serialize(next));30setStored(next);31},32[key, ser]33);3435return [stored, setValue] as const;36}37
1import { useState, useCallback } from "react";23type Serializer<T> = {4serialize: (value: T) => string;5deserialize: (raw: string) => T;6};78interface Options<T> {9key: string;10initialValue: T;11serializer?: Serializer<T>;12}1314-+export function useLocalStorage<T>(15-+options: Options<T>16-+): [T, (value: T) => void] {17-+const { key, initialValue,serializer } = options;18-+const ser = serializer ?? JSON;1920const [stored, setStored] = useState<T>(21() => {22const item = localStorage.getItem(key);23return item ? ser.deserialize(item): initialValue;24}25);2627const setValue = useCallback(28(next: T) => {29localStorage.setItem(key, ser.serialize(next));30setStored(next);31},32[key, ser]33);3435return [stored, setValue] as const;36}37
1import { useState, useCallback } from "react";23type Serializer<T> = {4serialize: (value: T) => string;5deserialize: (raw: string) => T;6};78interface Options<T> {9key: string;10initialValue: T;11serializer?: Serializer<T>;12}1314-+export function useLocalStorage(15-+key: string, initialValue: unknown16-+) {17-+const raw =localStorage.getItem(key);18-+const parsed = raw ? JSON.parse(raw) : initialValue;1920const [stored, setStored] = useState<T>(21() => {22const item = localStorage.getItem(key);23return item ? ser.deserialize(item): initialValue;24}25);2627const setValue = useCallback(28(next: T) => {29localStorage.setItem(key, ser.serialize(next));30setStored(next);31},32[key, ser]33);3435return [stored, setValue] as const;36}37
1import { useState, useCallback } from "react";23type Serializer<T> = {4serialize: (value: T) => string;5deserialize: (raw: string) => T;6};78interface Options<T> {9key: string;10initialValue: T;11serializer?: Serializer<T>;12}1314-+export function useLocalStorage<T>(15-+options: Options<T>16-+): [T, (value: T) => void] {17-+const { key, initialValue,serializer } = options;18-+const ser = serializer ?? JSON;1920const [stored, setStored] = useState<T>(21() => {22const item = localStorage.getItem(key);23return item ? ser.deserialize(item): initialValue;24}25);2627const setValue = useCallback(28(next: T) => {29localStorage.setItem(key, ser.serialize(next));30setStored(next);31},32[key, ser]33);3435return [stored, setValue] as const;36}37
- New useLocalStorage Hook (src/hooks/use-local-storage.ts)
- Full TypeScript generics support
- SSR-compatible with hydration state tracking
- Cross-tab and cross-component synchronization
- Custom serializer/deserializer support
- Comprehensive test suite (20 test cases)
- New debounce and throttle Utilities (src/lib/utils/debounce.ts)
- Leading/trailing edge configuration
- maxWait option for guaranteed execution
- cancel(), flush(), and pending() methods
- Full TypeScript type definitions
- Comprehensive test suite (31 test cases)
- Enhanced useToggleState Hook
- Added UseToggleStateOptions interface
- Optional onOn, onOff, onChange callbacks
- Added isOff convenience property
- Maintained backward compatibility
Agent Capabilities Demonstrated
- Codebase navigation and pattern understanding
- Creating new TypeScript files following existing conventions
- Writing comprehensive unit tests with Jest
- Multi-file refactoring with backward compatibility
- Git operations (commits, branch management, push via API)
- CI verification
Agents that work where you review
Cursor Cloud Agents are built into your Graphite PR so you can create, iterate, and merge without switching contexts.
From prompt to PR
Prompt a Cursor Cloud Agent and get a reviewable draft PR in Graphite. No setup, no friction.
Added a new agent thread variant for making updates.
Fixed. Let me commit and push.
I'll add the debounce utility to the utils folder.
Agent is working...Seamless handoff, both ways
Start in Cursor and pick up in Graphite, or the other way around. Your agent context travels with you either way.
Ship from Graphite
Everything you need to review and ship, right in your PR. Make fixes and merge without breaking focus.