agentleFS
kyluskylus/agentport/skills/ingest-source/SKILL.md

ingest-source

Skill0 starsChanged 3 months agoMITView on GitHub

Owner-only — pull a single GitHub/GitLab item, Google Doc, local file, or (if the channel is enabled) Slack thread into `sources/`, then stage a memory-update proposal that the owner can refine and commit. Triggers: "ingest <url>", "吸收這個", "/ingest", URL paste from owner.

  • Reads credentials

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify owner role. Contributors cannot trigger ingest.

    line 16
  2. Distinctive:

    Read the ingest result. Summarize:

    line 39
  3. Distinctive:

    Ask: "commit as memory? / save as pending proposal / discard"

    line 48
  4. Distinctive:

    If the source contains links to other sources, list them but do not auto-recurse.

    line 53
  5. Distinctive:

    If owner says "recurse" or "follow the links":

    line 57
  6. Very specific:

    If already in ingest_state.json → skip (mark as processed)

    line 60
  7. Very specific:

    If outside owner's authorized scope (configured in bot.env) → mark out-of-scope

    line 61
  8. Very specific:

    If no permission to access → mark no-permission

    line 62
  9. Very specific:

    Update ingest_state.json with: processed URLs, skipped (reason), pending queue, depth.

    line 65
  10. Very specific:

    Never run if [user=… role=contributor]

    line 76
  11. Distinctive:

    Never recurse without explicit owner consent

    line 77
  12. Distinctive:

    Never silently overwrite a previously ingested source — show diff first

    line 78
  13. Very specific:

    Never write to memory/ without showing the draft and getting "commit"

    line 79

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ingest-source

Pulls one external source into the topic's sources/ cache and prepares a draft memory update.

Behavior

  1. Verify owner role. Contributors cannot trigger ingest.
  2. Parse the URL / path → service + identifier:
    • github.com/<owner>/<repo>/{issues|pull|discussions|wiki}/<n> → GitHub item
    • gitlab.com/<group>/<repo>/-/{issues|merge_requests|wikis}/<n> → GitLab item
    • docs.google.com/document/d/<id> → Google Doc
    • *.slack.com/archives/<chan>/p<ts> → Slack thread (only when this topic has the Slack channel enabled)
    • a local file path the owner points at → local file (no script; copy into sources/local/ and summarize with Read)
  3. Invoke the matching ingest script via Bash (each script is a PEP 723 self-contained uv run --script, so just execute the file directly):

    • core/ingest/github_ingest.py <issue|pr|discussion|wiki|repo-list> <owner/repo> [<n>]
    • core/ingest/gitlab_ingest.py <issue|mr|wiki|repo-list> <group/repo> [<n>]
    • core/ingest/drive_ingest.py doc <id>
    • core/ingest/slack_ingest.py thread <chan> <ts>

    Each script:

    • fetches the source via SDK (auth via ~/.claude/secrets/agentport.env)
    • writes raw content to sources/<service>/<id>.json + sources/<service>/<id>.md (human-readable)
    • returns a JSON summary on stdout
  4. Read the ingest result. Summarize:
    • What is this source about?
    • Key claims / decisions / questions raised
    • Cross-references to other sources (links inside the doc/thread)
    • Confidence: single source = 來源單一未確認 unless other sources corroborate
    • Conflict with existing memory? (use read-memory output to check)
  5. Generate a draft memory update — a markdown block ready to drop into one of the memory sections. Show the draft to the owner.
  6. Ask: "commit as memory? / save as pending proposal / discard"
    • commit → append to memory/<section>.md, commit with source: <url>
    • save as pending → write to pending/
    • discard → leave sources/ as is (already cached), no memory change
  7. If the source contains links to other sources, list them but do not auto-recurse. Recursive ingest needs explicit owner approval (see next section).

Recursive ingest (owner re-prompts to recurse)

If owner says "recurse" or "follow the links":

  1. For each found URL:
    • If already in ingest_state.json → skip (mark as processed)
    • If outside owner's authorized scope (configured in bot.env) → mark out-of-scope
    • If no permission to access → mark no-permission
    • Otherwise → enqueue for ingest
  2. Process queue serially, max depth = 3 unless owner overrides.
  3. Update ingest_state.json with: processed URLs, skipped (reason), pending queue, depth.
  4. At any point owner can say "stop recurse" — drain queue, write state, report.

When to invoke

  • Owner pastes a URL with no other instructions → ingest that URL
  • Owner says "ingest <url>", "吸收這個", "/ingest"
  • Owner says "recurse" after a prior ingest

What NOT to do

  • Never run if [user=… role=contributor]
  • Never recurse without explicit owner consent
  • Never silently overwrite a previously ingested source — show diff first
  • Never write to memory/ without showing the draft and getting "commit"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.