You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dce7c55
Browse filesBrowse the repository at this point in the historyBrowse files
- add Just the Docs callouts for warnings, tips, examples, checks, and takeaways
- revise chapters, appendices, and prompt templates to emphasize sanitized prompts, synthetic fixtures, code/data separation, and approved real-data environments
- update citation formatting and reference-audit guidance for stable source-key anchors
Copy file name to clipboardExpand all lines: .codex/agents/reference-auditor.toml
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,12 @@ You are a reference and citation auditor for a practical textbook on GenAI-assis
10
10
Your job is to validate references and citation alignment. Do not edit files directly unless the parent explicitly asks for patch-ready changes. Prefer a concise audit memo with evidence.
11
11
12
12
Audit scope:
13
-
- Parse docs/References.md for reference ids, titles, source names, access dates, and URLs.
14
-
- Parse chapters/, docs/, docs/templates/, and scripts/ docs for citations to References.md#refN.
15
-
- Check that every cited ref id exists and that every reference anchor is well-formed.
13
+
- Parse docs/References.md for stable source-key anchors, display numbers, titles, source names, access dates, and URLs.
14
+
- Treat reference list numbers as display-only. Inbound citations should target stable source-key anchors such as References.md#nice-ng246-bmi, not numeric refN anchors.
15
+
- Parse chapters/, docs/, docs/templates/, and scripts/ docs for citations to References.md#source-key.
16
+
- Check that every cited source key exists and that every reference anchor is unique and well-formed.
17
+
- Distinguish citation links from ordinary navigation/prose links. Citation links point to docs/References.md anchors; navigation links point to chapters, templates, scripts, or other pages.
18
+
- For citation display style, prefer visible bracketed citations such as [[Source label](../docs/References.md#source-key)] so citations stand apart from surrounding prose. Do not require this style for ordinary navigation links, links inside docs/References.md source entries, or links inside fenced copy/paste prompt bodies unless the parent task explicitly asks for template style cleanup.
16
19
- Identify unused references, duplicate references, weak sources, stale sources, and sources that should be replaced by primary sources.
17
20
- Verify that reference URLs still resolve. Record status, redirects, canonical replacement URLs, and access date.
18
21
- Compare the claim surrounding each citation against the cited source content. Classify each claim as supported, partially supported, unsupported, stale/changed, or unverifiable.
@@ -26,10 +29,10 @@ Source rules:
26
29
27
30
Output format:
28
31
- Start with a high-level risk summary.
29
-
- Include a table with: file:line, citation/ref id, claim summary, source URL, link status, support status, severity, recommended action.
32
+
- Include a table with: file:line, citation/source key, claim summary, source URL, link status, support status, severity, recommended action.
30
33
- Separate link-rot issues from claim-support issues.
34
+
- List citation-style issues separately from source-validity issues, and treat inconsistent display style as low severity unless it obscures evidence boundaries.
31
35
- List duplicate or low-quality references that should be consolidated or replaced.
32
36
- Suggest exact replacement references when a source is missing, weak, or stale.
33
37
- Recommend whether a content-editor or deep-research-content-updater should implement follow-up changes.
Copy file name to clipboardExpand all lines: chapters/Chapter01_PlanAndContext.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,24 +24,32 @@ flowchart TB
24
24
25
25
The initial stage involves **defining the goal and scope** of your endeavor. This means articulating precisely what you aim to accomplish with the assistance of an LLM. For instance, in the context of our running example, the overarching goal is harmonizing BMI data from EHRs. This broad objective can be broken down into more specific aims, such as cleaning the raw data, creating a summary of BMI categories, or automating a particular data transformation process. A well-defined goal provides a clear direction for subsequent steps, including how you will prompt the LLM and how you will evaluate its output.
26
26
27
-
Next, it is vital to have a comprehensive **understanding of the context**. This includes noting the specific characteristics of your data, such as its format (e.g., tab-delimited, CSV), the variables it contains (e.g., `person_id`, `encounter_id`, `bmi`, `height_cm`, `weight_kg`, `measurement_date`), and any domain-specific considerations that might be relevant. In our BMI harmonization example, understanding that the data comes from EHRs implies the need to consider medical standards for BMI categories and potential data quality issues inherent in clinical data. This contextual awareness is critical for tailoring your prompts to the LLM and ensuring that its responses are aligned with the specific requirements of your research domain.
27
+
Next, it is vital to have a comprehensive **understanding of the context**. This includes noting the specific characteristics of your data, such as its format (e.g., tab-delimited, CSV), the variables it contains (e.g., `person_id`, `encounter_id`, `bmi`, `height_cm`, `weight_kg`, `measurement_date`), and any domain-specific considerations that might be relevant. In our BMI harmonization example, understanding that the data comes from EHRs implies the need to consider medical standards for BMI categories and potential data quality issues inherent in clinical data. Record this context in your local project plan, but only share sanitized schema, methods, and synthetic examples with an LLM.
28
28
29
29
Once the goal and context are clear, the next logical step is to **plan the sub-tasks**. Complex problems are often more manageable when broken down into smaller, actionable steps. For our BMI harmonization project, this might involve sub-tasks such as reading the EHR file, cleaning and filtering the data to remove errors or inconsistencies, selecting a single representative BMI measurement for each person, categorizing the BMI values into meaningful groups (e.g., underweight, normal, overweight, obese), and finally, outputting the processed data and any summary statistics. Planning these sub-tasks provides a structured roadmap for both you and the LLM, making the overall project seem less daunting and easier to execute.
30
30
31
31
Finally, before you even begin to prompt an LLM, it is essential to **set success criteria**. This involves determining what the final deliverables should be and how you will validate whether your solution is successful. In our BMI example, success might be defined by the creation of a clean dataset containing one representative BMI per person, a summary table showing the distribution of individuals across different BMI categories, and a data dictionary that clearly explains the contents of the cleaned dataset. Establishing these criteria upfront allows for an objective evaluation of the LLM's contribution and the overall outcome of your workflow.
32
32
33
-
For modern coding agents, success criteria should also include **executable verification**. Instead of only writing "the script should clean BMI data," specify what evidence would convince you that the script works: a smoke test on synthetic EHR records, `testthat` unit tests for BMI boundary cases, an expected output schema, and the exact commands the agent should run before it claims completion. Current agent guidance from multiple vendors emphasizes giving agents concrete verification steps and asking for command output or other evidence, not just a verbal assertion that the work is done [GitHub Copilot agent best practices](../docs/References.md#github-copilot-agent-best-practices), [Claude Code best practices](../docs/References.md#claude-code-best-practices).
33
+
For modern coding agents, success criteria should also include **executable verification**. Instead of only writing "the script should clean BMI data," specify what evidence would convince you that the script works: a smoke test on synthetic EHR records, `testthat` unit tests for BMI boundary cases, an expected output schema, and the exact commands the agent should run before it claims completion. Current agent guidance from multiple vendors emphasizes giving agents concrete verification steps and asking for command output or other evidence, not just a verbal assertion that the work is done [[GitHub Copilot agent best practices](../docs/References.md#github-copilot-agent-best-practices)], [[Claude Code best practices](../docs/References.md#claude-code-best-practices)].
34
34
35
-
This planning stage is also where you should define **data and tool boundaries**. For clinical, EHR, or genomic work, decide what the LLM or coding agent is allowed to see before any prompt is written:
35
+
{: .takeaway }
36
+
> A useful project plan tells the LLM what to build, what context matters, and how you will prove the result works.
36
37
37
-
- Do not paste PHI, direct identifiers, credentials, private access tokens, or controlled-access genomic data into public tools.
38
-
- Use synthetic, simulated, or approved de-identified examples when demonstrating the workflow.
38
+
This planning stage is also where you should define **data and tool boundaries**. For clinical, EHR, genomic, or other sensitive work, decide what the LLM or coding agent is allowed to see before any prompt is written:
39
+
40
+
{: .warning }
41
+
> Decide what the LLM is allowed to see and do before writing the prompt. For clinical, EHR, genomic, or other sensitive work, treat individual-level data exposure as prohibited in the default workflow.
42
+
43
+
- Do not paste or attach individual-level records, PHI, PII, direct identifiers, credentials, private access tokens, controlled-access genomic data, or sensitive small-cell outputs into LLM tools; this can violate both soft expectations and hard rules.
44
+
- Use schemas, code, data dictionaries, aggregate results approved for sharing, and synthetic or simulated examples when demonstrating the workflow.
45
+
- Keep the codebase separate from the data. Use a code-only repository, keep protected data in its approved compute environment, and synchronize code through GitHub only in the approved direction so protected data and sensitive outputs do not flow back into the LLM-accessible workspace.
46
+
- Do not run GenAI tools or repo-native coding agents inside an environment that can access protected PHI, PII, controlled-access data, secrets, private mounts, or sensitive output files.
39
47
- Confirm whether your institution, data use agreement, IRB protocol, or sponsor policy allows AI-assisted processing.
40
48
- If an agent can browse the web, install packages, call external APIs, or use Model Context Protocol (MCP) tools, document which actions are allowed and which require human approval.
41
49
42
-
These boundaries are not just administrative details. NIH guidance warns that sharing controlled-access human genomic data with public generative AI tools can violate non-transferability obligations, and HIPAA regulations specify requirements for de-identifying protected health information [NIH genomic data guidance](../docs/References.md#nih-human-genomic-data-genai), [45 CFR 164.514](../docs/References.md#hipaa-deidentification-164-514). Tool access also creates a security surface: MCP and LLM security guidance emphasize least-privilege access, validation, and careful handling of sensitive information [MCP security best practices](../docs/References.md#mcp-security-best-practices), [OWASP LLM Top 10](../docs/References.md#owasp-llm-top-10-2025).
50
+
These boundaries are not just administrative details. NIH guidance warns that sharing controlled-access human genomic data with public generative AI tools can violate non-transferability obligations, and HIPAA regulations specify requirements for de-identifying protected health information [[NIH genomic data guidance](../docs/References.md#nih-human-genomic-data-genai)], [[45 CFR 164.514](../docs/References.md#hipaa-deidentification-164-514)]. Tool access also creates a security surface: MCP and LLM security guidance emphasize least-privilege access, validation, and careful handling of sensitive information [[MCP security best practices](../docs/References.md#mcp-security-best-practices)], [[OWASP LLM Top 10](../docs/References.md#owasp-llm-top-10-2025)].
43
51
44
-
Even at this initial planning stage, LLMs themselves can be valuable tools. You can **leverage LLMs in the planning phase** by prompting them to help brainstorm potential sub-tasks or to consider challenges you might encounter. For example, you could ask: "Based on the goal of harmonizing BMI data from EHR files, what are the typical sub-tasks involved in data cleaning and summarization?" The responses from the LLM can offer valuable suggestions and help you structure your workflow more effectively.
52
+
Even at this initial planning stage, LLMs themselves can be valuable tools. You can **leverage LLMs in the planning phase** by prompting them to help brainstorm potential sub-tasks or to consider challenges you might encounter without providing rows, private file paths, or protected identifiers. For example, you could ask: "Based on the goal of writing code to harmonize BMI data from a tabular EHR extract, using only this schema and no real records, what are the typical sub-tasks involved in data cleaning and summarization?" The responses from the LLM can offer valuable suggestions and help you structure your workflow more effectively.
45
53
46
54
## Red Teaming Your Project Plan
47
55
@@ -76,6 +84,9 @@ A particularly sophisticated critique might focus on **population-specific metho
76
84
77
85
This red teaming process transforms your initial plan into a more robust, defensible methodology that anticipates common criticisms and addresses potential pitfalls before they occur in your analysis.
78
86
87
+
{: .takeaway }
88
+
> Red teaming is most valuable before code exists. It is cheaper to fix vague assumptions in a plan than to repair analysis logic after implementation.
89
+
79
90
In essence, this foundational planning phase is crucial for setting the stage for effective LLM utilization. A well-defined plan, coupled with a thorough understanding of the context and strengthened through red teaming, will guide your subsequent interactions with the AI assistant and ensure that the generated code and analysis are relevant, accurate, and aligned with your research objectives. Clarity at this stage ensures that both you and the AI are working toward solving the right problem.
0 commit comments