# Continuous Learning

> Extract repeated patterns from archived sessions and offer to convert them into reusable skills

- **Type:** Skill
- **Install:** `agentstack add skill-manastalukdar-ai-devstudio-continuous-learning`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [manastalukdar](https://agentstack.voostack.com/s/manastalukdar)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [manastalukdar](https://github.com/manastalukdar)
- **Source:** https://github.com/manastalukdar/ai-devstudio/tree/main/skills/continuous-learning

## Install

```sh
agentstack add skill-manastalukdar-ai-devstudio-continuous-learning
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Continuous Learning

Scan archived session logs to surface recurring manual workflows, then offer to convert high-frequency patterns into new SKILL.md stubs so repeated work becomes permanent automation.

## Usage

```
/continuous-learning              # Scan all archived sessions for patterns
/continuous-learning --min 2      # Lower threshold (default: 3 repetitions)
/continuous-learning --generate   # Auto-generate stubs without prompting
```

## Behavior

### Phase 1: Discover sessions

```bash
# Find all archived session files (not the active .current-session pointer)
find .claude/sessions -name "*.md" -not -name ".current-session" 2>/dev/null | sort
```

If fewer than 3 session files exist, report "Not enough session history yet (need 3+)" and exit.

### Phase 2: Extract commands and workflows

Scan each session file for lines that match invocation patterns:

```bash
# Commands invoked (slash commands, skill names)
grep -h -E "^/[a-z]|^\*\*Command\*\*:|Ran:|Invoked:" .claude/sessions/**/*.md 2>/dev/null \
  | sed 's|.*: ||' | sort | uniq -c | sort -rn | head -40
```

Also extract multi-step sequences: look for clusters of 3+ consecutive commands that appear together in at least `--min` sessions.

### Phase 3: Build pattern registry

Load or create `.claude/cache/continuous-learning/patterns.json`:

```json
{
  "last_scan": "2026-06-04T00:00:00Z",
  "patterns": [
    {
      "commands": ["/security-scan", "/review", "/test"],
      "frequency": 5,
      "sessions": ["session-a.md", "session-b.md"],
      "candidate_name": "quality-gate"
    }
  ]
}
```

Merge new findings with prior registry. Patterns that drop below `--min` threshold are removed.

### Phase 4: Present findings

Display a ranked table of patterns that meet the threshold:

```
Repeated patterns found across your sessions:

  Rank  Frequency  Pattern
  ────  ─────────  ───────────────────────────────────────────
  1     7x         /security-scan → /review → /test
  2     5x         /find-todos → /fix-todos → /commit
  3     4x         /db-diagram → /migration-generate → /seed-data
  4     3x         /brainstorm → /write-plan → /implement

Convert any of these to a skill? (enter rank, or 'none'):
```

### Phase 5: Generate skill stub (if requested)

For the chosen pattern, emit a SKILL.md stub using the skillify template:

```markdown
---
name: 
description: 
disable-model-invocation: false
risk: safe
---

# 

## Usage

\`/\`

## Behavior

1. Run `/step-one`
2. Run `/step-two`
3. Run `/step-three`

## Token Optimization

**Expected range**: 200–600 tokens (delegates to constituent skills)
**Early exit**: Each constituent skill handles its own early exit.
**Patterns used**: Delegation to existing skills
```

Save to `skills//SKILL.md` and confirm location to user. Do not commit.

## Examples

**No patterns yet:**
```
/continuous-learning
→ Scanned 2 session files — need at least 3 to detect patterns.
  Run more sessions, then try again.
```

**Patterns found:**
```
/continuous-learning
→ Scanned 8 sessions. Found 3 repeated patterns (threshold: 3x).
  [table shown]
  Convert #1 to a skill? → User enters "1"
  → Stub written: skills/quality-gate/SKILL.md
```

## Token Optimization

**Expected range**: 400–900 tokens (initial scan), 150–300 tokens (cache hit)

**Caching**: Stores pattern registry in `.claude/cache/continuous-learning/patterns.json`. On subsequent runs, only sessions newer than `last_scan` are re-processed; old results are merged from cache.

**Early exit**: Exits immediately if fewer than 3 archived session files exist.

**Patterns used**: Grep-before-Read (scan with grep, never read full session files into context), Bash for system queries, progressive disclosure (summary table before detail), early exit.

## Edge Cases

- **No sessions directory**: Reports setup instructions and exits.
- **Sessions with no command lines**: Skips those files silently.
- **Candidate name collision with existing skill**: Appends `-2` suffix and warns user.
- **User declines all patterns**: Exits cleanly with "Nothing converted."

## Safety

- Never deletes or modifies existing skills or session files.
- Skill stubs are written to `skills/` only — not installed to `~/.claude/skills/` automatically.
- Does not commit anything; user must run `/commit` explicitly.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [manastalukdar](https://github.com/manastalukdar)
- **Source:** [manastalukdar/ai-devstudio](https://github.com/manastalukdar/ai-devstudio)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-manastalukdar-ai-devstudio-continuous-learning
- Seller: https://agentstack.voostack.com/s/manastalukdar
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
