google-agents-cli-scaffold
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
building-with-kafka-strimzi
Use when building event-driven systems with Apache Kafka on Kubernetes. Triggers include EDA patterns, Kafka producers/consumers, Strimzi operator deployment, Schema Registry, transactions, exactly-once semantics. NOT for general messaging (use Dapr pub/sub for abstraction).
Full skill instructions
Production-ready event streaming on Kubernetes using Apache Kafka with Strimzi operator.
You are a Kafka and event-driven architecture expert with production Kubernetes experience. You understand:
| Concept | Description |
|---|---|
| Events | Immutable facts about past occurrences (e.g., "OrderCreated") |
| Commands | Requests to perform actions (e.g., "CreateOrder") |
| Eventual Consistency | Systems converge to consistent state over time |
| Event Sourcing | Capture state changes as event sequence |
| CQRS | Separate command and query processing |
┌─────────────────────────────────────────────────────────────┐
│ Kafka Cluster (KRaft Mode - No ZooKeeper) │
├─────────────────────────────────────────────────────────────┤
│ Controller Nodes (metadata via Raft) │
│ └─ __cluster_metadata topic │
├─────────────────────────────────────────────────────────────┤
│ Broker Nodes (message processing) │
│ └─ Topics → Partitions → Segments │
├─────────────────────────────────────────────────────────────┤
│ Producers → Topics ← Consumer Groups │
│ └─ Partition assignment, offset tracking │
└─────────────────────────────────────────────────────────────┘
| Component | Role |
|---|---|
| Cluster Operator | Manages Kafka cluster lifecycle |
| Entity Operator | Contains Topic + User operators |
| Topic Operator | Manages KafkaTopic CRs |
| User Operator | Manages KafkaUser CRs and credentials |
| Situation | Pattern | Why |
|---|---|---|
| Critical data | acks=all + idempotent producer | Durability over speed |
| High throughput | acks=1 + batching | Balance speed/safety |
| Atomic multi-topic writes | Transactions | All-or-nothing |
| Schema evolution | Avro + Schema Registry | Backward compatibility |
| Database sync | Debezium CDC + Outbox | Transactional integrity |
| Consumer scaling | Consumer groups | Parallel processing |
# Add Strimzi Helm repo
helm repo add strimzi https://strimzi.io/charts/
helm repo update
# Install operator
helm install strimzi-kafka-operator strimzi/strimzi-kafka-operator \
--namespace kafka --create-namespace
# kafka-cluster.yaml
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
name: dual-role
labels:
strimzi.io/cluster: task-events
spec:
replicas: 1
roles:
- controller
- broker
storage:
type: ephemeral # Use persistent-claim for production
---
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
name: task-events
annotations:
strimzi.io/node-pools: enabled
strimzi.io/kraft: enabled
spec:
kafka:
version: 3.8.0
listeners:
- name: plain
port: 9092
type: internal
tls: false
- name: tls
port: 9093
type: internal
tls: true
config:
offsets.topic.replication.factor: 1
transaction.state.log.replication.factor: 1
transaction.state.log.min.isr: 1
default.replication.factor: 1
min.insync.replicas: 1
entityOperator:
topicOperator: {}
userOperator: {}
kubectl apply -f kafka-cluster.yaml -n kafka
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
name: task-created
labels:
strimzi.io/cluster: task-events
spec:
partitions: 3
replicas: 1
config:
retention.ms: "604800000" # 7 days
cleanup.policy: delete
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaUser
metadata:
name: task-api
labels:
strimzi.io/cluster: task-events
spec:
authentication:
type: scram-sha-512
authorization:
type: simple
acls:
- resource:
type: topic
name: task-*
patternType: prefix
operations: [Read, Write, Describe]
from confluent_kafka import Producer
def delivery_report(err, msg):
"""Callback triggered by poll() or flush()"""
if err is not None:
print(f'Delivery failed: {err}')
else:
print(f'Delivered to {msg.topic()} [{msg.partition()}] @ {msg.offset()}')
producer = Producer({
'bootstrap.servers': 'task-events-kafka-bootstrap:9092',
'client.id': 'task-api',
'acks': 'all',
'enable.idempotence': True,
'retries': 5,
'delivery.timeout.ms': 30000
})
# Async produce (default)
producer.produce(
topic='task-created',
key='task-123',
value='{"id": "task-123", "title": "Buy groceries"}',
callback=delivery_report
)
# Service callbacks
producer.poll(0)
# Flush before shutdown
producer.flush()
producer = Producer({
'bootstrap.servers': 'localhost:9092',
'enable.idempotence': True, # Prevents duplicates on retry
'acks': 'all', # Wait for all replicas
'max.in.flight.requests.per.connection': 5, # Max for idempotence
'retries': 2147483647 # Retry indefinitely within timeout
})
from confluent_kafka import Consumer, KafkaError
consumer = Consumer({
'bootstrap.servers': 'task-events-kafka-bootstrap:9092',
'group.id': 'notification-service',
'auto.offset.reset': 'earliest',
'enable.auto.commit': False # Manual commit for at-least-once
})
consumer.subscribe(['task-created'])
try:
while True:
msg = consumer.poll(1.0)
if msg is None:
continue
if msg.error():
if msg.error().code() == KafkaError._PARTITION_EOF:
continue
raise Exception(msg.error())
# Process message
print(f'Received: {msg.value().decode()}')
# Commit after successful processing
consumer.commit(message=msg)
finally:
consumer.close()
def on_assign(consumer, partitions):
print(f'Assigned: {partitions}')
def on_revoke(consumer, partitions):
print(f'Revoking: {partitions}')
consumer.commit(asynchronous=False) # Commit before losing partitions
consumer.subscribe(
['task-created'],
on_assign=on_assign,
on_revoke=on_revoke
)
from confluent_kafka import Producer
from confluent_kafka.schema_registry import SchemaRegistryClient
from confluent_kafka.schema_registry.avro import AvroSerializer
from confluent_kafka.serialization import SerializationContext, MessageField
# Schema Registry client
sr_client = SchemaRegistryClient({'url': 'http://schema-registry:8081'})
# Avro schema
task_schema = """
{
"type": "record",
"name": "TaskCreated",
"namespace": "com.example.events",
"fields": [
{"name": "id", "type": "string"},
{"name": "title", "type": "string"},
{"name": "created_at", "type": "string"},
{"name": "priority", "type": ["null", "int"], "default": null}
]
}
"""
# Serializer
serializer = AvroSerializer(
schema_registry_client=sr_client,
schema_str=task_schema,
to_dict=lambda obj, ctx: obj.__dict__
)
# Produce
class TaskCreated:
def __init__(self, id, title, created_at, priority=None):
self.id = id
self.title = title
self.created_at = created_at
self.priority = priority
event = TaskCreated('task-123', 'Buy groceries', '2025-01-01T10:00:00Z', 1)
producer.produce(
topic='task-created',
key='task-123',
value=serializer(event, SerializationContext('task-created', MessageField.VALUE))
)
producer = Producer({
'bootstrap.servers': 'localhost:9092',
'transactional.id': 'task-processor-1',
'enable.idempotence': True
})
# Initialize transactions once
producer.init_transactions()
try:
producer.begin_transaction()
# Produce multiple messages atomically
producer.produce('orders', key='o1', value='order-1')
producer.produce('payments', key='p1', value='payment-1')
producer.produce('audit', key='a1', value='audit-log')
producer.commit_transaction()
except Exception as e:
producer.abort_transaction()
raise
consumer = Consumer({
'bootstrap.servers': 'localhost:9092',
'group.id': 'txn-consumer',
'isolation.level': 'read_committed', # Only read committed messages
'enable.auto.commit': False
})
from contextlib import asynccontextmanager
from fastapi import FastAPI
from confluent_kafka import Producer
import asyncio
producer = None
@asynccontextmanager
async def lifespan(app: FastAPI):
global producer
producer = Producer({'bootstrap.servers': 'kafka:9092'})
yield
producer.flush()
app = FastAPI(lifespan=lifespan)
@app.post("/tasks")
async def create_task(title: str):
task_id = str(uuid.uuid4())
event = {"id": task_id, "title": title}
producer.produce(
'task-created',
key=task_id,
value=json.dumps(event)
)
producer.poll(0)
return {"id": task_id}
import asyncio
from threading import Thread
def consume_loop():
consumer = Consumer({
'bootstrap.servers': 'kafka:9092',
'group.id': 'notification-service'
})
consumer.subscribe(['task-created'])
while True:
msg = consumer.poll(1.0)
if msg and not msg.error():
# Process message
pass
@asynccontextmanager
async def lifespan(app: FastAPI):
# Start consumer in background thread
consumer_thread = Thread(target=consume_loop, daemon=True)
consumer_thread.start()
yield
| Guarantee | Producer Config | Consumer Config | Risk |
|---|---|---|---|
| At-most-once | acks=0 | Auto-commit before process | Data loss |
| At-least-once | acks=all, retries | Commit after process | Duplicates |
| Exactly-once | Transactions + idempotence | isolation.level=read_committed | Complexity |
Domain: task
Events: task.created, task.updated, task.completed, task.deleted
Topics: task-events (single topic) or task-created, task-updated (per event)
{
"event_id": "uuid",
"event_type": "task.created",
"occurred_at": "ISO-8601",
"data": {
"task_id": "uuid",
"title": "string",
"owner_id": "uuid"
},
"metadata": {
"correlation_id": "uuid",
"causation_id": "uuid"
}
}
acks=0 for critical datamax.in.flight.requests > 5 with idempotenceconsumer.close() (causes rebalance delays)acks=all for important eventsKafkaError._PARTITION_EOF gracefullyretention.ms for event topics| Error | Cause | Fix |
|---|---|---|
NOT_ENOUGH_REPLICAS | ISR below min.insync.replicas | Check broker health |
COORDINATOR_NOT_AVAILABLE | Consumer group coordinator missing | Wait, retry |
REBALANCE_IN_PROGRESS | Consumer group rebalancing | Wait for completion |
OFFSET_OUT_OF_RANGE | Requested offset doesn't exist | Check auto.offset.reset |
UNKNOWN_TOPIC_OR_PARTITION | Topic doesn't exist | Create topic first |
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.
Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.
Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.
Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.
Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.
Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".
Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.
Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Opus.ai: Revolutionize Your Web Experience
Build a no-code AI app in minutes.
An IDE for code migration from legacy to modern frameworks through coding agents.
Automate CGI animation in live-action scenes
Branded artistic QR-code concepts
Launch a website in seconds with AI.
Streamline Your Coding Experience with AI Code Helper
Convert any screenshot or design to clean code.