PolicyPulse Development
БесплатноБез исполняемых скриптовНе проверенAI-powered synthetic population simulator with clean architecture, Python type safety, and professional dashboard design patterns
от FDU-INS★ 84 звезды на GitHubОб этом скилле
PolicyPulse Development
This skill guides AI agents in developing PolicyPulse, a professional analytical tool for stress-testing policies against synthetic populations using hybrid AI (LLM + Neural Network).
When to use
Activate this skill when:
- Building or modifying PolicyPulse application code
- Creating modular Python components following clean architecture
- Designing dashboard UI components for Streamlit
- Implementing type-safe Python code with proper annotations
- Writing tests for PolicyPulse functionality
Core Principles
1. Document-Driven Development
- Source of Truth: PRD.md, DESIGN_DOC.md, and TECH_STACK.md are authoritative
- No Feature Invention: Only implement features explicitly defined in documents
- Incremental Progress: Small, safe steps that keep the project runnable
- No Summary Documents: Don't create documentation unless explicitly requested
2. Clean Architecture (Modular Monolith)
Follow the defined module structure:
app.py # Entry point, session management
ui_sections.py # UI component rendering
simulation.py # Simulation orchestration
llm_client.py # Gemini API wrapper
nn_model.py # Neural network training/inference
population.py # Synthetic citizen generation
stats.py # Aggregation and statistics
data_models.py # Dataclass definitions
utils.py # Helper functions
config.py # Environment loading
ml_data.py # Training dataset management
Module Dependency Rules:
data_models.pyhas no dependencies (stdlib only)config.pyis imported by app.py only- UI layers depend on business logic, not vice versa
- External dependencies (genai, sklearn) isolated in specific modules
3. Python Type Safety
- Always use type hints: Function signatures, variables, return types
- Leverage Python 3.10+ features:
- Dataclasses for data models
- Union types with
|syntax (e.g.,str | None) - Type aliases for complex types
- Example Pattern:
from dataclasses import dataclass
from typing import Literal
@dataclass
class Citizen:
id: int
age: int
income_level: Literal["Low", "Middle", "High"]
happiness: float
def calculate_average(citizens: list[Citizen]) -> float:
return sum(c.happiness for c in citizens) / len(citizens)
4. Professional Dashboard Design
- Data Density without Overwhelm: Show comprehensive info in digestible chunks
- Progressive Disclosure: Start simple, reveal complexity on demand
- Sidebar + Main Content: Sidebar for config (300-320px fixed), main area for results
- Muted Professional Palette:
- Primary: Deep Purple (#667EEA)
- Semantic: Teal (positive), Coral (negative)
- Neutrals: Charcoal text, Pearl backgrounds
- Tabbed Analysis: Overview, Demographics, Individuals, Experts, AI Insights, Compare
- Metric Cards: Large bold values, small change indicators with colored arrows
- Responsible AI: Prominent disclaimer that this is synthetic simulation, not prediction
5. Streamlit-Specific Patterns
- Session State: Use
st.session_statefor simulation results, populations, models - File Persistence: Save models to
models/, training data todata/as CSV/Joblib - Component Organization: Separate UI rendering from business logic
- Layout Structure:
# Sidebar config
with st.sidebar:
# Population, steps, mode, policy config
pass
# Main content with tabs
tab1, tab2, tab3 = st.tabs(["Overview", "Demographics", "Individuals"])
with tab1:
# Metrics cards, time-series charts
pass
Implementation Guidelines
Data Models First
- Define dataclasses in
data_models.pywith full type annotations - Include docstrings explaining purpose and constraints
- Use
frozen=Truefor immutable data
Business Logic Isolation
- Keep simulation logic in
simulation.py,population.py,nn_model.py - No Streamlit imports in business logic modules
- Return structured data (dataclasses, DataFrames), not UI components
UI Components
- UI rendering functions in
ui_sections.py - Accept typed data structures as parameters
- Use Plotly for charts (
st.plotly_chart(fig, use_container_width=True)) - Follow design system: spacing (8px base), typography (Inter font), colors
Error Handling
- Graceful degradation: LLM → NN → Rule-based fallback
- User-friendly error messages in UI
- Log technical details for debugging
- Never crash the app; show error state and recovery options
Testing Patterns
- Unit tests for business logic (population generation, stats calculations)
- Integration tests for simulation workflow
- Mock external dependencies (Gemini API)
- Validate type contracts with pytest
File Organization
policypulse/
├── .streamlit/
│ └── config.toml # Streamlit configuration
├── data/
│ └── llm_training_samples.csv # Persistent training data
├── mode
Установить PolicyPulse Development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл PolicyPulse Development?
AI-powered synthetic population simulator with clean architecture, Python type safety, and professional dashboard design patterns
Как установить скилл PolicyPulse Development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл PolicyPulse Development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic