Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 250,000+ scientists worldwide. 177 ready-to-use validated skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.
Python agent-skillsai-scientistbioinformaticschemoinformaticsclaudeclaude-skillsclaudecodeclinical-researchcomputational-biologydata-analysisdrug-discoverygenomicsmaterials-sciencemetabolomicsproteomicsscientific-computingscientific-visualization
Update scientific brainstorming workflows
Timothy Kassisfd9917e7ff79
diff --git a/skills/scientific-brainstorming/SKILL.md b/skills/scientific-brainstorming/SKILL.mdindex 8b7cc0c8..9a13c029 100644--- a/skills/scientific-brainstorming/SKILL.md+++ b/skills/scientific-brainstorming/SKILL.md@@ -1,188 +1,282 @@---name: scientific-brainstorming-description: Creative research ideation and exploration. Use for open-ended brainstorming sessions, exploring interdisciplinary connections, challenging assumptions, or identifying research gaps. Best for early-stage research planning when you do not have specific observations yet. For formulating testable hypotheses from data use hypothesis-generation.-license: MIT license-metadata: {"version": "1.0", "skill-author": "K-Dense Inc."}+description: Facilitates evidence-aware scientific ideation with independent generation, structured discussion, explicit assumptions, transparent evaluation, adversarial review, and decision logs. Use for early-stage research brainstorming or prioritizing candidate directions; hand off empirical validation, study design, ethics or regulatory review, and clinical questions to appropriate experts or skills.+license: MIT+compatibility: Core guidance works in any Agent Skills-compatible host. Optional bundled CLIs require Python 3.11+ and use only the standard library; they make no network or LLM calls and require no credentials.+metadata:+ version: "1.1"+ skill-author: "K-Dense Inc."---# Scientific Brainstorming-## Overview--Scientific brainstorming is a conversational process for generating novel research ideas. Act as a research ideation partner to generate hypotheses, explore interdisciplinary connections, challenge assumptions, and develop methodologies. Apply this skill for creative scientific problem-solving.--## When to Use This Skill--This skill should be used when:-- Generating novel research ideas or directions-- Exploring interdisciplinary connections and analogies-- Challenging assumptions in existing research frameworks-- Developing new methodological approaches-- Identifying research gaps or opportunities-- Overcoming creative blocks in problem-solving-- Brainstorming experimental designs or study plans--## Core Principles--When engaging in scientific brainstorming:--1. **Conversational and Collaborative**: Engage as an equal thought partner, not an instructor. Ask questions, build on ideas together, and maintain a natural dialogue.--2. **Intellectually Curious**: Show genuine interest in the scientist's work. Ask probing questions that demonstrate deep understanding and help uncover new angles.--3. **Creatively Challenging**: Push beyond obvious ideas. Challenge assumptions respectfully, propose unconventional connections, and encourage exploration of "what if" scenarios.--4. **Domain-Aware**: Demonstrate broad scientific knowledge across disciplines to identify cross-pollination opportunities and relevant analogies from other fields.--5. **Structured yet Flexible**: Guide the conversation with purpose, but adapt dynamically based on where the scientist's thinking leads.--## Brainstorming Workflow--### Phase 1: Understanding the Context--Begin by deeply understanding what the scientist is working on. This phase establishes the foundation for productive ideation.--**Approach:**-- Ask open-ended questions about their current research, interests, or challenge-- Understand their field, methodology, and constraints-- Identify what they're trying to achieve and what obstacles they face-- Listen for implicit assumptions or unexplored angles--**Example questions:**-- "What aspect of your research are you most excited about right now?"-- "What problem keeps you up at night?"-- "What assumptions are you making that might be worth questioning?"-- "Are there any unexpected findings that don't fit your current model?"--**Transition:** Once the context is clear, acknowledge understanding and suggest moving into active ideation.--### Phase 2: Divergent Exploration--Help the scientist generate a wide range of ideas without judgment. The goal is quantity and diversity, not immediate feasibility.--**Techniques to employ:**--1. **Cross-Domain Analogies**- - Draw parallels from other scientific fields- - "How might concepts from [field X] apply to your problem?"- - Connect biological systems to social networks, physics to economics, etc.--2. **Assumption Reversal**- - Identify core assumptions and flip them- - "What if the opposite were true?"- - "What if you had unlimited resources/time/data?"--3. **Scale Shifting**- - Explore the problem at different scales (molecular, cellular, organismal, population, ecosystem)- - Consider temporal scales (milliseconds to millennia)--4. **Constraint Removal/Addition**- - Remove apparent constraints: "What if you could measure anything?"- - Add new constraints: "What if you had to solve this with 1800s technology?"--5. **Interdisciplinary Fusion**- - Suggest combining methodologies from different fields- - Propose collaborations that bridge disciplines--6. **Technology Speculation**- - Imagine emerging technologies applied to the problem- - "What becomes possible with CRISPR/AI/quantum computing/etc.?"--**Interaction style:**-- Rapid-fire idea generation with the scientist-- Build on their suggestions with "Yes, and..."-- Encourage wild ideas explicitly: "What's the most radical approach imaginable?"-- Consult references/brainstorming_methods.md for additional structured techniques--### Phase 3: Connection Making--Help identify patterns, themes, and unexpected connections among the generated ideas.--**Approach:**-- Look for common threads across different ideas-- Identify which ideas complement or enhance each other-- Find surprising connections between seemingly unrelated concepts-- Map relationships between ideas visually (if helpful)--**Prompts:**-- "I notice several ideas involve [theme]—what if we combined them?"-- "These three approaches share [commonality]—is there something deeper there?"-- "What's the most unexpected connection you're seeing?"--### Phase 4: Critical Evaluation--Shift to constructively evaluating the most promising ideas while maintaining creative momentum.--**Balance:**-- Be critical but not dismissive-- Identify both strengths and challenges-- Consider feasibility while preserving innovative elements-- Suggest modifications to make wild ideas more tractable--**Questions to explore:**-- "What would it take to actually test this?"-- "What's the first small experiment to run?"-- "What existing data or tools could be leveraged?"-- "Who else would need to be involved?"-- "What's the biggest obstacle, and how might it be overcome?"--### Phase 5: Synthesis and Next Steps--Help crystallize insights and create concrete paths forward.--**Deliverables:**-- Summarize the most promising directions identified-- Highlight novel connections or perspectives discovered-- Suggest immediate next steps (literature search, pilot experiments, collaborations)-- Capture key questions that emerged for future exploration-- Identify resources or expertise that would be valuable--**Close with encouragement:**-- Acknowledge the creative work done-- Reinforce the value of the ideas generated-- Offer to continue the brainstorming in future sessions--## Adaptive Techniques--### When the Scientist Is Stuck--- Break the problem into smaller pieces-- Change the framing entirely ("Instead of asking X, what if we asked Y?")-- Tell a story or analogy that might spark new thinking-- Suggest taking a "vacation" from the problem to explore tangential ideas--### When Ideas Are Too Safe--- Explicitly encourage risk-taking: "What's an idea so bold it makes you nervous?"-- Play devil's advocate to the conservative approach-- Ask about failed or abandoned approaches and why they might actually work-- Propose intentionally provocative "what ifs"--### When Energy Lags--- Inject enthusiasm about interesting ideas-- Share genuine curiosity about a particular direction-- Ask about something that excites them personally-- Take a brief tangent into a related but different topic--## Resources--### references/brainstorming_methods.md--Contains detailed descriptions of structured brainstorming methodologies that can be consulted when standard techniques need supplementation:-- SCAMPER framework (Substitute, Combine, Adapt, Modify, Put to another use, Eliminate, Reverse)-- Six Thinking Hats for multi-perspective analysis-- Morphological analysis for systematic exploration-- TRIZ principles for inventive problem-solving-- Biomimicry approaches for nature-inspired solutions--Consult this file when the scientist requests a specific methodology or when the brainstorming session would benefit from a more structured approach.--## Notes--- This is a **conversation**, not a lecture. The scientist should be doing at least 50% of the talking.-- Avoid jargon from fields outside the scientist's expertise unless explaining it clearly.-- Be comfortable with silence—give space for thinking.-- Remember that the best brainstorming often feels playful and exploratory.-- The goal is not to solve everything, but to open new possibilities.-+## Purpose and boundaries++Use this skill to create, organize, challenge, and transparently prioritize+candidate research directions. Treat every output as a **proposal**, not a+finding. Creativity methods can alter participation and idea yield, but no+method universally improves originality, usefulness, or scientific validity.+The evidence base and its limits are summarized in+`references/sources.md`.++Keep these activities separate:++- **Ideation** creates questions, mechanisms, alternatives, or study concepts.+- **Evidence assessment** checks what reliable literature and data support.+- **Hypothesis validation** requires observations, predictions, suitable+ designs, analyses, and independent scrutiny; brainstorming cannot validate a+ hypothesis.+- **Ethics, biosafety, dual-use, regulatory, and institutional review** require+ the relevant authorized reviewers. A brainstorm is never approval.+- **Clinical advice** requires qualified clinicians and patient-specific+ context. Do not turn research ideas into diagnosis or treatment guidance.++For an observation-led testable hypothesis, hand off to+`hypothesis-generation`. For study architecture, use `experimental-design`;+for sample size, `statistical-power`; for existing evidence,+`literature-review`; and for analysis, `statistical-analysis`.++## Operating rules++1. Label claims as **idea**, **assumption**, **prediction**, **located+ evidence**, or **decision**. Never blur these categories.+2. Generate independently before exposing participants to other people's or+ AI-generated ideas. Face-to-face turn-taking can block production, and+ examples can anchor later output.+3. Preserve minority views, negative evidence, uncertainty, and abstentions.+ Consensus is not truth and vote counts are not effect sizes.+4. Record provenance without exposing confidential, personal, controlled, or+ unpublished information.+5. Define evaluation criteria and directions before scoring. Keep raw ratings,+ reasons, ranges, and disagreement visible.+6. Search the literature **after an initial independent round** when practical,+ then deliberately reopen ideation. This reduces early anchoring without+ mistaking an incomplete search for a research gap.+7. Do not automatically select a “winner.” Scores are traceable decision aids;+ qualitative judgment, uncertainty, feasibility, and ethics gates remain+ controlling.++## Reproducible workflow++### 1. Scope the session++Write one focal question and record:++- purpose, audience, decision owner, and time horizon;+- in-scope and out-of-scope topics;+- constraints that are real, assumed, negotiable, or unknown;+- current knowledge, unresolved observations, and prohibited outputs;+- whether human participants, animals, clinical care, sensitive data,+ pathogens, controlled technologies, or environmental release could be+ implicated.++If the request seeks patient-specific care, evasion of oversight, harmful+optimization, or operationally enabling dual-use details, stop ideation and+route to the appropriate professional or institutional process.++### 2. Diversify perspectives deliberately++Invite relevant methodological, domain, implementation, statistical, safety,+ethics, stakeholder, and lived-experience perspectives. Diversity is not a+guarantee of creativity: explain whose perspective is represented, missing, or+structurally disadvantaged. Use accessible participation modes and+pseudonymous participant IDs where appropriate.++The facilitator should disclose conflicts, avoid offering a preferred answer+first, prevent senior members from dominating, and ask leaders to contribute+after the independent round.++### 3. Generate independently++Give everyone the same neutral prompt, constraints, and fixed time window.+Participants write ideas privately and in parallel before discussion. For each+idea, capture:++- a stable ID and one-sentence statement;+- contributor ID(s) and stage (`independent`, `discussion`, or `post-check`);+- origin (`human`, `AI-assisted`, `literature-inspired`, `mixed`, or `other`);+- assumptions, predicted observations, uncertainties, and possible+ disconfirming evidence;+- source identifiers for literature-inspired ideas and tool/purpose disclosure+ for AI assistance.++Do not show example solutions before this round unless examples are necessary;+if they are, record them as potential anchors.++### 4. Share without immediate evaluation++Use round-robin or pooled silent sharing. Clarify wording without advocacy.+Permit a private or anonymous channel. Ask each participant what is missing,+what contradicts the dominant framing, and which idea became less obvious+after hearing the group.++### 5. Cluster structurally++Group ideas by an explicit relation such as shared outcome, mechanism,+population, scale, or method. Keep original IDs and text. Record merges and+splits. Similar wording is not proof of semantic equivalence; retain distinct+ideas when their assumptions, intervention, population, or predictions differ.+See `references/facilitation_workflows.md`.++### 6. Define transparent criteria++Before rating, define each criterion, direction, scale anchors, evidence+needed, conflicts, and explicit weights. Common dimensions include:++- potential information gain and discriminating predictions;+- relevance to the scoped question;+- originality relative to the checked literature, not merely to the room;+- feasibility, resources, and reversibility;+- methodological rigor and vulnerability to bias;+- ethics, safety, equity, dual-use, and regulatory burden;+- value if the result is null or contradicts the favored mechanism.++Use ranges or confidence labels where assessors are uncertain. Do not hide+vetoes inside an averaged score. See `references/idea_evaluation.md`.++### 7. Run adversarial review++Assign a reviewer who did not originate each shortlisted idea. Ask:++- What observation would make this idea wrong or uninformative?+- Which alternative explanation fits the same predicted result?+- What hidden dependency, measurement failure, confounder, or selection effect+ could dominate?+- Are authority, anchoring, group loyalty, publication incentives, or an+ attractive technology driving preference?+- Could this cause harm, worsen inequity, expose sensitive information, or+ enable misuse?++Record the response, mitigation, residual uncertainty, and whether the idea was+revised—not just pass/fail.++### 8. Check literature and evidence++Search authoritative databases, primary studies, methods guidance, negative+results, and adjacent fields. Verify every citation at its source. For each+idea, record query/date, sources screened, evidence for and against, and search+limits. Use statuses such as `not-checked`, `search-incomplete`,+`support-located`, `challenge-located`, or `mixed`.++Absence from a bounded search does not establish novelty, and supportive+literature does not validate a new mechanism. Reopen one short independent+generation round after the evidence check.++### 9. Apply feasibility, rigor, and ethics gates++Before advancing an idea, identify the appropriate domain review:++- For biomedical work, consider rigor of prior research, robust design,+ relevant biological variables, and resource authentication. When NIH policy+ applies, sex as a biological variable should be considered from the research+ question through design, analysis, and reporting; justify a single-sex scope+ with relevant evidence.+- Route human-subjects, animal, biosafety, data-governance, export-control,+ clinical, environmental, and other regulated work to the relevant office.+- Screen life-science and enabling-technology ideas for dual-use or misuse+ potential early. Current U.S. oversight is evolving; consult the institution+ and current agency policy rather than relying on a static checklist.+- Do not upload sensitive, unpublished, proprietary, controlled, or personal+ information to an external AI service.++An ethics or feasibility concern may require redesign, controlled handling, or+stopping. A high creativity score never overrides a gate.++### 10. Decide and log++The accountable human decision owner records:++- candidates considered and criteria/weights used;+- raw ratings, uncertainty ranges, dissent, abstentions, and sensitivity+ results;+- literature and review dates;+- gate outcomes and required approvals;+- decision, rationale, rejected alternatives, unresolved risks, owner, and+ revisit trigger.++Label the next action correctly: further search, consultation, simulation,+pilot design, protocol development, preregistration, or no action. If a+confirmatory study is planned, preregister hypotheses and analysis decisions+before outcomes are known; report later deviations and exploratory work+transparently. Preregistration improves transparency but is not peer review,+ethical approval, or proof of validity.++## Bias and failure controls++- **Production blocking:** private parallel generation before oral discussion.+- **Anchoring and design fixation:** no leader answer or AI examples until the+ independent round; reopen generation after evidence review.+- **Authority and status effects:** leader-last sharing, anonymous input,+ independent ratings, and visible dissent.+- **Groupthink:** assign a genuine alternative-generation role, invite outside+ review, and document rejected options. Treat “groupthink” as a family of+ risks, not a single universally established diagnosis.+- **Evaluation apprehension:** separate contribution from attribution where+ possible; critique ideas, not contributors.+- **Premature convergence:** fixed divergence window followed by an explicit+ transition and predeclared criteria.+- **False precision:** use anchored scales, uncertainty ranges, sensitivity+ analysis, and narrative review.+- **Research-gap inflation:** record search boundaries and use “no direct+ evidence located,” not “never studied.”+- **AI hallucination or homogenization:** human-first ideation, provenance,+ independent verification, multiple non-AI perspectives, and comparison for+ suspiciously repeated frames. See `references/responsible_ai.md`.++## Optional local CLIs++The scripts are deterministic, standard-library utilities. They do not call a+network service, LLM, or scientific database and do not make scientific+conclusions.++```bash+python scripts/session_scaffold.py --help+python scripts/validate_register.py --help+python scripts/evaluate_matrix.py --help+```++Create a session register:++```bash+python scripts/session_scaffold.py \+ --session-id "microbiome-01" \+ --title "Microbiome mechanism ideation" \+ --question "Which mechanisms could explain the scoped observation?" \+ --participant P01 --participant P02 \+ --output session.json+```++Validate structure and provenance:++```bash+python scripts/validate_register.py session.json --output validation.json+```++Calculate a fully disclosed weighted matrix from CSV, including score intervals+and one-at-a-time weight sensitivity:++```bash+python scripts/evaluate_matrix.py scores.csv \+ --config criteria.json \+ --weight-delta 0.10 \+ --output matrix.json+```++Outputs refuse symlinks and existing files unless `--force` is explicit; inputs+and collection sizes are bounded. The validator checks structure, not truth.+The matrix preserves qualitative review and uncertainty and leaves+`decision` null. Input formats and interpretation are documented in+`references/idea_evaluation.md`.++## Reference index++- `references/brainstorming_methods.md` — evidence-calibrated method selection,+ nominal groups, Delphi, structured elicitation, and creative prompts.+- `references/facilitation_workflows.md` — ready-to-run individual, group, and+ asynchronous session protocols plus provenance templates.+- `references/idea_evaluation.md` — criteria, scoring formula, uncertainty,+ sensitivity analysis, gates, and decision logs.+- `references/responsible_ai.md` — accountable AI assistance, confidentiality,+ hallucination, homogenization, disclosure, dual-use, and integrity.+- `references/sources.md` — dated primary studies and official guidance+ consulted for this version.diff --git a/skills/scientific-brainstorming/references/brainstorming_methods.md b/skills/scientific-brainstorming/references/brainstorming_methods.mdindex 152773ee..172b5b05 100644--- a/skills/scientific-brainstorming/references/brainstorming_methods.md+++ b/skills/scientific-brainstorming/references/brainstorming_methods.md@@ -1,326 +1,292 @@-# Advanced Brainstorming Methodologies--This reference document provides detailed descriptions of structured brainstorming frameworks that can be applied to scientific ideation. Consult these when standard techniques need supplementation or when the scientist requests a specific methodology.--## SCAMPER Framework--SCAMPER is an acronym for seven different ways to approach a problem or idea. Particularly useful for improving existing methods or adapting known techniques.--### Substitute-- What elements can be replaced? (materials, methods, models, assumptions)-- What other processes could achieve similar results?-- What if you used a different organism/system/dataset?--**Scientific applications:**-- Substitute chemical catalysts with biological enzymes-- Replace traditional microscopy with super-resolution techniques-- Use computational models instead of animal models--### Combine-- What ideas, methods, or technologies can be merged?-- What collaborations would create synergy?-- Can you combine data sources or techniques?--**Scientific applications:**-- Merge genomics with metabolomics for multi-omics analysis-- Combine machine learning with traditional statistical methods-- Integrate field observations with laboratory experiments--### Adapt-- What can be borrowed from other fields?-- How have others solved similar problems?-- What analogous systems exist in nature or other disciplines?--**Scientific applications:**-- Adapt evolutionary algorithms to drug design-- Use concepts from network theory to understand protein interactions-- Apply ecological principles to microbiome research+# Brainstorming and Elicitation Methods++Use methods as fit-for-purpose process choices, not creativity guarantees. The+best-supported finding in classic laboratory work is narrow: interacting+face-to-face groups often produce fewer nonredundant ideas than the pooled+output of the same number of people working independently, with turn-taking+(`production blocking`) an important mechanism. That does not establish that+independent work is always better for learning, synthesis, commitment,+selection, or every real-world task. See `sources.md` for studies and+limitations.++## Choose by purpose++| Need | Suitable pattern | Main caution |+|---|---|---|+| Broad initial idea pool | Independent generation, then structured sharing | A larger pool is not automatically a better decision |+| Equal participation and same-day prioritization | Nominal group technique (NGT) | Votes show panel preference, not scientific truth |+| Iterative geographically distributed judgment | Delphi | Consensus can stabilize around shared bias |+| Quantitative uncertain values for a model | Structured expert elicitation | Expert judgment does not replace empirical evidence |+| Explore a combinatorial design space | Morphological analysis | Combinations may be infeasible or meaningless |+| Reframe an existing concept | SCAMPER or assumption reversal | Prompting heuristics have context-dependent evidence |+| Stress-test shortlisted ideas | Red team, premortem, alternative explanations | Critique needs an explicit response and owner |++For consequential decisions, state why the chosen process fits the question,+who is included, what information participants see, and how uncertainty and+dissent will be retained.++## Independent-then-interactive generation++This is the default for a live research session.++1. Give every participant the same neutral question, constraints, and time.+2. Ask them to write ideas privately and in parallel.+3. Capture each idea before anyone sees another participant's answer.+4. Pool ideas with stable IDs; optionally mask contributor identity.+5. Clarify in a round robin without advocacy or scoring.+6. Add a second private round after participants have seen the pool.+7. Cluster by a declared relation while preserving original text.+8. Move to a separately announced evaluation phase.++Why use it:++- Parallel work avoids waiting to speak.+- Human-first generation limits early leader, example, and AI anchors.+- The second private round permits stimulation from others' ideas without+ requiring immediate public performance.++Limits:++- Classic brainstorming studies often used short, artificial tasks and student+ samples.+- Pooled individual output may contain redundancy and miss benefits of+ dialogue, knowledge integration, or implementation commitment.+- Higher idea counts do not guarantee better final selections. One experiment+ found nominal groups produced more and more-original ideas, but selected+ ideas were not better than those of interactive groups.++## Nominal group technique++NGT is a facilitated, usually synchronous process for eliciting and+prioritizing contributions. A common four-stage form is:++1. **Silent generation:** participants independently answer one precise+ question.+2. **Round-robin recording:** each person contributes one item at a time until+ all items are recorded.+3. **Clarification:** discuss meaning, not merit; merge only with originators'+ agreement and preserve a merge log.+4. **Independent rating or ranking:** participants vote privately using+ predeclared rules.++Use NGT when equal airtime, traceability, and prompt prioritization matter.+Report:++- recruitment and relevant perspectives;+- exact question and materials shown in advance;+- group size, facilitator, accessibility adaptations, and conflicts;+- how items were edited, merged, removed, or added;+- rating scale, consensus or retention rule, missing votes, ties, and+ abstentions;+- full distribution, not only top-ranked items.++Do not:++- call a ranked list “validated”;+- drop low-ranked minority concerns when they concern safety or ethics;+- infer population prevalence from a purposive panel;+- silently modify NGT and still imply a standardized procedure.++NGT is flexible, and reviews document substantial variation in implementation.+Describe the procedure actually used.++## Delphi++Delphi is an iterative, usually anonymous elicitation process with controlled+feedback between rounds. It is useful when participants are dispersed,+face-to-face status effects are a concern, or judgments need time for revision.++### Minimal defensible design++1. Define why Delphi is appropriate and what decision it will inform.+2. Predefine “expertise” or stakeholder eligibility; sample multiple relevant+ perspectives rather than only prestigious titles.+3. Pilot unambiguous questions and scales.+4. Predefine the number or stopping logic for rounds, feedback statistics,+ consensus rule, missing-data handling, and treatment of new items.+5. Collect round 1 independently.+6. Return controlled feedback that includes the distribution and anonymized+ reasons, not only a mean.+7. Let participants retain or revise judgments and explain important changes.+8. Report attrition by round, disagreement, stability, and items without+ consensus.++### Interpretation++- Consensus means convergence among this panel under this protocol.+- It does not establish correctness, causality, clinical effectiveness, or+ ethical acceptability.+- Anonymity can reduce interpersonal pressure but also removes conversational+ repair and may obscure conflicts of interest.+- Repeated feedback may manufacture agreement. Preserve rationales and+ minority estimates.+- “Modified Delphi” is not self-explanatory; list every modification.++Use the CREDES checklist or the 2023 RAND methodological guidance when a Delphi+result will be published or relied upon. Those resources are indexed in+`sources.md`.++## Structured expert elicitation++Use structured expert elicitation when empirical evidence is incomplete and a+decision model needs quantities or probability distributions—not simply a list+of ideas. Follow domain guidance where available.++High-level sequence:++1. Define the target quantity, unit, conditioning information, time horizon,+ and resolution criterion.+2. Review available evidence systematically before asking for judgment.+3. Select experts for relevant and complementary expertise; disclose conflicts.+4. Train participants to express uncertainty and test the instrument.+5. Elicit individual judgments before group aggregation.+6. Ask for plausible bounds and reasons, then a central estimate; avoid+ presenting a preferred anchor.+7. Record assumptions, dependencies, and what evidence would change the+ estimate.+8. Apply a declared mathematical or behavioral aggregation method.+9. Test sensitivity to experts, aggregation rules, and assumptions.+10. Document the complete process and distinguish expert judgment from data.++EFSA's guidance emphasizes framing, expert selection, uncertainty elicitation,+aggregation, and documentation because unaided judgment—especially about+uncertainty—can be biased. Cooke's Classical Model and other protocols have+additional requirements; do not imitate only their scoring labels.-### Modify (Magnify/Minify)-- What can be amplified, exaggerated, or made more prominent?-- What can be reduced, simplified, or made more subtle?-- Change scale, frequency, or magnitude?+## Divergence and convergence-**Scientific applications:**-- Scale up from single cells to populations-- Miniaturize assays for high-throughput screening-- Increase temporal resolution of measurements-- Simplify complex models to essential components--### Put to Another Use-- What new applications could this serve?-- Can this be used in a different context?-- What unexpected applications might exist?+Treat divergence and convergence as facilitation modes, not cleanly separable+mental faculties.-**Scientific applications:**-- Repurpose existing drugs for new diseases-- Use industrial waste products as research materials-- Apply failed experiments' insights to different questions--### Eliminate-- What can be removed or simplified?-- What's unnecessary?-- What if you did less but better?+### Divergence-**Scientific applications:**-- Remove confounding variables-- Eliminate expensive reagents or equipment requirements-- Simplify experimental protocols-- Remove assumptions to see what's truly necessary+Aim for a varied candidate set:-### Reverse/Rearrange-- What if you worked backwards?-- Can you invert the process?-- What if you changed the sequence?+- defer comparative judgment for a fixed interval;+- vary scale, population, mechanism, measurement, time horizon, and level of+ intervention;+- request alternatives that predict different observations;+- include null mechanisms and “do nothing / measure first” options;+- capture assumptions and uncertainties while the idea is generated.-**Scientific applications:**-- Work backwards from desired outcomes to methods-- Reverse causality questions (what if the effect causes the cause?)-- Rearrange experimental order-- Invert the control and experimental groups conceptually--## Six Thinking Hats--A method for exploring ideas from six distinct perspectives, ensuring comprehensive analysis. Have the scientist metaphorically "wear" different hats to shift thinking modes.--### White Hat (Facts and Information)-- What data do we have?-- What information is missing?-- What facts are known?-- What measurements exist?--**Usage:** Start here to establish baseline knowledge--### Red Hat (Emotions and Intuition)-- What's your gut feeling?-- What excites or worries you?-- What seems promising intuitively?-- What emotional responses arise?+### Transition-**Usage:** Allow intuitive responses without justification+The facilitator explicitly closes generation, freezes the initial register,+and introduces evaluation criteria. This process separation reduces premature+evaluation, but evidence does not support claiming that it always improves+selected idea quality.-### Black Hat (Critical Judgment)-- What could go wrong?-- What are the weaknesses?-- Why might this fail?-- What are the risks?--**Usage:** Identify potential problems constructively--### Yellow Hat (Optimistic View)-- What's the best-case scenario?-- What are the benefits?-- Why might this work brilliantly?-- What value could this create?--**Usage:** Explore positive possibilities fully--### Green Hat (Creativity)-- What alternatives exist?-- What wild ideas come to mind?-- What if anything were possible?-- What creative solutions emerge?--**Usage:** Generate novel ideas without constraint--### Blue Hat (Process Control)-- What's the big picture?-- What have we learned?-- What should we do next?-- How do we organize these ideas?--**Usage:** Step back to synthesize and plan--## Morphological Analysis--Systematic exploration of all possible combinations of different dimensions of a problem. Particularly powerful for complex research questions with multiple variables.--### Method:-1. **Identify key dimensions** of the research question (organism, technique, variable, scale, etc.)-2. **List options** for each dimension-3. **Create combinations** systematically-4. **Evaluate** promising combinations--### Example: Drug Delivery Research--| Dimension | Options |-|-----------|---------|-| Carrier | Liposomes, Nanoparticles, Viruses, Exosomes |-| Target | Brain, Tumor, Liver, Specific cell type |-| Trigger | pH, Temperature, Light, Enzyme |-| Cargo | Small molecule, Protein, RNA, DNA |--This creates 4×4×4×4 = 256 possible combinations to explore.--### Scientific applications:-- Design comprehensive experimental matrices-- Identify unexplored parameter spaces-- Systematically consider all methodological options-- Find unique combinations others haven't tried--## TRIZ (Theory of Inventive Problem Solving)--Originally developed for engineering, TRIZ principles apply remarkably well to scientific challenges. Based on patterns identified across millions of patents.--### Key Concepts:--#### Contradictions-Identify competing requirements and find principles that resolve them.--**Example contradictions in science:**-- Need high sensitivity vs. need high specificity-- Want more data vs. limited resources-- Need fast results vs. need accuracy--#### Principles for Resolution:-1. **Segmentation** - Divide into parts, increase modularity-2. **Taking out** - Remove interfering components-3. **Local quality** - Optimize each part for its specific function-4. **Asymmetry** - Break symmetry for advantage-5. **Merging** - Combine similar operations-6. **Universality** - Make objects perform multiple functions-7. **Nesting** - Place objects inside each other-8. **Counterweight** - Use opposing forces-9. **Prior action** - Perform changes in advance-10. **Cushion in advance** - Prepare emergency measures--### Ideal Final Result-Imagine the perfect solution where the problem solves itself or disappears.--**Questions:**-- What if the system optimized itself?-- What if the measurement didn't require intervention?-- What if the sample prepared itself?--### Use of Resources-Identify unused resources in the system (waste products, byproducts, available data, existing equipment).--## Biomimicry Approach--Look to nature's 3.8 billion years of R&D for solutions. Particularly powerful in biology, chemistry, materials science, and engineering.--### The Process:--#### 1. Define the Function-Focus on what you need to accomplish, not how.-- "I need to transport molecules across a membrane"-- "I need to sense trace chemicals"-- "I need to self-assemble structures"--#### 2. Biologize the Question-Reframe in biological terms:-- "How does nature move substances across barriers?"-- "How do organisms detect minute concentrations?"-- "How do biological systems build themselves?"--#### 3. Discover Natural Models-Search for organisms that excel at this function:-- Which species are champions at this?-- What ecosystems manage this process?-- What molecular mechanisms exist?--#### 4. Abstract the Strategy-Identify the underlying principle, not just the literal mechanism:-- What's the core strategy?-- What patterns repeat?-- What universal principles apply?--#### 5. Apply to Your Challenge-Adapt the natural strategy to your scientific context:-- How can this principle be implemented?-- What would be the scientific equivalent?-- What modifications are needed?--### Scientific Examples:-- **Gecko feet → Adhesives**: Van der Waals forces in nanoscale structures-- **Lotus leaf → Self-cleaning surfaces**: Superhydrophobic micro-textures-- **Firefly bioluminescence → Imaging**: Luciferase reporters-- **Shark skin → Antibacterial surfaces**: Microscale patterns inhibit bacteria-- **Octopus camouflage → Adaptive materials**: Responsive color-changing systems--### Nature's Strategies:-- **Self-assembly**: Components organize without external direction-- **Adaptation**: Systems adjust to environmental changes-- **Resilience**: Systems recover from disturbance-- **Efficiency**: Maximum output for minimum input-- **Multifunctionality**: One structure serves many purposes-- **Redundancy**: Backup systems ensure reliability--## Additional Techniques--### Provocation Technique-Use deliberately absurd or impossible statements to break mental patterns.--**Format**: "Po (Provocation Operation) + [impossible statement]"--**Examples:**-- Po: The experiment runs itself-- Po: Results arrive before the experiment-- Po: The sample tells you what to test-- Po: Funding is unlimited-- Po: Time runs backwards--**Then ask:** "What's interesting about this?" and "How could we move toward this?"--### Random Input-Introduce a completely random word, concept, or image and force connections to the problem.--**Method:**-1. Select a random noun (use a random word generator or dictionary)-2. Explore its properties and associations-3. Force connections to the research question-4. See what unexpected ideas emerge--**Example:**-Random word: "Bridge"-- What bridges are needed in my research? (Between fields? Scales? Concepts?)-- How can I bridge gaps? (Data gaps? Knowledge gaps?)-- What acts as a bridge in biological systems?--### Reverse Assumptions-List fundamental assumptions, then deliberately reverse each one.--**Example in molecular biology:**-- Assumption: "Proteins fold after translation"-- Reverse: "What if proteins folded during translation?" → co-translational folding research-- Assumption: "DNA is the template"-- Reverse: "What if RNA is the template?" → reverse transcription, RNA world hypothesis--### Future Backwards-Imagine it's 10 years in the future and the problem has been solved brilliantly. Work backwards to figure out how it happened.--**Questions:**-- What breakthrough enabled this?-- What had to happen first?-- What obstacles were overcome?-- What unexpected development made it possible?--## Selecting a Method--Choose based on the situation:--- **SCAMPER**: When improving existing methods or adapting known approaches-- **Six Hats**: When the scientist needs to break out of one thinking mode-- **Morphological Analysis**: For systematic exploration of complex parameter spaces-- **TRIZ**: When facing apparent contradictions or impossible requirements-- **Biomimicry**: When the function exists in nature or biological inspiration is relevant-- **Provocation**: When completely stuck or thinking is too conventional-- **Random Input**: When the conversation feels stale or circular-- **Reverse Assumptions**: When fundamental rethinking is needed-- **Future Backwards**: When envisioning breakthrough outcomes--## Combining Methods--These methods work powerfully in combination:-- Use **Six Hats** to approach **SCAMPER** questions from different perspectives-- Apply **Biomimicry** to find natural solutions, then use **TRIZ** to abstract principles-- Use **Morphological Analysis** to map the space, then **Random Input** to explore unexpected corners-- Start with **Reverse Assumptions** to break frames, then **SCAMPER** to build new approaches--## Notes on Application--- Don't announce the method unless the scientist asks—just use it naturally in conversation-- Methods are tools, not rigid procedures—adapt as needed-- Sometimes the best approach is no explicit method—just curious questioning-- Watch for when a method is generating energy vs. when it feels forced-- Be ready to switch methods if one isn't working+### Convergence++- clarify and cluster without erasing distinctions;+- define originality and usefulness for this decision;+- rate independently before discussion;+- show score distributions and qualitative reasons;+- run adversarial, evidence, feasibility, and ethics reviews;+- revisit ideas when criteria or evidence change.++Experiments on idea selection show that people can select poorly from their+own pools. Explicit criteria can improve selection on the named dimension+while producing trade-offs in satisfaction or perceived effectiveness.+Therefore, keep criteria plural and make trade-offs visible.++## Generative prompt families++These are scaffolds, not validated scientific methods.++### Assumption inventory and reversal++1. List descriptive, causal, measurement, operational, and value assumptions.+2. Mark each as evidenced, conventional, required, or uncertain.+3. Reverse or remove one assumption.+4. Ask what observation would follow and whether the reversal is coherent.++Do not confuse a provocative reversal with a plausible hypothesis.++### Scale and boundary shifts++Vary:++- spatial or organizational level;+- time scale and lag;+- population, environment, or boundary conditions;+- dose, intensity, or resolution;+- unit of analysis and measurement modality.++Ask which mechanisms remain invariant and which predictions change.++### Cross-domain analogy++Write the mapping explicitly:++- source system and target system;+- relation being transferred;+- known mismatches;+- testable implication;+- evidence needed before transfer is credible.++An analogy generates a question; it is not evidence for the target mechanism.++### Morphological analysis++1. Define independent dimensions of the problem.+2. List bounded options for each dimension.+3. Generate combinations systematically.+4. Remove combinations that violate stated constraints.+5. Sample remaining combinations transparently if the full product is too+ large.+6. Record why combinations were excluded.++Do not equate an unlisted combination with novelty. Check literature and+feasibility.++### SCAMPER++For an existing method or concept, ask whether to **Substitute, Combine, Adapt,+Modify, Put to another use, Eliminate, or Reverse/Rearrange**. For each output,+add a mechanism, expected observation, and failure mode. Avoid generic+technology substitution without a scientific reason.++### Constraint ladder++Run three rounds:++1. current real constraints;+2. one negotiable constraint removed;+3. a stricter safety, cost, time, or accessibility constraint added.++Compare which ideas survive and which assumptions drive the difference.++### Premortem and alternatives++Assume the favored idea produced an uninterpretable or harmful result. List+causes across theory, measurement, sampling, execution, analysis, governance,+and misuse. Then ask for at least two mechanisms that predict the same apparent+success. Convert each into a check or discriminating observation.++## Method combinations++Useful combinations include:++- independent generation → NGT clarification/rating → adversarial review;+- morphological analysis → independent rating → feasibility gate;+- Delphi → structured uncertainty elicitation for unresolved quantitative+ items;+- human-first round → disclosed AI counterexamples → second human-only round;+- literature check → assumption reversal → updated decision matrix.++Never stack methods merely to look rigorous. Every stage should have a stated+purpose, output, and stop rule.++## Stop conditions++Pause or end the process when:++- the question cannot be scoped without confidential or controlled details;+- the group lacks a perspective essential to safety or interpretation;+- a clinical, ethics, biosafety, security, legal, or regulatory gate is+ triggered;+- participants cannot dissent safely;+- criteria or weights are being changed to favor a known option;+- a literature check is too incomplete to support a novelty claim;+- the accountable decision owner is absent.diff --git a/skills/scientific-brainstorming/references/facilitation_workflows.md b/skills/scientific-brainstorming/references/facilitation_workflows.mdnew file mode 100644index 00000000..a36945c8--- /dev/null+++ b/skills/scientific-brainstorming/references/facilitation_workflows.md@@ -0,0 +1,284 @@+# Facilitation Workflows and Records++These workflows make a session reproducible without turning facilitation into+an automatic scientific decision. Adapt timing and accessibility needs, but+record adaptations.++## Minimum session record++Create one record with:++- session ID, date, title, focal question, and decision owner;+- facilitator, participant pseudonyms, represented perspectives, missing+ perspectives, and relevant conflicts;+- in-scope/out-of-scope boundaries and constraints;+- information and examples shown before independent generation;+- idea, assumption, cluster, criterion, review, evidence-check, gate, and+ decision-log entries;+- method, timing, anonymization, voting, merge, and stopping rules;+- AI tool/version/purpose when used, without storing sensitive prompt content;+- deviations from the planned process and their reasons.++Use `scripts/session_scaffold.py` to create a deterministic JSON starting+point. It intentionally omits a generated timestamp: provide `--date` when a+date belongs in the record.++## Provenance templates++### Idea++```json+{+ "id": "I001",+ "statement": "A concise candidate research direction.",+ "provenance": {+ "origin": "human",+ "contributor_ids": ["P01"],+ "recorded_stage": "independent",+ "source_refs": [],+ "ai_tool": null+ },+ "assumption_ids": ["A001"],+ "predicted_observations": ["What would be expected if the idea were useful"],+ "uncertainties": ["The main unresolved uncertainty"],+ "evidence_status": "not-checked",+ "status": "candidate"+}+```++Allowed origin labels in the bundled validator are `human`, `ai-assisted`,+`literature-inspired`, `mixed`, and `other`. An origin label documents process;+it does not determine quality or ownership.++### Assumption++```json+{+ "id": "A001",+ "statement": "The measurement reflects the proposed construct.",+ "category": "measurement",+ "status": "untested",+ "test_or_check": "Compare with an orthogonal measure.",+ "owner_id": "P01",+ "evidence_refs": []+}+```++Useful categories include `causal`, `mechanistic`, `measurement`, `sampling`,+`operational`, `statistical`, `feasibility`, `ethical`, and `value`.++### Literature check++```json+{+ "idea_id": "I001",+ "checked_on": "2026-07-23",+ "queries": ["Exact query or protocol identifier"],+ "sources_screened": ["DOI or stable URL"],+ "support": [],+ "challenges": [],+ "search_limits": ["Databases, date, language, or access limits"],+ "status": "search-incomplete",+ "reviewer_id": "P02"+}+```++Do not store copyrighted full text, confidential reviews, credentials, or+personal data in the register.++## 30-minute individual or pair workflow++### Minute 0–5: scope++1. Write one question and one decision the session can inform.+2. List real and assumed constraints separately.+3. Check whether clinical, ethics, safety, dual-use, privacy, or regulatory+ concerns require a different process.++### Minute 5–12: independent generation++- Work silently, even as a pair.+- Generate one idea per record.+- Attach at least one assumption and one uncertainty.+- Do not search or ask an AI system during this first round unless the session+ explicitly studies AI anchoring.++### Minute 12–17: share and expand++- Read ideas without ranking.+- Clarify wording.+- Run a second two-minute private round for additions and contradictions.++### Minute 17–23: cluster and criteria++- Cluster by one declared relation.+- Define three to five criteria with directions and scale anchors.+- Identify any noncompensatory safety or ethics gates.++### Minute 23–28: challenge++- Write one disconfirming observation and one alternative explanation for each+ leading candidate.+- Mark literature work as `not-checked` unless a real search was performed.++### Minute 28–30: log++- Select the next information-gathering action, not a scientific conclusion.+- Record owner, due/revisit condition, and unresolved concerns.++## 60–90 minute facilitated group workflow++### Before the session++- Obtain a neutral focal question from the decision owner.+- Recruit complementary perspectives and identify missing voices.+- Send constraints and definitions, not example solutions.+- Choose an anonymous contribution path.+- Predeclare how ideas are retained, clustered, rated, and escalated.+- Decide what information must not enter shared notes or external tools.++### Opening (10 minutes)++- State purpose, boundaries, and what the session cannot establish.+- Explain the sequence: independent generation, sharing, clustering,+ evaluation, challenge, then next-step logging.+- Ask leaders and sponsors to withhold preferences.+- Invite conflict and accessibility disclosures.++### Independent round (10–15 minutes)++- Same prompt and time for all.+- Require stable idea IDs, assumptions, and uncertainty.+- Allow private submission to the facilitator.++### Round robin and second round (15–20 minutes)++- One item per person per turn; passing is permitted.+- Clarify without advocacy.+- Display all items simultaneously only after initial capture.+- Add a short second private generation round.++### Clustering (10–15 minutes)++- Name the relationship used for each cluster.+- Keep originals visible.+- Log every merge and preserve minority interpretations.+- Do not use lexical similarity as a claim of semantic equivalence.++### Independent evaluation (10 minutes)++- Publish criteria, definitions, directions, and weights first.+- Rate privately; permit uncertainty ranges and abstention.+- Reveal distributions before discussion.++### Challenge and gate (15 minutes)++- Assign each candidate to a non-originator.+- Record falsifiers, alternatives, bias risks, harm/misuse potential, and+ mitigations.+- Route triggered reviews to the responsible office; do not resolve them by+ vote.++### Close (5–10 minutes)++- Log candidate dispositions and dissent.+- Assign literature, feasibility, consultation, or protocol tasks.+- State that any score or rank is provisional.+- Schedule a revisit after evidence checks or external review.++## Asynchronous workflow++Use for distributed teams or when status differences make live contribution+difficult.++1. Freeze the prompt, definitions, scope, and deadline.+2. Collect independent entries without showing the current pool.+3. Release a de-identified pool at the same time to all participants.+4. Collect clarification requests and second-round ideas.+5. Publish a merge log and let originators contest merges.+6. Collect ratings and rationales independently.+7. Return distributions, dissenting reasons, and missing responses.+8. Collect revisions once; more rounds require a stated stopping rule.+9. Record attrition and whether late participants saw different information.++If iterative anonymous judgment and convergence are the actual objective, use+a documented Delphi design rather than calling any online survey “Delphi.”++## Literature-aware reopening workflow++This pattern reduces premature literature anchoring while keeping ideation+connected to evidence.++1. Complete and freeze an independent human-first idea set.+2. Run a documented search for each shortlisted idea.+3. Separate located evidence, interpretations, and unknowns.+4. Record search limits and contradictory or null findings.+5. Give all participants the same bounded evidence packet.+6. Run a new private round asking for revisions, alternatives, and+ disconfirming studies.+7. Link new ideas to their parent IDs without overwriting the initial record.++Never label an idea “novel” solely because no result appeared in one search.++## Leader and authority controls++- The most senior person speaks after independent capture.+- The facilitator is not the scientific decision owner when avoidable.+- Ask for ratings before discussion and show distributions.+- Provide a confidential dissent channel.+- Separate factual corrections from preference statements.+- Record who can veto and on what grounds.+- Ask an external reviewer to challenge ideas favored by the sponsor.+- Do not force consensus; retain “no consensus” as a valid outcome.++## Accessibility and inclusion++- Offer spoken, typed, asynchronous, and private contribution modes.+- Define jargon and distribute materials in accessible formats.+- Allow processing time and breaks.+- Do not infer silence as agreement.+- Compensate or acknowledge stakeholder and lived-experience contributions+ under applicable policy.+- Record whose participation was constrained by language, time zone,+ technology, hierarchy, or access.++## Sensitive and unpublished work++Before the session, classify what may be recorded and shared. Minimize detail:++- use abstracted mechanisms instead of controlled operational parameters;+- use participant IDs instead of personal identifiers;+- store unpublished ideas only in approved systems with appropriate access;+- do not paste unpublished manuscripts, grant reviews, patient information,+ proprietary methods, security-sensitive details, or controlled data into+ public AI or collaboration services;+- follow contractual, institutional, community, and Indigenous data-governance+ obligations.++If safe abstraction would make the question meaningless, stop and use an+approved closed process.++## Decision-log entry++```json+{+ "decision_id": "D001",+ "date": "2026-07-23",+ "owner_id": "P01",+ "candidate_ids": ["I001", "I002"],+ "decision": "Advance I001 to a bounded literature review; no study approved.",+ "rationale": "Reason linked to criteria and qualitative review.",+ "dissent": ["P02 preferred I002 because ..."],+ "uncertainties": ["Feasibility estimate has not been checked."],+ "gate_status": {+ "ethics": "not-assessed",+ "biosafety_or_dual_use": "not-applicable",+ "regulatory": "not-assessed"+ },+ "next_action": "Run and document the search protocol.",+ "revisit_when": "Evidence check and methods consultation are complete."+}+```++The log should make the decision reconstructable, not merely defensible after+the fact.diff --git a/skills/scientific-brainstorming/references/idea_evaluation.md b/skills/scientific-brainstorming/references/idea_evaluation.mdnew file mode 100644index 00000000..ea655224--- /dev/null+++ b/skills/scientific-brainstorming/references/idea_evaluation.md@@ -0,0 +1,268 @@+# Transparent Idea Evaluation++Evaluation narrows a candidate set; it does not convert ideas into evidence.+Use explicit criteria, independent ratings, uncertainty, qualitative review,+adversarial checks, and noncompensatory gates.++## Define criteria before viewing scores++For every criterion record:++- name and decision relevance;+- direction (`higher` or `lower`);+- observable anchors for the minimum, midpoint, and maximum;+- weight and who set it;+- evidence required for a rating;+- uncertainty representation;+- conflicts or overlap with other criteria.++Possible criteria include information gain, ability to distinguish mechanisms,+importance to stakeholders, feasibility, reversibility, novelty relative to a+documented search, methodological rigor, cost, time, equity, safety, and+dual-use burden.++Avoid:++- “impact” or “quality” without anchors;+- counting correlated criteria twice;+- silently converting missing information to a zero;+- changing weights after seeing which idea wins;+- averaging away an ethics, safety, regulatory, or feasibility veto.++## Rating process++1. Train raters on two neutral examples that are not session candidates.+2. Ask raters to score independently and cite the reason or source.+3. Allow `not assessable` and abstention rather than forced precision.+4. Collect a central score and plausible low/high values when uncertainty is+ material.+5. Reveal distributions and reasons.+6. Discuss disagreements, then retain both original and revised ratings.+7. Resolve factual errors separately from preference differences.++Do not report inter-rater agreement as evidence that an idea is correct.+Agreement can reflect shared information or shared bias.++## Weighted additive matrix++The bundled `scripts/evaluate_matrix.py` uses a simple, fully disclosed model.+For criterion \(j\), observed score \(x_{ij}\), minimum \(L_j\), maximum \(U_j\),+and positive weight \(w_j\):++- higher-is-better: \(n_{ij}=(x_{ij}-L_j)/(U_j-L_j)\)+- lower-is-better: \(n_{ij}=(U_j-x_{ij})/(U_j-L_j)\)+- normalized weight: \(p_j=w_j/\sum_j w_j\)+- displayed score: \(100\sum_j p_j n_{ij}\)++This compensatory formula means a high value on one criterion can offset a low+value on another. Keep hard gates outside the formula.++### Criteria configuration++```json+{+ "schema_version": "1.0",+ "criteria": [+ {+ "name": "information_gain",+ "description": "Ability to discriminate plausible mechanisms",+ "weight": 3,+ "direction": "higher",+ "minimum": 1,+ "maximum": 5+ },+ {+ "name": "resource_burden",+ "description": "Relative time, cost, and scarce-resource burden",+ "weight": 2,+ "direction": "lower",+ "minimum": 1,+ "maximum": 5+ }+ ]+}+```++Weights must be explicit, finite, and positive. They need not sum to one; the+script reports both supplied and normalized values.++### Scores CSV++```csv+idea_id,information_gain,information_gain_low,information_gain_high,resource_burden,resource_burden_low,resource_burden_high,qualitative_review,uncertainties,evidence_status,ethics_status+I001,4,3,5,3,2,4,"Distinguishing prediction is clear","Assay performance unknown",search-incomplete,review-required+I002,3,2,4,2,2,3,"Lower burden but less discriminating","Population transfer uncertain",mixed,not-assessed+```++Required columns are `idea_id`, every configured criterion,+`qualitative_review`, and `uncertainties`. Low/high columns are optional but+must appear as pairs and contain `low <= score <= high`. Extra columns are+preserved as qualitative context.++Run:++```bash+python scripts/evaluate_matrix.py scores.csv \+ --config criteria.json \+ --weight-delta 0.10 \+ --output matrix.json+```++The output includes:++- raw and normalized criterion scores;+- supplied and normalized weights;+- base score and deterministic presentation rank;+- score interval implied by input low/high values;+- minimum/maximum score and rank when each weight is perturbed one at a time+ by the requested fraction and all weights are renormalized;+- qualitative fields, limitations, formula, and tie rule;+- `decision: null` and an explicit notice that no scientific conclusion or+ automatic selection was made.++The sensitivity analysis is local and one-factor-at-a-time. It does not explore+all possible weights, criterion dependence, model-form uncertainty, correlated+ratings, or uncertainty in the scale anchors.++## Interpreting sensitivity++Treat a ranking as fragile when:++- rank changes under small, plausible weight perturbations;+- score intervals overlap materially;+- one criterion dominates the result;+- rankings change after a reasonable alternative definition;+- missing evidence is driving optimistic ratings;+- qualitative review or a gate conflicts with the numeric order.++Do not “fix” fragility by choosing weights that stabilize a preferred result.+Use it to identify value judgments, missing information, or candidates that+need further comparison.++## Adversarial review template++For every shortlisted idea record:++```text+Idea ID:+Reviewer (not an originator):+Strongest version of the idea:+Observation that would count against it:+At least two alternative explanations:+Measurement or analysis failure:+Sampling or generalizability failure:+Prior evidence that challenges it:+Potential harm, inequity, or misuse:+Mitigation:+Residual uncertainty:+Disposition: retain / revise / pause / stop / external review+```++Review the strongest version before attacking it. Avoid performative “devil's+advocacy” with no follow-up; every challenge needs a response, owner, and+status.++## Literature check++For each idea:++1. Translate the idea into searchable concepts and alternative terminology.+2. Search primary literature, systematic reviews, methods guidance, negative+ findings, and adjacent disciplines.+3. Record databases, exact queries, dates, filters, and screening limits.+4. Verify each source, DOI, sample, design, and relevant result.+5. Separate:+ - directly relevant evidence;+ - indirect analogy;+ - conflicting or null evidence;+ - expert opinion;+ - no direct evidence located in this search.+6. Update assumptions and ratings without overwriting the original record.++Do not use citation counts as a validity score. Do not let an AI-generated+summary substitute for reading the source.++## Feasibility and rigor gate++Ask a relevant methods expert to review:++- research question, unit of inference, and proposed comparison;+- discriminating predictions and plausible alternatives;+- sampling frame, controls, randomization, blinding, and replication;+- measurement validity and resource authentication;+- nuisance variables, batch effects, missingness, and analytic flexibility;+- sample-size or information requirements;+- feasibility, dependencies, cost, skills, and failure recovery;+- value and interpretability of null or contradictory outcomes.++This is a gate to protocol development, not approval to collect data.++### NIH-funded biomedical work++When NIH guidance applies, the later application or protocol should address:++- rigor of prior published and unpublished research;+- robust and unbiased design, methodology, analysis, interpretation, and+ reporting;+- relevant biological variables;+- authentication of key biological or chemical resources.++NIH's SABV policy expects sex to be considered in research questions, design,+analysis, and reporting for vertebrate animal and human studies, with strong+justification for a single-sex scope. “Include both sexes” alone is not an+analysis plan, and an inappropriate underpowered comparison can reduce rather+than improve rigor. Consult current NIH instructions and program staff.++## Ethics, safety, and regulatory gate++Ask whether the idea involves:++- people, identifiable or sensitive data, vulnerable groups, or clinical care;+- animals;+- pathogens, toxins, engineered biological systems, or environmental release;+- dual-use capabilities, dangerous optimization, or security-sensitive+ details;+- controlled technologies, export restrictions, or research-security duties;+- Indigenous, community, cultural, or data-sovereignty obligations;+- proprietary information or unpublished work;+- environmental, distributive, or accessibility harms.++Record `not-assessed`, `not-applicable`, `review-required`, `approved under+identifier ...`, `redesign-required`, or `stop`. Only the authorized body can+issue approval. Current policies vary by jurisdiction and can change.++## Decision log++Record the decision while alternatives and uncertainty are still visible:++- date, owner, and decision scope;+- candidate IDs and versions;+- criteria, anchors, weights, and sensitivity settings;+- raw ratings, ranges, dissent, missing ratings, and abstentions;+- evidence-check protocol and results;+- adversarial review and responses;+- feasibility and ethics/safety/regulatory gate status;+- selected next action and why;+- rejected or deferred alternatives and why;+- revisit trigger, owner, and deadline.++Do not rewrite the log after outcomes are known. Append corrections and+reasons.++## Preregistration and open science handoff++Ideation is normally exploratory. When a candidate becomes a confirmatory+study:++1. distinguish hypotheses formed before versus after seeing relevant outcomes;+2. specify design, primary outcomes, exclusions, stopping, and analysis+ decisions before outcome inspection;+3. use a time-stamped registry appropriate to the field;+4. document amendments and label departures and new analyses as exploratory;+5. consider a Registered Report when protocol review before results is useful;+6. follow consent, privacy, intellectual-property, security, and community+ constraints when sharing.++Preregistration supports transparency; it does not guarantee a good question,+adequate power, correct analysis, reproducibility, ethics approval, or truthful+execution. Exploratory research remains valuable when reported as exploratory.diff --git a/skills/scientific-brainstorming/references/responsible_ai.md b/skills/scientific-brainstorming/references/responsible_ai.mdnew file mode 100644index 00000000..7513757b--- /dev/null+++ b/skills/scientific-brainstorming/references/responsible_ai.md@@ -0,0 +1,220 @@+# Responsible AI in Research Ideation++AI can supply prompts, reframings, counterarguments, or organizational help.+It is not an expert panel, evidence source, author, ethics reviewer, or+scientific decision maker. Capabilities and policies change; follow current+institutional, funder, publisher, legal, and community requirements.++## Default sequence++1. **Classify information.** Decide whether the prompt would include personal,+ patient, confidential, unpublished, proprietary, export-controlled,+ security-sensitive, or otherwise restricted information.+2. **Generate human ideas first.** Freeze an independent human-only round+ before showing AI suggestions.+3. **Define the AI role.** Examples: produce orthogonal questions, challenge an+ assumption, list search terms, or reformat an already approved record.+4. **Use only an approved tool and data class.** Do not assume a paid or+ “private” interface satisfies institutional controls.+5. **Capture provenance.** Record tool/model or service, date, purpose, material+ prompt constraints, output IDs used, and human editor. Avoid storing+ restricted prompt text in the session register.+6. **Verify externally.** Check factual claims and every citation against+ authoritative sources. Search for contradictory and null evidence.+7. **Run a second independent human round.** Ask for ideas outside the AI's+ frames and for harms or stakeholders the output omitted.+8. **Disclose as required.** The accountable humans retain authorship,+ responsibility, and final judgment.++AI use is optional. The bundled CLIs make no network or LLM calls.++## Suitable bounded roles++- Generate alternative phrasings of a non-sensitive focal question.+- Suggest dimensions for a morphological matrix, followed by human review.+- Produce counterexamples or alternative mechanisms for registered ideas.+- Identify ambiguous terms or missing assumptions.+- Generate candidate search vocabulary, not references presented as real.+- Convert an approved, non-sensitive record between formats.+- Act as one disclosed adversarial prompt after human-first ideation.++Avoid using AI to:++- decide which scientific claim is true;+- certify novelty, safety, ethics, legality, or regulatory compliance;+- invent or complete missing data;+- rank people, patients, communities, or protected groups;+- replace stakeholder participation or domain expertise;+- generate actionable harmful or dual-use procedures;+- review confidential manuscripts, grants, or peer-review material in systems+ where confidentiality is not assured.++## Hallucination and source verification++Generative systems can produce plausible but false claims, references,+methods, statistics, and quotations. A 2023 study found fabricated and+substantively erroneous bibliographic citations in outputs from the tested+GPT-3.5 and GPT-4 versions; model-specific rates are not timeless estimates.++For every AI-suggested source:++1. locate the work in a trusted index or publisher site;+2. match title, authors, venue, year, DOI, and version;+3. read the relevant primary text;+4. confirm the cited result, population, design, and limitations;+5. record the stable source identifier;+6. delete unsupported claims rather than laundering them as “AI suggested.”++Never cite the model as evidence for a scientific claim.++## Anchoring and homogenization++AI output can anchor users on examples and compress a group's idea diversity.+In a preregistered short-story experiment, access to GPT-4 ideas improved+average evaluated creativity for some writers while making outputs more+similar in aggregate. The task was short creative writing, not scientific+ideation, so treat homogenization as a credible risk to test—not a universal+effect size.++Controls:++- human-only generation before any AI output;+- different participants receive no AI, or distinct prompt frames, when the+ comparison is methodologically justified;+- ask for mechanisms that contradict the AI's dominant frame;+- compare assumptions, predictions, and causal structure—not only wording;+- preserve pre-AI ideas and record which ideas changed after exposure;+- include non-AI domain, methods, stakeholder, ethics, and safety perspectives;+- do not infer independent support from many outputs of the same model.++Multiple AI samples are correlated products of a system, not independent+experts or replications.++## Automation bias and false authority++Fluent language, technical detail, and confident formatting are not evidence.+To reduce deference:++- hide model branding during idea review when feasible;+- evaluate ideas against the same predeclared criteria;+- require a human rationale and uncertainty statement;+- assign a non-originating human challenger;+- verify with primary evidence and domain experts;+- retain a “no decision / insufficient evidence” outcome;+- prohibit automatic advancement based only on an AI or matrix score.++Do not ask an AI system to assign a probability it cannot calibrate and then+treat the number as measured uncertainty.++## Confidentiality, privacy, and intellectual property++Do not submit the following to an external AI service unless an authorized+policy and agreement explicitly permit that data class:++- patient, participant, employee, student, or other personal information;+- unpublished manuscripts, peer reviews, grants, invention disclosures, or+ partner materials;+- proprietary protocols, source code, compounds, sequences, or business data;+- controlled unclassified, export-controlled, classified, or+ security-sensitive information;+- credentials, tokens, private links, or internal system details;+- community-governed or Indigenous data outside agreed governance.++Data minimization and abstraction are still required with an approved tool.+Check retention, training use, access, location, deletion, audit, and incident+terms. If the work cannot be safely abstracted, use an approved local/closed+process or do not use AI.++## Bias, representation, and participation++AI output may reproduce gaps and stereotypes in training data and overrepresent+well-indexed, English-language, high-resource perspectives. It cannot consent+on behalf of affected communities.++- Ask which populations, languages, geographies, disciplines, and negative+ findings are missing.+- Involve relevant people directly and compensate them where applicable.+- Distinguish biological variables from social identities and avoid+ essentialist mechanisms.+- Examine whether a proposed measurement or intervention transfers across+ settings.+- Treat accessibility, equity, and distribution of benefits and burdens as+ review criteria and possible gates.++## Research integrity and disclosure++Humans remain responsible for accuracy, attribution, originality, permissions,+and the research record. AI systems should not be listed as authors. Record and+disclose AI use at the level required by the institution, funder, venue, and+applicable guidance.++A useful internal disclosure includes:++```text+Tool/service and model or version (if exposed):+Date used:+Purpose:+Information classification and approved environment:+Human-first idea set frozen before use: yes/no+Outputs retained or used:+Verification performed:+Material changes made by humans:+Known limitations:+```++Disclosure does not cure inappropriate data sharing, plagiarism, fabricated+citations, or unverified content.++## Dual-use and misuse review++AI can make technical ideation faster and more accessible. Screen both the+research idea and the AI interaction for misuse potential.++Escalate before generating operational detail when an idea could materially+enable:++- pathogen enhancement, immune evasion, host-range change, or harmful delivery;+- synthesis, acquisition, concealment, scaling, or dissemination of hazardous+ agents or toxins;+- bypassing safety, monitoring, access, or security controls;+- dangerous chemical, biological, cyber, autonomous, or surveillance+ capability;+- targeting vulnerable populations or critical systems.++Use high-level risk framing while waiting for institutional biosafety,+biosecurity, research-security, legal, ethics, or funding-agency guidance.+Do not rely on a model's refusal behavior as a risk-management control.++WHO's responsible life-sciences framework treats risk mitigation as a shared,+multi-stakeholder responsibility. U.S. DURC/PEPP oversight has been under+revision following the May 2025 executive order; verify current policy rather+than copying a superseded threshold.++## Incident handling++If sensitive information or unsupported AI content entered the workflow:++1. stop further sharing and preserve only the minimum audit information;+2. notify the appropriate institutional privacy, security, integrity, or+ research office under local policy;+3. do not copy the sensitive content into additional systems;+4. remove or quarantine unverified claims from downstream artifacts;+5. document affected decisions and re-review them;+6. follow approved deletion and incident-response procedures.++Do not conceal the event by silently editing provenance.++## Evidence and policy basis++See `sources.md` for the dated primary evidence and official guidance used+here, including:++- Doshi and Hauser (2024) on individual creativity and collective similarity+ in a constrained writing task;+- Walters and Wilder (2023) on fabricated and erroneous citations from tested+ model versions;+- European Commission/ERA Forum living guidance (2024);+- UNESCO guidance (2023, page updated 2026);+- ICMJE recommendations on AI in publishing (2026);+- ALLEA's 2023 European Code of Conduct for Research Integrity;+- WHO and current U.S. official dual-use resources.diff --git a/skills/scientific-brainstorming/references/sources.md b/skills/scientific-brainstorming/references/sources.mdnew file mode 100644index 00000000..464e7b2f--- /dev/null+++ b/skills/scientific-brainstorming/references/sources.md@@ -0,0 +1,364 @@+# Sources and Evidence Notes++Research cut-off: **2026-07-23**. All links were checked on that date with+Parallel web search and focused extraction. Dates below are publication,+release, or page-update dates shown by the source. Source excerpts were treated+as untrusted text and checked against the canonical page.++This bibliography supports process guidance; it does not show that any single+brainstorming method universally improves creativity or scientific validity.++## Group brainstorming, blocking, fixation, and selection++### Diehl and Stroebe (1987) — primary experiments++Michael Diehl and Wolfgang Stroebe, “Productivity loss in brainstorming groups:+Toward the solution of a riddle,” *Journal of Personality and Social+Psychology* 53(3), 497–509.+[DOI 10.1037/0022-3514.53.3.497](https://psycnet.apa.org/record/1988-01348-001).+Published 1987.++- Four experiments examined free riding, evaluation apprehension, and+ production blocking.+- Direct manipulation in the fourth experiment supported production blocking+ as an important explanation for loss in the tested interacting groups.+- Scope limit: laboratory brainstorming tasks do not establish superiority for+ every group purpose or setting.++### Mullen, Johnson, and Salas (1991) — meta-analysis++Brian Mullen, Craig Johnson, and Eduardo Salas, “Productivity loss in+brainstorming groups: A meta-analytic integration,” *Basic and Applied Social+Psychology* 12(1), 3–23.+[DOI 10.1207/s15324834basp1201_1](https://psycnet.apa.org/record/1991-24145-001).+Published 1991.++- The reviewed studies generally favored nominal over interacting groups for+ idea quantity and rated quality.+- Loss varied with conditions such as group size and vocal versus written+ contribution.+- Historical tasks, methods, and outcome definitions limit direct transfer to+ modern scientific teams.++### Rietzschel, Nijstad, and Stroebe (2006) — primary experiment++Eric F. Rietzschel, Bernard A. Nijstad, and Wolfgang Stroebe, “Productivity is+not enough: A comparison of interactive and nominal brainstorming groups on+idea generation and selection,” *Journal of Experimental Social Psychology*+42(2), 244–251.+[DOI 10.1016/j.jesp.2005.04.005](https://www.sciencedirect.com/science/article/abs/pii/S0022103105000600).+Published March 2006.++- In 42 analyzed three-person student groups, nominal groups generated more+ ideas; their ideas were more original and less feasible.+- Selected-idea quality did not differ among conditions, and selection was not+ significantly better than chance.+- Strictly separating generation and selection did not establish a universal+ selection advantage in this experiment.++### Rietzschel, Nijstad, and Stroebe (2010) — primary experiments++Eric F. Rietzschel, Bernard A. Nijstad, and Wolfgang Stroebe, “The selection of+creative ideas after individual idea generation: Choosing between creativity+and impact,” *British Journal of Psychology* 101(1), 47–68.+[DOI 10.1348/000712609X414204](https://pubmed.ncbi.nlm.nih.gov/19267959/).+Published February 2010.++- Explicit selection criteria improved selection on the named originality+ dimension in the reported studies, with trade-offs in satisfaction or rated+ effectiveness.+- This supports explicit criteria, not a claim that a single composite score+ identifies the scientifically best idea.++### Smith, Ward, and Schumacher (1993) — primary experiments++Steven M. Smith, Thomas B. Ward, and Jay S. Schumacher, “Constraining effects+of examples in a creative generation task,” *Memory & Cognition* 21, 837–845.+[DOI 10.3758/BF03202751](https://pubmed.ncbi.nlm.nih.gov/8289661/).+Published November 1993.++- Across three creative-generation experiments, participants exposed to+ examples were more likely to reproduce example features.+- The specific drawing/design tasks support an anchoring or fixation risk; they+ do not quantify the effect for scientific ideation.++### Esser (1998) — review++James K. Esser, “Alive and Well after 25 Years: A Review of Groupthink+Research,” *Organizational Behavior and Human Decision Processes* 73(2–3),+116–141.+[DOI 10.1006/obhd.1998.2758](https://pubmed.ncbi.nlm.nih.gov/9705799/).+Published February 1998.++- Reviews the evidence and evolution of Janis's groupthink model.+- The broader literature includes substantial debate over the model and its+ antecedents; this skill therefore uses “groupthink” as a risk prompt, not a+ definitive diagnosis.++## Nominal groups, Delphi, and structured elicitation++### Van de Ven and Delbecq (1972) — early NGT paper++Andrew H. Van de Ven and André L. Delbecq, “The nominal group as a research+instrument for exploratory health studies,” *American Journal of Public+Health* 62(3), 337–342.+[DOI 10.2105/AJPH.62.3.337](https://pmc.ncbi.nlm.nih.gov/articles/PMC1530096/).+Published March 1972.++- Primary early account of the nominal-group approach in exploratory health+ research.+- Historical evidence should be combined with current, context-specific+ reporting guidance.++### Harb et al. (2021) — NGT scoping review++Sami I. Harb et al., “Methodological options of the nominal group technique for+survey item elicitation in health research: A scoping review,” *Journal of+Clinical Epidemiology* 139, 140–148.+[DOI 10.1016/j.jclinepi.2021.08.008](https://www.sciencedirect.com/science/article/abs/pii/S0895435621002535).+Published November 2021.++- Included 57 studies and identified 30 process decision points across five+ broad stages.+- Supports documenting actual choices and their rationale rather than treating+ NGT as one invariant protocol.+- Scope is health-survey item elicitation, not every use of NGT.++### Jünger et al. (2017) — CREDES systematic review and guidance++Saskia Jünger et al., “Guidance on Conducting and REporting DElphi Studies+(CREDES) in palliative care,” *Palliative Medicine* 31(8), 684–706.+[DOI 10.1177/0269216317690685](https://pubmed.ncbi.nlm.nih.gov/28190381/).+E-published 13 February 2017.++- A methodological systematic review of 30 palliative-care Delphi studies+ found substantial variation in conduct, terminology, and reporting.+- CREDES is reporting and conduct guidance developed in a palliative-care+ context, not proof that Delphi consensus is correct.++### RAND (2023) — official Delphi methods guidance++Dmitry Khodyakov, Sean Grant, Jack Kroger, and Melissa Bauman,+[*RAND Methodological Guidance for Conducting and Critically Appraising Delphi+Panels*](https://www.rand.org/pubs/tools/TLA3082-1.html).+RAND Corporation, 29 December 2023.+[DOI 10.7249/TLA3082-1](https://doi.org/10.7249/TLA3082-1).++- Defines Delphi as iterative, anonymous, structured group communication under+ uncertainty and provides a design/appraisal tool.+- RAND explicitly notes a lack of consistent methodological guidance across+ the many Delphi variants.++### EFSA (2014) — official expert-knowledge elicitation guidance++European Food Safety Authority, “Guidance on Expert Knowledge Elicitation in+Food and Feed Safety Risk Assessment,” *EFSA Journal* 12(6):3734.+[DOI 10.2903/j.efsa.2014.3734](https://efsa.onlinelibrary.wiley.com/doi/10.2903/j.efsa.2014.3734).+Adopted 22 May and published 19 June 2014.++- Covers problem definition, preparation, expert/method selection, elicitation,+ uncertainty, aggregation, and documentation.+- Developed for EFSA food/feed risk assessment; apply domain-specific guidance+ elsewhere.++### Cooke, Mendel, and Thijs (1988) — structured judgment method++Roger Cooke, Max Mendel, and Wim Thijs, “Calibration and information in expert+resolution; a classical approach,” *Automatica* 24(1), 87–94.+[DOI 10.1016/0005-1098(88)90011-8](https://www.sciencedirect.com/science/article/abs/pii/0005109888900118).+Published 1988.++- Presents calibration and information concepts for combining expert+ judgments and an experiment with descriptive value.+- Using a “calibration” label without the method's elicitation, seed questions,+ and validation requirements would be misleading.++## Rigor, reproducibility, and sex as a biological variable++### NIH rigor and reproducibility guidance++NIH Office of Extramural Research,+[*Guidance: Rigor and Reproducibility in Grant Applications*](https://grants.nih.gov/policy-and-compliance/policy-topics/reproducibility/guidance).+Page dated 16 October 2024.++- Identifies rigor of prior research, rigorous experimental design, relevant+ biological variables, and authentication of key resources.+- This is grant guidance. It does not validate an idea or substitute for a+ protocol, statistical review, or field-specific reporting standard.++### NIH SABV policy and current ORWH guidance++NIH Office of Research on Women's Health,+[*Sex as a Biological Variable*](https://orwh.od.nih.gov/sex-as-biological-variable).+Page last updated 17 October 2025.++- NIH expects sex to be considered in design, analysis, and reporting for+ vertebrate animal and human studies and requests strong justification for a+ single-sex scope.+- The page links the governing+ [NOT-OD-15-102](https://grants.nih.gov/grants/guide/notice-files/not-od-15-102.html),+ released 9 June 2015 and effective for relevant applications from 2016.+- Scope is NIH policy; other funders and jurisdictions may differ.++## Preregistration and open science++### Nosek et al. (2018) — preregistration perspective++Brian A. Nosek et al., “The preregistration revolution,” *Proceedings of the+National Academy of Sciences* 115(11), 2600–2606.+[DOI 10.1073/pnas.1708274114](https://pubmed.ncbi.nlm.nih.gov/29531091/).+Published 13 March 2018.++- Frames preregistration as a way to distinguish prediction from postdiction+ by specifying questions and analyses before observing outcomes.+- It is a methodological perspective, not evidence that registration alone+ guarantees rigor or reproducibility.++### Nosek et al. (2015) — TOP Guidelines++Brian A. Nosek et al., “Promoting an open research culture,” *Science*+348(6242), 1422–1425.+[DOI 10.1126/science.aab2374](https://www.science.org/doi/10.1126/science.aab2374).+Published 26 June 2015.++- Proposes modular journal-policy standards for transparency and openness.+- A policy framework does not itself establish that a specific study is valid+ or ethically shareable.++### COS/OSF — current operational guidance++Center for Open Science,+[*Preregistration*](https://www.cos.io/initiatives/prereg) and+[*Preregistration: A Plan, Not a Prison*](https://www.cos.io/blog/preregistration-plan-not-prison).+Current pages accessed 23 July 2026.++- Explicitly values both exploratory and confirmatory research, recommends+ transparent labeling, and explains how to report deviations.++Center for Open Science,+[*Registered Reports*](https://www.cos.io/initiatives/registered-reports).+Current page accessed 23 July 2026.++- Describes Stage 1 protocol review and in-principle acceptance before results,+ with exploratory analyses reported separately.+- COS states that Registered Reports are not a panacea for every field or+ design.++## Responsible AI and research integrity++### Doshi and Hauser (2024) — primary randomized experiment++Anil R. Doshi and Oliver P. Hauser, “Generative AI enhances individual+creativity but reduces the collective diversity of novel content,” *Science+Advances* 10(28):eadn5290.+[DOI 10.1126/sciadv.adn5290](https://www.science.org/doi/10.1126/sciadv.adn5290).+Published 12 July 2024.++- Preregistered online experiment: 293 analyzed UK participants wrote+ eight-sentence stories with no, one, or up to five GPT-4 ideas.+- AI access improved average evaluated novelty/usefulness, especially for+ lower-scoring writers, while outputs became more similar in aggregate.+- Constrained short-story writing is not scientific ideation; the study+ supports a risk hypothesis, not a universal creativity claim.++### Walters and Wilder (2023) — primary citation audit++William H. Walters and Esther Isabelle Wilder, “Fabrication and errors in the+bibliographic citations generated by ChatGPT,” *Scientific Reports* 13.+[DOI 10.1038/s41598-023-41032-5](https://www.nature.com/articles/s41598-023-41032-5).+Published 7 September 2023.++- Audited 84 texts produced in April 2023 by tested GPT-3.5 and GPT-4 versions+ and documented fabricated and substantive citation errors.+- Results are model-, prompt-, task-, and date-specific; they justify direct+ source verification rather than a timeless error rate.++### European Commission / ERA Forum (2024) — official living guidance++European Commission Directorate-General for Research and Innovation,+[*Guidelines on the responsible use of generative AI in+research*](https://research-and-innovation.ec.europa.eu/news/all-research-and-innovation-news/guidelines-responsible-use-generative-ai-research-developed-european-research-area-forum-2024-03-20_en).+Published 20 March 2024.++- Emphasizes transparency, responsibility, privacy, confidentiality,+ intellectual property, bias awareness, and avoiding AI in sensitive+ evaluation activities when confidentiality is not assured.+- The Commission describes the guidance as living and subject to updates.++### UNESCO (2023; updated 2026) — official guidance++Fengchun Miao and Wayne Holmes,+[*Guidance for generative AI in education and research*](https://www.unesco.org/en/articles/guidance-generative-ai-education-and-research).+Published 7 September 2023; page last updated 16 January 2026.++- Uses a human-centered framing and addresses privacy, ethical validation,+ inclusion, equity, and institutional capacity.+- Much of the document concerns education; apply research-specific provisions+ with local policy.++### ICMJE (2026) — official publishing recommendations++International Committee of Medical Journal Editors,+[*Use of Artificial Intelligence in Publishing*](https://www.icmje.org/recommendations/browse/artificial-intelligence).+Recommendations page dated 2026.++- Humans remain responsible for accuracy, attribution, permissions,+ confidentiality, and disclosure; AI tools are not authors.+- Publishing guidance does not replace institutional research policy.++### ALLEA (2023) — research-integrity code++ALLEA,+[*The European Code of Conduct for Research Integrity, 2023 Revised+Edition*](https://allea.org/portfolio-item/european-code-of-conduct-2023).+[DOI 10.26356/ECOC](https://doi.org/10.26356/ECOC). Published 2023.++- Cross-disciplinary self-regulatory framework recognized as a reference for+ EU-funded research.+- General principles require translation into institutional and+ discipline-specific procedures.++## Dual-use and responsible life sciences++### WHO global framework and current program++World Health Organization,+[*Ensuring responsible use of life sciences research*](https://www.who.int/activities/ensuring-responsible-use-of-life-sciences-research).+Program page accessed 23 July 2026; it indexes the 13 September 2022 Global+Guidance Framework and materials through a 15 June 2026 meeting report.++- Frames dual-use risk mitigation as individual and collective,+ multi-stakeholder work across life sciences and relevant emerging+ technologies.+- Global guidance must be applied with jurisdictional and institutional rules.++### Current U.S. policy-status notice++U.S. Department of Health and Human Services, Administration for Strategic+Preparedness and Response,+[*Dual Use Research of Concern Oversight Policy Framework*](https://aspr.hhs.gov/S3/Pages/Dual-Use-Research-of-Concern-Oversight-Policy-Framework.aspx).+Current-status notice accessed 23 July 2026.++- The page states that federal departments and agencies will revise or replace+ the 2024 DURC/PEPP policy in response to the 5 May 2025 executive order and+ that the page will be updated when revised policy is available.+- Therefore this skill does not present the 2024 policy as a stable current+ checklist; researchers should consult their institution and current agency+ materials.++## Research method++Parallel CLI searches used focused academic and official-domain queries for:++- interactive versus nominal brainstorming and productivity blocking;+- NGT, Delphi, and structured expert elicitation;+- divergent/convergent idea generation and selection;+- NIH rigor, reproducibility, and SABV;+- preregistration, Registered Reports, and open-science guidance;+- responsible AI, hallucinated citations, homogenization, confidentiality,+ research integrity, and disclosure;+- WHO and U.S. dual-use policy status.++Canonical sources were then fetched with `parallel-cli extract` using focused+objectives for bibliographic metadata, methods, findings, limitations, and+current policy status. No research JSON artifacts were saved in the skill.diff --git a/skills/scientific-brainstorming/scripts/_common.py b/skills/scientific-brainstorming/scripts/_common.pynew file mode 100644index 00000000..5d318bf5--- /dev/null+++ b/skills/scientific-brainstorming/scripts/_common.py@@ -0,0 +1,307 @@+"""Shared standard-library safety helpers for brainstorming CLIs."""++from __future__ import annotations++import argparse+import json+import math+import os+import re+import stat+import tempfile+from collections.abc import Iterable+from datetime import date+from pathlib import Path+from typing import Any++MAX_INPUT_BYTES = 5 * 1024 * 1024+MAX_TEXT_CHARS = 10_000+MAX_SHORT_TEXT_CHARS = 500+MAX_ITEMS = 5_000+IDENTIFIER_PATTERN = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$")+++class CliError(ValueError):+ """A deterministic, user-facing CLI validation error."""+++def bounded_float(minimum: float, maximum: float):+ """Return an argparse converter for a finite bounded float."""++ def convert(raw: str) -> float:+ try:+ value = float(raw)+ except ValueError as exc:+ raise argparse.ArgumentTypeError(f"expected a number, got {raw!r}") from exc+ if not math.isfinite(value) or not minimum <= value <= maximum:+ raise argparse.ArgumentTypeError(+ f"expected a finite number from {minimum} through {maximum}"+ )+ return value++ return convert+++def require_identifier(value: Any, label: str) -> str:+ """Validate a stable, bounded identifier."""++ if not isinstance(value, str) or not IDENTIFIER_PATTERN.fullmatch(value):+ raise CliError(+ f"{label} must match {IDENTIFIER_PATTERN.pattern} and be at most "+ "64 characters"+ )+ return value+++def require_text(+ value: Any,+ label: str,+ *,+ maximum: int = MAX_TEXT_CHARS,+ allow_empty: bool = False,+) -> str:+ """Validate and normalize a bounded text field."""++ if not isinstance(value, str):+ raise CliError(f"{label} must be a string")+ normalized = value.strip()+ if not normalized and not allow_empty:+ raise CliError(f"{label} must not be empty")+ if len(normalized) > maximum:+ raise CliError(f"{label} is {len(normalized)} characters; limit is {maximum}")+ return normalized+++def bounded_strings(+ values: Iterable[str],+ label: str,+ *,+ maximum_items: int = 100,+ maximum_length: int = MAX_SHORT_TEXT_CHARS,+) -> list[str]:+ """Validate a bounded sequence of strings."""++ result = list(values)+ if len(result) > maximum_items:+ raise CliError(f"{label} has {len(result)} items; limit is {maximum_items}")+ return [+ require_text(+ value,+ f"{label}[{index}]",+ maximum=maximum_length,+ )+ for index, value in enumerate(result)+ ]+++def require_iso_date(value: str, label: str = "date") -> str:+ """Validate an ISO calendar date without inventing a current date."""++ try:+ parsed = date.fromisoformat(value)+ except (TypeError, ValueError) as exc:+ raise CliError(f"{label} must be an ISO date (YYYY-MM-DD)") from exc+ return parsed.isoformat()+++def finite_number(value: Any, label: str) -> float:+ """Convert a JSON/CSV value to a finite float, rejecting booleans."""++ if isinstance(value, bool):+ raise CliError(f"{label} must be numeric, not boolean")+ try:+ result = float(value)+ except (TypeError, ValueError) as exc:+ raise CliError(f"{label} must be numeric") from exc+ if not math.isfinite(result):+ raise CliError(f"{label} must be finite")+ return result+++def read_bounded_text(+ raw_path: str,+ *,+ label: str,+ suffixes: set[str],+ encoding: str = "utf-8",+) -> tuple[Path, str]:+ """Read a bounded regular file without following a final symlink."""++ path = Path(raw_path).expanduser()+ if path.name in {"", ".", ".."}:+ raise CliError(f"{label} must name a file")+ if path.suffix.lower() not in suffixes:+ expected = ", ".join(sorted(suffixes))+ raise CliError(f"{label} must use one of these suffixes: {expected}")+ if path.is_symlink():+ raise CliError(f"refusing to read {label} through a symlink")++ flags = os.O_RDONLY+ if hasattr(os, "O_NOFOLLOW"):+ flags |= os.O_NOFOLLOW+ try:+ descriptor = os.open(path, flags)+ except OSError as exc:+ raise CliError(f"cannot open {label} as a regular file: {path}") from exc++ try:+ metadata = os.fstat(descriptor)+ if not stat.S_ISREG(metadata.st_mode):+ raise CliError(f"{label} is not a regular file: {path}")+ if metadata.st_size > MAX_INPUT_BYTES:+ raise CliError(+ f"{label} is {metadata.st_size} bytes; limit is {MAX_INPUT_BYTES}"+ )+ with os.fdopen(descriptor, "r", encoding=encoding, newline="") as handle:+ descriptor = -1+ return path, handle.read()+ except UnicodeDecodeError as exc:+ raise CliError(f"{label} is not valid {encoding} text") from exc+ finally:+ if descriptor >= 0:+ os.close(descriptor)+++def read_json(raw_path: str, *, label: str = "JSON input") -> tuple[Path, Any]:+ """Read strict, bounded JSON and reject non-standard constants."""++ path, text = read_bounded_text(+ raw_path,+ label=label,+ suffixes={".json"},+ )++ def reject_constant(value: str) -> None:+ raise CliError(f"non-standard JSON constant is not allowed: {value}")++ try:+ return path, json.loads(text, parse_constant=reject_constant)+ except (json.JSONDecodeError, RecursionError) as exc:+ raise CliError(f"invalid JSON in {path}: {exc}") from exc+++def _safe_output_target(raw_path: str, suffix: str) -> Path:+ """Resolve a user-selected output in an existing directory."""++ requested = Path(raw_path).expanduser()+ if requested.name in {"", ".", ".."}:+ raise CliError("output must name a file")+ if requested.suffix.lower() != suffix:+ raise CliError(f"output filename must end in {suffix}")+ if requested.is_symlink():+ raise CliError("refusing to write through an output symlink")+ try:+ parent = requested.parent.resolve(strict=True)+ except FileNotFoundError as exc:+ raise CliError("output parent directory does not exist") from exc+ if not parent.is_dir():+ raise CliError("output parent is not a directory")+ target = parent / requested.name+ if target.is_symlink():+ raise CliError("refusing to replace an output symlink")+ if target.exists() and not target.is_file():+ raise CliError("output exists and is not a regular file")+ return target+++def write_json(+ raw_path: str,+ payload: Any,+ *,+ force: bool = False,+) -> Path:+ """Write deterministic JSON with private permissions and safe overwrite."""++ target = _safe_output_target(raw_path, ".json")+ try:+ text = (+ json.dumps(+ payload,+ allow_nan=False,+ ensure_ascii=False,+ indent=2,+ sort_keys=True,+ )+ + "\n"+ )+ except (TypeError, ValueError, RecursionError) as exc:+ raise CliError(f"payload cannot be serialized as strict JSON: {exc}") from exc++ if not force:+ flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL+ if hasattr(os, "O_NOFOLLOW"):+ flags |= os.O_NOFOLLOW+ descriptor = -1+ created = False+ try:+ descriptor = os.open(target, flags, 0o600)+ created = True+ os.fchmod(descriptor, 0o600)+ with os.fdopen(descriptor, "w", encoding="utf-8", newline="\n") as handle:+ descriptor = -1+ handle.write(text)+ except FileExistsError as exc:+ raise CliError(+ f"output already exists: {target}; pass --force to replace it"+ ) from exc+ except OSError as exc:+ if created:+ target.unlink(missing_ok=True)+ raise CliError(f"could not write output: {target}") from exc+ finally:+ if descriptor >= 0:+ os.close(descriptor)+ return target++ if target.exists() and not target.is_file():+ raise CliError("output exists and is not a regular file")++ descriptor, temporary_name = tempfile.mkstemp(+ prefix=f".{target.name}.",+ suffix=".tmp",+ dir=target.parent,+ )+ temporary = Path(temporary_name)+ try:+ os.fchmod(descriptor, 0o600)+ with os.fdopen(descriptor, "w", encoding="utf-8", newline="\n") as handle:+ descriptor = -1+ handle.write(text)+ if target.is_symlink():+ raise CliError("refusing to replace an output symlink")+ os.replace(temporary, target)+ except OSError as exc:+ raise CliError(f"could not replace output: {target}") from exc+ finally:+ if descriptor >= 0:+ os.close(descriptor)+ temporary.unlink(missing_ok=True)+ return target+++def emit_json(+ payload: Any,+ output: str | None,+ *,+ force: bool = False,+) -> Path | None:+ """Print strict JSON or write it to a safe output path."""++ if output is None:+ print(+ json.dumps(+ payload,+ allow_nan=False,+ ensure_ascii=False,+ indent=2,+ sort_keys=True,+ )+ )+ return None+ return write_json(output, payload, force=force)+++def rounded(value: float) -> float:+ """Return stable display precision without changing the documented formula."""++ return round(value, 6)diff --git a/skills/scientific-brainstorming/scripts/evaluate_matrix.py b/skills/scientific-brainstorming/scripts/evaluate_matrix.pynew file mode 100644index 00000000..5e8d5b44--- /dev/null+++ b/skills/scientific-brainstorming/scripts/evaluate_matrix.py@@ -0,0 +1,518 @@+"""Calculate a transparent weighted idea matrix with sensitivity analysis."""++from __future__ import annotations++import argparse+import csv+import io+import sys+from collections.abc import Mapping, Sequence+from dataclasses import dataclass+from typing import Any++from _common import (+ CliError,+ bounded_float,+ emit_json,+ finite_number,+ read_bounded_text,+ read_json,+ require_identifier,+ require_text,+ rounded,+)++MAX_CRITERIA = 25+MAX_ROWS = 1_000+MAX_COLUMNS = 200+MAX_CSV_FIELD_CHARS = 100_000+++@dataclass(frozen=True)+class Criterion:+ """One explicit criterion in the disclosed additive model."""++ name: str+ description: str+ weight: float+ direction: str+ minimum: float+ maximum: float++ def normalize(self, value: float) -> float:+ """Map a bounded raw score to zero through one."""++ if self.direction == "higher":+ return (value - self.minimum) / (self.maximum - self.minimum)+ return (self.maximum - value) / (self.maximum - self.minimum)+++@dataclass(frozen=True)+class Rating:+ """One central rating and its raw plausible interval."""++ score: float+ low: float+ high: float+++@dataclass(frozen=True)+class IdeaRow:+ """Validated ratings and qualitative context for one idea."""++ idea_id: str+ ratings: Mapping[str, Rating]+ qualitative: Mapping[str, str]+++def load_criteria(raw_path: str) -> list[Criterion]:+ """Load and validate the explicit criteria configuration."""++ _, document = read_json(raw_path, label="criteria configuration")+ if not isinstance(document, dict):+ raise CliError("criteria configuration must be a JSON object")+ if document.get("schema_version") != "1.0":+ raise CliError("criteria configuration schema_version must be '1.0'")+ raw_criteria = document.get("criteria")+ if not isinstance(raw_criteria, list) or not raw_criteria:+ raise CliError("criteria configuration must contain a non-empty list")+ if len(raw_criteria) > MAX_CRITERIA:+ raise CliError(+ f"criteria count is {len(raw_criteria)}; limit is {MAX_CRITERIA}"+ )++ result: list[Criterion] = []+ seen: set[str] = set()+ for index, raw in enumerate(raw_criteria):+ label = f"criteria[{index}]"+ if not isinstance(raw, dict):+ raise CliError(f"{label} must be an object")+ name = require_identifier(raw.get("name"), f"{label}.name")+ if name in seen:+ raise CliError(f"duplicate criterion name: {name}")+ seen.add(name)+ description = require_text(+ raw.get("description"),+ f"{label}.description",+ maximum=500,+ )+ weight = finite_number(raw.get("weight"), f"{label}.weight")+ if weight <= 0 or weight > 1_000_000:+ raise CliError(f"{label}.weight must be greater than 0 and at most 1000000")+ direction = raw.get("direction")+ if direction not in {"higher", "lower"}:+ raise CliError(f"{label}.direction must be 'higher' or 'lower'")+ minimum = finite_number(raw.get("minimum"), f"{label}.minimum")+ maximum = finite_number(raw.get("maximum"), f"{label}.maximum")+ if minimum >= maximum:+ raise CliError(f"{label}.minimum must be less than maximum")+ result.append(+ Criterion(+ name=name,+ description=description,+ weight=weight,+ direction=direction,+ minimum=minimum,+ maximum=maximum,+ )+ )+ return result+++def _parse_bounded_score(+ raw: str | None,+ *,+ label: str,+ criterion: Criterion,+) -> float:+ if raw is None or not raw.strip():+ raise CliError(f"{label} must contain a score")+ score = finite_number(raw, label)+ if not criterion.minimum <= score <= criterion.maximum:+ raise CliError(+ f"{label}={score} is outside [{criterion.minimum}, {criterion.maximum}]"+ )+ return score+++def load_scores(raw_path: str, criteria: Sequence[Criterion]) -> list[IdeaRow]:+ """Load bounded CSV ratings and preserve qualitative columns."""++ _, text = read_bounded_text(+ raw_path,+ label="scores CSV",+ suffixes={".csv"},+ encoding="utf-8-sig",+ )+ csv.field_size_limit(MAX_CSV_FIELD_CHARS)+ reader = csv.DictReader(io.StringIO(text, newline=""))+ fieldnames = reader.fieldnames+ if not fieldnames:+ raise CliError("scores CSV has no header")+ if len(fieldnames) > MAX_COLUMNS:+ raise CliError(f"scores CSV has more than {MAX_COLUMNS} columns")+ if any(name is None or not name.strip() for name in fieldnames):+ raise CliError("scores CSV contains an empty column name")+ if len(set(fieldnames)) != len(fieldnames):+ raise CliError("scores CSV column names must be unique")++ required = {"idea_id", "qualitative_review", "uncertainties"}+ required.update(criterion.name for criterion in criteria)+ missing = sorted(required - set(fieldnames))+ if missing:+ raise CliError(f"scores CSV is missing required columns: {', '.join(missing)}")++ interval_columns: set[str] = set()+ for criterion in criteria:+ low_name = f"{criterion.name}_low"+ high_name = f"{criterion.name}_high"+ has_low = low_name in fieldnames+ has_high = high_name in fieldnames+ if has_low != has_high:+ raise CliError(+ f"uncertainty columns for {criterion.name} must include both "+ f"{low_name} and {high_name}"+ )+ if has_low:+ interval_columns.update({low_name, high_name})++ numeric_columns = {criterion.name for criterion in criteria} | interval_columns+ qualitative_columns = [+ name for name in fieldnames if name not in numeric_columns and name != "idea_id"+ ]++ rows: list[IdeaRow] = []+ seen_ids: set[str] = set()+ for row_index, raw_row in enumerate(reader, start=2):+ if row_index > MAX_ROWS + 1:+ raise CliError(f"scores CSV exceeds the limit of {MAX_ROWS} data rows")+ if None in raw_row:+ raise CliError(f"row {row_index} has more values than header columns")+ idea_id = require_identifier(raw_row.get("idea_id"), f"row {row_index}.idea_id")+ if idea_id in seen_ids:+ raise CliError(f"duplicate idea_id in scores CSV: {idea_id}")+ seen_ids.add(idea_id)++ ratings: dict[str, Rating] = {}+ for criterion in criteria:+ score = _parse_bounded_score(+ raw_row.get(criterion.name),+ label=f"row {row_index}.{criterion.name}",+ criterion=criterion,+ )+ low_name = f"{criterion.name}_low"+ high_name = f"{criterion.name}_high"+ if low_name in interval_columns:+ raw_low = raw_row.get(low_name)+ raw_high = raw_row.get(high_name)+ low_blank = raw_low is None or not raw_low.strip()+ high_blank = raw_high is None or not raw_high.strip()+ if low_blank != high_blank:+ raise CliError(+ f"row {row_index} must provide both {low_name} and "+ f"{high_name}, or leave both blank"+ )+ if low_blank:+ low = high = score+ else:+ low = _parse_bounded_score(+ raw_low,+ label=f"row {row_index}.{low_name}",+ criterion=criterion,+ )+ high = _parse_bounded_score(+ raw_high,+ label=f"row {row_index}.{high_name}",+ criterion=criterion,+ )+ else:+ low = high = score+ if not low <= score <= high:+ raise CliError(+ f"row {row_index}.{criterion.name} requires low <= score <= high"+ )+ ratings[criterion.name] = Rating(score=score, low=low, high=high)++ qualitative: dict[str, str] = {}+ for name in qualitative_columns:+ allow_empty = name not in {"qualitative_review", "uncertainties"}+ qualitative[name] = require_text(+ raw_row.get(name, ""),+ f"row {row_index}.{name}",+ maximum=10_000,+ allow_empty=allow_empty,+ )+ rows.append(+ IdeaRow(+ idea_id=idea_id,+ ratings=ratings,+ qualitative=qualitative,+ )+ )++ if not rows:+ raise CliError("scores CSV must contain at least one data row")+ return rows+++def _normalized_weights(+ criteria: Sequence[Criterion],+ *,+ override: Mapping[str, float] | None = None,+) -> dict[str, float]:+ raw = {+ criterion.name: (+ override[criterion.name] if override is not None else criterion.weight+ )+ for criterion in criteria+ }+ total = sum(raw.values())+ if total <= 0:+ raise CliError("sum of weights must be positive")+ return {name: value / total for name, value in raw.items()}+++def _score(+ row: IdeaRow,+ criteria: Sequence[Criterion],+ weights: Mapping[str, float],+) -> float:+ return 100.0 * sum(+ weights[criterion.name] * criterion.normalize(row.ratings[criterion.name].score)+ for criterion in criteria+ )+++def _ranks(scores: Mapping[str, float]) -> dict[str, int]:+ """Assign deterministic ordinal ranks; lexical idea ID breaks ties."""++ order = sorted(scores, key=lambda idea_id: (-scores[idea_id], idea_id))+ return {idea_id: index + 1 for index, idea_id in enumerate(order)}+++def calculate_matrix(+ criteria: Sequence[Criterion],+ rows: Sequence[IdeaRow],+ *,+ weight_delta: float,+) -> dict[str, Any]:+ """Calculate disclosed scores, intervals, and local weight sensitivity."""++ if not 0 <= weight_delta <= 0.5:+ raise CliError("weight_delta must be between 0 and 0.5")++ base_weights = _normalized_weights(criteria)+ base_scores = {row.idea_id: _score(row, criteria, base_weights) for row in rows}+ base_ranks = _ranks(base_scores)++ scenario_scores: list[dict[str, float]] = []+ scenario_ranks: list[dict[str, int]] = []+ scenario_names: list[str] = []+ if weight_delta > 0:+ for criterion in criteria:+ for sign, factor in (+ ("minus", 1.0 - weight_delta),+ ("plus", 1.0 + weight_delta),+ ):+ raw_weights = {+ item.name: (+ item.weight * factor+ if item.name == criterion.name+ else item.weight+ )+ for item in criteria+ }+ weights = _normalized_weights(criteria, override=raw_weights)+ scores = {row.idea_id: _score(row, criteria, weights) for row in rows}+ scenario_scores.append(scores)+ scenario_ranks.append(_ranks(scores))+ scenario_names.append(f"{criterion.name}:{sign}")++ results: list[dict[str, Any]] = []+ warnings: list[str] = []+ for row in sorted(rows, key=lambda item: item.idea_id):+ interval_low = 0.0+ interval_high = 0.0+ criterion_details: dict[str, Any] = {}+ for criterion in criteria:+ rating = row.ratings[criterion.name]+ normalized_score = criterion.normalize(rating.score)+ if criterion.direction == "higher":+ normalized_low = criterion.normalize(rating.low)+ normalized_high = criterion.normalize(rating.high)+ else:+ normalized_low = criterion.normalize(rating.high)+ normalized_high = criterion.normalize(rating.low)+ weight = base_weights[criterion.name]+ interval_low += 100.0 * weight * normalized_low+ interval_high += 100.0 * weight * normalized_high+ criterion_details[criterion.name] = {+ "raw_score": rating.score,+ "raw_interval": [rating.low, rating.high],+ "normalized_score": rounded(normalized_score),+ "normalized_interval": [+ rounded(normalized_low),+ rounded(normalized_high),+ ],+ "normalized_weight": rounded(weight),+ "contribution_to_score": rounded(100.0 * weight * normalized_score),+ }++ sensitivity_scores = [scores[row.idea_id] for scores in scenario_scores] or [+ base_scores[row.idea_id]+ ]+ sensitivity_ranks = [ranks[row.idea_id] for ranks in scenario_ranks] or [+ base_ranks[row.idea_id]+ ]+ rank_min = min(sensitivity_ranks)+ rank_max = max(sensitivity_ranks)+ if rank_min != rank_max:+ warnings.append(+ f"{row.idea_id} changes rank from {rank_min} to {rank_max} "+ "under one-at-a-time weight perturbations"+ )+ results.append(+ {+ "idea_id": row.idea_id,+ "base_score": rounded(base_scores[row.idea_id]),+ "base_presentation_rank": base_ranks[row.idea_id],+ "input_uncertainty_score_interval": [+ rounded(interval_low),+ rounded(interval_high),+ ],+ "weight_sensitivity_score_range": [+ rounded(min(sensitivity_scores)),+ rounded(max(sensitivity_scores)),+ ],+ "weight_sensitivity_rank_range": [rank_min, rank_max],+ "criteria": criterion_details,+ "qualitative": dict(row.qualitative),+ }+ )++ return {+ "schema_version": "1.0",+ "method": {+ "name": "weighted-additive-normalized-matrix",+ "formula": (+ "score_i = 100 * sum_j(normalized_weight_j * "+ "direction_normalized_rating_ij)"+ ),+ "higher_normalization": "(x - minimum) / (maximum - minimum)",+ "lower_normalization": "(maximum - x) / (maximum - minimum)",+ "supplied_weights": {+ criterion.name: criterion.weight for criterion in criteria+ },+ "normalized_weights": {+ name: rounded(value) for name, value in base_weights.items()+ },+ "criteria": [+ {+ "name": criterion.name,+ "description": criterion.description,+ "direction": criterion.direction,+ "minimum": criterion.minimum,+ "maximum": criterion.maximum,+ }+ for criterion in criteria+ ],+ "weight_sensitivity": {+ "type": "one-at-a-time proportional perturbation",+ "delta": weight_delta,+ "scenario_count": len(scenario_names),+ "scenarios": scenario_names,+ "weights_renormalized_in_each_scenario": True,+ },+ "tie_rule": (+ "Scores are ordered descending for presentation; exact ties are "+ "broken by lexical idea_id. Rank is not a decision."+ ),+ },+ "results": results,+ "warnings": warnings,+ "decision": None,+ "notice": (+ "No idea was selected and no scientific conclusion was made. "+ "Review qualitative reasons, uncertainty, dissent, evidence, and "+ "noncompensatory feasibility/ethics/safety gates."+ ),+ "limitations": [+ (+ "The additive model permits compensation across criteria; keep "+ "hard gates outside the score."+ ),+ (+ "Input intervals are combined as simultaneous criterion-wise "+ "bounds and are not calibrated probability intervals."+ ),+ (+ "Weight sensitivity changes one weight at a time and does not "+ "cover all plausible weights, criterion dependence, scale "+ "uncertainty, or model-form uncertainty."+ ),+ (+ "Ratings and weights are judgments, not empirical measurements "+ "of scientific truth."+ ),+ ],+ }+++def build_parser() -> argparse.ArgumentParser:+ """Create the command-line parser."""++ parser = argparse.ArgumentParser(+ description=(+ "Calculate a disclosed weighted matrix from bounded CSV ratings, "+ "including input intervals and local weight sensitivity. No network, "+ "LLM, or automatic scientific decision is used."+ )+ )+ parser.add_argument("scores", help="Input ratings .csv file")+ parser.add_argument(+ "--config",+ required=True,+ help="Explicit criteria and weights .json file",+ )+ parser.add_argument(+ "--weight-delta",+ type=bounded_float(0.0, 0.5),+ default=0.10,+ help=(+ "Proportional one-at-a-time weight perturbation from 0 through 0.5 "+ "(default: 0.10)"+ ),+ )+ parser.add_argument(+ "--output",+ help="Optional result .json file in an existing directory",+ )+ parser.add_argument(+ "--force",+ action="store_true",+ help="Explicitly replace an existing regular output file",+ )+ return parser+++def main(argv: Sequence[str] | None = None) -> int:+ """Run matrix evaluation."""++ args = build_parser().parse_args(argv)+ try:+ criteria = load_criteria(args.config)+ rows = load_scores(args.scores, criteria)+ result = calculate_matrix(+ criteria,+ rows,+ weight_delta=args.weight_delta,+ )+ emit_json(result, args.output, force=args.force)+ except CliError as exc:+ print(f"error: {exc}", file=sys.stderr)+ return 2+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/skills/scientific-brainstorming/scripts/session_scaffold.py b/skills/scientific-brainstorming/scripts/session_scaffold.pynew file mode 100644index 00000000..6da33f5b--- /dev/null+++ b/skills/scientific-brainstorming/scripts/session_scaffold.py@@ -0,0 +1,248 @@+"""Generate a deterministic JSON scaffold for a brainstorming session."""++from __future__ import annotations++import argparse+import sys+from collections.abc import Sequence+from typing import Any++from _common import (+ CliError,+ bounded_strings,+ emit_json,+ require_identifier,+ require_iso_date,+ require_text,+)++WORKFLOW_STAGES = [+ "scope",+ "independent-generation",+ "structured-sharing",+ "clustering",+ "criteria-definition",+ "independent-evaluation",+ "adversarial-review",+ "literature-check",+ "feasibility-and-ethics-gate",+ "decision-log",+]+++def build_scaffold(+ *,+ session_id: str,+ title: str,+ question: str,+ participant_ids: Sequence[str],+ session_date: str | None = None,+ in_scope: Sequence[str] = (),+ out_of_scope: Sequence[str] = (),+ constraints: Sequence[str] = (),+ perspectives: Sequence[str] = (),+) -> dict[str, Any]:+ """Build a reproducible, empty session register from explicit inputs."""++ clean_session_id = require_identifier(session_id, "session ID")+ clean_title = require_text(title, "title", maximum=200)+ clean_question = require_text(question, "question", maximum=2_000)+ participants = [+ require_identifier(value, f"participant ID {index + 1}")+ for index, value in enumerate(participant_ids)+ ]+ if not participants:+ raise CliError("at least one participant ID is required")+ if len(participants) > 100:+ raise CliError("participant count exceeds the limit of 100")+ if len(set(participants)) != len(participants):+ raise CliError("participant IDs must be unique")++ clean_date = (+ require_iso_date(session_date, "session date")+ if session_date is not None+ else None+ )+ clean_in_scope = bounded_strings(in_scope, "in-scope items")+ clean_out_of_scope = bounded_strings(out_of_scope, "out-of-scope items")+ clean_constraints = bounded_strings(constraints, "constraints")+ clean_perspectives = bounded_strings(perspectives, "perspectives")++ return {+ "schema_version": "1.1",+ "session": {+ "id": clean_session_id,+ "title": clean_title,+ "question": clean_question,+ "date": clean_date,+ "decision_owner_id": None,+ "facilitator_id": None,+ "participant_ids": participants,+ "represented_perspectives": clean_perspectives,+ "missing_perspectives": [],+ "conflicts_or_power_dynamics": [],+ },+ "scope": {+ "in_scope": clean_in_scope,+ "out_of_scope": clean_out_of_scope,+ "constraints": [+ {+ "statement": statement,+ "classification": "unclassified",+ }+ for statement in clean_constraints+ ],+ "prohibited_outputs": [],+ },+ "information_governance": {+ "classification": "not-assessed",+ "approved_record_location": None,+ "contains_personal_or_sensitive_data": False,+ "contains_unpublished_or_proprietary_data": False,+ "contains_controlled_or_security_sensitive_data": False,+ "external_ai_use_permitted": "not-assessed",+ },+ "workflow": [+ {+ "order": index + 1,+ "stage": stage,+ "status": "pending",+ "method_or_deviation": None,+ }+ for index, stage in enumerate(WORKFLOW_STAGES)+ ],+ "ideas": [],+ "assumptions": [],+ "clusters": [],+ "criteria": [],+ "adversarial_reviews": [],+ "literature_checks": [],+ "feasibility_and_ethics_reviews": [],+ "decision_log": [],+ "templates": {+ "idea": {+ "id": "I001",+ "statement": "Replace with a concise candidate direction.",+ "provenance": {+ "origin": "human",+ "contributor_ids": [participants[0]],+ "recorded_stage": "independent",+ "source_refs": [],+ "ai_tool": None,+ },+ "assumption_ids": ["A001"],+ "predicted_observations": [],+ "uncertainties": [],+ "evidence_status": "not-checked",+ "status": "candidate",+ },+ "assumption": {+ "id": "A001",+ "statement": "Replace with one explicit assumption.",+ "category": "measurement",+ "status": "untested",+ "test_or_check": "Describe how this could be checked.",+ "owner_id": participants[0],+ "evidence_refs": [],+ },+ },+ "notices": [+ "Ideas and scores are not evidence or scientific conclusions.",+ (+ "Clinical, ethics, biosafety, dual-use, regulatory, and "+ "institutional review remain separate."+ ),+ (+ "Do not store sensitive prompt content or restricted information "+ "in this register."+ ),+ ],+ }+++def build_parser() -> argparse.ArgumentParser:+ """Create the command-line parser."""++ parser = argparse.ArgumentParser(+ description=(+ "Generate a deterministic JSON session scaffold for evidence-aware "+ "scientific brainstorming. No network or LLM calls are made."+ )+ )+ parser.add_argument("--session-id", required=True, help="Stable session ID")+ parser.add_argument("--title", required=True, help="Session title")+ parser.add_argument("--question", required=True, help="One focal question")+ parser.add_argument(+ "--participant",+ action="append",+ required=True,+ dest="participants",+ help="Pseudonymous participant ID; repeat for multiple participants",+ )+ parser.add_argument(+ "--date",+ dest="session_date",+ help="Optional explicit ISO date (YYYY-MM-DD); no date is invented",+ )+ parser.add_argument(+ "--in-scope",+ action="append",+ default=[],+ help="In-scope item; repeat as needed",+ )+ parser.add_argument(+ "--out-of-scope",+ action="append",+ default=[],+ help="Out-of-scope item; repeat as needed",+ )+ parser.add_argument(+ "--constraint",+ action="append",+ default=[],+ help="Constraint to classify later; repeat as needed",+ )+ parser.add_argument(+ "--perspective",+ action="append",+ default=[],+ help="Represented perspective; repeat as needed",+ )+ parser.add_argument(+ "--output",+ required=True,+ help="Destination .json file in an existing directory",+ )+ parser.add_argument(+ "--force",+ action="store_true",+ help="Explicitly replace an existing regular output file",+ )+ return parser+++def main(argv: Sequence[str] | None = None) -> int:+ """Run the scaffold generator."""++ args = build_parser().parse_args(argv)+ try:+ payload = build_scaffold(+ session_id=args.session_id,+ title=args.title,+ question=args.question,+ participant_ids=args.participants,+ session_date=args.session_date,+ in_scope=args.in_scope,+ out_of_scope=args.out_of_scope,+ constraints=args.constraint,+ perspectives=args.perspective,+ )+ emit_json(payload, args.output, force=args.force)+ except CliError as exc:+ print(f"error: {exc}", file=sys.stderr)+ return 2+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/skills/scientific-brainstorming/scripts/validate_register.py b/skills/scientific-brainstorming/scripts/validate_register.pynew file mode 100644index 00000000..b166d475--- /dev/null+++ b/skills/scientific-brainstorming/scripts/validate_register.py@@ -0,0 +1,654 @@+"""Validate brainstorming idea and assumption registers structurally."""++from __future__ import annotations++import argparse+import re+import sys+import unicodedata+from collections import defaultdict+from collections.abc import Sequence+from typing import Any++from _common import (+ MAX_ITEMS,+ CliError,+ emit_json,+ read_json,+ require_identifier,+ require_iso_date,+ require_text,+)++ORIGINS = {"human", "ai-assisted", "literature-inspired", "mixed", "other"}+RECORDED_STAGES = {"independent", "discussion", "post-check"}+EVIDENCE_STATUSES = {+ "not-checked",+ "search-incomplete",+ "support-located",+ "challenge-located",+ "mixed",+ "no-direct-evidence-located",+}+IDEA_STATUSES = {+ "candidate",+ "revised",+ "deferred",+ "paused",+ "stopped",+ "advanced-to-review",+}+ASSUMPTION_CATEGORIES = {+ "causal",+ "mechanistic",+ "measurement",+ "sampling",+ "operational",+ "statistical",+ "feasibility",+ "ethical",+ "value",+ "other",+}+ASSUMPTION_STATUSES = {+ "untested",+ "partially-supported",+ "challenged",+ "refuted",+ "not-applicable",+}+++def _issue(path: str, message: str) -> dict[str, str]:+ return {"path": path, "message": message}+++def _normalized_statement(value: str) -> str:+ """Normalize only exact text features; this is not semantic matching."""++ normalized = unicodedata.normalize("NFKC", value).casefold()+ return re.sub(r"\s+", " ", normalized).strip()+++def _list_field(+ record: dict[str, Any],+ field: str,+ path: str,+ errors: list[dict[str, str]],+ *,+ required: bool = True,+) -> list[Any]:+ value = record.get(field)+ if value is None and not required:+ return []+ if not isinstance(value, list):+ errors.append(_issue(f"{path}.{field}", "must be a list"))+ return []+ if len(value) > MAX_ITEMS:+ errors.append(+ _issue(+ f"{path}.{field}",+ f"has {len(value)} items; limit is {MAX_ITEMS}",+ )+ )+ return value[:MAX_ITEMS]+ return value+++def _check_text(+ value: Any,+ path: str,+ errors: list[dict[str, str]],+ *,+ maximum: int = 10_000,+ allow_empty: bool = False,+) -> str | None:+ try:+ return require_text(+ value,+ path,+ maximum=maximum,+ allow_empty=allow_empty,+ )+ except CliError as exc:+ errors.append(_issue(path, str(exc)))+ return None+++def _check_id(+ value: Any,+ path: str,+ errors: list[dict[str, str]],+) -> str | None:+ try:+ return require_identifier(value, path)+ except CliError as exc:+ errors.append(_issue(path, str(exc)))+ return None+++def _check_string_list(+ values: list[Any],+ path: str,+ errors: list[dict[str, str]],+ *,+ identifiers: bool = False,+) -> list[str]:+ result: list[str] = []+ for index, value in enumerate(values):+ item_path = f"{path}[{index}]"+ checked = (+ _check_id(value, item_path, errors)+ if identifiers+ else _check_text(value, item_path, errors, maximum=2_000)+ )+ if checked is not None:+ result.append(checked)+ return result+++def validate_register(document: Any) -> dict[str, Any]:+ """Return a deterministic structural validation report."""++ errors: list[dict[str, str]] = []+ warnings: list[dict[str, str]] = []++ if not isinstance(document, dict):+ return {+ "valid": False,+ "errors": [_issue("$", "top-level JSON value must be an object")],+ "warnings": [],+ "statistics": {},+ "limitations": [+ (+ "Structural validation cannot establish truth, novelty, "+ "feasibility, ethics approval, or scientific validity."+ )+ ],+ }++ schema_version = document.get("schema_version")+ if schema_version != "1.1":+ warnings.append(+ _issue(+ "$.schema_version",+ "expected schema version '1.1'; unknown fields are not rejected",+ )+ )++ session = document.get("session")+ participant_ids: set[str] = set()+ if not isinstance(session, dict):+ errors.append(_issue("$.session", "must be an object"))+ else:+ _check_id(session.get("id"), "$.session.id", errors)+ _check_text(session.get("title"), "$.session.title", errors, maximum=200)+ _check_text(+ session.get("question"),+ "$.session.question",+ errors,+ maximum=2_000,+ )+ raw_participants = _list_field(+ session,+ "participant_ids",+ "$.session",+ errors,+ )+ participant_list = _check_string_list(+ raw_participants,+ "$.session.participant_ids",+ errors,+ identifiers=True,+ )+ if not participant_list:+ errors.append(+ _issue(+ "$.session.participant_ids",+ "must contain at least one participant ID",+ )+ )+ if len(set(participant_list)) != len(participant_list):+ errors.append(+ _issue("$.session.participant_ids", "participant IDs must be unique")+ )+ participant_ids = set(participant_list)+ if session.get("date") is not None:+ try:+ require_iso_date(session["date"], "$.session.date")+ except CliError as exc:+ errors.append(_issue("$.session.date", str(exc)))++ assumptions_raw = document.get("assumptions")+ if not isinstance(assumptions_raw, list):+ errors.append(_issue("$.assumptions", "must be a list"))+ assumptions_raw = []+ elif len(assumptions_raw) > MAX_ITEMS:+ errors.append(+ _issue(+ "$.assumptions",+ f"has {len(assumptions_raw)} items; limit is {MAX_ITEMS}",+ )+ )+ assumptions_raw = assumptions_raw[:MAX_ITEMS]++ assumption_ids: set[str] = set()+ assumption_references: set[str] = set()+ for index, assumption in enumerate(assumptions_raw):+ path = f"$.assumptions[{index}]"+ if not isinstance(assumption, dict):+ errors.append(_issue(path, "must be an object"))+ continue+ assumption_id = _check_id(assumption.get("id"), f"{path}.id", errors)+ if assumption_id is not None:+ if assumption_id in assumption_ids:+ errors.append(_issue(f"{path}.id", "duplicate assumption ID"))+ assumption_ids.add(assumption_id)+ _check_text(assumption.get("statement"), f"{path}.statement", errors)+ category = assumption.get("category")+ if category not in ASSUMPTION_CATEGORIES:+ errors.append(+ _issue(+ f"{path}.category",+ f"must be one of {sorted(ASSUMPTION_CATEGORIES)}",+ )+ )+ status = assumption.get("status")+ if status not in ASSUMPTION_STATUSES:+ errors.append(+ _issue(+ f"{path}.status",+ f"must be one of {sorted(ASSUMPTION_STATUSES)}",+ )+ )+ _check_text(+ assumption.get("test_or_check"),+ f"{path}.test_or_check",+ errors,+ maximum=2_000,+ )+ owner = _check_id(assumption.get("owner_id"), f"{path}.owner_id", errors)+ if owner is not None and participant_ids and owner not in participant_ids:+ errors.append(_issue(f"{path}.owner_id", "is not listed as a participant"))+ evidence_refs = _list_field(+ assumption,+ "evidence_refs",+ path,+ errors,+ )+ clean_evidence_refs = _check_string_list(+ evidence_refs,+ f"{path}.evidence_refs",+ errors,+ )+ if (+ status not in {None, "untested", "not-applicable"}+ and not clean_evidence_refs+ ):+ warnings.append(+ _issue(+ f"{path}.evidence_refs",+ "non-untested status has no recorded evidence reference",+ )+ )++ ideas_raw = document.get("ideas")+ if not isinstance(ideas_raw, list):+ errors.append(_issue("$.ideas", "must be a list"))+ ideas_raw = []+ elif len(ideas_raw) > MAX_ITEMS:+ errors.append(+ _issue(+ "$.ideas",+ f"has {len(ideas_raw)} items; limit is {MAX_ITEMS}",+ )+ )+ ideas_raw = ideas_raw[:MAX_ITEMS]++ idea_ids: set[str] = set()+ statements: defaultdict[str, list[str]] = defaultdict(list)+ ai_assisted_count = 0+ for index, idea in enumerate(ideas_raw):+ path = f"$.ideas[{index}]"+ if not isinstance(idea, dict):+ errors.append(_issue(path, "must be an object"))+ continue+ idea_id = _check_id(idea.get("id"), f"{path}.id", errors)+ if idea_id is not None:+ if idea_id in idea_ids:+ errors.append(_issue(f"{path}.id", "duplicate idea ID"))+ idea_ids.add(idea_id)+ statement = _check_text(idea.get("statement"), f"{path}.statement", errors)+ if statement is not None and idea_id is not None:+ statements[_normalized_statement(statement)].append(idea_id)++ provenance = idea.get("provenance")+ if not isinstance(provenance, dict):+ errors.append(_issue(f"{path}.provenance", "must be an object"))+ provenance = {}+ origin = provenance.get("origin")+ if origin not in ORIGINS:+ errors.append(+ _issue(+ f"{path}.provenance.origin",+ f"must be one of {sorted(ORIGINS)}",+ )+ )+ if origin in {"ai-assisted", "mixed"}:+ ai_assisted_count += 1+ stage = provenance.get("recorded_stage")+ if stage not in RECORDED_STAGES:+ errors.append(+ _issue(+ f"{path}.provenance.recorded_stage",+ f"must be one of {sorted(RECORDED_STAGES)}",+ )+ )+ contributors_raw = _list_field(+ provenance,+ "contributor_ids",+ f"{path}.provenance",+ errors,+ )+ contributors = _check_string_list(+ contributors_raw,+ f"{path}.provenance.contributor_ids",+ errors,+ identifiers=True,+ )+ if not contributors:+ errors.append(+ _issue(+ f"{path}.provenance.contributor_ids",+ "must contain at least one contributor ID",+ )+ )+ for contributor in contributors:+ if participant_ids and contributor not in participant_ids:+ errors.append(+ _issue(+ f"{path}.provenance.contributor_ids",+ f"{contributor!r} is not listed as a participant",+ )+ )+ source_refs_raw = _list_field(+ provenance,+ "source_refs",+ f"{path}.provenance",+ errors,+ )+ source_refs = _check_string_list(+ source_refs_raw,+ f"{path}.provenance.source_refs",+ errors,+ )+ ai_tool = provenance.get("ai_tool")+ if origin in {"ai-assisted", "mixed"}:+ _check_text(+ ai_tool,+ f"{path}.provenance.ai_tool",+ errors,+ maximum=500,+ )+ elif ai_tool is not None and ai_tool != "":+ warnings.append(+ _issue(+ f"{path}.provenance.ai_tool",+ "AI tool is recorded but origin is not AI-assisted or mixed",+ )+ )+ if origin == "literature-inspired" and not source_refs:+ errors.append(+ _issue(+ f"{path}.provenance.source_refs",+ "literature-inspired ideas require at least one source reference",+ )+ )++ linked_assumptions_raw = _list_field(+ idea,+ "assumption_ids",+ path,+ errors,+ )+ linked_assumptions = _check_string_list(+ linked_assumptions_raw,+ f"{path}.assumption_ids",+ errors,+ identifiers=True,+ )+ assumption_references.update(linked_assumptions)+ if not linked_assumptions:+ warnings.append(+ _issue(+ f"{path}.assumption_ids",+ "idea has no explicit linked assumptions",+ )+ )++ predictions_raw = _list_field(+ idea,+ "predicted_observations",+ path,+ errors,+ )+ _check_string_list(+ predictions_raw,+ f"{path}.predicted_observations",+ errors,+ )+ uncertainties_raw = _list_field(+ idea,+ "uncertainties",+ path,+ errors,+ )+ uncertainties = _check_string_list(+ uncertainties_raw,+ f"{path}.uncertainties",+ errors,+ )+ if not uncertainties:+ warnings.append(+ _issue(+ f"{path}.uncertainties",+ "idea has no recorded uncertainty",+ )+ )+ evidence_status = idea.get("evidence_status")+ if evidence_status not in EVIDENCE_STATUSES:+ errors.append(+ _issue(+ f"{path}.evidence_status",+ f"must be one of {sorted(EVIDENCE_STATUSES)}",+ )+ )+ status = idea.get("status")+ if status not in IDEA_STATUSES:+ errors.append(+ _issue(+ f"{path}.status",+ f"must be one of {sorted(IDEA_STATUSES)}",+ )+ )++ for normalized, duplicate_ids in sorted(statements.items()):+ if normalized and len(duplicate_ids) > 1:+ warnings.append(+ _issue(+ "$.ideas",+ "exact-after-case/whitespace/Unicode normalization duplicate "+ f"text for IDs {sorted(duplicate_ids)}; this is not a claim "+ "of semantic equivalence",+ )+ )++ for missing_id in sorted(assumption_references - assumption_ids):+ errors.append(+ _issue(+ "$.ideas[*].assumption_ids",+ f"references missing assumption ID {missing_id!r}",+ )+ )+ for unlinked_id in sorted(assumption_ids - assumption_references):+ warnings.append(+ _issue(+ "$.assumptions",+ f"assumption {unlinked_id!r} is not linked from any idea",+ )+ )++ clusters = document.get("clusters", [])+ if not isinstance(clusters, list):+ errors.append(_issue("$.clusters", "must be a list when present"))+ elif len(clusters) > MAX_ITEMS:+ errors.append(_issue("$.clusters", f"limit is {MAX_ITEMS}"))+ else:+ cluster_ids: set[str] = set()+ for index, cluster in enumerate(clusters):+ path = f"$.clusters[{index}]"+ if not isinstance(cluster, dict):+ errors.append(_issue(path, "must be an object"))+ continue+ cluster_id = _check_id(cluster.get("id"), f"{path}.id", errors)+ if cluster_id is not None:+ if cluster_id in cluster_ids:+ errors.append(_issue(f"{path}.id", "duplicate cluster ID"))+ cluster_ids.add(cluster_id)+ _check_text(cluster.get("relation"), f"{path}.relation", errors)+ members = _check_string_list(+ _list_field(cluster, "idea_ids", path, errors),+ f"{path}.idea_ids",+ errors,+ identifiers=True,+ )+ for member in members:+ if member not in idea_ids:+ errors.append(+ _issue(+ f"{path}.idea_ids",+ f"references missing idea ID {member!r}",+ )+ )++ decisions = document.get("decision_log", [])+ if not isinstance(decisions, list):+ errors.append(_issue("$.decision_log", "must be a list when present"))+ elif len(decisions) > MAX_ITEMS:+ errors.append(_issue("$.decision_log", f"limit is {MAX_ITEMS}"))+ else:+ decision_ids: set[str] = set()+ for index, decision in enumerate(decisions):+ path = f"$.decision_log[{index}]"+ if not isinstance(decision, dict):+ errors.append(_issue(path, "must be an object"))+ continue+ decision_id = _check_id(+ decision.get("decision_id"), f"{path}.decision_id", errors+ )+ if decision_id is not None:+ if decision_id in decision_ids:+ errors.append(+ _issue(f"{path}.decision_id", "duplicate decision ID")+ )+ decision_ids.add(decision_id)+ if decision.get("date") is not None:+ try:+ require_iso_date(decision["date"], f"{path}.date")+ except CliError as exc:+ errors.append(_issue(f"{path}.date", str(exc)))+ candidates = _check_string_list(+ _list_field(decision, "candidate_ids", path, errors),+ f"{path}.candidate_ids",+ errors,+ identifiers=True,+ )+ for candidate in candidates:+ if candidate not in idea_ids:+ errors.append(+ _issue(+ f"{path}.candidate_ids",+ f"references missing idea ID {candidate!r}",+ )+ )+ _check_text(decision.get("decision"), f"{path}.decision", errors)+ _check_text(+ decision.get("rationale"),+ f"{path}.rationale",+ errors,+ )++ return {+ "valid": not errors,+ "errors": errors,+ "warnings": warnings,+ "statistics": {+ "participants": len(participant_ids),+ "ideas": len(ideas_raw),+ "assumptions": len(assumptions_raw),+ "ai_assisted_or_mixed_ideas": ai_assisted_count,+ "errors": len(errors),+ "warnings": len(warnings),+ },+ "limitations": [+ (+ "Validation is structural and deterministic; it does not verify "+ "claims, citations, novelty, feasibility, or scientific validity."+ ),+ (+ "Exact normalized-text duplicate warnings do not assert semantic "+ "equivalence."+ ),+ (+ "A valid register is not ethics, biosafety, regulatory, clinical, "+ "or institutional approval."+ ),+ ],+ }+++def build_parser() -> argparse.ArgumentParser:+ """Create the command-line parser."""++ parser = argparse.ArgumentParser(+ description=(+ "Validate the structure, provenance, links, and bounded fields in a "+ "brainstorming JSON register. No network or LLM calls are made."+ )+ )+ parser.add_argument("input", help="Session/register .json file")+ parser.add_argument(+ "--output",+ help="Optional validation-report .json file in an existing directory",+ )+ parser.add_argument(+ "--strict",+ action="store_true",+ help="Return exit status 1 for warnings as well as errors",+ )+ parser.add_argument(+ "--force",+ action="store_true",+ help="Explicitly replace an existing regular output file",+ )+ return parser+++def main(argv: Sequence[str] | None = None) -> int:+ """Run register validation."""++ args = build_parser().parse_args(argv)+ try:+ _, document = read_json(args.input, label="register")+ report = validate_register(document)+ emit_json(report, args.output, force=args.force)+ except CliError as exc:+ print(f"error: {exc}", file=sys.stderr)+ return 2+ if not report["valid"] or (args.strict and report["warnings"]):+ return 1+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/skills/scientific-brainstorming/tests/test_scripts.py b/skills/scientific-brainstorming/tests/test_scripts.pynew file mode 100644index 00000000..d71d61f8--- /dev/null+++ b/skills/scientific-brainstorming/tests/test_scripts.py@@ -0,0 +1,278 @@+"""Synthetic tests for the standard-library scientific brainstorming CLIs."""++from __future__ import annotations++import json+import stat+import sys+import tempfile+import unittest+from pathlib import Path++SKILL_ROOT = Path(__file__).resolve().parents[1]+SCRIPTS = SKILL_ROOT / "scripts"+sys.path.insert(0, str(SCRIPTS))++import evaluate_matrix+import session_scaffold+import validate_register+from _common import MAX_INPUT_BYTES, CliError, read_json, write_json+++def populated_register() -> dict:+ """Return a small valid synthetic register."""++ document = session_scaffold.build_scaffold(+ session_id="test-session",+ title="Synthetic session",+ question="Which synthetic mechanism should be checked?",+ participant_ids=["P01", "P02"],+ session_date="2026-07-23",+ )+ document["assumptions"] = [+ {+ "id": "A001",+ "statement": "The synthetic measurement reflects the construct.",+ "category": "measurement",+ "status": "untested",+ "test_or_check": "Compare with an orthogonal synthetic measure.",+ "owner_id": "P01",+ "evidence_refs": [],+ }+ ]+ document["ideas"] = [+ {+ "id": "I001",+ "statement": "Test a synthetic alternative mechanism.",+ "provenance": {+ "origin": "human",+ "contributor_ids": ["P01"],+ "recorded_stage": "independent",+ "source_refs": [],+ "ai_tool": None,+ },+ "assumption_ids": ["A001"],+ "predicted_observations": ["The synthetic signal changes direction."],+ "uncertainties": ["Synthetic measurement error is unknown."],+ "evidence_status": "not-checked",+ "status": "candidate",+ }+ ]+ return document+++class ScaffoldTests(unittest.TestCase):+ def test_scaffold_is_deterministic_and_has_required_order(self):+ first = session_scaffold.build_scaffold(+ session_id="session-1",+ title="Title",+ question="Question?",+ participant_ids=["P01", "P02"],+ session_date="2026-07-23",+ constraints=["Budget is bounded"],+ )+ second = session_scaffold.build_scaffold(+ session_id="session-1",+ title="Title",+ question="Question?",+ participant_ids=["P01", "P02"],+ session_date="2026-07-23",+ constraints=["Budget is bounded"],+ )+ self.assertEqual(first, second)+ self.assertEqual(first["session"]["date"], "2026-07-23")+ stages = [entry["stage"] for entry in first["workflow"]]+ self.assertLess(+ stages.index("independent-generation"),+ stages.index("structured-sharing"),+ )+ self.assertEqual(first["ideas"], [])+ self.assertEqual(first["decision_log"], [])++ def test_scaffold_rejects_duplicate_participant_ids(self):+ with self.assertRaises(CliError):+ session_scaffold.build_scaffold(+ session_id="session-1",+ title="Title",+ question="Question?",+ participant_ids=["P01", "P01"],+ )+++class SafeOutputTests(unittest.TestCase):+ def test_private_json_output_refuses_implicit_overwrite(self):+ with tempfile.TemporaryDirectory() as directory:+ output = Path(directory) / "output.json"+ write_json(str(output), {"ok": True})+ self.assertEqual(json.loads(output.read_text()), {"ok": True})+ self.assertEqual(stat.S_IMODE(output.stat().st_mode), 0o600)+ with self.assertRaises(CliError):+ write_json(str(output), {"ok": False})+ write_json(str(output), {"ok": False}, force=True)+ self.assertEqual(json.loads(output.read_text()), {"ok": False})++ def test_output_symlink_is_rejected(self):+ with tempfile.TemporaryDirectory() as directory:+ root = Path(directory)+ real = root / "real.json"+ real.write_text("{}")+ link = root / "link.json"+ try:+ link.symlink_to(real)+ except OSError:+ self.skipTest("symlinks unavailable")+ with self.assertRaises(CliError):+ write_json(str(link), {"ok": True}, force=True)+++class SafeInputTests(unittest.TestCase):+ def test_json_input_symlink_is_rejected(self):+ with tempfile.TemporaryDirectory() as directory:+ root = Path(directory)+ real = root / "real.json"+ real.write_text("{}")+ link = root / "link.json"+ try:+ link.symlink_to(real)+ except OSError:+ self.skipTest("symlinks unavailable")+ with self.assertRaises(CliError):+ read_json(str(link))++ def test_oversized_input_is_rejected_before_parsing(self):+ with tempfile.TemporaryDirectory() as directory:+ oversized = Path(directory) / "oversized.json"+ oversized.write_bytes(b" " * (MAX_INPUT_BYTES + 1))+ with self.assertRaises(CliError):+ read_json(str(oversized))+++class RegisterValidationTests(unittest.TestCase):+ def test_valid_register_passes_without_warnings(self):+ report = validate_register.validate_register(populated_register())+ self.assertTrue(report["valid"])+ self.assertEqual(report["errors"], [])+ self.assertEqual(report["warnings"], [])+ self.assertEqual(report["statistics"]["ideas"], 1)++ def test_missing_ai_provenance_and_assumption_are_errors(self):+ document = populated_register()+ idea = document["ideas"][0]+ idea["provenance"]["origin"] = "ai-assisted"+ idea["provenance"]["ai_tool"] = None+ idea["assumption_ids"] = ["A999"]+ report = validate_register.validate_register(document)+ self.assertFalse(report["valid"])+ messages = " ".join(item["message"] for item in report["errors"])+ self.assertIn("must be a string", messages)+ self.assertIn("missing assumption ID", messages)++ def test_duplicate_warning_disclaims_semantic_equivalence(self):+ document = populated_register()+ duplicate = json.loads(json.dumps(document["ideas"][0]))+ duplicate["id"] = "I002"+ duplicate["statement"] = " TEST a synthetic alternative mechanism. "+ duplicate["provenance"]["contributor_ids"] = ["P02"]+ document["ideas"].append(duplicate)+ report = validate_register.validate_register(document)+ self.assertTrue(report["valid"])+ messages = " ".join(item["message"] for item in report["warnings"])+ self.assertIn("not a claim of semantic equivalence", messages)+++class MatrixTests(unittest.TestCase):+ def _write_inputs(self, root: Path) -> tuple[Path, Path]:+ config = root / "criteria.json"+ config.write_text(+ json.dumps(+ {+ "schema_version": "1.0",+ "criteria": [+ {+ "name": "information_gain",+ "description": "Synthetic discriminating value",+ "weight": 3,+ "direction": "higher",+ "minimum": 1,+ "maximum": 5,+ },+ {+ "name": "burden",+ "description": "Synthetic resource burden",+ "weight": 2,+ "direction": "lower",+ "minimum": 1,+ "maximum": 5,+ },+ ],+ }+ ),+ encoding="utf-8",+ )+ scores = root / "scores.csv"+ scores.write_text(+ "idea_id,information_gain,information_gain_low,"+ "information_gain_high,burden,burden_low,burden_high,"+ "qualitative_review,uncertainties,evidence_status\n"+ "I001,5,4,5,5,4,5,High information gain,High burden,"+ "search-incomplete\n"+ "I002,1,1,2,1,1,2,Low information gain,Transfer unknown,mixed\n",+ encoding="utf-8",+ )+ return config, scores++ def test_matrix_discloses_formula_context_and_no_decision(self):+ with tempfile.TemporaryDirectory() as directory:+ config, scores = self._write_inputs(Path(directory))+ criteria = evaluate_matrix.load_criteria(str(config))+ rows = evaluate_matrix.load_scores(str(scores), criteria)+ result = evaluate_matrix.calculate_matrix(+ criteria,+ rows,+ weight_delta=0.5,+ )+ by_id = {item["idea_id"]: item for item in result["results"]}+ self.assertAlmostEqual(by_id["I001"]["base_score"], 60.0)+ self.assertAlmostEqual(by_id["I002"]["base_score"], 40.0)+ self.assertEqual(+ by_id["I001"]["qualitative"]["qualitative_review"],+ "High information gain",+ )+ self.assertEqual(result["decision"], None)+ self.assertIn("No idea was selected", result["notice"])+ self.assertIn("formula", result["method"])+ self.assertNotEqual(+ by_id["I001"]["weight_sensitivity_rank_range"][0],+ by_id["I001"]["weight_sensitivity_rank_range"][1],+ )++ def test_matrix_preserves_input_uncertainty_interval(self):+ with tempfile.TemporaryDirectory() as directory:+ config, scores = self._write_inputs(Path(directory))+ criteria = evaluate_matrix.load_criteria(str(config))+ rows = evaluate_matrix.load_scores(str(scores), criteria)+ result = evaluate_matrix.calculate_matrix(+ criteria,+ rows,+ weight_delta=0.1,+ )+ first = {item["idea_id"]: item for item in result["results"]}["I001"]+ low, high = first["input_uncertainty_score_interval"]+ self.assertLess(low, first["base_score"])+ self.assertLessEqual(first["base_score"], high)++ def test_matrix_rejects_out_of_range_score(self):+ with tempfile.TemporaryDirectory() as directory:+ root = Path(directory)+ config, scores = self._write_inputs(root)+ scores.write_text(+ scores.read_text().replace("I001,5,4,5", "I001,9,4,5"),+ encoding="utf-8",+ )+ criteria = evaluate_matrix.load_criteria(str(config))+ with self.assertRaises(CliError):+ evaluate_matrix.load_scores(str(scores), criteria)+++if __name__ == "__main__":+ unittest.main()