extract

boshu2/agentops · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/boshu2/agentops --skill extract
0 commentsdiscussion
summary

Typically runs automatically via SessionStart hook.

skill.md

Extract Skill

Typically runs automatically via SessionStart hook.

Process pending learning extractions from previous sessions.

How It Works

The SessionStart hook runs:

ao extract

This checks for queued extractions and outputs prompts for Claude to process.

Manual Execution

Given /extract:

Step 1: Check for Pending Extractions

ao extract 2>/dev/null

Or check the pending queue:

cat .agents/ao/pending.jsonl 2>/dev/null | head -5

Step 1.5: Without ao CLI — Manual Extraction

If ao CLI is not available, process the pending queue manually:

if ! command -v ao &>/dev/null; then
  echo "ao CLI not available — running manual extraction"

  # Check for pending queue
  if [ -f .agents/ao/pending.jsonl ] && [ -s .agents/ao/pending.jsonl ]; then
    echo "Found pending extractions:"
    cat .agents/ao/pending.jsonl

    # For each pending entry, check for corresponding forge output
    # Forge outputs live in .agents/forge/
    for forge_file in .agents/forge/*.md; do
      [ -f "$forge_file" ] || continue
      echo "Processing: $forge_file"
    done
  else
    echo "No pending extractions found."
  fi

  # After processing, check .agents/forge/ for unprocessed candidates
  FORGE_COUNT=$(ls .agents/forge/*.md 2>/dev/null | wc -l | tr -d ' ')
  if [ "$FORGE_COUNT" -gt 0 ]; then
    echo "$FORGE_COUNT forge candidates found — review and extract learnings manually."
    echo "For each candidate in .agents/forge/:"
    echo "  1. Read the candidate file"
    echo "  2. Extract actionable learnings using the template in Step 3"
    echo "  3. Write to .agents/learnings/YYYY-MM-DD-<topic>.md"
    echo "  4. High-confidence items (>= 0.7) can be promoted directly"
  fi
fi

For each forge candidate, extract learnings using the same template format defined in Step 3 of this skill. Write results to .agents/learnings/. After processing, clear the pending queue:

# Clear processed entries
> .agents/ao/pending.jsonl
echo "Pending queue cleared"

Step 2: Process Each Pending Item

For each queued session:

  1. Read the session summary
  2. Extract actionable learnings
  3. Write to .agents/learnings/

Step 3: Write Learnings

Write to: .agents/learnings/YYYY-MM-DD-<session-id>.md

# Learning: <Short Title>

**ID**: L1
**Category**: <debugging|architecture|process|testing|security>
**Confidence**: <high|medium|low>

## What We Learned

<1-2 sentences describing the insight>

## Why It Matters

<1 sentence on impact/value>

## Source

Session: <session-id>

Step 3.5: Validate Learnings

After writing learning files, validate each has required fields:

  1. Scan newly written files:
ls -t .agents/learnings/YYYY-MM-DD-*.md 2>/dev/null | head -5
  1. For each file, check required fields:

    • Heading: File must start with # Learning: <title> (non-empty title)
    • Category: Must contain **Category**: <value> where value is one of: debugging, architecture, process, testing, security
    • Confidence: Must contain **Confidence**: <value> where value is one of: high, medium, low
    • Content: Must contain a ## What We Learned section with at least one non-empty line after the heading
  2. Report validation results:

    • For each valid learning: "✓ : valid"
    • For each invalid learning: "⚠ : missing " (list each missing field)
  3. Do NOT delete or retry invalid learnings. Log the warning and proceed. Invalid learnings are still better than no learnings — the warning helps identify extraction quality issues over time.

Step 4: Clear the Queue

ao extract --clear 2>/dev/null

Step 5: Report Completion

Tell the user:

  • Number of learnings extracted
  • Key insights
  • Location of learning files

The Knowledge Loop

Session N ends:
  → ao forge --last-session --queue
  → Session queued in pending.jsonl

Session N+1 starts:
  → ao extract (this skill)
  → Claude processes the queue
  → Writes to .agents/learnings/
  → Validates required fields
  → Loop closed

Key Rules

  • Runs automatically - usually via hook
  • Process the queue - don't leave extractions pending
  • Be specific - actionable learnings, not vague observations
  • Close the loop - extraction completes the knowledge cycle

Examples

SessionStart Hook Invocation

Hook triggers: session-start.sh runs at session start

What happens:

  1. Hook calls ao extract 2>/dev/null
  2. CLI outputs queued session IDs and prompts
  3. Agent processes each pending extraction
  4. Agent writes learnings to .agents/learnings/<date>-<session>.md
  5. Agent validates required fields and reports results
  6. Hook calls ao extract --clear to empty queue

Result: Prior session knowledge automatically extracted at session start without user action.

Manual Extraction Trigger

User says: /extract or "extract learnings from last session"

What happens:

  1. Agent checks pending queue with ao extract
  2. Agent reads session summaries from queue
  3. Agent extracts decisions, learnings, failures
  4. Agent writes to .agents/learnings/ with proper structure
  5. Agent validates fields (category, confidence, content)
  6. Agent clears queue and reports completion

Result: Pending extractions processed manually, queue cleared, learnings indexed.

Troubleshooting

Problem Cause Solution
No pending extractions found Queue empty or ao CLI unavailable Check .agents/ao/pending.jsonl exists; verify ao CLI installed
Invalid learning warning Missing category/confidence/content Review learning file, add missing fields; DO NOT delete
extraction --clear fails CLI not available or permission error Manually truncate .agents/ao/pending.jsonl as fallback
Duplicate extractions Queue not cleared after processing Always run ao extract --clear after writing learnings
how to use extract

How to use extract on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add extract
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/boshu2/agentops --skill extract

The skills CLI fetches extract from GitHub repository boshu2/agentops and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/extract

Reload or restart Cursor to activate extract. Access the skill through slash commands (e.g., /extract) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.843 reviews
  • Min Jackson· Dec 24, 2024

    We added extract from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Chaitanya Patil· Dec 4, 2024

    I recommend extract for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Hana Kim· Dec 4, 2024

    Registry listing for extract matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Piyush G· Nov 23, 2024

    Useful defaults in extract — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Nikhil Kapoor· Nov 23, 2024

    Solid pick for teams standardizing on skills: extract is focused, and the summary matches what you get after install.

  • Alexander Agarwal· Nov 15, 2024

    extract fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • James Malhotra· Nov 3, 2024

    extract has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • James Chawla· Oct 22, 2024

    Keeps context tight: extract is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Shikha Mishra· Oct 14, 2024

    extract is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Arjun Okafor· Oct 14, 2024

    We added extract from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

showing 1-10 of 43

1 / 5