/aoshimash-skills:analyze-sessionsfrom aoshimash-skills
Analyze the running agent's session history — Codex or Claude Code, or a history export the user provides — to detect recurring patterns in skill executions and propose improvements to skill definitions and, where that agent's configuration surface is confirmed, to its settings or hooks. Use when the user says "analyze sessions", "improve skills", "analyze skill logs", "セッションを分析", "スキルを改善", "ログを分析", "設定を提案", or wants to review skill usage patterns and environment configuration.
Ships in aoshimash-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Analyze an agent's locally stored conversation history to detect recurring patterns in skill executions and propose concrete improvements to skill definitions and — for the environment the history came from — to its settings or hooks.
The history under analysis and the agent running this skill are two different things. A Claude Code session can analyze Codex history the user points at, and the reverse; the running agent only decides the default source. Every product-specific fact this skill relies on — where a history store lives, what its records look like, how a skill invocation shows up in them, which configuration surface exists — is kept in references/history-sources.md with its confirmation status, and the instructions below never assume one product.
This skill targets any agent implementing the Agent Skills spec. Instructions below use capability terms; map them to your environment as follows.
| Capability | With native support (example) | Fallback |
|---|---|---|
| Session history access — read an agent's locally stored conversation transcripts | The running agent's own history store, read directly from disk (Claude Code's per-project transcript directory; Codex's sessions/ rollouts — locations, formats, and confirmation status in references/history-sources.md) | A history export or directory the user provides, in one of the formats the reference describes; with neither, report that no history is reachable (Step 2 outcome A) and stop — never fabricate findings |
| User choice — present numbered options, wait for an explicit selection | Structured question tool (e.g. Claude Code's AskUserQuestion) | Numbered options as plain text; wait for the user's reply |
| Platform access — create the issue or pull request that Step 5's Issue / PR output methods produce | A connector or MCP server for GitHub that creates issues and pull requests | The gh CLI commands in Step 6; with neither, output the drafted body as Markdown for the user to submit |
User choice is used in three places: selecting the skill to analyze (Step 2), choosing the output method (Step 5), and approving each improvement (Step 6). Nothing is written anywhere without the third.
Platform access is resolved once, before Step 6's first write, in the
order the other skills in this plugin use: a method the user named, then a
connector or MCP server whose own tool descriptions show it creates issues and
pull requests in this repository, then the gh CLI, then — with neither — the
drafted body as Markdown for the user to submit. Keep the method for the rest
of the run, and name it in the report.
Pick the store to read, in this order, and name the choice in the report:
Then scope the store to the current project, by the rule the reference gives for that store. The scoping rule derives a location or a filter from the working directory; verify the derived location exists before reading, and when it does not, list the store and pick the entry that matches the working directory — or ask. A derivation that silently matches nothing would be reported as "no sessions", which is the confusion Principle 2 forbids.
Read the recent sessions in the scoped store — the 20 most recent files modified in the last 30 days, or a wider window only when the user names one — and find the ones in which a skill from this plugin ran.
PATH, a
first record that is not the shape the reference describes, or a parser the
check needs (python3 for Codex rollouts) missing — counts as unsupported or
unparsed, never as "no executions". The reference's commands print those
counts beside the number of files read.aoshimash-skills:<skill-name>) where the
store records it that way, and for the heuristic markers the reference gives
where no marker is documented — and say in the report when detection was
heuristic.Report the result as exactly one of these outcomes, with the counts it names:
| Outcome | Condition | Report |
|---|---|---|
| A. History not reachable | No store resolved in Step 1, or the resolved store cannot be read (missing directory, no read permission) | No session history is reachable: <what was tried and why it failed>. Then stop — nothing below can run |
| B. Unsupported format | Files were found but none could be parsed as the reference describes (unsupported or unparsed, in the reference's counts) | Found N session file(s) in <store>, none in a format this skill can read: <reason, e.g. compressed .zst and no zstd on PATH; first lines that are not session records>. Say what would make them readable, and stop. When only some files are affected, continue with the rest and state the counts in every later message |
| C. No skill executions | N files were read (N may be 0) and no skill invocation marker was found in any of them | No skill execution found in N session(s) from the last <window> (<store>, current project). Name the window and the detection method, so the user can judge whether N is enough history |
| D. Insufficient count | A skill was found, but in fewer than 3 sessions | Not enough data for pattern analysis yet (K/3 sessions for <skill-name>). List every skill found with its count |
With 3+ sessions for at least one skill, list which skills were used and how many sessions each has, and ask the user (user choice) which single skill to analyze. Do not offer an "analyze all" option — analyze one skill per invocation to keep execution fast.
For each session file containing the target skill invocation, read the conversation. Focus on the user and assistant turns to understand the interaction flow — skip large tool results unless needed for context (e.g., to confirm a test failure). Detect these patterns:
These patterns indicate issues with the skill definition itself:
User explicitly rejects a proposal or asks to change something. Look for:
A step fails and must be re-done. Look for:
User experiences confusion or frustration. Look for:
Workflow was not completed. Look for:
These patterns indicate issues solvable by the environment's configuration — permissions, hooks, automation — rather than by skill modifications. Detect them the same way in every store; only the proposal (Step 4) depends on the product.
Repeated permission or approval prompts slow down the workflow. Look for:
Repeated manual actions suggest automation via the product's lifecycle hooks. Look for:
Aggregate findings across the analyzed sessions using these thresholds:
| Signal | Threshold | Indicates |
|---|---|---|
| Same-step rejection | 2+ sessions | Default approach doesn't match user expectations |
| Same-step retry | 2+ sessions | Instructions unclear or incomplete |
| Similar friction | 2+ sessions | Missing context or explanation |
| Abandonment | 2+ sessions | Workflow too heavy or misaligned |
| Permission friction | 2+ sessions | A permission rule should cover the tool |
| Hook opportunity | 2+ sessions | A manual step should be automated via a hook |
Open every report with one line that fixes its evidence base:
History: <store> · <N> session(s) read · window <30 days, or the one the user named> · detection <marker | heuristic> · unparsed/unsupported files: <K>
No recurring patterns found in <skill-name> sessions (N sessions analyzed).
Group findings by target:
Skill Improvements (changes to SKILL.md):
### <pattern description>
- **Type**: Rejection / Retry / Friction / Abandonment
- **Seen in**: X/N sessions
- **Common reason**: "<aggregated reasons>"
- **Root cause**: <what in the skill likely causes this>
- **Proposed fix**: <what to change in SKILL.md>
Environment Proposals (changes to the product's settings or hooks):
Before writing one, look up the product the analyzed history came from under "Configuration surface" in references/history-sources.md. A proposal carries a configuration snippet only for a surface whose status there counts as confirmed (documented, or observed and verified on this machine); otherwise it carries the evidence and the product documentation to consult, and says that no snippet was produced because the surface is not confirmed. Never write one product's snippet for another product's history — a Claude Code settings entry for a Codex pattern, or the reverse.
### <pattern description>
- **Type**: Permission Friction / Hook Opportunity
- **Product**: <the product the analyzed history came from>
- **Seen in**: X/N sessions
- **Common reason**: "<aggregated reasons>"
- **Root cause**: <missing configuration>
- **Proposed fix**: Add to <target file> — or — Consult <documentation>; surface unconfirmed, no snippet
- **Configuration** (confirmed surfaces only):
<proposed snippet in that product's own format>
After presenting findings, ask the user (user choice) how to proceed:
For each improvement suggestion:
Present the full analysis report. No external submission occurs. End the workflow.
Create an issue for the analyzed skill:
gh issue create --title "improve(<skill-name>): <summary>" --body "<drafted body>" --label "enhancement"
Create a PR with the approved fixes for the analyzed skill:
fix/improve-<skill-name>-<description>fix(<skill-name>): <description>gh pr create --title "fix(<skill-name>): <description>" --body "<summary of changes>"
Note: environment proposals are not auto-applied via PR — they are included in the PR description as recommendations for the user to apply manually. This avoids modifying the user's environment configuration without explicit action.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aoshimash/skills --plugin aoshimash-skills11 skills in this plugin
/collect-agent-rulesPromote hand-written conventions out of the author's own GitHub repositories and into the shared rule corpus in aoshimash/skills — confirm which repositories to scan, read each one's AGENTS.md over the GitHub API without cloning, ignore everything inside a managed rules block, propose the conventions that recur across repositories, decide on them one at a time, and open a pull request adding the approved ones to the corpus. Runs inside a checkout of aoshimash/skills; proposes, never promotes automatically. Use when the user says "collect agent rules", "promote rules into the shared corpus", "find rules worth sharing in my repos", "scan my repositories for conventions to centralize", "harvest conventions from my other projects", "ルールを収集して", "他のリポジトリのルールを共通ルールに取り込んで", "自分のリポジトリから共通化できる規約を集めて", "エージェントルールを収集", "共通ルールに昇格させて", or otherwise wants hand-written conventions in owned repositories gathered into the shared rule set.
/create-issueCreate well-structured issues on GitHub or Backlog with codebase analysis — from a single quick issue to a fully designed issue hierarchy (parent + sub-issues with dependencies). Everything unknown is gathered in one batched question round; design work is carried by a single consolidated plan file refined through inline annotation; nothing is published without an explicit approval. Use when the user wants to create an issue, file a bug report, request a feature, create a technical task, or design a feature and break it down into implementable issues. Triggers on phrases like "create an issue", "file a bug", "open an issue", "issueを作って", "issue作成", "バグ報告", "機能要望", "課題を作成", "design sprint", "スプリント設計", "機能を設計して issue に分解", "plan and create issues", "design and decompose", "この機能を設計して".
Other plugins' skills for the same job