AgentSkillsCN

backlog

使用 backlog.md CLI 工具管理 QualCoder v2 任务。按照 DDD 架构与“以代理为先”的约定,创建、编辑并优化任务。 **适用场景:** - 为 QualCoder v2 创建新任务或新功能 - 按照 DDD 层级(领域 → 基础设施 → 应用 → 表现层)拆分功能模块 - 编辑或优化现有任务 - 管理任务状态与优先级 **功能亮点:** - 提供任务管理的 CLI 命令 - 支持以有界上下文与层级为基础的任务结构 - 遵循“以代理为先”的任务约定(MCP 工具模式与领域模型并行) - 提供 QualCoder 特定的标签与有界上下文

SKILL.md
--- frontmatter
name: backlog
description: |
  Manage QualCoder v2 tasks using the backlog.md CLI tool. Create, edit, and refine
  tasks following DDD architecture and agent-first conventions.

  **Invoke when:**
  - Creating new tasks or features for QualCoder v2
  - Breaking down features by DDD layer (Domain → Infrastructure → Application → Presentation)
  - Editing or refining existing tasks
  - Managing task status and priorities

  **Provides:**
  - CLI commands for task management
  - DDD-aware task structure (by bounded context and layer)
  - Agent-first task conventions (MCP tool schemas alongside domain)
  - QualCoder-specific labels and bounded contexts

QualCoder v2 Backlog Management

Manage QualCoder v2 tasks using the backlog CLI tool. Tasks follow DDD architecture with agent-first design.

Project Configuration

yaml
task_prefix: qc              # Tasks are qc-001, qc-002, etc.
zero_padded_ids: 3           # qc-001, not qc-1

Quick Start

bash
# List all tasks
backlog task list --plain

# Create a task (always include layer and bounded context)
backlog task create "Coding Domain" -d "Define domain entities" -l domain,coding,P0

# View task details
backlog task qc-004 --plain

# Edit task status
backlog task edit qc-004 -s "In Progress"

# Create subtask
backlog task create -p qc-004 "Unit Tests"

Directory Structure

code
backlog/
├── config.yml                # Project config (labels, bounded contexts)
├── milestones/               # Epics by bounded context (m-001, m-002...)
│   ├── m-001 - Foundation.md
│   ├── m-002 - Coding-Context.md
│   ├── m-003 - Source-Management.md
│   └── ...
├── tasks/                    # Tasks (qc-NNN - Title.md)
├── completed/                # Archived completed tasks
└── decisions/                # Architecture Decision Records

Bounded Contexts

QualCoder v2 is organized into bounded contexts. Always tag tasks with the appropriate context:

ContextLabelDescription
CodingcodingCore: applying codes to text/image/AV/PDF segments
SourcessourcesFile import and media management
CasescasesParticipant/case groupings and attributes
JournalsjournalsResearch memos, field notes, reflections
AnalysisanalysisReports, visualizations, exports
AI Assistantai-assistantAI chat, semantic search, code suggestions
CollaborationcollaborationMulti-coder workflows, inter-rater reliability
ProjectsprojectsProject-level operations

Architecture Layers

Tasks are organized by DDD layer. Create tasks in dependency order:

LayerLabelDepends OnContains
DomaindomainShared typesEntities, events, invariants, derivers, agent schemas
InfrastructureinfrastructureDomainRepositories, persistence, external services
ApplicationapplicationInfrastructureUse cases, command handlers
PresentationpresentationApplicationPyQt6 widgets, screens
Design Systemdesign-systemTokens, components, patterns

Task creation order per bounded context:

  1. qc-XXX Domain (entities, events, derivers, agent tool schemas)
  2. qc-XXX Infrastructure (repositories, persistence)
  3. qc-XXX Application (use cases)
  4. qc-XXX Presentation (UI widgets)

Agent-First Design

IMPORTANT: MCP tool schemas are defined alongside domain entities, not as an afterthought.

Every domain task should include:

  • Agent tool schemas (create_X, get_X, list_X, update_X, delete_X)
  • Tool input/output types
  • Permission requirements (trust levels)
python
# Domain task includes agent schemas
src/domain/coding/entities.py      # Entities
src/agent_context/schemas/coding_tools.py  # Agent tools for this context

CLI Commands

ActionCommand
Create taskbacklog task create "Title" -d "Desc" -l domain,coding,P0
Create subtaskbacklog task create -p qc-004 "Subtask title"
List tasksbacklog task list --plain
List by statusbacklog task list -s "In Progress" --plain
List by labelbacklog task list -l coding --plain
View taskbacklog task qc-004 --plain
Edit statusbacklog task edit qc-004 -s "Done"
Add labelbacklog task edit qc-004 -l agent-tools
Archivebacklog task archive qc-004

Always use --plain flag for AI-friendly output.


Labels Reference

Architecture Layers

domain, application, infrastructure, presentation, design-system

Bounded Contexts

coding, sources, cases, journals, analysis, ai-assistant, collaboration, projects

Media Types

text-coding, image-coding, av-coding, pdf-coding

Feature Types

feature, enhancement, bug, refactor, documentation, testing, security

AI/Agent

agent-tools, agent-ui, trust-level

Priority

P0 (critical), P1 (high), P2 (medium), P3 (low)


Task Format

markdown
---
id: QC-004
title: Coding Domain
status: To Do
milestone: M-002
layer: Domain
created_date: '2026-01-29'
labels: [domain, coding, agent-tools, P0]
dependencies: [QC-001]
---

## Description

Define the domain layer for the Coding bounded context: entities, events, invariants, derivers, and agent tool schemas.

**Agent-First:** MCP tool schemas are defined alongside domain entities.

## Acceptance Criteria

- [ ] Entities: Code, Category, TextSegment, ImageSegment, AVSegment
- [ ] Value objects: Color, TextPosition, ImageRegion, TimeRange
- [ ] Domain events (CodeCreated, CodeApplied, etc.)
- [ ] Invariants (business rule predicates)
- [ ] Derivers (pure functions → Result[Event, Failure])
- [ ] Agent tool schemas (create_code, apply_code, list_codes, etc.)

## Subtasks

| ID | Subtask | Status |
|----|---------|--------|
| QC-004.1 | Entities & Value Objects | To Do |
| QC-004.2 | Domain Events | To Do |
| QC-004.3 | Agent Tool Schemas | To Do |
| QC-004.4 | Unit Tests | To Do |

## Implementation

- `src/domain/coding/entities.py`
- `src/domain/coding/events.py`
- `src/domain/coding/derivers.py`
- `src/agent_context/schemas/coding_tools.py`

Task Breakdown Strategy

Per Bounded Context Pattern

For each bounded context (coding, sources, cases, etc.), create tasks in this order:

  1. Domain Task - Entities, events, derivers, agent schemas
  2. Infrastructure Task - Repositories, persistence adapters
  3. Application Task - Use cases, command handlers
  4. Presentation Task - PyQt6 widgets and screens

Example: Coding Context (M-002)

code
QC-004 Coding Domain        → entities, events, agent schemas
QC-005 Coding Infrastructure → repositories, SQLite adapters
QC-006 Coding Application   → use cases (apply_code, remove_code)
QC-007 Coding Presentation  → CodeTreeWidget, CodingPanel

Dependencies

  • Domain depends on Shared Types (QC-001)
  • Infrastructure depends on Domain
  • Application depends on Infrastructure
  • Presentation depends on Application

Quality Checks

Before finalizing task creation:

  • Layer label is set (domain/infrastructure/application/presentation)
  • Bounded context label is set (coding/sources/cases/etc.)
  • Priority is set (P0/P1/P2/P3)
  • Dependencies reference only existing tasks
  • Agent tool schemas included for domain tasks
  • Implementation paths follow src/{layer}/{context}/ structure

Milestones Reference

IDNameDescription
M-001FoundationShared types, design system, app shell
M-002Coding ContextCode tree, text/image/AV/PDF coding
M-003Source ManagementFile import, media handling
M-004Case ManagementCases, attributes, linking
M-005AnalysisReports, visualizations, exports
M-006Agent ContextAI chat, semantic search, suggestions
M-007CollaborationMulti-coder, inter-rater reliability

File Structure Convention

code
src/
├── domain/
│   ├── shared/              # QC-001: Shared types
│   ├── coding/              # QC-004: Coding domain
│   ├── sources/             # QC-008: Source domain
│   └── ...
├── infrastructure/
│   ├── coding/              # QC-005: Coding infra
│   └── ...
├── application/
│   ├── coding/              # QC-006: Coding use cases
│   └── ...
├── presentation/
│   ├── coding/              # QC-007: Coding UI
│   └── ...
└── agent_context/
    └── schemas/             # Agent tool schemas (all contexts)

Tips for AI Agents

  • Always use --plain flag for list/view commands
  • Include both layer AND bounded context labels
  • For domain tasks, always include agent tool schemas
  • Follow the layer dependency order: Domain → Infra → App → UI
  • Use subtask tables for complex tasks
  • Reference implementation paths in the Implementation section