Skip to content

kgraph57/paper-writer-skill

paper-writer

Verified

Medical/scientific paper writing workflow skill. Manages the full pipeline from literature search to submission-ready manuscript. Creates and manages a project directory with IMRAD-format section files, literature matrix, reference management, and quality checklists. Supports both English and Japanese papers. Triggers: 'write paper', 'paper-write', 'start manuscript', '論文を書く', '論文執筆', '論文プロジェクト', 'manuscript', 'research paper', '原稿作成'.

FileKindSize
SKILL.mdskill md77.7 KB
examples/case-studies/discovery-to-draft.mdmarkdown5.3 KB
references/abstract-formats.mdmarkdown5.1 KB
references/adversarial-review.mdmarkdown21.6 KB
references/ai-disclosure.mdmarkdown6.4 KB
references/ai-for-science-model.mdmarkdown12.8 KB
references/citation-guide.mdmarkdown2.4 KB
references/citation-verification.mdmarkdown10.5 KB
references/clinical-trial-registration.mdmarkdown4.7 KB
references/coauthor-review.mdmarkdown14.2 KB
references/coi-detailed.mdmarkdown6.8 KB
references/desk-rejection-prevention.mdmarkdown6.1 KB
references/hook-compatibility.mdmarkdown6.1 KB
references/humanizer-academic.mdmarkdown12.0 KB
references/imrad-guide.mdmarkdown2.5 KB
references/journal-reformatting.mdmarkdown5.6 KB
references/journal-selection.mdmarkdown13.5 KB
references/keywords-guide.mdmarkdown4.6 KB
references/master-reference-list.mdmarkdown11.3 KB
references/multilingual-guide.mdmarkdown12.4 KB
references/novelty-check.mdmarkdown13.8 KB
references/open-access-guide.mdmarkdown4.6 KB
references/pubmed-query-builder.mdmarkdown16.7 KB
references/reporting-guidelines-full.mdmarkdown10.6 KB
references/reporting-guidelines.mdmarkdown3.2 KB
references/section-checklist.mdmarkdown4.5 KB
references/statistical-reporting-full.mdmarkdown8.6 KB
references/statistical-reporting.mdmarkdown22.5 KB
references/submission-portals.mdmarkdown4.1 KB
references/supplementary-materials.mdmarkdown3.9 KB
references/tables-figures-guide.mdmarkdown7.7 KB
references/word-count-limits.mdmarkdown4.6 KB
scripts/analysis-template.pyexecutablescript19.6 KB
scripts/compile-manuscript.shexecutablescript6.9 KB
scripts/forest-plot.pyexecutablescript16.9 KB
scripts/sr-dedup.pyexecutablescript12.5 KB
scripts/sr-pdf-link.pyexecutablescript6.8 KB
scripts/sr-prisma-count.pyexecutablescript8.7 KB
scripts/table1.pyexecutablescript9.7 KB
scripts/word-count.shexecutablescript12.8 KB
templates/abstract.mdmarkdown1.3 KB
templates/acknowledgments.mdmarkdown1.7 KB
templates/analysis-workflow.mdmarkdown5.1 KB
templates/case-abstract.mdmarkdown1.2 KB
templates/case-introduction.mdmarkdown1.7 KB
templates/case-report.mdmarkdown2.2 KB
templates/conclusion.mdmarkdown1.0 KB
templates/cover-letter.mdmarkdown1.3 KB
templates/data-management.mdmarkdown5.7 KB
templates/declarations.mdmarkdown6.1 KB
templates/discussion.mdmarkdown1.8 KB
templates/graphical-abstract.mdmarkdown2.7 KB
templates/highlights.mdmarkdown3.8 KB
templates/human-loop-ledger.mdmarkdown9.4 KB
templates/introduction.mdmarkdown1.8 KB
templates/limitations-guide.mdmarkdown6.2 KB
templates/literature-matrix.mdmarkdown1.2 KB
templates/methods.mdmarkdown1.9 KB
templates/preregistration.mdmarkdown19.5 KB
templates/project-init-case.mdmarkdown3.2 KB
templates/project-init.mdmarkdown3.6 KB
templates/proof-correction.mdmarkdown2.5 KB
templates/research-question.mdmarkdown18.6 KB
templates/response-to-reviewers.mdmarkdown12.5 KB
templates/results.mdmarkdown1.5 KB
templates/review-article.mdmarkdown11.6 KB
templates/revision-cover-letter.mdmarkdown10.3 KB
templates/sr-data-extraction.mdmarkdown9.2 KB
templates/sr-grade.mdmarkdown14.7 KB
templates/sr-outline.mdmarkdown13.5 KB
templates/sr-prisma-flow.mdmarkdown12.9 KB
templates/sr-prospero.mdmarkdown15.9 KB
templates/sr-rob.mdmarkdown18.3 KB
templates/sr-screening-pipeline.mdmarkdown12.1 KB
templates/study-design.mdmarkdown28.5 KB
templates/submission-ready.mdmarkdown2.5 KB
templates/title-page.mdmarkdown3.5 KB

scripts/compile-manuscript.sh

View on GitHub
#!/usr/bin/env bash
# compile-manuscript.sh - Compiles markdown manuscript sections into a single document.
#
# Usage: ./compile-manuscript.sh /path/to/project-dir [output-format]
# Formats: md (default), docx, pdf, latex
#
# Reads sections in order: Title, Abstract, Keywords, Introduction, Methods,
# Results, Discussion, Conclusion, References, Appendices
# Strips TODO/NOTE/FIXME comments, adds page breaks, generates line-numbered version.

set -euo pipefail

SCRIPT_NAME="$(basename "$0")"
VERSION="1.0.0"

SECTION_ORDER=(
    "Title Page:title"
    "Abstract:abstract"
    "Keywords:keywords"
    "Introduction:introduction"
    "Methods:methods"
    "Results:results"
    "Discussion:discussion"
    "Conclusion:conclusion"
    "Acknowledgments:acknowledgments"
    "Declarations:declarations"
    "References:references"
    "Appendices:appendix"
    "Supplementary:supplementary"
    "Tables:tables"
    "Figures:figures"
    "Figure Legends:figure-legends"
)

usage() {
    echo "${SCRIPT_NAME} v${VERSION} - Compile manuscript sections"
    echo ""
    echo "USAGE: ${SCRIPT_NAME} <project-dir> [output-format]"
    echo ""
    echo "  project-dir     Directory containing section .md files"
    echo "  output-format   md (default), docx, pdf, latex"
    echo ""
    echo "EXAMPLES:"
    echo "  ${SCRIPT_NAME} ./my-paper"
    echo "  ${SCRIPT_NAME} ./my-paper docx"
    echo "  ${SCRIPT_NAME} ./my-paper pdf"
    echo ""
    echo "SECTIONS (in order):"
    for section in "${SECTION_ORDER[@]}"; do
        IFS=':' read -r name pattern <<< "${section}"
        printf "  %-20s (%s.md)\n" "${name}" "${pattern}"
    done
    echo ""
    echo "NOTES:"
    echo "  - TODO/NOTE/FIXME lines and HTML comments are stripped"
    echo "  - pandoc required for docx/pdf/latex; LaTeX required for pdf"
}

log_info() { echo "[INFO] $*"; }
log_warn() { echo "[WARN] $*" >&2; }
log_error() { echo "[ERROR] $*" >&2; }

check_pandoc() {
    if ! command -v pandoc &>/dev/null; then
        log_error "pandoc not installed. Required for ${1} output."
        log_error "Install: brew install pandoc (macOS) or apt install pandoc (Linux)"
        return 1
    fi
}

check_latex() {
    if ! command -v pdflatex &>/dev/null && ! command -v xelatex &>/dev/null; then
        log_error "LaTeX not found. Required for PDF output."
        return 1
    fi
}

find_section_file() {
    local project_dir="$1" pattern="$2"
    local search_dirs=(
        "${project_dir}"
        "${project_dir}/sections"
        "${project_dir}/references"
        "${project_dir}/tables"
        "${project_dir}/figures"
        "${project_dir}/supplements"
        "${project_dir}/supplements/appendices"
    )
    local dir g
    for dir in "${search_dirs[@]}"; do
        [[ -d "${dir}" ]] || continue
        for g in \
            "${dir}/${pattern}.md" \
            "${dir}/${pattern}"*.md \
            "${dir}"/[0-9]*"_${pattern}"*.md \
            "${dir}"/[0-9]*"-${pattern}"*.md; do
            if [[ -f "$g" ]]; then
                echo "$g"
                return 0
            fi
        done
    done
    return 1
}

strip_internal_notes() {
    local f="$1"
    perl -0777 -pe 's/<!--.*?-->//gs' "$f" | \
        { grep -vE '^\s*(TODO|FIXME|HACK|XXX|NOTE|INTERNAL):' 2>/dev/null || true; } | \
        cat -s
}

main() {
    if [[ $# -lt 1 ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
        usage; exit 0
    fi

    local project_dir="$1"
    local output_format="${2:-md}"

    if [[ ! -d "${project_dir}" ]]; then
        log_error "Directory not found: ${project_dir}"; exit 1
    fi

    project_dir="$(cd "${project_dir}" && pwd)"
    local project_name; project_name="$(basename "${project_dir}")"
    local ts; ts="$(date +%Y%m%d_%H%M%S)"
    local outbase="${project_dir}/compiled/${project_name}_manuscript_${ts}"
    local out_md="${outbase}.md"
    local out_numbered="${outbase}_numbered.md"

    mkdir -p "${project_dir}/compiled"
    log_info "Compiling from: ${project_dir}"
    log_info "Format: ${output_format}"

    local tmp; tmp=$(mktemp)
    trap "rm -f '${tmp}'" EXIT

    local found=0
    local missing=()

    for entry in "${SECTION_ORDER[@]}"; do
        IFS=':' read -r sec_name sec_pat <<< "${entry}"
        local sec_file
        if sec_file=$(find_section_file "${project_dir}" "${sec_pat}"); then
            log_info "Found: ${sec_name} -> $(basename "${sec_file}")"
            if [[ ${found} -gt 0 ]]; then
                printf '\n\n---\n\n\\newpage\n\n' >> "${tmp}"
            fi
            strip_internal_notes "${sec_file}" >> "${tmp}"
            ((found++))
        else
            missing+=("${sec_name}")
        fi
    done

    echo ""
    log_info "=== Compilation Summary ==="
    log_info "Sections included: ${found}"
    if [[ ${#missing[@]} -gt 0 ]]; then
        log_warn "Sections not found (skipped):"
        for m in "${missing[@]}"; do log_warn "  - ${m}"; done
    fi
    if [[ ${found} -eq 0 ]]; then
        log_error "No sections found."; exit 1
    fi

    cp "${tmp}" "${out_md}"
    log_info "Written: ${out_md}"

    nl -ba -w4 -s'  ' "${tmp}" > "${out_numbered}"
    log_info "Written (numbered): ${out_numbered}"

    case "${output_format}" in
        md) log_info "Markdown output complete." ;;
        docx)
            if check_pandoc "docx"; then
                local out_docx="${outbase}.docx"
                if [[ -f "${project_dir}/reference.docx" ]]; then
                    pandoc "${out_md}" -f markdown -t docx --toc \
                        --reference-doc="${project_dir}/reference.docx" -o "${out_docx}"
                else
                    pandoc "${out_md}" -f markdown -t docx --toc -o "${out_docx}"
                fi
                log_info "Written: ${out_docx}"
            fi ;;
        pdf)
            if check_pandoc "pdf" && check_latex; then
                local out_pdf="${outbase}.pdf"
                local engine="xelatex"
                command -v xelatex &>/dev/null || engine="pdflatex"
                pandoc "${out_md}" -f markdown --pdf-engine="${engine}" --toc \
                    -V geometry:margin=1in -V fontsize=12pt -V linestretch=2 \
                    -o "${out_pdf}"
                log_info "Written: ${out_pdf}"
            fi ;;
        latex|tex)
            if check_pandoc "LaTeX"; then
                local out_tex="${outbase}.tex"
                pandoc "${out_md}" -f markdown -t latex --standalone --toc \
                    -V geometry:margin=1in -V fontsize=12pt -V linestretch=2 \
                    -o "${out_tex}"
                log_info "Written: ${out_tex}"
            fi ;;
        *) log_error "Unknown format: ${output_format}. Use: md, docx, pdf, latex"; exit 1 ;;
    esac

    local wc_w; wc_w=$(wc -w < "${tmp}" | tr -d ' ')
    local wc_c; wc_c=$(wc -c < "${tmp}" | tr -d ' ')
    echo ""
    log_info "=== Manuscript Statistics ==="
    log_info "Word count:      ${wc_w}"
    log_info "Character count: ${wc_c}"
    log_info "Sections:        ${found}"
    log_info "Compilation complete."
}

main "$@"
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall