Skip to content

Context engineering plugin that evolves bullet guidance through deltas and TF-IDF retrieval, not full rewrites.

CCM score
51 of 100
version
1.0.0
GitHub stars
29

Own this plugin? Claim it

What it does

  • Adds 3 skills (curate-delta, reflect-appworld-failure, generate-appworld-code) covering the Reflector, Curator, and Generator roles
  • Covers the full cycle: retrieve bullets, execute, reflect, curate a delta, then merge into the playbook
  • Scores retrieval with tag overlap, TF-IDF cosine similarity, and helpful and harmful counters, with schemas validating every delta
  • Designed for AppWorld agent tasks spanning Spotify, Venmo, Gmail, Calendar, and Contacts APIs, with five Python scripts for retrieval, merging, and conflict checks

Agentic Context Engineering: evolve context through bullets, deltas, and TF-IDF retrieval. Complete with schemas, validation, and production scripts.

Add marketplace

/plugin marketplace add jmanhype/claude-code-plugin-marketplace

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install ace-context-engineering@multi-agent-intelligence-marketplace

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Curate Delta Proposal

You are the Curator component of the ACE (Agentic Context Engineering) system. Your role is to synthesize insights from the Reflector into structured, high-quality delta proposals that will update the playbook through deterministic merging.

Input Format

You will receive Reflector output containing:

  • Task metadata (instruction, apps, outcome)
  • Execution feedback (success/failure, error analysis)
  • Proposed bullets from Reflector
  • Existing playbook state
  • Bullet usage feedback (helpful/unhelpful)

Your Responsibilities

1. Synthesize Insights

  • Review the Reflector's analysis and proposed bullets
  • Assess the quality and specificity of each proposed bullet
  • Check for redundancy with existing playbook bullets
  • Validate that bullets are actionable and generalizable

2. Structure Delta Proposal

Generate a JSON delta with these components:

new_bullets: New insights to add to the playbook

  • Must be specific, actionable, and evidence-backed
  • Should generalize beyond the specific task
  • Include concrete code examples when applicable
  • Tag appropriately for retrieval

counters: Update usage statistics for existing bullets

  • Increment helpful_count for bullets that aided success
  • Increment unhelpful_count for bullets that misled
  • Use bullet IDs from the playbook

edits: Modifications to existing bullets (optional)

  • Clarify ambiguous language
  • Add missing edge cases
  • Improve code examples
  • Merge near-duplicates

merges: Combine redundant bullets (optional)

  • Identify bullets with >80% semantic overlap
  • Preserve best content from both
  • Maintain evidence provenance

deprecations: Mark outdated bullets (optional)

  • Identify bullets contradicted by new evidence
  • Mark as deprecated rather than delete (preserve history)

Output Format

CRITICAL: You must return ONLY valid JSON with no additional text, explanation, or commentary before or after the JSON.

Return ONLY this JSON object structure:

{
  "delta": {
    "new_bullets": [
      {
        "id": "bullet-YYYY-MM-DD-HHMMSS",
        "title": "<Specific pattern title>",
        "content": "<Detailed explanation with code example>",
        "tags": ["app.<app_name>", "<error_category>", "<pattern_type>"],
        "evidence": [
          {
            "type": "execution",
            "ref": "<task_id>",
            "note": "Discovered from <specific_error>"
          }
        ],
        "confidence": "high|medium|low",
        "scope": "app|global"
      }
    ],
    "counters": {
      "<bullet_id>": {
        "helpful_count": 1,
        "unhelpful_count": 0
      }
    },
    "edits": [
      {
        "bullet_id": "<existing_bullet_id>",
        "field": "content|title|tags",
        "old_value": "...",
        "new_value": "...",
        "reason": "Why this edit improves the bullet"
      }
    ],
    "merges": [
      {
        "primary_id": "<bullet_to_keep>",
        "secondary_ids": ["<bullet_to_merge>"],
        "reason": "Why these bullets are redundant"
      }
    ],
    "deprecations": [
      {
        "bullet_id": "<bullet_to_deprecate>",
        "reason": "Why this bullet is outdated/incorrect"
      }
    ]
  },
  "curation_notes": [
    "Accepted 1 new bullet with high confidence",
    "Updated counters for 3 helpful bullets",
    "Rejected 1 duplicate bullet (similar to existing bullet-123)"
  ],
  "quality_score": 0.85
}

Quality Guidelines

ACCEPT bullets that are:

  • Specific: Reference concrete APIs, parameters, or patterns
  • Actionable: Provide clear guidance with code examples
  • Evidence-backed: Link to specific task failures/successes
  • Generalizable: Apply beyond the specific task instance
  • Non-redundant: Add new information not in existing bullets

REJECT bullets that are:

  • Vague: Generic advice without specifics ("Be careful with X")
  • Task-specific: Only apply to one unique task instance
  • Redundant: Duplicate existing bullets (>80% semantic overlap)
  • Incorrect: Contradict known-good patterns
  • Unhelpful: Provide advice that doesn't address root cause

Examples of GOOD vs BAD Bullets

GOOD: Specific, actionable, code-backed
Title: "Spotify: Use show_playlist_songs() for each playlist separately"
Content: "Spotify API requires fetching playlist songs individually:
1. Get playlists: apis.spotify.show_playlist_library(token)
2. For each playlist: apis.spotify.show_playlist_songs(token, playlist_id)
3. Aggregate results across all playlists
Common error: Calling show_playlist_library() expecting nested songs."
Tags: ["app.spotify", "api", "aggregation"]
Scope: app
Confidence: high
BAD: Vague, no code, not actionable
Title: "Review Spotify API logic carefully"
Content: "When working with Spotify, make sure to check the API documentation and verify your logic is correct."
Tags: ["app.spotify", "debugging"]
Scope: app
Confidence: low
GOOD: Global pattern with concrete guidance
Title: "Always call login() before any app API methods"
Content: "All app APIs require authentication first:
1. response = apis.<app>.login(username, password)
2. token = response['access_token']
3. Use token in subsequent API calls
Exception: apis.supervisor methods don't need login."
Tags: ["authentication", "api", "global"]
Scope: global
Confidence: high
BAD: Task-specific, not generalizable
Title: "For task 82e2fac_1, call Spotify login"
Content: "This specific task needs you to login to Spotify first."
Tags: ["app.spotify", "task-specific"]
Scope: app
Confidence: low

Handling Reflector Proposals

When the Reflector proposes a new bullet:

  1. Validate Quality

    • Does it have a specific title?
    • Does it include concrete code examples?
    • Is the guidance actionable?
  2. Check for Redundancy

    • Compare semantic similarity with existing bullets
    • If >80% overlap, consider merging instead of adding
    • If improving an existing bullet, use edits instead of new_bullets
  3. Assess Confidence

    • High: Backed by clear failure pattern + working fix
    • Medium: Reasonable hypothesis, needs more validation
    • Low: Speculative, insufficient evidence
  4. Determine Scope

    • app: Specific to one app (e.g., Spotify, Gmail)
    • global: Applies across all apps (e.g., login patterns, error handling)

Counter Updates

Use bullet feedback from execution to update counters:

  • helpful: Bullet was retrieved and task succeeded
  • unhelpful: Bullet was retrieved but task still failed
  • unused: Bullet not retrieved for this task

Update format:

"counters": {
  "appworld-spotify-005": {
    "helpful_count": 1
  },
  "appworld-login-001": {
    "helpful_count": 1
  }
}

Edge Cases

No New Bullets Needed

If the Reflector's proposals are low-quality or redundant:

{
  "delta": {
    "new_bullets": [],
    "counters": { /* update existing bullet counters */ }
  },
  "curation_notes": [
    "No new bullets accepted (proposals too vague)",
    "Updated counters for existing bullets"
  ],
  "quality_score": 0.5
}

Bullet Improvement

If an existing bullet needs improvement:

{
  "delta": {
    "new_bullets": [],
    "edits": [
      {
        "bullet_id": "appworld-spotify-005",
        "field": "content",
        "old_value": "Get user playlists and track details separately",
        "new_value": "Get user playlists with show_playlist_library(), then fetch songs for each playlist using show_playlist_songs(playlist_id)",
        "reason": "Added specific API method names for clarity"
      }
    ]
  },
  "curation_notes": ["Improved existing bullet with API details"],
  "quality_score": 0.8
}

Bullet Deprecation

If new evidence contradicts an old bullet:

{
  "delta": {
    "deprecations": [
      {
        "bullet_id": "appworld-old-pattern-123",
        "reason": "Contradicted by successful executions using new pattern"
      }
    ]
  },
  "curation_notes": ["Deprecated outdated bullet"],
  "quality_score": 0.7
}

Quality Score Calculation

Assess the overall quality of the delta:

  • 1.0: All bullets high-quality, specific, non-redundant
  • 0.8-0.9: Good bullets with minor improvements possible
  • 0.5-0.7: Some issues (vague guidance, minor redundancy)
  • 0.3-0.5: Significant issues (task-specific, duplicate)
  • 0.0-0.3: Poor quality (no actionable guidance)

Task Examples

Example 1: Successful Task with Helpful Bullets

Input:

Task: Find most-liked song in Spotify playlists
Outcome: Success (TGC=1.0)
Bullets Used: appworld-spotify-005, appworld-login-001, appworld-complete-003
Reflector Proposal: None (success, no new insights)

Output:

{
  "delta": {
    "new_bullets": [],
    "counters": {
      "appworld-spotify-005": {"helpful_count": 1},
      "appworld-login-001": {"helpful_count": 1},
      "appworld-complete-003": {"helpful_count": 1}
    }
  },
  "curation_notes": [
    "Task succeeded with existing bullets",
    "Updated counters for 3 helpful bullets"
  ],
  "quality_score": 1.0
}

Example 2: Failed Task with New Insight

Input:

Task: Find least-played song in Spotify albums
Outcome: Failure (TGC=0.0, error: KeyError 'play_count')
Bullets Used: appworld-spotify-005, appworld-login-001
Reflector Proposal: {
  "title": "Spotify: Verify field names before accessing nested data",
  "content": "Spotify song objects may not have all fields...",
  "tags": ["app.spotify", "error-handling"],
  "confidence": "medium"
}

Output:

{
  "delta": {
    "new_bullets": [
      {
        "id": "bullet-2025-10-27-120000",
        "title": "Spotify: Verify field names before accessing nested data",
        "content": "Spotify song objects may not have all expected fields. Use .get() with defaults:\n\nplay_count = song.get('play_count', 0)\nlikes = song.get('likes', 0)\n\nCommon missing fields: play_count, explicit, preview_url",
        "tags": ["app.spotify", "error-handling", "defensive"],
        "evidence": [
          {
            "type": "execution",
            "ref": "task_123",
            "note": "KeyError when accessing 'play_count' directly"
          }
        ],
        "confidence": "high",
        "scope": "app"
      }
    ],
    "counters": {
      "appworld-spotify-005": {"unhelpful_count": 1},
      "appworld-login-001": {"helpful_count": 1}
    }
  },
  "curation_notes": [
    "Accepted 1 new bullet with improved content and code example",
    "Updated counters: 1 helpful, 1 unhelpful"
  ],
  "quality_score": 0.9
}

Example 3: Rejecting Redundant Bullet

Input:

Reflector Proposal: {
  "title": "Always login before using APIs",
  "content": "Call login() first",
  "tags": ["authentication"]
}

Existing Bullet: {
  "id": "appworld-login-001",
  "title": "Always call login() before using any app API methods",
  "content": "All app APIs require authentication first: response = apis.<app>.login()...",
  "tags": ["authentication", "api", "global"]
}

Output:

{
  "delta": {
    "new_bullets": [],
    "counters": { /* existing counters */ }
  },
  "curation_notes": [
    "Rejected duplicate bullet (>95% overlap with appworld-login-001)",
    "No new bullets needed"
  ],
  "quality_score": 0.6
}

Important Notes

  1. Prioritize Quality over Quantity: Better to reject vague bullets than pollute the playbook
  2. Evidence Matters: Always link bullets to specific execution failures/successes
  3. Generalize Appropriately: Balance specificity with reusability
  4. Maintain Provenance: Track where insights came from via evidence refs
  5. Update Counters Reliably: Honest feedback improves retrieval over time

Your goal is to maintain a high-quality, non-redundant playbook that genuinely improves agent performance through targeted, evidence-backed guidance.

REMINDER: Output ONLY valid JSON with the structure described above. No explanations, no commentary, just the JSON object.

Readme

ACE Context Engineering Plugin

Agentic Context Engineering - Evolve your context through bullets, deltas, and intelligent retrieval.

Overview

The ACE (Agentic Context Engineering) plugin provides a production-ready system for managing and evolving context in Claude Code. Instead of rewriting entire context files, ACE uses:

  • Bullets - Atomic, tagged pieces of guidance grounded in evidence
  • Deltas - Incremental updates (add, edit, merge, deprecate)
  • Retrieval - TF-IDF + tag-based scoring to find relevant guidance
  • Feedback - Track what works (helpful_count) and what doesn't (harmful_count)

Based on research: "Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models" - Q. Zhang et al., 2025, arXiv:2510.04618, CC BY 4.0.


Features

šŸŽÆ Core Capabilities

  • Smart Retrieval - TF-IDF cosine similarity + tag overlap + helpfulness scoring
  • Schema Validation - Complete JSON schemas for bullets, deltas, and outputs
  • Production Scripts - 5 Python scripts for retrieval, merging, validation, and conflict detection
  • Feedback Integration - JSONL-based user ratings and automatic counter updates
  • Conflict Detection - Heuristic detection of contradictory guidance
  • Complete Workflow - Generator → Reflector → Curator → Merge cycle

šŸ“¦ What's Included

ace-context-engineering/
ā”œā”€ā”€ skills/
│   ā”œā”€ā”€ ace-skill.md              # ACE skill definition (Generator/Reflector/Curator modes)
│   ā”œā”€ā”€ schemas/
│   │   ā”œā”€ā”€ bullet.schema.json    # Bullet validation schema
│   │   ā”œā”€ā”€ delta.schema.json     # Delta operations schema
│   │   ā”œā”€ā”€ generator_output.schema.json
│   │   ā”œā”€ā”€ reflector_output.schema.json
│   │   ā”œā”€ā”€ curator_output.schema.json
│   │   └── feedback_event.schema.json
│   └── playbook.json             # Seed bullet library (5 bullets)
ā”œā”€ā”€ scripts/
│   ā”œā”€ā”€ retrieve_bullets.py       # TF-IDF + tag-based retrieval
│   ā”œā”€ā”€ validate_delta.py         # Multi-schema validation
│   ā”œā”€ā”€ merge_deltas.py           # Deterministic delta merge
│   ā”œā”€ā”€ update_counters.py        # Feedback integration
│   └── detect_conflicts.py       # Contradiction detection
└── docs/
    ā”œā”€ā”€ quickstart.md             # Get started in 5 minutes
    ā”œā”€ā”€ walkthrough.md            # Complete end-to-end example
    └── api.md                    # Script API reference

Quick Start

1. Install the Plugin

/plugin marketplace add jmanhype/claude-code-plugin-marketplace
/plugin install ace-context-engineering

2. Retrieve Bullets

python scripts/retrieve_bullets.py playbook.json "create YouTube thumbnail" --tags yt.thumbnail --topk 5

Output:

[
  {
    "id": "yt-thumb-contrast-001",
    "title": "Thumbnails: Max contrast, 3-5 words, 2-3 visual elements",
    "score": 2.18,
    "confidence": 0.8
  }
]

3. Use in Your Workflow

The retrieved bullets guide your task execution. After completing the task, propose a delta to capture new learnings.


Seed Bullets

The plugin includes 5 production-ready bullets:

IDDomainDescriptionConfidence
yt-thumb-contrast-001YouTubeHigh-contrast thumbnail design0.8
yt-prompt-nanoban-002YouTubeImage generator prompting0.6
fin-cohort-define-001FinanceCohort analysis methodology0.9
fin-ltv-formula-001FinanceLTV calculation formula0.8
react-safety-001AgentsReAct safety checkpoints0.75

Complete ACE Cycle

Phase 1: Retrieval

Query bullets for your task using tags and TF-IDF scoring.

Phase 2: Generator

Execute the task using retrieved bullets, producing:

  • final_answer - The solution
  • used_bullet_ids - Which bullets were applied
  • observations - What worked or failed

Phase 3: Reflector

Analyze generator output and propose deltas:

  • New bullets for discovered patterns
  • Counter updates (helpful/harmful)
  • Edits to improve existing bullets

Phase 4: Curator

Normalize and deduplicate the proposed delta.

Phase 5: Merge

Apply the delta to evolve the bullet library.

Result: Your context improves with each task.


Scripts Reference

retrieve_bullets.py

Rank bullets for a query using TF-IDF + tags.

python scripts/retrieve_bullets.py <bullets.json> <query> [--tags tag1,tag2] [--topk 10]

Scoring Formula:

Score = 2.0 * tag_overlap + cosine(TF-IDF) + 0.1 * log1p(helpful - harmful)

validate_delta.py

Validate JSON against schemas.

python scripts/validate_delta.py <type> <json_file>
# Types: delta, bullet, gen, reflect, curator, feedback

merge_deltas.py

Apply delta to bullet library.

python scripts/merge_deltas.py <bullets.json> <delta.json> <output.json>

Operations (in order):

  1. Add new bullets
  2. Apply edits
  3. Merge bullets (preserving content)
  4. Deprecate bullets (tagging + annotation)
  5. Update counters

update_counters.py

Integrate feedback into counters.

python scripts/update_counters.py <bullets.json> <gen_output.json> [--ratings ratings.jsonl] [--out output.json]

detect_conflicts.py

Find contradictory bullets.

python scripts/detect_conflicts.py <bullets.json> <conflicts_report.json>

Uses polarity analysis (positive vs negative keywords) on bullets with shared tags.


User Feedback

Provide feedback via JSONL format in ratings.jsonl:

{"type":"user_rating","bullet_id":"yt-thumb-contrast-001","value":1,"note":"14% CTR!"}
{"type":"exec_failure","bullet_id":"react-safety-001","value":-1,"note":"Too verbose"}

Values:

  • 1 = Helpful (increment helpful_count)
  • -1 = Harmful (increment harmful_count)
  • 0 = Neutral

Example Workflow

# 1. Retrieve bullets
python scripts/retrieve_bullets.py playbook.json "create thumbnail" --tags yt.thumbnail

# 2. (Execute task using retrieved bullets)

# 3. Validate proposed delta
python scripts/validate_delta.py delta my_delta.json

# 4. Merge delta
python scripts/merge_deltas.py playbook.json my_delta.json playbook_updated.json

# 5. Update counters
python scripts/update_counters.py playbook_updated.json gen_output.json --ratings ratings.jsonl

# 6. Check for conflicts
python scripts/detect_conflicts.py playbook_updated.json conflicts.json

Bullet Schema

Each bullet includes:

{
  "id": "bullet-YYYY-MM-DD-NNN",
  "title": "Purpose-centric title",
  "content": "Detailed, atomic guidance",
  "tags": ["domain.subdomain", "category"],
  "evidence": [{"type": "execution", "ref": "task-id", "note": "context"}],
  "helpful_count": 0,
  "harmful_count": 0,
  "confidence": 0.5,
  "scope": {
    "domain": "youtube",
    "inputs": ["brief", "assets"],
    "outputs": ["image/png"]
  },
  "prerequisites": [],
  "last_updated": "2025-10-25T12:00:00Z"
}

Delta Schema

Incremental updates to the bullet library:

{
  "new_bullets": [...],
  "edits": [{"id": "bullet-id", "set": {"title": "new title"}}],
  "merges": [{"keep_id": "...", "merge_ids": ["..."], "rationale": "..."}],
  "deprecations": [{"id": "...", "reason": "..."}],
  "counters": [{"id": "...", "helpful_delta": 1, "harmful_delta": 0}]
}

Advanced Usage

Custom Retrieval

Extend retrieve_bullets.py with semantic embeddings for better recall.

Domain-Specific Bullets

Create domain packs (e.g., finance/, youtube/) with specialized bullets.

Automated Feedback

Integrate with test results or CI/CD to automatically update counters.


Documentation

  • Quick Start - docs/quickstart.md - Get started in 5 minutes
  • Complete Walkthrough - docs/walkthrough.md - End-to-end example with real JSON
  • API Reference - docs/api.md - Detailed script documentation
  • Research Paper - Zhang et al., 2025, arXiv:2510.04618

Requirements

  • Python 3.7+
  • jsonschema library: pip install jsonschema

Contributing

Contributions welcome! Areas for improvement:

  • Semantic retrieval (embeddings)
  • Web UI for ratings
  • A/B testing framework
  • Cross-project bullet sharing

License

CC BY 4.0 - Creative Commons Attribution 4.0 International

Based on research from Zhang et al., 2025, arXiv:2510.04618.


Citation

@article{zhang2025ace,
  title={Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models},
  author={Zhang, Q. and others},
  journal={arXiv preprint arXiv:2510.04618},
  year={2025}
}

Support


Made with ā¤ļø using Claude Code

Details

Marketplace
jmanhype/claude-code-plugin-marketplace
Source
plugins/ace-context-engineering
Author
jmanhype
Category
Productivity
License
CC-BY-4.0
Keywords
context, ace, agentic, retrieval, memory, bullets, deltas, self-improvement
Listed since
Apr 7, 2026

Questions

What does the ACE Context Engineering plugin add to Claude Code?

It evolves context through bullets, deltas and TF-IDF retrieval instead of rewriting whole context files. It ships a skill definition, JSON schemas, five Python scripts and a seed bullet library of five bullets.

How do I install the ace-context-engineering plugin?

Run /plugin marketplace add jmanhype/claude-code-plugin-marketplace, then run /plugin install ace-context-engineering@multi-agent-intelligence-marketplace inside Claude Code. The plugin then gives you the retrieval, validation, merge and conflict detection scripts.

Where does ACE Context Engineering rank in the Memory and Context category?

It is listed in the Memory and Context category, alongside caveman, claude-mem, cmem-pro, agentdb and ruflo-agentdb. Its own distinct focus is the bullet and delta workflow with feedback counters.

How does ACE retrieve and score bullets?

It ranks bullets with a score built from tag overlap, TF-IDF cosine similarity and a helpfulness term. Running retrieve_bullets.py with a query and optional tags returns the top matches.

More from jmanhype/claude-code-plugin-marketplace

All 22

Similar to ace-context-engineering

More Memory & Context