Skip to content

Instantly share code, notes, and snippets.

@jawherkh
Last active November 4, 2026 22:17
Show Gist options
  • Select an option

  • Save jawherkh/52787520b448819ee9690cf0ee4acba5 to your computer and use it in GitHub Desktop.

Select an option

Save jawherkh/52787520b448819ee9690cf0ee4acba5 to your computer and use it in GitHub Desktop.
insat-pfe-report installable skill (Claude Code / opencode / Codex CLI)

Installing the insat-pfe-report skill

Claude Code, opencode, and Codex CLI all now discover skills the same way: a folder containing a SKILL.md with YAML frontmatter (name, description), dropped into a known directory. That's what this package is.

Fastest path: one command

cd insat-pfe-report          # this folder
./install.sh                 # installs into the current project for all three tools
# or:
./install.sh --global        # installs into your home dir, available in every project

This copies the skill into:

  • .claude/skills/insat-pfe-report/ (Claude Code)
  • .opencode/skills/insat-pfe-report/ (opencode — also auto-detects .claude/skills/, so this is belt-and-suspenders)
  • .codex/skills/insat-pfe-report/ and .agents/skills/insat-pfe-report/ (Codex CLI — the latter is the officially documented cross-tool path; installing both covers older and newer Codex builds)

Restart the tool / start a new session afterward so it re-scans for skills.

Manual install, per tool

Claude Code

mkdir -p .claude/skills
cp -r insat-pfe-report .claude/skills/
# or globally: cp -r insat-pfe-report ~/.claude/skills/

opencode

mkdir -p .opencode/skills
cp -r insat-pfe-report .opencode/skills/
# or globally: cp -r insat-pfe-report ~/.config/opencode/skills/

opencode also reads .claude/skills/*/SKILL.md automatically, so if you've already installed for Claude Code in the same repo, opencode picks it up with no extra step.

Codex CLI

mkdir -p .codex/skills   # or .agents/skills — Codex checks both, paths vary by version
cp -r insat-pfe-report .codex/skills/
cp -r insat-pfe-report .agents/skills/
# or globally: cp -r insat-pfe-report ~/.codex/skills/

Verifying it loaded

  • Claude Code: ask "what skills do you have available?" or run claude skills list if your version supports it.
  • opencode: the skill shows up in the <available_skills> list the agent sees; you can also check via the skill tool description.
  • Codex CLI: run /skills (or type $ to mention a skill by name) to see it listed.

If it doesn't show up: confirm the file is spelled exactly SKILL.md (all caps), confirm the frontmatter has both name and description, and restart the session — none of these tools hot-reload skills mid-session.

Using it

Once installed, just ask the agent to work on the PFE report — e.g. "set up a new PFE report from the INSAT template" or "compile my report" from inside the project directory — and the description in SKILL.md is enough for the agent to pick it up on its own. You can also invoke it explicitly if your tool supports that (Codex CLI: $insat-pfe-report).

#!/usr/bin/env bash
# Installs this skill folder into Claude Code, opencode, and Codex CLI.
# All three now read the same SKILL.md standard, so this just copies the
# folder into each tool's discovery path. Run with --global to install
# for every project (home directory) instead of just this one.
set -euo pipefail
SKILL_NAME="insat-pfe-report"
SCOPE="project"
for arg in "$@"; do
case "$arg" in
--global) SCOPE="global" ;;
--project) SCOPE="project" ;;
esac
done
SRC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
install_to() {
local dest="$1"
mkdir -p "$(dirname "$dest")"
rm -rf "$dest"
cp -r "$SRC_DIR" "$dest"
echo " -> $dest"
}
echo "==> Installing '$SKILL_NAME' skill ($SCOPE scope)"
if [ "$SCOPE" = "global" ]; then
install_to "$HOME/.claude/skills/$SKILL_NAME"
install_to "$HOME/.config/opencode/skills/$SKILL_NAME"
install_to "$HOME/.codex/skills/$SKILL_NAME"
install_to "$HOME/.agents/skills/$SKILL_NAME"
else
install_to ".claude/skills/$SKILL_NAME"
install_to ".opencode/skills/$SKILL_NAME"
install_to ".codex/skills/$SKILL_NAME"
install_to ".agents/skills/$SKILL_NAME"
fi
echo "==> Done."
echo " Claude Code, opencode, and Codex CLI all discover SKILL.md the same way —"
echo " installed to all four paths above so whichever tool you run picks it up."
echo " Restart the tool (or start a new session) so it re-scans for skills."
#!/usr/bin/env bash
# Compile the INSAT PFE report template to main.pdf, entirely locally.
# Usage: compile.sh [project-dir]
set -euo pipefail
PROJECT_DIR="${1:-.}"
cd "$PROJECT_DIR"
if [ ! -f main.tex ]; then
echo "ERROR: no main.tex in $PROJECT_DIR — run this from the report project root." >&2
exit 1
fi
if command -v latexmk >/dev/null 2>&1; then
echo "==> Building with latexmk (auto-sequences pdflatex + biber)"
latexmk -pdf -interaction=nonstopmode -halt-on-error main.tex
else
echo "==> latexmk not found, falling back to manual pdflatex/biber sequence"
pdflatex -interaction=nonstopmode -halt-on-error main.tex
biber main
pdflatex -interaction=nonstopmode -halt-on-error main.tex
pdflatex -interaction=nonstopmode -halt-on-error main.tex
fi
if [ -f main.pdf ]; then
echo "==> Build OK: $(pwd)/main.pdf"
else
echo "ERROR: build finished but main.pdf was not produced — check main.log" >&2
exit 1
fi
#!/usr/bin/env bash
# Regenerate PageDeGarde_English.pdf and LastPage.pdf from their .docx sources
# after editing them, using headless LibreOffice. Keeps filenames identical,
# which main.tex requires (it \includepdf's these by literal filename).
# Usage: convert-cover-pages.sh [project-dir]
set -euo pipefail
PROJECT_DIR="${1:-.}"
cd "$PROJECT_DIR"
if ! command -v libreoffice >/dev/null 2>&1; then
echo "ERROR: libreoffice not found. Run scripts/install-deps.sh (without --no-libreoffice)." >&2
exit 1
fi
for docx in "PageDeGarde_English.docx" "LastPage.docx"; do
if [ ! -f "$docx" ]; then
echo "WARNING: $docx not found in $PROJECT_DIR, skipping" >&2
continue
fi
echo "==> Converting $docx -> PDF"
libreoffice --headless --convert-to pdf --outdir . "$docx" >/tmp/lo_convert.log 2>&1 \
|| { echo "ERROR converting $docx:"; cat /tmp/lo_convert.log; exit 1; }
done
echo "==> Done. Re-run the compile script so main.tex picks up the refreshed PDFs."
#!/usr/bin/env bash
# Clone the INSAT PFE report template into a fresh project directory, detached from upstream.
set -euo pipefail
TARGET="${1:-insat-pfe-report}"
REPO_URL="https://github.com/ahmedsilinii/INSAT-PFE-Report-Template.git"
if [ -e "$TARGET" ]; then
echo "ERROR: '$TARGET' already exists — choose a new directory or remove it first." >&2
exit 1
fi
echo "==> Cloning template into $TARGET"
git clone --depth 1 "$REPO_URL" "$TARGET"
rm -rf "$TARGET/.git"
git -C "$TARGET" init -q
git -C "$TARGET" add -A
git -C "$TARGET" commit -q -m "Initial import: INSAT-PFE-Report-Template" || true
echo "==> Ready. cd $TARGET && scripts/compile.sh (or the compile.sh from this skill) to build."
echo " Large optional files you can delete to speed up future clones/compiles:"
echo " '$TARGET/INSAT Report Notes.pdf' '$TARGET/INSAT Report Notes Latex.zip' '$TARGET/examples'"
#!/usr/bin/env bash
# Install everything needed to compile the INSAT PFE report template locally.
# Verified on Ubuntu/Debian (apt). For other platforms see the notes at the bottom.
set -euo pipefail
NO_LIBREOFFICE=0
for arg in "$@"; do
case "$arg" in
--no-libreoffice) NO_LIBREOFFICE=1 ;;
esac
done
if command -v apt-get >/dev/null 2>&1; then
echo "==> Installing TeX Live + biber + latexmk via apt (this can take a few minutes)"
SUDO=""
if [ "$(id -u)" -ne 0 ]; then SUDO="sudo"; fi
$SUDO apt-get update
PKGS="texlive-latex-base texlive-latex-recommended texlive-latex-extra \
texlive-fonts-recommended texlive-pictures texlive-bibtex-extra \
biber latexmk"
if [ "$NO_LIBREOFFICE" -eq 0 ]; then
PKGS="$PKGS libreoffice"
fi
# shellcheck disable=SC2086
$SUDO apt-get install -y $PKGS
echo "==> Verifying toolchain"
for bin in pdflatex biber latexmk; do
if ! command -v "$bin" >/dev/null 2>&1; then
echo "ERROR: $bin not found after install" >&2
exit 1
fi
done
if [ "$NO_LIBREOFFICE" -eq 0 ] && ! command -v libreoffice >/dev/null 2>&1; then
echo "WARNING: libreoffice not found — docx cover/last-page conversion won't work" >&2
fi
echo "==> Done. pdflatex, biber, latexmk ready."
elif [ "$(uname)" = "Darwin" ]; then
cat <<'EOF'
No apt on macOS. Do this instead:
brew install --cask mactex-no-gui # full TeX Live, ~5GB, includes biber/latexmk
# or, smaller:
brew install --cask basictex
sudo tlmgr update --self
sudo tlmgr install biblatex biber tikz pdfpages pdflscape listings \
fancyhdr titlesec enumitem csquotes latexmk collection-fontsrecommended
brew install --cask libreoffice # for docx -> pdf cover/last page conversion
Then re-run scripts/compile.sh — no further setup needed.
EOF
else
cat <<'EOF'
Unrecognized platform. You need, on the PATH:
pdflatex, biber, latexmk (any recent TeX Live / MiKTeX distribution)
libreoffice (optional — only needed to regenerate the cover/last page from .docx)
Consult your distro's TeX Live packaging (texlive-full is the always-safe option).
EOF
fi
name insat-pfe-report
description Use this skill when the user wants to write, edit, or compile an INSAT end-of-studies (PFE) report using the ahmedsilinii/INSAT-PFE-Report-Template LaTeX template. Covers scaffolding a new report from the template, editing chapters/preliminary pages, regenerating the Word-based cover and last pages, and compiling to PDF locally (pdflatex + biber) without Overleaf. Trigger on mentions of "PFE report", "INSAT report template", "rapport de PFE", or a project directory containing this template's main.tex.
license See upstream repo (github.com/ahmedsilinii/INSAT-PFE-Report-Template) for template license terms. Scripts in this skill are provided as-is.

INSAT PFE Report — local build skill

Turns github.com/ahmedsilinii/INSAT-PFE-Report-Template into something you can write and compile entirely on the command line — no Overleaf account needed.

Overview

The template is a LaTeX report-class document (main.tex) that:

  • pulls chapters from chapters/*.tex (general intro, chapter1–5, general conclusion)
  • pulls front/back matter from preliminary pages/*.tex (dedication, acknowledgements, abstract, résumé, list of acronyms, appendices) and bibliography from preliminary pages/bibliography.bib
  • uses biblatex + biber with style=ieee (set explicitly in main.tex: \usepackage[style=ieee, backend=biber]{biblatex}), tikz, pdfpages, pdflscape + eso-pic (rotated landscape headers), listings, fancyhdr, titlesec, hyperref, plus table support (tabularx, longtable, booktabs, xcolor[table])
  • includes pages that are NOT written in LaTeX — they're Word docs exported to PDF and pulled in with \includepdf: PageDeGarde_English.pdf (cover — both pages of it are included: \includepdf{PageDeGarde_English.pdf} then \includepdf[pages=2]{PageDeGarde_English.pdf} for an inner declaration page) and LastPage.pdf (back cover, single page), sourced from PageDeGarde_English.docx and LastPage.docx respectively

This has been verified end-to-end in a clean Ubuntu container: clone → install TeX Live + biber → 4-pass build (pdflatex → biber → pdflatex → pdflatex, or latexmk -pdf as a one-shot) → valid PDF. docx→PDF conversion for the cover/last page was verified with headless LibreOffice.

First-time setup (once per machine)

Run scripts/install-deps.sh. It installs, via apt:

  • texlive-latex-base texlive-latex-recommended texlive-latex-extra (base LaTeX + biblatex, hyperref, etc.)
  • texlive-fonts-recommended texlive-pictures (tikz)
  • texlive-bibtex-extra biber (bibliography backend)
  • latexmk (build driver)
  • libreoffice (headless docx→PDF conversion for the cover/last page — optional, skip with --no-libreoffice if the user only edits chapters)

This is a ~1–2GB install the first time. If the user is on a machine without apt (macOS, etc.), tell them to install MacTeX (or basictex + tlmgr install biblatex biber tikz pdfpages pdflscape listings fancyhdr titlesec enumitem csquotes) and LibreOffice via brew install --cask libreoffice, then skip straight to compiling.

Getting the template into a project

Run scripts/fetch-template.sh <target-dir>. It git clone --depth 1s the upstream repo into <target-dir> and strips .git so it becomes the user's own project, not a fork tracking upstream. If the user already has the template cloned, skip this step and just cd into it.

Compiling

Run scripts/compile.sh <project-dir> (defaults to .). It runs, inside that directory:

latexmk -pdf -interaction=nonstopmode -halt-on-error main.tex

latexmk auto-detects that biblatex needs biber (via main.bcf) and reruns pdflatex as many times as needed to settle cross-references, the ToC, and citations — this replaces the manual pdflatex → biber → pdflatex → pdflatex sequence. Output is main.pdf in the project root.

If latexmk isn't available for some reason, fall back to the manual sequence, run from the project directory:

pdflatex -interaction=nonstopmode -halt-on-error main.tex
biber main
pdflatex -interaction=nonstopmode -halt-on-error main.tex
pdflatex -interaction=nonstopmode -halt-on-error main.tex

(Two pdflatex passes after biber are required — one pass alone can leave the bibliography or ToC one revision stale.)

On a clean compile you'll see a handful of harmless pdfTeX warning ... PDF inclusion lines from the \includepdf calls and possibly a destination with the same identifier warning — these are not errors. Treat anything under ! LaTeX Error or ! Undefined control sequence in the log as the thing to actually fix.

If the user only changed a .tex file (no new citations, no cover page swap), a single pdflatex -interaction=nonstopmode main.tex is enough for a quick preview — just remember to do the full 4-step (or latexmk) pass before calling it done, or citations/toc will be stale.

Editing content

  • Chapters: edit chapters/chapter1.tex … chapter5.tex, general_introduction.tex, general_conclusion.tex. To add/remove a chapter, edit the \input{chapters/...} lines in main.tex directly — mirror the existing pattern.
  • Front/back matter: preliminary pages/dedication.tex, acknowledgements.tex, abstract.tex, resume.tex, list_of_acronyms.tex, appendices.tex.
  • References: add BibTeX entries to preliminary pages/bibliography.bib, cite with \cite{key}. Style is IEEE via biblatex — no manual formatting needed.
  • Images: put files under assets/ (e.g. assets/Logos/) and \includegraphics them.
  • Code listings: use the lstlisting environment (already configured with line numbers, a light gray background, and syntax highlighting via the listings package).

Editing the cover and last page (no Word needed)

These two source files are DOCX documents exported to PDF; main.tex includes the PDFs, not the DOCX. PageDeGarde_English.docx must stay a 2-page document (cover + inner declaration page) since main.tex pulls both pages in separately — deleting a page or adding one shifts what \includepdf[pages=2]{...} grabs. LastPage.docx is a single page. Two ways to edit them without opening Word/Overleaf:

  1. Text edits only, keep the Word layout: edit PageDeGarde_English.docx / LastPage.docx with any tool the user has (LibreOffice Writer GUI, or programmatically with python-docx if it's a simple find-and-replace like a name or project title), then run scripts/convert-cover-pages.sh <project-dir> to headless-convert both docx files back to PDF with the exact same filenames (PageDeGarde_English.pdf, LastPage.pdf) that main.tex expects. Re-run the compile after.
  2. Full redesign: if the user wants a different look, they can design a new PDF (Canva, LaTeX, whatever) and drop it in under the same filename — main.tex doesn't care how the PDF was made.

Never hand-edit the .pdf cover files directly; always regenerate from source and keep filenames identical, since \includepdf{PageDeGarde_English.pdf} and \includepdf{LastPage.pdf} are literal filename references in main.tex.

Common failure modes

  • ! LaTeX Error: File 'preliminary pages/bibliography.bib' not found: run from the project root, not from inside chapters/ or preliminary pages/ — all paths in main.tex are relative to the root.
  • Citations show as [?] or bibliography is empty: biber didn't run, or ran before a .bcf was generated. Always do a pdflatex pass before biber, or just use latexmk -pdf which sequences this correctly on its own.
  • biber: command not found: rerun scripts/install-deps.sh, or apt install biber / tlmgr install biber depending on the TeX distribution.
  • Cover/last page missing or stale after a docx edit: the PDF wasn't regenerated, or was saved under a different filename — rerun scripts/convert-cover-pages.sh and check the two PDF filenames match exactly (case-sensitive).
  • Space in preliminary pages/ trips up a shell one-liner: always quote the path, e.g. "preliminary pages/bibliography.bib".

Files in this skill

  • scripts/install-deps.sh — one-time TeX Live + biber + latexmk + LibreOffice install (apt-based)
  • scripts/fetch-template.sh — clone the upstream template into a fresh project directory
  • scripts/compile.sh — full local build (latexmk, with manual-sequence fallback)
  • scripts/convert-cover-pages.sh — headless docx→pdf for the cover/last page
  • INSTALL.md — how to install this skill into Claude Code, opencode, and Codex CLI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment