# What Artifacts Do AI Lessons Generate? Skills, Prompts, and Agents Explained

> Discover the AI artifacts generated by AI lessons, including skills prompts and agents. Learn how these reusable components are automatically created and stored for immediate use in AI Engineering From Scratch.

- Repository: [Rohit Ghumare/ai-engineering-from-scratch](https://github.com/rohitg00/ai-engineering-from-scratch)
- Tags: deep-dive
- Published: 2026-06-13

---

**TLDR:** The *AI Engineering From Scratch* curriculum automatically generates three reusable artifact types—**skills** (markdown capability documents), **prompts** (structured templates), and **agents** (orchestration programs)—stored in lesson-specific `outputs/` directories for direct downstream consumption.

The *AI Engineering From Scratch* repository (`rohitg00/ai-engineering-from-scratch`) implements a **lesson-driven code generation** architecture where each tutorial produces tangible, reusable outputs. Unlike traditional educational repositories that only store source code, this curriculum automatically exports self-contained artifacts that can be imported into production workflows without modification.

## The Three Core Artifact Types

The repository generates three principal artifact categories, each defined in [`AGENTS.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/AGENTS.md) and produced by the lesson execution pipeline.

### Skills (Self-Contained Capability Documents)

**Skills** are markdown files that encapsulate complete, executable capabilities—ranging from low-level algorithmic implementations to high-level AI pipelines.

Generated at: `phases/<phase-slug>/<lesson-slug>/outputs/skill-<name>.md`

These files contain embedded Python code blocks that can be extracted and executed directly. For example, [`phases/09-reinforcement-learning/06-policy-gradients-reinforce/outputs/skill-policy-gradient-trainer.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/phases/09-reinforcement-learning/06-policy-gradients-reinforce/outputs/skill-policy-gradient-trainer.md) ships a complete REINFORCE implementation, while [`phases/19-capstone-projects/82-jailbreak-taxonomy/outputs/skill-jailbreak-taxonomy.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/phases/19-capstone-projects/82-jailbreak-taxonomy/outputs/skill-jailbreak-taxonomy.md) provides a safety classification system.

### Prompts (Structured Generation Templates)

**Prompts** are JSON or markdown files storing curated prompt templates with placeholders for dynamic injection. These steer downstream LLM or multimodal model behavior.

Generated at: `phases/<phase-slug>/<lesson-slug>/outputs/prompt-<name>.md`

Examples include OCR stack pickers and specialized reasoning templates that lessons produce for consistent model interaction across different pipeline stages.

### Agents (Orchestration Programs)

**Agents** are small Python or TypeScript programs that orchestrate multiple LLM calls or service invocations to achieve higher-level tasks. While agents are technically expressed as *skills* (markdown documents), they represent distinct architectural artifacts.

Generated at: `phases/<phase-slug>/<lesson-slug>/outputs/skill-<name>.md`

Notable examples include the LLM observability dashboard at [`phases/19-capstone-projects/11-llm-observability-dashboard/outputs/skill-llm-observability.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/phases/19-capstone-projects/11-llm-observability-dashboard/outputs/skill-llm-observability.md) and the constitutional rules engine at [`phases/19-capstone-projects/86-constitutional-rules-engine/outputs/skill-constitutional-rules-engine.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/phases/19-capstone-projects/86-constitutional-rules-engine/outputs/skill-constitutional-rules-engine.md).

## The Artifact Generation Pipeline

Every lesson follows a standardized four-step execution pattern defined in [`scripts/lesson_run.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/lesson_run.py):

1. **Implementation** – Source code resides under `phases/.../code/main.<lang>`, demonstrating the core algorithm.
2. **Testing** – Unit tests validate correctness under `code/tests/`.
3. **Output Generation** – Upon execution, the lesson writes artifacts into the `outputs/` directory.
4. **Cataloging** – The system indexes all artifacts in [`outputs/index.json`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/outputs/index.json), which [`site/build.js`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/site/build.js) consumes to generate the public artifact catalog.

This pipeline ensures all artifacts are plain-text (markdown/JSON), enabling version control, text search, and reuse without hidden runtime dependencies.

## Consuming Generated Artifacts in Practice

Because skills store executable Python code within markdown fences, you can extract and run them dynamically. The following pattern demonstrates loading a policy-gradient trainer from its skill file:

```python
from pathlib import Path
import json

# Target the skill file path

skill_path = Path(
    "phases/09-reinforcement-learning/08-ppo/outputs/skill-ppo-trainer.md"
)

def extract_code(md_path: Path) -> str:
    """Extract Python code from markdown code blocks."""
    inside = False
    lines = []
    for line in md_path.read_text().splitlines():
        if line.strip().startswith("```python"):
            inside = True
            continue
        if line.strip().startswith("```") and inside:
            break
        if inside:
            lines.append(line)
    return "\n".join(lines)

# Extract and execute the skill code

code = extract_code(skill_path)
namespace = {}
exec(code, namespace)

# Invoke the trainer function defined in the skill

trainer = namespace["train_ppo"]
env = ...  # Initialize your environment

config = {"learning_rate": 3e-4, "epochs": 100}
trainer(env, config)

```

This approach allows you to treat lesson outputs as **importable modules** despite their documentation-oriented format.

## Summary

- **Skills** are markdown documents containing self-contained, executable capabilities (e.g., RL trainers, safety taxonomies) stored in `phases/<phase>/<lesson>/outputs/skill-<name>.md`.
- **Prompts** are structured templates (JSON/markdown) for steering model generation, located in lesson-specific `outputs/` directories.
- **Agents** are orchestration programs (expressed as skills) that coordinate multiple LLM calls, such as observability dashboards and PR automation bots.
- The **generation pipeline** ([`scripts/lesson_run.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/lesson_run.py)) automatically produces these artifacts during lesson execution and indexes them in [`outputs/index.json`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/outputs/index.json).
- All artifacts are **plain-text and version-controllable**, enabling direct reuse in downstream production systems without proprietary dependencies.

## Frequently Asked Questions

### What is the difference between a skill and an agent in this repository?

While both are stored as markdown files, **skills** represent general capabilities (e.g., a vector similarity algorithm), whereas **agents** specifically orchestrate multiple LLM calls or external services to accomplish complex workflows (e.g., an issue-to-PR bot). Agents are technically implemented as a subset of skills but follow additional conventions defined in [`AGENTS.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/AGENTS.md) for autonomous behavior.

### How do I locate specific artifacts generated by a lesson?

Each lesson stores its artifacts in a predictable path: `phases/<phase-slug>/<lesson-slug>/outputs/`. The master index at [`outputs/index.json`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/outputs/index.json) catalogs all skills, prompts, and agents across the entire curriculum, allowing programmatic discovery without traversing the filesystem.

### Can I use these artifacts in my own production applications?

Yes. The artifacts are designed for direct reuse. Since skills embed executable Python code within markdown documents, you can extract the code blocks programmatically (as shown in the consumption example) and integrate them into your services. The plain-text format ensures no hidden dependencies or vendor lock-in.

### What triggers the generation of these artifacts?

The [`scripts/lesson_run.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/lesson_run.py) script executes the lesson code, which automatically writes outputs to the `outputs/` directory upon successful completion. This process is integrated with the testing pipeline, ensuring artifacts only generate when the underlying implementation passes validation.