Skip to content

session-aggregate: cross-workspace pattern mining skill #16

Description

@bacleclement

Part of the feedback-loop v2 epic.

Problem

Individual session reviews and revision records live in isolation. Each workspace gets its own {key}-review.md and {key}-summary.md, but patterns only emerge when you look across many workspaces.

Examples of patterns only visible at the aggregate level:

  • "70% of post-QA defects in the last month were bad acceptance criteria — the refine skill is missing an edge-case check"
  • "All bad architecture revisions happened in the network scope — its AGENT.md is stale (last updated 6 weeks ago)"
  • "The tdd skill produced feedback corrections 4 times in 2 weeks, always about missing failure cases — skill gap"
  • "Recurring capture-rule entries about readonly props across 5 different features — propose promoting to code-standards.md"

Today these signals are invisible. You'd have to manually read 20 review files and mentally diff them.

Proposed skill: session-aggregate

Runs on accumulated summaries and revision records, detects recurring patterns, proposes rules via capture-rule.

Inputs

  • A set of {key}-summary.md files (produced by child B's session-summarize)
  • A set of revisions/{timestamp}/ folders (produced by child A's revise)
  • Scope filter: all workspaces / one app scope / one time window / one skill
  • Minimum pattern size: e.g. "report patterns that occur in at least 3 workspaces"

Logic

LLM-driven pattern detection. The prompt asks the model to:

  1. Recurring corrections — same rule captured multiple times across features
  2. Recurring debug patterns — same type of bug found repeatedly
  3. Recurring friction points — same skill failing, same manual step taken
  4. Stale context indicators — references to patterns that no longer exist in the codebase
  5. Skill gaps — operations users keep doing by hand
  6. Classification hotspots — which revise classification dominates (bad spec? bad arch? bad tests?)

For each pattern:

  • Category (one of 6 above)
  • Evidence (which workspaces, which timestamps, which classifications)
  • Recommended action (capture-rule target: code-standards.md, product.md, scope AGENT.md, or specific kitt skill)
  • Confidence score

Output

~/.claude/workspace/aggregates/{timestamp}-patterns.md with:

  • Summary of scope and time window analyzed
  • Ordered list of detected patterns with evidence
  • Proposed rules ready to be captured via capture-rule

User reviews the output, approves patterns one by one, each approval invokes capture-rule against the suggested target.

Trigger

  • Manual: /session-aggregate with optional scope/time arguments
  • Future automation: a cron-based call once a week to propose patterns for review (not in this ticket)

Depends on

  • Child A (revise) — needs a few weeks of revision data to mine
  • Child B (refactor) — needs session-summarize output to consume

Does NOT depend on

  • Multi-user aggregation (not in scope, solo first)
  • Cloud storage (local filesystem only)
  • Studio UI (Studio will read these files later)

Files to change

  • ~/.claude/kitt/.claude/skills/session-aggregate/SKILL.md (new)

Acceptance criteria

  • /session-aggregate is callable with optional scope and time filters
  • Produces a timestamped aggregates/{timestamp}-patterns.md file
  • Each detected pattern has category, evidence, recommended action, confidence
  • User can approve patterns one by one; approvals flow through capture-rule
  • Works on an empty dataset (gracefully reports "not enough data")
  • Respects minimum pattern size threshold to avoid noise

Estimate

~1-1.5 days solo. The skill is mostly a prompt + a file loop + delegation to capture-rule.

Ship condition

Only ship after child A has been running for at least 3 weeks in real use — otherwise there's nothing to aggregate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    batch-dRoadmapenhancementNew feature or requestskillSkill improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions