This project uses a local dual-graph MCP server for efficient context retrieval.
-
Call
graph_continuefirst — before any file exploration, grep, or code reading. -
If
graph_continuereturnsneeds_project=true: callgraph_scanwith the current project directory (pwd). Do NOT ask the user. -
If
graph_continuereturnsskip=true: project has fewer than 5 files. Do NOT do broad or recursive exploration. Read only specific files if their names are mentioned, or ask the user what to work on. -
Read
recommended_filesusinggraph_read— one call per file.graph_readaccepts a singlefileparameter (string). Call it separately for each recommended file. Do NOT pass an array or batch multiple files into one call.recommended_filesmay containfile::symbolentries (e.g.src/auth.ts::handleLogin). Pass them verbatim tograph_read(file: "src/auth.ts::handleLogin")— it reads only that symbol's lines, not the full file.- Example: if
recommended_filesis["src/auth.ts::handleLogin", "src/db.ts"], callgraph_read(file: "src/auth.ts::handleLogin")andgraph_read(file: "src/db.ts")as two separate calls (they can be parallel).
-
Check
confidenceand obey the caps strictly:confidence=high-> Stop. Do NOT grep or explore further.confidence=medium-> If recommended files are insufficient, callfallback_rgat mostmax_supplementary_grepstime(s) with specific terms, thengraph_readat mostmax_supplementary_filesadditional file(s). Then stop.confidence=low-> Callfallback_rgat mostmax_supplementary_grepstime(s), thengraph_readat mostmax_supplementary_filesfile(s). Then stop.
A token-counter MCP is available for tracking live token usage.
- To check how many tokens a large file or text will cost before reading it:
count_tokens({text: "<content>"}) - To log actual usage after a task completes (if the user asks):
log_usage({input_tokens: <est>, output_tokens: <est>, description: "<task>"}) - To show the user their running session cost:
get_session_stats()
Live dashboard URL is printed at startup next to "Token usage".
- Do NOT use
rg,grep, or bash file exploration before callinggraph_continue. - Do NOT do broad/recursive exploration at any confidence level.
max_supplementary_grepsandmax_supplementary_filesare hard caps - never exceed them.- Do NOT dump full chat history.
- Do NOT call
graph_retrievemore than once per turn. - After edits, call
graph_register_editwith the changed files. Usefile::symbolnotation (e.g.src/auth.ts::handleLogin) when the edit targets a specific function, class, or hook.
Whenever you make a decision, identify a task, note a next step, fact, or blocker during a conversation, append it to .dual-graph/context-store.json.
Entry format:
{"type": "decision|task|next|fact|blocker", "content": "one sentence max 15 words", "tags": ["topic"], "files": ["relevant/file.ts"], "date": "YYYY-MM-DD"}To append: Read the file → add the new entry to the array → Write it back → call graph_register_edit on .dual-graph/context-store.json.
Rules:
- Only log things worth remembering across sessions (not every minor detail)
contentmust be under 15 wordsfileslists the files this decision/task relates to (can be empty)- Log immediately when the item arises — not at session end
When the user signals they are done (e.g. "bye", "done", "wrap up", "end session"), proactively update CONTEXT.md in the project root with:
- Current Task: one sentence on what was being worked on
- Key Decisions: bullet list, max 3 items
- Next Steps: bullet list, max 3 items
Keep CONTEXT.md under 20 lines total. Do NOT summarize the full conversation — only what's needed to resume next session.
TypeScript · React Native · Expo (managed, prebuild) · Zustand · React Query · React Hook Form · react-i18next · react-native-mmkv · Axios · @rnmapbox/maps · gluestack-ui · lucide-react-native
- Write concise, type-safe TypeScript. Avoid
any; use precise types and interfaces for props/state. - Use functional components and hooks; never class components. Use
React.FCfor typed components. - Enable strict mode in
tsconfig.json. - Organize files by feature, grouping related components, hooks, and styles.
- All components must be mobile-friendly and responsive, supporting both iOS and Android.
- This is an Expo managed project using prebuild — do not make native code changes outside Expo prebuild capabilities.
- Variables and functions:
camelCase(e.g.,isFetchingData,handleUserInput) - Components:
PascalCase(e.g.,UserProfile,ChatScreen) - Files and directories:
lowercase-hyphenated(e.g.,user-profile.tsx,chat-screen/)
- Use
gluestack-uicomponents fromcomponents/uiwhen available. - For anything without a Gluestack component, use
StyleSheet.create()or Styled Components. - Support both dark mode and light mode.
- Follow WCAG accessibility guidelines for mobile.
- Minimize
useEffect,useState, and heavy computation inside render methods. - Use
React.memo()for components with static props. - Optimize
FlatListwithremoveClippedSubviews,maxToRenderPerBatch,windowSize, andgetItemLayoutwhen items have a consistent size. - Avoid anonymous functions in
renderItemor event handlers.
- All user-visible text must be wrapped in
t()fromreact-i18next. - Translation dictionary files live in
src/translations/.
| Purpose | Library |
|---|---|
| Package manager | yarn |
| State management | zustand |
| Data fetching | react-query |
| Forms | react-hook-form |
| i18n | react-i18next |
| Local storage | react-native-mmkv |
| Secure storage | Expo SecureStore |
| HTTP | axios |
| Maps / navigation | @rnmapbox/maps |
| Icons | lucide-react-native (use directly in markup, not via gluestack Icon wrapper) |
Use ternary ? : for conditional rendering — never &&.
- Use Jest. Generate tests for all new components, services, and logic.
- Ensure tests run without errors before considering a task done.
- Follow React Native's threading model for smooth UI performance.
- Use React Navigation for navigation and deep linking.
- Handle errors gracefully and provide user feedback.
- Implement proper offline support.
- Optimize for low-end devices.