- chore(release): v1.5.0 — the move to Gitea (D38), suite 4.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 KiB
CLAUDE.md — SoftHarbor
Root instruction file for AI-assisted development (Claude Code). Read this first. Detailed specs live in
docs/00–16. Suite version: 4.0 (2026-11-24, site v1.5.0) · Author: poli0981 / SkullMute
What this project is
SoftHarbor is a fully static, bilingual (EN/VI) directory of desktop software that is either free or purchasable with a single one-time payment — never subscription-only. It exists so that after a fresh Windows install (or macOS/Linux setup) you open one page, filter by category, and jump straight to each app's official homepage/repo/download page instead of googling every tool one by one.
- Repo:
poli0981/softharboron the owner's Gitea (https://git.poli0981.dev/poli0981/softharbor, see "Forge & CI" below) · License: code GPL-3.0-only, data CC BY-SA 4.0 - Hosting: Cloudflare Workers Static Assets on canonical
https://softharbor.net(Free zone;www301s to apex; workers.dev route disabled — seedocs/16), deployed by the CIdeployjob (wrangler deploy) whenmainchanges. One tiny Worker runs the site-wide rate limit (D32) and answersPOST /api/verify(D25); no backend, no database. - Stack: Node 26 · pnpm 11 · Astro 7 (static output) · Svelte 5 islands ·
Tailwind CSS 4.3 · TypeScript strict (TS 7
tscbeside the TS 6 API thatastro checkneeds — D28) · Wrangler 4 — full table indocs/01
Maintenance mode (D36 — since 2026-11-15)
The project is feature-frozen: maintained, not extended. Work that is in scope — and nothing else:
- Catalogue — add, correct or remove listings (one app per PR; the owner reviews the Vietnamese), VirusTotal re-checks, quarantine.
- Fixes — bugs, UI/UX defects and accessibility barriers.
- Dependencies — Renovate's PRs (grouped non-major, OSV security PRs); out of schedule for any advisory rated High or Critical, or a serious Node.js security release.
- Major language / platform moves — TypeScript (6 → 7), Astro, Svelte, Tailwind, Node, Cloudflare Workers / Wrangler majors, the forge and its CI (D38).
- Incidents — the site down, degraded or under attack.
Out of scope: new features, including the frozen feature items of
docs/15 §2. Close an issue or PR that proposes one as not planned with the
wontfix label, and never start one unless the owner lifts D36 first.
Releases: a patch tag when a fix is worth announcing, a minor one for a
platform major; data changes never tag (docs/13 §1).
Hard rules (never violate)
- Static-first. No SSR, no database, no serverless functions; all
interactivity is client-side Svelte islands. The ONE exception is
worker/, a minimal Worker that does exactly two things: the site-wide rate limit (D32 — over it, a 429; otherwise the request goes to the asset server untouched) andPOST /api/verify(D25, the legal gate's Turnstile check). It runs only for the paths inassets.run_worker_first, never renders or rewrites a page, never withholds one from a person reading at a normal pace, and every failure on its side must fail OPEN. Anything else that seems to need a server: redesign it or move it to a Gitea Actions workflow — a second Worker route, or a change to what runs it first, needs a decision-log entry. - Data is law. Every listed app is exactly one JSON file in
src/data/apps/<slug>.json, validated by the Zod schema insrc/content.config.ts. Invalid data must fail the build. Never bypass the schema, never hand-edit generated indexes. - No subscription-only software.
pricing∈free | free-onetime | onetime. If full desktop use requires a recurring payment, the app does not enter the list (inclusion criteria:docs/00 §3). - Never assert "no virus". Security is expressed only as
security.status: clean | flagged | unverified+checkedAtdate + optionalevidenceURL. UI copy must say "no known warnings as of ", never guarantee safety. - Flagged ⇒ quarantine, never delete. Any app with
status: "flagged"is moved by workflow todata/quarantine/(outside the content glob) and disappears from the site on next build. History is preserved; restoration is a reviewed PR. Seedocs/03 §5. - Bilingual parity. Every user-facing UI string exists in both
src/i18n/en.jsonandsrc/i18n/vi.json; every app hassummary.enandsummary.vi. A missing key in either language fails CI. - Self-host everything. Fonts (Fontsource), logos (Simple Icons /
src/assets/logos/), scripts, styles. The only third-party runtime requests are two Cloudflare services, each started by our own code: Web Analytics (src/scripts/analytics.js— never under Global Privacy Control, production host only; D26) and Turnstile (src/lib/turnstile.ts— only after the legal gate is accepted; D25). Adding a third needs a decision-log entry. The CSP (default-src 'self'plus exactly those origins,docs/09 §4) must keep passingpnpm check:cspand the e2e suite. - Official links only, original words only.
links.*must point to the developer's official domain or official repo. Summaries are written from scratch — never paste vendor marketing copy or Wikipedia text (data is CC BY-SA 4.0; provenance must be clean).
Forge & CI (D38 — since 2026-11-24)
The GitHub account was suspended in November 2026. The repository lives on
Gitea, https://git.poli0981.dev/poli0981/softharbor, as origin; the
github remote is the old repository's — keep it, never push to it.
- Outside issues and merge requests arrive on the GitLab push mirror,
gitlab.com/poli0981/softharbor, where no CI runs; patches come by e-mail tocode@. Registration on the Gitea is closed. - Workflows are Gitea Actions in
.gitea/workflows/(ci,security,qodana,notify,quarantine,vt-recheck,link-check) on one runner on the maintainer's PC: jobs run only while it is on, every cron sits inside 13:00–16:00 UTC on a registered slot, and every action is pinned to a SHA. The ops repo's reusables are pinned by hand to an ops tag. - Deploy is
ci.yml'sdeployjob (wrangler deployon pushes tomain, Cloudflare secrets at user level); Workers Builds is gone and there are no PR previews. - Bots (quarantine, vt-recheck, link-check) talk to Gitea through
scripts/gitea.mjswith the job token; they dispatch CI on their branch, andci.yml'srecordjob writes the statuses a dispatched run lacks. - Renovate (
renovate.json→local>poli0981/renovate-config) replaces Dependabot; the opssecurity.yml(gitleaks, Opengrep, osv-scanner) replaces CodeQL; Qodana runs through the opsreusable-qodana.yml; SonarQube Cloud and GitHub code scanning are gone. - Rules: branch protection on
mainrequiresCI / build (*)andCI / gates (*)(Gitea names a check<workflow> / <job> (<event>), so renaming either breaks the rule); squash merges; signed commits are not required (the bots cannot sign). - The migration runbook is
docs/GITEA-MIGRATION.mdinpoli0981/.github(E:\.githubon the PC); for migration topics it wins over this file, and a conflict is reported. The details are indocs/12.
Build phases
Work in order. Do not start a phase before the previous phase's exit
criteria (docs/15) are met.
| Phase | Scope | Key docs |
|---|---|---|
| P1 — Scaffold & spikes | pnpm create astro, add integrations, run spikes S1–S5, commit toolchain baseline |
01, 11 |
| P2 — Data layer | Content collections, Zod schema, categories registry, validate-data script, 5 seed apps |
03, 04 |
| P3 — Static pages | Welcome, /apps, /apps/[slug], /categories/[id], layouts, tokens, fonts, dark mode (no JS yet) |
02, 06 |
| P4 — Islands | Search/filter/sort (MiniSearch + nanostores), language switcher, theme toggle, legal gate | 05, 06, 07, 14 |
| P5 — Resilience & outputs | 404/offline/PWA, dormant error templates, /api/apps.json, /rss.xml, bug-report button |
03, 05, 08 |
| P6 — Ship | _headers, CI/CD wiring, deploy, seed the app catalogue (326 as of 2026-07-30; 364 after batch 2, 2026-10-23; 373 after batch 3, 2026-11-09; 390 after batch 4, 2026-11-24), launch checklist |
09, 10, 12, 13 |
All six phases are done — v1.0.0 shipped on 2026-07-30 — and no new phase opens: the project is in maintenance mode (above).
Commands
pnpm install # Node 26 required (see .nvmrc / engines)
pnpm dev # astro dev
pnpm build # astro build → dist/
pnpm preview # astro preview
pnpm lint # eslint + prettier --check
pnpm check # astro check (TS 6) + tsc --noEmit (TS 7)
pnpm test # vitest run (unit, islands, scripts, worker)
pnpm coverage # vitest run --coverage (thresholds in vitest.config.ts)
pnpm e2e # playwright + axe against astro preview (build first)
pnpm validate:data # node scripts/validate-data.mjs (L2 data rules)
pnpm vt:recheck # VirusTotal re-check (needs VT_API_KEY; docs/12 §4b)
pnpm i18n:check # node scripts/check-i18n-parity.mjs (EN/VI key parity)
pnpm deploy # build + wrangler deploy (CI's deploy job does this on main)
Naming & identifiers (locked)
- Component prefix
Sh*:ShAppCard.astro,ShSearch.svelte,ShLegalGate.svelte,ShFilterSheet.svelte,ShLangSwitch.svelte,ShPrefs.svelte(display menu; replacedShThemeToggle) - CSS custom properties:
--sh-*· localStorage keys:sh:legal,sh:human,sh:lang,sh:theme,sh:scrollbar,sh:motion,sh:keys - Worker name:
softharbor(code inworker/, endpoint/api/verify) · Data:src/data/apps/· Quarantine:data/quarantine/ - Contacts: one
@poli0981.devaddress per purpose —src/lib/contacts.ts(D27)
Document map
| Doc | Contents |
|---|---|
docs/00_PROJECT_OVERVIEW.md |
Pitch, principles, inclusion criteria, locked decisions, identifiers, human-only TODOs |
docs/01_TECH_STACK.md |
Verified versions (2026-07-15), rationale, upgrade & CVE policy |
docs/02_ARCHITECTURE.md |
Static-first architecture, project tree, routing, wrangler config |
docs/03_DATA_FLOW.md |
Authoring → validation → build → indexes → quarantine → feeds |
docs/04_DATA_SCHEMA.md |
Zod schema, field reference, categories registry, examples |
docs/05_ALGORITHMS.md |
VN-insensitive normalizer, search, filters, feed, ring buffer, issue-URL builder |
docs/06_UI_SPEC.md |
Design tokens, fonts, layouts, card anatomy, motion, a11y |
docs/07_I18N.md |
EN/VI routing, dictionaries, hreflang, switcher, search across locales |
docs/08_PLATFORM_CLOUDFLARE.md |
Workers setup guide, error-page matrix, PWA/offline, future custom-domain appendix |
docs/09_SECURITY_PRIVACY.md |
Threat model, _headers/CSP, security.txt, data-vetting policy, privacy |
docs/10_CODING_STANDARDS.md |
TS/ESLint/Prettier/Knip/lefthook, naming, commits, DoD |
docs/11_TESTING.md |
Test pyramid, P0 spikes S1–S5, coverage targets |
docs/12_CI_CD.md |
Gitea Actions: ci (build, gates, record, deploy) / security / qodana / notify / quarantine / vt-recheck / link-check, scripts/gitea.mjs, Renovate, issue templates, branch protection |
docs/13_RELEASE.md |
Launch checklist, seed list, versioning, notify.py announcement |
docs/14_LEGAL.md |
Licensing model, legal-gate spec, bilingual drafts (Disclaimer/Privacy/Terms/Trademarks/Third-party) |
docs/15_ROADMAP.md |
Milestones, post-v1 backlog, decision log, open questions |
docs/16_DOMAIN_SEO.md |
softharbor.net: zone/DNS/DNSSEC, redirects, HSTS, email, robots/JSON-LD, GSC/Bing/IndexNow, off-by-choice features |