session-to-templates

Mine reusable prompt templates from Claude Code session files.

1|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/cdrguru/portable-agent-kit --skill session-to-templates
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-to-templates
Source: https://github.com/cdrguru/portable-agent-kit/tree/main/.agent/skills/session-to-templates
Command: npx skills add https://github.com/cdrguru/portable-agent-kit --skill session-to-templates

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, python-dotenv, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables developers to mine reusable prompt templates from Claude Code sessions, turning lengthy conversations into structured, reusable prompts to accelerate future work.

Core Features & Use Cases

  • Session-scoped extraction: scans Claude Code session files, identifies high-signal turns, and collects key exchanges.
  • Sampling strategy: uses head, tail, and key-turn selection to preserve problem-solution context while keeping prompts concise.
  • Template generation: leverages an LLM to distill prompts into a reusable template library for reuse in future tasks.
  • Use Case: create a prompt library for common coding tasks to speed up new projects and onboarding.

Quick Start

Run the batch tool to generate reusable templates from your Claude Code sessions.

Frequently Asked Questions about session-to-templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract reusable prompt templates from Claude Code sessions?

To extract reusable prompt templates from Claude Code sessions, this Skill analyzes stored session files, scores exchanges, samples key turns, and uses an LLM to distill structured templates into a reusable library.

What is the best way to build a prompt library from LLM session history?

Building a prompt library from LLM session history is done by mining high-signal turns using head, tail, and key-turn sampling to preserve problem-solution context, then generating structured prompts stored in a manifest.

Does session-to-templates support resume-capable processing for large session files?

Yes, session-to-templates supports resume-capable processing for large session files by storing extracted outputs with metadata in a manifest, enabling deduplication and allowing batch processing to resume.

Do I need an LLM API key to generate templates from AI session logs?

Yes, you need an LLM API key configured via python-dotenv to generate templates from AI session logs, as the Skill leverages an LLM to analyze sampled turns and distill them into structured reusable prompts.

Can I automate prompt extraction for common coding tasks in Claude Code?

Yes, you can automate prompt extraction for common coding tasks in Claude Code by running the batch tool, which scans session files, scores exchanges, and generates a structured template library to speed up new projects.

How does key-turn sampling work when mining prompts from conversation logs?

Key-turn sampling when mining prompts from conversation logs works by selecting head, tail, and critical middle exchanges to preserve problem-solution context while keeping the distilled LLM prompt templates concise and reusable.