name: guided-code-scaffold
description: Create homework-style, intentionally incomplete code scaffolds with detailed inline TODO comments, fill-in prompts, file organization, function names, notebook cells, tests, interfaces, placeholders, or pseudocode. Use when the user wants Codex to map out implementation structure while leaving the intellectually important parts for the user to manually complete. Especially useful for research code, implementing estimators or algorithms from papers, simulations, blank-file starts, Python notebooks, feature skeletons, refactors that need staged human implementation, or requests to avoid writing all code end to end.
Guided Code Scaffold
Purpose
Produce a non-final programming scaffold that helps the user think through the code while avoiding time wasted on mechanical setup. The scaffold should feel like a guided homework worksheet inside the code: the file should show where to fill things in, what local decision is being made, and what nearby check should pass after each step.
For research code, the goal is to create a working intellectual workspace with explicit prompts embedded at the exact places where the researcher should think: definitions, data flow, function boundaries, checks, and placeholders that let the researcher implement the estimator, algorithm, simulation, or analysis deliberately.
The target artifact may be incomplete. Setup code, examples, simple helpers, and check harnesses should usually be runnable when practical; conceptual functions can fail clearly until the user fills them in.
Workflow
- Inspect the existing codebase before editing or drafting. Match its language, file layout, naming style, formatting, and test conventions.
- Identify the user's intellectual objective: estimator, algorithm, transformation, simulation, model, diagnostic, analysis, or integration.
- Separate the work into:
- Mechanical support: imports, data containers, parsing, fixture creation, CLI/notebook wiring, plotting shells, logging, shape checks, simple helpers, and test harnesses. Implement these directly when safe.
- Research judgment: mathematical formulas, estimating equations, nuisance-model choices, loss functions, targeting steps, convergence criteria, diagnostics, simulation design, error policy, and scientific assumptions. Scaffold these with line-local TODO prompts unless the user explicitly asks for full implementation.
- Bridging structure: function names, data flow, contracts, inline comments, examples, and assertions that connect the mechanical support to the research judgment.
- Break the scaffold into small implementation units. Prefer many local TODO checkpoints over one large missing implementation.
- For each incomplete block, write 2-6 nearby inline comments that guide the next few lines of code. The comments should appear where the user will type, not only in a docstring or large header comment.
- Create or update files with syntactically plausible code where practical, while explicitly marking incomplete sections.
- Leave a concise handoff that names the scaffolded files, the intended fill-in sequence, and the research decisions still owned by the user.
If a language, notebook, or research-specific pattern matters, read references/scaffold-patterns.md.
Scaffold Style
Prefer real symbols over prose-only outlines. Name functions, types, modules, routes, tests, fixtures, estimator components, and diagnostics as if they will survive into the final implementation.
Use comments to explain intent, assumptions, and mathematical contracts, not to restate obvious syntax. Each placeholder should give enough context for a human to implement the block without re-deriving the whole design.
Favor inline guidance over summary blocks. A short docstring may name the objective and notation, but the main teaching should happen inside the function body:
- Put
TODO comments immediately before the line or expression the user should write.
- Phrase TODOs as concrete homework prompts: "derive", "choose", "compute", "check", "compare", "store", or "decide".
- Use a small hint ladder when helpful: first point to the paper notation or concept, then the expected shape/range, then the edge case.
- After a research TODO, add a nearby check TODO when possible, such as an assertion, convergence diagnostic, identity case, or toy-data sanity check.
- Avoid long top-of-file TODO lists that are not repeated near the relevant code.
Make incomplete code unmistakable. Use the local convention where it exists; otherwise prefer markers such as TODO, NotImplementedError, todo!(), panic!("TODO"), pass # TODO, or a clearly failing placeholder.
Keep placeholders narrow. A good placeholder says what contract the next few lines must satisfy, what inputs and outputs matter, what assumption is being made, and what edge case needs attention.
Maintain coherent control flow. Even when implementation blocks are missing, the reader should understand the path through the feature.
When editing an existing runnable project, decide whether the scaffold is allowed to break execution. If the user explicitly wants a non-executable script or branch, use failing placeholders freely. Otherwise isolate incomplete work in new files, skipped tests, pending examples, feature branches, or guarded call sites so unrelated workflows are not accidentally broken.
Research Implementation Feel
Shape the scaffold like a serious research implementation workspace:
- Start with the estimator, algorithm, or analysis objective in a short docstring or nearby comment, then move quickly into code-local prompts.
- Encode notation into names: use stable names for observed data, nuisance functions, parameters, estimating equations, losses, gradients, influence functions, simulation settings, and diagnostics.
- Implement low-value support code directly when it is straightforward and unlikely to affect the scientific argument.
- Leave the central mathematical or methodological choices as guided fill-in regions with formulas, references to paper notation, expected shapes, and invariants placed immediately beside the code to be written.
- Add checks that protect reasoning: dimensions, ranges, normalization, convergence flags, deterministic toy examples, identity cases, and simulation sanity checks.
- Make the fill-in sequence visible in the code itself. If a function has five conceptual steps, scaffold five small TODO prompts in order rather than one broad TODO paragraph.
- Add optional extension TODOs only after the core path, such as robustness checks, alternative nuisance models, bootstrap variants, or sensitivity analyses.
Target the difficulty so each fill-in block can be started quickly but still requires thought. Avoid both extremes: do not write the whole intellectual core, and do not leave a function body with only TODO: implement.
For estimator or algorithm code, prefer this local structure:
# TODO: Map the paper's symbol here to the variable below.
# Hint: expected shape/range/convention.
<blank or failing placeholder for the user to fill>
# TODO: Add the sanity check that should pass after the previous line.
Output Contract
When changing files, make the scaffold useful in-place:
- Add imports, signatures, types, module boundaries, and call sites that establish the shape of the work.
- Add comments near the exact code they guide; do not rely on a single large explanatory block at the top of a file or function.
- Add examples and test/check skeletons for important behavior, with incomplete assertions or fixtures when the user should decide details.
- Avoid large fully implemented sections unless they are mechanical, conventional, or obviously low-value for the user to write manually.
- Avoid fake production behavior, silent fallbacks, or placeholder code that could look complete.
For Python notebooks, prefer a research-notebook sequence: setup cell, notation/objective cell, starter function cells, toy-data or simulation cell, check cell, and optional extension cell. If editing .ipynb directly is not necessary, a .py or markdown draft of the intended cells is acceptable.
When only answering with a draft, use code blocks and brief notes, but still follow the same scaffold ratio.
Do not chase a passing test suite unless the user asks for an executable implementation. For scaffolds, verification should focus on file placement, naming coherence, obvious syntax where practical, and whether every incomplete section is clearly marked.
Calibration
Default to implementing mechanical support and scaffolding the intellectual core. Adjust based on the user's wording:
- More direct code when the user asks for "boilerplate", "wire this up", "types", "file structure", "plotting", "data loading", "simple helpers", or "test harness".
- More guided blanks when the user asks to "think through", "implement from paper", "estimator", "algorithm", "derive", "simulation design", "leave TODOs", "do not implement", "help me start", or "I want to fill it in".
- More tests and contracts when the scaffold touches shared APIs, numerical code, estimators, stochastic simulations, or behavior that is easy to misunderstand.
- More hints when the topic is unfamiliar, but keep hints in a ladder: conceptual nudge first, notation or shape hint second, code-shape hint third, full solution only if the user explicitly asks.
Do not present the scaffold as complete. Be explicit that it is intentionally incomplete and identify which decisions remain for the user.
1---2name: guided-code-scaffold3description: Create homework-style, intentionally incomplete code scaffolds with detailed inline TODO comments, fill-in prompts, file organization, function names, notebook4---5---6name: guided-code-scaffold7description: Create homework-style, intentionally incomplete code scaffolds with detailed inline TODO comments, fill-in prompts, file organization, function names, notebook cells, tests, interfaces, placeholders, or pseudocode. Use when the user wants Codex to map out implementation structure while leaving the intellectually important parts for the user to manually complete. Especially useful for research code, implementing estimators or algorithms from papers, simulations, blank-file starts, Python notebooks, feature skeletons, refactors that need staged human implementation, or requests to avoid writing all code end to end.8---910# Guided Code Scaffold1112## Purpose1314Produce a non-final programming scaffold that helps the user think through the code while avoiding time wasted on mechanical setup. The scaffold should feel like a guided homework worksheet inside the code: the file should show where to fill things in, what local decision is being made, and what nearby check should pass after each step.1516For research code, the goal is to create a working intellectual workspace with explicit prompts embedded at the exact places where the researcher should think: definitions, data flow, function boundaries, checks, and placeholders that let the researcher implement the estimator, algorithm, simulation, or analysis deliberately.1718The target artifact may be incomplete. Setup code, examples, simple helpers, and check harnesses should usually be runnable when practical; conceptual functions can fail clearly until the user fills them in.1920## Workflow21221. Inspect the existing codebase before editing or drafting. Match its language, file layout, naming style, formatting, and test conventions.232. Identify the user's intellectual objective: estimator, algorithm, transformation, simulation, model, diagnostic, analysis, or integration.243. Separate the work into:25 - **Mechanical support**: imports, data containers, parsing, fixture creation, CLI/notebook wiring, plotting shells, logging, shape checks, simple helpers, and test harnesses. Implement these directly when safe.26 - **Research judgment**: mathematical formulas, estimating equations, nuisance-model choices, loss functions, targeting steps, convergence criteria, diagnostics, simulation design, error policy, and scientific assumptions. Scaffold these with line-local TODO prompts unless the user explicitly asks for full implementation.27 - **Bridging structure**: function names, data flow, contracts, inline comments, examples, and assertions that connect the mechanical support to the research judgment.284. Break the scaffold into small implementation units. Prefer many local TODO checkpoints over one large missing implementation.295. For each incomplete block, write 2-6 nearby inline comments that guide the next few lines of code. The comments should appear where the user will type, not only in a docstring or large header comment.306. Create or update files with syntactically plausible code where practical, while explicitly marking incomplete sections.317. Leave a concise handoff that names the scaffolded files, the intended fill-in sequence, and the research decisions still owned by the user.3233If a language, notebook, or research-specific pattern matters, read `references/scaffold-patterns.md`.3435## Scaffold Style3637Prefer real symbols over prose-only outlines. Name functions, types, modules, routes, tests, fixtures, estimator components, and diagnostics as if they will survive into the final implementation.3839Use comments to explain intent, assumptions, and mathematical contracts, not to restate obvious syntax. Each placeholder should give enough context for a human to implement the block without re-deriving the whole design.4041Favor inline guidance over summary blocks. A short docstring may name the objective and notation, but the main teaching should happen inside the function body:4243- Put `TODO` comments immediately before the line or expression the user should write.44- Phrase TODOs as concrete homework prompts: "derive", "choose", "compute", "check", "compare", "store", or "decide".45- Use a small hint ladder when helpful: first point to the paper notation or concept, then the expected shape/range, then the edge case.46- After a research TODO, add a nearby check TODO when possible, such as an assertion, convergence diagnostic, identity case, or toy-data sanity check.47- Avoid long top-of-file TODO lists that are not repeated near the relevant code.4849Make incomplete code unmistakable. Use the local convention where it exists; otherwise prefer markers such as `TODO`, `NotImplementedError`, `todo!()`, `panic!("TODO")`, `pass # TODO`, or a clearly failing placeholder.5051Keep placeholders narrow. A good placeholder says what contract the next few lines must satisfy, what inputs and outputs matter, what assumption is being made, and what edge case needs attention.5253Maintain coherent control flow. Even when implementation blocks are missing, the reader should understand the path through the feature.5455When editing an existing runnable project, decide whether the scaffold is allowed to break execution. If the user explicitly wants a non-executable script or branch, use failing placeholders freely. Otherwise isolate incomplete work in new files, skipped tests, pending examples, feature branches, or guarded call sites so unrelated workflows are not accidentally broken.5657## Research Implementation Feel5859Shape the scaffold like a serious research implementation workspace:6061- Start with the estimator, algorithm, or analysis objective in a short docstring or nearby comment, then move quickly into code-local prompts.62- Encode notation into names: use stable names for observed data, nuisance functions, parameters, estimating equations, losses, gradients, influence functions, simulation settings, and diagnostics.63- Implement low-value support code directly when it is straightforward and unlikely to affect the scientific argument.64- Leave the central mathematical or methodological choices as guided fill-in regions with formulas, references to paper notation, expected shapes, and invariants placed immediately beside the code to be written.65- Add checks that protect reasoning: dimensions, ranges, normalization, convergence flags, deterministic toy examples, identity cases, and simulation sanity checks.66- Make the fill-in sequence visible in the code itself. If a function has five conceptual steps, scaffold five small TODO prompts in order rather than one broad TODO paragraph.67- Add optional extension TODOs only after the core path, such as robustness checks, alternative nuisance models, bootstrap variants, or sensitivity analyses.6869Target the difficulty so each fill-in block can be started quickly but still requires thought. Avoid both extremes: do not write the whole intellectual core, and do not leave a function body with only `TODO: implement`.7071For estimator or algorithm code, prefer this local structure:7273```text74# TODO: Map the paper's symbol here to the variable below.75# Hint: expected shape/range/convention.76<blank or failing placeholder for the user to fill>7778# TODO: Add the sanity check that should pass after the previous line.79```8081## Output Contract8283When changing files, make the scaffold useful in-place:8485- Add imports, signatures, types, module boundaries, and call sites that establish the shape of the work.86- Add comments near the exact code they guide; do not rely on a single large explanatory block at the top of a file or function.87- Add examples and test/check skeletons for important behavior, with incomplete assertions or fixtures when the user should decide details.88- Avoid large fully implemented sections unless they are mechanical, conventional, or obviously low-value for the user to write manually.89- Avoid fake production behavior, silent fallbacks, or placeholder code that could look complete.9091For Python notebooks, prefer a research-notebook sequence: setup cell, notation/objective cell, starter function cells, toy-data or simulation cell, check cell, and optional extension cell. If editing `.ipynb` directly is not necessary, a `.py` or markdown draft of the intended cells is acceptable.9293When only answering with a draft, use code blocks and brief notes, but still follow the same scaffold ratio.9495Do not chase a passing test suite unless the user asks for an executable implementation. For scaffolds, verification should focus on file placement, naming coherence, obvious syntax where practical, and whether every incomplete section is clearly marked.9697## Calibration9899Default to implementing mechanical support and scaffolding the intellectual core. Adjust based on the user's wording:100101- More direct code when the user asks for "boilerplate", "wire this up", "types", "file structure", "plotting", "data loading", "simple helpers", or "test harness".102- More guided blanks when the user asks to "think through", "implement from paper", "estimator", "algorithm", "derive", "simulation design", "leave TODOs", "do not implement", "help me start", or "I want to fill it in".103- More tests and contracts when the scaffold touches shared APIs, numerical code, estimators, stochastic simulations, or behavior that is easy to misunderstand.104- More hints when the topic is unfamiliar, but keep hints in a ladder: conceptual nudge first, notation or shape hint second, code-shape hint third, full solution only if the user explicitly asks.105106Do not present the scaffold as complete. Be explicit that it is intentionally incomplete and identify which decisions remain for the user.