aif-reference
Skill10 starsChanged 6 months agoMITView on GitHub
Create knowledge references from URLs, documents, or files for use by AI agents. Fetch, process, and store structured references in the configured references directory (default: .ai-factory/references/).
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- letuhao/lore-weaveedited, first seen Oct 17, 2026
- lee-to/ai-factoryedited, first seen Sep 22, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- lee-to/ai-factory★ 1.2k61% same
- letuhao/lore-weave★ 3583% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- site-docs/AGENTS.mdAGENTS.md
- web/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- web/CLAUDE.mdCLAUDE.md
- aif-architectureSkill
- aif-best-practicesSkill
- aif-build-automationSkill
- aif-ciSkill
- aif-commitSkill
- aif-distillationSkill
- aif-dockerizeSkill
- aif-docsSkill
- aif-evolveSkill
- aif-exploreSkill
- aif-fixSkill
- aif-groundedSkill
- aif-implementSkill
- aif-improveSkill
- aif-loopSkill
- aif-planSkill
- aif-qaSkill
- aif-reviewSkill
- aif-roadmapSkill
- aif-rules-checkSkill
- aif-rulesSkill
- aif-security-checklistSkill
- aif-skill-generatorSkill
- aifSkill
- aif-verifySkill
- generate-claudemdSkill
- aif-architectureSkill
- aif-best-practicesSkill
- aif-build-automationSkill
- aif-ciSkill
- aif-commitSkill
- aif-distillationSkill
- aif-dockerizeSkill
- aif-docsSkill
- aif-evolveSkill
- aif-exploreSkill
- aif-fixSkill
- aif-groundedSkill
- aif-implementSkill
- aif-improveSkill
- aif-loopSkill
- aif-planSkill
- aif-qaSkill
- aif-referenceSkill
- aif-reviewSkill
- aif-roadmapSkill
- aif-rules-checkSkill
- aif-rulesSkill
- aif-security-checklistSkill
- aif-skill-generatorSkill
- aifSkill
- aif-verifySkill
- generate-claudemdSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 14 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Create structured knowledge references from external sources and store them in the configured references directory so other AI Factory …
- Very specific: line 22
FIRST: Read .ai-factory/config.yaml if it exists to resolve:
- Very specific: line 26
If config.yaml doesn't exist, use defaults:
- Distinctive: line 39
Treat them as project-level overrides for this skill's general instructions
- Very specific: line 40
When a skill-context rule conflicts with a general rule written in this SKILL.md,
- Distinctive: line 42
When there is no conflict, apply both
- Distinctive: line 46
Enforcement: After generating any output artifact, verify it against all skill-context rules.
- Distinctive: line 47
If any rule is violated - fix the output before presenting it to the user.
- Distinctive: line 73
Ensure the resolved references directory exists:
- Distinctive: line 79
Check for existing references to avoid duplicates:
- Very specific: line 85
If --name <ref-name> is provided, use it as the reference name.
- Very specific: line 86
If --update is provided, find and update the existing reference instead of creating a new one.
- Distinctive: line 104
If critical sub-pages are referenced, fetch them too (up to 8 extra pages per source URL).
- Very specific: line 105
If obvious gaps remain, run 1-2 targeted WebSearch queries to fill them.
- Very specific: line 109
Read each file with Read
- Distinctive: line 110
If the file references other local files, read those too (up to 5 levels of includes)
- Distinctive: line 117
Do they have URLs or local files, or should you search?
- Distinctive: line 173
Source attribution: - always include source URLs or paths
- Very specific: line 179
Use lowercase, hyphens, .md
- Very specific: line 180
If --name was provided, use that (add .md if missing)
- Very specific: line 181
Avoid generic names like reference.md
- Very specific: line 187
Check if <resolved references dir>/INDEX.md exists.
- Very specific: line 211
When --update is present:
- Very specific: line 221
$aif-reference list: - read and display <resolved references dir>/INDEX.md or list files in the directory - Very specific: line 222
$aif-reference show <name>: - read and display the reference content (.md is optional) - Very specific: line 223
$aif-reference delete <name>: - ask for confirmation, delete the file, and update INDEX.md - Very specific: line 243
Read-only: all other .ai-factory/ files
- Distinctive: line 249
No duplication: check existing references before creating a new one
- Distinctive: line 250
No stale data: always include sources so the reference can be refreshed
- Distinctive: line 252
Respect access: if a URL requires authentication or fails to load, report that instead of guessing
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reference Creator
Create structured knowledge references from external sources and store them in the configured references directory so other AI Factory skills can reuse them later.
Step 0: Load Config
FIRST: Read .ai-factory/config.yaml if it exists to resolve:
- Paths:
paths.referencesandpaths.rules_file - Language:
language.uifor prompts
If config.yaml doesn't exist, use defaults:
- references/:
.ai-factory/references/ - RULES.md:
.ai-factory/RULES.md - Language:
en(English)
Project Context
Read .ai-factory/skill-context/aif-reference/SKILL.md - MANDATORY if the file exists.
This file contains project-specific rules accumulated by $aif-evolve from patches,
codebase conventions, and tech-stack analysis. These rules are tailored to the current project.
How to apply skill-context rules:
- Treat them as project-level overrides for this skill's general instructions
- When a skill-context rule conflicts with a general rule written in this SKILL.md, the skill-context rule wins
- When there is no conflict, apply both
- CRITICAL: skill-context rules apply to ALL outputs of this skill - including the generated reference files. If a skill-context rule says "references MUST include X" - you MUST comply.
Enforcement: After generating any output artifact, verify it against all skill-context rules. If any rule is violated - fix the output before presenting it to the user.
When To Use
- AI needs documentation it was not trained on or may know only partially
- You want grounded answers based on specific docs, specs, or internal files
- You want reusable domain context for
$aif-plan,$aif-implement,$aif-explore, or$aif-grounded - You want a durable knowledge artifact instead of one-off conversation context
Argument Detection
Check $ARGUMENTS:
- Contains "--update" -> Update Mode: refresh existing reference
- Contains URLs (http/https) -> URL Mode: fetch and process web sources
- Contains file paths -> File Mode: process local documents
- "list" -> List existing references
- "show <name>" -> Show reference content
- "delete <name>" -> Delete a reference (with confirmation)
- Empty -> Interactive modeWorkflow
Step 0.1: Setup
Ensure the resolved references directory exists:
mkdir -p <resolved references dir>Check for existing references to avoid duplicates:
ls <resolved references dir>If --name <ref-name> is provided, use it as the reference name.
If --update is provided, find and update the existing reference instead of creating a new one.
Step 1: Collect Sources
For URLs:
For each URL:
- Fetch the page using
WebFetchand extract:- main topic and purpose
- key concepts, terms, and definitions
- code examples and patterns
- API methods, parameters, return types, and signatures
- configuration options with defaults
- best practices and recommendations
- error handling and edge cases
- version information and compatibility notes
- links to critical sub-pages
- If critical sub-pages are referenced, fetch them too (up to 8 extra pages per source URL).
- If obvious gaps remain, run 1-2 targeted
WebSearchqueries to fill them.
For local files:
- Read each file with
Read - If the file references other local files, read those too (up to 5 levels of includes)
- Detect the format (markdown, HTML, JSON, YAML, plain text) and extract accordingly
For interactive mode:
Ask the user:
- What topic or technology should this reference cover?
- Do they have URLs or local files, or should you search?
- What aspects matter most for their use case?
Step 2: Synthesize the Reference
Transform collected material into a structured reference document.
Reference file format:
# <Topic> Reference
> Source: <list of source URLs or file paths>
> Created: YYYY-MM-DD
> Updated: YYYY-MM-DD
## Overview
<1-3 paragraph summary>
## Core Concepts
<Concept 1>: <clear explanation>
<Concept 2>: <clear explanation>
## API / Interface
<Only if applicable. Preserve exact signatures and types from source docs.>
## Usage Patterns
<Practical code examples organized by use case.>
## Configuration
<Options, defaults, valid values. Table format preferred.>
## Best Practices
<Numbered list with reasoning>
## Common Pitfalls
<What goes wrong and how to avoid it>
## Version Notes
<Only if relevant. Breaking changes, migration notes, deprecations.>Quality rules:
- No hallucination - include only what was actually found
- Preserve code verbatim - docs examples must stay exact
- Actionable over academic - optimize for useful lookup
- Dense - maximize useful information per line
- Complete signatures - APIs need full parameters, types, and returns
- Source attribution - always include source URLs or paths
Step 3: Name and Save
Naming convention:
- Derive from topic:
react-hooks.md,fastapi-endpoints.md,docker-compose.md - Use lowercase, hyphens,
.md - If
--namewas provided, use that (add.mdif missing) - Avoid generic names like
reference.md
Save to: <resolved references dir>/<name>.md
Step 4: Register in Index
Check if <resolved references dir>/INDEX.md exists. Create or update it:
# References Index
Available knowledge references for AI agents.
| Reference | Topic | Sources | Updated |
|-----------|-------|---------|---------|
| [react-hooks](react-hooks.md) | React Hooks API and patterns | react.dev | 2026-03-20 |
| [docker-compose](docker-compose.md) | Docker Compose configuration | docs.docker.com | 2026-03-20 |Step 5: Report
Show the user:
- reference name and path
- size (line count)
- sections included
- source URLs or file paths used
- how to use it in later AI Factory workflows
Update Mode (--update)
When --update is present:
- Find the existing reference by
--nameor matching sources - Re-fetch the sources listed in the header
- Compare new material with existing content and update only changed sections
- Preserve
Created:, updateUpdated: - Report what changed
List / Show / Delete
$aif-reference list- read and display<resolved references dir>/INDEX.mdor list files in the directory$aif-reference show <name>- read and display the reference content (.mdis optional)$aif-reference delete <name>- ask for confirmation, delete the file, and updateINDEX.md
Integration With Other Skills
References in the resolved references directory are available to all AI Factory skills:
$aif-planand$aif-implementcan read them for domain context$aif-groundedcan use them as evidence sources$aif-explorecan reference them during research
To make a skill aware of a specific reference, mention it in the resolved RULES.md file:
## References
- For <topic> details, see `<resolved references dir>/<name>.md`Artifact Ownership
- Primary ownership: the resolved references directory (default:
.ai-factory/references/) - Shared ownership: the resolved references index file (
INDEX.mdinside that directory) - Read-only: all other
.ai-factory/files - Config policy: config-aware. Use
paths.referencesfor storage andpaths.rules_filewhen pointing other skills at a saved reference.
Guardrails
- Max reference size: aim for under 1000 lines per reference. If larger, split into multiple files and create a directory inside the resolved references dir with an
INDEX.mdinside - No duplication: check existing references before creating a new one
- No stale data: always include sources so the reference can be refreshed
- No opinions: references should reflect sources, not personal preferences
- Respect access: if a URL requires authentication or fails to load, report that instead of guessing
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
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.

