Skip to content

Remove Unowned Domain Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Remove the unowned legacy domain from all current website source, configuration, and documentation without breaking traffic data or repository navigation.

Architecture: The production domain remains deployment-time configuration through VITEPRESS_SITE_URL. The traffic collector receives its callback URL only from a secret or deployment variable, while the public traffic API no longer reports a hard-coded host allowlist. Documentation uses relative links or a neutral example domain.

Tech Stack: TypeScript, Cloudflare Pages Functions and Workers, VitePress, Vitest, Markdown.

Global Constraints

  • Do not rewrite Git history.
  • Do not select or configure a replacement production domain.
  • Do not introduce any domain-specific secret or deployment value into Git.

Task 1: Remove the old domain from traffic runtime behavior

Files:

  • Modify: functions/api/traffic.ts
  • Modify: functions/api/traffic.test.ts
  • Modify: wrangler.collector.jsonc
  • Modify: DEPLOYMENT.md

Interfaces:

  • Consumes: buildTrafficResponse(live, archive, now).

  • Produces: traffic payloads without a hard-coded hosts property and a collector that requires TRAFFIC_SYNC_URL to be configured outside Git.

  • [ ] Step 1: Write the failing test

Add this expectation to the existing adds today's live metrics to the permanent D1 archive test:

ts
expect(result).not.toHaveProperty("hosts");
  • [ ] Step 2: Run test to verify it fails

Run: npm test -- functions/api/traffic.test.ts

Expected: FAIL because buildTrafficResponse currently returns a hosts property.

  • [ ] Step 3: Write minimal implementation

Remove PUBLIC_HOSTS and the hosts: PUBLIC_HOSTS response field from functions/api/traffic.ts. Remove TRAFFIC_SYNC_URL from the vars object in wrangler.collector.jsonc. In DEPLOYMENT.md, document TRAFFIC_SYNC_URL as a Worker secret/variable set to the future owned domain plus /api/internal/traffic-sync.

  • [ ] Step 4: Run test to verify it passes

Run: npm test -- functions/api/traffic.test.ts

Expected: PASS with the response still containing traffic totals and no hosts property.

  • [ ] Step 5: Commit
bash
git add functions/api/traffic.ts functions/api/traffic.test.ts wrangler.collector.jsonc DEPLOYMENT.md
git commit -m "fix: remove unowned domain from traffic config"

Files:

  • Modify: README.md
  • Modify: README_en.md
  • Modify: CONTRIBUTING.md
  • Modify: SEO.md

Interfaces:

  • Consumes: repository-relative Markdown links and future deployment environment variables.

  • Produces: documentation that does not publish or recommend the unowned domain.

  • [ ] Step 1: Write the failing source audit

Run: rg -n --hidden --glob '!node_modules/**' --glob '!.git/**' 'workbuddy\\.homes|www\\.workbuddy\\.homes' .

Expected: output identifies the current documentation links and deployment references.

  • [ ] Step 2: Write minimal implementation

Replace README site navigation links with relative repository links, use “待配置的正式网站域名” wording for online reading, replace the contribution-guide site link with its local documentation path, and rewrite SEO manual launch instructions to use https://<your-domain>/sitemap.xml after the user owns a domain.

  • [ ] Step 3: Run source audit to verify the old domain is absent

Run: rg -n --hidden --glob '!node_modules/**' --glob '!.git/**' 'workbuddy\\.homes|www\\.workbuddy\\.homes' .

Expected: exit code 1 and no matches.

  • [ ] Step 4: Commit
bash
git add README.md README_en.md CONTRIBUTING.md SEO.md
git commit -m "docs: remove unowned domain references"

Task 3: Validate and publish the cleanup

Files:

  • Verify: all files changed in Tasks 1 and 2

Interfaces:

  • Consumes: cleaned source tree.

  • Produces: a tested VitePress build ready for a future owned-domain deployment.

  • [ ] Step 1: Run the full automated test suite

Run: npm test

Expected: all Vitest tests pass.

  • [ ] Step 2: Build the static site

Run: npm run docs:build

Expected: VitePress completes successfully and writes docs/.vitepress/dist.

  • [ ] Step 3: Confirm clean Git state and remote equality

Run: git status -sb followed by git fetch origin --prune and git rev-list --left-right --count HEAD...origin/main.

Expected: the branch has only the intended local commits before the final push; after push it reports 0 0.

  • [ ] Step 4: Push the committed cleanup

Run: git push origin main

Expected: the remote main branch receives the cleanup commits.

最后更新:

以真实任务为主线的 WorkBuddy 社区实战读本