ModWe is a Chromium browser extension that modifies websites using user-defined CSS and JS snippets.
These instructions apply to the whole repository unless a deeper AGENTS.md overrides them.
- For implementation work (any non-planning/non-question-only task), if current branch is
mainormaster, ask the user first whether to switch to a newversion/*orfeature/*branch before making edits. - Do not start code changes on
main/masteruntil the user confirms how to proceed.
-
Files that must be updated for each extension version bump:
manifest.json— updateversion
-
Chromium extension version format for
manifest.json:- Use
x.y.zorx.y.z.w(1 to 4 dot-separated numeric parts) - Each part must be an integer in range
0..65535 - Do not use SemVer suffixes like
-betaor+build
- Use
-
When user asks to bump extension to
x.x.x(orx.x.x.x), follow this order:- Ensure branch
version/<requested-version>exists and is checked out (create it if missing). - Update version value in
manifest.json. - Commit version change with message:
Next version.
- Ensure branch
- Build release zip from repository root so
manifest.jsonis at zip root (no wrapping parent directory). - Keep all release artifacts in
releases/. - Read release version from
manifest.jsonand name archive asreleases/ModWe-<version>-release.zip. - Exclude repository/editor metadata and agent docs from release archive:
.git/*.idea/*.gitignoreAGENTS.mdCLAUDE.mdModWe-*.zipreleases/*
- Standard command:
VERSION=$(sed -n 's/.*"version": "\(.*\)".*/\1/p' manifest.json | head -n1)
mkdir -p releases
zip -rFS "releases/ModWe-${VERSION}-release.zip" . \
-x '.git/*' '.idea/*' '.gitignore' 'AGENTS.md' 'CLAUDE.md' 'ModWe-*.zip' 'releases/*'- Validate exclusions:
unzip -l "releases/ModWe-${VERSION}-release.zip" | rg 'AGENTS\.md|CLAUDE\.md|\.gitignore|^.* releases/' || true- Validation output should be empty.
- Add comments for functions at minimum.
- Add additional comments around special or non-obvious logic.
- In every change, follow established patterns from related contexts in this project (similar screen, feature, layer, or widget type).
- Prefer consistency with existing structure and naming over introducing a new approach.
- If multiple patterns exist, choose the one used in the closest relevant files unless the user explicitly asks otherwise.
- Keep shared helpers in
service/orutils.js - Keep feature-specific logic in its context (
background.js,popup/,options/) - Prefer functional, stateless utilities over OOP-style service classes with internal state
- When adding TODO comments, use the format:
// TODO(name) some text. - Prefer
namefromgit config user.nameof the user running the agent. - If the name is unknown, ask the user once, then remember and reuse it consistently.
- When completing user requests, treat existing TODOs as informational only; do not execute or integrate them unless the user explicitly asks for that TODO work.
- Before proposing a plan or starting code changes, review related files in the same domain/context to identify established patterns and structure.
- Use those nearby implementations as the primary reference for architecture, naming, state handling, and UI composition decisions.
- If patterns conflict, prefer the closest feature-equivalent example and call out the choice in your summary.
- Prefer
rg/rg --filesfor search when available. - If
rgis not available or not working in the current environment, immediately fall back togrep/findand provide the user with conciseripgrepinstallation instructions for their OS, including at least one web reference.
- After finishing code changes, run available project checks and resolve issues introduced by your changes before handoff.
- If lint tooling is available, prefer targeted checks for changed files first.
- For manifest changes, verify
manifest.jsonstays valid JSON andversionfollows Chromium extension rules.
- After code changes and validation, include a short summary of changed files in your final response.
- Use plain text (non-clickable) project-relative file references only.
- For each relevant change block, include the starting line number using the
path:lineformat (for exampleoptions/default.js:120). - Do not use markdown file links for handoff file references.
- Keep this summary concise and focused on user-impacting or logic-impacting edits.