Kano Agent Backlog Skill (local-first)
Scope
Use this skill to:
- Plan new work by creating backlog items before code changes.
- Maintain hierarchy and relationships via
parent links, as defined by the active process profile.
- Record decisions with ADRs and link them to items.
- Keep a durable, append-only worklog for project evolution.
Agent compatibility: read the whole skill
- Always load the entire
SKILL.md before acting; some agent shells only fetch the first ~100 lines by default.
- If your client truncates, fetch in chunks (e.g., lines 1-200, 200-400, …) until you see the footer marker
END_OF_SKILL_SENTINEL.
- If you cannot confirm the footer marker, stop and ask for help; do not proceed with partial rules.
- When generating per-agent guides, preserve this read-all requirement so downstream agents stay in sync.
Non-negotiables
- Planning before coding: create/update items and meet the Ready gate before making code changes.
- Worklog is append-only; never rewrite history.
- Update Worklog whenever:
- a discussion produces a clear decision or direction,
- an item state changes,
- scope/approach changes,
- or an ADR is created/linked.
- Archive by view: hide
Done/Dropped items in views by default; do not move files unless explicitly requested.
- Backlog volume control:
- Only create items for work that changes code or design decisions.
- Avoid new items for exploratory discussion; record in existing Worklog instead.
- Keep Tasks/Bugs sized for a single focused session.
- Avoid ADRs unless a real architectural trade-off is made.
- Ticketing threshold (agent-decided):
- Open a new Task/Bug when you will change code/docs/views/scripts.
- Open an ADR (and link it) when a real trade-off or direction change is decided.
- Otherwise, record the discussion in an existing Worklog; ask if unsure.
- Ticket type selection (keep it lightweight):
- Epic: multi-release or multi-team milestone spanning multiple Features.
- Feature: a new capability that delivers multiple UserStories.
- UserStory: a single user-facing outcome that requires multiple Tasks.
- Task: a single focused implementation or doc change (typically one session).
- Example: "End-to-end embedding pipeline" = Epic; "Pluggable vector backend" = Feature; "MVP chunking pipeline" = UserStory; "Implement tokenizer adapter" = Task.
- Bug vs Task triage (when fixing behavior):
- If you are correcting a behavior that was previously marked
Done and the behavior violates the original intent/acceptance (defect or regression), open a Bug and link it to the original item.
- If the change is a new requirement/scope change beyond the original acceptance, open a Task/UserStory (or Feature) instead, and link it for traceability.
- Bug origin tracing (when diagnosing a defect/regression):
- Record when the issue started and the evidence path you used to determine it.
- Prefer VCS-backed evidence when available:
- last-known-good revision (commit hash or tag)
- first-known-bad revision (commit hash or tag)
- suspected introducing change(s) (commit hash) and why (e.g.,
git blame on specific lines)
- If git history is unavailable (zip export, shallow clone, missing remote), explicitly record that limitation and what alternative evidence you used (e.g., release notes, timestamps, reproduction reports).
- Keep evidence lightweight: record commit hashes + 1–2 line summaries; avoid pasting large diffs into Worklog. Attach artifacts when needed.
- Suggested Worklog template:
Bug origin: last_good=<sha|tag>, first_bad=<sha|tag>, suspect=<sha> (reason: blame <path>:<line>), evidence=<git log/blame/bisect|other>
- State ownership: the agent decides when to move items to InProgress or Done; humans observe and can add context.
- State semantics: Proposed = needs discovery/confirmation; Planned = approved but not started; Ready gate applies before start.
- Hierarchy is in frontmatter links, not folder nesting; avoid moving files to reflect scope changes.
- Filenames stay stable; use ASCII slugs.
- Never include secrets in backlog files or logs.
- Language: backlog and documentation content must be English-only (no CJK), to keep parsing and cross-agent collaboration deterministic.
- Agent Identity: In Worklog and audit logs, use your own identity (e.g.,
[agent=antigravity]), never copy [agent=codex] blindly.
- Always provide an explicit
--agent value for auditability (some commands currently default to cli, but do not rely on it).
- Model attribution (optional but preferred): provide
--model <name> (or env KANO_AGENT_MODEL / KANO_MODEL) when it is known deterministically.
- Do not guess model names; if unknown, omit the
[model=...] segment.
- Agent Identity Protocol: Supply
--agent <ID> with your real product name (e.g., cursor, copilot, windsurf, antigravity).
- Forbidden (Placeholders):
auto, user, assistant, <AGENT_NAME>, $AGENT_NAME.
- File operations for backlog/skill artifacts must go through the
kano-backlog CLI
(python skills/kano-agent-backlog-skill/scripts/kano-backlog <command>) so audit logs capture the action.
- Skill scripts only operate on paths under
_kano/backlog/ or _kano/backlog_sandbox/;
refuse other paths.
- After modifying backlog items, refresh the plain Markdown views immediately using
python skills/kano-agent-backlog-skill/scripts/kano-backlog view refresh --agent <agent-id> --backlog-root <path> so the dashboards stay current.
- Persona summaries/reports are available via
python skills/kano-agent-backlog-skill/scripts/kano-backlog admin persona summary|report ....
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem update-state ... auto-syncs parent states forward-only by default; use --no-sync-parent
for manual re-plans where parent state should stay put.
- Add Obsidian
[[wikilink]] references in the body (e.g., a ## Links section) so Graph/backlinks work; frontmatter alone does not create graph edges.
Agent compatibility: read the whole skill
- Always load the entire
SKILL.md before acting; some agent shells only fetch the first ~100 lines by default.
- If your client truncates, fetch in chunks (e.g., lines 1-200, 200-400, …) until you see the footer marker
END_OF_SKILL_SENTINEL.
- If you cannot confirm the footer marker, stop and ask for help; do not proceed with partial rules.
- When generating per-agent guides, preserve this read-all requirement so downstream agents stay in sync.
First-run bootstrap (prereqs + initialization)
Before using this skill in a repo, the agent must confirm:
- Python prerequisites are available (or install them), and
- the backlog scaffold exists for the target product/root.
If the backlog structure is missing, propose the bootstrap commands and wait for user approval before writing files.
Developer vs user mode (where to declare it)
- Preferred source of truth: product config in
_kano/backlog/products/<product>/_config/config.json.
mode.skill_developer: true when this repo actively develops the skill itself (this demo repo).
mode.persona: optional string describing the primary human persona (e.g. developer, pm, qa), used only for human-facing summaries/views.
- Secondary: agent guide files (e.g.,
AGENTS.md / CLAUDE.md) can document expectations, but are agent-specific and not script-readable.
Skill developer gate (architecture compliance)
If mode.skill_developer=true, before writing any skill code (in scripts/ or src/), you must:
- Read ADR-0013 ("Codebase Architecture and Module Boundaries") in the product decisions folder.
- Follow the folder rules defined in ADR-0013:
scripts/ is executable-only: no reusable module code.
src/ is import-only: core logic lives here, never executed directly.
- All agent-callable operations go through
scripts/kano-backlog CLI.
- Place new code in the correct package:
- Models/config/errors →
src/kano_backlog_core/
- Use-cases (create/update/view) →
src/kano_backlog_ops/
- Storage backends →
src/kano_backlog_adapters/
- CLI commands →
src/kano_backlog_cli/commands/
Violating these boundaries will be flagged in code review.
Prerequisite install (Python)
Detect:
- Run
python skills/kano-agent-backlog-skill/scripts/kano-backlog doctor --format plain.
If packages are missing, install once (recommended):
- Default:
python -m pip install -e skills/kano-agent-backlog-skill
- Skill contributors:
python -m pip install -e skills/kano-agent-backlog-skill[dev]
- Optional heavy dependencies (FAISS, sentence-transformers) should be installed manually per platform requirements before running the CLI against embedding features.
Backlog initialization (file scaffold + config + dashboards)
Detect (multi-product / platform layout):
- Product initialized if
_kano/backlog/products/<product>/_config/config.json exists (or confirm via python skills/kano-agent-backlog-skill/scripts/kano-backlog doctor --product <product>).
Bootstrap:
- Run
python skills/kano-agent-backlog-skill/scripts/kano-backlog admin init --product <product> --agent <agent-id> [--backlog-root <path>] to scaffold _kano/backlog/products/<product>/ (items/, decisions/, views/, _config/, _meta/, _index/).
- The init command derives a project prefix, writes
_config/config.json, and refreshes dashboards so views exist immediately after initialization.
- Manual fallback (only if automation is unavailable): follow
_kano/backlog/README.md to copy the template scaffold, then refresh views via kano-backlog view refresh.
Optional LLM analysis over deterministic reports
This skill can optionally append an LLM-generated analysis to a deterministic report.
The deterministic report is the SSOT; analysis is treated as a derived artifact.
- Deterministic report:
views/Report_<persona>.md
- Derived LLM output:
views/_analysis/Report_<persona>_LLM.md (gitignored by default)
- Deterministic prompt artifact:
views/_analysis/Report_<persona>_analysis_prompt.md
Enable by config (per product):
analysis.llm.enabled = true
Execution:
- The default workflow is: generate the deterministic report → use it as SSOT → fill in the analysis template.
- The skill generates a deterministic prompt file to guide the analysis, and a derived markdown file with placeholder headings.
- Optional automation: when
analysis.llm.enabled = true in config, view refresh generates views/snapshots/_analysis/Report_<persona>_analysis_prompt.md (deterministic prompt) and Report_<persona>_LLM.md (template or LLM output)
- Never pass API keys as CLI args; keep secrets in env vars to avoid leaking into audit logs.
ID prefix derivation
- Source of truth:
- Product config:
_kano/backlog/products/<product>/_config/config.toml (product.name, product.prefix), or
- Repo config (single-product):
_kano/backlog/_config/config.toml (product.name, product.prefix).
- Derivation:
- Split
product.name on non-alphanumeric separators and camel-case boundaries.
- Take the first letter of each segment.
- If only one letter, take the first letter plus the next consonant (A/E/I/O/U skipped).
- If still short, use the first two letters.
- Uppercase the result.
- Example:
product.name=kano-agent-backlog-skill-demo -> KABSD.
Recommended layout
This skill supports both single-product and multi-product layouts:
- Single-product (repo-level):
_kano/backlog/
- Multi-product (monorepo):
_kano/backlog/products/<product>/
Within each backlog root:
_meta/ (schema, conventions)
items/<type>/<bucket>/ (work items)
decisions/ (ADR files)
views/ (dashboards / generated Markdown)
Item bucket folders (per 100)
- Store items under
_kano/backlog/items/<type>/<bucket>/.
- Bucket names use 4 digits for the lower bound of each 100 range.
- Example:
0000, 0100, 0200, 0300, ...
- Example path:
_kano/backlog/items/task/0000/KABSD-TSK-0007_define-secret-provider-validation.md
Index/MOC files
- For Epic, create an adjacent index file:
- Index files should render a tree using Dataview/DataviewJS and rely on
parent links.
- Track epic index files in
_kano/backlog/_meta/indexes.md (type, item_id, index_file, updated, notes).
References
- Reference index:
REFERENCE.md
- Schema and rules:
references/schema.md
- Templates:
references/templates.md
- Workflow SOP:
references/workflow.md
- View patterns:
references/views.md
- Obsidian Bases (plugin-free):
references/bases.md
- Context Graph + Graph-assisted retrieval:
references/context_graph.md
If the backlog structure is missing, propose creation and wait for user approval before writing files.
Kano CLI entrypoints (current surface)
scripts/ exposes a single executable: scripts/kano-backlog. The CLI is intentionally organized as nested command groups so agents can discover operations via --help on-demand (instead of hard-coding the full command surface into this skill).
Help-driven discovery (preferred)
Run these in order, expanding only what you need:
python skills/kano-agent-backlog-skill/scripts/kano-backlog --help
- Shows top-level groups (e.g.,
backlog, item, state, worklog, view) and global options.
python skills/kano-agent-backlog-skill/scripts/kano-backlog <group> --help
- Shows subcommands for that group.
python skills/kano-agent-backlog-skill/scripts/kano-backlog <group> <command> --help
- Shows required args/options for that command.
Guideline: do not paste large --help output into chat; inspect it locally and run the command.
Canonical examples (keep these few memorized)
- Bootstrap:
python skills/kano-agent-backlog-skill/scripts/kano-backlog doctor --format plain
python skills/kano-agent-backlog-skill/scripts/kano-backlog admin init --product <name> --agent <id>
- Daily workflow:
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem create --type task --title "..." --agent <id> --product <name>
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem set-ready <item-id> --context "..." --goal "..." --approach "..." --acceptance-criteria "..." --risks "..." --product <name>
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem validate <item-id> --product <name>
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem update-state <item-ref> --state InProgress --agent <id> --message "..." --product <name>
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem attach-artifact <item-id> --path <file> --shared --agent <id> --product <name> [--note "..."]
python skills/kano-agent-backlog-skill/scripts/kano-backlog view refresh --agent <id> --product <name>
- Backlog integrity checks:
python skills/kano-agent-backlog-skill/scripts/kano-backlog admin validate uids --product <name>
Conflict handling policy (configurable)
Use product config to control how duplicate IDs and UIDs are handled by maintenance commands
such as admin links normalize-ids.
- Config keys (product
_config/config.toml):
conflict_policy.id_conflict: default rename (rename duplicate IDs).
conflict_policy.uid_conflict: default trash_shorter (move shorter duplicate content to _trash/).
trash_shorter uses _trash/<YYYYMMDD>/... under the product root; items get a Worklog entry.
Sandbox workflow (isolated experimentation)
For testing, prototyping, or demos without affecting production backlog:
- Create:
python skills/kano-agent-backlog-skill/scripts/kano-backlog admin sandbox init <sandbox-name> --product <source-product> --agent <id>
- Use:
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem create --product <sandbox-name> ... (same CLI, different product)
- Cleanup:
rm -rf _kano/backlog_sandbox/<sandbox-name> (git will ignore this directory)
- Rationale: Sandboxes mirror production structure but live in
_kano/backlog_sandbox/, so changes never leak into _kano/backlog/.
Artifacts policy (local-first)
- Storage locations:
- Shared across products:
_kano/backlog/_shared/artifacts/<ITEM_ID>/ (use --shared).
- Product-local:
_kano/backlog/products/<product>/artifacts/<ITEM_ID>/ (use --no-shared).
- Usage:
- Attach via
workitem attach-artifact — copies the file and appends a Worklog link.
- Prefer lightweight, text-first artifacts (Markdown, Mermaid, small images). Use Git LFS for large binaries if needed.
- Git policy:
- Commit human-readable artifacts that aid review. Avoid committing generated binaries unless justified.
- Sandboxes under
_kano/backlog_sandbox/ are gitignored; artifacts there are ephemeral.
- For derived analysis, store under
views/_analysis/ (gitignored by default), and keep deterministic reports in views/.
- Linking:
- The CLI appends a Markdown link relative to the item file. Optionally add a
## Links section for richer context.
State update helper
- Use
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem update-state ... to update state + append Worklog.
- Prefer
--action on kano-backlog state transition for the common transitions (start, ready, review, done, block, drop).
- Use
python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem validate <item-id> to check the Ready gate explicitly.
Topic and Workset workflow (context management)
When to use Topics
Topics are shareable context buffers for multi-step work that spans multiple work items or requires exploratory research before creating formal backlog items.
Use Topics when:
- Exploring a complex problem that may result in multiple work items
- Collecting code snippets, logs, and materials across multiple sessions
- Collaborating across agents/sessions with a shared context
- Refactoring work that requires tracking multiple code locations
Topic lifecycle:
- Create:
python skills/kano-agent-backlog-skill/scripts/kano-backlog topic create <topic-name> --agent <id>
- Creates
_kano/backlog/topics/<topic>/ with manifest.json, brief.md, brief.generated.md, notes.md, and materials/ subdirectories
- Collect materials:
- Add items:
topic add <topic-name> --item <ITEM_ID>
- Add code snippets:
topic add-snippet <topic-name> --file <path> --start <line> --end <line> --agent <id>
- Pin docs:
topic pin <topic-name> --doc <path>
- Distill:
python skills/kano-agent-backlog-skill/scripts/kano-backlog topic distill <topic-name>
- Generates/overwrites deterministic
brief.generated.md from collected materials
brief.md is a stable, human-maintained brief (do not overwrite it automatically)
- Switch context:
python skills/kano-agent-backlog-skill/scripts/kano-backlog topic switch <topic-name> --agent <id>
- Sets active topic (affects config overlays and workset behavior)
- Close:
python skills/kano-agent-backlog-skill/scripts/kano-backlog topic close <topic-name> --agent <id>
- Marks topic as closed; eligible for TTL cleanup
- Cleanup:
python skills/kano-agent-backlog-skill/scripts/kano-backlog topic cleanup --ttl-days <N> [--dry-run]
- Removes raw materials from closed topics older than TTL
Topic snapshots (retention policy):
- Snapshots are intended for milestone checkpoints (pre-merge/split/restore, risky bulk edits), not every small edit.
- To prevent noise, keep only the latest snapshot per topic in this demo repo.
- After creating a snapshot (or periodically), prune all but the newest snapshot:
python skills/kano-agent-backlog-skill/scripts/kano-backlog topic snapshot cleanup <topic-name> --ttl-days 0 --keep-latest 1 --apply
Topic structure:
_kano/backlog/topics/<topic>/
manifest.json # refs to items/docs/snippets, status, timestamps
brief.md # stable, human-maintained brief (do not overwrite automatically)
brief.generated.md # deterministic distilled brief (generated/overwritten by `topic distill`)
notes.md # freeform notes (backward compat)
materials/ # raw collection (gitignored by default)
clips/ # code snippet refs + cached text
links/ # urls / notes
extracts/ # extracted paragraphs
logs/ # build logs / command outputs
synthesis/ # intermediate drafts
publish/ # prepared write-backs (patches/ADRs)
config.toml # optional topic-specific config overrides
When to use Worksets
Worksets are per-item working directories (cached, derived data) for a single backlog item.
Use Worksets when:
- Starting work on a specific Task/Bug/UserStory
- Need scratch space for deliverables (patches, test artifacts, etc.)
- Want item-specific config overrides (rare)
Workset lifecycle:
- Initialize:
python skills/kano-agent-backlog-skill/scripts/kano-backlog workset init <ITEM_ID> --agent <id> [--ttl-hours <N>]
- Creates
_kano/backlog/.cache/worksets/items/<ITEM_ID>/ with meta.json, plan.md, notes.md, deliverables/
- Work: Store scratch files in
deliverables/ (patches, test outputs, etc.)
- Refresh:
python skills/kano-agent-backlog-skill/scripts/kano-backlog workset refresh <ITEM_ID> --agent <id>
- Updates
refreshed_at timestamp
- Cleanup:
python skills/kano-agent-backlog-skill/scripts/kano-backlog workset cleanup --ttl-hours <N> [--dry-run]
- Removes stale worksets older than TTL
Workset structure:
_kano/backlog/.cache/worksets/items/<ITEM_ID>/
meta.json # workset metadata (item_id, agent, timestamps, ttl)
plan.md # execution plan template
notes.md # work notes with Decision: marker guidance
deliverables/ # scratch outputs (patches, logs, test artifacts)
config.toml # optional item-specific config overrides
Topic vs Workset decision guide
| Scenario |
Use Topic |
Use Workset |
| Exploring before creating items |
✅ Yes |
❌ No |
| Multi-item refactor |
✅ Yes |
❌ No |
| Collecting code snippets across files |
✅ Yes |
❌ No |
| Shared context for collaboration |
✅ Yes |
❌ No |
| Single item scratch space |
❌ No |
✅ Yes |
| Item-specific deliverables |
❌ No |
✅ Yes |
| Version-controlled distillation |
✅ Yes (brief.generated.md) |
❌ No |
Best practice: Start exploration in a Topic, create work items as scope clarifies, then use Worksets for individual item execution.
Active topic and config overlays
- Active topic is per-agent:
_kano/backlog/.cache/worksets/active_topic.<agent>.txt
- When an agent has an active topic, config resolution includes topic overrides:
- Layer order: defaults → product → topic → workset → runtime
- Topic config:
_kano/backlog/topics/<topic>/config.toml
- Use for temporary overrides (e.g., switch
default_product during exploration)
- Get active topic:
python skills/kano-agent-backlog-skill/scripts/kano-backlog topic show --agent <id>
Materials buffer (Topic-specific)
- Reference-first snippet collection: Avoid large copy-paste; store file+line+hash+optional snapshot
- Snippet refs include:
file: relative path from workspace root
lines: [start, end] (1-based inclusive)
hash: sha256:... of content for staleness check
cached_text: optional snapshot (use --snapshot to include)
revision: git commit hash if available
Human decision materials vs. machine manifest
Dual-Readability Design: Every artifact checks against both human and agent readability:
- Human-Readable: High-level summaries, clear checklists, "manager-friendly" reports for rapid decision-making
- Agent-Readable: Structural precision, file paths, line numbers, explicit markers for action without hallucination
Implementation in Topics:
- Treat
manifest.json as machine-oriented metadata:
seed_items: UUID list for precise agent reference
snippet_refs: file+line+hash for deterministic loading
pinned_docs: absolute paths for unambiguous reference
- Keep
brief.generated.md deterministic and tool-owned (generated/overwritten by topic distill):
- Readable item titles (e.g., "KABSD-TSK-0042: Implement tokenizer adapter")
- If available, include item path and keep UID in a hidden HTML comment for deterministic mapping
- Materials index with items/docs/snippets sorted for repeatability
- Keep
brief.md human-oriented and stable (do not overwrite automatically):
- Context summary and key decisions
- Optional: include a human-friendly materials list (do not duplicate raw snippet text)
- Put human-facing decision support in
_kano/backlog/topics/<topic>/notes.md (and/or pinned docs), e.g.:
- Decision to make
- Options + trade-offs
- Evidence (ADR links, snippet refs, benchmark/log artifacts)
- Recommendation + follow-ups
- Staleness detection: Compare current file hash with stored hash to detect if code changed
- Distillation:
topic distill generates deterministic brief.generated.md with a repeatable materials index
END_OF_SKILL_SENTINEL
1---2name: kano-agent-backlog-skill-23description: Local-first backlog workflow. Use when planning work, creating/updating backlog items, writing ADRs, enforcing Ready gate, generating views, or maintaining derived indexes (SQLite/FTS/embeddings).4---56# Kano Agent Backlog Skill (local-first)78## Scope910Use this skill to:11- Plan new work by creating backlog items before code changes.12- Maintain hierarchy and relationships via `parent` links, as defined by the active process profile.13- Record decisions with ADRs and link them to items.14- Keep a durable, append-only worklog for project evolution.1516## Agent compatibility: read the whole skill1718- Always load the entire `SKILL.md` before acting; some agent shells only fetch the first ~100 lines by default.19- If your client truncates, fetch in chunks (e.g., lines 1-200, 200-400, …) until you see the footer marker `END_OF_SKILL_SENTINEL`.20- If you cannot confirm the footer marker, stop and ask for help; do not proceed with partial rules.21- When generating per-agent guides, preserve this read-all requirement so downstream agents stay in sync.2223## Non-negotiables2425- Planning before coding: create/update items and meet the Ready gate before making code changes.26- Worklog is append-only; never rewrite history.27- Update Worklog whenever:28 - a discussion produces a clear decision or direction,29 - an item state changes,30 - scope/approach changes,31 - or an ADR is created/linked.32- Archive by view: hide `Done`/`Dropped` items in views by default; do not move files unless explicitly requested.33- Backlog volume control:34 - Only create items for work that changes code or design decisions.35 - Avoid new items for exploratory discussion; record in existing Worklog instead.36 - Keep Tasks/Bugs sized for a single focused session.37 - Avoid ADRs unless a real architectural trade-off is made.38- Ticketing threshold (agent-decided):39 - Open a new Task/Bug when you will change code/docs/views/scripts.40 - Open an ADR (and link it) when a real trade-off or direction change is decided.41 - Otherwise, record the discussion in an existing Worklog; ask if unsure.42- Ticket type selection (keep it lightweight):43 - Epic: multi-release or multi-team milestone spanning multiple Features.44 - Feature: a new capability that delivers multiple UserStories.45 - UserStory: a single user-facing outcome that requires multiple Tasks.46 - Task: a single focused implementation or doc change (typically one session).47 - Example: "End-to-end embedding pipeline" = Epic; "Pluggable vector backend" = Feature; "MVP chunking pipeline" = UserStory; "Implement tokenizer adapter" = Task.48- Bug vs Task triage (when fixing behavior):49 - If you are correcting a behavior that was previously marked `Done` and the behavior violates the original intent/acceptance (defect or regression), open a **Bug** and link it to the original item.50 - If the change is a new requirement/scope change beyond the original acceptance, open a **Task/UserStory** (or Feature) instead, and link it for traceability.51- Bug origin tracing (when diagnosing a defect/regression):52 - Record **when the issue started** and the **evidence path** you used to determine it.53 - Prefer VCS-backed evidence when available:54 - last-known-good revision (commit hash or tag)55 - first-known-bad revision (commit hash or tag)56 - suspected introducing change(s) (commit hash) and why (e.g., `git blame` on specific lines)57 - If git history is unavailable (zip export, shallow clone, missing remote), explicitly record that limitation and what alternative evidence you used (e.g., release notes, timestamps, reproduction reports).58 - Keep evidence lightweight: record commit hashes + 1–2 line summaries; avoid pasting large diffs into Worklog. Attach artifacts when needed.59 - Suggested Worklog template:60 - `Bug origin: last_good=<sha|tag>, first_bad=<sha|tag>, suspect=<sha> (reason: blame <path>:<line>), evidence=<git log/blame/bisect|other>`61- State ownership: the agent decides when to move items to InProgress or Done; humans observe and can add context.62- State semantics: Proposed = needs discovery/confirmation; Planned = approved but not started; Ready gate applies before start.63- Hierarchy is in frontmatter links, not folder nesting; avoid moving files to reflect scope changes.64- Filenames stay stable; use ASCII slugs.65- Never include secrets in backlog files or logs.66- Language: backlog and documentation content must be English-only (no CJK), to keep parsing and cross-agent collaboration deterministic.67- Agent Identity: In Worklog and audit logs, use your own identity (e.g., `[agent=antigravity]`), never copy `[agent=codex]` blindly.68- Always provide an explicit `--agent` value for auditability (some commands currently default to `cli`, but do not rely on it).69- Model attribution (optional but preferred): provide `--model <name>` (or env `KANO_AGENT_MODEL` / `KANO_MODEL`) when it is known deterministically.70 - Do not guess model names; if unknown, omit the `[model=...]` segment.71- **Agent Identity Protocol**: Supply `--agent <ID>` with your real product name (e.g., `cursor`, `copilot`, `windsurf`, `antigravity`).72 - **Forbidden (Placeholders)**: `auto`, `user`, `assistant`, `<AGENT_NAME>`, `$AGENT_NAME`.73- File operations for backlog/skill artifacts must go through the `kano-backlog` CLI74 (`python skills/kano-agent-backlog-skill/scripts/kano-backlog <command>`) so audit logs capture the action.75- Skill scripts only operate on paths under `_kano/backlog/` or `_kano/backlog_sandbox/`;76 refuse other paths.77- After modifying backlog items, refresh the plain Markdown views immediately using78 `python skills/kano-agent-backlog-skill/scripts/kano-backlog view refresh --agent <agent-id> --backlog-root <path>` so the dashboards stay current.79 - Persona summaries/reports are available via `python skills/kano-agent-backlog-skill/scripts/kano-backlog admin persona summary|report ...`.80- `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem update-state ...` auto-syncs parent states forward-only by default; use `--no-sync-parent`81 for manual re-plans where parent state should stay put.82- Add Obsidian `[[wikilink]]` references in the body (e.g., a `## Links` section) so Graph/backlinks work; frontmatter alone does not create graph edges.8384## Agent compatibility: read the whole skill8586- Always load the entire `SKILL.md` before acting; some agent shells only fetch the first ~100 lines by default.87- If your client truncates, fetch in chunks (e.g., lines 1-200, 200-400, …) until you see the footer marker `END_OF_SKILL_SENTINEL`.88- If you cannot confirm the footer marker, stop and ask for help; do not proceed with partial rules.89- When generating per-agent guides, preserve this read-all requirement so downstream agents stay in sync.9091## First-run bootstrap (prereqs + initialization)9293Before using this skill in a repo, the agent must confirm:941) Python prerequisites are available (or install them), and952) the backlog scaffold exists for the target product/root.9697If the backlog structure is missing, propose the bootstrap commands and wait for user approval before writing files.9899### Developer vs user mode (where to declare it)100101- **Preferred source of truth**: product config in `_kano/backlog/products/<product>/_config/config.json`.102 - `mode.skill_developer`: `true` when this repo actively develops the skill itself (this demo repo).103 - `mode.persona`: optional string describing the primary human persona (e.g. `developer`, `pm`, `qa`), used only for human-facing summaries/views.104- **Secondary**: agent guide files (e.g., `AGENTS.md` / `CLAUDE.md`) can document expectations, but are agent-specific and not script-readable.105106### Skill developer gate (architecture compliance)107108**If `mode.skill_developer=true`**, before writing any skill code (in `scripts/` or `src/`), you **must**:1091. Read **ADR-0013** ("Codebase Architecture and Module Boundaries") in the product decisions folder.1102. Follow the folder rules defined in ADR-0013:111 - `scripts/` is **executable-only**: no reusable module code.112 - `src/` is **import-only**: core logic lives here, never executed directly.113 - All agent-callable operations go through `scripts/kano-backlog` CLI.1143. Place new code in the correct package:115 - Models/config/errors → `src/kano_backlog_core/`116 - Use-cases (create/update/view) → `src/kano_backlog_ops/`117 - Storage backends → `src/kano_backlog_adapters/`118 - CLI commands → `src/kano_backlog_cli/commands/`119120Violating these boundaries will be flagged in code review.121122### Prerequisite install (Python)123124Detect:125- Run `python skills/kano-agent-backlog-skill/scripts/kano-backlog doctor --format plain`.126127If packages are missing, install once (recommended):128- **Default**: `python -m pip install -e skills/kano-agent-backlog-skill`129- **Skill contributors**: `python -m pip install -e skills/kano-agent-backlog-skill[dev]`130- Optional heavy dependencies (FAISS, sentence-transformers) should be installed manually per platform requirements before running the CLI against embedding features.131132### Backlog initialization (file scaffold + config + dashboards)133134Detect (multi-product / platform layout):135- Product initialized if `_kano/backlog/products/<product>/_config/config.json` exists (or confirm via `python skills/kano-agent-backlog-skill/scripts/kano-backlog doctor --product <product>`).136137Bootstrap:138- Run `python skills/kano-agent-backlog-skill/scripts/kano-backlog admin init --product <product> --agent <agent-id> [--backlog-root <path>]` to scaffold `_kano/backlog/products/<product>/` (items/, decisions/, views/, `_config/`, `_meta/`, `_index/`).139- The init command derives a project prefix, writes `_config/config.json`, and refreshes dashboards so views exist immediately after initialization.140- Manual fallback (only if automation is unavailable): follow `_kano/backlog/README.md` to copy the template scaffold, then refresh views via `kano-backlog view refresh`.141142## Optional LLM analysis over deterministic reports143144This skill can optionally append an LLM-generated analysis to a deterministic report.145The deterministic report is the SSOT; analysis is treated as a derived artifact.146147- Deterministic report: `views/Report_<persona>.md`148- Derived LLM output: `views/_analysis/Report_<persona>_LLM.md` (gitignored by default)149- Deterministic prompt artifact: `views/_analysis/Report_<persona>_analysis_prompt.md`150151Enable by config (per product):152- `analysis.llm.enabled = true`153154Execution:155- The **default workflow** is: generate the deterministic report → use it as SSOT → fill in the analysis template.156 - The skill generates a deterministic prompt file to guide the analysis, and a derived markdown file with placeholder headings.157- Optional automation: when `analysis.llm.enabled = true` in config, view refresh generates `views/snapshots/_analysis/Report_<persona>_analysis_prompt.md` (deterministic prompt) and `Report_<persona>_LLM.md` (template or LLM output)158- Never pass API keys as CLI args; keep secrets in env vars to avoid leaking into audit logs.159160## ID prefix derivation161162- Source of truth:163 - Product config: `_kano/backlog/products/<product>/_config/config.toml` (`product.name`, `product.prefix`), or164 - Repo config (single-product): `_kano/backlog/_config/config.toml` (`product.name`, `product.prefix`).165- Derivation:166 - Split `product.name` on non-alphanumeric separators and camel-case boundaries.167 - Take the first letter of each segment.168 - If only one letter, take the first letter plus the next consonant (A/E/I/O/U skipped).169 - If still short, use the first two letters.170 - Uppercase the result.171- Example: `product.name=kano-agent-backlog-skill-demo` -> `KABSD`.172173## Recommended layout174175This skill supports both single-product and multi-product layouts:176177- Single-product (repo-level): `_kano/backlog/`178- Multi-product (monorepo): `_kano/backlog/products/<product>/`179180Within each backlog root:181- `_meta/` (schema, conventions)182- `items/<type>/<bucket>/` (work items)183- `decisions/` (ADR files)184- `views/` (dashboards / generated Markdown)185186## Item bucket folders (per 100)187188- Store items under `_kano/backlog/items/<type>/<bucket>/`.189- Bucket names use 4 digits for the lower bound of each 100 range.190 - Example: `0000`, `0100`, `0200`, `0300`, ...191- Example path:192 - `_kano/backlog/items/task/0000/KABSD-TSK-0007_define-secret-provider-validation.md`193194## Index/MOC files195196- For Epic, create an adjacent index file:197 - `<ID>_<slug>.index.md`198- Index files should render a tree using Dataview/DataviewJS and rely on `parent` links.199- Track epic index files in `_kano/backlog/_meta/indexes.md` (type, item_id, index_file, updated, notes).200201## References202203- Reference index: `REFERENCE.md`204- Schema and rules: `references/schema.md`205- Templates: `references/templates.md`206- Workflow SOP: `references/workflow.md`207- View patterns: `references/views.md`208- Obsidian Bases (plugin-free): `references/bases.md`209- Context Graph + Graph-assisted retrieval: `references/context_graph.md`210211If the backlog structure is missing, propose creation and wait for user approval before writing files.212213## Kano CLI entrypoints (current surface)214215`scripts/` exposes a single executable: `scripts/kano-backlog`. The CLI is intentionally organized as nested command groups so agents can discover operations via `--help` on-demand (instead of hard-coding the full command surface into this skill).216217### Help-driven discovery (preferred)218219Run these in order, expanding only what you need:220221- `python skills/kano-agent-backlog-skill/scripts/kano-backlog --help`222 - Shows top-level groups (e.g., `backlog`, `item`, `state`, `worklog`, `view`) and global options.223- `python skills/kano-agent-backlog-skill/scripts/kano-backlog <group> --help`224 - Shows subcommands for that group.225- `python skills/kano-agent-backlog-skill/scripts/kano-backlog <group> <command> --help`226 - Shows required args/options for that command.227228Guideline: do not paste large `--help` output into chat; inspect it locally and run the command.229230### Canonical examples (keep these few memorized)231232- Bootstrap:233 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog doctor --format plain`234 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog admin init --product <name> --agent <id>`235- Daily workflow:236 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem create --type task --title "..." --agent <id> --product <name>`237 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem set-ready <item-id> --context "..." --goal "..." --approach "..." --acceptance-criteria "..." --risks "..." --product <name>`238 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem validate <item-id> --product <name>`239 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem update-state <item-ref> --state InProgress --agent <id> --message "..." --product <name>`240 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem attach-artifact <item-id> --path <file> --shared --agent <id> --product <name> [--note "..."]`241 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog view refresh --agent <id> --product <name>`242- Backlog integrity checks:243 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog admin validate uids --product <name>`244245## Conflict handling policy (configurable)246247Use product config to control how duplicate IDs and UIDs are handled by maintenance commands248such as `admin links normalize-ids`.249250- Config keys (product `_config/config.toml`):251 - `conflict_policy.id_conflict`: default `rename` (rename duplicate IDs).252 - `conflict_policy.uid_conflict`: default `trash_shorter` (move shorter duplicate content to `_trash/`).253- `trash_shorter` uses `_trash/<YYYYMMDD>/...` under the product root; items get a Worklog entry.254255### Sandbox workflow (isolated experimentation)256257For testing, prototyping, or demos without affecting production backlog:258- Create: `python skills/kano-agent-backlog-skill/scripts/kano-backlog admin sandbox init <sandbox-name> --product <source-product> --agent <id>`259- Use: `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem create --product <sandbox-name> ...` (same CLI, different product)260- Cleanup: `rm -rf _kano/backlog_sandbox/<sandbox-name>` (git will ignore this directory)261- Rationale: Sandboxes mirror production structure but live in `_kano/backlog_sandbox/`, so changes never leak into `_kano/backlog/`.262263## Artifacts policy (local-first)264265- Storage locations:266 - Shared across products: `_kano/backlog/_shared/artifacts/<ITEM_ID>/` (use `--shared`).267 - Product-local: `_kano/backlog/products/<product>/artifacts/<ITEM_ID>/` (use `--no-shared`).268- Usage:269 - Attach via `workitem attach-artifact` — copies the file and appends a Worklog link.270 - Prefer lightweight, text-first artifacts (Markdown, Mermaid, small images). Use Git LFS for large binaries if needed.271- Git policy:272 - Commit human-readable artifacts that aid review. Avoid committing generated binaries unless justified.273 - Sandboxes under `_kano/backlog_sandbox/` are gitignored; artifacts there are ephemeral.274 - For derived analysis, store under `views/_analysis/` (gitignored by default), and keep deterministic reports in `views/`.275- Linking:276 - The CLI appends a Markdown link relative to the item file. Optionally add a `## Links` section for richer context.277278## State update helper279280- Use `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem update-state ...` to update state + append Worklog.281- Prefer `--action` on `kano-backlog state transition` for the common transitions (`start`, `ready`, `review`, `done`, `block`, `drop`).282- Use `python skills/kano-agent-backlog-skill/scripts/kano-backlog workitem validate <item-id>` to check the Ready gate explicitly.283284## Topic and Workset workflow (context management)285286### When to use Topics287288**Topics** are shareable context buffers for multi-step work that spans multiple work items or requires exploratory research before creating formal backlog items.289290Use Topics when:291- Exploring a complex problem that may result in multiple work items292- Collecting code snippets, logs, and materials across multiple sessions293- Collaborating across agents/sessions with a shared context294- Refactoring work that requires tracking multiple code locations295296**Topic lifecycle**:2971. **Create**: `python skills/kano-agent-backlog-skill/scripts/kano-backlog topic create <topic-name> --agent <id>`298 - Creates `_kano/backlog/topics/<topic>/` with `manifest.json`, `brief.md`, `brief.generated.md`, `notes.md`, and `materials/` subdirectories2992. **Collect materials**:300 - Add items: `topic add <topic-name> --item <ITEM_ID>`301 - Add code snippets: `topic add-snippet <topic-name> --file <path> --start <line> --end <line> --agent <id>`302 - Pin docs: `topic pin <topic-name> --doc <path>`3033. **Distill**: `python skills/kano-agent-backlog-skill/scripts/kano-backlog topic distill <topic-name>`304 - Generates/overwrites deterministic `brief.generated.md` from collected materials305 - `brief.md` is a stable, human-maintained brief (do not overwrite it automatically)3064. **Switch context**: `python skills/kano-agent-backlog-skill/scripts/kano-backlog topic switch <topic-name> --agent <id>`307 - Sets active topic (affects config overlays and workset behavior)3085. **Close**: `python skills/kano-agent-backlog-skill/scripts/kano-backlog topic close <topic-name> --agent <id>`309 - Marks topic as closed; eligible for TTL cleanup3106. **Cleanup**: `python skills/kano-agent-backlog-skill/scripts/kano-backlog topic cleanup --ttl-days <N> [--dry-run]`311 - Removes raw materials from closed topics older than TTL312313**Topic snapshots (retention policy)**:314- Snapshots are intended for **milestone checkpoints** (pre-merge/split/restore, risky bulk edits), not every small edit.315- To prevent noise, keep only the **latest snapshot per topic** in this demo repo.316- After creating a snapshot (or periodically), prune all but the newest snapshot:317 - `python skills/kano-agent-backlog-skill/scripts/kano-backlog topic snapshot cleanup <topic-name> --ttl-days 0 --keep-latest 1 --apply`318319**Topic structure**:320```321_kano/backlog/topics/<topic>/322 manifest.json # refs to items/docs/snippets, status, timestamps323 brief.md # stable, human-maintained brief (do not overwrite automatically)324 brief.generated.md # deterministic distilled brief (generated/overwritten by `topic distill`)325 notes.md # freeform notes (backward compat)326 materials/ # raw collection (gitignored by default)327 clips/ # code snippet refs + cached text328 links/ # urls / notes329 extracts/ # extracted paragraphs330 logs/ # build logs / command outputs331 synthesis/ # intermediate drafts332 publish/ # prepared write-backs (patches/ADRs)333 config.toml # optional topic-specific config overrides334```335336### When to use Worksets337338**Worksets** are per-item working directories (cached, derived data) for a single backlog item.339340Use Worksets when:341- Starting work on a specific Task/Bug/UserStory342- Need scratch space for deliverables (patches, test artifacts, etc.)343- Want item-specific config overrides (rare)344345**Workset lifecycle**:3461. **Initialize**: `python skills/kano-agent-backlog-skill/scripts/kano-backlog workset init <ITEM_ID> --agent <id> [--ttl-hours <N>]`347 - Creates `_kano/backlog/.cache/worksets/items/<ITEM_ID>/` with `meta.json`, `plan.md`, `notes.md`, `deliverables/`3482. **Work**: Store scratch files in `deliverables/` (patches, test outputs, etc.)3493. **Refresh**: `python skills/kano-agent-backlog-skill/scripts/kano-backlog workset refresh <ITEM_ID> --agent <id>`350 - Updates `refreshed_at` timestamp3514. **Cleanup**: `python skills/kano-agent-backlog-skill/scripts/kano-backlog workset cleanup --ttl-hours <N> [--dry-run]`352 - Removes stale worksets older than TTL353354**Workset structure**:355```356_kano/backlog/.cache/worksets/items/<ITEM_ID>/357 meta.json # workset metadata (item_id, agent, timestamps, ttl)358 plan.md # execution plan template359 notes.md # work notes with Decision: marker guidance360 deliverables/ # scratch outputs (patches, logs, test artifacts)361 config.toml # optional item-specific config overrides362```363364### Topic vs Workset decision guide365366| Scenario | Use Topic | Use Workset |367|----------|-----------|-------------|368| Exploring before creating items | ✅ Yes | ❌ No |369| Multi-item refactor | ✅ Yes | ❌ No |370| Collecting code snippets across files | ✅ Yes | ❌ No |371| Shared context for collaboration | ✅ Yes | ❌ No |372| Single item scratch space | ❌ No | ✅ Yes |373| Item-specific deliverables | ❌ No | ✅ Yes |374| Version-controlled distillation | ✅ Yes (brief.generated.md) | ❌ No |375376**Best practice**: Start exploration in a Topic, create work items as scope clarifies, then use Worksets for individual item execution.377378### Active topic and config overlays379380- Active topic is per-agent: `_kano/backlog/.cache/worksets/active_topic.<agent>.txt`381- When an agent has an active topic, config resolution includes topic overrides:382 - Layer order: defaults → product → **topic** → workset → runtime383 - Topic config: `_kano/backlog/topics/<topic>/config.toml`384 - Use for temporary overrides (e.g., switch `default_product` during exploration)385- Get active topic: `python skills/kano-agent-backlog-skill/scripts/kano-backlog topic show --agent <id>`386387### Materials buffer (Topic-specific)388389- **Reference-first snippet collection**: Avoid large copy-paste; store file+line+hash+optional snapshot390- **Snippet refs** include:391 - `file`: relative path from workspace root392 - `lines`: `[start, end]` (1-based inclusive)393 - `hash`: `sha256:...` of content for staleness check394 - `cached_text`: optional snapshot (use `--snapshot` to include)395 - `revision`: git commit hash if available396397### Human decision materials vs. machine manifest398399**Dual-Readability Design**: Every artifact checks against both human and agent readability:400- **Human-Readable**: High-level summaries, clear checklists, "manager-friendly" reports for rapid decision-making401- **Agent-Readable**: Structural precision, file paths, line numbers, explicit markers for action without hallucination402403**Implementation in Topics**:404- Treat `manifest.json` as **machine-oriented** metadata:405 - `seed_items`: UUID list for precise agent reference406 - `snippet_refs`: file+line+hash for deterministic loading407 - `pinned_docs`: absolute paths for unambiguous reference408- Keep `brief.generated.md` **deterministic** and **tool-owned** (generated/overwritten by `topic distill`):409 - Readable item titles (e.g., "KABSD-TSK-0042: Implement tokenizer adapter")410 - If available, include item path and keep UID in a hidden HTML comment for deterministic mapping411 - Materials index with items/docs/snippets sorted for repeatability412- Keep `brief.md` **human-oriented** and **stable** (do not overwrite automatically):413 - Context summary and key decisions414 - Optional: include a human-friendly materials list (do not duplicate raw snippet text)415- Put human-facing decision support in `_kano/backlog/topics/<topic>/notes.md` (and/or pinned docs), e.g.:416 - Decision to make417 - Options + trade-offs418 - Evidence (ADR links, snippet refs, benchmark/log artifacts)419 - Recommendation + follow-ups420- **Staleness detection**: Compare current file hash with stored hash to detect if code changed421- **Distillation**: `topic distill` generates deterministic `brief.generated.md` with a repeatable materials index422423---424END_OF_SKILL_SENTINEL425