Skip to content

refactor: clean up project structure (scripts/, templates/fonts/, docs/i18n/)#320

Open
aajinn wants to merge 5 commits intosantifer:mainfrom
aajinn:main
Open

refactor: clean up project structure (scripts/, templates/fonts/, docs/i18n/)#320
aajinn wants to merge 5 commits intosantifer:mainfrom
aajinn:main

Conversation

@aajinn
Copy link
Copy Markdown

@aajinn aajinn commented Apr 15, 2026

What does this PR do?

Reduces root-level clutter by moving files to more logical locations:
14 .mjs scripts → scripts/, fonts → templates/fonts/, and 6 translated READMEs → docs/i18n/.
No behavior changes — all internal paths, npm scripts, docs, and mode files updated to match.

Related issue

Type of change

  • Bug fix
  • New feature
  • Documentation / translation
  • Refactor (no behavior change)

Checklist

  • I have read CONTRIBUTING.md
  • I linked a related issue above (required for features and architecture changes)
  • My PR does not include personal data (CV, email, real names)
  • I ran node scripts/test-all.mjs and all tests pass
  • My changes respect the Data Contract (no modifications to user-layer files)
  • My changes align with the project roadmap

Changes

scripts/ — all 13 .mjs utilities + scripts/lib/liveness-core.mjs

  • All __dirname path resolutions updated to resolve project root as join(__dirname, '..')
  • package.json npm scripts updated
  • All references updated: CLAUDE.md, DATA_CONTRACT.md, docs/, modes/ (EN/DE/FR/JA/PT/RU), batch/batch-runner.sh, CONTRIBUTING.md, CI templates

templates/fonts/ — fonts co-located with cv-template.html that uses them

  • scripts/generate-pdf.mjs and scripts/doctor.mjs path updated
  • update-system.mjs SYSTEM_PATHS updated (fonts now covered by templates/)

docs/i18n/ — 6 translated READMEs off the root

  • Language links in README.md updated to new paths

Questions? Join the Discord for faster feedback.

Summary by CodeRabbit

  • Documentation

    • Updated all documentation to reflect reorganized project structure with scripts now in a scripts/ directory and fonts moved under templates/fonts/.
    • Updated setup and usage instructions across all language translations and mode guides to reference correct script locations.
    • Added comprehensive scripts documentation describing utility command mappings and shared modules.
  • Chores

    • Reorganized project structure: moved Node.js utility scripts to dedicated scripts/ directory; consolidated font assets under templates/fonts/.

aajinn and others added 5 commits April 15, 2026 22:11
Reduces root clutter from 7 README files to 1.
Updates language links in README.md to new paths.

Moved:
- README.es.md → docs/i18n/README.es.md
- README.ja.md → docs/i18n/README.ja.md
- README.ko-KR.md → docs/i18n/README.ko-KR.md
- README.pt-BR.md → docs/i18n/README.pt-BR.md
- README.ru.md → docs/i18n/README.ru.md
- README.zh-TW.md → docs/i18n/README.zh-TW.md
Fonts are only used by the PDF pipeline (generate-pdf.mjs +
cv-template.html). Co-locating them with the CV template makes
the dependency explicit and reduces root-level clutter.

Updated references in:
- generate-pdf.mjs (fontsDir resolution)
- doctor.mjs (checkFonts path)
- update-system.mjs (SYSTEM_PATHS — fonts now covered by templates/)
- templates/README.md
- docs/SCRIPTS.md, docs/CUSTOMIZATION.md
- DATA_CONTRACT.md
- batch/batch-prompt.md, modes/pdf.md
- README.md + all docs/i18n/README.*.md
Moves 13 runnable scripts to scripts/ and the shared liveness
module to scripts/lib/ to clean up the project root.

Scripts moved:
- analyze-patterns.mjs    → scripts/analyze-patterns.mjs
- check-liveness.mjs      → scripts/check-liveness.mjs
- cv-sync-check.mjs       → scripts/cv-sync-check.mjs
- dedup-tracker.mjs       → scripts/dedup-tracker.mjs
- doctor.mjs              → scripts/doctor.mjs
- followup-cadence.mjs    → scripts/followup-cadence.mjs
- generate-pdf.mjs        → scripts/generate-pdf.mjs
- merge-tracker.mjs       → scripts/merge-tracker.mjs
- normalize-statuses.mjs  → scripts/normalize-statuses.mjs
- scan.mjs                → scripts/scan.mjs
- test-all.mjs            → scripts/test-all.mjs
- update-system.mjs       → scripts/update-system.mjs
- verify-pipeline.mjs     → scripts/verify-pipeline.mjs
- liveness-core.mjs       → scripts/lib/liveness-core.mjs

Internal path fixes:
- All scripts using dirname(__filename) updated to resolve
  project root as join(__dirname, '..')
- check-liveness.mjs import updated to ./lib/liveness-core.mjs
- batch-runner.sh updated to scripts/merge-tracker.mjs + scripts/verify-pipeline.mjs
- merge-tracker.mjs internal execFileSync path updated

Reference updates:
- package.json npm scripts
- CLAUDE.md (update-system, merge-tracker, verify, dedup, normalize)
- DATA_CONTRACT.md system layer table
- docs/SCRIPTS.md, docs/SETUP.md, docs/ARCHITECTURE.md
- README.md project structure
- modes/_shared.md + all language variants (de, fr, ja, pt, ru)
- modes/pdf.md, modes/patterns.md, modes/followup.md, modes/pipeline.md
- batch/batch-prompt.md
- CONTRIBUTING.md, .github/PULL_REQUEST_TEMPLATE.md
- examples/ats-normalization-test.md
Documents all runnable scripts and shared modules in the
new scripts/ directory with npm command mappings.
refactor: clean up project structure (scripts/, templates/fonts/, docs/i18n/)
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to career-ops, @aajinn! Thanks for your first PR.

A few things to know:

  • Tests will run automatically — check the status below
  • Make sure you've linked a related issue (required for features)
  • Read CONTRIBUTING.md if you haven't

We'll review your PR soon. Join our Discord if you have questions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

This pull request reorganizes project structure by moving executable .mjs scripts from the repository root to a new scripts/ directory, relocating font assets to templates/fonts/, moving i18n documentation to docs/i18n/, and updating all references across 40+ documentation, configuration, and script files accordingly. Path resolution logic in scripts was adjusted to account for the subdirectory relocation.

Changes

Cohort / File(s) Summary
Documentation Path Updates
.github/PULL_REQUEST_TEMPLATE.md, CLAUDE.md, CONTRIBUTING.md, docs/ARCHITECTURE.md, docs/CUSTOMIZATION.md, docs/SCRIPTS.md, docs/SETUP.md, examples/ats-normalization-test.md, templates/README.md
Updated all Node script command references to invoke from scripts/ subdirectory (e.g., node generate-pdf.mjsnode scripts/generate-pdf.mjs). Updated font directory references from fonts/ to templates/fonts/. Added BOM characters to several file headers.
Modes Documentation
modes/_shared.md, modes/de/_shared.md, modes/de/pipeline.md, modes/followup.md, modes/fr/_shared.md, modes/fr/pipeline.md, modes/ja/_shared.md, modes/ja/pipeline.md, modes/patterns.md, modes/pdf.md, modes/pipeline.md, modes/pt/_shared.md, modes/pt/pipeline.md, modes/ru/_shared.md, modes/ru/oferta.md, modes/ru/pipeline.md
Updated script command invocations to use scripts/ directory paths. Added BOM characters to headers in multiple language variants. Adjusted font path references to templates/fonts/.
Internationalization Documentation
docs/i18n/README.es.md, docs/i18n/README.ja.md, docs/i18n/README.ko-KR.md, docs/i18n/README.pt-BR.md, docs/i18n/README.ru.md, docs/i18n/README.zh-TW.md
Updated project directory structure documentation to show templates/ directory containing cv-template.html, portals.example.yml, states.yml, and nested fonts/ subdirectory, replacing previous root-level fonts/ entry.
Configuration & Data Contract
package.json, DATA_CONTRACT.md, batch/batch-prompt.md, batch/batch-runner.sh
Updated package.json script commands to reference scripts/ subdirectory. Updated DATA_CONTRACT.md to narrow JavaScript utility scope to scripts/*.mjs and explicitly include scripts/lib/liveness-core.mjs. Updated shell script paths in batch runner.
Root-Level Scripts Path Resolution
scripts/analyze-patterns.mjs, scripts/dedup-tracker.mjs, scripts/followup-cadence.mjs, scripts/merge-tracker.mjs, scripts/normalize-statuses.mjs, scripts/verify-pipeline.mjs, scripts/cv-sync-check.mjs
Updated path calculations from __dirname (script directory) to join(__dirname, '..') to resolve to project root. Adjusts all subsequent file path resolutions that depend on CAREER_OPS or projectRoot.
Scripts with Font Path Updates
scripts/doctor.mjs, scripts/generate-pdf.mjs
Updated font directory references from fonts/ to templates/fonts/. Modified path resolution and asset lookup logic. Adjusted status messages and verification checks to reference correct template fonts location.
Other Scripts
scripts/check-liveness.mjs, scripts/update-system.mjs
Updated import path from ./liveness-core.mjs to ./lib/liveness-core.mjs. Expanded and adjusted tracked system paths list, moving scripts to scripts/ subdirectory and removing fonts/ entry.
New Documentation
scripts/README.md
Added new documentation page describing utility scripts collection, enumerating runnable scripts with npm command mappings, listing script purposes, identifying shared modules (lib/liveness-core.mjs), and linking to complete documentation.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main organizational refactor: moving scripts, fonts, and documentation into new directories to reduce root-level clutter.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 22

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@batch/batch-prompt.md`:
- Line 235: The "Sources of Truth" table contains a stale script path
referencing generate-pdf.mjs at the repo root; update that entry to match the
other reference by changing it to scripts/generate-pdf.mjs so both mentions of
the PDF generation script (generate-pdf.mjs) are consistent.

In `@docs/i18n/README.ja.md`:
- Around line 207-211: The directory tree duplicates a "templates/" node; remove
the second "templates/" block and merge its "fonts/" entry into the existing
templates section so there is only one "templates/" listing that contains
cv-template.html, portals.example.yml, states.yml, and a fonts/ subdirectory;
ensure the final tree shows a single templates/ node with fonts/ nested under
it.

In `@docs/i18n/README.ko-KR.md`:
- Around line 207-211: The README contains a duplicated "templates/" tree entry;
remove the redundant block and consolidate into a single "templates/" node that
includes "fonts/" as a child; update the existing "templates/" section (the one
listing cv-template.html, portals.example.yml, states.yml) to also list fonts/
so there is one authoritative "templates/" tree instead of two conflicting
entries referencing templates/ and fonts/.

In `@docs/i18n/README.pt-BR.md`:
- Around line 207-212: Remove the duplicated top-level "templates/" subtree and
merge its "fonts/" entry into the existing "templates/" block (the earlier
templates/ listing) so there is only one templates/ subtree; specifically delete
the second block that repeats "templates/" and ensure the first templates/ block
includes the "fonts/" item alongside cv-template.html, portals.example.yml and
states.yml to restore a consistent project tree.

In `@docs/i18n/README.ru.md`:
- Around line 193-197: The project tree contains a duplicated templates/ block;
remove the second templates/ block (the one listing cv-template.html,
portals.example.yml, states.yml, and fonts/) and instead place fonts/ as a child
under the existing templates/ node so there is only one templates/ entry and
fonts/ is nested beneath it; update the entries cv-template.html,
portals.example.yml, and states.yml to remain under that single templates/ node
to keep the tree accurate.

In `@docs/i18n/README.zh-TW.md`:
- Around line 210-214: The project tree contains a duplicated top-level
"templates/" node; remove the duplicate entry and merge its children so there is
a single "templates/" subtree that lists "cv-template.html",
"portals.example.yml", "states.yml" and the "fonts/" directory (i.e., move
"fonts/" under the existing templates/ node and delete the redundant templates/
root).

In `@examples/ats-normalization-test.md`:
- Line 46: Update the inconsistent verification commands so they all use the
relative script path "scripts/generate-pdf.mjs" (as in the updated Line 46);
locate the older root-level invocations present around Line 35 and Line 39 and
replace them with the same form used on Line 46 (e.g., "node
scripts/generate-pdf.mjs /tmp/dirty-cv.html /tmp/clean-cv.pdf --format=a4") to
ensure every example/verification in examples/ats-normalization-test.md is
normalized and copy/paste-safe.

In `@modes/de/_shared.md`:
- Line 1: The file starts with a UTF-8 BOM which causes parser/tool
compatibility issues and a false-positive "unpaired bracket" warning; remove the
BOM so the file is saved as UTF-8 without BOM and ensure the first characters
read "Geteilter Kontext -- career-ops (Deutsch)" (i.e., the header line begins
at the very first byte), then re-run linting to confirm the unpaired bracket
warning disappears.

In `@modes/followup.md`:
- Line 1: Remove the invisible BOM character at the start of the file so the
header line "# Mode: followup -- Follow-up Cadence Tracker" begins with a normal
'#' character, then re-save the file in UTF-8 without BOM (ensure your
editor/IDE encoding is set to "UTF-8 without BOM" or use a tool to strip the
BOM).

In `@modes/fr/pipeline.md`:
- Line 1: Remove the UTF-8 BOM at the start of the file so the first character
is the '#' of the heading "Mode : pipeline -- Inbox d'URLs (Second Brain)"; open
the file in a text editor or run a tool to strip the BOM (e.g., save as UTF-8
without BOM) and ensure the first byte is '#' to avoid BOM-related
linting/editor issues.

In `@modes/ja/_shared.md`:
- Line 1: The file starts with a UTF-8 BOM (U+FEFF) before the header "共通コンテキスト
-- career-ops(日本語)"; remove that BOM character so the first character of the
file is the “#” header, and save the file as UTF-8 without BOM to prevent
markdown tooling inconsistencies.

In `@modes/ja/pipeline.md`:
- Line 1: Remove the invisible UTF-8 BOM (U+FEFF) at the start of the file
before the text "モード: pipeline -- URL インボックス(Second Brain)" and re-save the file
as UTF-8 without BOM so the first character is the visible '#' instead of the
BOM; ensure your editor/CI enforces UTF-8 without BOM for this file.

In `@modes/patterns.md`:
- Line 1: The first line "Mode: patterns -- Rejection Pattern Detector" contains
a leading UTF-8 BOM which can break some Markdown parsers; remove the BOM so the
file is plain UTF-8 (no BOM) by editing the file encoding or deleting the BOM
character at the start of that header line (e.g., reopen in UTF-8-without-BOM or
run a BOM-strip command) and verify the line now begins exactly with "Mode:
patterns -- Rejection Pattern Detector".

In `@modes/pdf.md`:
- Line 1: The file header "Modo: pdf — Generación de PDF ATS-Optimizado"
contains a leading UTF-8 BOM character; remove the BOM from the start of
modes/pdf.md so the file begins with the visible header text only, then save and
re-commit the file (you can strip it with an editor or a one-line tool/command
before committing). Ensure the first byte is not the BOM and verify the file
renders correctly in Markdown viewers after the change.
- Line 21: The script scripts/generate-pdf.mjs calls join() but only imports
resolve and dirname from 'path'; update the import statement to include join
(e.g., import { resolve, dirname, join } from 'path') or replace the join usage
(projectRoot = join(__dirname, '..')) with an existing function like resolve to
avoid the ReferenceError; locate the import line importing resolve and dirname
and add join, and verify projectRoot is set correctly in the top-level script.

In `@modes/pipeline.md`:
- Line 1: The file starts with a UTF-8 BOM before the first line ("# Modo:
pipeline — Inbox de URLs (Second Brain)"); remove that leading BOM character and
re-save the document as UTF-8 without BOM so the first character is the hash (#)
and keep the rest of the line intact, then verify tools/CI no longer report
encoding issues.

In `@modes/ru/_shared.md`:
- Line 1: Remove the UTF-8 BOM from the first line which currently reads "#
Общий контекст — career-ops (Русский)"; edit the header so it starts with a
plain '#' character (e.g., "# Общий контекст — career-ops (Русский)") to
eliminate the hidden BOM and ensure consistent encoding and tooling behavior.

In `@modes/ru/oferta.md`:
- Line 1: Remove the leading UTF-8 BOM (U+FEFF) from the start of
modes/ru/oferta.md and any other updated markdown files in this PR; open each
file in a text editor or run a strip step that removes a BOM at the first
character so the file begins with the visible text "Режим: oferta — Полная
оценка A-F" and re-save without the BOM to avoid noisy diffs and parser/linter
issues.

In `@scripts/generate-pdf.mjs`:
- Around line 116-117: The script currently sets fontsDir (const fontsDir =
resolve(projectRoot, 'templates', 'fonts')) and proceeds to rewrite font URLs
without checking the directory exists; add an existence check for fontsDir
before any URL rewriting and handle both branches: if missing, either fail fast
with a clear, actionable error message (including fontsDir) or log a warning and
skip the rewrite step so file:// URLs are not produced, and if present continue
with the current rewrite logic; update the code paths that reference fontsDir
(the variable and the function that performs URL rewriting) to follow this
check.
- Line 20: The file uses join to construct projectRoot but join is not imported
from the path module; update the import that provides path (the import where
path is referenced) to also import join (so that join(...) used to set
projectRoot resolves), or alternatively replace usage with path.join if you
prefer keeping a default import; ensure the symbol join is defined before using
it in the assignment to projectRoot.

In `@scripts/README.md`:
- Line 3: Update the README's opening sentence and the script table guidance so
it doesn't claim every script is run with `npm run <name>`: change the header
line that currently reads like "All utility scripts for career-ops. Run via `npm
run <name>`..." to indicate "Most utility scripts..." or similar, and for the
table rows that lack npm aliases provide explicit execution examples (e.g.,
"node scripts/<file>.mjs") next to those entries; ensure you update both the
initial summary sentence and the table rows referenced near the script listings
so readers know when to use `npm run` versus `node scripts/<file>.mjs`.

In `@scripts/update-system.mjs`:
- Around line 50-63: The SYSTEM_PATHS allowlist is missing the new
scripts/README.md file; update the SYSTEM_PATHS array in
scripts/update-system.mjs to include 'scripts/README.md' so the auto-update
logic (the SYSTEM_PATHS constant used by the updateSystem function) will treat
that doc as a system-updatable file and avoid drift between local and upstream
script documentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cfbea418-2b66-4395-a9f8-e029420efd00

📥 Commits

Reviewing files that changed from the base of the PR and between 2051beb and 579d2a9.

⛔ Files ignored due to path filters (4)
  • templates/fonts/dm-sans-latin-ext.woff2 is excluded by !**/*.woff2
  • templates/fonts/dm-sans-latin.woff2 is excluded by !**/*.woff2
  • templates/fonts/space-grotesk-latin-ext.woff2 is excluded by !**/*.woff2
  • templates/fonts/space-grotesk-latin.woff2 is excluded by !**/*.woff2
📒 Files selected for processing (51)
  • .github/PULL_REQUEST_TEMPLATE.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • DATA_CONTRACT.md
  • README.md
  • batch/batch-prompt.md
  • batch/batch-runner.sh
  • docs/ARCHITECTURE.md
  • docs/CUSTOMIZATION.md
  • docs/SCRIPTS.md
  • docs/SETUP.md
  • docs/i18n/README.es.md
  • docs/i18n/README.ja.md
  • docs/i18n/README.ko-KR.md
  • docs/i18n/README.pt-BR.md
  • docs/i18n/README.ru.md
  • docs/i18n/README.zh-TW.md
  • examples/ats-normalization-test.md
  • modes/_shared.md
  • modes/de/_shared.md
  • modes/de/pipeline.md
  • modes/followup.md
  • modes/fr/_shared.md
  • modes/fr/pipeline.md
  • modes/ja/_shared.md
  • modes/ja/pipeline.md
  • modes/patterns.md
  • modes/pdf.md
  • modes/pipeline.md
  • modes/pt/_shared.md
  • modes/pt/pipeline.md
  • modes/ru/_shared.md
  • modes/ru/oferta.md
  • modes/ru/pipeline.md
  • package.json
  • scripts/README.md
  • scripts/analyze-patterns.mjs
  • scripts/check-liveness.mjs
  • scripts/cv-sync-check.mjs
  • scripts/dedup-tracker.mjs
  • scripts/doctor.mjs
  • scripts/followup-cadence.mjs
  • scripts/generate-pdf.mjs
  • scripts/lib/liveness-core.mjs
  • scripts/merge-tracker.mjs
  • scripts/normalize-statuses.mjs
  • scripts/scan.mjs
  • scripts/test-all.mjs
  • scripts/update-system.mjs
  • scripts/verify-pipeline.mjs
  • templates/README.md

Comment thread batch/batch-prompt.md
Comment thread docs/i18n/README.ja.md
Comment thread docs/i18n/README.ko-KR.md
Comment thread docs/i18n/README.pt-BR.md
Comment thread docs/i18n/README.ru.md
Comment thread modes/ru/oferta.md
Comment thread scripts/generate-pdf.mjs
Comment thread scripts/generate-pdf.mjs
Comment thread scripts/README.md
Comment thread scripts/update-system.mjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant