feat: expose plan and tasks templates inside plan.get API response
This commit is contained in:
@@ -5697,6 +5697,56 @@ const SPEC_MAPPING: Record<string, string> = {
|
||||
checklist: "01-master-prd.md",
|
||||
};
|
||||
|
||||
const PLAN_TEMPLATE = `# Implementation Plan: [FEATURE]
|
||||
|
||||
**Branch**: \`[###-feature-name]\` | **Date**: [DATE] | **Spec**: [link]
|
||||
|
||||
**Input**: Feature specification from \`/specs/[###-feature-name]/spec.md\`
|
||||
|
||||
## 1. Summary
|
||||
*Briefly describe the primary requirement and technical approach.*
|
||||
|
||||
## 2. Technical Context
|
||||
- **Language/Version**: [e.g., Node.js v20, Python 3.11]
|
||||
- **Primary Dependencies**: [e.g., Next.js, Prisma, TailwindCSS]
|
||||
- **Storage**: [e.g., PostgreSQL, Redis]
|
||||
- **Testing**: [e.g., Jest, Vitest, Playwright]
|
||||
|
||||
## 3. Project Structure Layout
|
||||
\`\`\`text
|
||||
specs/[###-feature]/
|
||||
├── plan.md # This file
|
||||
├── research.md # Phase 0 output
|
||||
├── data-model.md # Phase 1 output
|
||||
└── tasks.md # Phase 2 output
|
||||
\`\`\`
|
||||
|
||||
## 4. Complexity & Constraints
|
||||
- [e.g. Performance goals, scalability, memory limit]
|
||||
`;
|
||||
|
||||
const TASKS_TEMPLATE = `# Tasks Backlog: [FEATURE NAME]
|
||||
|
||||
**Prerequisites**: plan.md (required), spec.md (required)
|
||||
|
||||
## 1. Format Guideline: \`[ID] [P?] [Story] Description\`
|
||||
- **[P]**: Can run in parallel (different files, no dependencies)
|
||||
- **[Story]**: Which user story this task belongs to (e.g., US1, US2)
|
||||
- Include exact file paths in task titles
|
||||
|
||||
## 2. Phase 1: Setup & Foundations (Prerequisites)
|
||||
- [ ] T001 Initialize database schemas and Prisma migrations
|
||||
- [ ] T002 Setup API routes and express middleware structures
|
||||
|
||||
## 3. Phase 2: User Story 1 - Core Implementation (Priority: P1)
|
||||
- [ ] T003 [P] [US1] Create [Model] in src/models/[file].ts
|
||||
- [ ] T004 [US1] Build /api/v1/resource endpoint in src/routes/[file].ts
|
||||
|
||||
## 4. Phase 3: Polish & Verification
|
||||
- [ ] T005 [P] Run linter and formatting checks
|
||||
- [ ] T006 Validate end-to-end user journeys
|
||||
`;
|
||||
|
||||
async function readPrdContent(
|
||||
principal: Principal,
|
||||
projectId: string,
|
||||
@@ -5740,6 +5790,10 @@ async function toolPlanGet(principal: Principal, params: Record<string, any>) {
|
||||
tasks,
|
||||
decisions: [],
|
||||
ideas: [],
|
||||
templates: {
|
||||
plan: PLAN_TEMPLATE,
|
||||
tasks: TASKS_TEMPLATE,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user