Skip to content

[FEATURE] Post-completion memory proposal — auto-extract patterns for human approval #186

@JoshLuedeman

Description

@JoshLuedeman

Problem It Solves

Closes gap: #173

Memory is never automatically populated. teamwork complete marks a workflow done and writes metrics, but extracts nothing from the completed workflow for future use. Patterns, decisions, and anti-patterns are lost unless a human manually runs teamwork memory add.

Proposed Behavior

teamwork complete <workflow-id> gains an optional (default: on) post-completion analysis step:

$ teamwork complete wf-042

✓ Workflow wf-042 marked complete.

Analyzing completed workflow for memory candidates...

Proposed memory additions (review and accept/edit/reject each):

[1/3] PATTERN — domain: auth
  "RS256 JWT with sub-claims for roles: validate aud and iss on every request"
  Source: Step 2 (Architect) handoff, confirmed in Step 6 (Reviewer) handoff
  > Accept (a), Edit (e), Reject (r), Skip all (s): a

[2/3] ANTIPATTERN — domain: logging
  "Never log Authorization headers or request bodies containing tokens"
  Source: Step 3 (Security Auditor) finding SA-002
  > Accept (a), Edit (e), Reject (r), Skip all (s): e
  Edit: "Never log Authorization headers or request bodies — they may contain tokens or PII"
  > a

[3/3] DECISION — domain: api
  "Auth errors return 401 with WWW-Authenticate header per RFC 7235"
  Source: Step 2 (Architect) handoff, ADR-012
  > Accept (a), Edit (e), Reject (r), Skip all (s): r

2 entries added to .teamwork/memory/ and committed.

The extraction reads all handoffs for the workflow, identifies: architectural decisions (from Architect/Planner handoffs), security findings (from Security Auditor handoffs), reviewer-flagged patterns (from Reviewer handoffs), and resolved blockers (from state file block records). It proposes them as typed memory entries. Human reviews and approves before anything is written.

--no-memory flag skips the proposal for scripted/CI usage.

Dependencies

Complexity Estimate

Large — 6 files: handoff section extractor, memory proposal engine, interactive TUI prompt (extends internal/tui/tui.go), teamwork complete command integration, duplicate detection, tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfeature-requestA new capability proposed through forward-looking design or gap analysis

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions