Agent skill
session-export
Update GitHub PR descriptions with AI session export summaries. Use when user asks to add session summary to PR, document AI assistance in PR, or export conversation summary to PR description.
Install this agent skill to your Project
npx add-skill https://github.com/gmcabrita/dotfiles/tree/main/.agents/skills/session-export
SKILL.md
Session Export
Update PR descriptions with a structured summary of the AI-assisted conversation.
Output Format
> [!NOTE]
> This PR was written with AI assistance.
<details><summary>AI Session Export</summary>
<p>
```json
{
"info": {
"title": "<brief task description>",
"agent": "opencode",
"models": ["<model(s) used>"]
},
"summary": [
"<action 1>",
"<action 2>",
...
]
}
```
Workflow
1. Export Session Data
Get session data using OpenCode CLI:
opencode export [sessionID]
Returns JSON with session info including models used. Use current session if no sessionID provided.
2. Generate Summary JSON
From exported data and conversation context, create summary:
- title: 2-5 word task description (lowercase)
- agent: always "opencode"
- models: array from export data
- summary: array of terse action statements
- Use past tense ("added", "fixed", "created")
- Start with "user requested..." or "user asked..."
- Chronological order
- Attempt to keep the summary to a max of 25 turns ("user requested", "agent did")
- NEVER include sensitive data: API keys, credentials, secrets, tokens, passwords, env vars
3. Update PR Description
GitHub:
gh pr edit <PR_NUMBER> --body "$(cat <<'EOF'
<existing description>
> [!NOTE]
> This PR was written with AI assistance.
<details><summary>AI Session Export</summary>
...
</details>
EOF
)"
4. Preserve Existing Content
Always fetch and preserve existing PR description:
# GitHub
gh pr view <PR_NUMBER> --json body -q '.body'
Append session export after existing content with blank line separator.
Example Summary
For a session where user asked to add dark mode:
{
"info": {
"title": "dark mode implementation",
"agent": "opencode",
"models": ["claude sonnet 4"]
},
"summary": [
"user requested dark mode toggle in settings",
"agent explored existing theme system",
"agent created ThemeContext for state management",
"agent added DarkModeToggle component",
"agent updated CSS variables for dark theme",
"agent ran tests and fixed 2 failures",
"agent committed changes"
]
}
Security
NEVER include in summary:
- API keys, tokens, secrets
- Passwords, credentials
- Environment variable values
- Private URLs with auth tokens
- Personal identifiable information
- Internal hostnames/IPs
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
autoresearch-finalize
Finalize an autoresearch session into clean, reviewable branches. Use when asked to "finalize autoresearch", "clean up experiments", or "prepare autoresearch for review".
autoresearch-create
Set up and run an autonomous experiment loop for any optimization target. Gathers what to optimize, then starts the loop immediately. Use when asked to "run autoresearch", "optimize X in a loop", "set up autoresearch for X", or "start experiments".
update-changelog
Read this skill before updating changelogs
web-browser
Allows to interact with web pages by performing actions such as clicking buttons, filling out forms, and navigating links. It works by remote controlling Google Chrome or Chromium browsers using the Chrome DevTools Protocol (CDP). When Claude needs to browse the web, it can use this skill to do so.
summarize
Fetch a URL or convert a local file (PDF/DOCX/HTML/etc.) into Markdown using `uvx markitdown`, optionally it can summarize
commit
Read this skill before making git commits
Didn't find tool you were looking for?