tpmjs/packages/tools/official/postmortem-action-extractor
Ajax Davis 5d2096fb5d feat: add 100+ official TPMJS tools
Implements a comprehensive suite of AI SDK v6 tools across multiple categories:

- Research (5): page-brief, compare-pages, source-credibility, claim-checklist, timeline-from-text
- Web (10): fetch-text, links-catalog, extract-meta, extract-json-ld, redirect-trace, sitemap-read, rss-read, table-extract, robots-policy, url-normalize
- Data (15): csv-parse, csv-stringify, json-repair, json-schema-validate, yaml-parse, yaml-stringify, text-chunk, normalize-whitespace, dedupe-by-key, pivot, rows-filter, rows-sort, rows-group-aggregate, rows-join, schema-infer
- Doc (12): toc-generate, glossary-build, faq-from-text, executive-brief, decision-record-adr, prd-outline, acceptance-criteria, style-rewrite
- Eng (12): diff-text-unified, env-var-docs-generate, dependency-audit-lite, conventional-commit-suggest, markdown-lint-basic, test-case-generate, stacktrace-parse, release-notes, changelog-entry, release-checklist
- Security (7): redact-secrets, secret-scan-text, url-risk-heuristic, csp-compose, hardening-checklist-web, access-control-matrix, data-classification-heuristic
- Stats (9): effect-size-suite, bootstrap-ci, permutation-test, multiple-testing-adjust, linear-regression-ols, logistic-regression, time-series-decompose-lite, anomaly-detect-mad
- Ops (7): slo-draft, runbook-draft, postmortem-draft, postmortem-action-extractor, error-log-triage, coverage-tracker, monitoring-gap-analysis
- Agent (15): prompt-to-workflow-skeleton, workflow-validate-io, workflow-explain, workflow-cost-estimate, tool-call-accuracy-score, eval-fixture-build, guardrail-policy-draft, workflow-auto-repair, tool-selection-plan, novelty-score-workflow, workflow-variant-generate, config-normalize, recipe-*
- Utility (8): base64-encode, base64-decode, hash-text, regex-extract, template-render, date-parse, json-path-query, url-parse
- HTML (3): html-sanitize, html-to-markdown, markdown-to-html

All tools follow AI SDK v6 pattern with tool() and jsonSchema<T>().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-31 22:55:56 +10:00
..
src feat: add 100+ official TPMJS tools 2025-12-31 22:55:56 +10:00
package.json feat: add 100+ official TPMJS tools 2025-12-31 22:55:56 +10:00
README.md feat: add 100+ official TPMJS tools 2025-12-31 22:55:56 +10:00
tsconfig.json feat: add 100+ official TPMJS tools 2025-12-31 22:55:56 +10:00
tsup.config.ts feat: add 100+ official TPMJS tools 2025-12-31 22:55:56 +10:00

@tpmjs/tools-postmortem-action-extractor

Extract action items from postmortem and incident review documents with automatic detection of owners, priorities, and due dates.

Installation

npm install @tpmjs/tools-postmortem-action-extractor

Usage

import { postmortemActionExtractorTool } from '@tpmjs/tools-postmortem-action-extractor';

const postmortemText = `
## Incident Summary
Database outage on 2024-01-15 from 14:00 to 14:45 UTC

## Actions

- Add monitoring for connection pool exhaustion (@john) [P0] due: 2024-01-20
- Update runbook with connection reset procedure (@sarah) [P1]
- Review and increase connection pool limits (devops team) [P2] within 7 days
- Schedule architecture review to discuss scaling strategy

## Follow-up
TODO: Document the incident in knowledge base (@mike)
`;

const result = await postmortemActionExtractorTool.execute({
  text: postmortemText
});

console.log(result.actions);
// [
//   {
//     action: "Add monitoring for connection pool exhaustion",
//     owner: "john",
//     priority: "high",
//     dueDate: "2024-01-20",
//     context: "Actions"
//   },
//   ...
// ]
console.log(result.count); // 5

Input

  • text (string, required): Postmortem or incident review text to analyze

Output

Returns an object with:

  • actions (array): Array of extracted action items, each containing:
    • action (string): The action item text (cleaned)
    • owner (string, optional): Person assigned to the action
    • priority (string, optional): 'high', 'medium', or 'low'
    • dueDate (string, optional): Due date in YYYY-MM-DD format
    • context (string, optional): Section header where action was found
  • count (number): Total number of actions extracted
  • metadata (object):
    • extractedAt: ISO timestamp of extraction
    • textLength: Length of input text
    • hasOwners: Number of actions with assigned owners
    • hasPriorities: Number of actions with priorities
    • hasDueDates: Number of actions with due dates

Detected Patterns

Action Items

  • Action:, TODO:, Follow-up:, Next step:
  • [action], [todo], [follow-up]
  • Bullet points in "Actions" or "Action Items" sections
  • Phrases like "we should", "we need to", "team must"

Owners

  • (@username) or @username
  • assigned to username
  • owner: username
  • [owner: username]

Priorities

  • [P0], [P1], [P2], [P3] (high, high, medium, low)
  • priority: high/medium/low
  • Emoji indicators: 🔴 (high), ⚠️ (high)
  • Keywords: critical, urgent (high)

Due Dates

  • due: 2024-01-20
  • by 2024-01-20
  • [due: 2024-01-20]
  • deadline: 2024-01-20
  • Relative: within 3 days, in 2 weeks (converted to absolute dates)

Features

  • Multiple Detection Strategies: Finds actions in both structured sections and inline throughout the document
  • Automatic Deduplication: Removes duplicate action items
  • Priority Sorting: Actions are sorted by priority (high → medium → low → none)
  • Flexible Formats: Supports various postmortem formats and styles
  • Context Preservation: Tracks which section an action came from

Example Formats Supported

Section-based

## Actions
- Implement retry logic (@alice) [P1]
- Add integration tests (@bob)

Inline

Action: Update the deployment guide with new steps (@charlie) due: 2024-02-01
TODO: Review error handling in payment service [P0]

Natural Language

We should add monitoring for this metric within 7 days.
The team needs to review the architecture by 2024-03-15.

License

MIT