Work
RitualAI
TypeScript CLI that scans local Claude/Codex prompt history and turns repeated workflows into reusable skills.
What RitualAI turns into a skill
RitualAI is an interactive TypeScript CLI that finds repeated workflows in local Claude and Codex history and guides an approved candidate into a reusable SKILL.md.
Why repeated workflows stay hidden
Developers often repeat useful agent prompts and workflows without noticing which patterns are stable enough to turn into reusable automation.
Building the history-to-skill workflow
I designed and implemented history-source discovery, bounded JSON/JSONL parsing, local repeated-workflow ranking, the same-window Claude/Codex discovery handoff, duplicate-skill suppression, and guarded installation paths.
Local history discovery and guarded installation
- Source discovery reads supported Claude history and transcript locations plus Codex history, active sessions, and archived sessions; malformed records become diagnostics rather than stopping the scan.
- The preferred path passes only discovered history paths and scoped instructions to a user-selected local claude or codex executable; a deterministic local ranker is the fallback when agent discovery is declined or unavailable.
- The selected workflow continues in the same agent window, asks whether installation should be project-local or global, and writes the resulting SKILL.md only after the user confirms the target.
npx ritualai@latest
npx ritualai@latest prompts --limit 25Why agent discovery requires opt-in
- History discovery, extraction, and fallback ranking remain local; the CLI never uploads history itself.
- Agent discovery is opt-in because the local claude or codex executable may call an external service according to the user's configuration.
- Existing project and global skills suppress already-covered candidates, and existing skill files are never overwritten without interactive confirmation.
Ranking repetition without overfitting
- Claude and Codex store multiple evolving JSONL shapes across history, transcript, active-session, and archived-session paths, so parsing needs bounded compatibility and clear truncation diagnostics.
- Repeated text is not automatically a reusable workflow; candidate ranking must reduce generic duplicates and avoid suppressing broad workflows because of short, loosely related skills.
- The agent handoff must expose enough local context for semantic discovery while constraining repository inspection and file writes during the discovery phase.
Privacy, scan caps, and human judgment
- The local fallback is more private and deterministic but less capable of semantic grouping than an agent review.
- Bounded scan caps prevent unbounded history processing but can skip older or oversized sources; the CLI reports those gaps.
- Generated skills still require human judgment because repetition alone does not prove that a workflow is stable, safe, or worth maintaining.
RitualAI at v0.3.2
RitualAI is published through npm and GitHub. The latest tagged release is v0.3.2, published June 20, 2026.