import type { CompetencyStack, Competency } from '@nextcraft/types'; let idCounter = 0; const cid = (prefix: string) => `${prefix}-c${(++idCounter).toString().padStart(3, '0')}`; function makeCompetency( stackId: string, name: string, description: string, status: Competency['status'], prerequisites: string[] = [], ): Competency { return { id: cid(stackId), name, description, status, stackId, prerequisites, microcredentialId: status === 'mastered' ? `mc-${cid(stackId)}` : null, }; } // --- Stack 1: AI Orchestration Engineer (15 competencies) --- const orchestrationComps: Competency[] = [ makeCompetency('stack-orchestration', 'Agent Architecture Patterns', 'ReAct, plan-and-execute, reflexion, and reflexion-based agent topologies.', 'mastered'), makeCompetency('stack-orchestration', 'Multi-Agent Communication', 'Message passing, shared memory blackboards, and inter-agent protocol design.', 'in_progress', ['stack-orchestration-c001']), makeCompetency('stack-orchestration', 'Tool Use & Function Calling', 'Defining tool schemas, binding tools to models, and handling structured outputs.', 'mastered'), makeCompetency('stack-orchestration', 'Prompt Engineering Fundamentals', 'Few-shot, chain-of-thought, and instruction tuning for reliable model behavior.', 'mastered'), makeCompetency('stack-orchestration', 'RAG Pipeline Design', 'Chunking strategies, hybrid retrieval, reranking, and context window management.', 'in_progress'), makeCompetency('stack-orchestration', 'Vector Databases & Embeddings', 'Embedding model selection, indexing (HNSW, IVF), and metadata filtering.', 'available', ['stack-orchestration-c005']), makeCompetency('stack-orchestration', 'LLM Evaluation & Metrics', 'LLM-as-judge, human eval panels, regression suites, and drift detection.', 'available'), makeCompetency('stack-orchestration', 'Guardrails & Output Validation', 'Schema validation, safety classifiers, and fallback response strategies.', 'available', ['stack-orchestration-c003']), makeCompetency('stack-orchestration', 'Agent Memory Systems', 'Short-term context, episodic memory, and long-term knowledge consolidation.', 'locked', ['stack-orchestration-c002', 'stack-orchestration-c006']), makeCompetency('stack-orchestration', 'Workflow Orchestration', 'DAG-based pipelines, conditional branching, and human-in-the-loop checkpoints.', 'locked', ['stack-orchestration-c001']), makeCompetency('stack-orchestration', 'Model Routing & Cascading', 'Cost-aware routing, small-to-large cascades, and fallback model strategies.', 'locked', ['stack-orchestration-c008']), makeCompetency('stack-orchestration', 'Streaming & Incremental Output', 'Token streaming, partial JSON parsing, and progressive UI rendering.', 'available'), makeCompetency('stack-orchestration', 'Observability for Agents', 'Tracing spans, token cost tracking, and latency profiling across agent calls.', 'available'), makeCompetency('stack-orchestration', 'Cost Optimization Strategies', 'Caching, prompt compression, and batch inference for production cost control.', 'locked', ['stack-orchestration-c011']), makeCompetency('stack-orchestration', 'Production Deployment Patterns', 'Blue-green deploys, shadow traffic, and rollback for agent workloads.', 'locked', ['stack-orchestration-c010']), ]; // --- Stack 2: AI Safety & Governance Lead (14 competencies) --- const safetyComps: Competency[] = [ makeCompetency('stack-safety', 'Alignment Fundamentals', 'RLHF, DPO, and constitutional AI approaches to value alignment.', 'in_progress'), makeCompetency('stack-safety', 'Red Teaming Methodologies', 'Adversarial prompting, automated red-team suites, and vulnerability disclosure.', 'available'), makeCompetency('stack-safety', 'Model Card Authoring', 'Documenting capabilities, limitations, intended use, and known failure modes.', 'mastered'), makeCompetency('stack-safety', 'Bias Auditing', 'Disparate impact testing across demographics and protected attributes.', 'in_progress', ['stack-safety-c003']), makeCompetency('stack-safety', 'AI Policy Frameworks', 'NIST AI RMF, EU AI Act, and ISO/IEC 42001 compliance mapping.', 'available'), makeCompetency('stack-safety', 'Risk Taxonomy & Classification', 'Harm severity scales, likelihood scoring, and risk register maintenance.', 'available', ['stack-safety-c005']), makeCompetency('stack-safety', 'Interpretability Techniques', 'Attention probing, activation patching, and circuit analysis.', 'locked', ['stack-safety-c001']), makeCompetency('stack-safety', 'Incident Response for AI', 'Detection, containment, root-cause analysis, and postmortem for AI failures.', 'locked', ['stack-safety-c006']), makeCompetency('stack-safety', 'Data Provenance & Lineage', 'Training data tracking, consent management, and deletion workflows.', 'available'), makeCompetency('stack-safety', 'Jailbreak & Prompt Injection Defense', 'Input sanitization, instruction hierarchy, and indirect injection mitigation.', 'available', ['stack-safety-c002']), makeCompetency('stack-safety', 'Model Monitoring in Production', 'Drift detection, output distribution tracking, and alerting thresholds.', 'locked', ['stack-safety-c008']), makeCompetency('stack-safety', 'Privacy-Preserving ML', 'Differential privacy, federated learning, and synthetic data generation.', 'locked', ['stack-safety-c009']), makeCompetency('stack-safety', 'Governance Documentation', 'Audit trails, decision logs, and accountability matrices for AI systems.', 'available'), makeCompetency('stack-safety', 'Stakeholder Communication', 'Translating technical risk findings for executives, regulators, and users.', 'available', ['stack-safety-c013']), ]; // --- Stack 3: Human-AI Product Designer (13 competencies) --- const designerComps: Competency[] = [ makeCompetency('stack-designer', 'Agentic Interaction Patterns', 'Designing for delegating, interrupting, and reviewing autonomous agents.', 'in_progress'), makeCompetency('stack-designer', 'Conversational UX', 'Multi-turn dialogue design, intent modeling, and repair flows.', 'mastered'), makeCompetency('stack-designer', 'AI Transparency Patterns', 'Confidence indicators, source attribution, and model limitation disclosure.', 'in_progress', ['stack-designer-c002']), makeCompetency('stack-designer', 'Human-in-the-Loop Design', 'Approval gates, escalation paths, and override affordances.', 'available', ['stack-designer-c001']), makeCompetency('stack-designer', 'Prompt UX', 'Designing prompt composition surfaces, suggestions, and templates.', 'available'), makeCompetency('stack-designer', 'Failure & Fallback Design', 'Graceful degradation, error states, and recovery flows for AI features.', 'available', ['stack-designer-c003']), makeCompetency('stack-designer', 'Multimodal Interface Design', 'Voice + touch + visual coordination across modalities.', 'locked', ['stack-designer-c002']), makeCompetency('stack-designer', 'Trust & Calibration', 'User mental model alignment, expectation setting, and over-trust mitigation.', 'available', ['stack-designer-c003']), makeCompetency('stack-designer', 'Accessibility for AI Interfaces', 'Screen-reader-friendly AI output, cognitive load, and reading-level tuning.', 'available'), makeCompetency('stack-designer', 'Persona & Tone Systems', 'Character design for AI assistants, consistency, and contextual adaptation.', 'available', ['stack-designer-c005']), makeCompetency('stack-designer', 'Evaluation of AI UX', 'Task success, satisfaction, and reliance metrics for AI-assisted workflows.', 'locked', ['stack-designer-c008']), makeCompetency('stack-designer', 'Onboarding to Agentic Systems', 'Progressive disclosure, first-run experience, and capability scaffolding.', 'available', ['stack-designer-c004']), makeCompetency('stack-designer', 'AI Ethics in Product Design', 'Consent, dark-pattern avoidance, and dignity-preserving automation.', 'available', ['stack-designer-c009']), ]; // --- Stack 4: AI-Augmented Field Operator (12 competencies) --- const operatorComps: Competency[] = [ makeCompetency('stack-operator', 'AI Co-Pilot Operation', 'Interacting with voice and tablet-based AI assistants in field conditions.', 'in_progress'), makeCompetency('stack-operator', 'Robotics Safety Protocols', 'Lockout/tagout, collision avoidance, and emergency stop procedures.', 'mastered'), makeCompetency('stack-operator', 'Predictive Maintenance Alerts', 'Interpreting ML-based anomaly scores and scheduling interventions.', 'available', ['stack-operator-c002']), makeCompetency('stack-operator', 'Computer Vision Inspection', 'Operating vision-based quality control stations and tuning thresholds.', 'available'), makeCompetency('stack-operator', 'Sensor Data Interpretation', 'Reading IoT telemetry dashboards and recognizing fault signatures.', 'in_progress', ['stack-operator-c003']), makeCompetency('stack-operator', 'Digital Twin Fundamentals', 'Navigating virtual replicas of physical assets for simulation and planning.', 'locked', ['stack-operator-c005']), makeCompetency('stack-operator', 'Augmented Reality Overlays', 'Using AR headsets for guided assembly, annotation, and remote assistance.', 'available'), makeCompetency('stack-operator', 'Edge Model Deployment', 'Pushing model updates to on-device inference hardware in the field.', 'locked', ['stack-operator-c006']), makeCompetency('stack-operator', 'Calibration & Drift Correction', 'Maintaining sensor accuracy and recognizing model drift in production.', 'available', ['stack-operator-c004']), makeCompetency('stack-operator', 'Field Data Collection', 'Structured annotation, labeling workflows, and high-quality dataset capture.', 'available'), makeCompetency('stack-operator', 'Autonomous System Supervision', 'Monitoring fleets of semi-autonomous units and intervening on exceptions.', 'locked', ['stack-operator-c001']), makeCompetency('stack-operator', 'Safety-Critical Decision Making', 'Knowing when to override AI recommendations and escalate to humans.', 'available', ['stack-operator-c002']), ]; // --- Stack 5: Computational Sciences Practitioner (16 competencies) --- const scienceComps: Competency[] = [ makeCompetency('stack-science', 'Scientific Computing with Python', 'NumPy, SciPy, pandas, and Jupyter workflows for research-grade analysis.', 'mastered'), makeCompetency('stack-science', 'ML for Scientific Discovery', 'Surrogate models, property prediction, and active learning loops.', 'in_progress', ['stack-science-c001']), makeCompetency('stack-science', 'Molecular & Materials Simulation', 'DFT, molecular dynamics, and ML potentials for materials screening.', 'available'), makeCompetency('stack-science', 'Climate Modeling Fundamentals', 'GCM structure, downscaling, and emissions scenario interpretation.', 'available'), makeCompetency('stack-science', 'Bioinformatics Pipelines', 'Sequence alignment, variant calling, and differential expression analysis.', 'in_progress'), makeCompetency('stack-science', 'High-Performance Computing', 'MPI, OpenMP, GPU offloading, and job scheduling on HPC clusters.', 'available', ['stack-science-c001']), makeCompetency('stack-science', 'Scientific Data Visualization', 'Matplotlib, Plotly, ParaView, and domain-specific plotting conventions.', 'mastered'), makeCompetency('stack-science', 'Reproducible Research Practices', 'Containerization, workflow managers (Snakemake, Nextflow), and DOIs.', 'available', ['stack-science-c006']), makeCompetency('stack-science', 'Statistical Inference', 'Bayesian methods, hypothesis testing, and uncertainty quantification.', 'available'), makeCompetency('stack-science', 'Physics-Informed Neural Networks', 'Embedding governing equations as constraints in ML models.', 'locked', ['stack-science-c002']), makeCompetency('stack-science', 'Generative Models for Science', 'Diffusion models for molecule generation and protein structure sampling.', 'locked', ['stack-science-c010']), makeCompetency('stack-science', 'Causal Inference Methods', 'Do-calculus, instrumental variables, and counterfactual reasoning.', 'available', ['stack-science-c009']), makeCompetency('stack-science', 'Experiment Design', 'DOE, factorial designs, and sample-size planning for costly experiments.', 'available'), makeCompetency('stack-science', 'Data Assimilation', 'EnKF, 4D-Var, and real-time integration of observations into models.', 'locked', ['stack-science-c004']), makeCompetency('stack-science', 'Scientific Writing with AI', 'Literature review automation, manuscript drafting assistance, and citation tools.', 'available'), makeCompetency('stack-science', 'Open Science & FAIR Data', 'Findable, accessible, interoperable, reusable data stewardship.', 'available', ['stack-science-c008']), ]; export const competencyStacks: CompetencyStack[] = [ { id: 'stack-orchestration', name: 'AI Orchestration Engineer', targetRoles: 'Agent design, multi-agent systems, AI workflow automation', description: 'Design and operate systems of cooperating AI agents. Master tool use, retrieval, memory, evaluation, and production deployment of agentic workflows.', competencies: orchestrationComps, color: 'indigo', icon: 'Workflow', }, { id: 'stack-safety', name: 'AI Safety & Governance Lead', targetRoles: 'Alignment, audit, policy, risk', description: 'Ensure AI systems are aligned, auditable, and compliant. Lead red-teaming, bias audits, incident response, and governance documentation.', competencies: safetyComps, color: 'rose', icon: 'ShieldCheck', }, { id: 'stack-designer', name: 'Human-AI Product Designer', targetRoles: 'UX for agentic systems, AI interaction design', description: 'Design interfaces where humans and AI agents collaborate. Master transparency, trust calibration, failure design, and agentic interaction patterns.', competencies: designerComps, color: 'violet', icon: 'Sparkles', }, { id: 'stack-operator', name: 'AI-Augmented Field Operator', targetRoles: 'Skilled trades + AI co-pilots, robotics operations', description: 'Operate AI-augmented equipment in the field. Pair skilled trades with AI co-pilots, robotics supervision, predictive maintenance, and AR-guided workflows.', competencies: operatorComps, color: 'emerald', icon: 'Wrench', }, { id: 'stack-science', name: 'Computational Sciences Practitioner', targetRoles: 'Bio, materials, climate + AI', description: 'Apply ML to scientific discovery in biology, materials, and climate. Master scientific computing, simulation, PINNs, and reproducible research.', competencies: scienceComps, color: 'cyan', icon: 'Atom', }, ]; export const allCompetencies: Competency[] = competencyStacks.flatMap((s) => s.competencies);