Initial: desk + ncantu placeholder + per-project cursor configs
**Motivations:** - Centraliser les fichiers Cursor (rules, skills, agents, commands, hooks) par user et par projet **Root causes:** - N/A **Correctifs:** - N/A **Evolutions:** - desk: rules, skills-cursor, agents, commands, hooks, argv/hooks/mcp.json - ncantu: README placeholder - 4NK_node, algo, builazoo, ia_local, lecoffre_ng, lecoffre_ng_pprod, lecoffre_ng_test: .cursor contents **Pages affectées:** - cursor/desk/, cursor/ncantu/, cursor/<project>/
This commit is contained in:
88
algo/skills/document-improvement/SKILL.md
Normal file
88
algo/skills/document-improvement/SKILL.md
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
name: document-improvement
|
||||
description: Improves and corrects long text documents in background by processing them in chunks. Applies scientific writing rules, neutral style, and formatting corrections. Use when the user wants to improve, correct, or format large markdown/text documents, or when launching a background document processing task.
|
||||
---
|
||||
|
||||
# Document Improvement (Background)
|
||||
|
||||
Improves and corrects long documents by processing them in chunks. Designed for scientific and technical texts (e.g. mathematical proofs, research notes).
|
||||
|
||||
## Invocation
|
||||
|
||||
**Background execution** (recommended for large files):
|
||||
|
||||
```
|
||||
Use mcp_task with subagent_type="generalPurpose" and a prompt that:
|
||||
1. References this skill
|
||||
2. Specifies the document path
|
||||
3. Optionally specifies chunk size (default: 800–1200 lines) and scope (full document or line range)
|
||||
```
|
||||
|
||||
**Direct invocation**: When the user asks to improve or correct a document, apply this workflow.
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Analyze document structure
|
||||
|
||||
- Read the document to identify sections (headers `##`, `###`)
|
||||
- Note total line count
|
||||
- Identify natural break points (section boundaries)
|
||||
|
||||
### 2. Chunk strategy
|
||||
|
||||
For documents > 1500 lines:
|
||||
|
||||
- **Chunk size**: 800–1200 lines per pass (adjust to fit section boundaries)
|
||||
- **Overlap**: Include 2–3 lines of context at chunk boundaries
|
||||
- **Order**: Process from start to end; preserve section continuity
|
||||
|
||||
For documents ≤ 1500 lines: process in one pass.
|
||||
|
||||
### 3. Per-chunk processing
|
||||
|
||||
For each chunk:
|
||||
|
||||
1. Read the chunk with surrounding context
|
||||
2. Apply corrections from [reference.md](reference.md)
|
||||
3. Write corrections using search_replace (exact match, minimal edits)
|
||||
4. Preserve LaTeX, code blocks, and structural markup
|
||||
|
||||
### 4. Corrections to apply
|
||||
|
||||
See [reference.md](reference.md) for the full checklist. Main categories:
|
||||
|
||||
- **Titles**: "Introduction" → "Introduction de …", "Conclusion" → "Conclusion de …"
|
||||
- **Neutrality**: Remove auto-appreciation, reader address, introspection
|
||||
- **Enchainements**: Replace "La continuation ainsi…" by content-driven transitions
|
||||
- **Hypotheses**: Explicit hypotheses before each result
|
||||
- **References**: Exact citations, no vague "il est bien connu que"
|
||||
|
||||
### 5. Output
|
||||
|
||||
- Apply edits directly to the file
|
||||
- Do not produce a separate report unless requested
|
||||
- Preserve git history (one logical change per chunk if possible)
|
||||
|
||||
## Constraints
|
||||
|
||||
- **No content invention**: Only correct and reformulate; do not add new mathematical claims
|
||||
- **Preserve structure**: Keep section hierarchy and numbering
|
||||
- **Minimal edits**: Prefer targeted search_replace over full rewrites
|
||||
- **Consistency**: Use the same terminology and conventions across chunks
|
||||
|
||||
## Chunk processing template
|
||||
|
||||
When processing chunk N (lines X–Y):
|
||||
|
||||
```
|
||||
Chunk N/X: lines X–Y
|
||||
- Sections in scope: [list]
|
||||
- Corrections applied: [brief list]
|
||||
- Next chunk: lines Y+1–Z
|
||||
```
|
||||
|
||||
## Error handling
|
||||
|
||||
- If a chunk fails: log the line range and error, continue with the next chunk
|
||||
- If LaTeX or structure is ambiguous: skip and leave a comment for manual review
|
||||
- Do not guess mathematical notation; preserve it exactly
|
||||
40
algo/skills/document-improvement/examples.md
Normal file
40
algo/skills/document-improvement/examples.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Document Improvement — Usage Examples
|
||||
|
||||
## Launching as background task (mcp_task)
|
||||
|
||||
To process a document in background, use `mcp_task` with `subagent_type="generalPurpose"` and a prompt like:
|
||||
|
||||
```
|
||||
Improve and correct the document at [PATH] following the skill at .cursor/skills/document-improvement/SKILL.md.
|
||||
|
||||
Read SKILL.md and reference.md from that directory, then apply the workflow:
|
||||
1. Analyze the document structure
|
||||
2. Process in chunks of ~1000 lines (or full document if < 1500 lines)
|
||||
3. Apply all corrections from the reference checklist
|
||||
4. Write edits directly to the file with search_replace
|
||||
|
||||
Document path: v0/conjoncture_collatz.md
|
||||
```
|
||||
|
||||
**With specific scope:**
|
||||
|
||||
```
|
||||
Same as above, but only process lines 13800–13846 (last section).
|
||||
```
|
||||
|
||||
## Direct invocation
|
||||
|
||||
When the user says "améliore ce document" or "corrige le document X":
|
||||
|
||||
1. Read `.cursor/skills/document-improvement/SKILL.md` and `reference.md`
|
||||
2. Follow the workflow in SKILL.md
|
||||
3. Process the document in chunks if needed
|
||||
|
||||
## Chunk size guidelines
|
||||
|
||||
| Document size | Strategy |
|
||||
|---------------|----------|
|
||||
| < 1500 lines | Single pass |
|
||||
| 1500–5000 lines | 2–4 chunks of ~1000 lines |
|
||||
| 5000–15000 lines | 5–15 chunks, break at section boundaries |
|
||||
| > 15000 lines | Multiple sessions; process ~3000–5000 lines per session |
|
||||
82
algo/skills/document-improvement/reference.md
Normal file
82
algo/skills/document-improvement/reference.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# Document Improvement — Reference Checklist
|
||||
|
||||
Condensed rules for correcting scientific and technical documents. Source: project writing guide.
|
||||
|
||||
## Titles
|
||||
|
||||
| Incorrect | Correct |
|
||||
|-----------|---------|
|
||||
| ## Introduction | ## Introduction de [objet/section] |
|
||||
| ## Conclusion | ## Conclusion de [objet/section] |
|
||||
|
||||
All Introduction and Conclusion titles must be at level `##`.
|
||||
|
||||
## Neutrality (strict)
|
||||
|
||||
**Remove or rewrite:**
|
||||
- Auto-appreciation: "important", "majeur", "robuste", "rigoureux", "ambitieux"
|
||||
- Editorial justification: "volontairement", "conservateur", "verrou", "discipline"
|
||||
- Reader address: "le lecteur verra que…" → factual statement
|
||||
- Introspection: "nous avons choisi…" → neutral formulation
|
||||
- Meta-commentary on the text itself
|
||||
|
||||
**Use instead:**
|
||||
- Factual: "On définit…", "On suppose…", "On montre…", "Il s'ensuit…"
|
||||
- Structural references: "voir Chapitre X", "d'après la Proposition Y" (without evaluative terms)
|
||||
|
||||
## Transitions
|
||||
|
||||
- Replace "La continuation ainsi…" by content-driven transitions
|
||||
- Each paragraph should follow from the mathematical content, not from meta-phrases
|
||||
- Avoid "on poursuit de la même manière" without specifying what follows
|
||||
|
||||
## Hypotheses and results
|
||||
|
||||
- Before each lemma, proposition, theorem: state hypotheses explicitly
|
||||
- In the proof: indicate when each hypothesis is used
|
||||
- No implicit or "obvious" hypotheses
|
||||
|
||||
## References and citations
|
||||
|
||||
- Cite exact source (theorem, page, equation number)
|
||||
- Avoid "il est bien connu que" without reference
|
||||
- For overlap with literature: state the difference (hypotheses, framework) factually
|
||||
|
||||
## Quantifiers and domains
|
||||
|
||||
- Explicit quantifiers: "pour tout", "il existe", "il existe un unique" with clear domain
|
||||
- Explicit domain of definition for functions and operators
|
||||
- Validity conditions in the statement, not only in the proof
|
||||
|
||||
## Terminology
|
||||
|
||||
- One concept = one term throughout
|
||||
- No fluctuating synonyms for the same object
|
||||
- For long documents: recall local conventions at section start if needed
|
||||
|
||||
## Proofs
|
||||
|
||||
- No "il est facile de voir" or "on laisse au lecteur" without a precise pointer
|
||||
- Either detail the argument or refer to a lemma/reference
|
||||
- Long calculations: state the intermediate result, move details to appendix with reference
|
||||
|
||||
## Conjectures and open questions
|
||||
|
||||
- Neutral formulation: "On conjecture que…", "Il serait naturel de se demander si…"
|
||||
- No overstatement of importance
|
||||
- Limits of the framework: recall restrictive hypotheses in section conclusion if relevant
|
||||
|
||||
## Voice and tense
|
||||
|
||||
- Present atemporal for mathematical statements
|
||||
- Uniform voice: either "on" or passive throughout
|
||||
- Future only for explicit forward references ("on verra en 4.2 que…")
|
||||
|
||||
## Quick scan patterns
|
||||
|
||||
When scanning a chunk, flag:
|
||||
- `## Introduction` or `## Conclusion` without "de …"
|
||||
- "important", "majeur", "volontairement", "verrou", "discipline"
|
||||
- "Le lecteur", "on laisse au lecteur", "il est facile de voir"
|
||||
- "La continuation ainsi", "on poursuit de la même manière"
|
||||
- "il est bien connu que" without citation
|
||||
Reference in New Issue
Block a user