# Project Guidelines## Build & Test- Build: `npm run build`- Test: `npm test`- Lint: `npm run lint`## Code Style- Use TypeScript strict mode- Prefer functional components in React- Write tests for new features
Start minimal—you’ll expand this as you work. See the AGENTS.md guide for more examples.
3
Configure your default model
Set your preferred model in settings:CLI:
droid> /settings# Navigate to Model and select your default
Factory App: Use the model selector dropdown in the chat interface.Recommendation: Start with Claude Opus 4.5 (default) for complex work, switch to Haiku 4.5 or GPT-5.1-Codex for routine tasks.
Checkpoint: You should now have IDE integration, basic project context, and your preferred model configured.
Create ~/.factory/memories.md for personal preferences:
# My Development Preferences## Code Style- I prefer arrow functions over function declarations- I like early returns over nested conditionals- I use 2-space indentation## Testing- I use React Testing Library, not Enzyme- I prefer integration tests over unit tests for components- Mock external APIs, not internal modules## Past Decisions- [2024-01] Chose Zustand over Redux for state management- [2024-02] Using Tailwind CSS for styling
Update this file whenever you find yourself repeating instructions to Droid.
2
Reference memories in AGENTS.md
Add to your AGENTS.md:
## Personal PreferencesRefer to `~/.factory/memories.md` for my coding preferences and past decisions.
3
Create project-specific memories (optional)
For team projects, create .factory/memories.md:
# Project Memories## Architecture Decisions- We use the repository pattern for data access- All API routes go through the /api/v1 prefix- Feature flags are managed via LaunchDarkly## Known Issues- The auth service has a 5-second timeout issue (#123)- Legacy users table uses snake_case columns
Checkpoint: Droid now has access to your preferences and project history without you repeating them.
Want automated memory capture? Set up a hook to automatically save memories when you say “remember this:”. See Memory Management for setup instructions.
# TypeScript Conventions## General- Use `interface` for object types, `type` for unions/intersections- Avoid `any` - use `unknown` with type guards instead- Export types alongside their implementations## React Components- Use functional components with TypeScript FC type- Props interfaces should be named `{ComponentName}Props`- Use `React.ReactNode` for children, not `React.ReactChild`## Imports- Group imports: React, external libs, internal modules, types- Use absolute imports from `@/` prefix- Avoid barrel files (index.ts re-exports) for performance
3
Add testing rules
Create .factory/rules/testing.md:
# Testing Conventions## File Organization- Test files live next to source: `Component.tsx` → `Component.test.tsx`- Integration tests go in `__tests__/integration/`- E2E tests go in `e2e/`## Test Structure- Use descriptive test names: "should [action] when [condition]"- One assertion per test when possible- Use `beforeEach` for common setup, not `beforeAll`## Mocking- Mock at the boundary (API calls, not internal functions)- Use MSW for API mocking in integration tests- Reset mocks in `afterEach`
---name: prompt-refinerdescription: Improve prompts before sending them to get better results. Use when you want to refine a task description.---# Prompt Refiner## InstructionsWhen the user wants to refine a prompt:1. Ask for their draft prompt or task description2. Analyze it for: - Clarity: Is the goal specific and measurable? - Context: Does it include relevant background? - Constraints: Are requirements and limitations stated? - Examples: Would examples help clarify expectations?3. Suggest an improved version with explanations4. Offer to iterate if needed## Good Prompt Patterns- Start with the outcome: "Create a..." not "I want you to..."- Include acceptance criteria: "The result should..."- Specify format: "Return as JSON/markdown/code"- Mention constraints: "Must be compatible with...", "Should not modify..."
2
Add an auto-formatting hook
Run /hooks and add a PostToolUse hook for automatic formatting:
Use Shift+Tab or /spec before starting features that touch multiple files. This prevents expensive false starts.
2
Configure model switching
Set up a spec mode model for planning:
droid> /settings# Set Spec Mode Model to a reasoning-heavy model
Use Opus 4.5 for planning, then Sonnet or Codex for implementation.
3
Run the readiness report
Check your project’s AI-readiness:CLI:
droid> /readiness-report
Factory App: View your readiness score in the Agent Readiness Dashboard.Address high-impact items first—linting, type checking, and fast tests dramatically reduce token waste.