NSFC Budget Specification Generator
Collaboration Agreement with bensz-collect-bugs
- When bugs caused by design flaws of this skill occur in the user's environment, prioritize using to record them in according to specifications. It is strictly prohibited to directly modify the source code of the skill already installed in the user's local Claude Code / Codex.
- If the AI can still complete the user's task through a workaround, record the bug first, then continue to complete the current task.
- When the user explicitly requests actions such as "report bensz skills bugs", call the local and , and only upload new bugs to ; do not pull / clone the entire bug repository.
Objective: Based on the proposal text and supplementary materials, write a budget specification that "stands up to both financial and academic scrutiny", and deliver an editable LaTeX project and
.
Applicability Judgment First
- If the user does not specify a working directory: Pause immediately and ask the user to provide the working directory first.
- If the user only asks "how to write a budget/what are the principles", directly answer or give suggestions, and do not activate this skill.
- If the user is in the 2026 Youth A/B/C scenario and belongs to the lump-sum system: First clearly remind that "usually no budget specification is required"; only continue if the user explicitly states it is for historical templates, specific unit requirements, or budget-based scenarios.
Required Inputs
Prioritize asking the user to provide information according to
skills/nsfc-budget/references/info_form.md
. At minimum, obtain:
- Working directory (required)
- Proposal text or other materials
- Project type:
- Budget scope: At least specify whether "this is the total application amount" or "this is the direct cost scope that needs explanation"
If the user does not provide all information, handle it according to the following rules:
- Total budget not provided: Take the default value from
config.yaml:defaults.total_budget_wan
.
- Target word count for the text not provided: Execute according to the recommended range in
config.yaml:defaults.target_chars
.
- Per-section upper limit: Follow
config.yaml:defaults.per_section_max_chars
.
- Template not provided: Use
config.yaml:defaults.template_id
.
- Valid values for budget mode: See
config.yaml:rules.budget_modes
.
- Valid values for budget scope: See
config.yaml:rules.budget_scopes
.
Intermediate Product Boundaries
- All intermediate files must be placed in .
- Do not scatter drafts, logs, plans, screenshots, temporary JSON, or compilation intermediate files to other locations in the working directory.
- Final visible deliverables are only placed in
<workdir>/<output_dirname>/
(default value see config.yaml:defaults.output_dirname
).
- , , and
section_files/latex_entry/pdf_name
in must be relatively safe paths; they must not contain absolute paths, or cross-boundary segments like / .
- must not point to the root path of the working directory, nor overlap with the hidden workspace .
Workflow
1. Initialize Run
First create the hidden workspace and the skeleton of
:
bash
python3 skills/nsfc-budget/scripts/init_budget_run.py \
--workdir <workdir> \
--project-type <general|local|youth> \
--template-id 01
If the user has provided material paths, you can append multiple
. The script will copy snapshots of the materials to
.nsfc-budget/run_xxx/materials/
.
If initialization is repeated within the same second, the script will automatically avoid directory name conflicts to prevent contamination between run directories.
2. Thoroughly Understand Materials, Form the "Task-Requirement-Amount-Basis" Chain
After reading the text and supplementary materials, first form internal judgments within the hidden workspace, then fill in
:
- Every sum of money must be traceable to a specific research task.
- For each section, explain why it needs to be spent, where it is spent, how it is calculated, and why the amount is reasonable.
- Do not fabricate equipment, cooperating units, test times, business trip frequencies, number of labor services, or price bases.
- When evidence is insufficient, either ask the user for clarification, or conservatively write "not included for now/no cooperative transfer funds for now/no other source funds for now", do not fabricate.
Writing principles can be found in:
skills/nsfc-budget/references/budget-writing-rules.md
.
3. Fill in
The
generated by the script is the
only structured intermediate draft. At minimum, complete:
- : Project title, project type, budget mode, working directory, output directory, template ID, word count target
- : Total budget scope, total direct costs (if known), amounts for equipment/operations/labor/cooperative transfer/other sources
- : Text paragraphs for the five parts (array)
- : Key calculation bases, necessary assumptions, pending confirmation points
Requirements:
Equipment fee + Operations fee + Labor fee = Total direct costs
(if you have clearly defined the direct cost scope)
- and must be consistent to avoid drift between two amount sources.
Cooperative research transfer funds
must not conflict logically with the first three items
- must clearly state the source and purpose; if none, explicitly write "none"
- Values such as amounts, word count upper limits, and tolerances must not be negative; when invalid, prioritize correcting the JSON instead of rendering with errors.
4. Render, Validate, Iterate
Use the script to render the JSON into a LaTeX project, and leave the validation report and compilation logs in the hidden directory:
bash
python3 skills/nsfc-budget/scripts/render_budget_project.py \
--spec <workdir>/.nsfc-budget/run_xxx/budget_spec.json
The script will:
- Copy the template to
<workdir>/<output_dirname>/
- Write the five sections to the corresponding
- Validate amount relationships, paragraph lengths, visible character counts, and template/path constraints
- Verify that is still located in to ensure the hidden workspace commitment is not violated
- Automatically escape common LaTeX special characters (such as , , , ) to reduce compilation failures caused by natural language text
- Save
validation_report.md/json
in the hidden directory
- If validation fails, the terminal will directly give a summary of the first batch of errors and the path to
- Compile and output
If validation fails, modify
first and then re-run the script until it passes.
5. Manual Review Before Delivery
Before delivery, at least review the following points:
- Is the budget scope clearly stated: total application amount vs direct costs
- Do equipment/testing/travel/labor truly correspond to research tasks one-to-one
- Are there any sentences that "are written in detail but lack evidence"
- Are there any hidden loopholes where "amounts match but logic does not"
- Are there any traces of fabrication where "should write 'none' but was forced to add a paragraph"
Writing Strategy
The following structured strategy is used by default:
- Strict overview: First state that the budget complies with policy consistency, goal relevance, and economic rationality.
- Item-by-item implementation: Each section must at least clarify "purpose + calculation + necessity + basis".
- Avoid empty words: Do not write uninformative sentences such as "to ensure the smooth progress of the project" or "is of great significance" unless followed by specific tasks and expenditures.
- Amounts serve tasks: The specification is not "financial prose"; every paragraph must relate back to the research plan.
- Prioritize quality over quantity: When materials are missing, be conservative first, ask the user first, clarify boundaries first; do not make assumptions.
Output
The final output must include both:
<workdir>/<output_dirname>/
: Complete LaTeX project
<workdir>/<output_dirname>/budget.pdf
Intermediate processes are retained in:
<workdir>/.nsfc-budget/run_xxx/
Key Files
skills/nsfc-budget/references/info_form.md
skills/nsfc-budget/references/budget-writing-rules.md
skills/nsfc-budget/scripts/init_budget_run.py
skills/nsfc-budget/scripts/render_budget_project.py
skills/nsfc-budget/models/01/.template.yaml