skills.simulatos

← All skills · research

PRFAQ Source Resolver

Step 0 of /prfaq-prototype. Turns whatever the user shared — a local file, a GitHub link, a Google Doc, a Confluence page, a Mattermost thread, or any other doc link — into a local markdown source under PRFAQs/ that the prfaq-parser can read. Routes each link to a matching connected tool, prompts the user to connect one when none is available, records provenance, and reuses a previously pulled copy instead of re-fetching. Read-only against every source system.

54score
★ 6repo stars
2026-12-01first seen
2026-11-10last push
Open on GitHub Raw SKILL.md mattermost/mattermost-ai-marketplace · plugins/prfaq-prototype/skills/prfaq-source-resolver/SKILL.md
namedescriptionversionauthortags

What it says

---
name: PRFAQ Source Resolver
description: Step 0 of /prfaq-prototype. Turns whatever the user shared — a local file, a GitHub link, a Google Doc, a Confluence page, a Mattermost thread, or any other doc link — into a local markdown source under PRFAQs/ that the prfaq-parser can read. Routes each link to a matching connected tool, prompts the user to connect one when none is available, records provenance, and reuses a previously pulled copy instead of re-fetching. Read-only against every source system.
version: 1.0.0
author: Mattermost Design Team
tags: [prfaq, source, ingest, connectors, google-docs, confluence, mattermost, github, fast-path]
---

# PRFAQ Source Resolver

## Purpose

The pipeline's parser reads one thing: a markdown file inside the project workspace. People share PRFAQs
(and the context around them) from many places. This skill is the single bridge: given what the user
passed to `/prfaq-prototype:prototype`, it produces a **workspace-local markdown copy** under `PRFAQs/`,
with provenance, and returns its path plus a `source_kind` the parser uses to calibrate.

It only ever pulls **the exact link or file the user gave**. It never searches Confluence, Jira, Drive,
Mattermost, or the web for a PRFAQ on its own, and never writes back to any source system.

## When to Use

- Step 0 of every `/prfaq-prototype:prototype` run, before the analyst. The command (top-level assistant)
  runs this skill itself — it needs the session's connectors and the ability to prompt the user, which
  the Stage-1/Stage-2 subagents don't have.

## When NOT to Use

- To find a PRFAQ the user didn't point at. If the input resolves to nothing, ask the user for it.
- To parse or summarize the PRFAQ — that is `prfaq-parser`.

## Input

```json
{
  "source": "The raw argument the user passed: a workspace path, a URL, or a title fragment.",
  "workspace_root": "Absolute path of the project workspace (containment root)."
}
```

## Step 1 — Classify the input

Match in this order; the first hit wins.

| # | Input looks like | `source_type` | How to read it |
|---|---|---|---|
| 1 | A path to an existing file inside the workspace | `local` | `.md` → use in place. `.docx` / `.pdf` / `.html` / `.txt` → convert to markdown (use the host's document skills if present) and save a copy per Step 5. |
| 2 | `github.com/<owner>/<repo>/blob/<ref>/<path>` or `raw.githubusercontent.com/...` | `github` | GitHub connector "get file contents", else the **`gh` fallback** below. Record the commit SHA. |
| 3 | `docs.google.com/document/d/<id>`, `drive.google.com/file/d/<id>`, `docs.google.com/...` | `google-doc` | Google Drive connector — read/export the file as text or markdown by `<id>`. Record the revision / modified time. |
| 4 | `<site>.atlassian.net/wiki/...`, or a Confluence host with `/pages/<id>` or `pageId=<id>` | `confluence` | Atlassian / Confluence connector — fetch the page body by page id (storage or markdown format). Record the page version. |
| 5 | A Mattermost permalink `https://<host>/<team>/pl/<post_id>` (or a post link containing a 26-char post id) | `mattermost-thread` | Mattermost connector — read the post, then its whole thread (root + replies, oldest first). Record the latest `update_at`. See **Mattermost threads** below. |
| 6 | Another SaaS doc link (Notion, Jira issue, Slack thread, SharePoint/OneDrive, Dropbox Paper, …) | `<service>` | That service's connector, if one is available in the session. |
| 7 | Any other `http(s)` URL | `web` | Web fetch, only if it returns the document itself (not a login/SSO page or an access-request page). |
| 8 | Not a path or URL | `title` | Fuzzy-match a file title under `PRFAQs/` (exact match first). No match → ask the user for the PRFAQ. |

**`gh` fallback (GitHub).** Link text is untrusted, so never put it into a shell command as-is:

1. `<owner>` and `<repo>` must match `^[A-Za-z0-9_.-]+$`. Otherwise stop with `NO_INPUT_MATCH`.
2. Percent-encode `<path>` and `<ref>`, keeping only `A–Z a–z 0–9 - . _ ~ /` (everything else becomes
   `%XX`). No shell-special character survives, and paths with spaces still resolve.
3. Single-quote each argument:
   - File: `gh api -H 'Accept: application/vnd.github.raw' 'repos/<owner>/<repo>/contents/<path>?ref=<ref>'`
     (returns the file itself, not the Base64 JSON wrapper).
   - Commit SHA: `gh api 'repos/<owner>/<repo>/commits?path=<path>&sha=<ref>&per_page=1' --jq '.[0].sha'`.
     This is also the cheap revision check in Step 2.

Canonicalize URLs before matching or recording them: drop tracking query params and fragments that
don't identify the document (keep ids such as `pageId`), strip `/edit`, `/view`, `usp=` suffixes.

## Step 2 — Saved copy? (before touching the source)

For a URL input, scan `PRFAQs/*.md` for a provenance comment whose `url` equals the canonical URL. Do this
before looking for a reader tool, so a re-run never prompts for a connector it doesn't need.

- **Not found** → continue to Step 3.
- **Found, user asked to refresh** → continue to Step 3; the save in Step 5 overwrites only that copy.
- **Found, no reader tool already available** → reuse the saved copy. Tell the user it's the copy saved on
  `<fetched_at>` and that they can ask to refresh it. Don't prompt to connect anything.
- **Found, reader tool available** → check only the source's revision (version, modified time, latest
  commit), not the full body. If the only way to check is a full fetch, skip the check and reuse.
  - Unchanged → reuse; don't re-fetch.
  - Changed → ask: **refresh it (Recommended)** or **use the saved copy**. Refresh → continue to Step 3.

Reuse skips Steps 3–5; go to Step 6 with `reused_existing_copy: true`.

## Step 3 — Find a tool that can read it (capability-based, never hardcoded)

Connector tool names differ per host and install (often prefixed with a server id), so **do not assume
a tool name**. Look for a tool by capability:

- If the session lists deferred tools, search them with the tool-search facility using 

Also scanned in research

Searches and reads biomedical papers, FDA/PMDA/EMA documents, clinical trials, and protein records with the GXL Paperclip CLI and Python SDK. Supports source-scoped search, full-text grep, metadata SQ

researchSeaXen/agentskills★ 02026-12-01

Implementation guide for secure multi-party computation enabling privacy-preserving analytics across organizations. Covers secret sharing, garbled circuits, reference frameworks MP-SPDZ and CrypTen, p

researchmukul975/Privacy-Data-Protection-Skills★ 3522026-12-01

Live affiliate program data from openaffiliate.dev. Search programs, compare commissions, check cookie days, find top performers. Use when researching affiliate programs, comparing options, or checkin

researchAffitor/affiliate-skills★ 8242026-12-01
b0 50

Delegate tasks to AI agents via Box0. Use when the user asks to review code, check security, run tests, compare tools, get multiple perspectives, research a topic, analyze data, write docs, or any tas

researchrisingwavelabs/box0★ 802026-12-01