citeget 0.1.1__tar.gz

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.
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: acquire-references
3
+ description: Acquire PDFs of academic references from a document. Parses reference sections, tries direct URLs and arxiv, falls back to libgen search with smart query strategies. Logs all attempts and produces references.md + missed_references.md.
4
+ argument-hint: <path-to-document-with-references> [--work-dir <dir>]
5
+ allowed-tools: Bash, Read, Write, Grep, Glob, Agent
6
+ ---
7
+
8
+ # Acquire References
9
+
10
+ Download PDFs for all references cited in an academic document. Uses a
11
+ multi-strategy approach: direct URL → arxiv → libgen search (with
12
+ progressively adjusted query specificity).
13
+
14
+ ## Working directory resolution
15
+
16
+ The system needs a **work directory** where it puts downloads, logs, and
17
+ output files. Resolution rules (in priority order):
18
+
19
+ 1. **User specifies a full path** → use it (create if needed; parent must exist).
20
+ 2. **User specifies a bare name** (no slashes) → use `~/Downloads/{name}`.
21
+ 3. **User provides a reference file but no work dir** → derive automatically:
22
+ `{reference_file_stem} -- acquired_references/` in the same directory as
23
+ the file.
24
+ 4. **Neither given** → ask the user.
25
+
26
+ ```python
27
+ from citeget import resolve_work_dir
28
+
29
+ work_dir = resolve_work_dir(reference_file="/path/to/paper.md")
30
+ # -> /path/to/paper -- acquired_references/
31
+
32
+ work_dir = resolve_work_dir(work_dir="~/projects/refs")
33
+ # -> /Users/.../projects/refs/
34
+
35
+ work_dir = resolve_work_dir(work_dir="my_refs")
36
+ # -> ~/Downloads/my_refs/
37
+ ```
38
+
39
+ Inside the work directory, PDFs go into a `references/` subdirectory.
40
+
41
+ ## Pre-flight: checking existing downloads
42
+
43
+ Before acquiring, check what's already downloaded. Report skips to the user
44
+ so they can rename/move files to force re-download.
45
+
46
+ ```python
47
+ from citeget import check_existing_downloads
48
+
49
+ to_acquire, already_have = check_existing_downloads(refs, download_dir)
50
+ # already_have is [(Reference, filepath), ...]
51
+ # to_acquire is [Reference, ...]
52
+ ```
53
+
54
+ `acquire_all_references()` does this automatically and prints skip info.
55
+
56
+ ## Core workflow
57
+
58
+ ```python
59
+ from citeget import (
60
+ parse_references_section,
61
+ resolve_work_dir,
62
+ acquire_all_references,
63
+ write_references_md,
64
+ write_missed_references_md,
65
+ )
66
+ from pathlib import Path
67
+ from datetime import datetime
68
+
69
+ # 1. Resolve work directory
70
+ work_dir = resolve_work_dir(reference_file="paper.md")
71
+ download_dir = work_dir / "references"
72
+
73
+ # 2. Parse references
74
+ refs = parse_references_section(refs_text)
75
+
76
+ # 3. Acquire (auto-skips existing, auto-generates timestamped log)
77
+ successes, failures, log_entries = acquire_all_references(
78
+ refs,
79
+ download_dir=download_dir,
80
+ work_dir=work_dir, # enables auto log naming
81
+ )
82
+ # Log written to: {work_dir}/{datetime}__acquisition_log.txt
83
+
84
+ # 4. Write output files
85
+ write_references_md(successes, download_dir, work_dir / "references.md")
86
+ ts = datetime.now().strftime("%Y-%m-%d_%H%M")
87
+ write_missed_references_md(failures, work_dir / f"{ts}_missed_references.md")
88
+ ```
89
+
90
+ ## Log format
91
+
92
+ The acquisition log (`{datetime}__acquisition_log.txt`) is TSV with columns:
93
+ ```
94
+ timestamp ref_number ref_title query query_type num_results matched best_score best_title error
95
+ ```
96
+ Every attempt is logged — direct URL, libgen, arxiv, sci-hub — not just libgen.
97
+
98
+ ## File naming
99
+
100
+ Downloaded files use APA 7 citation format:
101
+ ```
102
+ {title} ({authors_apa7}, {year}).pdf
103
+ ```
104
+ Where authors_apa7 is: 1 author → "Smith", 2 → "Smith & Jones", 3+ → "Smith et al."
105
+
106
+ Example: `Retiming synchronous circuitry (Leiserson & Saxe, 1991).pdf`
107
+
108
+ ## Tips
109
+
110
+ - **Skip non-papers**: Exclude web pages (Math Genealogy, Wikipedia),
111
+ unpublished preprints with no PDF, and similar non-acquirable items
112
+ - **Rate limiting**: The default 2s delay between operations is respectful.
113
+ Don't decrease it.
114
+ - **Re-downloading**: Already-downloaded files are reported and skipped. To
115
+ force re-download, the user must rename or move the existing file.
116
+ - **Matching**: Results are scored on title word overlap (60%), author match
117
+ (25%), and year match (15%). Threshold is 0.4.
118
+ - **Topics**: Try "articles" first (for papers), then "books" (for books/
119
+ proceedings). Conference papers often appear under "articles".
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: check-submission-fit
3
+ description: Assess how well a draft article fits a set of target journals and recommend the best venue. Compares the article's scope, tone, length, audience, and contribution type against journal profiles. Use when deciding where to submit an article.
4
+ argument-hint: <article_file_or_dir> [journal1,journal2,...]
5
+ allowed-tools: Read, Write, Glob, Grep, WebSearch
6
+ ---
7
+
8
+ # Check Article–Journal Fit
9
+
10
+ Evaluate how well a draft article matches the requirements and culture of one or more journals, and recommend the best submission venue.
11
+
12
+ ## Arguments
13
+
14
+ - `$0` — Path to the article file or directory (required)
15
+ - `$1` — Comma-separated list of journal keys to evaluate (optional; if omitted, evaluates all known journals)
16
+ - `ieee_software` — IEEE Software
17
+ - `cacm_practice` — CACM Practice
18
+ - `cacm_research` — CACM Research and Advances
19
+ - `cacm_viewpoints` — CACM Viewpoints/Opinion
20
+ - `ieee_tse` — IEEE Transactions on Software Engineering
21
+ - `acm_queue` — ACM Queue
22
+
23
+ ## Workflow
24
+
25
+ ### Phase 1: Extract Article Profile
26
+
27
+ Read the full article and extract:
28
+
29
+ | Dimension | Value |
30
+ |-----------|-------|
31
+ | Word count | (count) |
32
+ | Abstract word count | (count) |
33
+ | Number of references | (count) |
34
+ | Number of figures/tables | (count) |
35
+ | Primary audience | researchers / practitioners / both / general CS |
36
+ | Contribution type | empirical study / tool / experience report / opinion / survey / vision |
37
+ | Has methodology section? | yes / no |
38
+ | Has evaluation/data? | yes / no |
39
+ | Tone | formal/academic / semi-formal / conversational |
40
+ | Main domain | SE / systems / PL / AI / security / distributed / general CS |
41
+ | Is novel research? | yes / no |
42
+ | Industry relevance | high / medium / low |
43
+
44
+ ### Phase 2: Load Journal Profiles
45
+
46
+ Read `data/journal_profiles.json` from the project directory. For each journal in the evaluation list, extract its profile.
47
+
48
+ ### Phase 3: Score Each Journal
49
+
50
+ For each journal, score the article-journal fit on 6 dimensions (1=poor, 3=good, 5=excellent):
51
+
52
+ #### Dimension Scoring Rubric
53
+
54
+ **1. Scope Match**
55
+ - Does the article's subject fall within what this journal covers?
56
+ - 5: Core topic of this venue; 3: Adjacent; 1: Out of scope
57
+
58
+ **2. Contribution Type Match**
59
+ - Does the article's type (empirical, opinion, tool, etc.) match what the journal publishes?
60
+ - 5: Exact match; 3: Acceptable variant; 1: Mismatch
61
+
62
+ **3. Audience Match**
63
+ - Does the article's assumed audience match the journal's readership?
64
+ - 5: Perfect fit; 3: Requires reframing; 1: Wrong audience
65
+
66
+ **4. Tone Match**
67
+ - Is the writing style appropriate for this journal?
68
+ - 5: No adjustment needed; 3: Minor tuning; 1: Major rewrite needed
69
+
70
+ **5. Length/Format Feasibility**
71
+ - Can the article be adapted to fit this journal's format requirements with reasonable effort?
72
+ - 5: Already fits; 3: Moderate cuts/additions needed; 1: Fundamental restructuring required
73
+
74
+ **6. Novelty vs. Accessibility Balance**
75
+ - Is the article's novelty/depth appropriate for this venue?
76
+ - 5: Perfect balance; 3: Slightly off; 1: Too academic for a magazine or too shallow for a journal
77
+
78
+ #### Adjustment Factors
79
+
80
+ Apply these as ±1 adjustments to the total:
81
+ - `+1` — Article has strong practitioner takeaways (favors IEEE Software, ACM Queue)
82
+ - `+1` — Article has rigorous methodology + evaluation (favors IEEE TSE)
83
+ - `+1` — Article is broadly accessible to non-SE CS readers (favors CACM)
84
+ - `-1` — Article is too long to fit this journal even with cuts
85
+ - `-1` — Article is invitation-only and user has no invite (ACM Queue)
86
+ - `-1` — Article is primarily about a narrow tool without generalizable lessons (penalizes CACM Research)
87
+
88
+ ### Phase 4: Produce Fit Report
89
+
90
+ Write a fit report to `output/<article_slug>_fit_report.md`:
91
+
92
+ ```markdown
93
+ # Journal Fit Report: <Title>
94
+
95
+ **Assessed:** <date>
96
+ **Article type:** <contribution type>
97
+ **Current word count:** <count>
98
+
99
+ ---
100
+
101
+ ## Fit Scores
102
+
103
+ | Journal | Scope | Type | Audience | Tone | Length | Novelty | Adjustments | **Total** |
104
+ |---------|-------|------|----------|------|--------|---------|-------------|-----------|
105
+ | IEEE Software | X | X | X | X | X | X | +/-X | **X/30** |
106
+ | CACM Practice | X | X | X | X | X | X | +/-X | **X/30** |
107
+ | CACM Research | X | X | X | X | X | X | +/-X | **X/30** |
108
+ | CACM Viewpoints | X | X | X | X | X | X | +/-X | **X/30** |
109
+ | IEEE TSE | X | X | X | X | X | X | +/-X | **X/30** |
110
+ | ACM Queue | X | X | X | X | X | X | +/-X | **X/30** |
111
+
112
+ ---
113
+
114
+ ## Recommendation
115
+
116
+ **Primary recommendation:** <Journal Name> (score: X/30)
117
+
118
+ <2-3 sentences explaining why this is the best fit>
119
+
120
+ **Backup recommendation:** <Journal Name> (score: X/30)
121
+
122
+ <1-2 sentences>
123
+
124
+ **Not recommended:** <Journal Name> — <reason in one sentence>
125
+
126
+ ---
127
+
128
+ ## What It Would Take
129
+
130
+ ### To submit to <Primary Recommendation>:
131
+ - [ ] <specific change 1>
132
+ - [ ] <specific change 2>
133
+ - [ ] ...
134
+
135
+ ### To submit to <Backup>:
136
+ - [ ] <specific change 1>
137
+ - [ ] ...
138
+
139
+ ---
140
+
141
+ ## Red Flags
142
+
143
+ (Anything that would likely trigger a desk rejection or poor peer review at the recommended venue)
144
+
145
+ - <flag 1>
146
+ - <flag 2>
147
+
148
+ ---
149
+
150
+ ## Notes on Specific Journals
151
+
152
+ <Any other observations about specific journals not captured in scores>
153
+ ```
154
+
155
+ ## Output
156
+
157
+ - `output/<article_slug>_fit_report.md` — Journal fit assessment and recommendations
158
+
159
+ ## Decision Guide
160
+
161
+ Use these heuristics when scores are close:
162
+
163
+ | Article type | Best primary target | Best backup |
164
+ |-------------|---------------------|------------|
165
+ | Empirical study with novel findings | IEEE TSE | CACM Research |
166
+ | Tool/method with practitioner validation | IEEE Software | CACM Practice |
167
+ | Experience report / case study | IEEE Software | CACM Practice |
168
+ | Broad vision / position paper | CACM Research | CACM Viewpoints |
169
+ | Opinion / argument | CACM Viewpoints | IEEE Software |
170
+ | Deep technical practitioner story | ACM Queue (if invited) | IEEE Software |
171
+ | Theoretical contribution | IEEE TSE | CACM Research |
172
+
173
+ ## Notes
174
+
175
+ - Desk rejection is the biggest risk — always prioritize scope and contribution type match
176
+ - IEEE Software and CACM Practice are both practitioner-focused but differ: IEEE Software is SE-specific; CACM Practice targets all of CS
177
+ - CACM's editorial bar is high even for well-written work — the "why does this matter to all of CS?" test is real
178
+ - IEEE TSE reviewers expect rigorous methodology; if there is no evaluation or formal proof, TSE is probably wrong
179
+ - ACM Queue is only worth pursuing if the user has an invitation or a very compelling pitch; flag this clearly
@@ -0,0 +1,208 @@
1
+ ---
2
+ name: format-for-journal
3
+ description: Reformat and adapt a draft article to meet the specific requirements of a target journal (IEEE Software, CACM, IEEE TSE, etc.). Adjusts structure, word count, abstract, references, and required elements. Use when you have a polished draft and need to produce a journal-ready version.
4
+ argument-hint: <article_file_or_dir> <target_journal>
5
+ allowed-tools: Read, Write, Edit, Glob, Grep, WebSearch, Bash(python *)
6
+ ---
7
+
8
+ # Format Article for Journal Submission
9
+
10
+ Transform a draft article into a version that meets the specific structural and formatting requirements of a target journal.
11
+
12
+ ## Arguments
13
+
14
+ - `$0` — Path to the article file (`.md`, `.txt`, `.tex`, or a directory) (required)
15
+ - `$1` — Target journal key (required). One of:
16
+ - `ieee_software` — IEEE Software magazine
17
+ - `cacm_practice` — CACM Practice section
18
+ - `cacm_research` — CACM Research and Advances section
19
+ - `cacm_viewpoints` — CACM Viewpoints/Opinion section
20
+ - `ieee_tse` — IEEE Transactions on Software Engineering
21
+ - `acm_queue` — ACM Queue (note: invitation-only, see notes)
22
+
23
+ ## Workflow
24
+
25
+ ### Phase 1: Load Journal Profile
26
+
27
+ Read `data/journal_profiles.json` from the project directory to get the exact requirements for the target journal. Key dimensions:
28
+
29
+ - Word/page limit
30
+ - Abstract word limit
31
+ - Reference limit
32
+ - Required sections
33
+ - Required elements (takeaways, author bios, etc.)
34
+ - Tone (research vs. practitioner vs. broad audience)
35
+ - Citation style
36
+
37
+ ### Phase 2: Inventory the Draft
38
+
39
+ Read the full draft and build an inventory:
40
+
41
+ - Current word count (use `scripts/count_words.py` or count manually from content)
42
+ - Section structure
43
+ - Abstract word count
44
+ - Number of references
45
+ - Figures and tables (each counts as ~250 words for IEEE Software)
46
+ - Any journal-specific required elements present or absent
47
+
48
+ Report the inventory as a table showing current vs. required for each dimension.
49
+
50
+ ### Phase 3: Apply Journal-Specific Transformations
51
+
52
+ Work through each requirement and transform the article. Create a new file rather than modifying the original.
53
+
54
+ #### For `ieee_software`:
55
+
56
+ 1. **Word limit (4,200 words + figures @250 each)**
57
+ - Count figures, compute effective budget: `4200 - (num_figures * 250)`
58
+ - If over budget: identify sections to cut; prioritize cutting related work and methodological details that practitioners don't need
59
+ - If well under budget: consider adding a concrete example or figure
60
+
61
+ 2. **Abstract (max 150 words)**
62
+ - Rewrite to be exactly ≤150 words
63
+ - Must describe the overall focus and main takeaway
64
+ - Should not contain abbreviations or citations
65
+
66
+ 3. **References (max 15)**
67
+ - If over 15: identify which references can be merged, cut, or replaced with a more authoritative single source
68
+ - Prioritize: seminal works > recent influential works > online resources
69
+ - Format: IEEE numbered style `[1]`, `[2]`, ...
70
+
71
+ 4. **Practitioner Takeaways (required)**
72
+ - Add a "Practitioner Takeaways" sidebar/section with exactly 3 bullet points
73
+ - Each must be a concrete, actionable insight — not a restatement of the abstract
74
+ - Format:
75
+ ```
76
+ ## Practitioner Takeaways
77
+ - <Specific insight a practitioner can act on>
78
+ - <Specific insight a practitioner can act on>
79
+ - <Specific insight a practitioner can act on>
80
+ ```
81
+
82
+ 5. **Author bio(s) (required)**
83
+ - Add a brief bio (2-3 sentences) for each author
84
+ - Include: current role, research/practice area, contact/email or affiliation
85
+
86
+ 6. **Tone adjustment**
87
+ - Soften heavy academic hedging; practitioners prefer direct statements
88
+ - Replace "it can be argued that" → "this shows that"
89
+ - Ensure code examples or figures are concrete and immediately useful
90
+
91
+ #### For `cacm_practice` or `cacm_research`:
92
+
93
+ 1. **Page limit (10 pages single-column single-spaced, ~6,000–7,000 words)**
94
+ - Use ACM `acmsmall` template mentally; single-column, generous margins
95
+ - If over budget: tighten related work, shorten examples
96
+
97
+ 2. **References (max 40, alphabetical order)**
98
+ - Format: ACM style — `[AuthorYear]` or numbered alphabetically by first author last name
99
+ - Ensure all references are complete (no "et al." in reference list itself)
100
+
101
+ 3. **Broad audience requirement**
102
+ - CACM's key editorial test: could a computer scientist outside this subfield follow this article?
103
+ - Add a "What problem are we solving?" paragraph early
104
+ - Define all acronyms and jargon
105
+ - Add context that a non-specialist would need
106
+
107
+ 4. **Author statement of relevance** (required at submission)
108
+ - Draft a 1-paragraph statement: "Why does this matter to the computing field? Why is it valuable to CACM readers?"
109
+ - Save this as a separate file: `output/<slug>_cacm_relevance_statement.md`
110
+
111
+ #### For `cacm_viewpoints`:
112
+
113
+ 1. **Page limit (5 pages, ~3,000 words)**
114
+ - More opinion-forward; less methodology detail needed
115
+ - Strong thesis statement required in first 2 paragraphs
116
+
117
+ 2. **References (max 10)**
118
+ - Be ruthless; only the most essential citations
119
+
120
+ 3. **Point-counterpoint framing** (optional but valued by CACM)
121
+ - If the article takes a position, acknowledge the strongest opposing view and address it
122
+
123
+ #### For `ieee_tse`:
124
+
125
+ 1. **Page limit (12 formatted pages in IEEE 2-column format)**
126
+ - IEEE 2-column format is denser than single-column; roughly 8,000–10,000 words equivalent
127
+ - Structured abstract preferred: Objective, Methods, Results, Conclusion
128
+
129
+ 2. **References (unlimited, IEEE numbered style)**
130
+ - Ensure all references include venue, volume, issue, pages
131
+ - Self-citations: list and review for appropriateness
132
+
133
+ 3. **Replication package note** (strongly recommended)
134
+ - Add a Data Availability statement if the work has associated data, code, or artifacts
135
+
136
+ 4. **Rigor markers**
137
+ - Ensure threats to validity section exists (for empirical work)
138
+ - Ensure limitations are explicitly stated
139
+
140
+ #### For `acm_queue`:
141
+
142
+ Note: ACM Queue is invitation-only. The formatted version here is for reference or after receiving an invitation.
143
+
144
+ 1. **Word limit (~3,500 words)**
145
+ - Conversational, problem-focused narrative
146
+ - Cut all hedging language; Queue readers are senior engineers who want directness
147
+
148
+ 2. **No rigid section structure**
149
+ - Problem → Challenge → Insight arc, not Introduction/Related Work/Methodology/Conclusion
150
+
151
+ 3. **Tone**
152
+ - Write as if explaining to a colleague at a whiteboard
153
+ - Include real war stories, production numbers, failure modes
154
+
155
+ ### Phase 4: Generate the Formatted Output
156
+
157
+ Write the transformed article to:
158
+ `output/<article_slug>_<journal_key>.md`
159
+
160
+ Also generate a **change summary** documenting what was modified:
161
+ `output/<article_slug>_<journal_key>_changes.md`
162
+
163
+ Change summary format:
164
+ ```markdown
165
+ # Formatting Changes: <Title> → <Journal>
166
+
167
+ **Original word count:** X
168
+ **Formatted word count:** X (target: X)
169
+
170
+ ## Changes Made
171
+
172
+ ### Structural Changes
173
+ - <what was added/removed/moved>
174
+
175
+ ### Abstract
176
+ - <original word count> → <new word count>
177
+ - <key changes>
178
+
179
+ ### References
180
+ - <original count> → <new count>
181
+ - <references removed: list titles>
182
+
183
+ ### Added Required Elements
184
+ - <list any newly added required sections>
185
+
186
+ ### Tone Adjustments
187
+ - <key phrasing changes>
188
+
189
+ ## What Still Needs Human Review
190
+
191
+ - <list any decisions that require author judgment>
192
+ - <any sections where cuts were made that author should verify>
193
+ ```
194
+
195
+ ## Output Files
196
+
197
+ 1. `output/<article_slug>_<journal_key>.md` — Reformatted article
198
+ 2. `output/<article_slug>_<journal_key>_changes.md` — Change summary
199
+ 3. `output/<article_slug>_cacm_relevance_statement.md` — (CACM only) Relevance statement
200
+
201
+ ## Notes
202
+
203
+ - Never delete content from the original; create a new file
204
+ - When cutting for word count, preserve the core argument — cut supporting material, not the thesis
205
+ - If cuts are ambiguous, leave a `<!-- AUTHOR: consider cutting this section -->` comment
206
+ - The formatted output is a starting point — always review with the author before submission
207
+ - LaTeX formatting is outside the scope of this skill; this produces clean markdown that can be pasted into a LaTeX template
208
+ - Use `scripts/count_words.py` to get accurate word counts