- Keep both worktrees clean before merge/rebase:
- feature worktree:
git status --short - main worktree:
git status --short
- feature worktree:
- If any merge/rebase is already in progress, abort it first in that worktree:
- merge:
git merge --abort - rebase:
git rebase --abort
- merge:
- Always checkpoint local changes in main worktree before merge/rebase:
git add -A && git commit -m "temp-before-merge-<branch>"- skip only if there are no local changes.
- Standard merge path:
- commit task in feature worktree
- create/switch feature branch
- rebase feature branch on
main - from main worktree:
git checkout main && git merge --no-ff <feature-branch>
- If user explicitly asks for a single merge commit, use:
git checkout maingit reset --hard <pre-merge-main-commit>git checkout <feature-branch>git rebase maingit checkout maingit merge --no-ff <feature-branch> -m "Merge branch '<feature-branch>' into main"
- Never use automatic conflict-bias strategies blindly (for example:
git merge -X theirs,git merge -X ours,git checkout --theirs .,git checkout --ours .). - If conflicts occur, inspect each conflicted file and resolve intentionally.
- After conflict resolution, run required verification/tests before pushing.
- Do not rebase long-lived mixed-history branches directly onto
mainif it creates broad unrelated conflicts. - Prefer a fresh branch from
main+ cherry-pick only task-relevant commits. - If a branch is already checked out in another worktree, rebase/commit there, then merge by branch name from main worktree.
- If merge pulls unrelated conflicts, abort and retry with a narrower commit set.
- For any merge/rebase conflict involving
package.json, always resolve by taking the current local/checkpointpackage.jsonentirely (full file replacement) without additional review, then continue merge. - Treat
package.jsonas generated/low-priority for conflict resolution and do not block merge completion on its conflicts. - If
package.jsonhas uncommitted changes during merge/rebase workflow, always discard those uncommitted changes and keep the current local/checkpointpackage.jsonversion. - For any merge/rebase conflict involving
tests.md, always resolve by taking the current local/checkpointtests.mdentirely (full file replacement) without additional review, then continue merge. - Treat
tests.mdas low-priority for conflict resolution and do not block merge completion on its conflicts.
- Always create a commit after completing each discrete task or sub-task.
- Do not batch multiple tasks into a single commit.
- Each commit message should describe the specific change made.
- Before merging to local
main, diff-compare all changes on the current branch againstmain.
- After every feature implementation, update
tests.mdin the repository root. - Add a new section describing how to test the feature manually.
- Each test section must include:
- feature/change name
- prerequisites/setup
- exact step-by-step actions
- expected result(s)
- rollback/cleanup notes (if applicable)
- Keep existing test cases; append or update only what is needed for the new feature.
- Do not mark a feature task complete until
tests.mdis updated.
- Test changes before reporting completion when feasible.
- Run Playwright verification only when the user explicitly asks for Playwright/browser automation testing.
- If a change affects package/runtime/module loading behavior, also run a CJS smoke test before completion.
- CJS smoke test requirement:
- Build the project/artifact first (if needed).
- Run a Node
require(...)check against the changed entry (or closest public CJS entry). - Confirm the module loads without runtime errors and expected exported symbol(s) exist.
- Include the exact CJS command and result summary in the completion report.
- For Playwright automation scripts, CJS (
const { chromium } = require('playwright')) is the default style unless ESM is explicitly required. - Preferred Playwright verification pattern for chat parsing changes (when Playwright is requested):
- send a message with a unique marker (for selecting the correct rendered row)
- include mixed content in one message (for example: plain text,
**bold**, and`code`) - inspect row HTML and count expected rendered nodes (for example
strong.message-bold-text) - save screenshot to
output/playwright/<task-name>.png
- Playwright test sequence (when Playwright is requested):
- Start or confirm a single dev server instance (
pnpm run dev -- --host 0.0.0.0 --port 4173). - If there are stale servers on the same port, stop them first to avoid false test results.
- Run Playwright CLI against
http://127.0.0.1:4173(or required test URL) and exercise the changed flow. - For responsive/mobile changes, run checks at 375x812 and 768x1024.
- Wait 2-3 seconds before capturing final screenshot(s).
- Save screenshots under
output/playwright/with task-specific names.
- Start or confirm a single dev server instance (
- Capture screenshots only when Playwright verification is requested.
- If the dev server fails to start due to pre-existing errors, fix them first or work around them before testing.
- If requested Playwright assertions fail, do not report completion; fix and re-run until passing.
- For all browser interactions (navigation, clicking, typing, screenshots, snapshots), prefer the Playwright CLI skill in headless mode over the Cursor IDE browser MCP tool.
- Do not run Playwright for routine task completion unless the user explicitly asks for it.
- Playwright CLI is faster, more reliable, and works in headless environments without a desktop.
- Use headless mode by default; only add
--headedwhen a live visual check is explicitly needed. - Skill location:
~/.codex/skills/playwright/SKILL.md(wrapper script:~/.codex/skills/playwright/scripts/playwright_cli.sh). - Minimum reporting format in completion messages:
- tested URL
- viewport(s)
- assertion/result summary
- screenshot absolute path(s)
- CJS command/result (when module-loading behavior was changed)
- For any
npxpackage behavior test, publish first, then test the published@latestpackage. - Do not rely on local unpublished changes when validating
npxbehavior. - Run
npxvalidation on the Oracle host (not local machine) unless user explicitly asks otherwise. - For Playwright verification of
npxbehavior, use the Oracle host Tailscale URL (for examplehttp://100.127.77.25:<port>) instead oflocalhost.
- Use this flow when validating UI behavior on Oracle A1 from the local Mac machine.
- On A1, start the app server with Codex CLI available in
PATH:export PATH="$HOME/.npm-global/bin:$PATH"pnpm run dev -- --host 0.0.0.0 --port 4173
- From Mac, run Playwright against Tailscale URL (
http://100.127.77.25:4173), not localhost. - Verify success with both checks:
- UI assertion in Playwright (new project/folder appears in sidebar or selector).
- Filesystem assertion on A1 (
test -d /home/ubuntu/<project-name>).
- Save screenshot artifact under
output/playwright/and include it in the report.
- When the user asks to test with Playwright, run the verification on the explicitly requested project/thread context (for example
TestChat). - Screenshot artifacts must show complete passing evidence for the tested feature, not only the base page load.
- For refresh-persistence fixes, include a post-refresh screenshot that still shows the expected UI state.
- For any markdown parsing, link parsing, file-link rendering, or browse-link encoding change, verification in
TestChatis mandatory before reporting completion. - Use CJS Playwright scripts as the default verification implementation:
const { chromium } = require('playwright')- run from repository working directory so local
node_modulesresolves correctly.
- Required validation flow:
- Start dev server at
http://127.0.0.1:4173. - Open project
TestChat. - Open an existing TestChat thread, or create one if none exists.
- Send a message with a unique marker plus target markdown link (example:
<MARKER> [hosting_manager.py](/home/ubuntu/Documents/New Project (2)/hosting_manager.py)). - Locate the rendered row by marker.
- Assert a parsed file link exists (
a.message-file-link) in that row. - Assert link metadata is correct:
hrefincludes encoded full path (example:/codex-local-browse/home/ubuntu/Documents/New%20Project%20(2)/hosting_manager.py)titleequals the original full file path- visible link text contains expected filename.
- Save screenshot to
output/playwright/testchat-<feature>-cjs.png.
- Start dev server at
- Completion report must include:
- tested URL
- thread context (
TestChat) - viewport
- exact CJS command/script path
- assertion summary (
hrefOk,titleOk,textOk) - screenshot absolute path
This repository includes a persistent wiki under llm-wiki/ maintained by an LLM agent.
llm-wiki/raw/: immutable source notes and captured material.llm-wiki/wiki/: synthesized, interlinked markdown pages.llm-wiki/wiki/index.md: catalog of pages.llm-wiki/wiki/log.md: append-only operation log.
- Never edit files under
llm-wiki/raw/after creation. - Prefer updating existing wiki pages over creating duplicates.
- Add wiki links using relative markdown links.
- Keep factual claims tied to one or more source files in
llm-wiki/raw/.
- Ingest:
- Add a source under
llm-wiki/raw/. - Create or update topic/entity pages under
llm-wiki/wiki/. - Update
llm-wiki/wiki/index.md. - Append one entry in
llm-wiki/wiki/log.md.
- Add a source under
- Query:
- Read
llm-wiki/wiki/index.mdfirst. - Read relevant linked pages.
- Synthesize an answer and optionally file it back as a page.
- Read
- Lint:
- Check for orphan pages.
- Check for stale or contradictory claims.
- Add follow-up questions to the log.