Formula derivation

From wanshuiyin/Auto-claude-code-research-in-sleep · View interactive version

Formula derivation is an AI agent skill from the GitHub repository wanshuiyin/Auto-claude-code-research-in-sleep. Structures and derives research formulas when the user wants to 推导公式, build a theory line, organize assumptions, turn scattered equations into a coherent derivation, or rewrite theory notes into a paper-ready formula document. Use when the derivation target is not yet fully fixed, the main object st

How to use this skill

Skill file

Formula Derivation: Research Theory Line Construction

Build an honest derivation package, not a fake polished theorem story.

Constants

Context: $ARGUMENTS

Goal

Produce exactly one of:

  1. a coherent derivation package for the original target
  2. a reframed derivation package with corrected object / assumptions / scope
  3. a blocker report explaining why the current notes cannot yet support a coherent derivation

Inputs

Extract and normalize:

If the target, object, notation, or assumptions are ambiguous, state the exact interpretation you are using before deriving anything.

Workflow

Step 1: Gather Derivation Context

Determine the target derivation file with this priority:

  1. a file path explicitly specified by the user
  2. a derivation draft already referenced in local notes
  3. DERIVATION_PACKAGE.md in project root as the default target

Read the relevant local context:

Extract:

Step 2: Freeze the Target

State explicitly:

Do not start symbolic manipulation before this is fixed.

Step 3: Choose the Invariant Object

Identify the single quantity or conceptual object that should organize the derivation.

Typical possibilities include:

If the current notes start from a narrower quantity, decide explicitly whether it is:

Do not let a convenient proxy silently replace the actual conceptual object.

Step 4: Normalize Assumptions and Notation

Restate:

Identify:

Preserve the user's original notation unless a cleanup is necessary for coherence.

If you adopt a cleaner internal formulation, keep that as a derivation device rather than silently replacing the user's target.

Step 5: Classify the Derivation Steps

For every nontrivial step, determine whether it is:

Never merge these categories without signaling the transition.

If one part is only interpretive, do not present it as if it were mathematically proved.

Step 6: Build a Derivation Map

Choose a derivation strategy, for example:

Then write a derivation map:

If the derivation needs a decomposition, derive it from the chosen global quantity.

Do not make a split appear magically from one local variable itself.

Step 7: Write the Derivation Document

Write to the chosen target derivation file.

If the target derivation file already exists:

If the user does not specify a target, default to DERIVATION_PACKAGE.md in project root.

Do NOT write directly into paper sections or appendix .tex files unless the user explicitly asks for that target.

The derivation package must include:

Writing rules:

Step 8: Final Verification

Before finishing the target derivation file, verify:

If the derivation still lacks a coherent object, stable assumptions, or an honest path from premises to result, downgrade the status and write a blocker report instead of forcing a clean story.

Required File Structure

Write the target derivation file using this structure:

# Derivation Package

## Target
[what is being derived or explained]

## Status
COHERENT AS STATED / COHERENT AFTER REFRAMING / NOT YET COHERENT

## Invariant Object
[top-level quantity organizing the derivation]

## Assumptions
- ...

## Notation
- ...

## Derivation Strategy
[chosen route and why]

## Derivation Map
1. Target depends on ...
2. Intermediate step A uses ...
3. Approximation enters at ...

## Main Derivation
Step 1. ...
Step 2. ...
...

## Remarks and Interpretation
- ...

State each condition where the argument uses it. Add an Open Risks section only when a specific unresolved issue remains.

Output Modes

If the derivation is coherent as stated

Finish with the result under the stated assumptions.

If the notes are close but not coherent yet

Write:

If the derivation cannot be made coherent honestly

Write:

Relationship to `proof-writer`

Use formula-derivation when the user says things like:

Use proof-writer only after:

Once a precise claim and its hypotheses are available, use

CODE0 when the user requests Lean or a

specific proof obligation benefits from formal implementation and checking;

routine algebraic derivations do not require it.

Chat Response

After writing the target derivation file, respond briefly with:

Key Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.