Doc

From Llloooggg/LetsFLUTssh · View interactive version

Doc is an AI agent skill from the GitHub repository Llloooggg/LetsFLUTssh. Look up a section of docs/ARCHITECTURE.md without reading the whole file. Given a task description OR a § identifier (numeric like "3.6", "§11" or header fragment like "Security", "Tags", "Transfer Queue"), returns the relevant ARCHITECTURE.md section(s) verbatim. Executes Grep + Read itself in a si

How to use this skill

Skill file

`/doc` — autonomous doc lookup

When invoked, execute every step below yourself using Grep and Read. Do not ask the user to run anything. Do not instruct the user to re-invoke this skill — if a second lookup is needed, chain it internally in the same turn.

Input

A single string $ARGS. Two shapes are accepted:

Execution — a single invocation, done autonomously

  1. Classify the input. $ARGS is a § identifier when it matches ^§?\d+(\.\d+){0,2}$ or is a short phrase that already looks like an ARCHITECTURE.md heading. Everything else is a task description.
  1. If $ARGS is a task description → do steps 3–6. If $ARGS is a § identifier → skip to step 5 with that identifier.
  1. Load the TOC. Read(file_path: "docs/ARCHITECTURE.md", offset: 3, limit: 50) — this covers the ## Table of Contents block. (If the TOC has moved, Grep(pattern: "^## Table of Contents", path: "docs/ARCHITECTURE.md", output_mode: "content", -n: true) to find it, then Read from that offset with limit 55.)
  1. Pick the §s that map to the task. Reason about $ARGS against the TOC entries and pick 1–3 §s that are load-bearing for the task. Be generous — "add a DAO for pinned snippets" should pull §10 Data Models, §11 Persistence, and the §3.x §s for snippets and tags. Print a one-line summary: Task: <$ARGS>. Matched §s: <list>. Then, in the same turn, without asking the user, proceed to step 5 for each matched §.
  1. Locate the heading for each § identifier. Use Grep(path: "docs/ARCHITECTURE.md", output_mode: "content", -n: true):

Record the matched line number and the heading depth (count of #).

  1. Find the end of the §. Grep for the next heading of equal or shallower depth after the matched line:

End line = (next_heading_line - 1). If none found, end = end of file (use Bash("wc -l docs/ARCHITECTURE.md") if you need the exact count).

  1. Read the § body. Read(file_path: "docs/ARCHITECTURE.md", offset: <start>, limit: <end - start + 1>). Sub-§s come along because they live inside the parent range.
  1. Emit the result. Concatenate, in this order, for each § fetched:
  1. Surface cross-links as hints. Scan each emitted body for [§X …](…), […](#…), [ARCHITECTURE §X …](…). If any cross-linked § was not fetched in steps 5–8, list them as bullets at the end:

> Cross-link candidates:

> - §13 Security Model — referenced from the body above.

> - §9.1 SSH Connection Flow — referenced from the body above.

Then, if the current task plausibly depends on any of those, fetch them too by looping back to step 5 with that § id — in the same invocation, without asking the user. Stop when no new load-bearing cross-links appear.

  1. No match? If step 5 finds no heading matching the identifier:

Hard constraints

Worked examples

→ $ARGS = "описание к тегам". Classify as task. Read TOC. Pick §10 Data Models (tag model lives there) and §11 Persistence (tags DAO). Grep + Read both §s. Emit both bodies verbatim with cross-link hints. One invocation.

→ $ARGS = "3.6". Classify as § identifier. Grep ^### 3.6 . Find next ^### or ^## . Read slice. Emit body + cross-links. One invocation.

→ $ARGS = "Security". Classify as § identifier (single word, looks like a header). Grep ^##+ .*Security case-insensitive. Multiple matches possible (### 3.6 Security & Encryption, ## 13. Security Model, ### 16.3 Security Decisions) — emit all three bodies, labelled by anchor.

→ $ARGS = "why is transfer concurrency 2?". Classify as task. Read TOC. Pick §3.3 Transfer Queue. Grep + Read. Emit. If §3.3 cross-links to §9.4, add it to cross-link candidates and fetch inline because the task explicitly asks about the concurrency rationale, which is likely in the flow description too.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.