From scattered issues to automatic pull requests: the language that makes Shift act with precision
Imagine an issue opened in the repository: decent title, some description, maybe a thread discussion. Now imagine an autonomous agent is going to execute this issue — it will read the context, write the code, open the PR.
The question that matters isn’t “can the agent do this?”. The question is: will the agent get it right on the first try, or will it produce a PR that doesn’t work?
Shift’s execution depends on the context it receives. ICM — Interpretable Context Methodology organizes that context in the repository: global rules, area guidance, and local instructions. That is why Shift can work without a specialized agent for every folder.
Incantations complement this foundation. They help assess and prepare each issue, then indicate when Shift should execute it. ICM tells the agent how to navigate and work in the repository; Incantations shape the context and intent of each task.
- A repository that responds to spells
- The distinction that changes everything:
lblversuscmd - The anatomy of an Incantation
- Two layers of AI: Gemini and Shift
- The state machine that feeds the agent
- The two commands:
improve-contextandresolve - Passive intelligence: triage without asking
- Guardrails: why control is the product
- Possible paths and triage semantics
- What's next
A repository that responds to spells
In CERC’s data platform, we adopted a metaphor that’s not just aesthetic. When we call the command catalog Incantations and the structure that holds them Grimoire, we’re saying something about how this system should be treated: with respect, with precision, with awareness that the wrong invocation has consequences.
- DataPlatform Shift is the autonomous agent that executes engineering tasks in the repository — it reads an issue, understands the scope, writes code and opens a pull request.
- Grimoire is the structural tome: the organized collection of scripts and automations that bring Shift’s rules to life within the repository.
- Incantations are the invocations — the official and versionable catalog of everything that can be said to the repository to produce a concrete effect.
What distinguishes this design from a common workflow is the separation between what the system knows about itself and what humans can invoke. Incantations are that boundary.
The distinction that changes everything: lbl versus cmd
The catalog today exposes exactly two flavors of Incantation. Two not by limitation — by deliberate choice.
This separation carries an important philosophical distinction: state and intention are not the same thing, and confusing them creates fragile systems.
A label shift:lbl:ready tells the system the issue was evaluated and is ready for Shift. An @shift:cmd:resolve says that I, human, am deciding to trigger execution now. The first is a memory — the second is a will.
By naming them with distinct flavors, the catalog makes that difference impossible to ignore.
The anatomy of an Incantation
Each Incantation has a canonical identity — the complete and unambiguous form — and an operational token — the exact value that appears on GitHub.
shift:lbl:needs-context → issue awaits more context for Shift to act
shift:lbl:blocked → scope outside Shift's jurisdiction
shift:lbl:ready → ready for autonomous execution
shift:lbl:running → task created, execution in progress
@shift:cmd:resolve → trigger execution of a ready issue
@shift:cmd:improve-context → consolidate context and reclassify
Six tokens. But within them lives all the logic of preparation and control for an agentic platform in production.
Two layers of AI, one single flow
Before diving into states and commands, it’s worth naming something implicit in the design: the entire Incantations flow uses two AI systems with radically different roles.
improve-context. It's Gemini that transforms noise into structured context.@shift:cmd:resolve is triggered and all preconditions are met. Only at that moment does the agent receive the issue, read the prepared context, and start writing code.This separation is intentional. Gemini filters, evaluates and structures — all within GitHub Actions workflows, with no agent latency cost. Shift executes. Incantations are the layer ensuring Shift always receives the best possible input when finally invoked.
The state machine that feeds the agent
What makes the Incantations design elegant is that it’s not just a list of commands — it defines an explicit state machine. Each issue is always in some Shift state, and the agent only receives an issue when it reaches ready state with sufficient context for good execution.
flowchart LR
A[no label] -->|issue opened or commented| T[passive triage]
T --> NC[needs-context]
T --> BL[blocked]
T --> RD[ready]
NC -->|improve-context| IC[consolidates and reclassifies]
BL -->|improve-context| IC
RD -->|improve-context| IC
IC --> T
RD -->|resolve| RN[running]
RN -->|PR with closes closed| A
The complete flow exists for a reason: when Shift finally executes, the issue’s context has already passed through multiple layers of evaluation and consolidation. This is not bureaucracy — it’s the difference between a PR that gets it right and one that needs five rounds of review.
needs-context: the issue is not yet ready for the agent
This is the most common state for new issues. Passive triage evaluated and identified missing elements for Shift to work safely: sufficient technical context, clear acceptance criteria, defined scope boundary, explicit validation path.
It’s an honest state. It doesn’t say the issue is bad — it says it’s not complete enough to be handed to the agent. Shift executing on a needs-context issue would produce an imprecise or incomplete PR. The label exists to prevent exactly that.
blocked: outside jurisdiction
shift:lbl:blocked is the platform’s safety boundary. When triage identifies the scope penetrates forbidden areas — CI/CD files, pipeline configuration, permission structures — it signals that Shift shouldn’t act there.
What makes this guardrail sophisticated is it’s not purely lexical. Citing .github/workflows as an example of “what not to do” doesn’t block the issue. What blocks it is the path appearing as real implementation scope. When there’s ambiguity, Gemini — running in GitHub Actions — decides semantically. This distinction between citation and real scope is the kind of nuance a regex never captures and what makes the difference between a guardrail that protects and one that obstructs.
ready: the rune of readiness
shift:lbl:ready is the most valuable state in the catalog. It means the issue passed all triage criteria and has sufficient context for good Shift execution. The agent, when triggered, will have what it needs to produce a relevant and correct PR.
But ready doesn’t mean Shift will run — execution still depends on explicit human invocation. The human maintains control over when to trigger, even if the system validated the issue is ready.
An important detail: ready is not a sticky state. Any new comment on the issue triggers a new triage round. If the comment brings context that changes the assessment — for example, expanding scope to a forbidden area — the issue can be reclassified to blocked or needs-context even after reaching ready. The label always reflects what the system concluded in the last evaluation.
running: the invocation was accepted
shift:lbl:running marks that the task was created and Shift is executing. It’s the transient state — the issue remains alive until the PR is linked. When the PR assumes jurisdiction, the label is removed automatically.
The two commands: distinct intentions with distinct mechanics
@shift:cmd:improve-context: the context spell
This command has a precise function: force a new context consolidation and trigger a new triage cycle. The goal isn’t to produce a human-readable summary — it’s to feed Shift’s next evaluation cycle with more complete and structured information, so the agent has better input when executing.
When you comment @shift:cmd:improve-context on an issue, two comments are published in guaranteed sequence:
First — the consolidated comment: the GitHub Actions workflow reads the entire thread, filtering automation comments to avoid noise, and uses Gemini to produce a structured consolidation with three components:
- Current state summary — what’s clear about the request and where it’s stuck.
- Key thread facts — only information that emerged from discussion and wasn’t in the original issue body: file names, jobs, services, specific requirements raised in comments.
- Open blockers — only questions preventing readiness triage, not general concerns.
Second — the new [shift-triage]: immediately after publishing the consolidation, the system triggers a new triage round already with this material as base and publishes a new classification comment. The issue can move from needs-context to ready in the same cycle.
The command accepts additional context. You can write @shift:cmd:improve-context and continue in the same comment — or on lines below — with information you want included. Shift understands everything after the command is operator guidance and this content enters the consolidation directly. Editing an existing comment also works: if the final content still starts with @shift:cmd:improve-context, the entire cycle re-executes.
This design makes improve-context the most efficient path to unblock a stuck issue: instead of waiting for another passive triage cycle, you inject context and force immediate re-evaluation. It works in any label state.
@shift:cmd:resolve: the resolution spell
This is the only point in the flow where the Shift — the autonomous engineering agent — is finally invoked. Everything that came before (triage by Gemini, context consolidations, state transitions) was preparation. resolve is the trigger that converts validated context into real execution.
To be accepted, it requires:
- Issue to be in
shift:lbl:ready— notneeds-context, notblocked. - Comment to be exactly
@shift:cmd:resolve— no text before, during or after. Editing an existing comment also works, as long as the final content is exactly this. - No PR already linked to the issue.
- Issue not in
shift:lbl:running.
These conditions aren’t bureaucracy. Each eliminates a specific error class:
- The
readyrequirement ensures the agent only receives issues that passed triage — issues with validated context. - The exactness requirement eliminates accidental invocations in comments where the command appears as mention or example.
- The linked PR check prevents duplicate executions when a PR is already in progress but the label hasn’t updated.
- The
runningcheck ensures no two agents work on the same issue in parallel.
When all conditions are met, Shift prepares the issue’s final context — filtering automation comments, internal markers and previous resolve invocations — and creates the task. The issue gets shift:lbl:running, and the task URL is commented automatically so the team can track it.
Passive intelligence: triage without asking
It’s not just when humans comment that the system acts. One of Incantations’ most powerful characteristics is that substantial intelligence runs passively, without explicit invocation.
Every time an issue is opened or a comment is created — or edited — passive triage automatically evaluates state, updates the label and publishes a new comment [shift-triage]. The flow is append-only: each round adds a new comment to the thread, never overwrites previous ones. This preserves complete evaluation history on the issue itself. The system also maintains hidden state with metadata persisting between evaluations, allowing each triage round to build on where the previous one stopped.
When an issue finally reaches shift:lbl:ready, Shift automatically publishes a comment with the exact next step instruction — @shift:cmd:resolve — so the operator doesn’t need to remember syntax. This helper is marked internally and doesn’t contaminate the context sent to the agent when execution begins.
The system also automatically cleans shift:lbl:running in two distinct scenarios: when the issue is closed directly on GitHub, and when a PR referencing it is opened with correct closing directives (closes #N, fixes #N, resolves #N). In the second case, jurisdiction migrates to the PR. In both, no human action is needed beyond the gesture already being made.
Guardrails: why control is the product
An agentic platform that doesn’t know how to say no is dangerous. Incantations were designed with one clear principle: each guardrail exists to preserve system trust.
@shift: but using an uncataloged command gets immediate error feedback. The system doesn't ignore — it responds, explains which commands exist and doesn't reclassify the issue that cycle. Typos don't go silent.running, the running is removed before applying the new state. One issue, one state.Possible paths: semantics and execution flows
State machine design means there are well-defined flows for common situations. Each has a name and known sequence:
Path 1 — ready issue and direct trigger
Flow description: issue is opened with good context, triage applies ready, someone comments @shift:cmd:resolve, Shift executes with already-validated context, creates task, marks running, opens PR and then jurisdiction migrates. The happy path — possible because the issue arrived prepared.
When the issue receives ready
ready is the rare state of harmony — it means Gemini concluded that there’s sufficient context, scope is well-defined and no control areas are involved. Shift has everything it needs to execute.
Readiness signals:
- Acceptance criteria are testable and clear.
- Scope is contained — modifications to one or few related files.
- Technical context is complete — references to systems, versions, example data included.
- No pending questions in thread.
- Implementation path doesn’t touch blocked areas.
Example: “Add in-memory caching for frequent queries in the ingestion service. Use Redis with 5min TTL. Test cases: queries for top 100 receivables, queries by period composition. Validate in test/ingest.ts. No CI/CD changes.” That’s immediately ready.
Path 2 — incomplete issue
Flow description: triage applies needs-context. Discussion happens in thread. Someone comments @shift:cmd:improve-context with accumulated context. Shift consolidates and reclassifies. If it becomes ready, the agent already has what’s needed to execute assertively.
When the issue receives needs-context
Gemini looks for elements indicating non-superficial incompleteness:
- Clear acceptance criteria missing — issue says what should be done but doesn’t make clear how to recognize it’s done. The agent needs that finish line.
- Vague or open scope — “improve performance” without indicating where, what metric, what’s the target. Shift would execute but probably in the wrong direction.
- Insufficient technical context — references to systems, jobs or services are made without indicating where to find them, what version, what behavior is expected.
- Open questions in thread — someone commented with legitimate technical doubt that hasn’t been answered. Means even humans are still understanding the scope.
Example: “Add validation to ingestion job” without saying which job, what validation, what error justifies the change. Gemini will ask that be clear before marking ready.
Path 3 — structural blocking
Flow description: triage detects forbidden scope, applies blocked. Team needs to trim the issue — separate scopes, create sub-issues — before trying again. improve-context can help consolidate the new trim before next evaluation.
When the issue receives blocked
blocked is triggered when implementation path crosses areas under platform control or security jurisdiction. Triage detects:
- Modification to
.github/workflows,.github/actions, or CI/CD scripts — this isn’t merely a reference. It’s the path the PR would take. - Configuration or permission file changes —
.env, secrets declarations, RBAC modifications. - Audit-critical structures — audit logs, verification mechanisms, compliance tracking.
Important detail: naming the file doesn’t block the issue. If you write “don’t modify .github/workflows”, that’s context, not blockage. What blocks is triage concluding the implementation will modify that file. This is the nuance regex never captures — and why Gemini endorses the decision.
Example: “Automate staging deploy” may or may not be blocked. If the solution is building a new workflow in .github/workflows, it’s blocked. If it’s adding a new job to an existing workflow still under security review, also blocked. If it’s configuring a trigger on an already-approved workflow, can become ready.
What the Grimoire represents for platform engineering
It’s tempting to see Incantations as just GitHub labels and commands. But what they really represent is something more ambitious: a preparation layer that makes the difference between an agent that gets it right and one that fails.
The system’s premise is simple but powerful: an autonomous agent is only as good as its context. By creating canonical nomenclature, separating state from intention in distinct flavors, documenting each state transition with precision, CERC created a deliberate control surface — a set of points where humans can iteratively improve the context Shift will consume.
Any engineer opening an issue and seeing shift:lbl:needs-context knows exactly what’s missing for Shift to execute well. Anyone seeing shift:lbl:ready knows the agent has what’s needed to produce a good PR. Nobody needs to ask “is this ready for Shift?” — the system answers with the labels.
That’s ultimately what distinguishes a mature agentic platform from a collection of well-intentioned scripts: traceability as a first-class citizen, control that scales without depending on tribal knowledge, and a shared grammar ensuring the agent always receives the best possible context.
What’s next
The catalog has two flavors today, and Incantations live entirely in the issues world. But the natural next step is already on the horizon: extending the system to pull requests.
The logic is the same — states that say what’s true, commands that express intention — just applied to the PR review cycle. A PR that passed automated review, that consolidated feedback from multiple reviewers, that already has context structured for Shift to re-execute a fix: that’s the goal.
The separation between lbl and cmd was designed to grow without rewriting the current contract. When PR commands arrive, they’ll fit the same grammar — and any engineer already using Incantations for issues will recognize the syntax immediately.
The Grimoire isn’t finished. But it’s founded. And foundation is what matters when you’re building systems that need to be trustworthy long-term.
If you want to understand how this platform was born and evolved operationally, the article SHIFT, five months later tells that story. And if you want to dive into how CERC thinks about leadership and autonomy in the context of agents, the series Leadership in the Age of Agents is the next step.
The repository is alive. The Grimoire is open.
This post was written by: André Tayer