Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

seed default web-search skill on first run

Salman Qureshi8131492e3183
diff --git a/README.md b/README.md
index e5402387..013d852b 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,8 @@ Every AI agent can read files, run commands, and fetch URLs. Most do it silently
- **Always on** — Run as a background daemon on any OS. Auto-restarts on crash. Starts on boot. Cron scheduling, heartbeat monitoring, and proactive notifications.
- **Extensible** — Install community skills with a single command. Schedule skills as recurring tasks. Based on the [Agent Skills](https://agentskills.io) specification.
+Mercury now seeds a default `web-search` skill on first run in `~/.mercury/skills/web-search/SKILL.md`.
+
## Daemon Mode
**One command to make Mercury persistent:**
diff --git a/src/skills/default-skills.ts b/src/skills/default-skills.ts
new file mode 100644
index 00000000..b45e0c2b
--- /dev/null
+++ b/src/skills/default-skills.ts
@@ -0,0 +1,40 @@
+export interface DefaultSkillSeed {
+ dirName: string;
+ fileName: string;
+ content: string;
+}
+
+export const DEFAULT_SKILL_SEEDS: DefaultSkillSeed[] = [
+ {
+ dirName: 'web-search',
+ fileName: 'SKILL.md',
+ content: `---
+name: web-search
+description: Perform web searches using DuckDuckGo HTML and summarize sources.
+version: 1.0.0
+allowed-tools:
+ - fetch_url
+---
+
+# Web Search
+
+Use this skill when the user asks for current events, external facts, or web research.
+
+## Workflow
+
+1. Build a DuckDuckGo HTML search URL:
+ - https://html.duckduckgo.com/html/?q=<query>
+2. Use fetch_url with markdown format to retrieve result page content.
+3. Extract likely source links and open the top relevant pages with fetch_url.
+4. Cross-check key facts across at least 2 sources when possible.
+5. Return a concise answer with source links and clear caveats.
+
+## Rules
+
+- Prefer reliable sources (official docs, primary sources, reputable publications).
+- If information is uncertain or conflicting, say so explicitly.
+- Include source URLs in the response.
+- Avoid fabricated citations.
+`,
+ },
+];
diff --git a/src/skills/loader.ts b/src/skills/loader.ts
index 31d6357c..68f41fe6 100644
--- a/src/skills/loader.ts
+++ b/src/skills/loader.ts
@@ -4,6 +4,7 @@ import { parse as parseYaml } from 'yaml';
import { getMercuryHome } from '../utils/config.js';
import type { SkillDiscovery, Skill, SkillMeta } from './types.js';
import { logger } from '../utils/logger.js';
+import { DEFAULT_SKILL_SEEDS } from './default-skills.js';
const SKILL_FILE = 'SKILL.md';
@@ -40,9 +41,10 @@ export class SkillLoader {
if (!existsSync(this.skillsDir)) {
mkdirSync(this.skillsDir, { recursive: true });
this.seedTemplate();
- return [];
}
+ this.ensureDefaultSkills();
+
const entries = readdirSync(this.skillsDir, { withFileTypes: true });
for (const entry of entries) {
if (!entry.isDirectory() || entry.name.startsWith('_')) continue;
@@ -154,4 +156,16 @@ Describe what this skill enables Mercury to do. When invoked via the use_skill t
writeFileSync(join(templateDir, SKILL_FILE), content, 'utf-8');
logger.info('Seeded template skill');
}
-}
\ No newline at end of file
+
+ private ensureDefaultSkills(): void {
+ for (const seed of DEFAULT_SKILL_SEEDS) {
+ const skillDir = join(this.skillsDir, seed.dirName);
+ const skillFile = join(skillDir, seed.fileName);
+ if (existsSync(skillFile)) continue;
+
+ mkdirSync(skillDir, { recursive: true });
+ writeFileSync(skillFile, seed.content, 'utf-8');
+ logger.info({ skill: seed.dirName }, 'Seeded default skill');
+ }
+ }
+}
diff --git a/website/docs/reference/skills.mdx b/website/docs/reference/skills.mdx
index 9f454427..907779b5 100644
--- a/website/docs/reference/skills.mdx
+++ b/website/docs/reference/skills.mdx
@@ -5,6 +5,14 @@ title: Skills
Skills are markdown-based extensions that live in `~/.mercury/skills/<name>/SKILL.md`.
+## Default skills
+
+On first run, Mercury seeds a built-in `web-search` skill at:
+
+`~/.mercury/skills/web-search/SKILL.md`
+
+If you already have your own `web-search` skill, Mercury does not overwrite it.
+
## Installing
Tell Mercury in conversation:
@@ -20,4 +28,4 @@ Tell Mercury in conversation:
- "Remind me daily at 9am to run the daily-digest skill"
-Skills follow the [Agent Skills specification](https://agentskills.io). They get elevated permissions via `allowed-tools` and are loaded with progressive disclosure to save tokens.
\ No newline at end of file
+Skills follow the [Agent Skills specification](https://agentskills.io). They get elevated permissions via `allowed-tools` and are loaded with progressive disclosure to save tokens.