# Show a real result before restart

Site lane handoff for setup SKILL.md: after configuring Edge and recording the existing local-skill consent choice, demonstrate a real search in the current session. Do this before the final restart instruction. Adding an MCP server cannot retroactively expose its tools to the agent that is performing setup, so use the HTTP endpoint for this one demonstration.

1. Inspect the current workspace locally and choose one concrete specialist task it actually needs. Use the user's current task when possible. Describe the task without secrets, personal data, source code, or private file paths. If the workspace has no identifiable task, ask which task the user wants help with. Do not invent a project or show fabricated results.
2. Create `FIRST-TASK-PENDING` in the installed Edge skill directory for this host. Do not overwrite an existing marker. For Claude Code, this is `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/edge`; for Codex, `${CODEX_HOME:-$HOME/.codex}/skills/edge`.
3. Run the curl search below with that real task. Use the key only if the user already provided one, via the environment. Never echo the key, place it in a command argument, or save the request body to disk. This demonstration sends the task query to Edge, unlike the local prompt hook. It does not send local skill metadata or enable local ranking.
4. Read the actual returned `text`. Show the top three candidates with their names, links, and one short sentence explaining relevance. If fewer than three are returned, show only those. Quote any returned `Edge moved this up from #...` evidence for those candidates. If no movement is reported, say so. A Free response does not prove personalized value; do not invent an uplift, a baseline position, or a Pro entitlement. If the API fails, state that the demo could not be completed and do not present sample output as a result.
5. Only after showing the real result (or clearly reporting the failed attempt), say: "restart to use it inside your agent". Continue the user's task with the capabilities available now.

For this repository, a real task description is "Review the Edge MCP connector for reliable prompt hooks and first-task marker cleanup." For another workspace, replace it with that workspace's actual task before running:

```bash
# The task is non-sensitive. EDGE_KEY, if supplied, is already in the environment.
export EDGE_DEMO_TASK='Review the Edge MCP connector for reliable prompt hooks and first-task marker cleanup.'
set -o pipefail
node --input-type=module <<'NODE' | curl --fail --silent --show-error --max-time 45 \
  --request POST 'https://getedge.cc/api/mcp/find_skill' \
  --header 'Content-Type: application/json' --data-binary @-
const query = process.env.EDGE_DEMO_TASK?.trim();
if (!query || query.length < 3 || query.length > 500) process.exit(1);
const key = process.env.EDGE_KEY?.trim();
process.stdout.write(JSON.stringify({ query, ...(key ? { key } : {}) }));
NODE
```

Do not run with shell tracing enabled. The JSON request goes directly into curl's stdin, keeping the key out of the process arguments. Parse the response as JSON and check for a string `text`; curl's success alone is not evidence of a usable result. Choose a skill only if it clearly fits, and inspect its instructions before following them. A successful HTTP demo does not clear the pending marker because it is not the first real connector search in a new session.

An idempotent marker command for Claude Code is:

```bash
node --input-type=module <<'NODE'
import { mkdir, writeFile } from 'node:fs/promises';
import { homedir } from 'node:os';
import { join } from 'node:path';
const directory = join(process.env.CLAUDE_CONFIG_DIR || join(homedir(), '.claude'), 'skills', 'edge');
await mkdir(directory, { recursive: true });
try { await writeFile(join(directory, 'FIRST-TASK-PENDING'), 'pending\n', { flag: 'wx', mode: 0o600 }); }
catch (error) { if (error.code !== 'EEXIST') throw error; }
NODE
```

For Codex, use `process.env.CODEX_HOME || join(homedir(), '.codex')` for the base directory in the same command. On a later session's first successful `find_skill`, the connector removes pending markers from both configured host skill directories. Failed searches and `use_skill` leave them intact. Missing markers are harmless, and a permissions error leaves search usable and is retried after another successful find. The marker contains no key and does not grant local-skill consent.

This lane supplies instructions and tests only. The production demo endpoint was not called while implementing this change; evaluation uses staging and marker tests use a loopback stub.
