YCC-Lover/research-starter-skills / skills/rsk-paper-writing
rsk-paper-writing
Verified组织论文论证、起草或修改章节、核对学位论文一致性,也可单独自然润色并匹配作者语气。用于学术文字与实质写作;只润色时不启动整套研究流程。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.5 KB |
| agents/openai.yaml | config | 316 B |
| assets/chapter-map.tsv | other | 107 B |
| assets/terminology.tsv | other | 140 B |
| references/abstract-introduction.md | markdown | 2.9 KB |
| references/advanced-writing.md | markdown | 1.7 KB |
| references/discussion-submission.md | markdown | 1.8 KB |
| references/examples.md | markdown | 1.5 KB |
| references/prose-editing.md | markdown | 9.8 KB |
| references/related-methods.md | markdown | 2.2 KB |
| references/results-discussion.md | markdown | 1.9 KB |
| references/source-manifest.json | config | 7.3 KB |
| references/sources.md | markdown | 3.5 KB |
| references/structure.md | markdown | 1.7 KB |
| references/thesis-longform.md | markdown | 2.6 KB |
| references/third-party-notices.md | markdown | 2.0 KB |
| scripts/check_prose_edit.py | script | 4.7 KB |
scripts/check_prose_edit.py
View on GitHub"""Read-only comparison of common protected spans in Markdown, text and LaTeX."""
import argparse
from collections import Counter
from html.parser import HTMLParser
import json
from pathlib import Path
import re
class LinkTargets(HTMLParser):
def __init__(self):
super().__init__(convert_charrefs=False)
self.targets = []
def handle_starttag(self, tag, attrs):
for name, value in attrs:
if name in {'href', 'src'} and value is not None:
self.targets.append(value)
handle_startendtag = handle_starttag
def markdown_targets(text):
targets = []
for start in re.finditer(r'(?<!\\)\]\(', text):
depth, end = 1, start.end()
while end < len(text) and depth:
if text[end] == '\\':
end += 2
continue
if text[end] == '(':
depth += 1
elif text[end] == ')':
depth -= 1
end += 1
if depth == 0:
targets.append(text[start.end():end - 1])
targets.extend(re.findall(r'(?m)^ {0,3}\[[^\]\n]+\]:[ \t]*(.+)$', text))
return targets
def protected(text):
result = {'frontmatter': [], 'code': [], 'link_targets': [], 'citations': [], 'math': [], 'numbers': []}
frontmatter = re.match(r'\A---\n.*?\n(?:---|\.\.\.)\s*(?:\n|$)', text, re.S)
if frontmatter:
result['frontmatter'].append(frontmatter.group())
text = text[frontmatter.end():]
lines = text.splitlines(keepends=True)
plain, block, fence = [], [], None
for line in lines:
opening = re.match(r'^ {0,3}(`{3,}|~{3,})(.*)', line)
if fence is None and opening:
fence = opening.group(1)
block = [line]
elif fence is not None:
block.append(line)
if re.fullmatch(r' {0,3}' + re.escape(fence[0]) + '{' + str(len(fence)) + r',}[ \t]*(?:\n)?', line):
result['code'].append(''.join(block))
block, fence = [], None
else:
plain.append(line)
if fence is not None:
result['code'].append(''.join(block))
text = ''.join(plain)
inline = re.compile(r'(?<!`)(`+)(?!`)(.+?)(?<!`)\1(?!`)', re.S)
result['code'].extend(match.group() for match in inline.finditer(text))
text = inline.sub('', text)
result['link_targets'] = markdown_targets(text)
html = LinkTargets()
html.feed(text)
result['link_targets'].extend(html.targets)
result['link_targets'].extend(re.findall(r'<((?:https?://|mailto:)[^<>]+)>', text))
result['citations'] = re.findall(r'\\(?:cite\w*|ref|eqref|label)(?:\[[^\]]*\])*\{[^}]*\}|(?<![\w@])@[A-Za-z][\w:./-]*', text)
math = re.compile(r'(?s)\\\[.*?\\\]|\\\(.*?\\\)|(?<!\\)\$\$.*?(?<!\\)\$\$|(?<![\\$])\$(?!\$).*?(?<![\\$])\$(?!\$)|\\begin\{(equation\*?|align\*?|gather\*?)\}.*?\\end\{\1\}')
result['math'] = [match.group() for match in math.finditer(text)]
result['numbers'] = re.findall(r'(?<![\w])[-+]?\d+(?:[.,]\d+)*(?:[eE][-+]?\d+)?(?:\s*(?:%|\u00b0[CFF]|[A-Za-z\u03bc]+(?:/[A-Za-z]+)?))?', text)
return {name: Counter(values) for name, values in result.items()}
def compare(before, after):
left, right = protected(before), protected(after)
changes = []
for kind in left:
if left[kind] != right[kind]:
changes.append({'kind': kind, 'removed': list((left[kind] - right[kind]).elements()),
'added': list((right[kind] - left[kind]).elements())})
return {'protected_spans_unchanged': not changes, 'changes': changes,
'limits': ['Lexical checks cover common Markdown/text/LaTeX forms, not a complete document parser.',
'No semantic, authorship, scientific-validity or AI-detection judgment is made.',
'Negation, quantifiers, units, scope and author voice also need contextual review.'],
'files_written': 0}
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('before', type=Path)
parser.add_argument('after', type=Path)
args = parser.parse_args()
try:
if args.before.suffix.lower() not in {'.md', '.txt', '.tex'} or args.after.suffix.lower() not in {'.md', '.txt', '.tex'}:
raise ValueError('Export prose to MD/TXT/TEX first; this tool does not edit or parse Word/PDF binaries.')
result = compare(args.before.read_text(encoding='utf-8-sig'), args.after.read_text(encoding='utf-8-sig'))
except (ValueError, OSError) as error:
parser.exit(2, 'Prose check failed: ' + str(error) + '\n')
print(json.dumps(result, ensure_ascii=False))
if not result['protected_spans_unchanged']:
parser.exit(1)
if __name__ == '__main__':
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| add-product-e2e-evalpaperclipai/paperclipAdd or extend a Paperclip full-stack runner E2E workflow, fixture, matcher, or report evidence path for local or Daytona execution. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| add-runner-evalpaperclipai/paperclipAdd or extend a Paperclip Runner protocol evaluation definition, roster, assertion, or report fixture with provenance and narrow validation. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| diagnose-why-work-stoppedpaperclipai/paperclipCompatibility entry point for failed, stalled, looping, or over-recovered Paperclip work. Use fix-failed-paperclip-run for the full diagnosis, regression, repair, real verification, and green-PR workflow; honor an explicitly requested diagnosis-only scope. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| fix-failed-paperclip-runpaperclipai/paperclipDiagnose and fix failed, stuck, slow, or incorrectly blocked Paperclip tasks and runs. Use with a task/run URL or failure report to trace the root cause, prove a regression red then green, check second-order effects, verify the real workflow, and deliver a PR with passing checks. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |