agentleFS
wittyreferencewittyreference/twilio-claude-plugin/skills/context-engineering/SKILL.md

context-engineering

Skill2 starsChanged 8 months agoMITView on GitHub

Twilio development skill: context-engineering

82 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use using-agent-skills, constraint-driven-development and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • LLl0k0laDSkill

    using-agent-skills

    Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.

    Also in 24 projects that use this

  • vinvcnSkill

    constraint-driven-development

    把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。

    Also in 4 projects that use this

  • LLl0k0laDSkill

    shipping-and-launch

    Use when preparing to deploy to production. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.

    Also in 26 projects that use this

  • galandoSkill

    source-driven-development

    Version-aware, source-driven development — fetch official docs before writing framework code

    Also in 25 projects that use this

  • az9713Skill

    deprecation-and-migration

    Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

    Also in 22 projects that use this

  • +7 more from LLl0k0laD

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 77 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test output > 50 lines → Tests: 12 passed (voice: 4, messaging: 4, verify: 4)

    line 30
  2. Distinctive:

    Keep full context when actively debugging, writing new code from a pattern, first encounter with an API, doing code review, or security …

    line 87

“Common” is measured: kept by at least 6 in 10 of the 77 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

name: context-engineering description: Context management and compression techniques. Use when optimizing context window usage, managing large sessions, or applying compression strategies for Twilio development.

Context Engineering for Twilio Development

Unified context management skill — fundamentals, compression techniques, and session optimization.

Quick Reference: Compression Ratios

Content TypeRatioPreserveDrop
TwiML5:1Verb sequence, actions, key attrsXML boilerplate, default attrs
Webhook payload4:1From/To, SID, status, body/digitsAccountSid, ApiVersion, geo fields
Test output (pass)10:1Count by categoryIndividual test names
Test output (fail)3:1Test name, expected vs receivedStack traces
Error logs5:1Error code, URL, count, timeframeDuplicate entries
Conversation history8:1Decisions, files changed, current stateImplementation details

When to Compress

  • TwiML responses > 20 lines → Voice: Say(x) → Gather(y) → Dial(z)
  • Webhook payloads > 5 fields → SMS from +1555...4567: "Hello" (SMxxx)
  • Test output > 50 lines → Tests: 12 passed (voice: 4, messaging: 4, verify: 4)
  • Error logs with repeats → Error 11200: /voice/incoming 502 — 5 occurrences in 2 min
  • Session history > 10 exchanges → summarize progress, drop resolved threads

Context Budget

Task TypeRecommended Load
Simple bug fix1 file + error message
New functionPattern file + domain CLAUDE.md
Feature with tests2-3 files max
Complex refactor4-5 files, summarized
Full workflowUse plan mode, load per-phase

Loading Strategy

Always loaded (~2,900 tokens / 1.4% of 200K):

  • Root CLAUDE.md, CLAUDE.md, MEMORY.md

Load on demand (when entering domain):

  • Domain CLAUDE.md (e.g., CLAUDE.md)
  • Similar existing function as pattern
  • Relevant test file

Avoid loading:

  • CLAUDE.md files for domains you're not touching
  • Full test suites (just the relevant test)
  • Historical git logs
  • Passing test output (compress to counts)

Session Optimization

After 10+ exchanges: Summarize progress, drop resolved discussions, keep decisions.

Session summary format:

## Session Summary
### Completed: [tasks done]
### In Progress: [current work]
### Key Decisions: [choices made]
### Files Modified: [file list]

Twilio-Specific Patterns

TwiML compression: Say(welcome, Amy) → Gather(dtmf+speech, 5s) → Redirect(/ivr)

ConversationRelay compression: CR: wss://relay.example.com (Amy, Deepgram STT, interruptible)

Webhook compression: Inbound call: +1555...4567 → +1555...6543 (CAxxx, ringing)

Gather result: Gather: DTMF="2", Speech="support please" (92% confidence)

Verify status: Verify: +1555...4567 via SMS → pending (VExxx)

When NOT to Compress

Keep full context when actively debugging, writing new code from a pattern, first encounter with an API, doing code review, or security auditing.

Anti-Patterns

  • Loading all CLAUDE.md files "just in case"
  • Keeping full error logs after the bug is fixed
  • Including passing test output in ongoing context
  • Repeating the same context in every message
  • Loading full webhook payloads when only From/To/Body matter

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.