Files
poli0981andClaude Opus 5.5 7b197c702b
CI / build (push) Successful in 3m17s
CI / gates (push) Successful in 58s
CI / record (push) Skipped
Reusable / Qodana / Qodana (push) Successful in 2m55s
Qodana / qodana (push) Successful in 2m55s
Reusable / Security / Secrets (gitleaks) (push) Successful in 11s
Reusable / Security / Rust (cargo-deny) (push) Skipped
Reusable / Security / .NET (NuGetAudit) (push) Skipped
Reusable / Security / SAST (Opengrep) (push) Successful in 25s
Reusable / Security / Dependencies (osv-scanner) (push) Successful in 16s
Security / security (push) Successful in 52s
CI / deploy (push) Successful in 1m5s
Reusable — Announce Release to Discord / announce (release) Successful in 9s
notify / announce (release) Successful in 9s
chore(release): v1.5.0 — the move to Gitea (D38), suite 4.0 (#4)
- chore(release): v1.5.0 — the move to Gitea (D38), suite 4.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:41:13 +00:00

12 KiB
Raw Permalink Blame History

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/softharbor on 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; www 301s to apex; workers.dev route disabled — see docs/16), deployed by the CI deploy job (wrangler deploy) when main changes. One tiny Worker runs the site-wide rate limit (D32) and answers POST /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 tsc beside the TS 6 API that astro check needs — D28) · Wrangler 4 — full table in docs/01

Maintenance mode (D36 — since 2026-11-15)

The project is feature-frozen: maintained, not extended. Work that is in scope — and nothing else:

  1. Catalogue — add, correct or remove listings (one app per PR; the owner reviews the Vietnamese), VirusTotal re-checks, quarantine.
  2. Fixes — bugs, UI/UX defects and accessibility barriers.
  3. 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.
  4. Major language / platform moves — TypeScript (6 → 7), Astro, Svelte, Tailwind, Node, Cloudflare Workers / Wrangler majors, the forge and its CI (D38).
  5. 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)

  1. 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) and POST /api/verify (D25, the legal gate's Turnstile check). It runs only for the paths in assets.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.
  2. Data is law. Every listed app is exactly one JSON file in src/data/apps/<slug>.json, validated by the Zod schema in src/content.config.ts. Invalid data must fail the build. Never bypass the schema, never hand-edit generated indexes.
  3. 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).
  4. Never assert "no virus". Security is expressed only as security.status: clean | flagged | unverified + checkedAt date + optional evidence URL. UI copy must say "no known warnings as of ", never guarantee safety.
  5. Flagged ⇒ quarantine, never delete. Any app with status: "flagged" is moved by workflow to data/quarantine/ (outside the content glob) and disappears from the site on next build. History is preserved; restoration is a reviewed PR. See docs/03 §5.
  6. Bilingual parity. Every user-facing UI string exists in both src/i18n/en.json and src/i18n/vi.json; every app has summary.en and summary.vi. A missing key in either language fails CI.
  7. 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 passing pnpm check:csp and the e2e suite.
  8. 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 to code@. 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's deploy job (wrangler deploy on pushes to main, 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.mjs with the job token; they dispatch CI on their branch, and ci.yml's record job writes the statuses a dispatched run lacks.
  • Renovate (renovate.json → local>poli0981/renovate-config) replaces Dependabot; the ops security.yml (gitleaks, Opengrep, osv-scanner) replaces CodeQL; Qodana runs through the ops reusable-qodana.yml; SonarQube Cloud and GitHub code scanning are gone.
  • Rules: branch protection on main requires CI / build (*) and CI / 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.md in poli0981/.github (E:\.github on the PC); for migration topics it wins over this file, and a conflict is reported. The details are in docs/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; replaced ShThemeToggle)
  • CSS custom properties: --sh-* · localStorage keys: sh:legal, sh:human, sh:lang, sh:theme, sh:scrollbar, sh:motion, sh:keys
  • Worker name: softharbor (code in worker/, endpoint /api/verify) · Data: src/data/apps/ · Quarantine: data/quarantine/
  • Contacts: one @poli0981.dev address 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