Agent Skills for Context Engineering

repository·main·Indexed 12 days ago

https://github.com/muratcankoylan/agent-skills-for-context-engineering

A collection of skills and methodologies for building production-grade AI agent systems, focusing on context engineering and harness engineering. Includes the Book SFT Pipeline for author style transfer using LoRA on Qwen/Qwen3-8B-Base, and the Reasoning Trace Optimizer for capturing and analyzing interleaved thinking blocks via the MiniMax M2.1 API to improve agent prompts and behavior.

Tokens
276.6K
Snippets
418
Records
995
Agent score
96%

What's inside Agent Skills for Context Engineering

  1. Overview of the Book SFT Pipeline

    main

    The book-sft-pipeline is a complete system designed to convert books into Supervised Fine-Tuning (SFT) datasets for training style-transfer models. It covers the entire workflow from raw ePub extraction to training a LoRA adapter that can replicate an author's specific voice.

    When to use this skill:

    • Building fine-tuning datasets from literary works.
    • Creating author-voice or style-transfer models.
    • Preparing training data for SFT platforms like Tinker.
    • Designing text segmentation pipelines for long-form content.
    • Training small models (8B or less) on limited data.
  2. Overview of Agent Skills for Context Engineering

    main

    This project provides a collection of skills designed for building production-grade AI agent systems through context engineering and harness engineering. The skills are categorized into several domains:

    Foundational Skills

    Focus on the anatomy of context, degradation patterns (lost-in-middle, poisoning, distraction, clash), and compression strategies.

    Architectural Skills

    Focus on multi-agent patterns (orchestrator, peer-to-peer, hierarchical), long-horizon prompting, memory systems, tool design, filesystem context, and hosted agents (sandboxed VMs).

    Operational Skills

    Focus on optimization (compaction, masking, caching), latent briefing (KV cache compaction), evaluation (LLM-as-a-Judge), harness engineering, and self-improvement loops.

    Cognitive Architecture Skills

    Focus on formal cognitive modeling, such as transforming RDF context into BDI (Beliefs, Desires, Intentions) mental states.

    Development Methodology

    Covers the full lifecycle of LLM projects from ideation to deployment.

  3. Overview of LLM-as-a-Judge Skills

    main

    The llm-as-judge-skills package provides production-ready LLM evaluation capabilities designed to transform research insights into executable agent skills. It implements patterns for assessing AI-generated content using LLMs as judges, specifically addressing challenges like position bias and the need for clear rubrics.

    Key implementation features include:

    • Direct Scoring: Using the directScore tool for objective criteria with rubric support.
    • Pairwise Comparison: Using the pairwiseCompare tool for preference-based evaluation, featuring automatic position swapping to mitigate position bias.
    • Rubric Generation: Using the generateRubric tool to ensure consistent evaluation standards.
    • Chain-of-Thought: Requiring all evaluations to include justification and evidence to improve reliability.

    The implementation is built using Vercel AI SDK 6 patterns, utilizing type-safe tools (Zod), structured JSON outputs, and a reusable EvaluatorAgent class.

  4. Manage personal productivity with the Operations Module

    main

    The Operations Module serves as a personal productivity operating system for managing tasks, goals, meetings, and metrics. It uses a structured file system to maintain state across different time horizons (daily, weekly, quarterly).

    Data Storage Structure

    • todos.md (Markdown): Active task list with priority levels.
    • goals.yaml (YAML): OKRs and long-term goal tracking.
    • meetings.jsonl (JSONL): Log of meeting notes and outcomes.
    • metrics.jsonl (JSONL): Tracking of key performance indicators.
    • reviews/ (Folder): Storage for weekly and monthly review documents.
  5. Understand the `context-fundamentals` skill

    main

    The context-fundamentals skill is a conceptual foundation used to explain or reason about the core principles of context engineering. It is designed for onboarding, conceptual explanation, and first-principles reasoning.

    When to use this skill:

    • Explaining how attention mechanics constrain agent behavior.
    • Onboarding new contributors to the mental models of context.
    • Reasoning about design trade-offs (e.g., why a specific constraint exists) before choosing a tactic.
    • Grounding documentation in underlying mechanics.

    When NOT to use this skill (use specialized skills instead):

    • Diagnosing failures (lost-in-the-middle, poisoning): use context-degradation.
    • Reducing token cost (masking, partitioning, budgets): use context-optimization.
    • Summarizing sessions: use context-compression.
    • Offloading large outputs/scratchpads: use filesystem-context.
    • Project/pipeline architecture: use project-development.
  6. Understand the Schema Registry and Canonical Artifacts

    main

    The researcher/schemas/ directory serves as a runtime-neutral interchange boundary for durable organization records. It provides a common lookup surface for schemas via a registry, even though individual schema owners maintain their own files.

    Directory Layout

    • registry.json: The active registry containing exact schema-file digests.
    • registry.schema.json: The meta-schema for the registry itself.
    • v1/: Contains Draft 2020-12 schemas owned by SPEC-003.
    • fixtures/: Shared Python and TypeScript conformance records used for testing.
    • generated/: Contains evidence for compatibility, current-corpus, migration, and conformance.
    • public-legacy-sources.json: Defines the exact set of public fixtures allowed in migration evidence.
    • typescript/: An independent Ajv and canonicalization consumer with a reusable compiled runtime registry.

    Note: SPEC-002 export schemas are located in researcher/exports/schemas/ and are imported into the registry by their exact digest.

  7. Explore the Book SFT Pipeline directory structure

    main

    The book-sft-pipeline directory contains documentation, case studies, and implementation references:

    • SKILL.md: The complete, standalone skill documentation.
    • examples/gertrude-stein/: A complete case study including:
      • training_config.json: Configuration used for training.
      • dataset_sample.jsonl: Sample data format.
      • sample_outputs.md: Raw model outputs.
      • README.md: Results and analysis.
      • pangram/: AI detector screenshots.
    • scripts/pipeline_example.py: A conceptual implementation of the pipeline.
    • references/: Contains segmentation strategies and format definitions (tinker-format.md, tinker.txt).
  8. Use the BDI Mental State Modeling skill

    main

    The bdi-mental-states skill is used to transform external RDF context into formal agent mental states (Beliefs, Desires, and Intentions). This enables agents to reason about context through a cognitive architecture, supporting deliberative reasoning, explainability, and semantic interoperability.

    When to use this skill:

    • Processing RDF context into agent beliefs about world states.
    • Modeling rational agency (perception $\rightarrow$ deliberation $\rightarrow$ action).
    • Enabling explainability via traceable reasoning chains.
    • Implementing BDI frameworks (SEMAS, JADE, JADEX).
    • Augmenting LLMs with formal cognitive structures (Logic Augmented Generation).
    • Tracking the temporal evolution of mental states.

    When NOT to use this skill:

    • For general context-window or attention mechanics (use context-fundamentals).
    • For persistent memory without formal BDI state (use memory-systems).
    • For supervisor/swarm topology decisions (use multi-agent-patterns).
    • For general agent evaluation (use evaluation).
  9. Manage content using the Content Hub module

    main

    The content-module serves as a centralized system for content planning, writing, and tracking. It uses a combination of JSONL files for structured data (ideas, posts, engagement) and Markdown files/folders for unstructured content (calendar, drafts, templates).

    Module Structure

    • ideas.jsonl: Append-only log of raw content ideas.
    • posts.jsonl: Log of published content and associated metrics.
    • calendar.md: Markdown-based content schedule.
    • drafts/: Directory for work-in-progress Markdown files.
    • templates/: Directory containing reusable content formats.
    • engagement.jsonl: Log of saved posts or threads used for inspiration.
  10. Manage relationships with the Network Module

    main

    The Network Module acts as a personal CRM for managing contacts, interaction history, and networking notes. It is designed to be used for pre-meeting preparation, logging conversations, and facilitating introductions between contacts. The module relies on four primary files:

    • contacts.jsonl: A database of people.
    • interactions.jsonl: A log of meetings and conversations.
    • circles.yaml: Definitions for relationship tiers and groups.
    • intros.md: A record of pending or completed introductions.