# Hive Intelligence - Agent Skills

Skill packages for AI coding assistants: Claude Code, Cursor, Codex CLI,
and any other agent that consumes the
[Agent Skills convention](https://github.com/vercel-labs/skills).

## What this is

A skill is a folder of Markdown files that tells an AI agent how to use a
vendor API correctly. For Hive, the skill layer is the agent-facing workflow
surface above the MCP server:

1. Answer common questions with a hero tool, or discover candidates with search.
2. Inspect the exact schema and operation.
3. Execute bounded reads.
4. Preserve each material call's server-minted runtime receipt.
5. Validate the typed workflow envelope, then report provider provenance,
   source recency, missing evidence, and runtime status.

This mirrors the pattern used by strong ecosystem publishers: Vercel ships a
multi-skill repo, Supabase ships focused database and platform skills, and
Firecrawl ships a CLI skill that teaches command selection, output handling,
and escalation.

## Layout

```
agent-skills/
├── package.json       - standalone @hiveintelligence/agent-skills package
├── LICENSE
├── skills.sh.json     - public directory grouping metadata
├── .claude-plugin/     — Claude Code plugin manifest
├── .mcp.json           — hosted Hive MCP server config (wired on plugin install)
├── evals/             - trigger-quality eval prompts
├── references/        - always-on routing snippets for AGENTS.md-style files
├── scripts/           - deterministic package validation
├── README.md
└── packs/
    ├── hive/        — live crypto questions through the eight job tools, with cited sources
    └── hive-setup/  — install, sign in, verify, remove; API keys for servers (user-invoked)
```

## Distribution

The skills folder ships in three places (skills are not published to npm —
the agent-skills ecosystem resolves from GitHub, not npmjs.com):

1. **Bundled with `hive-intelligence`** — the root npm package includes these packs so
   `npx -y -p hive-intelligence@latest hive init --all` can copy them into
   `~/.claude/skills/`, `~/.cursor/skills/`, and other supported clients.

2. **Public GitHub repo** — `npm run codex-plugin:sync` copies these packs into
   `public-repos/hive-sdk/skills/`, which each release publishes to
   [`hive-intel/hive-sdk`](https://github.com/hive-intel/hive-sdk/tree/main/skills)
   (a `skills/<name>/SKILL.md` layout the `skills` CLI walks). Install both
   skills with `npx skills add hive-intel/hive-sdk`, or `hive` alone with
   `npx skills add hive-intel/hive-sdk --skill hive --yes`. The old `hive-intel/hive-skills` mirror is retired.

3. **Public agent-onboarding manifest** — the top-level `SKILL.md` is
   mirrored at `https://www.hiveintelligence.xyz/agent-onboarding/SKILL.md`
   (lives in the `hive-website` repo's `public/` directory). Any AI
   agent that fetches the marketing site's `<link rel="alternate"
type="text/markdown" href="/agent-onboarding/SKILL.md">` discovers
   this file and can self-install Hive.

## Authoring conventions

Each sub-skill follows the same shape:

```
packs/hive-<topic>/
├── SKILL.md          — frontmatter + instructions an agent should follow
├── references/       — deeper docs loaded only when needed
└── evals/            — realistic prompts for regression testing the skill
```

`SKILL.md` frontmatter:

```yaml
---
name: hive-<topic>
description: One-sentence "use this when…" trigger
license: MIT
metadata:
  package: "@hiveintelligence/agent-skills"
  category: "<setup|discovery|domain>"
  requires_network: "true"
version: 1.0.0
---
```

Body shape: short imperative instructions, code examples, links to
canonical docs. Keep each SKILL.md under ~400 lines; agents truncate
long files.

## Patterns copied from high-signal skills

- Keep the install command short and repo-level, then allow single-skill
  installs for narrow workflows.
- Put trigger rules in frontmatter and the first paragraphs, not buried in
  examples.
- Ship a compact always-on routing snippet for `AGENTS.md` / `CLAUDE.md` /
  `GEMINI.md`. Skills are vertical workflow modules; the routing snippet
  removes the "will the agent remember to load the skill?" decision point.
- Prefer progressive disclosure: `SKILL.md` gives the workflow, `references/`
  carries architecture and command matrices, and scripts are reserved for
  deterministic automation.
- Teach the agent how to decide before it executes: search compactly, inspect
  schema/operation, keep calls bounded, then cite provider/runtime receipts.
- Add eval prompts for real user tasks. A skill is not done until trigger
  prompts and output-quality prompts prove it routes and reports better than a
  generic model answer.

## Always-on routing

For agents that support repo-level instruction files, add the compact routing
block from `references/agents-routing.md`. Keep the block short; it should only
decide which Hive skill to load. Detailed endpoint and provider behavior stays
inside the skill packs and their `references/` files.

## Source of truth

The shipped skill metadata source of truth is `src/agentSkills.ts`.
The task-routing source of truth is `src/taskToolsets.ts`.

The sub-skills here are procedural expansions per topic. Run
`npm run verify:agent-skills`, `npx skills add ./agent-skills --list`, and
`npm --workspace @hiveintelligence/agent-skills run pack:check` after editing
this directory. Website copies should mirror these packs, but MCP execution
remains the runtime authority.
