from pydantic import BaseModel, HttpUrl
from typing import List, Optional, Dict
# Import previously defined components
# For brevity, they are assumed to exist in the same module
# e.g., ProductIdentity, PurposePositioning, TechStack, UserPersonaContext, etc.
class ProjectContext(BaseModel):
product_identity: ProductIdentity
purpose_positioning: PurposePositioning
tech_stack: TechStack
user_persona_context: UserPersonaContext
feature_scope: FeatureScope
strategic_positioning: StrategicPositioning
connected_systems: ConnectedSystems
team_culture: TeamCulture
documentation: Documentation
related_products: RelatedProducts
meta_context: MetaContext
# -------------------------------
# Example Master JSON Template
# -------------------------------
project_context_template = {
"product_identity": product_identity_template,
"purpose_positioning": purpose_positioning_template,
"tech_stack": tech_stack_template,
"user_persona_context": persona_context_template,
"feature_scope": feature_scope_template,
"strategic_positioning": strategic_positioning_template,
"connected_systems": connected_systems_template,
"team_culture": team_culture_template,
"documentation": documentation_template,
"related_products": related_products_template,
"meta_context": meta_context_template
}
# 1. Product Identity
from pydantic import BaseModel, HttpUrl, Field
from typing import List, Optional
class ProductIdentity(BaseModel):
name: str
tagline: Optional[str]
primary_color: str
secondary_color: Optional[str]
accent_colors: Optional[List[str]]
logo_style: Optional[str]
brand_tone: Optional[str]
# Skeleton JSON
product_identity_template = {
"name": "projectx",
"tagline": "Adaptive context platform for creators",
"primary_color": "#5562EA",
"secondary_color": "#0E1116",
"accent_colors": ["#00E6A8", "#E7E9F0", "#FF6B6B"],
"logo_style": "minimal monoline typography",
"brand_tone": "sincere, action-first, founder-led"
}
# 2. Purpose & Positioning
class PurposePositioning(BaseModel):
core_pain_point: str
value_proposition: str
product_category: str
stage: str
launch_tier: Optional[str]
tagline_addition: Optional[str]
target_market: Optional[str]
# Skeleton JSON
purpose_positioning_template = {
"core_pain_point": "Tool fragmentation causes workflow overload",
"value_proposition": "Unifies context, tools, and insights in one platform",
"product_category": "adaptive workflow OS",
"stage": "mvp live",
"launch_tier": "alpha private circle",
"tagline_addition": "context-aware intelligence",
"target_market": "knowledge-driven creators"
}
# 3. Technical Stack
class TechStack(BaseModel):
stack: List[str]
architecture_principles: Optional[List[str]]
system_layers: Optional[dict] # e.g., {"identity": "...", "context": "..."}
core_modules: Optional[dict]
design_patterns: Optional[List[str]]
design_system: Optional[dict]
# Skeleton JSON
tech_stack_template = {
"stack": [
"MongoDB", "Next.js App Router", "TailwindCSS",
"Framer Motion", "shadcn/ui", "GSAP",
"FastAPI", "Python", "Node.js + Express", "Vercel", "Docker"
],
"architecture_principles": [
"modular components", "event-driven context", "separation of concerns",
"human-in-the-loop feedback", "testable state transitions"
],
"system_layers": {
"identity_layer": "user and persona management",
"integration_layer": "external tools bridging",
"context_layer": "session & activity tracking",
"intelligence_layer": "action recommendations & adaptive UX",
"interface_layer": "reactive frontend components",
"feedback_layer": "continuous learning loop"
},
"core_modules": {
"meta": "document origin, authorship, assignment",
"status_history": "life-cycle state tracking",
"collaboration": "multi-role document collaboration",
"connection": "pairwise interactor validation",
"competency": "skills and levels",
"milestone": "progress checkpoints",
"sniffers": {
"mongo": "extract static sample subset",
"notion": "bidirectional sync with mongo"
}
},
"design_patterns": [
"context-driven UI adaptation",
"component isolation",
"predictive simplification",
"responsive transitions"
],
"design_system": {
"typography": "modern sans-serif",
"grid": "8pt modular grid",
"motion": "physics-based transitions",
"interaction_model": "energy-aware UX"
}
}
# 4. User & Persona Context
class Persona(BaseModel):
name: str
core_motivation: str
pain_points: List[str]
goals: List[str]
class UserPersonaContext(BaseModel):
primary_personas: List[Persona]
persona_roles: Optional[List[str]]
# Skeleton JSON
persona_context_template = {
"primary_personas": [
{
"name": "indie founder",
"core_motivation": "build scalable systems without losing vision",
"pain_points": ["cognitive overload", "tool fragmentation", "context switching fatigue"],
"goals": ["reduce friction", "accelerate insights", "simplify stack"]
},
{
"name": "creative developer",
"core_motivation": "tools that think like me",
"pain_points": ["lost context", "repetitive tasks", "rigid tools"],
"goals": ["automation", "visualization", "insight-driven design"]
},
{
"name": "knowledge synthesizer",
"core_motivation": "connect ideas clearly",
"pain_points": ["data chaos", "version conflicts", "collaboration opacity"],
"goals": ["centralize insights", "maintain continuity", "clear sharing"]
}
],
"persona_roles": ["coworker", "developer", "mentor", "partner", "analyst", "reviewer", "creator", "strategist"]
}
# 5. Feature Scope & MVP Milestones
class Milestone(BaseModel):
name: str
goal: str
class FeatureScope(BaseModel):
mvp: List[str]
post_mvp: Optional[List[str]]
milestones: List[Milestone]
# Skeleton JSON
feature_scope_template = {
"mvp": [
"contextual document engine",
"adaptive persona switching",
"mongo ↔ notion sync",
"cli sniffers",
"meta system for assignment tracking",
"collaboration & connection models"
],
"post_mvp": [
"energy-aware UI adaptation",
"reflection engine for insights",
"adaptive privacy layer",
"timeline visualization",
"persona intelligence tuning"
],
"milestones": [
{"name": "system foundation", "goal": "stabilize core models and meta architecture"},
{"name": "context sniffers", "goal": "enable sync with manual triggers"},
{"name": "collaborator graph", "goal": "visualize relationships and roles"},
{"name": "adaptive interface", "goal": "persona-based UI loops"},
{"name": "reflection engine", "goal": "deliver user insight dashboards"}
]
}
# 6. Strategic Positioning
class StrategicPositioning(BaseModel):
key_differentiators: List[str]
target_persona: List[str]
adoption_strategy: str
distribution_channels: List[str]
target_market: Optional[str]
# Skeleton JSON
strategic_positioning_template = {
"key_differentiators": [
"context-first, not task-first",
"energy-aware UX",
"hybrid structured & narrative data",
"persona graph architecture",
"human-in-the-loop AI integration"
],
"target_persona": ["indie hackers", "creative technologists", "founders", "makers", "analysts"],
"adoption_strategy": "build in public with founder storytelling",
"distribution_channels": ["twitter/x", "producthunt", "youtube devlogs", "private alpha network"],
"target_market": "knowledge-driven creators"
}
# 7. Connected Systems
class Integration(BaseModel):
name: str
type: Optional[str]
description: Optional[str]
class SyncPolicy(BaseModel):
trigger_mode: str
data_sample: str
conflict_resolution: str
class ConnectedSystems(BaseModel):
integrations: List[Integration]
sync_policies: SyncPolicy
# Skeleton JSON
connected_systems_template = {
"integrations": [
{"name": "Notion"},
{"name": "MongoDB"},
{"name": "GitHub"},
{"name": "Google Workspace"},
{"name": "Slack", "type": "optional notifications"}
],
"sync_policies": {
"trigger_mode": "manual by default, optional scheduled",
"data_sample": "200-document static sample, extendable",
"conflict_resolution": "prefer PX edits unless field locked"
}
}
# 8. Team & Culture
class TeamCulture(BaseModel):
cultural_values: List[str]
creative_principles: List[str]
# Skeleton JSON
team_culture_template = {
"cultural_values": ["radical clarity", "systemic empathy", "flow over friction", "small details, big meaning"],
"creative_principles": ["show your workings", "code as narrative", "design with memory"]
}
# 9. Documentation & Visuals
class Documentation(BaseModel):
diagram_count: int
diagram_types: List[str]
purpose: Optional[str]
visual_package: Optional[dict]
# Skeleton JSON
documentation_template = {
"diagram_count": 18,
"diagram_types": ["flowchart", "sequence", "state", "timeline", "graph", "architecture"],
"purpose": "Explain system logic for devs and non-technical readers",
"visual_package": {
"format": "markdown + json hybrid",
"storage_path": "/visuals/",
"use_cases": ["blog posts", "onboarding docs", "investor deck inserts"]
}
}
# 10. Related Products
class RelatedProduct(BaseModel):
name: str
url: Optional[HttpUrl]
class RelatedProducts(BaseModel):
products: List[RelatedProduct]
# Skeleton JSON
related_products_template = {
"products": [
{"name": "pwplz", "url": "https://pwplz.com"},
{"name": "sniffer", "url": "https://github.com/vo1t/sniffer"},
{"name": "context-graph-lab", "url": "internal-lab"}
]
}
# 11. Meta Context
class MetaContext(BaseModel):
version: str
schema: str
intended_use: str
author: str
integrity_check: Optional[str]
notes: Optional[str]
# Skeleton JSON
meta_context_template = {
"version": "2025.10.30",
"schema": "v2.7-modular",
"intended_use": "primary cross-agent context profile for system architecture, UX, and strategy generation",
"author": "V01T Collective",
"integrity_check": "sha256:V01T-UNIFIED-CONTEXT-HASH",
"notes": "Reflects full evolution of adaptive ecosystem model"
}