Skip to content
Back to search

process-mining-to-ai-redesign

From an event log to an AI-first redesign proposal: process mining, AI-fit with hard autonomy caps, an explicit value case, and an agent that drafts the process owner's memo.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/flam7791--process-mining-to-ai-redesign/badge.svg)](/listings/flam7791--process-mining-to-ai-redesign)

HTML

<a href="/listings/flam7791--process-mining-to-ai-redesign"><img src="/api/listings/flam7791--process-mining-to-ai-redesign/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Python 3.10 or later, no dependencies.

PYTHONPATH=src python -m pm2ai generate --cases 600 --seed 7 --out data/sample_event_log.csv
PYTHONPATH=src python -m pm2ai analyze data/sample_event_log.csv --out reports/latest
python -m unittest discover -s tests

On Windows PowerShell, set the path first: `$env:PYTHONPATH = "src"`.

Use your own log: a CSV with `case_id, activity, timestamp, resource, role` (extra columns are kept but never interpreted), plus an entry per activity in `config/activity_catalog.json`. Change the planning assumptions in `config/assumptions.json`; the report prints whatever is there.

The memo agent is a Claude skill in [`agent/redesign-memo/`](agent/redesign-memo/SKILL.md). To use it: - **Claude Code:** copy the folder to `~/.claude/skills/redesign-memo/` (or `.claude/skills/` in a project), then ask: "Draft the redesign memo from reports/latest/facts.json". - **Claude apps:** zip the `redesign-memo` folder and upload it as a custom skill (see Anthropic's Agent Skills documentation for where skills are enabled in your plan), then attach `facts.json` and ask for the memo.

Check any memo before it goes out: `python evals/check_memo.py reports/latest/facts.json memo.md`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 82 lines
  1. # process-mining-to-ai-redesign
  2. **From an event log to an AI-first redesign proposal a process owner can decide on: process mining, AI-fit with hard autonomy caps, an explicit value case, and an agent that writes the memo without inventing a number.**
  3. ## The problem
  4. Most "AI in operations" proposals start from the technology: a model is available, so a step gets automated. The result is often a faster version of a broken process. The bottleneck sits elsewhere, a rework loop absorbs a third of cases, and the value case rests on assumptions nobody wrote down. This repo starts from the evidence instead: mine where the time actually goes, judge where an agent can safely help, and put every estimate next to the assumption it depends on.
  5. ## What it does
  6. ```mermaid
  7. flowchart LR
  8. A[Event log CSV] --> B[Mine: variants, cycle time, rework, handoffs, bottlenecks]
  9. B --> C[AI-fit per activity: L0-L3 with hard caps]
  10. C --> D[Redesign proposals + value case, assumptions named]
  11. D --> E[report.md + facts.json]
  12. E --> F[redesign-memo agent drafts a one-page memo]
  13. F --> G{{Process owner: approve / change / stop}}
  14. ```
  15. 1. **Mine** the log: distinct variants, cycle time (median, P90), rework loops, handoffs between roles, a directly-follows graph and a bottleneck ranking by total waiting time.
  16. 2. **Assess AI-fit** for each activity from a short catalog the process owner fills in (task type, data availability, risk, financial authority). Autonomy levels: L1 assist, L2 draft and a person approves each output, L3 act and report. Decisions never go above L1; high-risk or financial-authority steps never above L2. The caps are rules, enforced by tests, not scores.
  17. 3. **Propose** a redesign: remove the main rework loop at intake first, then support the largest bottlenecks at the level allowed. Each proposal gets a value estimate, the assumptions it rests on, and a recommendation (pilot, iterate, assist only).
  18. 4. **Recompute** cycle time case by case under those assumptions (clearly labelled as an estimate).
  19. 5. **Draft the memo** with the `redesign-memo` agent skill, which may only use numbers that exist in `facts.json`, labels every estimate and stops at a decision table for the owner.
  20. ## Example (synthetic data)
  21. Fictional company Northwind Appliances, warranty-claim handling, 600 claims over 15 weeks ([full report](reports/example/report.md), [memo](reports/example/memo.md)):
  22. - Median cycle time 141 h; **33% of claims loop back** through a request for missing information.
  23. - The largest single block of waiting (30%) sits before the technical assessment.
  24. - Two proposals worth a pilot: a completeness check at registration (removes the loop for an estimated half of those cases) and an agent that drafts the technical assessment for a technician to approve.
  25. - Estimated median cycle time if all proposals work as assumed: 141 h -> 84 h. Every estimate in the report lists the assumption behind it.
  26. ## Quick start
  27. Python 3.10 or later, no dependencies.
  28. ```bash
  29. PYTHONPATH=src python -m pm2ai generate --cases 600 --seed 7 --out data/sample_event_log.csv
  30. PYTHONPATH=src python -m pm2ai analyze data/sample_event_log.csv --out reports/latest
  31. python -m unittest discover -s tests
  32. ```
  33. On Windows PowerShell, set the path first: `$env:PYTHONPATH = "src"`.
  34. Use your own log: a CSV with `case_id, activity, timestamp, resource, role` (extra columns are kept but never interpreted), plus an entry per activity in `config/activity_catalog.json`. Change the planning assumptions in `config/assumptions.json`; the report prints whatever is there.
  35. The memo agent is a Claude skill in [`agent/redesign-memo/`](agent/redesign-memo/SKILL.md). To use it:
  36. - **Claude Code:** copy the folder to `~/.claude/skills/redesign-memo/` (or `.claude/skills/` in a project), then ask: "Draft the redesign memo from reports/latest/facts.json".
  37. - **Claude apps:** zip the `redesign-memo` folder and upload it as a custom skill (see Anthropic's Agent Skills documentation for where skills are enabled in your plan), then attach `facts.json` and ask for the memo.
  38. Check any memo before it goes out: `python evals/check_memo.py reports/latest/facts.json memo.md`.
  39. ## How it was built
  40. - **Context.** One process, one owner, one decision: which redesign proposals deserve a pilot. Synthetic, seeded data so the example is public and reproducible.
  41. - **Loop.** The deterministic core (mine, assess, propose, report) runs end to end; the agent drafts, self-checks, and stops at the owner's decision. Nothing is approved, sent or implemented by the tool.
  42. - **Judge.** Acceptance criteria were written before the code: every number in a memo exists in facts.json; every estimate is labelled; no decision is claimed; no autonomy level is raised. An independent review scored the package against an eight-criterion rubric ([judge report](docs/JUDGE_REPORT.md)).
  43. - **Harness.** Plain Python with no dependencies, a Claude skill with its template, configuration in two JSON files.
  44. - **Evals.** 22 unit tests (16 for the pipeline, 6 for the memo checker), and 10 memo cases including a prompt injection hidden in an activity name, a request to approve and send, a request to raise an autonomy level, an empty and a broken input, and a request for figures the tool does not produce. 8/8 must-pass cases pass, model-run by isolated subagents; [`evals/check_memo.py`](evals/check_memo.py) checks mechanically that the memo's numbers come from the data ([EVALS.md](evals/EVALS.md)).
  45. - **Operate.** CI runs the tests, an end-to-end run, a reproducibility check, the memo check, skill limits and a scrub for internal material on every push ([workflow](.github/workflows/checks.yml)).
  46. ## Running it in production
  47. Designed for production; operated as a prototype. [OPERATIONS.md](OPERATIONS.md) sets out the sample operating model: a release gate, a six-week pilot with one process owner and thresholds fixed in advance, monitoring of grounding failures, owner corrections and decisions per month, every confirmed failure becoming a regression case, and rollback to the previous tag.
  48. ## Design decisions
  49. - **Measured and estimated never mix.** The miner reports only what the timestamps show; estimates live in their own section with their assumptions.
  50. - **Hard caps beat scores.** A high AI-fit score can rank a step, never lift it above its cap.
  51. - **Rework before automation.** A loop a third of cases go through is removed before anything in it is automated.
  52. - **Deterministic core, model at the edge.** The model only writes prose, and a check verifies its numbers.
  53. More in [docs/design-decisions.md](docs/design-decisions.md).
  54. ## Author
  55. Built by Flavio ([@flam7791](https://github.com/flam7791)), who designs AI adoption and governance approaches for large organisations, applies process mining and Six Sigma to operational redesign, and builds AI automation for SMEs.
  56. MIT licence.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.