nsfc-budget
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNSFC 预算说明书生成器
NSFC Budget Specification Generator
与 bensz-collect-bugs 的协作约定
Collaboration Agreement with bensz-collect-bugs
- 当用户环境中出现因本 skill 设计缺陷导致的 bug 时,优先使用 按规范记录到
bensz-collect-bugs,严禁直接修改用户本地 Claude Code / Codex 中已安装的 skill 源码。~/.bensz-skills/bugs/ - 若 AI 仍可通过 workaround 继续完成用户任务,应先记录 bug,再继续完成当前任务。
- 当用户明确要求“report bensz skills bugs”等公开上报动作时,调用本地 与
gh,仅上传新增 bug 到bensz-collect-bugs;不要 pull / clone 整个 bug 仓库。huangwb8/bensz-bugs
目标:基于标书正文与补充材料,写出一份“经得起财务与学术双重审视”的预算说明书,并交付可编辑 LaTeX 项目与 。
budget.pdf- When bugs caused by design flaws of this skill occur in the user's environment, prioritize using to record them in
bensz-collect-bugsaccording 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.~/.bensz-skills/bugs/ - 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
gh, and only upload new bugs tobensz-collect-bugs; do not pull / clone the entire bug repository.huangwb8/bensz-bugs
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 .
budget.pdf先做适用性判断
Applicability Judgment First
- 如果用户没有指定工作目录:立即暂停,先让用户给出工作目录。
- 如果用户只是问“预算怎么写/有哪些原则”,直接回答或给建议,不启动本 skill。
- 如果用户是 2026 青年 A/B/C 且场景属于包干制:先明确提醒“通常无需预算说明书”;只有在用户明确说明是历史模板、特定单位要求或预算制场景时才继续。
- 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
优先让用户按 提供。最少要拿到:
skills/nsfc-budget/references/info_form.md- 工作目录(必需)
- 标书正文或其它材料
- 项目类型:
general | local | youth - 预算口径:至少说明“这是申请总额”还是“这是需要解释的直接费用口径”
若用户没给全,按下面规则处理:
- 总预算未给:按 取默认值。
config.yaml:defaults.total_budget_wan - 正文目标字数未给:按 推荐区间执行。
config.yaml:defaults.target_chars - 每节上限:按 。
config.yaml:defaults.per_section_max_chars - 模板未给:按 。
config.yaml:defaults.template_id - 预算模式合法值:见 。
config.yaml:rules.budget_modes - 预算口径合法值:见 。
config.yaml:rules.budget_scopes
Prioritize asking the user to provide information according to . At minimum, obtain:
skills/nsfc-budget/references/info_form.md- Working directory (required)
- Proposal text or other materials
- Project type:
general | local | youth - 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
- 所有中间文件只能放在 。
<workdir>/.nsfc-budget/ - 不要把草稿、日志、计划、截图、临时 JSON、编译中间文件散落到工作目录其它位置。
- 最终可见交付物只放在 (默认值见
<workdir>/<output_dirname>/)。config.yaml:defaults.output_dirname - 、
template_id、output_dirname里的.template.yaml都必须是相对安全路径;不得包含绝对路径、section_files/latex_entry/pdf_name/.越界段。.. - 不得指向工作目录根路径,也不得与隐藏工作区
output_dirname重叠。<workdir>/.nsfc-budget/
- All intermediate files must be placed in .
<workdir>/.nsfc-budget/ - 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 (default value see
<workdir>/<output_dirname>/).config.yaml:defaults.output_dirname - ,
template_id, andoutput_dirnameinsection_files/latex_entry/pdf_namemust be relatively safe paths; they must not contain absolute paths, or cross-boundary segments like.template.yaml/.... - must not point to the root path of the working directory, nor overlap with the hidden workspace
output_dirname.<workdir>/.nsfc-budget/
工作流
Workflow
1. 初始化 run
1. Initialize Run
先创建隐藏工作区与 骨架:
budget_spec.jsonbash
python3 skills/nsfc-budget/scripts/init_budget_run.py \
--workdir <workdir> \
--project-type <general|local|youth> \
--template-id 01如用户已给材料路径,可追加多个 。脚本会把材料快照复制到 。
若同秒重复初始化,脚本会自动避让目录名冲突,避免 run 目录互相污染。
--material <path>.nsfc-budget/run_xxx/materials/First create the hidden workspace and the skeleton of :
budget_spec.jsonbash
python3 skills/nsfc-budget/scripts/init_budget_run.py \
--workdir <workdir> \
--project-type <general|local|youth> \
--template-id 01If the user has provided material paths, you can append multiple . The script will copy snapshots of the materials to .
If initialization is repeated within the same second, the script will automatically avoid directory name conflicts to prevent contamination between run directories.
--material <path>.nsfc-budget/run_xxx/materials/2. 吃透材料,形成“任务-需求-金额-依据”链
2. Thoroughly Understand Materials, Form the "Task-Requirement-Amount-Basis" Chain
读取正文与补充材料后,先在隐藏工作区内形成内部判断,再填写 :
budget_spec.json- 每一笔钱都必须能追溯到具体研究任务。
- 每一节都要说明为什么要花、花在哪里、怎么测算、为什么这个数合理。
- 不能捏造设备、合作单位、测试次数、出差频次、劳务人数、价格依据。
- 证据不足时,要么追问用户,要么保守写“暂不列支/暂无合作转拨/暂无其他来源资金”,不要编造。
写作原则见:。
skills/nsfc-budget/references/budget-writing-rules.mdAfter reading the text and supplementary materials, first form internal judgments within the hidden workspace, then fill in :
budget_spec.json- 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.md3. 填写 budget_spec.json
budget_spec.json3. Fill in budget_spec.json
budget_spec.json脚本生成的 是唯一结构化中间稿。至少补齐:
budget_spec.json- :项目题目、项目类型、预算模式、工作目录、输出目录、模板 ID、字数目标
meta - :总预算口径、直接费用总额(若已知)、设备/业务/劳务/合作转拨/其他来源金额
budget - :五个部分的正文段落(数组)
sections - :关键测算依据、必要假设、待确认点
evidence
要求:
- (若你已明确直接费用口径)
设备费 + 业务费 + 劳务费 = 直接费用总额 - 与
budget.*_wan必须保持一致,避免出现两份金额源漂移。sections.*.amount_wan - 不能与前三项形成逻辑冲突
合作研究转拨资金 - 必须写明来源与用途;若无,则显式写“无”
其他来源资金 - 金额、字数上限、容差等数值不得为负数;不合法时优先修正 JSON,而不是带病渲染。
The generated by the script is the only structured intermediate draft. At minimum, complete:
budget_spec.json- : Project title, project type, budget mode, working directory, output directory, template ID, word count target
meta - : Total budget scope, total direct costs (if known), amounts for equipment/operations/labor/cooperative transfer/other sources
budget - : Text paragraphs for the five parts (array)
sections - : Key calculation bases, necessary assumptions, pending confirmation points
evidence
Requirements:
- (if you have clearly defined the direct cost scope)
Equipment fee + Operations fee + Labor fee = Total direct costs - and
budget.*_wanmust be consistent to avoid drift between two amount sources.sections.*.amount_wan - must not conflict logically with the first three items
Cooperative research transfer funds - must clearly state the source and purpose; if none, explicitly write "none"
Other source funds - 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. 渲染、校验、迭代
4. Render, Validate, Iterate
用脚本把 JSON 渲染为 LaTeX 项目,并把校验报告与编译日志留在隐藏目录:
bash
python3 skills/nsfc-budget/scripts/render_budget_project.py \
--spec <workdir>/.nsfc-budget/run_xxx/budget_spec.json脚本会:
- 复制模板到
<workdir>/<output_dirname>/ - 将五个 section 写入对应
extraTex/*.tex - 校验金额关系、段落长度、可见字符数与模板/路径约束
- 校验 是否仍位于
budget_spec.json,保证隐藏工作区承诺不被破坏<workdir>/.nsfc-budget/ - 自动转义常见 LaTeX 特殊字符(如 、
%、#、&),减少自然语言正文导致的编译失败_ - 在隐藏目录保存
validation_report.md/json - 若校验失败,终端会直接给出首批错误摘要与 路径
validation_report.md - 编译输出
budget.pdf
如校验失败,先修 再重新运行脚本,直到通过。
budget_spec.jsonUse 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.jsonThe script will:
- Copy the template to
<workdir>/<output_dirname>/ - Write the five sections to the corresponding
extraTex/*.tex - Validate amount relationships, paragraph lengths, visible character counts, and template/path constraints
- Verify that is still located in
budget_spec.jsonto ensure the hidden workspace commitment is not violated<workdir>/.nsfc-budget/ - Automatically escape common LaTeX special characters (such as ,
%,#,&) to reduce compilation failures caused by natural language text_ - Save in the hidden directory
validation_report.md/json - If validation fails, the terminal will directly give a summary of the first batch of errors and the path to
validation_report.md - Compile and output
budget.pdf
If validation fails, modify first and then re-run the script until it passes.
budget_spec.json5. 交付前人工复核
5. Manual Review Before Delivery
交付前必须至少复核这些点:
- 预算口径是否说清楚:申请总额 vs 直接费用
- 设备/测试/差旅/劳务是否真的与研究任务一一对应
- 是否出现“写得很满但没有证据”的句子
- 是否存在“金额能对上,但逻辑对不上”的隐性漏洞
- 是否存在“应该写无,却被硬凑了一段”的编造痕迹
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
最终输出必须同时包含:
- :完整 LaTeX 项目
<workdir>/<output_dirname>/ <workdir>/<output_dirname>/budget.pdf
中间过程保留在:
<workdir>/.nsfc-budget/run_xxx/
The final output must include both:
- : Complete LaTeX project
<workdir>/<output_dirname>/ <workdir>/<output_dirname>/budget.pdf
Intermediate processes are retained in:
<workdir>/.nsfc-budget/run_xxx/
关键文件
Key Files
skills/nsfc-budget/references/info_form.mdskills/nsfc-budget/references/budget-writing-rules.mdskills/nsfc-budget/scripts/init_budget_run.pyskills/nsfc-budget/scripts/render_budget_project.pyskills/nsfc-budget/models/01/.template.yaml
skills/nsfc-budget/references/info_form.mdskills/nsfc-budget/references/budget-writing-rules.mdskills/nsfc-budget/scripts/init_budget_run.pyskills/nsfc-budget/scripts/render_budget_project.pyskills/nsfc-budget/models/01/.template.yaml