PTENES
MODULE 2.3

📦 Skills, Artifact Generation & Tokens

Package workflows as reusable commands and master the context budget. You understand what skills are and when to package them, build an email draft skill that can be invoked as a slash command, put together a slide deck generator, learn the five prompting patterns, fight context rot, decide between /clear e /compact, saves tokens, and consolidates everything into a checklist of 12 tips.

9
Topics
~75
Minutes
Inter.
Level
Practice
Type
Module progress 0% · 0 of 9

A skill is a workflow packaged in a special folder and triggered by a slash command — loaded on demand without bloating the context. The diagram below shows the skill becoming a reusable command and, on the right, the context budget with zones indicating when to give /compact and when to give /clear.

Workflow .md instructions (the W layer) .claude/skills/ draft-email/SKILL.md name · description · args + Python tools (T) /draft-email loads on demand Context budget 0–50% · safe 50–70% yellow 70–85% /compact 85%+ /clear quality degrades after ~60% — manage the context before it turns into noise

Illustrative diagram — conceptual recreation of skills and the context budget, not a real screenshot.

1

📦 What Skills Are

What it is: a skill is basically the same thing as a workflow (the W layer of WAT) — instructions in markdown — except stored in a special folder, the .claude/skills, with each skill in its own subfolder and a skill markdown file inside. The difference is in where it lives and in how it is triggered: the skill is exposed as a slash command, a reusable command you call by name. Under the hood, the skill can still invoke tools (Python scripts for search, scraping, and document generation), so the WAT framework remains intact.

💡 Why learn

Skills matter for four reasons: consistency (the same process every time, without re-explaining), token savings (load only when invoked), sharing (the same skill serves an entire team) and reliability (wrap up complex steps that are easy to forget, so you delegate and forget). Best of all, you don't need to know how to write skills — describe the workflow and ask the agent to turn it into a reusable slash command.

  • •Consistency: the process doesn’t vary between runs.
  • •Tokens: loaded on demand, not every session.
  • •Shareable: distribute the folder, and the team uses the same skill.
  • •Reliable: wraps the step that's hard to remember.

🗂️ Skill ≠ CLAUDE.md

CLAUDE.md stores only the rules for every session (project purpose, main objective, framework). Instructions per task belong in skills — that way, you avoid exceeding the context window. Having 20–50 skills doesn’t bloat the context the way one giant CLAUDE.md would, because skills are only loaded when called.

Key concepts

Markdown

Same as a workflow.

.claude/skills

One folder per skill.

Slash command

Invoked by name.

On demand

Loads only when used.

2

⚖️ Skill vs. typing

What it is: not every request deserves to become a skill. The decision is simple: package it when the gains in reuse and consistency outweigh the effort of creating the skill; type it directly when the request is simple and one-off. Packaging too early is overkill; too late means tedious repetition.

✓ It's worth creating a skill

  • ✓It's a repeated workflow — you do this every week.
  • ✓A consistency matters — the result needs to be the same every time.
  • ✓The instructions are complex or easy to forget.
  • ✓Other people from the team will run the same process.

✗ Just Type It Instead

  • ✗It's a one-off task, that you won't repeat.
  • ✗You're still experimenting and the process changes.
  • ✗The instruction fits in one sentence — a skill would be overkill.
  • ✗There’s no reuse in sight—packaging it would only add friction.

🎯 Why learn

The practical rule: in the third time that you type nearly the same long instruction, stop and ask the agent to turn it into a skill. Before that, typing is faster; after that, the skill pays for itself in just a few uses.

Key concepts

Repetition

Skill's #1 trigger.

Consistency

Output is always the same.

Complexity

Easy steps to forget.

Overkill

One-off? Just type.

3

✉️ Skill in practice: /draft-email

What it is: a hands-on build of a draft an email — created, tested, refined, and invoked as a slash command. Its anatomy is a folder .claude/skills with a subfolder for each skill, each with a SKILL.md that defines name, description, the arguments expected and the steps. Arguments here might be bullet points with the key information, recipient, and tone. It becomes callable as /draft-email — slash commands were unified with skills, comparable to built-ins like /clear.

.claude/skills/draft-email/SKILL.md (illustrative example)
name: draft-email
description: Rascunha um e-mail polido e conciso, sem enrolação.

## Argumentos
- bullets: pontos-chave do conteúdo
- destinatario: para quem é (ex.: cliente)
- tom: profissional | amistoso | formal

## Comportamento
1. Se faltar algum argumento, pergunte antes de escrever.
2. Escreva um e-mail claro, direto e sem enchimento.
3. Salve o rascunho em temporary/outputs/email.md

🛠️ Why learn — the build workflow

1

Create in Plan Mode

Ask for a skill that follows the official format, describing inputs (bullets, recipient, tone), behavior, and where to save the output. Approve the plan.

2

Clear context and invoke

Clear the conversation and call /draft-email. Invoking it without arguments prompts the agent to ask for the missing information.

3

Reuse with new inputs

Clear again, call the slash command with a different recipient/tone, and get a fresh output following the same rules. To modify the skill, just ask the agent to change it.

🎯 Practical tip

Clear the context between uses for clean, consistent runs. The skill ensures the same rules (tone, concision, structure) on every invocation — that's exactly what makes delegate and forget different from having to re-explain everything.

Key concepts

SKILL.md

name · description · args.

Arguments

bullets · destination · tone.

Question

Without args, it prompts you.

Reuse

Clear and call again.

4

🖼️ Slide deck generator

What it is: another full build in the WAT framework — a workflow that takes a document and generates a professional presentation from it. Reuse the standard flow: CLAUDE.md (WAT) → workflow + tools → run → iterate. In Plan Mode, the agent asks setup questions (tool language, how to extract key points, presentation style). The workflow reads the document, extracts the points, and creates the presentation file.

workflows/documento-para-slides.md (illustrative example)
# Workflow: documento → slides

## Entrada
Documento em temporary/resources/ (10–16 páginas)

## Passos
1. Ler o documento e extrair os pontos-chave.
2. Estruturar em títulos + bullets por slide.
3. Gerar a apresentação via ferramenta Python.

## Saída
Deck (ex.: 26 slides) em temporary/outputs/

🎨 Why learn — iteration and design

You don’t need to understand the Python tools—just check whether the workflow logic produces the desired output. There’s always room to improve the design: colors, fonts, corporate vs. casual style, a mix of text and bullets instead of bullets alone. And there’s a powerful shortcut for reuse: override a public slide design skill to the workflow elevates the visual design without you having to manually explain each design need.

  • •Input: document in temporary/resources.
  • •Output: professional deck in temporary/outputs.
  • •Upgrade: a design skill built into the workflow.

🎯 Practical tip

Run the build with permission bypass only after approving the plan. And remember: once you’re comfortable with the basic workflow, plugging in a dedicated design skill is the cheapest way to improve the deck’s quality—the skill brings the design knowledge you don’t want to rewrite.

Key concepts

WAT again

CLAUDE.md → wf+tools.

Doc → slides

Extract and structure.

Iterate on the design

Color, font, style.

Design skill

Overrides the workflow.

5

🗣️ 5 prompting patterns

What it is: five prompting patterns that produce consistent, high-quality results. They turn vague requests into instructions the agent can execute well—and shift your role from "operator" to "manager of a specialist."

1

Define the goal, not the steps

Describe the result you want; let the agent decide the sequence. You describe the “what,” not the “how.”

2

Be specific about the output

Format, structure, file names, and where to save them. The clearer the expected output, the less rework.

3

Plan Mode first, then execute

Approve the plan before letting the agent act; only then switch to execution mode (permission bypass).

4

Give feedback, not fixes

“I like the structure, but the tone is too formal” works better than “this is wrong.” The feedback updates the workflow behind the scenes.

5

Treat the agent as a specialist

You’re the manager; it’s the developer. Delegate the technical work and focus on clearly describing the goal and evaluating the result.

🎯 Why learn

Together, these five patterns connect the self-improvement loop: by giving feedback (not corrections) on a well-specified result, the agent adjusts the underlying workflow — and the next run already comes out better without you having to explain again.

Key concepts

Objective

What, not how.

Clear output

Format and location.

Plan Mode

Plan first.

Feedback

Instead of fixing it.

6

📉 Context Rot & Thresholds

What it is: context rot is the gradual decline in quality as a single session gets longer. The root cause lies in how attention mechanisms work: errors tend to appear after ~60% of window usage, when it fills up with noisy history and recent messages (possibly irrelevant) push the core rules out of the model’s focus.

ZoneRangeWhat to do
Green0–50%Safe—keep working.
Yellow50–70%Start thinking about compacting.
Orange70–85%Run /compact proactively.
Red85%+Run /clear and start over.

⚠️ Why learn — the warning sign

Context rot is real: after ~60% usage, expect more errors. Don’t reuse an overloaded conversation for unrelated work. If you’ve already corrected the agent about the same thing more than twice, the context is probably cluttered—clear it and start over with a better prompt.

Key concepts

~60%

Errors start here.

Attention

The window becomes noise.

4 zones

Green to red.

2 fixes

Sign of dirty context.

7

🧹 /clear vs /compact

What it is: two commands for managing context, with different purposes. /clear é o full reset from the conversation; /compact is a smart summary that preserves the key information and compresses the rest. Knowing which one to use—and when—is what keeps quality high in a long session.

/compact — smart summary

  • •Keeps the essentials and compresses the history.
  • •Use in the middle of a task when the context grows.
  • •Ideal in the orange zone (70–85%).

/clear — full reset

  • •Clears the entire conversation — starts from scratch.
  • •Use with switch tasks or when quality drops.
  • •Ideal above 85% or after 2+ repeated corrections.

🎯 Why learn

Rule of thumb: compact when you’re still on the same task but the context has grown; clean up when you switch tasks or when quality has already degraded. Compacting too late won’t recover context that’s already gone stale—in that case, it’s better to clear it and start over with a better prompt.

Key concepts

/compact

Summarizes, doesn’t delete.

/clear

Complete reset.

Same task

Compact.

Change task

Clear.

8

💸 Token Savings

What it is: a set of strategies to minimize token usage and context waste. Since the agent rereads the entire conversation with every message, long sessions cost more per message—so keeping the context lean also keeps costs low.

🪙 Why learn — the 5 strategies

  • •One task per session, then clean up — don't carry over old context.
  • •Define "done" (e.g., "exactly 75 profiles") so the agent stops instead of getting stuck in a loop.
  • •Use skills for specialized workflows, instead of bloating the CLAUDE.md.
  • •Turn off unused MCPs — each one adds tool definitions to the context.
  • •Keep CLAUDE.md concise (under ~500 lines, content from the entire session only).

⚠️ Common pitfall

Without a defined endpoint, the agent may search too much or get stuck in a loop, wasting tokens for no reason. And each active MCP server uses context through its tool definitions—leaving on the ones you don't use is silent waste.

Key concepts

1 per session

Clear afterward.

Define what done means

For the loop.

Skills

Instead of CLAUDE.md.

MCPs off

Turn off idle ones.

9

✅ 12 final tips

What it is: a consolidated checklist of 12 best practices for building high-quality agentic workflows. It’s the operational summary of the entire track—use it as a checklist before and during each build.

  1. Always start in Plan Mode.
  2. Be clear about the goal (e.g., "75 profiles of tech CEOs," not "build a scraper").
  3. Define what it is “ready”.
  4. Treat the agent as specialist — you manage; it develops.
  5. Manage the context proactively (compact at ~70%, clear when switching/breaking, 1 task/session).
  6. Use the self-improvement loop through specific feedback.
  7. Store API keys in environment files.
  8. Test with different inputs.
  9. Save battle-tested skills.
  10. Start from scratch when freeze.
  11. Turn off Unused MCPs.
  12. Track the build early to learn and catch errors.

🏁 Why learn — the practical challenge

Put it all together in your own end-to-end build: meeting-notes-to-actions, a PDF generator, an email drafter, or a workflow for your job. Use WAT, start in Plan Mode, let the agent ask questions, approve the plan, then switch to permission bypass. Use at least one MCP and/or skill when it makes sense (don't force it). Test the output with 2–3 different inputs — a workflow that only works with one input is, in practice, a one-off script.

Key concepts

Plan Mode

Always first.

Clear objective

Specific and measurable.

Plural test

2–3 entries.

.env

Never put a key in the chat.

🧠 Quick check

You’re in the middle of a task, the context has reached ~75%, and the agent is still focused on it. Which command should you use?

📌 Module Summary

✓
Skills — markdown workflows in the .claude/skills folder, invokable as slash commands; consistency, tokens, sharing, and reliability.
✓
When to package — repetition, consistency, complexity, or a team; for a one-off simple task, just type it.
✓
Builds — the /draft-email skill and the slide deck generator (document → presentation) in the WAT framework.
✓
Prompting + context — 5 patterns; context rot after ~60%; zones 0-50/50-70/70-85/85%+; /compact vs /clear.
✓
Savings + checklist — 1 task/session, define "done," skills, MCPs off, keep CLAUDE.md concise; the 12 final tips.

Next Module:

3.1 — From Local to Always-On: GitHub & Trigger.dev