imMamdouhaboammar/anti-slop-engineering / skills/context-window-and-token-economics-architect
context-window-and-token-economics-architect
VerifiedReview LLM context selection, retrieval evidence, prompt cache boundaries, time to first token, and structured output contracts. Use for changes that affect what an LLM sees, reuses, or returns.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.7 KB |
| examples/paired-workflow.md | markdown | 1.4 KB |
| examples/refund_workflow.py | script | 1.8 KB |
examples/refund_workflow.py
View on GitHub# SPDX-License-Identifier: MIT
"""Small, deterministic example of retrieval with source-aware cache reuse."""
POLICIES = {
("tenant-a", "r1"): {"days": 30, "source": "refund-policy:r1"},
("tenant-a", "r2"): {"days": 14, "source": "refund-policy:r2"},
}
def render_context(source, *, include_full_policy):
passage = f"{source['source']}: Refund requests must arrive within {source['days']} days."
if include_full_policy:
return passage + (
" Receipts are emailed after purchase. Gifts require a proof of purchase."
" Support opens weekdays. Damaged products have a separate replacement policy."
)
return passage
def retrieve(tenant, revision, scope, schema, cache):
if scope != "refund:read":
return {"status": "no_evidence"}
key = (tenant, revision, scope, schema)
if key not in cache:
source = POLICIES.get((tenant, revision))
if source is None:
return {"status": "no_evidence"}
cache[key] = {"status": "ok", "days": source["days"], "source": source["source"]}
return cache[key]
def main():
import json
cache = {}
baseline = retrieve("tenant-a", "r1", "refund:read", "refund-v1", cache)
candidate = retrieve("tenant-a", "r2", "refund:read", "refund-v1", cache)
revoked = retrieve("tenant-a", "r2", "revoked", "refund-v1", cache)
source = POLICIES[("tenant-a", "r2")]
report = {
"before_revision": baseline,
"current_revision": candidate,
"after_revocation": revoked,
"full_context_units": len(render_context(source, include_full_policy=True).split()),
"narrow_context_units": len(render_context(source, include_full_policy=False).split()),
}
print(json.dumps(report, indent=2))
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |