create_goal
Define software development objectives for project management, specifying goals and repository names to structure task workflows.
Instructions
Create a new goal
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | The software development goal description (string) | |
| repoName | No | Please give the name of the project that you are currently working on (string) |
Implementation Reference
- src/index.ts:199-213 (handler)The handler for the 'create_goal' tool call. It extracts the description and repoName from arguments, creates the goal using storage, sets the current goal, creates an initial plan, and returns the goal ID in the response.case 'create_goal': { const { description, repoName } = request.params.arguments as { description: string; repoName: string }; const goal = await storage.createGoal(description, repoName); this.currentGoal = goal; await storage.createPlan(goal.id); return { content: [ { type: 'text', text: JSON.stringify({ goalId: goal.id }), }, ], }; }
- src/index.ts:40-57 (registration)Registration of the 'create_goal' tool in the ListTools response, including its name, description, and input schema definition.{ name: 'create_goal', description: 'Create a new goal', inputSchema: { type: 'object', properties: { description: { type: 'string', description: 'The software development goal description (string)', }, repoName: { type: 'string', description: 'Please give the name of the project that you are currently working on (string)', }, }, required: ['description'], }, },
- src/index.ts:43-56 (schema)JSON schema defining the input parameters for the 'create_goal' tool: description (required string) and optional repoName (string).inputSchema: { type: 'object', properties: { description: { type: 'string', description: 'The software development goal description (string)', }, repoName: { type: 'string', description: 'Please give the name of the project that you are currently working on (string)', }, }, required: ['description'], },
- src/storage.ts:101-125 (helper)Helper function in storage that implements the core logic for creating a new Goal: generates ID, persists to LokiDB goals collection, initializes task ID metadata for the goal, saves the DB, and returns the goal object.async createGoal(description: string, repoName: string): Promise<Goal> { const goal: Goal = { id: this.goals.count() + 1, repoName, description, createdAt: new Date().toISOString(), }; this.goals.insert(goal as LokiGoal); // Initialize nextTaskId for the new goal const metadataCollection = this.db.getCollection('metadata'); const metadata = metadataCollection.findOne({}); if (metadata) { if (!metadata.nextTaskId) { metadata.nextTaskId = {}; } metadata.nextTaskId[goal.id] = { root: 0 }; // Initialize root counter for the new goal metadataCollection.update(metadata); } await this.save(); const { $loki, meta, ...goalResponse } = goal as LokiGoal; return goalResponse; }