home / skills / cameronapak / bknd-skills / bknd-repo-search-with-opencode

bknd-repo-search-with-opencode skill

/skills/bknd-repo-search-with-opencode

This skill helps you query the bknd repository with btca, guiding setup, configuration, and targeted questions for learning bknd internals.

npx playbooks add skill cameronapak/bknd-skills --skill bknd-repo-search-with-opencode

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
2.6 KB
---
name: bknd-repo-search-with-opencode
description: Use when querying the bknd source repository with btca CLI. Covers setup, configuration, and query patterns for learning bknd internals including data module, authentication, media handling, and adapter configuration.
compatibility: Requires bun or npm, btca, opencode-ai, and access to the internet
---

# Query bknd with btca

btca is a CLI tool for asking questions about git repos. It clones repositories, indexes them, and answers queries using AI.

## Quick Setup

```bash
# Install btca and OpenCode
bun add -g btca opencode-ai

# Configure model (Big Pickle: free, fast, surprisingly good)
btca config model --provider opencode --model big-pickle

# Add bknd as a resource
btca config resources add --name bknd --type git --url https://github.com/bknd-io/bknd --branch main
```

Or create `btca.config.jsonc`:
```jsonc
{
  "$schema": "https://btca.dev/btca.schema.json",
  "model": "big-pickle",
  "provider": "opencode",
  "providerTimeoutMs": 300000,
  "resources": [
    {
      "type": "git",
      "name": "bknd",
      "url": "https://github.com/bknd-io/bknd",
      "branch": "main"
    }
  ]
}
```

## Core Commands

### Ask a question
```bash
btca ask --resource bknd --question "How do I define a schema?"
```

### Interactive chat
```bash
btca chat --resource bknd
```

### Launch TUI
```bash
btca
```

## Reference Files

For detailed information, see:

- **[setup.md](references/setup.md)** - Full installation, configuration options, resource management, troubleshooting setup issues
- **[query-patterns.md](references/query-patterns.md)** - Specific query patterns for data, auth, media, adapters, and framework integration
- **[advanced.md](references/advanced.md)** - Multi-resource queries, interactive workflows, performance optimization, debugging

## Query Best Practices

1. **Be specific** - "How do I define a schema with a one-to-many relation?" vs "How do I use the data module?"
2. **Provide context** - "I'm using Cloudflare Workers. How do I configure the database adapter?"
3. **Ask for examples** - "Show me a complete example of setting up password authentication"
4. **Reference specific files** - "How does src/App.ts initialize the modules?"

## Learning Workflow

1. **Explore high-level**: Ask about overall architecture and main modules
2. **Module deep-dive**: Use `btca chat --resource bknd` to focus on one module
3. **Implementation details**: Ask to see specific feature implementations
4. **Examples & patterns**: Query the examples directory for best practices

## Resources

- btca docs: https://btca.dev
- bknd docs: https://docs.bknd.io
- bknd repo: https://github.com/bknd-io/bknd

Overview

This skill helps you query the bknd source repository using the btca CLI and the OpenCode provider. It guides setup, configuration, and practical query patterns to explore bknd internals such as the data module, authentication, media handling, and adapter configuration. Use it to quickly locate implementation details, configuration examples, and recommended patterns within the bknd codebase.

How this skill works

Install btca and OpenCode, configure btca to use the opencode provider and your chosen model, and add the bknd git repository as a resource. btca clones and indexes the repo, then answers questions or runs interactive chats against that index. You can run single questions, an interactive chat tied to the bknd resource, or launch the TUI for guided exploration.

When to use it

  • When you want to find how bknd defines schemas, relations, or data flows.
  • When you need implementation examples for authentication and password flows.
  • When configuring adapters for specific runtimes (Cloudflare Workers, Node, etc.).
  • When investigating media handling or storage adapter integrations.
  • When learning the overall architecture and where modules are initialized.

Best practices

  • Be specific: include exact feature, relation type, or runtime in your question.
  • Provide context like deployment target or adapter you plan to use.
  • Reference file paths or symbols (e.g., src/App.ts, data module) to narrow results.
  • Ask for complete examples when you need copy-pasteable code snippets.
  • Use the interactive chat to deep-dive into a single module across multiple follow-ups.

Example use cases

  • Ask: "How do I define a schema with a one-to-many relation in bknd?" and get file references and code snippets.
  • Ask: "Show a complete example of setting up password authentication" to see config, handlers, and tests.
  • Query: "How do I configure the database adapter for Cloudflare Workers?" to see adapter-specific guidance.
  • Explore: "How is media uploaded and stored?" to trace media module code and storage adapters.
  • Use btca chat to iteratively inspect the data module until you understand lifecycle and extensibility points.

FAQ

Which model/provider should I use for fast, free queries?

OpenCode's 'big-pickle' is recommended for fast, free, and reliable results when exploring the repo.

How do I add the bknd repo to my btca config?

Add a git resource pointing at https://github.com/bknd-io/bknd on the main branch via btca config resources add or in btca.config.jsonc.

Can I run multi-repo queries or compare projects?

Yes. Use btca multi-resource configuration to index and query multiple repositories for cross-repo comparisons and patterns.