diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-21 19:16:49 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-21 19:16:49 +0200 |
| commit | 6c761b737256d57c0ed7c9ea61578c8cc05f5d5b (patch) | |
| tree | 75142549356efe7cd75112b3e22a971d1e91ffcd | |
| parent | 5d684747c37e515d421345f3faa1b4c756c08b71 (diff) | |
more on prompts
7 files changed, 78 insertions, 26 deletions
diff --git a/prompts/commands/review-changes.md b/prompts/commands/review-changes.md new file mode 100644 index 0000000..3990e0c --- /dev/null +++ b/prompts/commands/review-changes.md @@ -0,0 +1,21 @@ +# /review-changes + +**Description:** Review all uncommitted git changes (staged + unstaged), explain what they do and why, assess correctness, and write a review to REVIEW-COMMENTS.md. + +--- + +## Prompt + +Review all uncommitted changes in this repository: + +1. Run `git status`, `git diff --cached`, `git diff`, and `git log --oneline -10` to understand the current state. +2. Read the relevant source files for full context around each change. +3. For each modified file, explain: + - What changed and why it's needed + - Whether the change is correct + - Any concerns or nits +4. Overwrite `REVIEW-COMMENTS.md` with a structured review covering: + - Overview and motivation + - Files changed (table) + - Detailed assessment of each change + - Summary with verdict diff --git a/prompts/skills/project-taskwarrior/00-context.md b/prompts/skills/project-taskwarrior/00-context.md index 19771b1..5c2c741 100644 --- a/prompts/skills/project-taskwarrior/00-context.md +++ b/prompts/skills/project-taskwarrior/00-context.md @@ -14,7 +14,8 @@ Use it as `project:<name>` in every `task` command. ## Rules that apply to all task commands -- **EVERY `task` command MUST include `project:<name>`** — no exceptions. Never run a bare `task` without the project filter. When using a task ID, confirm the task belongs to the current project first. -- **NEVER modify, delete, complete, start, or annotate tasks from other projects.** Only act on tasks where `project:<name>` matches the current git repo. +- **Project and tag matching:** The agent only reads, modifies, or creates tasks that have **both** `project:<name>` **and** the `+agent` tag. Do not touch any task that does not have `+agent` set. +- **EVERY `task` command MUST include `project:<name>`** — no exceptions. When listing or querying, also include `+agent` so only agent-managed tasks are shown (e.g. `task project:<name> +agent list`). Never run a bare `task` without the project filter. When using a task ID, confirm the task belongs to the current project **and** has the `+agent` tag before acting on it. +- **NEVER modify, delete, complete, start, or annotate tasks from other projects or tasks without `+agent`.** Only act on tasks where `project:<name>` matches the current git repo and the task has the `+agent` tag. - **One task in progress per project.** Do not start a second task while another is started and not completed, unless the user explicitly asks. - **Parallel work via sub-agents** — the agent may spawn sub-agents to work on tasks in parallel only **after the user approves**. diff --git a/prompts/skills/project-taskwarrior/1-create-task.md b/prompts/skills/project-taskwarrior/1-create-task.md index 259247c..8c37500 100644 --- a/prompts/skills/project-taskwarrior/1-create-task.md +++ b/prompts/skills/project-taskwarrior/1-create-task.md @@ -1,9 +1,10 @@ # Create task -Use with `00-context.md`. Project name and global rules apply. +Use with `00-context.md`. Project name and global rules apply. New tasks get `+agent` so they are agent-managed; when setting dependencies (`depends:<id>`), use IDs of tasks that have `+agent` (from `project:<name> +agent` lists). ## Rules for new tasks +- **Create tasks in smaller chunks that fit into the context window.** Break work into multiple tasks so that each task’s scope, description, and required context (refs, files, docs) can fit in one context window when the agent works on it with a fresh context. Do not create single tasks that would require more context than available. - **Every task MUST have at least one tag** for sub-project/feature/area (e.g. `+integrationtests`, `+flamegraph`, `+bpf`, `+cli`, `+refactor`, `+bugfix`). - **When an agent creates a task, always add the tag `+agent`** so agent-created tasks can be identified. - **Include references to all context required** to work on the task. So that work can be done with a fresh context, every task must list or link everything needed: relevant files, docs, specs, other tasks, or project guidelines (e.g. paths, doc links, `AGENTS.md`, `README` sections). Put these in the task description or in an initial annotation so that an agent starting with no prior conversation has everything they need in the task itself. @@ -24,6 +25,7 @@ Multiple dependencies: `depends:<id1>,<id2>`. ## Conventions +- **Keep tasks small:** each task should be a chunk that fits in the context window (description + refs + work to do). Split large efforts into multiple dependent tasks. - Pick or create a meaningful tag for the sub-project or feature. - Add dependencies when one task must complete before another can start. - When creating a task, add references to all required context (files, docs, specs) so the task is self-contained for fresh-context work. diff --git a/prompts/skills/project-taskwarrior/2-start-task.md b/prompts/skills/project-taskwarrior/2-start-task.md index 3f38bc1..ec34f25 100644 --- a/prompts/skills/project-taskwarrior/2-start-task.md +++ b/prompts/skills/project-taskwarrior/2-start-task.md @@ -1,6 +1,6 @@ # Start task -Use with `00-context.md`. Project name and global rules apply (including one task in progress per project unless the user says otherwise). +Use with `00-context.md`. Project name and global rules apply (including one task in progress per project unless the user says otherwise). Only start tasks that have both `project:<name>` and the `+agent` tag — use task IDs from `project:<name> +agent` filtered lists. ## Start each new task with a fresh context diff --git a/prompts/skills/project-taskwarrior/3-complete-task.md b/prompts/skills/project-taskwarrior/3-complete-task.md index 514bdbd..598afdc 100644 --- a/prompts/skills/project-taskwarrior/3-complete-task.md +++ b/prompts/skills/project-taskwarrior/3-complete-task.md @@ -1,6 +1,6 @@ # Complete task -Use with `00-context.md`. Project name and global rules apply. +Use with `00-context.md`. Project name and global rules apply. Only complete tasks that have both `project:<name>` and the `+agent` tag — use task IDs from `project:<name> +agent` filtered lists. ## Completion criteria (required before “done”) @@ -9,17 +9,37 @@ A task is **not** considered done until all of the following are true: - **Best practices** — the codebase (or changed parts) follows the project’s best practices. - **Compilable** — all code compiles successfully (e.g. full build succeeds). - **Tests pass** — all tests pass (e.g. full test suite green). +- **Negative tests where plausible** — for any new or changed tests, include negative tests (invalid input, errors, failure cases) wherever plausible. If any of these fail, fix the issues and recheck. Do not mark the task complete until they are all met. +## What the review sub-agent must check + +Review sub-agents (first and second review) **must always**: + +- **Unit test coverage** — double-check that coverage is as desired for the changed or added code (e.g. project expectations or thresholds are met). +- **Tests are testing real things** — confirm that tests exercise real behavior and assertions, not only mocks. Flag tests that merely assert on mocks or stubs without verifying real logic, integration points, or outcomes. Tests should give confidence that the code actually works. +- **Negative tests where plausible** — for all tests created, ensure there are also negative tests (invalid input, error paths, edge cases that should fail, unauthorized access, etc.) wherever plausible. If positive/happy-path tests exist but no corresponding negative tests, flag it unless there is a clear reason none are plausible. + +Include these checks in the sub-agent’s review report. + +## Self-review before any sub-agent handoff + +**Before signing off work to sub-agents for review** (before the first review and again before the second), the main agent must **ask itself**: + +- Did everything I did make sense? +- Isn’t there a better way to do it? + +If the answer suggests improvements or inconsistencies, address them first. Only then hand off to the sub-agent. Do not skip this step. + ## Before marking complete (after criteria are met) **Once the completion criteria above are met:** -1. Spawn a **sub-agent** with **fresh context** (no prior conversation). -2. Sub-agent reviews the diff, code, or deliverables for the task and **reports back** to the main agent (review comments, suggestions, issues). +1. **Self-review** (see above). Then spawn a **sub-agent** with **fresh context** (no prior conversation). +2. Sub-agent reviews the diff, code, or deliverables for the task (including test coverage and test quality — see “What the review sub-agent must check”) and **reports back** to the main agent (review comments, suggestions, issues). 3. Main agent **addresses all review comments** from the sub-agent — no exceptions. Fix or respond to every point. -4. **After addressing comments, spawn another sub-agent** (fresh context again) to **review the code again** and confirm the fixes. If this second review finds further issues, address them and repeat the sub-agent review until the review is satisfied. +4. **Self-review again** (see above). Then **spawn another sub-agent** (fresh context again) to **review the code again** (including test coverage and test quality) and confirm the fixes. If this second review finds further issues, address them and repeat the sub-agent review until the review is satisfied. 5. Only then: ```bash @@ -28,6 +48,8 @@ task <id> done ## Conventions -- A task is not done until: best practices met, code compiles, all tests pass, all first-round review comments addressed, **and** a second sub-agent review has confirmed the code (or any further issues have been addressed and re-reviewed). -- Complete with `task <id> done` only after completion criteria, first review, addressing all comments, and the follow-up sub-agent review are satisfied. +- When creating or changing tests, add negative tests (invalid input, errors, failure paths) wherever plausible; the review sub-agent will check for this. +- A task is not done until: best practices met, code compiles, all tests pass, negative tests included where plausible, all first-round review comments addressed (including coverage and test-quality checks), **and** a second sub-agent review has confirmed the code (or any further issues have been addressed and re-reviewed). +- Before every sub-agent review handoff, do the self-review: “Did it all make sense? Is there a better way?” Fix anything that comes up, then hand off. +- Complete with `task <id> done` only after completion criteria, self-review(s), first review, addressing all comments, and the follow-up sub-agent review are satisfied. - When completing a task, note which tasks were unblocked (dependents that became ready), if any. diff --git a/prompts/skills/project-taskwarrior/4-annotate-update-task.md b/prompts/skills/project-taskwarrior/4-annotate-update-task.md index f96d46b..ee45a4a 100644 --- a/prompts/skills/project-taskwarrior/4-annotate-update-task.md +++ b/prompts/skills/project-taskwarrior/4-annotate-update-task.md @@ -1,6 +1,6 @@ # Annotate / update task -Use with `00-context.md`. Project name and global rules apply. +Use with `00-context.md`. Project name and global rules apply. Only annotate, modify, or delete tasks that have both `project:<name>` and the `+agent` tag (use task IDs from `project:<name> +agent` filtered lists, or verify the task has `+agent` before acting). ## Reading task context diff --git a/prompts/skills/project-taskwarrior/5-review-overview-tasks.md b/prompts/skills/project-taskwarrior/5-review-overview-tasks.md index 954c720..51a5a54 100644 --- a/prompts/skills/project-taskwarrior/5-review-overview-tasks.md +++ b/prompts/skills/project-taskwarrior/5-review-overview-tasks.md @@ -4,55 +4,61 @@ Use with `00-context.md`. Project name and global rules apply. ## List tasks for the project +Only list tasks that have `+agent` (project + tag matching). When listing, order by **priority first, then urgency**: + ```bash -task project:<name> list +task project:<name> +agent list sort:priority-,urgency- ``` -By tag: +By tag (keep `+agent`, same order): ```bash -task project:<name> +<tag> list +task project:<name> +agent +<tag> list sort:priority-,urgency- ``` ## Picking what to work on (next task) +**Order by priority first, then by urgency.** When choosing among tasks, always consider priority first (e.g. H then M then L), then urgency as a tiebreaker. + **Check already-started tasks first.** Before suggesting or starting a new task: ```bash -task project:<name> start.any: list +task project:<name> +agent start.any: list sort:priority-,urgency- ``` -- If any tasks are already started, **use one of those** — do not start a second task unless the user explicitly asks. -- Only if no tasks are in progress, show the next actionable (READY) task: +- If any tasks are already started, **use one of those** (pick by priority, then urgency) — do not start a second task unless the user explicitly asks. +- Only if no tasks are in progress, show the next actionable (READY) task, ordered by priority then urgency: ```bash -task project:<name> +READY next limit:1 +task project:<name> +agent +READY list sort:priority-,urgency- limit:1 ``` +(Or use `next limit:1` with a report that sorts priority first, then urgency, if your Taskwarrior config supports it.) + ## View task details ```bash task <id> ``` -Always read description, summary, and **all annotations** when working on or reviewing a task. +Only work with task IDs that came from the filtered lists above (project + `+agent`). Always read description, summary, and **all annotations** when working on or reviewing a task. ## Visualization -Dependency tree (export): +Dependency tree (export, agent tasks only): ```bash -task project:<name> export +task project:<name> +agent export ``` -Blocked vs ready: +Blocked vs ready (with `+agent`): ```bash -task project:<name> +BLOCKED list -task project:<name> +READY list +task project:<name> +agent +BLOCKED list +task project:<name> +agent +READY list ``` ## Conventions -- When picking the next task: first list already-started (`start.any:`); if any exist, continue one of those; only if none, pick from `+READY` by urgency. -- Prefer `+READY` (unblocked) tasks sorted by urgency when choosing among ready tasks. +- When picking the next task: first list already-started (`start.any:`); if any exist, continue one of those; only if none, pick from `+READY`. **Always order by priority first, then urgency** (e.g. `sort:priority-,urgency-`). +- Among ready or started tasks, choose by priority (H then M then L), then by urgency. |
