| name | nightshift:update-table |
| description | Make bulk changes to a Nightshift shift's table.csv โ add rows, update metadata, or reset failed items. Use when the user invokes /nightshift:update-table. |
| disable-model-invocation | true |
| allowed-tools | Bash(qsv *) Bash(flock *) Bash(mv *) Bash(rm *) Bash(test *) Bash(ls *) |
| argument-hint | ["shift-name"] |
Bulk-modify the table.csv of shift $ARGUMENTS.
Steps
-
Resolve the shift
- If
$ARGUMENTS is non-empty, use it.
- Otherwise, list directories in
.nightshift/ (excluding archive/); auto-select if exactly one exists, otherwise use AskUserQuestion to pick.
-
Show current table state
flock -x .nightshift/<shift>/table.csv qsv count .nightshift/<shift>/table.csv
flock -x .nightshift/<shift>/table.csv qsv headers --just-names .nightshift/<shift>/table.csv
flock -x .nightshift/<shift>/table.csv qsv table .nightshift/<shift>/table.csv
Per task column, also show counts:
flock -x .nightshift/<shift>/table.csv qsv search --exact todo --select <task-column> .nightshift/<shift>/table.csv | qsv count
flock -x .nightshift/<shift>/table.csv qsv search --exact done --select <task-column> .nightshift/<shift>/table.csv | qsv count
flock -x .nightshift/<shift>/table.csv qsv search --exact failed --select <task-column> .nightshift/<shift>/table.csv | qsv count
-
Determine the operation
Use AskUserQuestion:
"What do you want to do?"
Options:
- "Add rows" โ append new items.
- "Update metadata" โ modify metadata column values.
- "Reset failed items" โ change
failed statuses back to todo.
-
Execute the operation
Add rows:
Update metadata:
Reset failed items:
- Ask which task column (or all).
- List failed items:
flock -x .nightshift/<shift>/table.csv qsv search --exact failed --select <task-column> .nightshift/<shift>/table.csv
- Show how many will be reset; confirm via AskUserQuestion.
- Reset each:
flock -x .nightshift/<shift>/table.csv qsv edit -i .nightshift/<shift>/table.csv <task-column> <qsv_index> todo
-
Show result
## Table Updated: <shift>
**Operation:** <what was done>
**Rows affected:** N
**Current state:** X total items, Y todo, Z done, W failed
Guardrails
- Always confirm before modifying existing data.
- Preserve item ordering when adding rows.
- Set all task columns to
todo for new rows.
- Never reorder existing rows.
- Always show the diff before applying destructive changes.