prompt-versioning
Skill0 starsChanged 6 months agoMITView on GitHub
Manages multiple named prompt versions with A/B routing by user-id hash. Use when running controlled prompt experiments, when rolling out a revised system prompt to a percentage of users, or when you need reproducible rollback to a prior prompt version.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- enriquerodrig/regulaitortheir own version, first seen Jul 7, 2026
- RBraga01/builder-aitheir own version, first seen Jun 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- RBraga01/builder-ai★ 2same name
- enriquerodrig/regulaitor★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/building-agents/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- adding-guardrailsSkill
- agent-health-timeoutSkill
- agent-permission-scopingSkill
- agent-session-isolationSkill
- agent-step-loggingSkill
- agent-supervisor-routerSkill
- agent-telemetrySkill
- async-agent-backgroundSkill
- building-agentsSkill
- building-teamsSkill
- building-toolsSkill
- calendar-scheduling-toolSkill
- callback-tracing-handlerSkill
- chain-of-thought-promptingSkill
- chat-model-configurationSkill
- code-execution-sandboxSkill
- common-agent-patternsSkill
- context-window-managementSkill
- conversation-memorySkill
- conversation-state-dbSkill
- database-query-toolSkill
- document-loadersSkill
- document-rerankingSkill
- email-notification-toolSkill
- embedding-model-ingestionSkill
- fallback-model-chainSkill
- few-shot-injectionSkill
- filesystem-toolSkill
- human-in-the-loopSkill
- hybrid-searchSkill
- inspecting-streamsSkill
- integrating-with-laurenSkill
- json-schema-enforcementSkill
- llm-provider-connectionSkill
- llm-rate-limitingSkill
- long-term-vector-memorySkill
- managing-memorySkill
- migrating-to-lauren-aiSkill
- multi-agent-delegationSkill
- multi-tool-orchestrationSkill
- multi-turn-tool-stateSkill
- output-guardrailsSkill
- plan-and-execute-agentSkill
- prompt-injection-defenseSkill
- rag-pipelineSkill
- react-agent-loopSkill
- response-validation-retrySkill
- rest-api-toolSkill
- securing-agentsSkill
- semantic-cacheSkill
- streaming-response-handlerSkill
- structured-output-parsingSkill
- sub-agent-spawningSkill
- system-prompt-templatingSkill
- testing-agentsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 146
Do not use MD5 for security-sensitive bucketing.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Use
codemap find "SymbolName"to locate any symbol before reading.
Prompt Versioning & A/B Testing
Pattern
# NOTE: future annotations are allowed, but tool signature types must resolve at import time.
import hashlib
from dataclasses import dataclass, field
@dataclass
class PromptVersion:
version: str
system_prompt: str
description: str = ""
class PromptVersionRegistry:
def __init__(self):
self._versions: dict[str, PromptVersion] = {}
self._default: str | None = None
def register(self, version: PromptVersion, default: bool = False) -> None:
self._versions[version.version] = version
if default or not self._default:
self._default = version.version
def get(self, version: str) -> PromptVersion:
if version not in self._versions:
raise KeyError(f"Prompt version '{version}' not found")
return self._versions[version]
def get_default(self) -> PromptVersion:
if self._default is None:
raise RuntimeError("No versions registered")
return self._versions[self._default]
def ab_select(
self,
user_id: str,
variants: list[str],
weights: list[float] | None = None,
) -> str:
"""Deterministically select a variant for user_id based on an MD5 bucket.
The same user_id always maps to the same variant as long as the
variants list and weights do not change.
"""
if weights is None:
weights = [1.0 / len(variants)] * len(variants)
bucket = int(hashlib.md5(user_id.encode()).hexdigest(), 16) % 100
cumulative = 0.0
for variant, weight in zip(variants, weights):
cumulative += weight * 100
if bucket < cumulative:
return variant
return variants[-1]Full example
registry = PromptVersionRegistry()
registry.register(
PromptVersion(
version="v1",
system_prompt="You are a helpful assistant.",
description="Baseline prompt",
),
default=True,
)
registry.register(
PromptVersion(
version="v2",
system_prompt="You are a concise, helpful assistant. Prefer bullet points.",
description="Concise variant",
),
)
# Route a user to one of the two variants (50/50 split)
def get_system_for_user(user_id: str) -> str:
version_name = registry.ab_select(user_id, ["v1", "v2"])
return registry.get(version_name).system_promptUsing the selected prompt in an agent
from lauren_ai import agent, AgentRunnerBase, LLMConfig
def make_agent_for_user(user_id: str):
system = get_system_for_user(user_id)
@agent(model="claude-haiku-4-5", system=system)
class UserAgent: ...
return UserAgentWeighted A/B split
# 80% control (v1), 20% experimental (v2)
version_name = registry.ab_select(
user_id,
variants=["v1", "v2"],
weights=[0.8, 0.2],
)Tracking which version was used
from dataclasses import dataclass
@dataclass
class VersionedResponse:
content: str
version_used: str
user_id: str
async def run_versioned(user_id: str, message: str, runner) -> VersionedResponse:
version_name = registry.ab_select(user_id, ["v1", "v2"])
version = registry.get(version_name)
# Create agent dynamically or cache by version name
result = await runner.run(agent_for_version(version), message)
return VersionedResponse(
content=result.content,
version_used=version_name,
user_id=user_id,
)Pitfalls
- The MD5 bucket is stable as long as you do not change the
variantslist order or the weights. Adding a new variant re-buckets some users — plan accordingly. - Do not use MD5 for security-sensitive bucketing; it is fine for load distribution but is not cryptographically random.
- Store
version_usedalongside model responses in your database so you can segment analytics by prompt version.
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
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.

