name: idea-machina description: | Expert assistant for developing the IdeaMachina app - an ideas management system with CRUD, tagging, ratings, and "Continue to..." actions that convert ideas into projects, goals, workflows, or prompts.
Use when: (1) Adding features to the idea-machina app (2) Creating new pages or components in apps/idea-machina/ (3) Working with pm_ideas, pm_idea_tags, pm_idea_ratings tables (4) Implementing "Continue to..." workflows (project, goal, workflow, prompt) (5) Extending the ideas data layer or types (6) Questions about idea-machina architecture or patterns
Triggers: "idea-machina", "ideas app", "pm_ideas", "idea management", "continue to project", "idea tags", "idea ratings"
IdeaMachina Development Guide
Expert guidance for extending the IdeaMachina app in the Raamattu Nyt monorepo.
App Location
apps/idea-machina/
├── src/
│ ├── pages/
│ │ ├── Index.tsx # Prompts management (original)
│ │ ├── IdeasPage.tsx # Ideas list with filters
│ │ └── IdeaDetailPage.tsx # Idea detail/edit view
│ ├── components/
│ │ ├── IdeaCard.tsx # Card for list view
│ │ ├── IdeaForm.tsx # Create/edit form
│ │ ├── IdeaFilters.tsx # Status/tag/AI filters
│ │ ├── TagSelector.tsx # Multi-select tags
│ │ ├── RatingStars.tsx # 1-5 star input
│ │ ├── ContinueDialog.tsx # "Continue to..." actions
│ │ └── AIPickupToggle.tsx # AI pickup toggle + priority
│ ├── lib/
│ │ └── ideas.ts # Data layer (CRUD, tags, ratings)
│ ├── types/
│ │ └── ideas.ts # TypeScript interfaces
│ └── App.tsx # Routes
└── package.json
Architecture Principles
- Monorepo patterns: Shared UI from
packages/ui, shared logic topackages/* - DB schema: All tables in
ai_promptschema - Data layer: Supabase client in
lib/ideas.ts, React Query for state - Soft delete: Use
deleted_atcolumn, never hard delete - RLS policies: Owner can CRUD, authenticated can read
Key Patterns
Data Fetching (React Query)
const { data: ideas } = useQuery({
queryKey: ["ideas", filters],
queryFn: () => listIdeas(filters),
});
const mutation = useMutation({
mutationFn: createIdea,
onSuccess: () => queryClient.invalidateQueries({ queryKey: ["ideas"] }),
});
Type Transformations
DB uses label, UI uses name for tags:
function transformTag(dbTag: PmIdeaTag): IdeaTag {
return { ...dbTag, name: dbTag.label };
}
"Continue to..." Actions
Ideas can convert to:
- Project →
pm_projects(sets idea status to 'converted') - Goal →
pm_goals(links to existing project) - Workflow →
workflows(optional project link) - Prompt →
prompts+prompt_versions
References
- Architecture Details - Full component hierarchy and data flow
- DB Schema - Table structures and RLS policies
- PRD location:
/Docs/idea-machina/PRD.md(when created)
Development Workflow
- New feature: Plan with brainstorming skill first
- DB changes: Create migration in
supabase/migrations/ - Types: Update
src/types/ideas.ts - Data layer: Add functions to
src/lib/ideas.ts - Components: Build in
src/components/ - Pages: Add routes in
src/App.tsx - Tests: Use test-writer skill
- Docs: Update
/Docs/idea-machina/
Common Tasks
Add New Field to Ideas
- Migration:
ALTER TABLE ai_prompt.pm_ideas ADD COLUMN ... - Types: Update
PmIdeaandIdeaWithDetails - Form: Add field to
IdeaForm.tsx - Card: Display in
IdeaCard.tsxif needed
Add New "Continue to..." Action
- Types: Add payload interface in
types/ideas.ts - Data: Add function in
lib/ideas.ts - Dialog: Add option and form in
ContinueDialog.tsx - Handlers: Wire up in pages
Add New Filter
- State: Add filter state in
IdeasPage.tsx - UI: Add control in
IdeaFilters.tsx - Query: Pass to
listIdeas()in query key - Data: Handle in
listIdeas()function