Phase 03: Project CRUD - 3 plans created - 6 total tasks defined - Covers M2 milestone (full project management) Plan breakdown: - 03-01: Project service + /projects, /project new - 03-02: /project select, /project info - 03-03: /project models, /project delete Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
94 lines
2.9 KiB
Markdown
94 lines
2.9 KiB
Markdown
---
|
|
phase: 03-project-crud
|
|
plan: 02
|
|
type: execute
|
|
---
|
|
|
|
<objective>
|
|
Implement project selection and info display commands.
|
|
|
|
Purpose: Enable users to switch between projects and view project details.
|
|
Output: Working /project select and /project info commands with user state tracking.
|
|
</objective>
|
|
|
|
<execution_context>
|
|
~/.claude/get-shit-done/workflows/execute-phase.md
|
|
~/.claude/get-shit-done/templates/summary.md
|
|
</execution_context>
|
|
|
|
<context>
|
|
@.planning/PROJECT.md
|
|
@.planning/ROADMAP.md
|
|
@.planning/STATE.md
|
|
|
|
# Prior plan context
|
|
@.planning/phases/03-project-crud/03-01-SUMMARY.md
|
|
|
|
# Relevant source files
|
|
@src/moai/core/services/project.py
|
|
@src/moai/bot/handlers/projects.py
|
|
@src/moai/bot/handlers/__init__.py
|
|
|
|
**Established patterns:**
|
|
- user_data dict in context for per-user state (python-telegram-bot pattern)
|
|
- Handler pattern: async def xxx_command(update, context) -> None
|
|
</context>
|
|
|
|
<tasks>
|
|
|
|
<task type="auto">
|
|
<name>Task 1: Add get_project_by_name to service</name>
|
|
<files>src/moai/core/services/project.py</files>
|
|
<action>
|
|
Add function to project service:
|
|
- get_project_by_name(name: str) -> Project | None: Query project by exact name match (case-insensitive using ilike)
|
|
|
|
This allows /project select to work with either ID or name.
|
|
</action>
|
|
<verify>python -c "from moai.core.services.project import get_project_by_name"</verify>
|
|
<done>get_project_by_name function exists and is importable</done>
|
|
</task>
|
|
|
|
<task type="auto">
|
|
<name>Task 2: Implement /project select and /project info handlers</name>
|
|
<files>src/moai/bot/handlers/projects.py</files>
|
|
<action>
|
|
Extend project_command handler to support:
|
|
|
|
/project select <id|name>:
|
|
- Store selected project ID in context.user_data["selected_project_id"]
|
|
- Reply with confirmation: "Selected project: {name}"
|
|
- If not found: "Project not found. Use /projects to list available projects."
|
|
|
|
/project info:
|
|
- Get selected project from user_data
|
|
- If no project selected: "No project selected. Use /project select <name> first."
|
|
- Display: name, ID, models list, created_at, discussion count
|
|
|
|
Helper function get_selected_project(context) -> Project | None to retrieve currently selected project from user_data.
|
|
</action>
|
|
<verify>ruff check src/moai/bot/handlers/projects.py</verify>
|
|
<done>/project select stores selection, /project info displays project details</done>
|
|
</task>
|
|
|
|
</tasks>
|
|
|
|
<verification>
|
|
Before declaring plan complete:
|
|
- [ ] `ruff check src/moai/bot/handlers/projects.py` passes
|
|
- [ ] `python -c "from moai.core.services.project import get_project_by_name"` succeeds
|
|
- [ ] project_command handles select and info subcommands
|
|
</verification>
|
|
|
|
<success_criteria>
|
|
|
|
- All tasks completed
|
|
- All verification checks pass
|
|
- /project select stores selection in user_data
|
|
- /project info shows project details
|
|
- Error messages are user-friendly
|
|
</success_criteria>
|
|
|
|
<output>
|
|
After completion, create `.planning/phases/03-project-crud/03-02-SUMMARY.md`
|
|
</output>
|