# Taskforge

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-heedful-ai-taskforge-taskforge`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Heedful-ai](https://agentstack.voostack.com/s/heedful-ai)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Heedful-ai](https://github.com/Heedful-ai)
- **Source:** https://github.com/Heedful-ai/taskforge/tree/main/skills/taskforge
- **Website:** https://heedful.ai

## Install

```sh
agentstack add skill-heedful-ai-taskforge-taskforge
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# taskforge — build a candidate coding task from a real PR

Turn one real GitHub PR into a bounded (~1–2h) **candidate coding take-home** plus a **grading guide**,
packaged as `task-bundle.zip`. The task **presents a problem and asks the candidate to design and solve
it** — it does NOT hand them the solution. Run this collaboratively. **Deterministic bundled scripts do
the fragile and safety-critical work — run them; do not reimplement their logic.** You (the agent)
design the *task* — grounded in `references/task-design.md`, not a fixed formula.

> **What you produce.** A self-contained take-home in `task/`, a grading guide (`EVALUATION.md` +
> `evaluation/reference/`), and app metadata (`context.json`). It's **dual-use**: the user can hand the
> candidate `task/` and grade by hand with `EVALUATION.md`, **or** send the whole bundle to **heedful**
> for automated grading. Your job is just to generate a good task + a clear grading guide. Don't
> editorialize about grading, don't emit a "how to grade" walkthrough, don't generate a grading script
> — producing the bundle is the whole job.

**Output location:** ask the user where to write output, **defaulting to the current directory**. Do
the work in a subdir there (e.g. `./taskforge--pr/`) and leave the final `task-bundle.zip` in
that location. **Never use `/tmp`** — the user should be able to find what you made. Paths below are
relative to the skill root for scripts/refs, and to that working subdir for artifacts (`correct/`,
`task/`, `*.json`, the zip).

**Copy this checklist into your reply and tick each phase. Never pass a STOP gate without the user.**

- [ ] Phase 0 — Preflight
- [ ] Phase 1 — Get a PR + score suitability (STOP: user picks)
- [ ] Phase 2 — Propose problem-first task options & confirm (+ collect hiring metadata)
- [ ] Phase 3 — Carve (STOP: approve the slice)
- [ ] Phase 4 — Validate standalone
- [ ] Phase 4b — Scrub (fail-closed)
- [ ] Phase 5 — Taskify (design the spec; STOP: approve difficulty)
- [ ] Phase 6 — Re-validate (offline)
- [ ] Phase 7 — Brief (STOP: approve — no spoilers)
- [ ] Phase 8 — Package & hand off

If you loop on any phase 3 times with no progress, STOP and propose stopping or narrowing scope.

---

## Phase 0 — Preflight
Run `scripts/preflight.py`. If it exits non-zero, **STOP** and tell the user exactly what to install.
Note the container runtime it found (you'll pass it to validation).

## Phase 1 — Get a PR + score its suitability
The user gives **one thing: a GitHub PR.**
- If they name a PR (link or number), use it. If they ask you to suggest one: list candidates with
  `gh pr list --state merged` / `gh search prs`.
- **Score suitability before proposing.** For each candidate, `gh pr view  --json
  files,additions,deletions > /tmp/pr.json` and run `python3 scripts/score_pr.py /tmp/pr.json --json`.
  **Drop any `hard_refuse` PR** (no carvable source, pure config/rename) with a plain-language
  reason. Apply the rubric in `references/pr-suitability.md` to the survivors.
- **Present 2–4 suitable PRs as proposals**, each with a one-line reason it makes a good task (grounded
  in the suitability signals/rubric, not a hunch). **STOP and let the user pick one.**

**Hard rule: propose, then wait.** Until the user picks a PR, do NOT design a task or ask about the
role. Don't interrogate them about language/stack — infer it. See `references/intake.md`.

## Phase 2 — Propose problem-first task options & confirm (+ hiring metadata)
1. With **read-only** `gh` calls, fetch the PR and its linked issue (`gh pr view  --json
   number,title,body,url`, `gh pr diff `, the issue if referenced). Keep these for `context.json`'s
   `source` block. Note: the PR diff is an **authoring aid** — never shipped in `task/`.
2. **Propose task OPTIONS in plain language — a menu, not one answer.** Ground them in
   `references/task-design.md`. Each option presents a **problem the PR solved** (the pre-solution
   world + what's needed), at the altitude the role needs, and is **time-filling**: typically a build-it
   core + a planted bug or two + an extend/scale part — *the candidate isn't expected to finish all of
   it*. **Never name the solution** (don't say "implement an append-only log"; say "make brief history
   auditable and recoverable"). Cover genuinely different parts of the PR. Give skills + rough
   difficulty. **STOP — let the user pick / combine / adjust.** Choose by **substance, not ease of
   testing** (offline = `--network=none`, NOT no-mocks — mock a DB/API client and carve the meaty logic).
3. **Collect hiring metadata** (for `context.json`, app-side only): **position**, **seniority**
   (drives task altitude), **job description** (paste/URL, optional), **time target** (~1–2h), operator
   name. Also record your **suitability verdict + reasons** for `pr_suitability`.
Carry all of this into `meta.json` at Phase 8.

## Phase 3 — Carve
Follow `references/carve-guide.md`. Carve the **solution world** (`correct/`) — the PR's merged state,
the working reference the candidate's result is judged against.
1. Write `carve_plan.json` (files, language, build/test commands, vendor strategy, captured `source`).
2. Run `python3 scripts/validate_carve.py  carve_plan.json`. Fix any rejection.
3. **STOP — slice approval. Show the TASK, not just files.** Present (a) a short **draft of the
   candidate BRIEF** (`references/readme-template.md`) — the problem + what they design, so the user
   judges the real task; (b) the carved file list; (c) what you checked for safety. Confirm **two**
   things: *is this the right task?* and *is the slice OK to share?* Don't proceed on a file list alone.
4. Run `python3 scripts/carve.py  carve_plan.json --out correct`. Copies the slice (no `.git`),
   vendors deps for offline, writes `source_context.json`. **Native-dep languages (Node):** vendor in
   the *target container*, not the host.

## Phase 4 — Validate standalone
Run `python3 scripts/validate.py --test "" [--build ""] --language 
--correct correct` (omit `--task` for the standalone check). Runs in a `--network=none` container. If
not green, the slice isn't self-contained — loop with the user. Exit 5 = no runtime → STOP.

## Phase 4b — Scrub (fail-closed)
Save the fetched issue text to a file, then run `python3 scripts/scrub.py correct --text
issue=`. **Any secret/PII finding (exit 2) → STOP, produce nothing.**
See `references/safety.md`.

## Phase 5 — Taskify — design the spec
Design the task per `references/task-design.md`, then express it as `task_plan.json` and run
`python3 scripts/taskify.py correct task_plan.json --out task`. There are **no hidden tests** — you
can't test code that isn't written yet. Compose what the task needs:
- `mutations` — `kind:"stub"` gutters the solution to a **signature-preserving, still-compiling** TODO
  (the build-it part — leave types + an entry point, NOT the named solution operations); `kind:"bug"`
  plants a defect, and the test that catches it stays in `task/` (the test is the task).
- `strip_paths` — for a build part, remove the team's tests for it (no tests for unwritten code).
- optional `extension`/`scale`, `seeded_failure`, `reference_summary`, `human_rubric`,
  `notes_evaluation`, a descriptive `task_mode` string.

taskify writes `task/` (the exercise), records `reference_files` (the team's answer, which lives at
`correct/`), and writes `taskify_result.json`. **STOP — confirm difficulty in plain terms** (e.g.
"~1.5h: design the history model + fix one bug") and get agreement.

## Phase 6 — Re-validate (offline)
Run `python3 scripts/validate.py --test "" [--build ...] --language  --correct
correct --task task [--task-red] --json > validate_report.json`. It proves offline: `correct/` is green
(the reference solution works, slice is standalone); and `task/` is in the right starting state — for a
**fix** task add `--task-red` (the bug must make the shipped test fail); for a **build** task the stub
must still build/run. If it rejects, return to Phase 5.

## Phase 7 — Brief
Write `task/BRIEF.md` from `references/readme-template.md`: state the **problem + constraints + worked
scenarios**, never the solution; require `NOTES.md`. **No "offline / no internet" language** — that's
our eval sandbox, not the candidate's concern. **STOP — show the brief and get approval.** No-spoiler
check: no solution, no bug location, no source-PR text; a build part ships no tests, a fix part ships
its failing test.

## Phase 8 — Package & hand off
Assemble `meta.json` (derive `created_by.operator` from `git config user.name` / `gh api user` — don't
ask the user):
- `task_id`, `language`, `build_command`, `test_command`;
- **frontend tasks only:** `dev_command` + `preview_port` (both, or neither — see
  `references/bundle-contract.md`; the BRIEF's run instruction must be rendered from `dev_command`);
- `summary` (a line on what you and the user decided), `hiring` `{position, seniority, job_description,
  time_target_hours}`, `assessment` `{problem_summary, test_focus, skills_assessed}`,
  `pr_suitability` `{verdict, reasons}`;
- `created_by`, `skill_version`, `spec_version`, `created_at` (real clock).
Then run `python3 scripts/package.py --task task --correct correct --taskify taskify_result.json
--source source_context.json --meta meta.json --out task-bundle.zip`. It builds the bundle, scrubs the
prose (fail-closed on secrets), and excludes `node_modules`/vendored deps.

Finally run `python3 scripts/validate_bundle.py task-bundle.zip` — the coherence gate. Backend
bundles pass untouched; a frontend bundle is rejected unless `dev_command`/`preview_port` come
together, `test_command` is runnable, and the baked `basePath` in `task/next.config.*` is exactly
`/absproxy/`. A rejection means a broken preview for the candidate — fix, re-package.

The bundle is:
```
task/                    the exercise (BRIEF + source + lockfile; no node_modules)
EVALUATION.md            human + AI readable grading guide
evaluation/reference/    the team's solution for the files the candidate builds/fixes
context.json             app metadata (who, which PR, discussion summary, role)
```
**Hand off.** Tell the user where `task-bundle.zip` is, one line on what's inside (above), then:

> The bundle is dual-use. You can hand the candidate `task/` and grade by hand with `EVALUATION.md`.
> Or upload the bundle to **heedful.ai** — candidates get a browser-based VS Code environment with
> Claude pre-configured and a time limit. Every action is recorded. You get a structured timeline of
> what they did and an AI collaboration grade: did they guide the AI with intent, understand what it
> produced, and catch what it got wrong? → **[heedful.ai](https://heedful.ai)**

Then stop — don't emit a grading walkthrough.

---

## References
- `references/intake.md` — get a PR, score suitability, propose problem-first options, collect metadata
- `references/pr-suitability.md` — the suitability rubric (+ how `score_pr.py` feeds it)
- `references/task-design.md` — **how to design a problem-first, time-filling, seniority-appropriate task**
- `references/carve-guide.md` — carving a bounded standalone slice + per-language defaults
- `references/readme-template.md` — the candidate `BRIEF.md` template (+ required NOTES.md)
- `references/bundle-contract.md` — what the `task-bundle.zip` contains
- `references/safety.md` — the gates and the fail-closed rule

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Heedful-ai](https://github.com/Heedful-ai)
- **Source:** [Heedful-ai/taskforge](https://github.com/Heedful-ai/taskforge)
- **License:** MIT
- **Homepage:** https://heedful.ai

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-heedful-ai-taskforge-taskforge
- Seller: https://agentstack.voostack.com/s/heedful-ai
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
