feat(next-task): add GitHub Projects as task source (#247)#248
Merged
feat(next-task): add GitHub Projects as task source (#247)#248
Conversation
…orts Add 'gh-projects' as a 6th task source option in the policy selection system. Includes SOURCE_LABELS entry, source option in getPolicyQuestions, mapSource mapping, needsProjectFollowUp/getProjectQuestions follow-up functions, and input validation for projectNumber (positive integer) and owner (alphanumeric with @_-). Exports both new functions from lib/index.js sources namespace.
Add GitHub Projects (v2) as a fetch source in the discover-tasks skill: - gh project item-list command with --format json - Filter to ISSUE type only (exclude PULL_REQUEST, DRAFT_ISSUE) - Map content.* fields to standard task shape - Permission error guidance: gh auth refresh -s project - Include gh-projects in PR-exclusion (Phase 2.5) and comment posting (Phase 6)
Update task-discoverer agent docs in both the plugin and OpenCode adapter to include gh-projects as a source type with its method (gh project item-list for v2 boards).
Include GitHub Projects in the Phase 1 policy selection source options list in the next-task command documentation. When selected, follow-up questions for project number and owner are presented.
Update existing test counts (5->6 options, 6->7 with cache) and add comprehensive tests for the new gh-projects source: - parseAndCachePolicy with project details and cache verification - Input validation: invalid project number (negative, zero, non-numeric) - Input validation: invalid owner (shell metacharacters, empty) - needsProjectFollowUp returns true only for 'GitHub Projects' - getProjectQuestions returns 2 free-text questions with hints - Integration tests: full gh-projects flow and cached preference reuse - Unit tests in tests/sources/policy-questions.test.js with mocked deps All 148 tests pass.
…ll safety - CRITICAL: Fix null crash when "(last used)" selected but cache cleared; mapSource returns null, now guarded with explicit throw - CRITICAL: Fix SKILL.md policy.taskSource string comparisons; taskSource is an object, comparisons now use policy.taskSource?.source - CRITICAL: Fix Phase 5 state update to extract source string from object - HIGH: Tighten owner regex from /^[@a-zA-Z0-9_-]+$/ to /^(@me|[a-zA-Z0-9][a-zA-Z0-9_-]*)$/ — rejects leading hyphens/underscores - HIGH: Quote gh CLI args in SKILL.md ($PROJECT_NUMBER, $OWNER) - HIGH: Throw when gh-projects selected without project details instead of silently proceeding with undefined projectNumber/owner - HIGH: Normalize label objects in gh-projects item mapping (extract l.name) - HIGH: Add gh-projects follow-up sequence to next-task.md Phase 1 - MEDIUM: Reject scientific notation / floats in projectNumber at string level before Number() coercion (e.g. "1e5", "1.5") - MEDIUM: Sanitize raw user input in error messages to prevent terminal escape injection (strip non-printable chars, truncate) - MEDIUM: Add explicit projectNumber/owner extraction in SKILL.md before gh project item-list command Tests: 4097 passed, 0 failed (98 suites)
…e list The hardcoded policySection in adapter-transforms.js was missing the "GitHub Projects" option and the follow-up question hint. This caused the generated OpenCode adapter to be stale and lack gh-projects support. Sync lib to all plugins and regenerate adapters.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub Projects (v2 boards) as a sixth task source option in the /next-task workflow, enabling users to discover and prioritize issues directly from GitHub Project boards alongside the existing GitHub Issues, GitLab, Local, Custom, and Other sources.
Changes:
- Added
gh-projectssource with follow-up questions for project number and owner; includes strict input validation (positive integers for project number, GitHub username pattern for owner) and shell injection protection - Updated task-discoverer to fetch items via
gh project item-list, filter to ISSUE type only, and apply the same PR-linked issue exclusion logic used for GitHub Issues - Vendored library updates and adapter file generation for all 11 plugins plus OpenCode and Codex adapters
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/sources/policy-questions.test.js |
44 new test cases covering GitHub Projects source selection, validation (scientific notation, negative, float, shell metacharacters), caching, and follow-up flow |
lib/sources/policy-questions.js |
Core implementation: adds gh-projects to SOURCE_LABELS and sourceMap, implements needsProjectFollowUp() and getProjectQuestions(), validates project number (/^[1-9][0-9]*$/) and owner (/^(@me|[a-zA-Z0-9][a-zA-Z0-9_-]*)$/), handles caching with projectNumber + owner |
lib/index.js |
Exports new needsProjectFollowUp and getProjectQuestions functions |
lib/adapter-transforms.js |
Documents GitHub Projects option and follow-up question flow for adapter transform |
plugins/*/lib/sources/policy-questions.js |
Vendored copies of core lib changes for 11 plugins (sync-docs, ship, repo-map, perf, next-task, learn, enhance, drift-detect, deslop, debate, audit-project) |
plugins/*/lib/index.js |
Vendored exports for 11 plugins |
plugins/*/lib/adapter-transforms.js |
Vendored adapter transform docs for 11 plugins |
plugins/next-task/skills/discover-tasks/SKILL.md |
Documents gh-projects fetch path using gh project item-list, label normalization, ISSUE-type filtering, permission error handling, includes gh-projects in PR-exclusion check and Phase 6 comment posting |
plugins/next-task/commands/next-task.md |
Documents Phase 1 follow-up sequence: check needsProjectFollowUp(), call getProjectQuestions(), merge responses into responses.project |
plugins/next-task/agents/task-discoverer.md |
Updates source types table and description to include gh-projects |
adapters/opencode/skills/discover-tasks/SKILL.md |
OpenCode-transformed version: JavaScript blocks replaced with placeholders, bash commands preserved with quoted variables |
adapters/opencode/commands/next-task.md |
OpenCode command docs with follow-up flow |
adapters/opencode/agents/task-discoverer.md |
OpenCode agent docs with gh-projects source |
adapters/codex/skills/next-task/SKILL.md |
Codex version with gh-projects follow-up flow using request_user_input |
__tests__/sources.test.js |
Integration tests covering full gh-projects workflow, cached preferences, and validation edge cases |
docs/workflows/NEXT-TASK.md |
User-facing docs updated to list GitHub Projects in Task Source options |
docs/reference/AGENTS.md |
Agent reference updated to include GitHub Projects (v2 boards) in task-discoverer description |
README.md |
Main readme updated to include GitHub Projects in policy selection step |
CHANGELOG.md |
Release notes documenting the new feature and linking to issue #247 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gh-projectsas a 6th task source option alongside GitHub Issues, GitLab, Local, Custom, and Othergh project item-list, filters to ISSUE-type only^(@me|[a-zA-Z0-9][a-zA-Z0-9_-]*)$)projectscopeChanges
lib/sources/policy-questions.js— new source +needsProjectFollowUp()+getProjectQuestions()lib/index.js— exports new functionsplugins/next-task/skills/discover-tasks/SKILL.md— gh-projects fetch path, label normalization, policy object extractionplugins/next-task/agents/task-discoverer.md— source types table updatedplugins/next-task/commands/next-task.md— Phase 1 follow-up sequence documentedTest Plan
npm test— 4097 tests pass/next-task, select "GitHub Projects" — follow-up questions appear for project number and owner@me— policy shape{ source: 'gh-projects', projectNumber: N, owner: '@me' }stored1e5as project number — throws "Invalid project number"@@evilas owner — throws "Invalid project owner"Related Issues
Closes #247