بنقرة واحدة
researchskills-extract
Extract research skills from conversation history into ResearchSkills skill files.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Extract research skills from conversation history into ResearchSkills skill files.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | researchskills-extract |
| description | Extract research skills from conversation history into ResearchSkills skill files. |
Extract research skills from the user's Codex session history for ResearchSkills.
Run automatically with THREE pauses for user consent: once after classifying projects (Stage 2.5 — choose which projects to scan), once after scoring to offer local installation (Stage 6.5 — store skills in Claude/Codex), and once before upload (Stage 7 — choose whether to submit). Report progress at each milestone.
Prerequisite: This skill spawns nested
codex execcalls that need full network and filesystem access. Start Codex with:codex -a never -s danger-full-access(or--dangerously-bypass-approvals-and-sandbox). If the parent session is sandboxed, nested calls will fail with network errors.
You extract three types of cognitive memory from research conversations:
Everything else — discovery, formatting, validation, upload — is done by helper scripts. Do not reimplement their work.
scan-sessions.js ─┐
classify-projects.js ─┤
extract-skills.js ─┤ deterministic scripts (you call them)
└─ codex exec │ ← Codex exec call per session, inside the script
clean-skills.js ─┤ ← review: reject/fix/merge
score-skills.js ─┤ ← score: 3-dim value assessment
store-local.js ─┤ ← optional: install skills into Claude/Codex
finalize.js ─┘
You (main agent) ← call scripts, read summaries, report
Helper scripts (installed at ~/.codex/skills/researchskills-extract/scripts/):
| Script | What it does |
|---|---|
scan-sessions.js | Discover sessions, extract metadata, filter, group by project |
classify-projects.js | Classify projects as research/engineering via Codex, pick domain/subdomain |
extract-skills.js | The core loop: format each session → call codex exec → validate + cache skills |
validate-skills.js | Validate skill markdown and cache to ~/.researchskills/cache/skills/ |
clean-skills.js | Review extracted skills: reject engineering, fix PII, merge duplicates |
score-skills.js | Score surviving skills on 3 dimensions: procedural, semantic, episodic value |
store-local.js | Install extracted skills into user's local Claude/Codex config |
finalize.js | Collect cached skills → upload to researchskills.ai |
--test (alias: test): Test mode. Accept engineering sessions too (not just research). Tag all output as test data.Detect mode at start. Announce: "Running in TEST MODE" or "Running in production mode".
mkdir -p ~/.researchskills/cache/meta ~/.researchskills/cache/skills
node ~/.codex/skills/researchskills-extract/scripts/scan-sessions.js
Reads ~/.researchskills/cache/work-list.json output. Report: "Found N sessions across M projects."
YOU MUST call this script. Do NOT classify projects yourself.
node ~/.codex/skills/researchskills-extract/scripts/classify-projects.js ~/.researchskills/cache/work-list.json --codex --verbose
For test mode, add --test.
The script calls Codex to classify each project as research/engineering and picks domain/subdomain from the taxonomy. It also filters out non-research sessions (e.g., researchskills-extract runs, build/deploy tasks) via skip_patterns.
Output: ~/.researchskills/cache/classification.json.
Read the output file. For each project with type: "research", use its research_session_ids (NOT session_ids), domain, subdomain, and project_name in later stages. Do NOT include skipped sessions.
The script generates an AI-summarized project_name for each project (e.g. "Protein Folding Simulation Pipeline") instead of using the raw folder name. Use this project_name in Stage 6 finalize. If project_name is null, fall back to the slug.
Report: "Classified N projects. Proceeding with M."
PAUSE and ask the user. After classification, show all discovered projects and let the user choose which to scan.
Read ~/.researchskills/cache/classification.json and display:
Select which projects to scan for research skills (all research projects selected — deselect any project that is not related to research):
[x] 1. Protein Folding Pipeline (4 sessions, research, quantitative-biology)
[x] 2. Quantum Monte Carlo Study (3 sessions, research, physics)
[ ] 3. Personal Website (3 sessions, engineering)
[x] 4. Dotfiles (2 sessions, other)
Enter numbers to toggle, or press Enter to continue:
All projects are pre-selected by default. Users can deselect individual projects by number.
YOU MUST STOP HERE AND WAIT FOR THE USER TO RESPOND. Use ask (Codex) or AskUserQuestion (Claude Code) to present the project list and block until the user replies. Do NOT continue to Stage 3 without an explicit user response. If no interactive tool is available, print the list and end your turn — the user's next message is their selection.
Only pass user-approved projects to Stage 3+. Remove deselected project session IDs from all subsequent --session-ids arguments.
Report: "Proceeding with N projects (M sessions) after user confirmation."
The extraction script MUST be called in a loop with --single-batch. Each call processes ONE batch (~5 parallel Codex calls) then exits. You call it again in a new tool call. This keeps the user informed of progress and prevents the UI from freezing.
FORBIDDEN patterns (will cause long freezes):
run_in_background: true — user sees nothing for 10+ minutes--single-batch — script runs all batches internally, no progress visibleREQUIRED pattern:
# REPEAT this exact call in a loop. Each call = 1 batch.
node ~/.codex/skills/researchskills-extract/scripts/extract-skills.js ~/.researchskills/cache/work-list.json \
--codex \
--domain <domain> \
--subdomain <subdomain> \
--contributor "$(git config user.name)" \
--session-ids <ALL-research-session-ids-csv> \
--single-batch \
--verbose
Loop logic:
0 Codex calls remaining or All sessions already cached → stop, go to Stage 4Pass ALL research session IDs from Stage 2. Do NOT drop sessions or pick a subset.
If you need to process multiple projects with different domains, call the script once per project with --session-ids filtering to that project's sessions.
Run review of all extracted skills: reject engineering content, fix PII leaks, merge duplicates.
node ~/.codex/skills/researchskills-extract/scripts/clean-skills.js \
--codex \
--session-ids <ALL-research-session-ids-csv> \
--verbose
This spawns a Codex instance that directly reads, deletes, and edits skill files on disk.
Report: "Clean: kept N, rejected M, merged K."
Run assessment of the value of each surviving skill on 3 dimensions.
node ~/.codex/skills/researchskills-extract/scripts/score-skills.js \
--codex \
--session-ids <ALL-research-session-ids-csv> \
--verbose
This spawns a Codex instance that reads each skill and writes review_scores (procedural, semantic, episodic — each 0-5) into the YAML frontmatter.
Report: "Scored N skills. Avg: procedural X.X, semantic X.X, episodic X.X."
Use the AI-generated project_name from classification.json (Stage 2). Do NOT use the raw folder name.
Do NOT pass --upload here. Collect skills locally first. Upload requires explicit user consent in Stage 7.
node ~/.codex/skills/researchskills-extract/scripts/finalize.js \
--session-ids <ALL-research-session-ids-csv> \
--domain <domain> \
--subdomain <subdomain> \
--contributor "$(git config user.name)" \
--project-name "<project_name from classification>" \
--project-slug "<slug>"
Third consent gate. After finalize collects skills, ask the user whether to install them into their local AI coding tool so the skills are available as context in future sessions.
Use ask (Codex) or AskUserQuestion (Claude Code) to present the options. If no interactive tool is available, print the options and end your turn — the user's next message is their selection.
~/.claude/commands/researchskills/<slug>.md~/.codex/skills/researchskills-<slug>/SKILL.mdYOU MUST STOP HERE AND WAIT FOR THE USER TO RESPOND. Do NOT continue to Stage 7 without an explicit user response.
If the user picks A, B, or C, run:
node ~/.codex/skills/researchskills-extract/scripts/store-local.js \
--target <claude|codex|both> \
--session-ids <ALL-research-session-ids-csv>
Report: "Installed N skills to <target>. M already up-to-date."
If the user picks D, skip and continue to Stage 7.
Fourth consent gate. Pause and ask the user before uploading anything.
Show the user what was extracted:
═══════════════════════════════════════════════════════
/researchskills-extract — Extraction Complete!
═══════════════════════════════════════════════════════
Extracted N skills from M sessions across P projects:
• Episodic: E skills
• Semantic: S skills
• Procedural: Pr skills
Review:
• Kept: K / Rejected: R / Merged: G
• Avg scores: procedural X.X, semantic X.X, episodic X.X
⚠ Nothing has been uploaded yet. Your skills are saved
locally. Would you like to submit them to ResearchSkills
for reviewer review?
Skills will be stored on researchskills.ai and reviewed
by a maintainer before publication (CC-BY 4.0).
═══════════════════════════════════════════════════════
Ask for explicit consent:
--uploadIf the user consents, re-run finalize with --upload.
Headless/SSH detection: If running over SSH (SSH_CONNECTION or SSH_CLIENT env vars set) or on a headless Linux server (no DISPLAY), the upload script automatically detects this and:
When the user has consented via the prompt above, pass --consent to include consent: true in the upload payload.
node ~/.codex/skills/researchskills-extract/scripts/finalize.js \
--session-ids <ALL-research-session-ids-csv> \
--domain <domain> \
--subdomain <subdomain> \
--contributor "$(git config user.name)" \
--project-name "<project_name from classification>" \
--project-slug "<slug>" \
--upload
Then show:
Review your skills:
→ https://researchskills.ai/review/batch/<batchId>
If headless, also show:
(Sign in with GitHub on the review page to claim credit and submit.)