From 632b8fb2d25f7172f556bb86e75425d515726232 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 29 Jan 2026 21:23:36 -0600 Subject: [PATCH] fix: address code review feedback - Fix incorrect API endpoint paths (removed /api prefix) - Improve TypeScript strict typing with explicit metadata interfaces - Update SKILL.md with clear trigger phrases and examples - Fix README installation path reference - Add clarification about API URL format (no /api suffix needed) - Export new metadata type interfaces --- packages/skills/gantt/README.md | 10 ++--- packages/skills/gantt/SKILL.md | 56 +++++++++++++-------------- packages/skills/gantt/gantt-api.sh | 2 +- packages/skills/gantt/gantt-client.ts | 18 ++++++--- packages/skills/gantt/index.ts | 2 + 5 files changed, 48 insertions(+), 40 deletions(-) diff --git a/packages/skills/gantt/README.md b/packages/skills/gantt/README.md index 61ec605..7306f0f 100644 --- a/packages/skills/gantt/README.md +++ b/packages/skills/gantt/README.md @@ -14,14 +14,14 @@ Clawdbot skill for querying and analyzing project timelines, task dependencies, 1. **Copy skill to Clawdbot plugins directory:** ```bash - cp -r ~/src/mosaic-skills/gantt ~/.claude/plugins/mosaic-plugin-gantt + cp -r ~/src/mosaic-stack-worktrees/feature-26-gantt-skill/packages/skills/gantt ~/.claude/plugins/mosaic-plugin-gantt ``` 2. **Set up environment variables:** Add to your `.env` or shell profile: ```bash - export MOSAIC_API_URL="http://localhost:3000/api" + export MOSAIC_API_URL="http://localhost:3000" export MOSAIC_WORKSPACE_ID="your-workspace-uuid" export MOSAIC_API_TOKEN="your-api-token" ``` @@ -75,9 +75,9 @@ The `gantt-api.sh` helper script can be used directly: ### Endpoints -- `GET /api/projects` - List projects (paginated) -- `GET /api/projects/:id` - Get project with tasks -- `GET /api/tasks` - List tasks with filters +- `GET /projects` - List projects (paginated) +- `GET /projects/:id` - Get project with tasks +- `GET /tasks` - List tasks with filters - Query params: `projectId`, `status`, `priority`, `assigneeId`, `page`, `limit` ### Authentication diff --git a/packages/skills/gantt/SKILL.md b/packages/skills/gantt/SKILL.md index 0a670dc..3f37d84 100644 --- a/packages/skills/gantt/SKILL.md +++ b/packages/skills/gantt/SKILL.md @@ -17,14 +17,14 @@ The Mosaic Stack provides project management capabilities with support for: ## API Endpoints -**Base URL**: Configured via `MOSAIC_API_URL` environment variable (default: `http://localhost:3000/api`) +**Base URL**: Configured via `MOSAIC_API_URL` environment variable (default: `http://localhost:3000`) ### Projects -- `GET /api/projects` - List all projects with pagination -- `GET /api/projects/:id` - Get project details with tasks +- `GET /projects` - List all projects with pagination +- `GET /projects/:id` - Get project details with tasks ### Tasks -- `GET /api/tasks` - List all tasks with optional filters +- `GET /tasks` - List all tasks with optional filters - Query params: `projectId`, `status`, `priority`, `assigneeId`, `page`, `limit` ## Authentication @@ -33,33 +33,33 @@ Requests require authentication headers: - `X-Workspace-Id`: Workspace UUID (from `MOSAIC_WORKSPACE_ID` env var) - `Authorization`: Bearer token (from `MOSAIC_API_TOKEN` env var) -## Usage Patterns +## Trigger Phrases & Examples -### Query Project Timeline -When the user asks to "show project X timeline" or "what's the status of project Y": -1. List projects to find the matching project (by name or ID) -2. Get full project details including tasks -3. Present timeline information with task dates and status +**Query project timeline:** +- "Show me the timeline for [project name]" +- "What's the status of [project]?" +- "Give me an overview of Project Alpha" -### Check Task Dependencies -When asked "what blocks task X" or "what are the dependencies for task Y": -1. Search tasks to find the target task -2. Check `metadata.dependencies` field (array of task IDs) -3. Fetch blocking tasks and present the dependency chain +**Check task dependencies:** +- "What blocks task [task name]?" +- "What are the dependencies for [task]?" +- "Show me what's blocking [task]" -### Get Project Status Overview -When asked for "project status" or "project overview": -1. Get project with task count -2. Calculate status distribution (completed/in-progress/not-started) -3. Identify tasks approaching or past due dates -4. Present summary statistics +**Project status overview:** +- "Project status for [project]" +- "How is [project] doing?" +- "Summary of [project]" -### Identify Critical Path -When asked to "find critical path" or "identify blockers": -1. Get all project tasks with dependencies -2. Build dependency graph from `metadata.dependencies` -3. Calculate longest path through dependencies -4. Identify tasks with no slack time (critical tasks) +**Identify critical path:** +- "Find the critical path for [project]" +- "What's the critical path?" +- "Show me blockers for [project]" +- "Which tasks can't be delayed in [project]?" + +**Find upcoming deadlines:** +- "What tasks are due soon in [project]?" +- "Show me tasks approaching deadline" +- "What's due this week?" ## Data Models @@ -130,7 +130,7 @@ When presenting information, use supportive, non-judgmental language: ## Implementation Notes 1. **Environment Setup**: Ensure `.env` has required variables: - - `MOSAIC_API_URL` - API base URL + - `MOSAIC_API_URL` - API base URL (e.g., `http://localhost:3000`, no `/api` suffix) - `MOSAIC_WORKSPACE_ID` - Workspace UUID - `MOSAIC_API_TOKEN` - Authentication token diff --git a/packages/skills/gantt/gantt-api.sh b/packages/skills/gantt/gantt-api.sh index b7f0c27..a5b9b3a 100755 --- a/packages/skills/gantt/gantt-api.sh +++ b/packages/skills/gantt/gantt-api.sh @@ -6,7 +6,7 @@ set -euo pipefail # Configuration from environment -API_URL="${MOSAIC_API_URL:-http://localhost:3000/api}" +API_URL="${MOSAIC_API_URL:-http://localhost:3000}" WORKSPACE_ID="${MOSAIC_WORKSPACE_ID:-}" API_TOKEN="${MOSAIC_API_TOKEN:-}" diff --git a/packages/skills/gantt/gantt-client.ts b/packages/skills/gantt/gantt-client.ts index 5ddb14a..d31661f 100644 --- a/packages/skills/gantt/gantt-client.ts +++ b/packages/skills/gantt/gantt-client.ts @@ -28,6 +28,10 @@ export type ProjectStatus = 'PLANNING' | 'ACTIVE' | 'ON_HOLD' | 'COMPLETED' | 'A export type TaskStatus = 'NOT_STARTED' | 'IN_PROGRESS' | 'PAUSED' | 'COMPLETED' | 'ARCHIVED'; export type TaskPriority = 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT'; +export interface ProjectMetadata { + [key: string]: unknown; +} + export interface Project { id: string; workspaceId: string; @@ -37,7 +41,7 @@ export interface Project { startDate: string | null; endDate: string | null; color: string | null; - metadata: Record; + metadata: ProjectMetadata; createdAt: string; updatedAt: string; tasks?: Task[]; @@ -47,6 +51,12 @@ export interface Project { }; } +export interface TaskMetadata { + startDate?: string; + dependencies?: string[]; + [key: string]: unknown; +} + export interface Task { id: string; workspaceId: string; @@ -61,11 +71,7 @@ export interface Task { creatorId: string; parentId: string | null; sortOrder: number; - metadata: { - startDate?: string; - dependencies?: string[]; - [key: string]: unknown; - }; + metadata: TaskMetadata; createdAt: string; updatedAt: string; project?: { diff --git a/packages/skills/gantt/index.ts b/packages/skills/gantt/index.ts index 2b8ac7c..295b2ba 100644 --- a/packages/skills/gantt/index.ts +++ b/packages/skills/gantt/index.ts @@ -7,7 +7,9 @@ export { createGanttClientFromEnv, type GanttClientConfig, type Project, + type ProjectMetadata, type Task, + type TaskMetadata, type ProjectStatus, type TaskStatus, type TaskPriority,