@kortix/sandbox 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/customize.sh +143 -0
- package/config/kortix-env-setup.sh +25 -0
- package/kortix-master/package.json +22 -0
- package/kortix-master/src/config.ts +22 -0
- package/kortix-master/src/index.ts +44 -0
- package/kortix-master/src/routes/env.ts +65 -0
- package/kortix-master/src/routes/proxy.ts +108 -0
- package/kortix-master/src/routes/update.ts +185 -0
- package/kortix-master/src/services/proxy.ts +43 -0
- package/kortix-master/src/services/secret-store.ts +156 -0
- package/kortix-master/tsconfig.json +14 -0
- package/opencode/agents/kortix-browser.md +142 -0
- package/opencode/agents/kortix-build.md +62 -0
- package/opencode/agents/kortix-explore.md +66 -0
- package/opencode/agents/kortix-image-gen.md +33 -0
- package/opencode/agents/kortix-main.md +450 -0
- package/opencode/agents/kortix-plan.md +100 -0
- package/opencode/agents/kortix-research.md +84 -0
- package/opencode/agents/kortix-sheets.md +61 -0
- package/opencode/agents/kortix-slides.md +64 -0
- package/opencode/agents/kortix-web-dev.md +572 -0
- package/opencode/commands/email.md +36 -0
- package/opencode/commands/init.md +43 -0
- package/opencode/commands/journal.md +44 -0
- package/opencode/commands/memory-init.md +81 -0
- package/opencode/commands/memory-search.md +50 -0
- package/opencode/commands/memory-status.md +56 -0
- package/opencode/commands/research.md +36 -0
- package/opencode/commands/search.md +38 -0
- package/opencode/commands/slides.md +32 -0
- package/opencode/commands/spreadsheet.md +30 -0
- package/opencode/memory.json +37 -0
- package/opencode/ocx.jsonc +10 -0
- package/opencode/opencode.jsonc +103 -0
- package/opencode/package.json +25 -0
- package/opencode/patches/apply.sh +19 -0
- package/opencode/patches/opencode-pty-spawn.txt +49 -0
- package/opencode/plugin/background-agents.ts.disabled +483 -0
- package/opencode/plugin/kdco-primitives/get-project-id.ts +172 -0
- package/opencode/plugin/kdco-primitives/index.ts +26 -0
- package/opencode/plugin/kdco-primitives/log-warn.ts +51 -0
- package/opencode/plugin/kdco-primitives/mutex.ts +122 -0
- package/opencode/plugin/kdco-primitives/shell.ts +138 -0
- package/opencode/plugin/kdco-primitives/temp.ts +36 -0
- package/opencode/plugin/kdco-primitives/terminal-detect.ts +34 -0
- package/opencode/plugin/kdco-primitives/types.ts +13 -0
- package/opencode/plugin/kdco-primitives/with-timeout.ts +84 -0
- package/opencode/plugin/memory.ts +306 -0
- package/opencode/plugin/worktree/state.ts +412 -0
- package/opencode/plugin/worktree/terminal.ts +1002 -0
- package/opencode/plugin/worktree.ts +861 -0
- package/opencode/skills/KORTIX-browser/SKILL.md +478 -0
- package/opencode/skills/KORTIX-cron-triggers/SKILL.md +173 -0
- package/opencode/skills/KORTIX-deep-research/SKILL.md +278 -0
- package/opencode/skills/KORTIX-docx/SKILL.md +398 -0
- package/opencode/skills/KORTIX-docx/scripts/__init__.py +1 -0
- package/opencode/skills/KORTIX-docx/scripts/accept_changes.py +104 -0
- package/opencode/skills/KORTIX-docx/scripts/comment.py +244 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/__init__.py +0 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/merge_runs.py +199 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/opencode/skills/KORTIX-docx/scripts/office/pack.py +159 -0
- package/opencode/skills/KORTIX-docx/scripts/office/soffice.py +183 -0
- package/opencode/skills/KORTIX-docx/scripts/office/unpack.py +132 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validate.py +111 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/__init__.py +15 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/base.py +847 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/docx.py +446 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/pptx.py +275 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/redlining.py +247 -0
- package/opencode/skills/KORTIX-docx/scripts/render_docx.py +179 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/comments.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtended.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtensible.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsIds.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/people.xml +3 -0
- package/opencode/skills/KORTIX-domain-research/SKILL.md +96 -0
- package/opencode/skills/KORTIX-domain-research/scripts/domain-lookup.py +810 -0
- package/opencode/skills/KORTIX-elevenlabs/SKILL.md +230 -0
- package/opencode/skills/KORTIX-elevenlabs/scripts/tts.py +389 -0
- package/opencode/skills/KORTIX-email/SKILL.md +145 -0
- package/opencode/skills/KORTIX-legal-writer/SKILL.md +409 -0
- package/opencode/skills/KORTIX-legal-writer/references/bluebook.md +152 -0
- package/opencode/skills/KORTIX-legal-writer/references/document-types.md +416 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/courtlistener.py +291 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/ecfr_lookup.py +299 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/verify-legal.py +507 -0
- package/opencode/skills/KORTIX-logo-creator/SKILL.md +293 -0
- package/opencode/skills/KORTIX-logo-creator/references/prompt-patterns.md +134 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/compose_logo.py +406 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/create_logo_sheet.py +258 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/remove_bg.py +96 -0
- package/opencode/skills/KORTIX-memory/SKILL.md +261 -0
- package/opencode/skills/KORTIX-memory/scripts/export-sessions.py +409 -0
- package/opencode/skills/KORTIX-paper-creator/SKILL.md +549 -0
- package/opencode/skills/KORTIX-paper-creator/assets/template.tex +101 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/compile.sh +177 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/openalex_to_bibtex.py +220 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/verify.sh +354 -0
- package/opencode/skills/KORTIX-paper-search/SKILL.md +418 -0
- package/opencode/skills/KORTIX-pdf/SKILL.md +232 -0
- package/opencode/skills/KORTIX-pdf/forms.md +36 -0
- package/opencode/skills/KORTIX-pdf/reference.md +105 -0
- package/opencode/skills/KORTIX-pdf/scripts/check_bounding_boxes.py +65 -0
- package/opencode/skills/KORTIX-pdf/scripts/check_fillable_fields.py +11 -0
- package/opencode/skills/KORTIX-pdf/scripts/convert_pdf_to_images.py +33 -0
- package/opencode/skills/KORTIX-pdf/scripts/create_validation_image.py +37 -0
- package/opencode/skills/KORTIX-pdf/scripts/extract_form_field_info.py +122 -0
- package/opencode/skills/KORTIX-pdf/scripts/extract_form_structure.py +115 -0
- package/opencode/skills/KORTIX-pdf/scripts/fill_fillable_fields.py +98 -0
- package/opencode/skills/KORTIX-pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/opencode/skills/KORTIX-plan/SKILL.md +228 -0
- package/opencode/skills/KORTIX-presentation-viewer/SKILL.md +87 -0
- package/opencode/skills/KORTIX-presentation-viewer/serve.ts +136 -0
- package/opencode/skills/KORTIX-presentation-viewer/viewer.html +559 -0
- package/opencode/skills/KORTIX-presentations/SKILL.md +344 -0
- package/opencode/skills/KORTIX-remotion/SKILL.md +56 -0
- package/opencode/skills/KORTIX-remotion/rules/3d.md +86 -0
- package/opencode/skills/KORTIX-remotion/rules/animations.md +29 -0
- package/opencode/skills/KORTIX-remotion/rules/assets.md +78 -0
- package/opencode/skills/KORTIX-remotion/rules/audio-visualization.md +198 -0
- package/opencode/skills/KORTIX-remotion/rules/audio.md +169 -0
- package/opencode/skills/KORTIX-remotion/rules/calculate-metadata.md +104 -0
- package/opencode/skills/KORTIX-remotion/rules/can-decode.md +75 -0
- package/opencode/skills/KORTIX-remotion/rules/charts.md +120 -0
- package/opencode/skills/KORTIX-remotion/rules/compositions.md +141 -0
- package/opencode/skills/KORTIX-remotion/rules/display-captions.md +184 -0
- package/opencode/skills/KORTIX-remotion/rules/extract-frames.md +229 -0
- package/opencode/skills/KORTIX-remotion/rules/ffmpeg.md +38 -0
- package/opencode/skills/KORTIX-remotion/rules/fonts.md +152 -0
- package/opencode/skills/KORTIX-remotion/rules/get-audio-duration.md +58 -0
- package/opencode/skills/KORTIX-remotion/rules/get-video-dimensions.md +68 -0
- package/opencode/skills/KORTIX-remotion/rules/get-video-duration.md +58 -0
- package/opencode/skills/KORTIX-remotion/rules/gifs.md +141 -0
- package/opencode/skills/KORTIX-remotion/rules/images.md +130 -0
- package/opencode/skills/KORTIX-remotion/rules/import-srt-captions.md +69 -0
- package/opencode/skills/KORTIX-remotion/rules/light-leaks.md +73 -0
- package/opencode/skills/KORTIX-remotion/rules/lottie.md +68 -0
- package/opencode/skills/KORTIX-remotion/rules/maps.md +401 -0
- package/opencode/skills/KORTIX-remotion/rules/measuring-dom-nodes.md +35 -0
- package/opencode/skills/KORTIX-remotion/rules/measuring-text.md +143 -0
- package/opencode/skills/KORTIX-remotion/rules/parameters.md +98 -0
- package/opencode/skills/KORTIX-remotion/rules/sequencing.md +118 -0
- package/opencode/skills/KORTIX-remotion/rules/subtitles.md +36 -0
- package/opencode/skills/KORTIX-remotion/rules/tailwind.md +11 -0
- package/opencode/skills/KORTIX-remotion/rules/text-animations.md +20 -0
- package/opencode/skills/KORTIX-remotion/rules/timing.md +179 -0
- package/opencode/skills/KORTIX-remotion/rules/transcribe-captions.md +70 -0
- package/opencode/skills/KORTIX-remotion/rules/transitions.md +197 -0
- package/opencode/skills/KORTIX-remotion/rules/transparent-videos.md +106 -0
- package/opencode/skills/KORTIX-remotion/rules/trimming.md +53 -0
- package/opencode/skills/KORTIX-remotion/rules/videos.md +171 -0
- package/opencode/skills/KORTIX-secrets/SKILL.md +280 -0
- package/opencode/skills/KORTIX-semantic-search/SKILL.md +213 -0
- package/opencode/skills/KORTIX-session-search/SKILL.md +807 -0
- package/opencode/skills/KORTIX-session-search/Untitled +1 -0
- package/opencode/skills/KORTIX-skill-creator/SKILL.md +163 -0
- package/opencode/skills/KORTIX-web-research/SKILL.md +69 -0
- package/opencode/skills/KORTIX-xlsx/LICENSE.txt +30 -0
- package/opencode/skills/KORTIX-xlsx/SKILL.md +549 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/__init__.py +0 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/pack.py +159 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/soffice.py +183 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/unpack.py +132 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validate.py +111 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/__init__.py +15 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/base.py +847 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/docx.py +446 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/pptx.py +275 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/redlining.py +247 -0
- package/opencode/skills/KORTIX-xlsx/scripts/recalc.py +184 -0
- package/opencode/tools/image-gen.ts +342 -0
- package/opencode/tools/image-search.ts +190 -0
- package/opencode/tools/memory-get.ts +168 -0
- package/opencode/tools/memory-search.ts +247 -0
- package/opencode/tools/presentation-gen.ts +723 -0
- package/opencode/tools/scrape-webpage.ts +115 -0
- package/opencode/tools/scripts/.python-version +1 -0
- package/opencode/tools/scripts/convert_pdf.py +184 -0
- package/opencode/tools/scripts/convert_pptx.py +562 -0
- package/opencode/tools/scripts/pyproject.toml +11 -0
- package/opencode/tools/scripts/uv.lock +287 -0
- package/opencode/tools/scripts/validate_slide.py +74 -0
- package/opencode/tools/show-user.ts +217 -0
- package/opencode/tools/tests/e2e-presentation-fix.ts +277 -0
- package/opencode/tools/tests/image-gen.test.ts +215 -0
- package/opencode/tools/tests/image-search.test.ts +125 -0
- package/opencode/tools/tests/memory-system-benchmark.ts +1076 -0
- package/opencode/tools/tests/presentation-gen.test.ts +389 -0
- package/opencode/tools/tests/scrape-webpage.test.ts +74 -0
- package/opencode/tools/tests/show-user.test.ts +241 -0
- package/opencode/tools/tests/video-gen.test.ts +110 -0
- package/opencode/tools/tests/web-search.test.ts +106 -0
- package/opencode/tools/video-gen.ts +200 -0
- package/opencode/tools/web-search.ts +153 -0
- package/opencode/tsconfig.json +29 -0
- package/package.json +36 -0
- package/patch-agent-browser.js +100 -0
- package/postinstall.sh +88 -0
- package/services/KORTIX-presentation-viewer/run +37 -0
- package/services/agent-browser-viewer/run +48 -0
- package/services/kortix-master/run +16 -0
- package/services/lss-sync/run +22 -0
- package/services/opencode-serve/run +25 -0
- package/services/opencode-web/run +21 -0
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kortix-paper-creator
|
|
3
|
+
description: "Scientific paper writing in LaTeX -- full pipeline from structure to compiled PDF. TDD-driven: every section is compiled and verified before moving to the next. Covers project scaffolding, citation management (OpenAlex to BibTeX), per-section academic writing with self-reflection, figure/table inclusion, LaTeX compilation, and comprehensive verification. Triggers on: 'write a paper', 'create a paper', 'academic paper about', 'scientific paper', 'LaTeX paper', 'write up results as a paper', 'draft a paper on', 'research paper about', any request to produce a formal academic/scientific paper in LaTeX. Assumes research findings, data, and/or figures already exist or will be provided -- this skill handles the WRITING, not the experimentation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Scientific Paper Creator
|
|
7
|
+
|
|
8
|
+
Write publication-quality scientific papers in LaTeX with a **test-driven workflow**: every section is compiled and verified before moving to the next. The paper is never in a broken state.
|
|
9
|
+
|
|
10
|
+
## Bundled Resources
|
|
11
|
+
|
|
12
|
+
This skill includes ready-to-use scripts and templates. Paths are relative to the skill directory (find it via `glob("**/KORTIX-paper-creator/")`):
|
|
13
|
+
|
|
14
|
+
| Resource | Path | Purpose |
|
|
15
|
+
|----------|------|---------|
|
|
16
|
+
| **LaTeX template** | `assets/template.tex` | Minimal IMRaD template -- copy to `main.tex` |
|
|
17
|
+
| **BibTeX generator** | `scripts/openalex_to_bibtex.py` | Convert OpenAlex API JSON to `.bib` entries |
|
|
18
|
+
| **Compiler** | `scripts/compile.sh` | `pdflatex + bibtex` pipeline with error reporting |
|
|
19
|
+
| **Verifier** | `scripts/verify.sh` | TDD verification suite (12 checks) |
|
|
20
|
+
|
|
21
|
+
## The TDD Rule
|
|
22
|
+
|
|
23
|
+
**After writing every section:**
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
1. WRITE section → sections/{name}.tex
|
|
27
|
+
2. COMPILE: bash compile.sh paper/{slug}/main.tex
|
|
28
|
+
3. VERIFY: bash verify.sh paper/{slug}/
|
|
29
|
+
4. If FAIL → FIX → go to 2
|
|
30
|
+
5. If PASS → move to next section
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The paper must compile and pass verification at every step. Never batch errors. Never skip verification. This is non-negotiable.
|
|
34
|
+
|
|
35
|
+
## Pipeline Overview
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Phase 1: SCAFFOLD → Create project, copy template, initialize empty sections
|
|
39
|
+
Verify: compiles to valid (empty) PDF ✓
|
|
40
|
+
|
|
41
|
+
Phase 2: CITE → Search literature (OpenAlex), build references.bib
|
|
42
|
+
Verify: bibliography builds without errors ✓
|
|
43
|
+
|
|
44
|
+
Phase 3: WRITE → Per-section composition in writing order
|
|
45
|
+
Verify: compile + verify after EACH section ✓
|
|
46
|
+
|
|
47
|
+
Phase 4: POLISH → Self-reflection pass, strict verification, final build
|
|
48
|
+
Verify: verify.sh --strict passes with zero warnings ✓
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Filesystem Architecture
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
paper/{paper-slug}/
|
|
55
|
+
├── main.tex # Master file (\input sections)
|
|
56
|
+
├── references.bib # BibTeX bibliography
|
|
57
|
+
├── sections/
|
|
58
|
+
│ ├── abstract.tex
|
|
59
|
+
│ ├── introduction.tex
|
|
60
|
+
│ ├── related-work.tex
|
|
61
|
+
│ ├── methods.tex
|
|
62
|
+
│ ├── results.tex
|
|
63
|
+
│ ├── discussion.tex
|
|
64
|
+
│ └── conclusion.tex
|
|
65
|
+
├── figures/ # .pdf/.png figures (+ generation scripts)
|
|
66
|
+
├── data/ # Supporting data, CSVs (optional)
|
|
67
|
+
└── build/ # Compilation output
|
|
68
|
+
└── main.pdf
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Phase 1: Scaffold
|
|
72
|
+
|
|
73
|
+
### 1a. Create project structure
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
SLUG="paper-slug-here"
|
|
77
|
+
mkdir -p "paper/$SLUG"/{sections,figures,data,build}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 1b. Copy and adapt the template
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
SKILL_DIR=$(find . -path "*/KORTIX-paper-creator/assets/template.tex" -exec dirname {} \; | head -1 | sed 's|/assets||')
|
|
84
|
+
cp "$SKILL_DIR/assets/template.tex" "paper/$SLUG/main.tex"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Edit `main.tex`: set `\title{}`, `\author{}`, and adapt `\documentclass` if targeting a specific venue:
|
|
88
|
+
|
|
89
|
+
| Venue | Document class | Notes |
|
|
90
|
+
|-------|---------------|-------|
|
|
91
|
+
| General / arXiv | `\documentclass[11pt,a4paper]{article}` | Default in template |
|
|
92
|
+
| IEEE conference | `\documentclass[conference]{IEEEtran}` | Remove geometry package |
|
|
93
|
+
| ACM conference | `\documentclass[sigconf]{acmart}` | Remove geometry, use acmart bib style |
|
|
94
|
+
| Springer LNCS | `\documentclass{llncs}` | Remove geometry, use splncs04 bib style |
|
|
95
|
+
|
|
96
|
+
### 1c. Initialize section stubs
|
|
97
|
+
|
|
98
|
+
Create each section file with a section header and TODO marker:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
for sec in abstract introduction related-work methods results discussion conclusion; do
|
|
102
|
+
SECTION_TITLE=$(echo "$sec" | sed 's/-/ /g; s/\b\(.\)/\u\1/g')
|
|
103
|
+
if [ "$sec" = "abstract" ]; then
|
|
104
|
+
echo '\begin{abstract}' > "paper/$SLUG/sections/$sec.tex"
|
|
105
|
+
echo "% TODO: Write abstract" >> "paper/$SLUG/sections/$sec.tex"
|
|
106
|
+
echo '\end{abstract}' >> "paper/$SLUG/sections/$sec.tex"
|
|
107
|
+
else
|
|
108
|
+
echo "\\section{$SECTION_TITLE}" > "paper/$SLUG/sections/$sec.tex"
|
|
109
|
+
echo "\\label{sec:$sec}" >> "paper/$SLUG/sections/$sec.tex"
|
|
110
|
+
echo "% TODO: Write $sec" >> "paper/$SLUG/sections/$sec.tex"
|
|
111
|
+
fi
|
|
112
|
+
done
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 1d. Initialize empty bibliography
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
echo "% References for $SLUG" > "paper/$SLUG/references.bib"
|
|
119
|
+
echo "% Generated by openalex_to_bibtex.py and manual entries" >> "paper/$SLUG/references.bib"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 1e. VERIFY: First green state
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
bash "$SKILL_DIR/scripts/compile.sh" "paper/$SLUG/main.tex"
|
|
126
|
+
bash "$SKILL_DIR/scripts/verify.sh" "paper/$SLUG/"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The empty paper must compile cleanly. This is your baseline. Every subsequent change maintains this green state.
|
|
130
|
+
|
|
131
|
+
## Phase 2: Literature & Citations
|
|
132
|
+
|
|
133
|
+
### 2a. Search for papers
|
|
134
|
+
|
|
135
|
+
Load the `kortix-paper-search` skill for OpenAlex API reference. Search strategy:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Seminal/highly-cited papers
|
|
139
|
+
curl -s "https://api.openalex.org/works?search=YOUR+TOPIC&filter=cited_by_count:>50,type:article,has_abstract:true&sort=cited_by_count:desc&per_page=15&select=id,display_name,publication_year,cited_by_count,doi,authorships,abstract_inverted_index&mailto=agent@kortix.ai"
|
|
140
|
+
|
|
141
|
+
# Recent work (last 2-3 years)
|
|
142
|
+
curl -s "https://api.openalex.org/works?search=YOUR+TOPIC&filter=publication_year:>2023,type:article&sort=publication_date:desc&per_page=15&mailto=agent@kortix.ai"
|
|
143
|
+
|
|
144
|
+
# Review/survey papers
|
|
145
|
+
curl -s "https://api.openalex.org/works?search=YOUR+TOPIC&filter=type:review&sort=cited_by_count:desc&per_page=10&mailto=agent@kortix.ai"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 2b. Generate BibTeX entries
|
|
149
|
+
|
|
150
|
+
Pipe OpenAlex results through the converter:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
curl -s "https://api.openalex.org/works?search=YOUR+TOPIC&per_page=20&mailto=agent@kortix.ai" | \
|
|
154
|
+
python3 "$SKILL_DIR/scripts/openalex_to_bibtex.py" >> "paper/$SLUG/references.bib"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
For non-OpenAlex sources (web pages, books, reports), add manual BibTeX entries:
|
|
158
|
+
|
|
159
|
+
```bibtex
|
|
160
|
+
@misc{authorYYYYtitle,
|
|
161
|
+
title = {Page Title},
|
|
162
|
+
author = {Author Name},
|
|
163
|
+
year = {2024},
|
|
164
|
+
url = {https://example.com/page},
|
|
165
|
+
note = {Accessed: 2024-01-15}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@book{authorYYYYbook,
|
|
169
|
+
title = {Book Title},
|
|
170
|
+
author = {First Author and Second Author},
|
|
171
|
+
year = {2024},
|
|
172
|
+
publisher = {Publisher Name},
|
|
173
|
+
edition = {2nd}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 2c. VERIFY: Bibliography builds
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
bash "$SKILL_DIR/scripts/compile.sh" "paper/$SLUG/main.tex"
|
|
181
|
+
bash "$SKILL_DIR/scripts/verify.sh" "paper/$SLUG/"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Check: zero BibTeX errors, all `.bib` entries parse correctly.
|
|
185
|
+
|
|
186
|
+
## Phase 3: Per-Section Writing
|
|
187
|
+
|
|
188
|
+
### Writing Order
|
|
189
|
+
|
|
190
|
+
Write sections in this order (each one builds on context from the previous):
|
|
191
|
+
|
|
192
|
+
1. **Abstract** (draft) -- establishes scope, will be revised last
|
|
193
|
+
2. **Introduction** -- context, problem, gap, contribution
|
|
194
|
+
3. **Methods** -- what you did and how
|
|
195
|
+
4. **Results** -- what you found
|
|
196
|
+
5. **Discussion** -- what it means, limitations
|
|
197
|
+
6. **Related Work** -- needs full paper context to position contribution
|
|
198
|
+
7. **Conclusion** -- recap, future work
|
|
199
|
+
8. **Abstract** (final) -- revise to match actual paper content
|
|
200
|
+
|
|
201
|
+
### The Writing Loop (for each section)
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
1. READ all previously written sections to build context
|
|
205
|
+
2. WRITE the section following the guidance below
|
|
206
|
+
3. COMPILE + VERIFY
|
|
207
|
+
4. SELF-REFLECT: re-read critically
|
|
208
|
+
- Every factual claim has a \cite{}?
|
|
209
|
+
- No filler words or empty hedging?
|
|
210
|
+
- Logical flow between paragraphs?
|
|
211
|
+
- Consistent with other sections?
|
|
212
|
+
- Quantitative where possible?
|
|
213
|
+
5. REVISE if needed → COMPILE + VERIFY again
|
|
214
|
+
6. Section DONE → next
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Section-Specific Guidance
|
|
218
|
+
|
|
219
|
+
#### Abstract (150-300 words)
|
|
220
|
+
|
|
221
|
+
Structure: **Context** (1-2 sentences) → **Problem** → **Approach** → **Key results** (quantitative!) → **Implications**.
|
|
222
|
+
|
|
223
|
+
```latex
|
|
224
|
+
\begin{abstract}
|
|
225
|
+
[Context sentence setting the broad area.]
|
|
226
|
+
[Problem: what gap or challenge exists.]
|
|
227
|
+
[Approach: what this paper does -- "We propose/present/introduce..."]
|
|
228
|
+
[Results: key quantitative findings -- "Our method achieves X\% on Y, outperforming Z by N\%."]
|
|
229
|
+
[Implications: why it matters.]
|
|
230
|
+
\end{abstract}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Rules: No citations in abstract. No undefined acronyms. Every number must appear in the actual results.
|
|
234
|
+
|
|
235
|
+
#### Introduction
|
|
236
|
+
|
|
237
|
+
**Funnel structure:** broad context → specific problem → gap in existing work → your contribution → paper outline.
|
|
238
|
+
|
|
239
|
+
```latex
|
|
240
|
+
\section{Introduction}
|
|
241
|
+
\label{sec:introduction}
|
|
242
|
+
|
|
243
|
+
% Paragraph 1: Broad context (2-3 sentences)
|
|
244
|
+
% Paragraph 2: Narrow to specific problem
|
|
245
|
+
% Paragraph 3: What's been tried, what's missing (the gap)
|
|
246
|
+
% Paragraph 4: Your contribution -- be specific and concrete
|
|
247
|
+
% "Our contributions are as follows:
|
|
248
|
+
% \begin{itemize}
|
|
249
|
+
% \item We propose...
|
|
250
|
+
% \item We demonstrate...
|
|
251
|
+
% \item We release...
|
|
252
|
+
% \end{itemize}"
|
|
253
|
+
% Paragraph 5: Paper outline
|
|
254
|
+
% "The remainder of this paper is organized as follows. \secref{sec:related-work} reviews..."
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Rules: End with explicit contribution list. Every contribution claimed here must be backed by evidence in Results/Discussion.
|
|
258
|
+
|
|
259
|
+
#### Methods
|
|
260
|
+
|
|
261
|
+
**Reproducible detail.** Another researcher should be able to replicate your work from this section alone.
|
|
262
|
+
|
|
263
|
+
```latex
|
|
264
|
+
\section{Methods}
|
|
265
|
+
\label{sec:methods}
|
|
266
|
+
|
|
267
|
+
% Define notation before using it:
|
|
268
|
+
% "Let $\mathcal{D} = \{(x_i, y_i)\}_{i=1}^{N}$ denote the training set..."
|
|
269
|
+
|
|
270
|
+
% Algorithms as pseudocode:
|
|
271
|
+
% \begin{algorithm}[t]
|
|
272
|
+
% \caption{Algorithm Name}
|
|
273
|
+
% \label{alg:name}
|
|
274
|
+
% \begin{algorithmic}[1]
|
|
275
|
+
% \REQUIRE Input description
|
|
276
|
+
% \ENSURE Output description
|
|
277
|
+
% \STATE Step 1
|
|
278
|
+
% \FOR{condition}
|
|
279
|
+
% \STATE Step in loop
|
|
280
|
+
% \ENDFOR
|
|
281
|
+
% \RETURN result
|
|
282
|
+
% \end{algorithmic}
|
|
283
|
+
% \end{algorithm}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Rules: Define all notation. Be precise about dimensions, loss functions, optimization details. Use consistent math notation throughout (define `\newcommand` macros in `main.tex` preamble).
|
|
287
|
+
|
|
288
|
+
#### Results
|
|
289
|
+
|
|
290
|
+
**Lead with the main finding.** Then support with details.
|
|
291
|
+
|
|
292
|
+
```latex
|
|
293
|
+
\section{Results}
|
|
294
|
+
\label{sec:results}
|
|
295
|
+
|
|
296
|
+
% Paragraph 1: Main result (the headline number)
|
|
297
|
+
% "Our method achieves X\% accuracy on Y benchmark, representing a Z\% improvement
|
|
298
|
+
% over the previous state of the art~\citep{baseline2024}."
|
|
299
|
+
|
|
300
|
+
% Table with main results:
|
|
301
|
+
% \begin{table}[t]
|
|
302
|
+
% \centering
|
|
303
|
+
% \caption{Main results on [benchmark]. Bold = best, underline = second best.}
|
|
304
|
+
% \label{tab:main-results}
|
|
305
|
+
% \begin{tabular}{lcc}
|
|
306
|
+
% \toprule
|
|
307
|
+
% Method & Metric 1 & Metric 2 \\
|
|
308
|
+
% \midrule
|
|
309
|
+
% Baseline A~\citep{ref} & 82.3 & 91.1 \\
|
|
310
|
+
% Baseline B~\citep{ref} & 84.7 & 92.4 \\
|
|
311
|
+
% \textbf{Ours} & \textbf{87.2} & \textbf{94.1} \\
|
|
312
|
+
% \bottomrule
|
|
313
|
+
% \end{tabular}
|
|
314
|
+
% \end{table}
|
|
315
|
+
|
|
316
|
+
% Subsequent paragraphs: ablation studies, analysis, per-dataset breakdown
|
|
317
|
+
% Every figure and table MUST be referenced: "As shown in \figref{fig:x}..."
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Rules: Every figure/table referenced in text at least once. Report statistical significance or confidence intervals where applicable. No cherry-picking -- report all metrics, including where you don't win.
|
|
321
|
+
|
|
322
|
+
#### Discussion
|
|
323
|
+
|
|
324
|
+
**Interpretation, not repetition.** Don't restate results -- explain what they mean.
|
|
325
|
+
|
|
326
|
+
```latex
|
|
327
|
+
\section{Discussion}
|
|
328
|
+
\label{sec:discussion}
|
|
329
|
+
|
|
330
|
+
% Paragraph 1: Interpret main findings -- what do the results tell us?
|
|
331
|
+
% Paragraph 2: Compare with prior work -- how do results relate to existing literature?
|
|
332
|
+
% Paragraph 3: Limitations -- be honest and specific
|
|
333
|
+
% "Our approach has several limitations. First, ... Second, ..."
|
|
334
|
+
% Paragraph 4: Broader implications -- what does this enable?
|
|
335
|
+
% Paragraph 5: Future work -- concrete directions, not vague hand-waving
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Rules: Limitations must be genuine, not token gestures. Future work should be specific enough to be actionable.
|
|
339
|
+
|
|
340
|
+
#### Related Work
|
|
341
|
+
|
|
342
|
+
Written **after** Methods/Results/Discussion so you can precisely position your contribution against the literature.
|
|
343
|
+
|
|
344
|
+
```latex
|
|
345
|
+
\section{Related Work}
|
|
346
|
+
\label{sec:related-work}
|
|
347
|
+
|
|
348
|
+
% Organize THEMATICALLY, not chronologically:
|
|
349
|
+
% \subsection{Theme A}
|
|
350
|
+
% "Several works have addressed ... \citep{a,b,c}. Specifically, A does X, B does Y.
|
|
351
|
+
% In contrast, our approach differs by Z."
|
|
352
|
+
%
|
|
353
|
+
% \subsection{Theme B}
|
|
354
|
+
% "Another line of work focuses on ... \citep{d,e,f}.
|
|
355
|
+
% While these methods ..., they do not address ..., which is the focus of our work."
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Rules: For each group of related work, explicitly state how your work differs. Don't just list papers -- synthesize and contrast. Every paper cited here should be in `references.bib`.
|
|
359
|
+
|
|
360
|
+
#### Conclusion
|
|
361
|
+
|
|
362
|
+
**No new information.** Brief recap of contribution and results, then future directions.
|
|
363
|
+
|
|
364
|
+
```latex
|
|
365
|
+
\section{Conclusion}
|
|
366
|
+
\label{sec:conclusion}
|
|
367
|
+
|
|
368
|
+
% Paragraph 1: What we did and what we found (3-4 sentences max)
|
|
369
|
+
% "In this paper, we presented [method] for [problem].
|
|
370
|
+
% Our approach [key insight]. Experiments on [benchmarks] demonstrate [main result]."
|
|
371
|
+
%
|
|
372
|
+
% Paragraph 2: Future directions (2-3 sentences)
|
|
373
|
+
% "In future work, we plan to explore ... and extend our approach to ..."
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Rules: Claims here must match what's in Results. Don't overclaim. 0.5-1 page max.
|
|
377
|
+
|
|
378
|
+
### LaTeX Conventions
|
|
379
|
+
|
|
380
|
+
Enforce these throughout all sections:
|
|
381
|
+
|
|
382
|
+
**Cross-references** (defined as macros in template):
|
|
383
|
+
```latex
|
|
384
|
+
\figref{fig:architecture} % → "Figure 1" (via cleveref)
|
|
385
|
+
\tabref{tab:main-results} % → "Table 2"
|
|
386
|
+
\eqnref{eq:loss} % → "Equation 3"
|
|
387
|
+
\secref{sec:methods} % → "Section 4"
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
**Citations:**
|
|
391
|
+
```latex
|
|
392
|
+
\citet{smith2024} % → "Smith et al. (2024)" (textual -- subject of sentence)
|
|
393
|
+
\citep{smith2024} % → "(Smith et al., 2024)" (parenthetical)
|
|
394
|
+
\citep{smith2024,jones2023} % → "(Smith et al., 2024; Jones et al., 2023)"
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Use `\citet` when the author is the grammatical subject: "**\citet{smith2024} showed** that...". Use `\citep` for parenthetical: "Recent work has shown significant gains **\citep{smith2024}**."
|
|
398
|
+
|
|
399
|
+
**Figures:**
|
|
400
|
+
```latex
|
|
401
|
+
\begin{figure}[t]
|
|
402
|
+
\centering
|
|
403
|
+
\includegraphics[width=\linewidth]{figure-name}
|
|
404
|
+
\caption{Descriptive caption. Best viewed in color.}
|
|
405
|
+
\label{fig:figure-name}
|
|
406
|
+
\end{figure}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
**Tables:**
|
|
410
|
+
```latex
|
|
411
|
+
\begin{table}[t]
|
|
412
|
+
\centering
|
|
413
|
+
\caption{Caption ABOVE the table (convention).}
|
|
414
|
+
\label{tab:table-name}
|
|
415
|
+
\begin{tabular}{lcc}
|
|
416
|
+
\toprule
|
|
417
|
+
Column 1 & Column 2 & Column 3 \\
|
|
418
|
+
\midrule
|
|
419
|
+
Row 1 & data & data \\
|
|
420
|
+
Row 2 & data & data \\
|
|
421
|
+
\bottomrule
|
|
422
|
+
\end{tabular}
|
|
423
|
+
\end{table}
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
**Math notation:** Define reusable macros in the preamble of `main.tex`:
|
|
427
|
+
```latex
|
|
428
|
+
\newcommand{\loss}{\mathcal{L}}
|
|
429
|
+
\newcommand{\model}{\mathcal{M}}
|
|
430
|
+
\newcommand{\dataset}{\mathcal{D}}
|
|
431
|
+
\newcommand{\R}{\mathbb{R}}
|
|
432
|
+
\newcommand{\E}{\mathbb{E}}
|
|
433
|
+
\newcommand{\argmin}{\operatorname{argmin}}
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
## Phase 4: Polish & Final Verification
|
|
437
|
+
|
|
438
|
+
### 4a. Self-Reflection Pass
|
|
439
|
+
|
|
440
|
+
After all sections are written, re-read the entire paper and check:
|
|
441
|
+
|
|
442
|
+
1. **Consistency:** Same terminology throughout? Abstract claims match Results numbers?
|
|
443
|
+
2. **Redundancy:** Any paragraph repeated across sections? Cut ruthlessly.
|
|
444
|
+
3. **Flow:** Smooth transitions between sections? Each section starts by connecting to the previous?
|
|
445
|
+
4. **Claims:** Every claim in Intro/Abstract backed by evidence in Results?
|
|
446
|
+
5. **Notation:** Math notation consistent? All symbols defined before first use?
|
|
447
|
+
|
|
448
|
+
### 4b. Strict Verification
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
bash "$SKILL_DIR/scripts/verify.sh" "paper/$SLUG/" --strict
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
The `--strict` flag treats warnings as failures. All 12 checks must pass:
|
|
455
|
+
|
|
456
|
+
- [ ] PDF exists and is non-trivial size
|
|
457
|
+
- [ ] Zero LaTeX errors
|
|
458
|
+
- [ ] Zero undefined `\ref{}` references
|
|
459
|
+
- [ ] Zero undefined `\cite{}` citations
|
|
460
|
+
- [ ] Zero BibTeX errors
|
|
461
|
+
- [ ] Zero overfull boxes > 10pt
|
|
462
|
+
- [ ] All referenced figure files exist
|
|
463
|
+
- [ ] All sections have content (no empty stubs)
|
|
464
|
+
- [ ] All `.bib` entries cited at least once (no dead refs)
|
|
465
|
+
- [ ] Zero TODO/FIXME comments remaining
|
|
466
|
+
- [ ] Abstract word count 100-300
|
|
467
|
+
- [ ] All figures/tables referenced in text
|
|
468
|
+
|
|
469
|
+
### 4c. Final Build
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
bash "$SKILL_DIR/scripts/compile.sh" "paper/$SLUG/main.tex" --clean
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
The `--clean` flag removes auxiliary files, leaving only the PDF. Deliverable: `paper/{slug}/build/main.pdf`.
|
|
476
|
+
|
|
477
|
+
## Figure Generation
|
|
478
|
+
|
|
479
|
+
When the paper needs figures, generate them as PDF or high-res PNG and save to `figures/`. Keep the generation script alongside for reproducibility.
|
|
480
|
+
|
|
481
|
+
### matplotlib (recommended for most plots)
|
|
482
|
+
|
|
483
|
+
```python
|
|
484
|
+
import matplotlib.pyplot as plt
|
|
485
|
+
import matplotlib
|
|
486
|
+
matplotlib.rcParams.update({
|
|
487
|
+
'font.size': 12,
|
|
488
|
+
'font.family': 'serif',
|
|
489
|
+
'figure.figsize': (6, 4),
|
|
490
|
+
'figure.dpi': 150,
|
|
491
|
+
'savefig.dpi': 300,
|
|
492
|
+
'savefig.bbox': 'tight',
|
|
493
|
+
'axes.grid': True,
|
|
494
|
+
'grid.alpha': 0.3,
|
|
495
|
+
})
|
|
496
|
+
|
|
497
|
+
fig, ax = plt.subplots()
|
|
498
|
+
# ... plot data ...
|
|
499
|
+
ax.set_xlabel('X Label')
|
|
500
|
+
ax.set_ylabel('Y Label')
|
|
501
|
+
ax.legend()
|
|
502
|
+
fig.savefig('paper/{slug}/figures/plot-name.pdf')
|
|
503
|
+
plt.close()
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
Rules:
|
|
507
|
+
- **Always save as PDF** for vector quality (PNG only for raster images like photos/heatmaps)
|
|
508
|
+
- Font size >= 10pt (readable when scaled to column width)
|
|
509
|
+
- Save the plotting script to `figures/plot_name.py` for reproducibility
|
|
510
|
+
- Use consistent color palettes across all figures
|
|
511
|
+
- Include axis labels, legends, and titles
|
|
512
|
+
|
|
513
|
+
### Diagrams and Architecture Figures
|
|
514
|
+
|
|
515
|
+
For architecture/flow diagrams, either:
|
|
516
|
+
- Generate with matplotlib/tikz and save as PDF
|
|
517
|
+
- Use `image-gen` tool and save to `figures/`
|
|
518
|
+
- Hand-draw in any tool and export as PDF/PNG
|
|
519
|
+
|
|
520
|
+
## LaTeX Troubleshooting
|
|
521
|
+
|
|
522
|
+
Common errors and fixes:
|
|
523
|
+
|
|
524
|
+
| Error | Cause | Fix |
|
|
525
|
+
|-------|-------|-----|
|
|
526
|
+
| `Missing $ inserted` | Math symbol outside math mode | Wrap in `$...$` |
|
|
527
|
+
| `Undefined control sequence` | Typo in command or missing package | Check spelling, add `\usepackage` |
|
|
528
|
+
| `File not found` | Wrong path in `\includegraphics` | Check `\graphicspath` and filename |
|
|
529
|
+
| `Citation undefined` | Key mismatch between `\cite` and `.bib` | Check exact key spelling |
|
|
530
|
+
| `Missing \begin{document}` | Error in preamble | Check for typos above `\begin{document}` |
|
|
531
|
+
| `Overfull \hbox` | Line too wide | Rephrase, add `\linebreak`, or use `\sloppy` locally |
|
|
532
|
+
| `Package clash` | Two packages conflict | Check compatibility, load order matters |
|
|
533
|
+
|
|
534
|
+
When compile fails: read the **first** error in the log (subsequent errors often cascade from the first). Fix it, recompile. Don't try to fix multiple errors at once.
|
|
535
|
+
|
|
536
|
+
## Scientific Writing Standards
|
|
537
|
+
|
|
538
|
+
Quick-reference checklist for quality prose:
|
|
539
|
+
|
|
540
|
+
- **Active voice:** "We propose X" not "X is proposed"
|
|
541
|
+
- **Strong verbs:** "achieves" not "is able to achieve", "reduces" not "leads to a reduction in"
|
|
542
|
+
- **Quantitative:** "improves by 12%" not "significantly improves"
|
|
543
|
+
- **Define before use:** Every acronym, symbol, and technical term defined on first use
|
|
544
|
+
- **Parallel structure:** Lists and comparisons use the same grammatical form
|
|
545
|
+
- **No orphan pronouns:** "This approach" not "This" alone at the start of a sentence
|
|
546
|
+
- **Hedging (appropriate):** "suggests" / "indicates" for uncertain claims; "demonstrates" / "establishes" for proven ones
|
|
547
|
+
- **Person:** "We" for authors' actions; passive voice sparingly for general facts; never "I" in multi-author papers
|
|
548
|
+
- **Tense:** Present for established facts and paper structure ("Section 3 presents..."); past for what you did ("We trained the model on...")
|
|
549
|
+
- **Citations as nouns:** "\citet{smith2024} showed..." (not "It was shown in \citep{smith2024}...")
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
% Minimal IMRaD Scientific Paper Template
|
|
2
|
+
% Usage: Copy this to paper/{slug}/main.tex and adapt
|
|
3
|
+
%
|
|
4
|
+
% Document class options:
|
|
5
|
+
% \documentclass[11pt,a4paper]{article} -- default, any venue
|
|
6
|
+
% \documentclass[conference]{IEEEtran} -- IEEE conferences
|
|
7
|
+
% \documentclass[sigconf]{acmart} -- ACM conferences
|
|
8
|
+
% \documentclass{llncs} -- Springer LNCS
|
|
9
|
+
%
|
|
10
|
+
% To switch venue: replace the documentclass line and adjust package imports.
|
|
11
|
+
% Most of this template works unchanged across venues.
|
|
12
|
+
|
|
13
|
+
\documentclass[11pt,a4paper]{article}
|
|
14
|
+
|
|
15
|
+
% === Core Packages ===
|
|
16
|
+
\usepackage[utf8]{inputenc}
|
|
17
|
+
\usepackage[T1]{fontenc}
|
|
18
|
+
\usepackage{lmodern} % Better fonts
|
|
19
|
+
\usepackage[margin=1in]{geometry} % Margins (remove for venue templates)
|
|
20
|
+
\usepackage{microtype} % Better typography
|
|
21
|
+
|
|
22
|
+
% === Math ===
|
|
23
|
+
\usepackage{amsmath,amssymb,amsfonts}
|
|
24
|
+
\usepackage{mathtools} % Extensions to amsmath
|
|
25
|
+
|
|
26
|
+
% === Figures & Tables ===
|
|
27
|
+
\usepackage{graphicx}
|
|
28
|
+
\usepackage{booktabs} % Professional tables (\toprule, \midrule, \bottomrule)
|
|
29
|
+
\usepackage{subcaption} % Subfigures
|
|
30
|
+
\usepackage{float} % Better float control
|
|
31
|
+
|
|
32
|
+
% === Algorithms ===
|
|
33
|
+
\usepackage{algorithm}
|
|
34
|
+
\usepackage{algorithmic}
|
|
35
|
+
|
|
36
|
+
% === Code Listings (optional) ===
|
|
37
|
+
\usepackage{listings}
|
|
38
|
+
\lstset{basicstyle=\ttfamily\small, breaklines=true, frame=single}
|
|
39
|
+
|
|
40
|
+
% === References & Hyperlinks ===
|
|
41
|
+
\usepackage[numbers]{natbib} % Citations: \citep{}, \citet{}
|
|
42
|
+
\usepackage{hyperref}
|
|
43
|
+
\hypersetup{
|
|
44
|
+
colorlinks=true,
|
|
45
|
+
linkcolor=blue,
|
|
46
|
+
citecolor=blue,
|
|
47
|
+
urlcolor=blue
|
|
48
|
+
}
|
|
49
|
+
\usepackage{cleveref} % Smart references: \cref{fig:x} -> "Figure 1"
|
|
50
|
+
|
|
51
|
+
% === Convenience Macros ===
|
|
52
|
+
\newcommand{\figref}[1]{\cref{#1}}
|
|
53
|
+
\newcommand{\tabref}[1]{\cref{#1}}
|
|
54
|
+
\newcommand{\eqnref}[1]{\cref{#1}}
|
|
55
|
+
\newcommand{\secref}[1]{\cref{#1}}
|
|
56
|
+
\newcommand{\algref}[1]{\cref{#1}}
|
|
57
|
+
|
|
58
|
+
% === Paper-Specific Macros (define your own here) ===
|
|
59
|
+
% \newcommand{\methodname}{MethodName}
|
|
60
|
+
% \newcommand{\loss}{\mathcal{L}}
|
|
61
|
+
% \newcommand{\R}{\mathbb{R}}
|
|
62
|
+
|
|
63
|
+
% === Graphics Path ===
|
|
64
|
+
\graphicspath{{figures/}}
|
|
65
|
+
|
|
66
|
+
% === Title Block ===
|
|
67
|
+
\title{Paper Title Here}
|
|
68
|
+
\author{
|
|
69
|
+
First Author\thanks{Affiliation, email@example.com} \and
|
|
70
|
+
Second Author\thanks{Affiliation, email@example.com}
|
|
71
|
+
}
|
|
72
|
+
\date{} % Leave empty for submission; set for preprints
|
|
73
|
+
|
|
74
|
+
\begin{document}
|
|
75
|
+
|
|
76
|
+
\maketitle
|
|
77
|
+
|
|
78
|
+
% === Abstract ===
|
|
79
|
+
\input{sections/abstract}
|
|
80
|
+
|
|
81
|
+
% === Main Sections ===
|
|
82
|
+
\input{sections/introduction}
|
|
83
|
+
\input{sections/related-work}
|
|
84
|
+
\input{sections/methods}
|
|
85
|
+
\input{sections/results}
|
|
86
|
+
\input{sections/discussion}
|
|
87
|
+
\input{sections/conclusion}
|
|
88
|
+
|
|
89
|
+
% === Acknowledgments (optional) ===
|
|
90
|
+
% \section*{Acknowledgments}
|
|
91
|
+
% We thank...
|
|
92
|
+
|
|
93
|
+
% === Bibliography ===
|
|
94
|
+
\bibliographystyle{plainnat}
|
|
95
|
+
\bibliography{references}
|
|
96
|
+
|
|
97
|
+
% === Appendix (optional) ===
|
|
98
|
+
% \appendix
|
|
99
|
+
% \input{sections/appendix}
|
|
100
|
+
|
|
101
|
+
\end{document}
|