Agent skill

Artifact Type Tailored Context

by closedloop-ai in closedloop-ai/claude-plugins

Compresses artifacts for judge evaluation. An agent skill from closedloop-ai/claude-plugins.

Apache-2.0Auto-check: notesWriting & Content

Install Artifact Type Tailored Context

skills CLI
$ npx skills add closedloop-ai/claude-plugins --skill artifact-type-tailored-context -a claude-code

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

GitHub CLI
$ gh skill install closedloop-ai/claude-plugins artifact-type-tailored-context --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/closedloop-ai/claude-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/judges/skills/artifact-type-tailored-context .claude/skills/artifact-type-tailored-context && 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
artifact-type-tailored-context
GitHub stars
122
Token cost
~2.1k tokens
SKILL.md length
777 words
Files
6
Skills in repo
43
Repo updated
First seen
Licence
Apache-2.0

At a glance

Compresses artifacts for judge evaluation. An agent skill from closedloop-ai/claude-plugins.

  • Works in 4 steps: Read Artifact → Count Raw Tokens → Apply Tiered Summarization Strategy → …
  • Tasks that involve Summarization
  • SKILL.md covers Purpose, Task Context, Input Parameters and Execution Workflow, plus 3 more sections
  • Calls uv

What it does

Artifact Type Tailored Context is an agent skill from closedloop-ai/claude-plugins. Compresses artifacts for judge evaluation. Reads a single raw artifact, applies tiered summarization within a token budget, and returns compacted content with metadata. Isolation via forked context prevents pollution of agent context

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files (for example `preambles/code_preamble.md`, `preambles/common_input_preamble.md` and `preambles/feature_preamble.md`).

It sits in Writing & Content, covering Summarization, LLM cost and token optimization and Codebase knowledge for agents. The repository describes itself as: Open-source Claude Code plugins for multi-agent software delivery. Plan-first SDLC workflow, code review, LLM quality judges, and self-learning — grounded in your codebase… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Summarization
  • Tasks that involve LLM cost and token optimization
  • Tasks that involve Codebase knowledge for agents

Example prompts

  • “Use the artifact-type-tailored-context skill to compress artifacts for judge evaluation. An agent skill from closedloop-ai/claude-plugins”
  • “/artifact-type-tailored-context”

Requirements

  • Pre-approved tools (allowed-tools): Read, Bash

Workflow steps

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

  1. Read Artifact
  2. Count Raw Tokens
  3. Apply Tiered Summarization Strategy
  4. Return JSON Response

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv

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

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    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

Artifact Type Tailored Context loads about 2.1k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 777 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Bash

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 closedloop-ai/claude-plugins at commit 0e20ac0, republished under its Apache-2.0 licence (© closedloop-ai). 777 words, ~2,104 tokens.

Download SKILL.mdSave it as .claude/skills/artifact-type-tailored-context/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
artifact-type-tailored-context
description
Compresses artifacts for judge evaluation. Reads a single raw artifact, applies tiered summarization within a token budget, and returns compacted content with metadata. Isolation via forked context prevents pollution of agent context
allowed-tools
Read, Bash
context
fork
model
haiku

Artifact-Type-Tailored Context Skill

Purpose

Compress individual artifacts within a specified token budget using tiered summarization strategies. This skill operates in isolated forked context to prevent polluting the parent agent's context with large raw artifacts.

Task Context

You are responsible for compressing a single artifact file to fit within a token budget. Your responsibilities:

  1. Read the raw artifact from the specified path
  2. Count its tokens using the count_tokens.py script
  3. Apply appropriate tiered summarization strategy
  4. Return structured JSON with metadata

Success criteria:

  • Compressed content fits within token budget (or is properly truncated)
  • Valid JSON response with all required fields
  • Metadata accurately reflects truncation status

Input Parameters

You receive three required parameters:

ParameterTypeDescription
artifact_pathstringPath to artifact file relative to $CLOSEDLOOP_WORKDIR
task_descriptionstringCompression guidance (e.g., "preserve function signatures")
token_budgetintegerMaximum allowed tokens for compressed output

Execution Workflow

Step 1: Read Artifact

Read the artifact from its absolute path:

bash
# Construct full path
ARTIFACT_FULL_PATH="$CLOSEDLOOP_WORKDIR/$artifact_path"

Use the Read tool to load the artifact content. If the file does not exist, skip to error handling.

Step 2: Count Raw Tokens

Invoke the count_tokens.py script to get accurate token count:

bash
cd "$CLOSEDLOOP_WORKDIR" && uv run count_tokens.py "$artifact_path"

Expected output format:

json
{
  "input_tokens": 1234
}

Parse the JSON output and extract input_tokens as raw_tokens.

Error handling:

  • If count_tokens.py fails (exit code non-zero), fallback to character-based heuristic: raw_tokens = len(content) / 4
  • Add warning to content preamble: [WARNING: Token count estimated via heuristic due to count_tokens.py failure]\n\n
Step 3: Apply Tiered Summarization Strategy

Choose strategy based on raw token count relative to budget:

Tier 1: Full Content (raw_tokens <= budget)

Condition: raw_tokens <= token_budget

Action: Return artifact unchanged

Metadata:

  • compacted_tokens = raw_tokens
  • truncated = false

No further processing needed.


Tier 2: Intelligent Compression (budget < raw_tokens <= budget * 1.5)

Condition: token_budget < raw_tokens <= token_budget * 1.5

Action: Apply artifact-type-specific compression preserving structure

Compression strategies by artifact type:

Artifact TypeStrategy
Code diffsKeep function signatures, class declarations, and error messages. Summarize method bodies with // ... (implementation omitted for brevity). Remove comments and blank lines.
JSON filesKeep all keys and structure. For arrays longer than 10 items, keep first 5 and last 2, replace middle with {"_truncated": "N items omitted"}. Truncate string values over 200 chars.
Log filesKeep all ERROR and WARNING lines. Summarize consecutive INFO lines with ... (N info lines omitted). Keep first and last 10 lines intact.
Plan/PRD markdownKeep all headings, tables, and code blocks. Summarize paragraph text preserving key nouns and action verbs. Remove redundant examples.

Validation:

After compression, count tokens again:

bash
cd "$CLOSEDLOOP_WORKDIR" && uv run count_tokens.py <(echo "$compressed_content")

Decision tree:

  • If compacted_tokens <= token_budget: Success → Return with truncated = false
  • If compacted_tokens > token_budget: Compression failed → Fallback to Tier 3

Tier 3: Hard Truncation (raw_tokens > budget * 1.5 OR Tier 2 failed)

Condition: raw_tokens > token_budget * 1.5 OR compression in Tier 2 exceeded budget

Action: Hard truncate at character boundary

Algorithm:

  1. Estimate truncation point: char_limit = token_budget * 4 (heuristic: 4 chars per token)
  2. Find last paragraph boundary (double newline \n\n) before char_limit
  3. Truncate at that boundary
  4. Calculate truncated token count: truncated_tokens = raw_tokens - token_budget
  5. Append truncation marker:
[TRUNCATED: content exceeds budget, remaining {truncated_tokens} tokens omitted]

Metadata:

  • compacted_tokens = token_budget (approximate)
  • truncated = true

Show full SKILL.md (284 more words)Show less
Step 4: Return JSON Response

Return structured JSON with strict schema:

json
{
  "artifact_name": "path/to/artifact.ext",
  "raw_tokens": 5000,
  "compacted_tokens": 2000,
  "truncated": false,
  "content": "compressed artifact content here..."
}

Field descriptions:

FieldTypeDescription
artifact_namestringOriginal artifact_path parameter
raw_tokensintegerToken count from count_tokens.py on raw artifact
compacted_tokensintegerToken count after compression (from count_tokens.py validation or estimate for Tier 1/3)
truncatedbooleantrue if Tier 3 truncation applied, false otherwise
contentstringCompressed or truncated artifact content

Error Handling

Artifact Not Found

Condition: artifact_path does not exist at $CLOSEDLOOP_WORKDIR/<artifact_path>

Response:

json
{
  "artifact_name": "path/to/missing.ext",
  "raw_tokens": 0,
  "compacted_tokens": 0,
  "truncated": true,
  "content": "[ERROR: artifact not found at $CLOSEDLOOP_WORKDIR/path/to/missing.ext]"
}
count_tokens.py Failure

Condition: Script exits with non-zero code or returns invalid JSON

Action:

  1. Fallback to character-based heuristic: raw_tokens = len(content) / 4
  2. Prepend warning to content:
[WARNING: Token count estimated via heuristic due to count_tokens.py failure]

<original content follows>
  1. Proceed with tiered strategy using estimated token count
  2. Set truncated = false unless Tier 3 is applied
Invalid Compression Output

Condition: Tier 2 compression produces malformed content (e.g., invalid JSON syntax for JSON artifacts)

Action: Immediately fallback to Tier 3 hard truncation with truncated = true


Example Scenarios

Example 1: Small Artifact (Tier 1)

Input:

  • artifact_path: plan.json
  • token_budget: 5000
  • Raw tokens: 3200

Output:

json
{
  "artifact_name": "plan.json",
  "raw_tokens": 3200,
  "compacted_tokens": 3200,
  "truncated": false,
  "content": "<full plan.json content>"
}

Example 2: Medium Artifact (Tier 2)

Input:

  • artifact_path: git_diff
  • token_budget: 10000
  • Raw tokens: 12000 (1.2x budget)

Compression applied: Remove comments, summarize method bodies, keep signatures

Output:

json
{
  "artifact_name": "git_diff",
  "raw_tokens": 12000,
  "compacted_tokens": 9500,
  "truncated": false,
  "content": "<compressed diff with function signatures preserved>"
}

Example 3: Large Artifact (Tier 3)

Input:

  • artifact_path: outcomes.log
  • token_budget: 3000
  • Raw tokens: 25000 (8.3x budget)

Action: Hard truncate at ~12000 chars (3000 tokens * 4)

Output:

json
{
  "artifact_name": "outcomes.log",
  "raw_tokens": 25000,
  "compacted_tokens": 3000,
  "truncated": true,
  "content": "<first ~2900 tokens of log>\n\n[TRUNCATED: content exceeds budget, remaining 22000 tokens omitted]"
}

Notes

  • Context isolation: This skill runs in forked context. The raw artifact content does not pollute the parent agent's context.
  • Token counting accuracy: Always prefer count_tokens.py output over estimates. Only fallback to heuristics on failure.
  • Compression quality: Tier 2 strategies prioritize structural information (function signatures, keys) over verbose content (comments, redundant text).
  • Budget enforcement: Tier 3 truncation is a hard stop. Judges must lower confidence when evaluating truncated artifacts.

© closedloop-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files in plugins/judges/skills/artifact-type-tailored-context of closedloop-ai/claude-plugins.

  • SKILL.md
  • preambles/code_preamble.md
  • preambles/common_input_preamble.md
  • preambles/feature_preamble.md
  • preambles/plan_preamble.md
  • preambles/prd_preamble.md

Open the folder on GitHubat commit 0e20ac0

Compare with similar skills

Artifact Type Tailored Context 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.

Artifact Type Tailored Context compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Artifact Type Tailored Context this skillclosedloop-ai/claude-plugins122—~2.1kAutomated safety check: NotesApache-2.0
Context Compressionguanyang/open-agent-hub9732 repos~4.6kAutomated safety check: PassMIT
Codememory Summarization Skillharrylettering/CodeMemory158—~788Automated safety check: PassNone
News Aggregator Skillcclank/news-aggregator-skill1.3k—~2.1kAutomated safety check: PassNone
Vss Search ArchiveNVIDIA-AI-Blueprints/video-search-and-summarization1.9k—~3.6kAutomated safety check: PassApache-2.0
Entroly Context Controljuyterman1000/entroly472—~501Automated safety check: PassApache-2.0

Similar skills

  • Context Compression

    guanyang/open-agent-hub

    This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve…

    973 GitHub starsUsed in 2 repos~4.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Codememory Summarization Skill

    harrylettering/CodeMemory

    This skill should be used when creating conversation summaries for CodeMemory, discussing summarization quality, optimizing DAG structure, or working with the compaction system.

    158 GitHub stars~788 tokensUpdated 2 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
  • Vss Search Archive

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

    A skill your agent uses when a user wants to search archived VSS video or ingest or delete a source for search.

    1.9k GitHub stars~3.6k tokensUpdated today
    Writing & ContentAuto-check passed
  • Entroly Context Control

    juyterman1000/entroly

    Surgically select, compress, and recover codebase context using Entroly's MCP tools.

    472 GitHub stars~501 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Deepgram JS Text Intelligence

    deepgram/deepgram-js-sdk

    A skill your agent uses when writing or reviewing JavaScript/TypeScript in this repo that calls Deepgram Text Intelligence / Read (/v1/read) for sentiment, summarization, topic detection, and intent…

    276 GitHub stars~1.1k tokensUpdated 5 days ago
    Writing & ContentAuto-check passed

More from closedloop-ai/claude-plugins

All 43 skills in this repo
  • Codex Review

    closedloop-ai/claude-plugins

    Run Codex to review a plan file and return structured feedback with a verdict.

    122 GitHub stars~1.4k tokensUpdated today
    Auto-check: notes
  • Critic Cache

    closedloop-ai/claude-plugins

    Check if critic reviews are still valid before re-running Phase 2.5 critics.

    122 GitHub stars~528 tokensUpdated today
    Auto-check: notes
  • Cross Repo Cache

    closedloop-ai/claude-plugins

    Check if cross-repo coordinator results can be reused, avoiding redundant Sonnet agent launches.

    122 GitHub stars~683 tokensUpdated today
    Auto-check: notes
  • Eval Cache

    closedloop-ai/claude-plugins

    Check for a cached plan-evaluation.json result before launching the plan-evaluator agent.

    122 GitHub stars~516 tokensUpdated today
    Auto-check: notes
  • Find Plugin File

    closedloop-ai/claude-plugins

    This skill should be used when needing to locate files within the Claude Code plugins cache directory (~/.claude/plugins/cache).

    122 GitHub stars~812 tokensUpdated today
    Auto-check passed
  • Gh Monitor PR

    closedloop-ai/claude-plugins

    Start a detached GitHub pull-request monitor that wakes the exact launching Codex Desktop or CLI root through the managed Codex App Server when review, CI, conflict, merge-queue, closure, readiness…

    122 GitHub stars~5.1k tokensUpdated today
    Auto-check passed

Questions about Artifact Type Tailored Context

What does Artifact Type Tailored Context do?

Compresses artifacts for judge evaluation. An agent skill from closedloop-ai/claude-plugins. Artifact Type Tailored Context is an agent skill from closedloop-ai/claude-plugins. Compresses artifacts for judge evaluation.

When should I use Artifact Type Tailored Context?

Artifact Type Tailored Context fits situations like: tasks that involve Summarization; tasks that involve LLM cost and token optimization; tasks that involve Codebase knowledge for agents.

How do I install Artifact Type Tailored Context in Claude Code?

Run `npx skills add closedloop-ai/claude-plugins --skill artifact-type-tailored-context -a claude-code`. Or copy the skill folder (plugins/judges/skills/artifact-type-tailored-context in closedloop-ai/claude-plugins) into .claude/skills/artifact-type-tailored-context in your project. Claude Code loads it when a task matches its description.

How do I install Artifact Type Tailored Context in Codex?

Run `npx skills add closedloop-ai/claude-plugins --skill artifact-type-tailored-context -a codex`. Or copy the skill folder (plugins/judges/skills/artifact-type-tailored-context in closedloop-ai/claude-plugins) into .agents/skills/artifact-type-tailored-context in your project. Codex loads it when a task matches its description.

Can I use Artifact Type Tailored Context 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 closedloop-ai/claude-plugins --skill artifact-type-tailored-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/artifact-type-tailored-context, .gemini/skills/artifact-type-tailored-context, .github/skills/artifact-type-tailored-context and .opencode/skills/artifact-type-tailored-context in your project.

What does Artifact Type Tailored Context need to run?

Going by SKILL.md and its folder, Artifact Type Tailored Context needs the command-line tools its instructions call (uv). Its frontmatter pre-approves these tools: Read, Bash.

Does Artifact Type Tailored Context access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Artifact Type Tailored Context safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Artifact Type Tailored Context use?

Artifact Type Tailored Context is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Artifact Type Tailored Context use?

About 2.1k tokens (SKILL.md is roughly 8.4k 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 Artifact Type Tailored Context?

Skills that share tags, products or a category with Artifact Type Tailored Context: Context Compression (guanyang/open-agent-hub, 973 stars), Codememory Summarization Skill (harrylettering/CodeMemory, 158 stars), News Aggregator Skill (cclank/news-aggregator-skill, 1.3k stars) and Vss Search Archive (NVIDIA-AI-Blueprints/video-search-and-summarization, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Artifact Type Tailored Context?

closedloop-ai (a GitHub organization) maintains it in closedloop-ai/claude-plugins, which has 122 GitHub stars. The repository holds 43 skills in this directory. The repository was last updated on October 7, 2026.

Source: closedloop-ai/claude-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.