xiaohongshu
xiaohongshu
contextvar-opportunity-finder
Detect explicit user_id parameters in functions to identify potential opportunities for using ambient context. This is an investigation tool that flags instances for human review, not a prescriptive analyzer.
Full skill instructions
An intelligent grep tool that finds all explicit user_id usage patterns in Python code. Reports findings with context for human review.
This is a detection-only skill - It finds and reports all instances of explicit user_id usage without making judgments about correctness.
Read every file completely, one at a time, and report findings for EACH file before moving to the next. No shortcuts, no grep tricks, no "I'll infer from patterns". Complete reads only!
What it does: Scans code, detects patterns, reports everything it finds.
What it doesn't do: Make recommendations, filter results, or determine what's "right" or "wrong".
Look for functions with user_id in their parameters:
def function_name(..., user_id: str, ...):
def function_name(..., user_id: Optional[str], ...):
def function_name(..., user_id=None, ...):
Look for functions extracting user_id from parameters:
def function_name(self, context: Dict[str, Any]):
user_id = context.get('user_id')
def function_name(self, event):
user_id = event.user_id
Look for code that sets context then passes user_id:
set_current_user_id(user_id)
result = some_function(user_id) # Passing after setting
Look for user_id passed through multiple function calls:
def handle_request(user_id):
result = process_data(user_id)
def process_data(user_id):
return validate_data(user_id)
def validate_data(user_id):
# Three layers deep
Constructor accepts optional user_id but methods still require it:
class Service:
def __init__(self, user_id: Optional[str] = None):
self.user_id = user_id or get_current_user_id()
def get_data(self, user_id: str): # Still requires parameter!
# Ignores self.user_id
Functions that exist only to extract user_id and pass it:
def store_api_key_for_current_user(service_name: str, api_key: str):
user_id = get_current_user_id()
service.store_credential(user_id, 'api_key', service_name, api_key)
Models/endpoints accepting user_id in request payloads:
class LogoutRequest(BaseModel):
user_id: str # Security risk!
When reporting each instance, note these surrounding context clues:
set_current_user_id() nearby?get_current_user_id() in the same class/file?## Explicit user_id Usage Report
**Found N instances across M files**
### path/to/file.py
Line X: def function_name(self, user_id: str, data: Dict):
Pattern: Direct user_id parameter
Context: Method in SomeClass, inherits from BaseClass
Line Y: user_id = event.user_id
Pattern: Extracting from object
Context: Inside handle_event() method
Line Z: self.some_service.process(user_id, ...)
Pattern: Threading through layers
Context: Calling another service with user_id
### path/to/another.py
Line A: def __init__(self, user_id: Optional[str] = None):
self.user_id = user_id or get_current_user_id()
Line B: def store_data(self, user_id: str, ...):
Pattern: Bad dual-mode pattern
Context: Constructor has dual-mode but methods require explicit
Line C: set_current_user_id(user_id)
result = service.method(user_id)
Pattern: Redundant context setting
Context: Sets ambient context then passes explicitly
### path/to/models.py
Line D: class SomeRequest(BaseModel):
user_id: str
Pattern: Request body user_id
Context: Pydantic model for API endpoint
... continues for all findings ...
The report simply shows:
This is purely an investigation tool that surfaces instances for human review.
user_id parametersuser_id is extracted from objects or dictsuser_id through multiple layersuser_iduser_id in request bodiesuser_id is still passed| Pattern | What to Look For | Example |
|---|---|---|
def fn(user_id: str) | Functions with explicit user_id parameter | Service methods, API handlers |
user_id = context.get('user_id') | Extracting from dicts/objects | Event handlers, context processing |
set_current_user_id(uid); fn(uid) | Setting context then passing explicitly | API endpoints, request handlers |
| Multiple layers passing user_id | Threading through call chains | API → Service → Repository |
user_id: Optional[str] = None | Optional parameters with fallback | Dual-mode constructors/methods |
class Request(user_id: str) | Request body models | Pydantic models for endpoints |
| Convenience wrappers | Functions that just extract and pass | *_for_current_user() helpers |
This is an intelligent grep tool for finding user_id usage patterns. It:
Think of it as "grep for user_id patterns" with better context awareness.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience