Skip to content

feat(tasks): multi-ecosystem task discovery + bootcamp tasks command#102

Merged
Arthur742Ramos merged 2 commits into
mainfrom
arthur742ramos-add-tasks-command
Jul 8, 2026
Merged

feat(tasks): multi-ecosystem task discovery + bootcamp tasks command#102
Arthur742Ramos merged 2 commits into
mainfrom
arthur742ramos-add-tasks-command

Conversation

@Arthur742Ramos

Copy link
Copy Markdown
Owner

Summary

  • What changed? Adds a deterministic, cross-ecosystem task-discovery engine (src/tasks.ts) and a new bootcamp tasks <repo-url> command that answers the chore(deps): bump actions/checkout from 4 to 6 #1 Day-1 onboarding question: "how do I build / test / run this repo?" The engine has pure, tested parsers for package.json (package-manager aware), Makefile, justfile, Taskfile (go-task), docker-compose, pyproject (Poetry / PEP-621), and composer.json, and groups results into categories (Build, Test, Lint, Develop, Run, Release, Other) with a suggested getting-started sequence. ingest.ts now reuses the same engine so generated onboarding kits also pick up non-npm commands.
  • Why was this change needed? Command extraction previously covered only package.json scripts and Makefile targets, and only fed the AI-generated docs. Non-npm repos (Rust/just, Go/Task, Python/Poetry, Compose, PHP/Composer) surfaced zero runnable commands, and there was no standalone, deterministic "what can I run?" command.

Approach notes

  • Extracted the symlink-safe file reader into src/fs-safe.ts so the engine and ingest.ts can share it without a circular import.
  • ingest.ts calls discoverTasks(..., { packageManager: "npm" }) so existing kits keep byte-identical npm run <name> strings (backward compatible); the change is purely additive.
  • The command is deterministic (no AI calls) and supports --json and --category filters.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Test-only change

Testing

  • npm run lint
  • npm run build
  • npm test

All six CI gates verified green:

  • typecheck pass, lint pass (--max-warnings=0)
  • test pass: 1459 passed / 87 files
  • test:coverage pass (branches 77.3% >= 70, lines 88.1% >= 80)
  • build pass, verify:packaging pass

End-to-end smoke test on this repo:

$ node dist/cli.js tasks .
Getting started
  1. npm run build
  2. npm run verify:packaging
  3. npm run dev
...
$ node dist/cli.js tasks . --json    # 17 tasks, keys: repo, category, gettingStarted, tasks
$ node dist/cli.js tasks . --category test   # 7 tasks

Checklist

  • I followed the project's coding patterns and conventions
  • I added or updated tests for behavior changes
  • I updated docs/config where needed
  • I verified no unrelated files were changed

Linked issues

N/A (no linked issue)

Breaking changes

  • No breaking changes
  • Breaking changes included (describe below)

The ingest.ts path is npm-forced to preserve byte-identical command strings, so existing onboarding-kit output is unchanged.

… tasks`

Answer the #1 Day-1 question — "how do I build / test / run this repo?" —
across ecosystems, not just npm.

Previously command extraction covered only package.json scripts and Makefile
targets and only fed the AI-generated docs, so non-npm repos surfaced zero
runnable commands and there was no standalone "what can I run?" command.

- src/fs-safe.ts: extract the symlink-safe readContainedFile reader into a
  shared, dependency-free module (avoids a circular import from the engine).
- src/tasks.ts: discoverTasks() engine with pure, tested parsers for
  package.json (package-manager aware), Makefile, justfile, Taskfile (go-task),
  docker-compose, pyproject (poetry / PEP-621) and composer.json; plus
  categorizeTask, detectPackageManager, toCommands and suggestGettingStarted.
- src/commands/tasks-command.ts: deterministic `bootcamp tasks <repo-url>`
  with --json and --category, a human report grouped by category and a
  getting-started sequence.
- src/ingest.ts: reuse discoverTasks (npm-forced for byte-identical
  `npm run <name>` strings) so generated kits also gain justfile / Taskfile /
  compose / poetry / composer commands.
- Wiring: package.json ./tasks export, src/api.ts re-export, src/cli.ts
  command registration.
- Tests: test/tasks.test.ts, test/tasks-command.test.ts.
- Docs: README task-discovery section + command table row, CHANGELOG entry.

Verified: typecheck, lint, test (1459), test:coverage, build, verify:packaging.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a deterministic, cross-ecosystem task discovery engine and exposes it both as a new bootcamp tasks <repo-url> CLI command and as a reusable API surface, while also reusing the same engine in ingest so onboarding kits can surface runnable commands beyond npm/Makefile.

Changes:

  • Introduces src/tasks.ts for multi-ecosystem task discovery (package.json, Makefile, justfile, Taskfile, docker-compose, pyproject, composer) with categorization + “getting started” suggestions.
  • Adds bootcamp tasks command with human report + --json and --category filtering.
  • Extracts symlink-safe fixed-name file reads into src/fs-safe.ts and updates ingestion/impact to use it.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/tasks.test.ts Unit tests for task parsing, categorization, package-manager detection, aggregation, and getting-started suggestions.
test/tasks-command.test.ts CLI-level tests for bootcamp tasks output modes, filtering, and exit behavior.
test/api.test.ts Extends export allow-list coverage for the new tasks API exports.
src/tasks.ts New deterministic task discovery/parsing engine + helpers and types.
src/ingest.ts Replaces legacy package.json/Makefile command extraction with discoverTasks(...)+toCommands(...) and uses fs-safe reader.
src/impact.ts Switches symlink-safe reader import to src/fs-safe.ts.
src/fs-safe.ts New shared symlink-safe fixed-name file reader (with size cap).
src/commands/tasks-command.ts New bootcamp tasks command implementation (grouped report, JSON mode, category filtering).
src/cli.ts Registers tasks subcommand and wires options/flag handling.
src/api.ts Re-exports task discovery APIs and types for external consumers.
README.md Documents the new bootcamp tasks command and updates feature list/command table.
package.json Adds ./tasks package export subpath for compiled artifacts.
CHANGELOG.md Adds release note entry for the new task discovery feature and exports.

Comment thread src/tasks.ts Outdated
Comment thread src/commands/tasks-command.ts
Move `--category` validation ahead of `withResolvedRepo` so a typo fails
fast without cloning a remote repo first, and drop `command` from the
dedupe key since it is derivable from (source, name), matching the
documented intent.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Arthur742Ramos
Arthur742Ramos merged commit 74c77a7 into main Jul 8, 2026
11 checks passed
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.

2 participants