Skip to content
Back to skills

Package Extensions

ASecurity

"Build and diagnose GraphRAG lower-level package extensions: custom

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
ai-agentsgoexpressapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill package-extensions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Package Extensions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Package Extensions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-package-extensions/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-package-extensions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: package-extensions
description: "Build and diagnose GraphRAG lower-level package extensions: custom
  caches, storage and table providers, input readers, chunkers, vector stores
  and filters, LLM completion/embedding providers, tokenizers,
  metrics/retry/rate-limit/template factories, graph helpers, and indexing
  workflow factories."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# GraphRAG Package Extensions

Use this sub-skill when the task mentions custom providers, factory registration, extension points, offline mocks, graph helper validation, vector-store filters, timestamp/date fields, chunkers, or low-level package diagnostics.

For user-facing YAML/config selection, route to `../configuration-data/`. For indexing orchestration or running pipelines, route to `../indexing/`. For query APIs and result-table requirements, route to `../querying/`.

## Core Pattern

GraphRAG package extensions usually follow the same pattern:

1. Implement the package interface or subclass the base class.
2. Register it under a stable string key with the package `register_*` function.
3. Use the matching config model or `create_*` helper so GraphRAG instantiates it.
4. Keep optional services behind explicit dependency and credential checks.

The shared factory base supports `scope="transient"` and `scope="singleton"`. `create()` removes init args whose value is `None`, so use a sentinel or explicit default if an initializer must distinguish "unset" from `None`. Singleton instances are cached by strategy plus init args; avoid singleton scope for mutable per-run state unless the init args fully identify the state.

## Common Extension Points

- **Cache**: implement `graphrag_cache.Cache`, register with `register_cache(type, initializer, scope="transient")`, create with `create_cache(CacheConfig(...), storage=...)`.
- **Storage**: implement `graphrag_storage.Storage`, register with `register_storage(type, initializer)`, create with `create_storage(StorageConfig(...))`.
- **Table provider**: implement `graphrag_storage.tables.TableProvider`, register with `register_table_provider(type, initializer)`, create with `create_table_provider(TableProviderConfig(...), storage=...)`.
- **Input reader**: subclass or implement `graphrag_input.InputReader`, register with `register_input_reader(type, initializer)`, create with `create_input_reader(InputConfig(...), storage)`.
- **Chunker**: implement `graphrag_chunking.Chunker`, register with `register_chunker(type, initializer)`, create with `create_chunker(ChunkingConfig(...), encode=..., decode=...)`.
- **Vector store**: subclass `graphrag_vectors.VectorStore`, register with `register_vector_store(type, initializer)`, create with `create_vector_store(VectorStoreConfig(...), IndexSchema(...))`.
- **LLM providers**: implement completion or embedding interfaces, register with `register_completion` or `register_embedding`; model config `model_extra` fields are passed through to initializers.
- **LLM utilities**: tokenizer, retry, rate-limit, metrics store/processor/writer, template manager/engine factories have analogous `register_*` and `create_*` helpers.
- **Index workflows**: register workflow callables with `PipelineFactory.register(name, workflow)` and methods with `PipelineFactory.register_pipeline(name, [workflow_names...])`.
- **Graph helpers**: use deterministic DataFrame helpers such as `compute_degree`, `connected_components`, `largest_connected_component`, and `stable_lcc` for offline graph checks.

## Recommended Workflow

1. Identify the package boundary first: storage/cache/input/chunking/vector/LLM/graph/workflow.
2. Inspect the initializer signature of the target base or built-in implementation.
3. Decide factory scope: transient for fresh state, singleton only for shareable clients keyed by complete init args.
4. Register a unique key before calling `create_*`; duplicate keys overwrite the previous initializer in the process.
5. Create a tiny offline mock before adding optional cloud/database dependencies.
6. Add a smoke check for `--help`, factory registration, and one deterministic operation.
7. If wiring through GraphRAG config, move user-facing config guidance to `../configuration-data/`.

## Bundled Scripts

- `scripts/register_mock_extensions.py` demonstrates offline custom storage, cache, input reader, vector store, and direct factory patterns.
- `scripts/validate_graph_helpers.py` checks degree, connected components, stable LCC normalization/order, timestamp explosion, and filter expressions on deterministic in-memory data.

Both scripts are examples for future agents to copy or adapt inside their own workspace. They do not require external services.

## References

- `references/factory-extension-recipes.md` for concrete registration recipes and design notes.
- `references/package-optional-dependencies.md` for guarded dependency and service guidance.
- `references/troubleshooting.md` for factory, config, service, vector filter, and graph-helper failures.

Files in this skill

  • SKILL.md4.9 KB
  • references/factory-extension-recipes.md7 KB
  • references/package-optional-dependencies.md4.5 KB
  • references/troubleshooting.md5.9 KB
  • scripts/register_mock_extensions.py11 KB
  • scripts/validate_graph_helpers.py3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.