---
name: backlog
description: "Show, add, and resolve local course backlog items stored in backlog.json."
---

# Backlog

> **Trigger**: `/backlog`
> **Plugin**: ASU Canvas Course Builder
> **Scripts**: `scripts/backlog_manager.py`
> **Related**: `course-audit`, `alignment`, `bulk-edit`, `staging`

## Purpose

Show and manage the active course backlog stored at `courses/{COURSE_ID}/backlog.json`. This skill is local-only: read and write backlog JSON, but do not write to Canvas.

## Source Of Truth

Use the active course ID from the current course context. Load:

```text
courses/{COURSE_ID}/backlog.json
```

If the file does not exist, treat the backlog as empty. Do not create Canvas content, update Canvas settings, or call push scripts from this skill.

## Display Pending Items

On `/backlog`, list unresolved items grouped in this exact order:

1. `drift`
2. `accessibility`
3. `readiness`
4. `other`

Use each item's `type` field for grouping. If `type` is missing or not one of the first three groups, show it under `other`.

For each item, show:

```text
{id} [{type}] {description}
```

Include source fields such as `objective`, `assessment`, `severity`, or `report_path` when present and useful.

## Resolve Items

If the user asks to mark an item resolved:

1. Prefer exact ID match.
2. If no ID matches, match a unique case-insensitive description substring.
3. If multiple items match, show the matches and ask the user to choose.
4. Mark the item with `resolved: true` and `resolved_at`.

Use `backlog_manager.resolve(course_id, item_id)` for ID matches. For description matches, first load `backlog_manager.list(course_id)`, find the unique unresolved match, then resolve its ID.

## Add Ad-Hoc Items

If the user asks to add something to the backlog, create a local item with:

```json
{
  "type": "other",
  "description": "...",
  "source": "ad-hoc"
}
```

Use `type` values `drift`, `accessibility`, or `readiness` when the user's language clearly indicates one. Otherwise use `other`. Save through `backlog_manager.add(course_id, item)`.

## Bulk Fix Requests

If the user asks to fix multiple backlog items, clean up a whole group, or apply broad changes, route to `bulk-edit`. Pass the selected backlog IDs/descriptions as local context. Do not perform Canvas writes from `/backlog`.

## Completion

After any add or resolve operation, show the updated pending counts by group and remind the user that changes were local-only.
