Knowledge intake

From athola/claude-night-market · View interactive version

Knowledge intake is an AI agent skill from the GitHub repository athola/claude-night-market. Processes external resources into stored knowledge with quality scoring and routing. Use when ingesting articles, papers, or docs into a memory palace.

How to use this skill

Skill file

Knowledge Intake

Process external resources into the knowledge store. When a user links an article, blog post, or paper, this skill guides evaluation, storage decisions, and application routing.

When To Use

When NOT To Use

What It Is

A knowledge governance framework that answers three questions for every external resource:

  1. Is it worth storing? - Evaluate signal-to-noise and relevance
  2. Where does it apply? - Route to local codebase or meta-infrastructure
  3. What does it displace? - Identify outdated knowledge to prune

The Intake Signal

When a user links an external resource, it is a signal of importance.

The act of sharing indicates the resource passed the user's own filter. Our job is to:

Quick Start

When a user shares a link:

1. FETCH    → Detect format, retrieve and convert content
2. EVALUATE → Apply importance criteria
3. DECIDE   → Storage location and application type
4. STORE    → Create structured knowledge entry
5. VALIDATE → Scribe verification (slop scan + doc verify)
6. CONNECT  → Link to existing palace structures
7. PROMOTE  → Offer Discussion promotion (score 80+)
8. APPLY    → Route to codebase or infrastructure updates
9. PRUNE    → Identify displaced/outdated knowledge

Step 1: FETCH with Format Detection

Before retrieving content, detect the source format from

the URL or file path to choose the right retrieval method.

Web articles and blog posts (default path):

Use WebFetch to retrieve HTML content directly.

No conversion needed.

Document URLs (PDF, DOCX, PPTX, XLSX):

Apply the leyline:document-conversion protocol.

This tries the markitdown MCP tool first for high-quality

markdown, then falls back to native Claude Code tools

(Read for PDFs, etc.), then informs the user if the

format is unsupported without markitdown.

Local files (user shares a file path):

Construct a file:// URI from the absolute path and

apply the leyline:document-conversion protocol.

Format detection heuristics:

| URL Pattern | Format | Retrieval |

|-------------|--------|-----------|

| *.pdf, arxiv.org/pdf/* | PDF | document-conversion |

| *.docx, *.doc | Word | document-conversion |

| *.pptx, *.ppt | PowerPoint | document-conversion |

| *.xlsx, *.xls | Excel | document-conversion |

| *.epub | E-book | document-conversion |

| drive.google.com/* | Various | document-conversion |

| Everything else | HTML/web | WebFetch (existing) |

After retrieval (regardless of method), wrap the content

in external content boundary markers per

leyline:content-sanitization before proceeding to

Step 2 (EVALUATE).

Step 5: Scribe Validation (Required)

All knowledge corpus entries MUST pass scribe validation before finalizing.

Run Skill(scribe:slop-detector) on the new entry:

Use Agent(scribe:doc-verifier) to validate:

# Quick validation for knowledge corpus entry
/slop-scan docs/knowledge-corpus/[entry-name].md
# Doc verification is now agent-only:
Agent(scribe:doc-verifier) "Verify docs/knowledge-corpus/[entry-name].md"

DO NOT finalize entries with slop score > 2.5 - rewrite with concrete specifics.

Step 7: Discussion Promotion (Score 80+ Only)

When the evaluation score is 80-100 (evergreen), you

MUST execute the Discussion promotion workflow. If the

score is below 80, skip this step entirely.

Execute these steps in order:

  1. Read modules/discussion-promotion.md for the

full GraphQL workflow

  1. Tell the user: "This entry has reached evergreen

maturity. Publishing to GitHub Discussions. [Y/n]"

  1. If the user says "n", skip to Step 8 (APPLY)
  2. Run the gh api graphql commands from the module

to create or update a Discussion in the "Knowledge"

category

  1. Update the local corpus entry with discussion_url

update the existing Discussion instead of creating

a new one

the user and continue to Step 8 (APPLY)

Publishing is the default for qualifying entries. It

never blocks the intake workflow.

Evaluation Framework

Importance Criteria

| Criterion | Weight | Questions |

|-----------|--------|-----------|

| Novelty | 25% | Does this introduce new patterns or concepts? |

| Applicability | 30% | Can we apply this to current work? |

| Durability | 20% | Will this remain relevant in 6+ months? |

| Connectivity | 15% | Does it connect to multiple existing concepts? |

| Authority | 10% | Is the source credible and well-reasoned? |

Scoring Guide

Application Routing

Local Codebase Application

Apply when knowledge directly improves current project:

Action: Update code, add comments, create ADR

Meta-Infrastructure Application

Apply when knowledge improves our plugin ecosystem:

Action: Update skills, create modules, enhance agents

Routing Decision Tree

Is the knowledge...
├── About HOW we build things? → Meta-infrastructure
│   ├── Skill patterns → Update abstract/memory-palace skills
│   ├── Learning methods → Add to knowledge-corpus
│   └── Tool techniques → Create new skill module
│
└── About WHAT we're building? → Local codebase
    ├── Domain knowledge → Store in project docs
    ├── Implementation patterns → Update code/architecture
    └── Bug/issue solutions → Apply fix, document

Storage Locations

| Knowledge Type | Location | Format |

|----------------|----------|--------|

| Meta-learning patterns | docs/knowledge-corpus/ | Full memory palace entry |

| Skill design insights | skills/*/modules/ | Technique module |

| Tool/library knowledge | docs/references/ | Quick reference |

| Temporary insights | Digital garden seedling | Lightweight note |

The Tidying Imperative (KonMari-Inspired)

"A cluttered palace is a cluttered mind."

New knowledge often displaces old, but time is not the criterion.

Relevance and aspirational alignment are.

The Master Curator

The human in the loop defines what stays. Before major tidying:

  1. Who are you becoming? - Your aspirations as a developer
  2. What excites you now? - Genuine enthusiasm, not "should"
  3. What have you outgrown? - Past interests consciously left behind

The Two Questions

For each piece of knowledge, both must be yes:

Tidying Actions

| Finding | Action |

|---------|--------|

| Supersedes | Archive old with gratitude, link as context |

| Contradicts | Evaluate both, keep what sparks joy |

| No longer aligned | Release with gratitude |

| Complements | Create bidirectional links |

"I might need this someday" is fear talking. Release it.

Marginal Value Filtering and Quality Scoring

Before storing anything, run the marginal value filter: an entry that

cannot teach something the corpus does not already teach is skipped.

After storage, RL usage signals, quality decay and the anchor-question

clarity gate keep each entry's score current. Source lineage records

provenance and does not change a score. The

three-step filter, its API, the autonomy levels and the scoring model

are in modules/quality-scoring.md.

Workflow Example

User shares: "Check out this article on structured concurrency"

intake:
  source: "https://example.com/structured-concurrency"

# PHASE 3: Marginal Value Filter
marginal_value:
  redundancy:
    level: partial_overlap
    overlap_score: 0.65
    matching_entries: [async-patterns, python-concurrency]
  delta:
    type: novel_insight
    value_score: 0.75
    novel_aspects: [structured, taskgroup, context-manager]
    teaching_delta: "Introduces structured concurrency pattern"
  integration:
    decision: standalone
    confidence: 0.80
    rationale: "Novel insights justify standalone entry"

# Continue with evaluation if filter passes
evaluation:
  novelty: 75        # New pattern for error handling
  applicability: 90  # Directly relevant to async code
  durability: 85     # Core concept, won't age quickly
  connectivity: 70   # Links to error handling, async patterns
  authority: 80      # Well-known author, cited sources
  total: 82          # Evergreen, store and apply

routing:
  type: both
  local_application:
    - Refactor async error handling in current project
    - Add structured concurrency pattern to codebase
  meta_application:
    - Create module in relevant skill
    - Add to knowledge-corpus as reference

storage:
  location: docs/knowledge-corpus/structured-concurrency.md
  format: memory_palace_entry
  maturity: growing

pruning:
  displaces:
    - Old async error patterns (mark deprecated)
  complements:
    - Existing error handling module
    - Async patterns documentation

Queue Processing

Research sessions and external content are automatically queued for review in docs/knowledge-corpus/queue/.

Processing Queue Entries

# List pending queue entries
ls -1t docs/knowledge-corpus/queue/*.yaml

# Review specific entry
cat docs/knowledge-corpus/queue/2025-12-31_topic.yaml

# Process approved entry
# 1. Create memory palace entry in docs/knowledge-corpus/
# 2. Update queue entry status to 'processed'
# 3. Archive or delete queue entry

Queue Integration

The research-queue-integration hook automatically queues:

Queue entry format: written by hooks/research_queue.py, one YAML file per entry

Queue Status Workflow

pending_review → [Review] → approved/rejected
approved → [Create Entry] → processed
processed → [Archive] → queue/archive/

Automation

developer drafts (docs/developer-drafts/), and appends audit rows to docs/curation-log.md.

Detailed Resources

for evergreen entries (score 80+). Publishing is the

default action.

See modules/discussion-promotion.md for full workflow.

Hook Integration

Memory-palace hooks (user_prompt, web_research_handler,

local_doc_processor, research_queue) add a context message when

content may need intake. They deduplicate against

memory-palace-index.yaml and run safety checks first. Triggers,

signals and the index schema are in modules/hook-integration.md.

Integration

modules/quality-scoring.md

Exit Criteria

produces no index entry (enforced by web_research_handler)

value probe names a concrete capability the knowledge enables

routing decision from the Application Routing tree

stored as full knowledge notes

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.