Agent skill

Add Augmentation Strategy

by FabioYanezRomero in FabioYanezRomero/Knowledge-Graph-Builder

Adds a new iterative augmentation strategy (e.g., enrichment, summarization) to the builder module.

MITAuto-check passedWriting & Content

Install Add Augmentation Strategy

skills CLI
$ npx skills add FabioYanezRomero/Knowledge-Graph-Builder --skill add-augmentation-strategy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install FabioYanezRomero/Knowledge-Graph-Builder add-augmentation-strategy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/FabioYanezRomero/Knowledge-Graph-Builder.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agent/skills/add-augmentation-strategy .claude/skills/add-augmentation-strategy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-augmentation-strategy
GitHub stars
103
Token cost
~3.3k tokens
SKILL.md length
442 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Adds a new iterative augmentation strategy (e.g., enrichment, summarization) to the builder module.

  • Works in 5 steps: Understand the Protocol → Implement Your Strategy → Create Domain Resources → …
  • Tasks that involve Summarization
  • SKILL.md covers Overview, Architecture, Step 1: Understand the Protocol and Step 2: Implement Your Strategy, plus 7 more sections
  • Calls python

What it does

Add Augmentation Strategy is an agent skill from FabioYanezRomero/Knowledge-Graph-Builder. Adds a new iterative augmentation strategy (e.g., enrichment, summarization) to the builder module.

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Writing & Content, covering Summarization. The repository describes itself as: Repository for building knowledge graphs from specific datasets using generative language model through ollama. The licence is MIT.

When your agent uses it

  • Tasks that involve Summarization

Example prompts

  • “/add-augmentation-strategy”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Understand the Protocol
  2. Implement Your Strategy
  3. Create Domain Resources
  4. Add CLI Subcommand
  5. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 588f0d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Augmentation Strategy loads about 3.3k tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 442 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~31
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from FabioYanezRomero/Knowledge-Graph-Builder at commit 588f0d9, republished under its MIT licence (© FabioYanezRomero). 442 words, ~3,341 tokens.

Download SKILL.mdSave it as .claude/skills/add-augmentation-strategy/SKILL.md (or your agent's skills folder).
name
add-augmentation-strategy
description
Adds a new iterative augmentation strategy (e.g., enrichment, summarization) to the builder module.

Adding an Augmentation Strategy

This skill documents how to add a new augmentation strategy to the kgb/builder module.

Overview

Augmentation strategies are iterative graph refinement algorithms that improve the knowledge graph after initial extraction. The system uses:

  1. A registry pattern with @register_strategy() decorator
  2. Protocol-based design for type safety
  3. Strategy-specific kwargs for flexibility
  4. Schema validation for generated triples

Architecture

Step 1: Extraction          Step 2: Augmentation
    Text                        Initial Triples
      │                              │
      ▼                              ▼
extract_triples()           augment_triples() orchestrator
      │                       ┌──────┴──────┐
      ▼                       ▼             ▼
Initial Triples        connectivity    your_strategy
                              │             │
                              └──────┬──────┘
                                     ▼
                              Refined Triples + Metadata

Key Files:

  • kgb/builder/augmentation.py — Strategy Protocol, Registry, implementations, orchestrator
  • kgb/builder/validation.py — Schema validation, prompt rendering
  • kgb/builder/__init__.py — Public exports

Step 1: Understand the Protocol

All strategies must conform to the AugmentationStrategy Protocol (in kgb/builder/augmentation.py):

python
class AugmentationStrategy(Protocol):
    def __call__(
        self,
        client: BaseLLMClient,
        domain: KnowledgeDomain,
        text: str,
        triples: list[Triple],
        **kwargs: Any
    ) -> tuple[list[Triple], dict[str, Any]]:
        """Returns (refined_triples, metadata)."""
        ...

Strategy-specific parameters (e.g., max_iterations) are passed via **kwargs. Define and document them with keyword-only args in your function signature.

extract() vs augment() — Why Strategies Use augment()

Strategies call client.augment() (NOT client.extract()):

  • extract() uses langextract's source-grounding pipeline (char positions) — appropriate for initial extraction
  • augment() is a direct LLM call that generates inferred triples without source grounding — appropriate for bridging and enrichment

Step 2: Implement Your Strategy

Add to kgb/builder/augmentation.py:

python
@register_strategy("enrichment")
def enrichment_strategy(
    client: BaseLLMClient,
    domain: KnowledgeDomain,
    text: str,
    triples: list[Triple],
    *,
    max_iterations: int = 3,
    temperature: float = 0.0,
    max_tokens: int | None = None,
    augmentation_prompt_override: str | None = None,
    **kwargs: Any
) -> tuple[list[Triple], dict[str, Any]]:
    """Enrichment augmentation: Add missing entity attributes and relations.

    Args:
        client: LLM client for generation
        domain: Knowledge domain with prompts/examples
        text: Source text to analyze
        triples: Initial triples from extraction
        max_iterations: Max refinement iterations (default: 3)
        temperature: Sampling temperature for LLM (0.0 = deterministic)
        max_tokens: Max tokens for LLM
        augmentation_prompt_override: Override the default prompt

    Returns:
        Tuple of (enriched_triples, metadata)
    """
    # 1. Fetch strategy-specific resources from domain
    augmentation_component = domain.get_augmentation("enrichment")
    aug_prompt_template = augmentation_prompt_override or augmentation_component.prompt
    constraints = collect_schema_constraints(domain, augmentation_component.examples)

    all_triples = list(triples)  # Copy to avoid mutation
    iterations_data = []
    error_occurred = False

    # 2. Iteration loop with error preservation
    for i in range(max_iterations):
        try:
            # Build prompt with current state
            current_triples_dicts = [t.model_dump() for t in all_triples]
            record = {
                "text": text,
                "current_triples": current_triples_dicts,
            }

            final_prompt = render_prompt_template(
                aug_prompt_template,
                record,
                schema_guidance=build_schema_guidance(constraints),
            )

            # Call client.augment() — NOT extract()
            new_triples_raw = client.augment(
                text=final_prompt,
                prompt_description="Enrich entities with missing attributes and relations",
                format_type=Triple,
                temperature=temperature,
                max_tokens=max_tokens
            )

            # 3. Validate and force CONTEXTUAL inference type
            new_triples = []
            normalized_raw: list[dict[str, Any]] = []
            for t_raw in new_triples_raw:
                try:
                    t_dict = t_raw if isinstance(t_raw, dict) else t_raw.model_dump()
                    t_dict["inference"] = InferenceType.CONTEXTUAL
                    new_triples.append(Triple(**t_dict))
                    normalized_raw.append(t_dict)
                except Exception as e:
                    print(f"Warning: Skipping invalid augmented triple: {e}")
                    continue

            # 4. Schema validation
            validated_triples, validation_summary = validate_triples_against_schema(
                new_triples,
                constraints,
                raw_triples=normalized_raw,
            )
            warn_on_schema_validation("enrichment", validation_summary)

            all_triples.extend(validated_triples)
            iterations_data.append({
                "iteration": i + 1,
                "new_triples_count": len(validated_triples),
                "status": "success",
                "schema_validation": validation_summary,
            })

        except Exception as e:
            print(f"Error during enrichment iteration {i+1}: {e}")
            iterations_data.append({
                "iteration": i + 1,
                "status": "failed",
                "error": str(e)
            })
            error_occurred = True
            break

    metadata = {
        "strategy": "enrichment",
        "iterations": iterations_data,
        "partial_result": error_occurred,
        "schema_constraints_applied": constraints.enforce,
        "allowed_entity_types": list(constraints.entity_types),
        "allowed_relation_types": list(constraints.relation_types),
    }

    return all_triples, metadata
Available Utilities (already imported in augmentation.py)
UtilityPurpose
_build_graph_from_triples(triples)Build NetworkX DiGraph from Triple list
_format_components(components, G, triples)Format disconnected components for prompts
collect_schema_constraints(domain, examples)Get schema constraints from domain
build_schema_guidance(constraints)Format constraints as prompt text
render_prompt_template(template, record, schema_guidance)Fill {{variables}} in prompt
validate_triples_against_schema(triples, constraints)Validate against schema
warn_on_schema_validation(stage, summary)Log validation warnings

Step 3: Create Domain Resources

Add prompts and examples for your strategy in each domain that supports it:

kgb/domains/<domain>/augmentation/enrichment/
├── prompt.md          # Strategy-specific prompt (must be .md)
└── examples.json      # Few-shot augmentation examples

prompt.md template variables (filled by render_prompt_template()):

  • {{text}} — source text
  • {{current_triples}} — current triple list (JSON)
  • {{disconnected_components}} — formatted component analysis
  • {{schema_constraints}} — entity/relation type guidance

examples.json structure:

json
[
  {
    "input": {"text": "...", "entities": ["..."]},
    "output": [{"head": "...", "relation": "...", "tail": "...", "inference": "contextual", "justification": "..."}]
  }
]
Show full SKILL.md (186 more words)Show less

Step 4: Add CLI Subcommand

Update kgb/__main__.py (follow the pattern of augment_connectivity):

python
@augment_app.command("enrichment")
def augment_enrichment(
    input_file: Path = typer.Option(..., "--input", "-i", exists=True),
    output_dir: Path = typer.Option("outputs/kg_extraction", "--output-dir", "-o"),
    domain: str = typer.Option(..., "--domain", "-d"),
    max_iterations: int = typer.Option(3, "--max-iterations"),
    client: str = typer.Option("gemini", "--client", "-c"),
    # ... other common options
):
    """Enrichment augmentation: Add missing entity attributes."""
    from .builder import augment_triples
    from .io import load_records
    from .domains import get_domain

    # Load records, create client, iterate, save results
    # See existing augment_connectivity command for the full pattern

See existing augment_connectivity command in kgb/__main__.py for the complete implementation reference.

Step 5: Verify

Check Registration
bash
python -c "from kgb.builder import list_strategies; print(list_strategies())"
# Output: ['connectivity', 'enrichment']
Unit Test
python
def test_enrichment_strategy():
    from unittest.mock import MagicMock
    from kgb.builder.augmentation import enrichment_strategy
    from kgb.domains import Triple, InferenceType

    mock_client = MagicMock()
    mock_client.augment.return_value = [
        {"head": "A", "relation": "has_attr", "tail": "B"}
    ]
    mock_domain = MagicMock()
    mock_domain.get_augmentation.return_value.prompt = "Test prompt {{text}}"
    mock_domain.get_augmentation.return_value.examples = []
    mock_domain.schema.entity_types = []
    mock_domain.schema.relation_types = []

    initial_triples = [Triple(head="X", relation="r", tail="Y")]

    result_triples, metadata = enrichment_strategy(
        client=mock_client,
        domain=mock_domain,
        text="Sample text",
        triples=initial_triples,
        max_iterations=1
    )

    assert len(result_triples) > len(initial_triples)
    assert metadata["strategy"] == "enrichment"
    # Verify augmented triples are CONTEXTUAL
    augmented = [t for t in result_triples if t not in initial_triples]
    assert all(t.inference == InferenceType.CONTEXTUAL for t in augmented)
Integration Test
python
def test_enrichment_via_orchestrator():
    from unittest.mock import MagicMock
    from kgb.builder import augment_triples
    from kgb.domains import Triple

    mock_client = MagicMock()
    mock_client.augment.return_value = [
        {"head": "NewEntity", "relation": "attr", "tail": "Value"}
    ]
    mock_domain = MagicMock()
    mock_domain.get_augmentation.return_value.prompt = "Test {{text}}"
    mock_domain.get_augmentation.return_value.examples = []
    mock_domain.schema.entity_types = []
    mock_domain.schema.relation_types = []

    initial = [Triple(head="A", relation="r", tail="B")]

    result, metadata = augment_triples(
        client=mock_client,
        domain=mock_domain,
        text="Sample text about A and B.",
        initial_triples=initial,
        augmentation_strategy="enrichment",
        max_iterations=1
    )

    assert len(result) > len(initial)

Key Principles

PrincipleDescription
Use client.augment()NOT extract() — augmentation generates inferred triples without source grounding
Iteration ResilienceWrap LLM calls in try-except. Set metadata["partial_result"] = True on failure.
Type SafetyAll augmented triples MUST have inference=InferenceType.CONTEXTUAL
Stateless LogicCopy input triples: all_triples = list(triples). No state between records.
Schema ValidationUse validate_triples_against_schema() + warn_on_schema_validation()
Metadata ContractAlways return {"strategy": "...", "iterations": [...], "partial_result": bool}

Error Handling

ExceptionWhenAction
LLMClientErrorAPI failureLog, set partial_result=True, break loop
ValidationErrorTriple parsingLog warning, skip triple, continue
DomainResourceErrorMissing prompt/examplesFail loudly (don't catch)

Files to Create/Modify

FileAction
kgb/builder/augmentation.pyModify — add strategy function with @register_strategy()
kgb/domains/<domain>/augmentation/<strategy>/prompt.mdCreate — strategy prompt
kgb/domains/<domain>/augmentation/<strategy>/examples.jsonCreate — few-shot examples
kgb/__main__.pyModify — add CLI subcommand (optional)

Verification Checklist

  • Decorated with @register_strategy("name")
  • Conforms to AugmentationStrategy Protocol signature
  • Uses client.augment() (not extract())
  • Forces inference=InferenceType.CONTEXTUAL on all generated triples
  • Uses collect_schema_constraints() + validate_triples_against_schema()
  • Returns (all_triples, metadata) with iteration logs
  • Domain resources created: augmentation/<name>/prompt.md + examples.json
  • Tests cover strategy function and orchestrator dispatch

© FabioYanezRomero, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agent/skills/add-augmentation-strategy of FabioYanezRomero/Knowledge-Graph-Builder.

Open the folder on GitHubat commit 588f0d9

Compare with similar skills

Add Augmentation Strategy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Augmentation Strategy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Augmentation Strategy this skillFabioYanezRomero/Knowledge-Graph-Builder103—~3.3kAutomated safety check: PassMIT
Book2skillHHU3637kr/skills145—~1.1kAutomated safety check: PassNone
Knowledge Summarizeevolution-foundation/evo-nexus545—~612Automated safety check: NotesCustom licence
Whole-Book Explainer Noteslijigang/ljg-skills7.5k—~1kAutomated safety check: PassMIT
News Aggregator Skillcclank/news-aggregator-skill1.3k—~2.1kAutomated safety check: PassNone
AI Daily Newsgeekjourneyx/ai-daily-skill235—~2.3kAutomated safety check: PassNone

Similar skills

  • Book2skill

    HHU3637kr/skills

    Distill a book into a coherent set of executable skills. An agent skill from HHU3637kr/skills.

    145 GitHub stars~1.1k tokensUpdated 18 days ago
    Writing & ContentAuto-check passed
  • Knowledge Summarize

    evolution-foundation/evo-nexus

    Generate a TL;DR summary of a specific document or learning unit in the Knowledge base.

    545 GitHub stars~612 tokensUpdated 5 mo ago
    Writing & ContentAuto-check: notes
  • Whole-Book Explainer Notes

    lijigang/ljg-skills

    Explains a whole book to someone who has not read it, keeping its specific content and showing how its threads connect, and saves the result as an Org note.

    7.5k GitHub stars~1k tokensUpdated 3 days ago
    Writing & ContentAuto-check passed
  • News Aggregator Skill

    cclank/news-aggregator-skill

    Comprehensive news aggregator that fetches, filters, and deeply analyzes real-time content from 44+ sources including Hacker News, Lobsters, Dev.to, GitHub, arXiv, Hugging Face Papers, AIHOT, TLDR…

    1.3k GitHub stars~2.1k tokensUpdated 4 mo ago
    Writing & ContentAuto-check passed
  • AI Daily News

    geekjourneyx/ai-daily-skill

    Fetches AI news from smol.ai RSS and generates structured markdown with intelligent summarization and categorization.

    235 GitHub stars~2.3k tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Vss Search Archive

    NVIDIA-AI-Blueprints/video-search-and-summarization

    A skill your agent uses when a user wants to search archived VSS video that is already registered in a configured deployment — by natural-language, similarity, attribute, object-ID, or lexical tag…

    1.9k GitHub stars~3.3k tokensUpdated yesterday
    Writing & ContentAuto-check passed

More from FabioYanezRomero/Knowledge-Graph-Builder

  • Add LLM Client

    FabioYanezRomero/Knowledge-Graph-Builder

    Adds a new LLM client provider to the clients module. An agent skill from FabioYanezRomero/Knowledge-Graph-Builder.

    103 GitHub stars~3.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Add Converter

    FabioYanezRomero/Knowledge-Graph-Builder

    Adds a new output format converter (e.g., CSV, RDF) to the IO writers module.

    103 GitHub stars~2.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Add Dataset Format

    FabioYanezRomero/Knowledge-Graph-Builder

    Adds a new input format loader (e.g., Parquet, Excel) to the IO readers module.

    103 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Add Domain

    FabioYanezRomero/Knowledge-Graph-Builder

    Manage knowledge domains (e.g., Medical, Finance). An agent skill from FabioYanezRomero/Knowledge-Graph-Builder.

    103 GitHub stars~3.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Add Visualization

    FabioYanezRomero/Knowledge-Graph-Builder

    Adds a new visualization engine or style to the visualization module.

    103 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Add Augmentation Strategy

What does Add Augmentation Strategy do?

Adds a new iterative augmentation strategy (e.g., enrichment, summarization) to the builder module. Add Augmentation Strategy is an agent skill from FabioYanezRomero/Knowledge-Graph-Builder., enrichment, summarization) to the builder module.

When should I use Add Augmentation Strategy?

Add Augmentation Strategy fits situations like: tasks that involve Summarization.

How do I install Add Augmentation Strategy in Claude Code?

Run `npx skills add FabioYanezRomero/Knowledge-Graph-Builder --skill add-augmentation-strategy -a claude-code`. Or copy the skill folder (.agent/skills/add-augmentation-strategy in FabioYanezRomero/Knowledge-Graph-Builder) into .claude/skills/add-augmentation-strategy in your project. Claude Code loads it when a task matches its description.

How do I install Add Augmentation Strategy in Codex?

Run `npx skills add FabioYanezRomero/Knowledge-Graph-Builder --skill add-augmentation-strategy -a codex`. Or copy the skill folder (.agent/skills/add-augmentation-strategy in FabioYanezRomero/Knowledge-Graph-Builder) into .agents/skills/add-augmentation-strategy in your project. Codex loads it when a task matches its description.

Can I use Add Augmentation Strategy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add FabioYanezRomero/Knowledge-Graph-Builder --skill add-augmentation-strategy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-augmentation-strategy, .gemini/skills/add-augmentation-strategy, .github/skills/add-augmentation-strategy and .opencode/skills/add-augmentation-strategy in your project.

What does Add Augmentation Strategy need to run?

Going by SKILL.md and its folder, Add Augmentation Strategy needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Add Augmentation Strategy access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Augmentation Strategy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Augmentation Strategy use?

Add Augmentation Strategy is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Augmentation Strategy use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Augmentation Strategy?

Skills that share tags, products or a category with Add Augmentation Strategy: Book2skill (HHU3637kr/skills, 145 stars), Knowledge Summarize (evolution-foundation/evo-nexus, 545 stars), Whole-Book Explainer Notes (lijigang/ljg-skills, 7.5k stars) and News Aggregator Skill (cclank/news-aggregator-skill, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Augmentation Strategy?

FabioYanezRomero (a GitHub user) maintains it in FabioYanezRomero/Knowledge-Graph-Builder, which has 103 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on August 28, 2026.

Source: FabioYanezRomero/Knowledge-Graph-Builder on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.