From tdk-retro
Create or update retrospective feedback after a TDK spec: reviews, phase drift, UT results, Langfuse traces when available, and user feedback. Writes retro-feedback.md and supports adding or removing user feedback entries across repeated collection runs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tdk-retro:tdk-retro-collectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
If any required TDK script exits non-zero, stop and show the exact error. The only allowed fallback is the local example fixture path `.specify/examples/specs/{task-id}` when it exists.
If any required TDK script exits non-zero, stop and show the exact error. The only allowed fallback is the local example fixture path .specify/examples/specs/{task-id} when it exists.
Collect evidence-backed signals after a spec implementation. This skill creates or updates retro-feedback.md; it does not propose or apply changes.
../_shared/retro-feedback-schema.md../_shared/consumer-skill-discovery.md../_shared/script-command-contract.mdreferences/phase-drift-detection.mdreferences/langfuse-trace-analysis.mdParse $ARGUMENTS as TASK_ID.
Run the prerequisite check using the shared script command contract:
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-${GITHUB_WORKSPACE:-$(git rev-parse --show-toplevel 2>/dev/null)}}"
if [ -z "$PROJECT_DIR" ]; then
echo "Cannot resolve project root. Run from a git workspace or set CLAUDE_PROJECT_DIR/GITHUB_WORKSPACE."
exit 1
fi
(cd "$PROJECT_DIR/.specify/scripts/ts" && bun src/commands/util/check-prerequisites.ts {task_id} --json)
Store FEATURE_DIR from the JSON output.
Fixture fallback: if the script fails and $PROJECT_DIR/.specify/examples/specs/{TASK_ID}/plan.md exists, use that path as FEATURE_DIR and mark the run as example-fixture.
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-${GITHUB_WORKSPACE:-$(git rev-parse --show-toplevel 2>/dev/null)}}"
if [ -z "$PROJECT_DIR" ]; then
echo "Cannot resolve project root. Run from a git workspace or set CLAUDE_PROJECT_DIR/GITHUB_WORKSPACE."
exit 1
fi
(cd "$PROJECT_DIR/.specify/scripts/ts" && bun src/commands/util/parse-phases-table.ts "{FEATURE_DIR}/plan.md" --json)
If parsing fails, stop. Phase drift detection depends on the canonical ## Phases table.
Read review files from:
{FEATURE_DIR}/reviews/*.md
{FEATURE_DIR}/review-reports/*.md
If neither directory exists, record Status: skipped for reviews with reason no review files found.
Extract findings semantically. Do not use regex-only parsing for markdown prose.
Follow references/phase-drift-detection.md.
Read plan.md and every phase file from the parsed phases table. Compare plan intent against phase content and status. Ask the user:
Did any phase change approach, scope, or implementation strategy during execution?
Record only confirmed or evidence-backed drift.
Read {FEATURE_DIR}/ut/plan.md when it exists. Summarize pass/fail rows, incomplete phases, and repeated test issues.
If missing, record Status: skipped for UT execution with reason ut/plan.md not found.
Follow references/langfuse-trace-analysis.md.
Guard order:
which langfuse missing -> record skipped reason.{FEATURE_DIR}/sessions.txt missing or empty -> record skipped reason.$PROJECT_DIR/.env missing -> record skipped reason.Run Langfuse from project root so --env .env resolves correctly:
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-${GITHUB_WORKSPACE:-$(git rev-parse --show-toplevel 2>/dev/null)}}"
(cd "$PROJECT_DIR" && langfuse --env .env api traces list --session-id "{session_id}")
Analyze recurring errors, token waste, and tool misuse. Keep only evidence-backed findings.
If {FEATURE_DIR}/retro-feedback.md exists, read it before asking for user feedback.
Use modes:
create: file does not exist; write all sections fresh.update: file exists; refresh collected source sections from this run and preserve active user feedback unless the user explicitly removes it.For legacy user feedback bullets without IDs, assign sequential IDs before writing, starting at the next available UF-###.
Use AskUserQuestion:
RetroAny recurring mistake, missed context, or workflow friction from this spec that should be captured?Add feedback - Include the user's feedback in retro-feedback.md.Remove feedback - Mark existing user feedback entries as removed.No change - Keep current user feedback as-is.Rules:
create mode, offer only Add feedback and No change unless existing fixture content already has active feedback.UF-### ID, status: active, severity, timestamp, and evidence user answer.status: removed with removed_at and optional removal_reason.Write {FEATURE_DIR}/retro-feedback.md using ../_shared/retro-feedback-schema.md.
Required source sections:
Report:
FEATURE_DIR/tdk-retro-propose {TASK_ID}Searches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.
npx claudepluginhub vinhltt/tdk --plugin tdk-retro