Context Engineering for Marketing and RevOps: The Six Files Your Agent Needs

Context engineering is the work of giving an AI system the right definitions, evidence, tools and task state when it needs them. For marketing and revenue operations (RevOps), that means documenting how your business measures performance, identifies customers and permits actions. A useful starting kit contains six maintained files: metrics, data, naming rules, customer fit, playbooks and brand rules.

Jafrin Akter AloLast updated 16 min read
On this page
An open reference book holds indexed cards and a checklist page with a blue checkmark, beside the headline Give Your AI Better Context.

Ask two colleagues for “last month's conversion rate” and you may get two defensible numbers. One uses website sessions and form submissions. The other uses qualified opportunities and closed-won deals. An agent connected to both systems inherits the ambiguity.

The fix starts by writing down the decision that people were resolving informally. Better context makes the meaning available before the agent selects a query or proposes an action.

How do context, prompts and execution controls differ?

Context engineering vs prompt engineering is a difference of scope: prompt engineering shapes the instruction, while context engineering decides what else the model sees when it carries that instruction out. A prompt gives the current instruction: “review the September pipeline.” Context supplies the definitions, source data and prior decisions needed to do that work. The harness is the surrounding software that manages tools, permissions, execution, retries and saved state.

Anthropic describes context engineering as managing the information available during model inference, including instructions, tools, external data and conversation history. Its guidance emphasises relevance and maintaining useful context as work progresses. Anthropic's context engineering article.

For a marketing workflow, the distinction is practical:

  • The prompt asks for an audience recommendation.
  • The context defines eligibility, exclusions and the intended offer.
  • The software prevents an unapproved audience from being sent to a campaign.

Writing “never send without approval” is useful guidance. Enforcing approval in the execution path is a separate implementation task. When choosing marketing tools to connect through Model Context Protocol (MCP), treat the protocol as a connection mechanism; the application still needs the appropriate access and action controls.

If your team is building this across several tools, Martechdevs' custom agent work connects the business definitions to the tools and controls that apply them.

Where does context engineering sit next to a CDP and semantic layer?

Context files describe business meaning and permitted work; a customer data platform (CDP) manages customer data, while a semantic layer supplies governed calculations. Keep those responsibilities connected without turning the written kit into another copy of every customer record or metric formula.

Where does context engineering sit next to a CDP and semantic layer?
ComponentWhat belongs thereExampleWhat it cannot establish alone
Written contextDefinitions, exceptions, source references and operating instructionsWhat qualifies a trial and when to abstainCurrent customer state or enforced permissions
Customer data or context layerPer-customer facts, relationships and relevant stateAccount ownership and current subscription statusWhich business decision is authorised
Metric or semantic layerMaintained calculation logic and its query interfaceQualified trial rate at an account grainWhether that metric is appropriate for this task
Execution softwareAccess, validation, approvals and action recordsReject an unapproved campaign sendWhether an undocumented definition is meaningful

This is a responsibility map, not a requirement to buy four products. A small team can start with one accepted warehouse model, a short definition and a controlled query path. Add tooling when repeated use across teams exposes a concrete gap in consistency, access or ownership.

For example, the dbt Semantic Layer centralises metric definitions and makes them queryable downstream. In the written kit, refer to the maintained metric and explain its use and exclusions. Keep the executable formula in the system that runs it.

A customer context layer for account facts answers which customer state is relevant now. The wider test of what makes marketing data AI-ready checks whether collection, identity and models are trustworthy before the agent uses either the facts or the instructions.

The six-file kit governs internal work. Public brand facts, documentation and pages that answer search questions serve an outward audience. Keep confidential operating context private; publishing it is not a prerequisite for using it with an agent. To measure the outward side, track AI search traffic in GA4, Google Analytics 4, while recognising that referral visits do not reveal every AI mention.

How should you organise a marketing context kit?

Use a small index that selects six focused files according to the task. A marketing knowledge base for AI works better this way than as a shared drive of every document, because the index points the agent to only what the current job needs. The structure below is an original template for a fictional business-to-business (B2B) software team. Adapt it to your environment; no platform automatically loads these files merely because they exist.

Plain text
context/
  README.md
  metrics.md
  data-dictionary.md
  naming-rules.md
  customer-fit.md
  playbooks.md
  brand-and-claims.md

The index should tell the agent what each file governs, when to read it and who owns it. Keep stable operating rules there. Retrieve detailed definitions when the task requires them.

The marketing context kit skill can draft the shared stack, naming, metric and data-dictionary files with owners, review dates and open questions.

For example, a UTM (Urchin Tracking Module) campaign-parameter review needs naming rules and the campaign brief. It usually does not need the full renewal playbook or every support transcript.

Relevant context should lead to a checkable answer or a bounded proposal. Conflicting definitions, stale evidence and missing execution approval are different stopping conditions; adding more files cannot resolve them automatically.

How the workflow fits together
Load the current request and relevant context, reconcile conflicting definitions with their owner, retrieve scoped evidence, hold conclusions when evidence is stale, and allow only a read-only result or a software-authorized action before recording outcomes.
Read diagram as text
  • Load the request and relevant context from the index to Approved definitions and executable logic agree?.
  • Approved definitions and executable logic agree? to Ask the owner to resolve the disputed definition: No.
  • Ask the owner to resolve the disputed definition to Load the request and relevant context from the index.
  • Approved definitions and executable logic agree? to Retrieve scoped source evidence for the task: Yes.
  • Retrieve scoped source evidence for the task to Evidence is current and sufficient for this conclusion?.
  • Evidence is current and sufficient for this conclusion? to Hold the recommendation and state the missing evidence: No.
  • Evidence is current and sufficient for this conclusion? to Check the answer and any proposed action: Yes.
  • Check the answer and any proposed action to Read-only result or software-authorized action?.
  • Read-only result or software-authorized action? to Keep the action as a proposal awaiting approval: No.
  • Read-only result or software-authorized action? to Return the result and record outcomes and corrections: Yes
Open full diagram

This structure makes maintenance possible. When a lifecycle definition changes, there is one known place to update it and a known set of tests to rerun. A public llms.txt index for agents is a separate website resource; it should point to public material rather than expose this internal kit.

What belongs in metrics.md?

The metric file should resolve the questions hidden inside a familiar label: population, event, period, exclusions and aggregation.

An example:

Markdown
## Qualified trial rate
Owner: Growth operations
Effective from: 2026-10-01

Numerator: Trial accounts that meet the approved qualification rule
within 14 complete days of trial creation.
Denominator: Eligible trial accounts created during the cohort period.
Grain: Account, counted once.
Exclude: Internal, test and duplicate accounts.
Unknown qualification state: Include in denominator; report separately.
Calculation reference: semantic metric qualified_trial_rate
Fallback accepted model: marketing_reporting.trial_qualification_cohorts
Observation rule: Exclude cohorts without a complete 14-day window.

The most valuable line may be the treatment of unknowns. If an agent drops unknown records, the reported rate can improve simply because missing data increased.

Add related terms that must remain distinct. An activated account, a qualified trial and a paying customer may overlap, but they are not interchangeable populations.

Include one small worked example with the expected answer. If 100 eligible trials contain 25 qualified, 60 unqualified and 15 unknown, this definition produces a 25% rate and a separately reported 15% unknown share. That example becomes a reusable acceptance test.

Keep metric logic in a semantic layer, or in a single accepted model if the team does not have one. The prose explains meaning and points to that implementation; it should not become a separately maintained formula. If code and prose disagree, stop the disputed calculation and ask the metric owner to reconcile them.

What belongs in data-dictionary.md?

The data dictionary records authoritative sources, record relationships, time fields and known limitations. Include the customer relationship management (CRM) mapping and any join that can multiply one business entity into several rows.

Markdown
## Account identity
Business key: account_id
Billing mapping: account_id -> billing_customer_id
CRM mapping: account_id -> crm_company_id
Expected relationship: one current CRM company per account

## Subscription state
Authoritative source: billing subscription events
Reporting model: customer_reporting.subscription_daily
Grain: one account per reporting date
Freshness expectation: complete through the previous UTC day
Known limitation: CRM lifecycle stage can lag billing status

Document timezones and timestamps separately. created_at, qualified_at, closed_at and synced_at answer different questions. If the agent chooses a valid but inappropriate date field, the query can run successfully and still produce a misleading report.

Also record join hazards. For example, one account may have several contacts and several subscriptions. Joining all three raw tables can multiply rows. The dictionary should identify the approved model or aggregation that avoids that multiplication.

Keep personal data out of a general context file when a description is sufficient. The agent usually needs to know how identity works before it needs to inspect an actual customer record.

The warehouse design guide explains how to turn these relationships into models that support repeatable analysis.

What belongs in naming-rules.md?

Naming rules turn campaign metadata into something the team can analyse consistently.

Markdown
## Paid campaign URL rules
utm_source: approved platform identifier
utm_medium: paid_social or cpc, according to channel policy
utm_campaign: stable campaign identifier from the campaign register
utm_content: creative identifier
Case: lowercase
Spaces: prohibited
Personal data: prohibited in URL parameters

Validation output: original URL, proposed URL, reason for each change
Unrecognised value: flag for review; do not invent a new convention

The final line prevents the agent from “cleaning up” a value by creating a new category nobody else uses.

Keep a distinction between identifiers and display labels. A campaign's marketing name can change while its analytical identifier stays stable. That stability makes longitudinal reporting much easier.

For a migration, maintain an explicit mapping between old and new values. Retrofitting names in a spreadsheet does not automatically rewrite historical analytics data or every destination URL already in circulation.

The UTM naming guide provides a fuller campaign-level convention and QA process.

What belongs in customer-fit.md?

An ideal customer profile (ICP) file needs observable evidence, exclusions and a rule for unknowns. “Growing software companies” gives an agent too much room to guess.

Markdown
## Fit for the implementation offer
Positive evidence:
- Uses the supported CRM and has a named operations owner.
- Has a specific cross-system reporting or lifecycle problem.
- Can provide access to the required systems during implementation.

Exclusions:
- Requests only a purchased contact list.
- Has no owner for the resulting workflow.
- Requires a capability outside the current service scope.

Unknown evidence: label unknown and state what would resolve it.
Company size alone: insufficient to classify as qualified.

These example criteria are illustrative. Use the actual buying conditions and delivery constraints of your business.

For research workflows, require a source and observation date. A company's old job advertisement may suggest it once used a tool, but it does not establish that the tool is still installed.

Separate fit from intent. An account can match your service well without showing any current need to buy. That distinction changes the appropriate next step and prevents manufactured urgency in outreach.

What belongs in playbooks.md?

A playbook should identify the trigger, evidence, decision and permitted next step.

Markdown
## Trial activation review
Trigger: eligible account reaches day 7 without the activation event.
Check: event ingestion freshness, current paid status, open support issue.
If data is stale: stop and report the freshness problem.
If already paid: exclude from trial outreach.
If support issue is open: route the recommendation to its owner.
Otherwise: prepare the approved assistance message for review.
Output: account ID, evidence, recommended next action and reason.
Execution: sending requires the configured campaign approval process.

This is more useful than a long list of generic customer-success advice because it tells the agent what to do with conflicting evidence.

Define completion too. “Reviewed account” could mean the agent retrieved data, wrote a recommendation or actually updated a task. Use a precise status so a later run does not mistake a proposal for a completed action.

For retryable operations, define how the implementation recognises an action that already happened. This is idempotency: repeating the same intended operation should not create an extra business effect. Use an approval step enforced in software before writes or sends; the playbook describes the boundary, while the execution system must enforce it.

What belongs in brand-and-claims.md?

The brand file should contain approved writing examples, explicit claim rules and evidence owners. Specific editorial decisions are easier to apply than a list of adjectives.

Markdown
## Writing principles
Lead with the useful answer.
Use concrete examples and explain the mechanism.
Remove sentences that add no evidence, instruction or necessary context.
Use direct language without exaggerated promises.

## Claims
Use only approved product capabilities and current offer terms.
Label modelled examples as examples.
Do not imply a customer result without an approved source.
When evidence is missing, qualify the claim or remove it.

## Examples
Keep three approved samples with notes on their openings,
sentence progression, level of detail and calls to action.

Add examples of weak and improved sentences using your own material. Explain the improvement: perhaps the revised line replaces a vague benefit with a specific operational result.

For instance, “improve reporting efficiency” says little. “Give the revenue meeting one agreed pipeline figure, with the source query attached” tells the reader what changes and how it can be checked.

Keep factual approval separate from voice approval. A sentence can sound exactly like the founder and still make an unsupported claim.

Who maintains context files, and when should they expire?

To keep AI context up to date, name the business owner who can approve each rule and the condition that triggers review. Use a compact header for each maintained document:

YAML
owner: revenue-operations
version: 1.2
effective_from: 2026-10-01
review_by: 2026-11-01
applies_to: trial-activation-review
status: approved

The dates are examples. Choose review frequency according to how quickly the content changes. Define what happens when review is overdue: an expired offer or eligibility rule may need to block action, while an outdated background note can be excluded until its owner checks it.

Also define precedence. Signed customer terms may govern a specific account; an approved internal policy governs the general process; an old sales note is supporting evidence. The agent should not decide authority purely from whichever document was retrieved most recently.

Remove superseded context from the active retrieval path while retaining an archive where needed. Leaving two conflicting “current” definitions available creates a problem that more detailed prompting may never fix reliably.

How can a scheduled check catch context drift?

Compare approved context with current system definitions and propose edits for the owner to review. A weekly schedule is a starting example; run an additional check when a metric, customer property or published tag changes. Anthropic's routines documentation includes a weekly documentation-drift workflow that opens pull requests for an editor.

Use the deployed system state as the comparison target:

How can a scheduled check catch context drift?
SystemRead-only evidenceCompare with the kitWhat still needs a person
HubSpotProperty definitions for permitted objectsInternal names, types and allowed valuesThe business meaning of an added or renamed property
Google Tag ManagerPublished container version and its contentsRelevant campaign/event naming and configured variablesWhether an intentional change requires a new naming rule
dbtManifest from the accepted deployed job or commitModel references, dependencies and documented definitionsWhether a changed calculation should replace the approved metric

HubSpot's properties API, an application programming interface for object metadata, can retrieve property details. A property label and its internal name serve different purposes; preserve the internal reference and review display-label changes separately.

Google Tag Manager (GTM) can list container version headers, but a header list does not contain the full configuration. Retrieve the container version, using its documented published-version selector when comparing production. Both methods accept the read-only scope. The latest saved draft may differ from the published version.

The dbt manifest describes project resources and dependencies; its schema version depends on the dbt version. Bind the snapshot to the intended deployment. A manifest by itself is not proof that a model completed successfully or that a database column changed its real-world meaning.

A proposed drift check can follow this sequence:

  1. Read the approved context version and the permitted metadata snapshots.
  2. Compare stable identifiers, types, values and referenced definitions with the previous accepted snapshot.
  3. Classify each difference as a missing reference, structural change or question for the business owner.
  4. Open a proposed documentation change containing the evidence and affected acceptance cases.
  5. Let the owner review and merge it, then rerun the affected tests before the new context becomes active.

Give the job read access to source metadata and only the repository permissions needed to propose a change. Do not attach production CRM-write or campaign-send access. Routines run autonomously, so “open a proposal only” in the prompt must be backed by access restrictions and branch protections. Routine execution and repository permissions.

This is a proposed maintenance workflow, not an installed routine or a claim that metadata comparison can approve business meaning automatically.

How do you connect context to tools without loading everything?

Give the agent a small index, descriptive tool names and a clear path to the relevant evidence. Anthropic's tool-design guidance stresses clear tool contracts and evaluation against realistic tasks. Writing effective tools.

Use slash commands that load only what a job needs to turn that context plan into a repeatable task.

For example, get_trial_activation_summary can return the approved metric, cohort window, freshness and count of unknown records. That is easier to use consistently than a generic tool returning every property on every account.

Claude Code reads CLAUDE.md instructions and supports @path imports; imported content loads with the referring file. Its memory documentation also states that these instructions are context rather than enforced configuration. Keep the always-needed index small and load detailed procedures when relevant. Claude Code memory.

For the file layout and maintenance workflow behind that approach, follow Claude Code memory for marketing teams.

Skills offer another packaging option for repeatable procedures and supporting files. The Agent Skills specification defines a SKILL.md-based structure. A skill can tell the agent when to read a playbook; it does not grant access to the data or enforce a security boundary. Agent Skills specification.

For Claude's app, the skills guide lists Free, Pro, Max, Team and Enterprise access with code execution enabled. Personal skills are managed in Customize > Skills; organisational policy can also govern access. Check the setting in the account that will run the workflow.

The marketing skills guide shows how to package these instructions around useful tasks. For another client, check ChatGPT connections to your marketing tools and verify the actual retrieval and action path instead of assuming a Claude-specific file mechanism transfers unchanged.

How can the wrong definition produce a plausible renewal list?

A valid field can produce a plausible wrong answer when its meaning differs from the task. In this fictional example, an agent asked to identify renewal risk sees a CRM field called last_active_date and flags 40 accounts.

The data dictionary reveals that the field records the last CRM interaction, not product usage. The agent has answered a different question: which customers have had little recorded sales contact?

After the context is corrected, the workflow uses a product-adoption model, contract renewal date and unresolved implementation milestones. It identifies 14 accounts for review, with five additional accounts marked unknown because recent usage data is missing.

Those figures are illustrative. The improvement is the decision process: the agent uses the intended evidence and preserves uncertainty.

Add the original failure to the acceptance set. Ask the same renewal question with misleading field names present and check that the agent still selects the approved model. Otherwise the next schema addition can recreate the problem.

How should you test a change to the context kit?

Test whether the changed context makes the agent choose the intended evidence and respect the action boundary. Use realistic questions with explicit expected outcomes, including ambiguous metrics, stale data, exclusions and a prohibited action.

Use a small acceptance set like this original example:

How should you test a change to the context kit?
Test inputExpected choiceEvidence to retainFailure that blocks release
“Last month's conversion rate” without a defined funnelAsk which approved metric and population applySelected definition or clarificationSilent choice of an unrelated denominator
Qualified-trial cohort with 15 unknowns among 100 accountsKeep unknowns in the agreed denominator and report themCohort and resultUnknowns silently removed
Renewal review with stale product usageMark missing evidence and hold the recommendationFreshness result and unresolved accountsConfident risk label from the CRM contact date
Request to send an unapproved messageStop at the configured approval boundaryProposed action and enforcement resultA message is sent before approval

For longer tasks, preserve completed work and unresolved decisions in a structured progress record. Anthropic's work on long-running harnesses discusses the need to maintain useful state across sessions. Long-running agent harnesses.

A marketing version can record the campaigns already reviewed, the files changed, the evidence still missing and the approvals still pending. That prevents the next session from repeating work or treating an unfinished review as complete.

What should pass before the context kit is used?

Release the kit when its definitions have owners, the client retrieves the intended files and the acceptance set produces the required decisions. Passing a file-format check alone does not establish correct agent behaviour.

Checklist

  • Each key metric has a population, period, grain and exclusions.
  • Identifiers, joins and freshness expectations are documented.
  • Naming rules include approved values and unknown-value handling.
  • Customer fit includes evidence requirements and exclusions.
  • Playbooks define triggers, exceptions and completion states.
  • Voice examples explain the editorial choices to preserve.
  • Claims have sources and an approval owner.
  • Documents have versions, owners and review dates.
  • Retrieval and actual tool access have been tested.
  • Context changes pass a realistic acceptance set.
  • Scheduled drift checks use the intended deployed metadata and propose changes for review.

Use the marketing context kit skill to draft the shared definitions, file owners and known-answer checks, and identify gaps before the kit is released.

At Martechdevs, we build the data access, definitions and working instructions behind repeatable AI workflows. Start with the free AI readiness checklist, or request an AI assistant implementation scope around the workflow, data access and approvals you need.

Keep reading

Browse all Martech AI guides

Questions people ask

What is the quickest way to start context engineering for a marketing team?

Choose one recurring decision and document only the definitions and evidence needed to make it correctly. Assign the business owner, add a worked answer and test an ambiguous or stale-data case. Put the references in a small index the agent can actually read. Expand the kit when a failed task reveals a specific missing rule, rather than uploading the whole company archive.

How should multilingual teams maintain the same business definition?

Keep one approved definition and link each translation to its version and owner. Translate the explanation while preserving system identifiers, metric references and allowed values exactly. Have a domain owner review wording that changes eligibility or claim meaning, then test equivalent questions in the relevant languages. An updated translation should not quietly introduce a different population, deadline or permission rule.

Can the same context kit serve an agency's different clients?

Reuse the structure and generic procedures, but keep each client's definitions, permissions, evidence and approved claims separate. Select the client explicitly before retrieval and test that another client's material cannot enter the answer. A shared template can reduce maintenance; a shared folder of unrestricted customer records can introduce incorrect context and access problems. Record who approves changes for each account.

Should rejected agent answers become new context rules?

Use rejected answers as evidence of a failure, then diagnose its cause before adding a rule. The problem may be missing data, the wrong tool, an ambiguous definition or a control outside the context file. Add the smallest correction that addresses the cause and test it against other accepted cases. Accumulating instructions for every bad answer can create contradictory procedures.

How should we share a context kit with an implementation partner?

Share the definitions, approved examples and access requirements needed for the scoped work through an approved location. Replace unnecessary customer payloads with representative fixtures and keep credentials outside the documents. Identify which files the partner may propose changes to and who approves them. Before handover, confirm that the resulting workflow works with the intended production permissions and maintained source references.

Sources

  1. Anthropic: Effective context engineering for AI agents.
  2. dbt Labs: dbt Semantic Layer.
  3. Anthropic: Writing effective tools for AI agents.
  4. Anthropic: How Claude remembers your project.
  5. Agent Skills: Specification.
  6. Anthropic: Effective harnesses for long-running agents.
  7. Anthropic: Automate work with routines.
  8. Anthropic: Use skills in Claude.
  9. Google: Tag Manager version_headers.list.
  10. Google: Tag Manager versions.get.
  11. HubSpot: Properties API.
  12. dbt Labs: Manifest JSON file.
Portrait of Jafrin Akter Alo

Written by

Jafrin Akter Alo

Data Engineer and Co-founder at Martechdevs and Growth and Analytics Partners

Jafrin writes practical guides to marketing technology, customer data, analytics and AI workflows. Martechdevs is a Growth and Analytics Partners company.

View LinkedIn profile

Book a Free Call

Thirty minutes on your stack and what it needs. Free, and no pitch.

Thirty minutes, and you leave with a plan

We look at what you have, what it is costing you and what to do about it first.

  • 30 minutes
  • Video call, link on booking
  • No obligation

What we'll cover

  • Your current stack and where it hurts
  • Quick wins we can ship first
  • An integration roadmap
  • Timeline, scope and next steps

Calendar not loading? Open it in a new tab or email hello@martechdevs.com.