Repository navigation
Closed
Labels
Description
Epic: Implement the new "Import Tasks" feature.
Part: 1 of 2 (Backend Infrastructure)
Goal
Create the backend infrastructure to accept a raw text blob from the UI, queue a new job type (processTaskImport), and have a worker execute an "analysis/planning" task using Claude.
Context
This new job type will provide Claude with the user's text and read-only access to the repository via a worktree. Unlike other jobs, Claude's goal is not to implement code, but to analyze the request and output a series of gh commands to create the planned GitHub issues.
Implementation Steps
-
src/queue/taskQueue.js- Update the
createWorkerprocessor function to handle the new job name 'processTaskImport'.
// ... } else if (job.name === 'processPullRequestComment') { return processPullRequestCommentJob(job); } else if (job.name === 'processTaskImport') { return processTaskImportJob(job); // Add this } else { // ...
- Update the
-
packages/dashboard/server.js- Add a new
ensureAuthenticatedPOST route:app.post('/api/import-tasks', ensureAuthenticated, async (req, res) => { ... });. - This endpoint should expect
{ taskDescription: string, repository: string }in the request body. - Inside the route, add a new job to the
taskQueue:- Job Name: 'processTaskImport'
- Job Data:
{ taskDescription, repository, correlationId: generateCorrelationId(), user: req.user.username } - Job ID: Generate a unique ID, e.g.,
import-tasks-${repository.replace('/', '-')}-${Date.now()}.
- Respond to the client with
{ jobId: newJob.id }.
- Add a new
-
src/worker.js- Import
generateTaskImportPromptfromsrc/claude/claudeService.js. - Create and export a new async function:
async function processTaskImportJob(job) { ... }. - This function's structure should be very similar to
processGitHubIssueJob(logging, state, auth, etc.). - Key Logic:
- Get job data:
const { taskDescription, repository, correlationId } = job.data;. - Split
repositoryintorepoOwnerandrepoName. - Call
ensureRepoClonedandcreateWorktreeForIssueto set up a repo context. Use a placeholder likeissueId: 'import'andmodelName: 'planner'for unique naming. - Call the new
generateTaskImportPrompt(taskDescription, repoOwner, repoName, worktreeInfo.worktreePath)(to be created in step 4). - Call
executeClaudeCodewith this new prompt. - Log the result from
executeClaudeCode. This job is "fire and forget" - its only goal is to run the planning prompt. Claude will execute theghcommands from within its container. - Ensure
cleanupWorktreeis called in afinallyblock.
- Get job data:
- Import
-
src/claude/claudeService.js- Create and export a new function:
generateTaskImportPrompt(taskDescription, repoOwner, repoName, worktreePath). - This function should return the following prompt string, injecting the appropriate variables:
You are an expert software analyst. Your task is to convert code change requests into detailed GitHub issue specifications for the **${repoOwner}/${repoName}** repo, so a junior developer can implement them. If the issue specification with comments is already defined, publish it directly to Github without modifications, otherwise carefully analyze the request first and then publish the issues. You are working in a git worktree at '${worktreePath}' which contains the full source code for analysis and planning. You MUST publish issues and their respective comments using gh commands: 1. **Create an Issue:** The issue body must contain: * A detailed task description and context. * Clear, step-by-step implementation instructions. 2. **Add a Comment:** After creating the issue and capturing its ID/number, add a separate comment to that issue containing the suggested implementation code (use diffs where possible). 3. **Multi-Issue Tasks:** If the work is significant, break it into multiple issues. When doing so, the issue description must reference the previous issue ID and describe the epic's overall goal and current stage. Prefer a single issue when possible. **YOUR FOCUS: ANALYSIS AND 'gh' COMMANDS ONLY** - You have read-only access to the codebase for planning. - DO NOT implement any code changes. - DO NOT use git commands (add, commit, push). - Your *only* output should be the bash script using 'gh' commands to create the issues. Here is the user's request: --- ${taskDescription} --- - Create and export a new function:
Activity
integry commentedon Sep 23, 2025
Implementation Guidance
The new
processTaskImportJobfunction insrc/worker.jswill be the core of this feature. It should follow the 3-phase pattern (Setup, AI, Cleanup) just likeprocessGitHubIssueJob.generateTaskImportPromptand thenexecuteClaudeCode.cleanupWorktree.The
executeClaudeCodefunction already provides theghbinary andGH_TOKENto the container, so Claude'sghcommands will execute and create the issues. We just need to log thestdoutfromexecuteClaudeCodeto confirm.Files to modify:
src/queue/taskQueue.js(AddprocessTaskImportto worker logic)packages/dashboard/server.js(AddPOST /api/import-tasksendpoint)src/worker.js(AddprocessTaskImportJobfunction)src/claude/claudeService.js(AddgenerateTaskImportPromptfunction)integry commentedon Sep 23, 2025
Besides a raw text blob, it will also accept a repo ID (username/repo)
propr-dev commentedon Sep 23, 2025
🤖 AI processing has started for this issue using claude-opus-4-20250514 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claude-opus-4-20250514ai-fix/86-feat-worker-add-processta-20250923-1141-claude-opus-4-20250514-i2amainissue-86-20250923-1141-claude-opus-4-20250514-i2apropr-dev commentedon Sep 23, 2025
🤖 AI processing has started for this issue using claude-opus-4-20250514 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claude-opus-4-20250514ai-fix/86-feat-worker-add-processta-20250923-1141-claude-opus-4-20250514-00lmainissue-86-20250923-1141-claude-opus-4-20250514-00lfix(ai): Resolve issue #86 - feat(worker): Add 'processTaskImport' jo…
fix(ai): Resolve issue #86 - feat(worker): Add 'processTaskImport' jo…
Merge pull request #89 from integry/ai-fix/86-feat-worker-add-process…
feat(ai): I fixed all three points on `/tasks`. Typecheck and lint pa…
feat(ai): Every row in the task list now has the same two lines. Line…