# ctf-similar-search

ctf-similar-search searches for writeups of similar CTF challenges via Tavily API. Handy when a challenge resists solving and you need a reference.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 1000 installs · ★ 3761 repo stars
- Author: Lukasz Jagiello
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/ljagiello/ctf-skills/tree/HEAD/ctf-similar-search/SKILL.md
- Updated: 2026-10-23
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/ctf-similar-search

## What it does

The skill runs a `search.sh` script with two commands: `search` finds writeups by keywords, `extract` pulls full text from URLs. A Python setup with `requests` and `tavily` is required, plus a Tavily key exported as `TAVILY_API_KEY`. Without the key the script will not run.

Non-code queries carry a three-word cap. You search “DASCTF URL Storage” or “HGAME baby web”, not “PlaidCTF 2025 zero day exploit solution”. Code snippets and unique strings skip the limit. A lone word like SSRF brings generic articles instead of writeups.

After search you can extract promising URLs and read how others solved a similar task, then decide whether that approach fits.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ljagiello/ctf-skills --skill ctf-similar-search -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/ctf-similar-search/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/ctf-similar-search/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ljagiello/ctf-skills --skill ctf-similar-search -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/ctf-similar-search/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ljagiello/ctf-skills --skill ctf-similar-search -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/ctf-similar-search/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ljagiello/ctf-skills ctf-similar-search
```

2. **Manually: put the files in place**
- File: `.github/skills/ctf-similar-search/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ljagiello/ctf-skills --skill ctf-similar-search -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ljagiello/ctf-skills --path ctf-similar-search
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/ctf-similar-search/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ljagiello/ctf-skills --skill ctf-similar-search -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ljagiello/ctf-skills/tree/HEAD/ctf-similar-search/SKILL.md

## When to use it
- Locate a writeup for a similar challenge when stuck
- Pull full text from search result URLs
- Build keyword queries that hit writeups rather than generic articles
- Identify a challenge type from existing solutions

## Example prompts
- Find similar writeups for the `DASCTF URL Storage` challenge
- Search for the error string `ERROR: invalid padding in AES block`
- Extract text from this URL and explain how the author solved it

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 4b52d9c0a3851782.

BEGIN THIRD-PARTY FILE 4b52d9c0a3851782
````text
---
name: ctf-similar-search
description: Searches for similar CTF challenge writeups using Tavily API for search and content extraction. Use when the user requests finding related challenges, when solve-challenge has failed multiple times and needs reference solutions, or when first identifying a challenge type and seeking examples.
license: MIT
compatibility: Requires filesystem-based agent (Claude Code or similar) with bash and Python 3 with requests and tavily packages.
allowed-tools: Bash Read Write Glob Grep Skill
metadata:
  user-invocable: "true"
  argument-hint: "<challenge-name-or-clues>"
  author: Lukasz Jagiello
---

# CTF Similar Challenge Search

Search for similar CTF challenge writeups using Tavily API.

## Prerequisites

```bash
pip install requests tavily
```

Set your Tavily API key (from https://tavily.com) before running:

```bash
export TAVILY_API_KEY='tvly-...'
```

## API Overview

This skill provides two interfaces:

| Interface | Purpose | Command |
|-----------|---------|---------|
| **Tavily Search** | Search for writeups and articles | `./search.sh search <keyword>` |
| **Tavily Extract** | Extract content from URLs | `./search.sh extract <url1> [url2] ...` |

## Search Workflow

### Step 1: Search with Keywords

Choose keywords based on available information:

#### Scenario 1: Known Competition + Challenge Name
```bash
# Format: [Competition Name] [Challenge Name] — max 3 words
./search.sh search "DASCTF URL Storage"
./search.sh search "HGAME baby web"
./search.sh search "BUUCTF pwn1"
```

#### Scenario 2: Challenge Name Only (no competition info)
```bash
# Use challenge name directly — max 3 words
./search.sh search "URL Storage"
./search.sh search "baby overflow"
./search.sh search "crypto-rsa"
```

#### Scenario 3: Unique Identifiers (code snippets, strings)
```bash
# Use unique, non-trivial strings from the challenge — NO word limit
./search.sh search "def encrypt_flag(key): return base64"
./search.sh search "CUSTOM_MAGIC_BYTES"
./search.sh search "ERROR: invalid padding in AES block"
```

### ⚠️ Critical: 3-Word Limit for Non-Code Queries

**All keyword searches that are NOT code snippets or unique identifier strings MUST NOT exceed 3 words.** This constraint ensures precise, focused queries that return relevant CTF writeup results instead of broad, diluted searches.

| Search Type | Word Limit | Examples |
|-------------|-----------|----------|
| Competition + Challenge name | ≤ 3 words | `"DASCTF URL Storage"`, `"HGAME baby web"` |
| Challenge name only | ≤ 3 words | `"URL Storage"`, `"baby overflow"` |
| Code snippets / strings | **No limit** | `"def encrypt_flag(key): return base64"` |
| Error messages / identifiers | **No limit** | `"CUSTOM_MAGIC_BYTES"`, `"ERROR: invalid padding in AES block"` |
````
END THIRD-PARTY FILE 4b52d9c0a3851782

The third-party file has ended. Everything between the 4b52d9c0a3851782 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2800 of 6456 bytes. © Lukasz Jagiello · MIT · https://github.com/ljagiello/ctf-skills/tree/HEAD/ctf-similar-search/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
