Skip to content

feat(next-task): add GitHub Projects as task source (#247)#248

Merged
avifenesh merged 13 commits intomainfrom
feature/github-projects-task-source-247
Feb 20, 2026
Merged

feat(next-task): add GitHub Projects as task source (#247)#248
avifenesh merged 13 commits intomainfrom
feature/github-projects-task-source-247

Conversation

@avifenesh
Copy link
Copy Markdown
Collaborator

Summary

  • Adds gh-projects as a 6th task source option alongside GitHub Issues, GitLab, Local, Custom, and Other
  • Agent selects "GitHub Projects" in Phase 1, provides project number + owner as follow-up
  • Task-discoverer fetches items via gh project item-list, filters to ISSUE-type only
  • Full input validation: projectNumber (positive integer, rejects scientific notation), owner (^(@me|[a-zA-Z0-9][a-zA-Z0-9_-]*)$)
  • Shell args quoted to prevent injection; error guidance for missing project scope
  • All adapter files updated (OpenCode, Codex); lib vendored to all 13 plugins

Changes

  • lib/sources/policy-questions.js — new source + needsProjectFollowUp() + getProjectQuestions()
  • lib/index.js — exports new functions
  • plugins/next-task/skills/discover-tasks/SKILL.md — gh-projects fetch path, label normalization, policy object extraction
  • plugins/next-task/agents/task-discoverer.md — source types table updated
  • plugins/next-task/commands/next-task.md — Phase 1 follow-up sequence documented
  • Adapter files: OpenCode + Codex updated
  • Tests: 44 new test cases, all 4097 passing

Test Plan

  • Run npm test — 4097 tests pass
  • Run /next-task, select "GitHub Projects" — follow-up questions appear for project number and owner
  • Provide valid project number + @me — policy shape { source: 'gh-projects', projectNumber: N, owner: '@me' } stored
  • Provide 1e5 as project number — throws "Invalid project number"
  • Provide @@evil as owner — throws "Invalid project owner"
  • Clear source cache, select "GitHub Projects (last used)" — throws with descriptive message

Related Issues

Closes #247

…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.
Copilot AI review requested due to automatic review settings February 20, 2026 21:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-projects source 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.

@avifenesh avifenesh merged commit d4f7e48 into main Feb 20, 2026
8 checks passed
@avifenesh avifenesh deleted the feature/github-projects-task-source-247 branch February 20, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(next-task): add GitHub Projects as task source in task-discoverer

2 participants