Skip to content

feat(discover): add discover-tasks skill and pnpm discover script - #12

Merged
c0d3ster merged 4 commits into
mainfrom
worktree-woolly-conjuring-eagle
Aug 5, 2026
Merged

feat(discover): add discover-tasks skill and pnpm discover script#12
c0d3ster merged 4 commits into
mainfrom
worktree-woolly-conjuring-eagle

Conversation

@c0d3ster

@c0d3ster c0d3ster commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a discover-tasks skill that mines a target repo's own memory (from direct work sessions in that repo) for task candidates and proposes additions to its TASKS.md ## Discovered section, behind an approval prompt.
  • Adds discover.sh + pnpm discover <repo> [--scan], mirroring plan.sh's invocation shape.
  • --scan (codebase-scanning phase, via a future task-scout agent) is stubbed: the skill reports task-scout doesn't exist yet and skips that phase gracefully rather than failing the run.

Test plan

  • Run pnpm discover <repo> against a repo with task-shaped entries in its own memory and confirm they're proposed, approved, and land correctly under TASKS.md ## Discovered with the source memory file cleared.
  • Run pnpm discover <repo> --scan and confirm it reports task-scout is missing and still completes the memory phase.
  • Once task-scout is built, re-test --scan end-to-end (tracked in nightlight-session memory as a follow-up).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added task discovery that identifies actionable work from repository memory and optional codebase scanning.
    • Added approval-based task creation in TASKS.md, with duplicate filtering and cleanup of processed memory.
    • Added a command-line workflow for running task discovery against a selected repository.
    • Added three discovered tasks covering usage-limit pause/resume, a project-scoped task-scanning agent, and end-to-end testing.
  • Bug Fixes

    • Normalized repository paths consistently when invoking planning workflows.

Mines a target repo's own memory for task candidates and proposes
additions to its TASKS.md \`## Discovered\` section, gated behind an
approval prompt. Repo-scanning (--scan) is stubbed to dispatch a
not-yet-built task-scout agent; it reports and skips gracefully today.

pnpm discover <repo> [--scan] mirrors plan.sh's invocation shape.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: de6c68af-2b9e-4852-a829-c786b720e9d5

📥 Commits

Reviewing files that changed from the base of the PR and between 77f8fb4 and 9f22c84.

📒 Files selected for processing (5)
  • .claude/skills/discover-tasks/SKILL.md
  • TASKS.md
  • discover.sh
  • package.json
  • plan.sh

📝 Walkthrough

Walkthrough

The PR adds the discover-tasks Claude skill, records three discovered tasks, and exposes the workflow through discover.sh and npm run discover. plan.sh now normalizes repository paths before invoking Claude.

Changes

Task discovery workflow

Layer / File(s) Summary
Define discovery behavior
.claude/skills/discover-tasks/SKILL.md, TASKS.md
The skill defines memory scanning, candidate approval, task writing, memory cleanup, and operation restrictions. TASKS.md adds three discovered tasks.
Wire command entry points
discover.sh, package.json, plan.sh
discover.sh validates and resolves repository paths, supports --scan, and invokes Claude. package.json adds the discover script. plan.sh resolves absolute repository paths.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant discover.sh
  participant Claude
  participant RepositoryMemory
  participant TASKS.md
  Operator->>discover.sh: Run discovery command
  discover.sh->>Claude: Invoke /discover-tasks with repository path
  Claude->>RepositoryMemory: Read candidate task memory
  Claude->>TASKS.md: Append approved tasks
  Claude->>RepositoryMemory: Clear consumed memory
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-woolly-conjuring-eagle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

discover.sh always passed --add-dir <repo>, even when the target was
nightlight itself. /plan-tasks already handles self-targeting cleanly
because nobody routes it through plan.sh with a self-referencing path —
you just run it directly inside nightlight, no --add-dir needed.
discover.sh had no equivalent self-detection, so self-targeting forced
a redundant --add-dir pointing at the CLI's own primary directory,
which is where the '.' vs './' path-resolution flakiness came from.

Detect when REPO resolves to nightlight's own directory and skip
--add-dir entirely in that case. Also fix discover-tasks/SKILL.md's
Phase 1 memory lookup, which assumed the target repo's memory folder
is always distinct from nightlight's — false when self-targeting,
where it's simply this session's own already-loaded memory.
…add-dir

Previous commit skipped --add-dir entirely for self-targeting, based on
an incorrect theory that --add-dir pointing at the CLI's own primary
directory was the source of './ ' vs '.' flakiness. Confirmed that's
wrong: --add-dir referencing the repo you're already in is a harmless
no-op (plan.sh has done this via './ ' for a while with no issue).

The actual fix is simpler: resolve REPO to an absolute path right
after the existing bare-name-vs-directory check, so '.' and './'
become byte-identical before they ever reach --add-dir, instead of
relying on the CLI to treat two relative-path spellings the same way.
Applied to both discover.sh and plan.sh for consistency, since they
share the identical unresolved-relative-path pattern.

Also reworded discover-tasks/SKILL.md's Phase 1 self-target note:
--add-dir is still passed when self-targeting (not omitted), it just
resolves to the same absolute path as the session's own primary
working directory.
@c0d3ster
c0d3ster marked this pull request as ready for review August 5, 2026 03:31
@c0d3ster
c0d3ster merged commit a1c3755 into main Aug 5, 2026
1 check was pending
@c0d3ster
c0d3ster deleted the worktree-woolly-conjuring-eagle branch August 5, 2026 03:32
c0d3ster added a commit that referenced this pull request Aug 8, 2026
- Archive #2 (fresh-subprocess-per-task execution model, PR #24) as
  complete; NEEDS HUMAN cache-read comparison trial ongoing outside
  TASKS.md tracking, see archive note
- Add #12 [stack: solo], bundling four turn/cache-read efficiency
  findings from the c0d3ster cost audit, placed at the top of
  Agent-Ready
- #1 confirmed not implemented, left open and untouched
- nextTaskNumber 12 -> 13, tasksCompleted 0 -> 1

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant