Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,48 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project Overview

XMOJ-Script is a browser userscript that enhances the XMOJ online judge platform (xmoj.tech). This repository consists of:
- **Main userscript** (`XMOJ.user.js`): ~5000 line single-file userscript with all features. As this file is very large you should use the xmoj-code-navigator agent to help you whenever possible.
- **Main userscript** (`XMOJ.user.js`): ~5000 line single-file userscript with all features. **See "Working with XMOJ.user.js" section below for CRITICAL instructions on using the xmoj-code-navigator agent.**
- **Update/version management scripts** (`Update/`): Automation for version bumping and releases
- **Metadata and documentation**: `Update.json` tracks version history, README and contributing guides

The `backend/` directory is a git submodule pointing to https://github.com/XMOJ-Script-dev/XMOJ-bbs and should be modified in that repository, not here.

## Working with XMOJ.user.js (CRITICAL)

**IMPORTANT: Due to the large size of XMOJ.user.js (~5000 lines), you MUST use the xmoj-code-navigator agent whenever you need to explore, search, or understand any part of this file.**

### When to use xmoj-code-navigator

Use the Task tool with `subagent_type="xmoj-code-navigator"` for:

- **Finding specific functions or features**: "Where is the auto-refresh functionality implemented?"
- **Understanding code sections**: "How does the login authentication work?"
- **Locating code patterns**: "Find all API calls to the backend"
- **Searching for specific implementations**: "Show me the dark mode toggle implementation"
- **Verifying if code exists**: "Does XMOJ.user.js have a function for parsing XML?"
- **ANY exploration task involving XMOJ.user.js**

### Why use this agent

Loading the entire XMOJ.user.js file into context:
- Wastes context window space
- Makes responses slower
- Is unnecessary when you only need specific sections

The xmoj-code-navigator agent efficiently locates and retrieves only the relevant code sections you need.

### Example usage

```
Instead of: Read tool on XMOJ.user.js (loads entire 5000 lines)
Use: Task tool with xmoj-code-navigator agent to find specific sections
```

**Exception**: Only use Read tool on XMOJ.user.js when:
- You need to edit a specific line number you already know
- You're making targeted edits and already know the exact location
- You need to verify a small, specific section (use offset and limit parameters)

## Development Workflow

### Branch Structure and PR Requirements
Expand Down
22 changes: 22 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3299,6 +3299,28 @@
}
],
"Notes": "Adds WebSocket-based real-time notification system for BBS mentions and mail notifications. Notifications now arrive within 1-2 seconds instead of requiring page focus. Includes automatic reconnection with exponential backoff and fallback to polling when WebSocket is unavailable."
},
"2.7.4": {
"UpdateDate": 1771211196807,
"Prerelease": true,
"UpdateContents": [
{
"PR": 906,
"Description": "Add toggleable Minimalist Monochrome UI"
}
],
"Notes": "Added a new toggleable \"极简黑白界面风格\" (Minimalist Monochrome UI) setting under Beautify options. Features serif typography, zero border-radius, line-based visual structure, and automatic dark mode support with charcoal tones."
},
"3.0.0": {
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Update.json version entries are auto-generated; manually adding a new version (3.0.0) violates the repository’s automated versioning workflow. Remove manual edits and let UpdateVersion.js generate the entry.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Update.json, line 3314:

<comment>Update.json version entries are auto-generated; manually adding a new version (3.0.0) violates the repository’s automated versioning workflow. Remove manual edits and let UpdateVersion.js generate the entry.</comment>

<file context>
@@ -3310,6 +3310,17 @@
             ],
             "Notes": "Added a new toggleable \"极简黑白界面风格\" (Minimalist Monochrome UI) setting under Beautify options. Features serif typography, zero border-radius, line-based visual structure, and automatic dark mode support with charcoal tones."
+        },
+        "3.0.0": {
+            "UpdateDate": 1771211353041,
+            "Prerelease": true,
</file context>
Fix with Cubic

"UpdateDate": 1771211353041,
"Prerelease": true,
"UpdateContents": [
{
"PR": 906,
"Description": "Add toggleable Minimalist Monochrome UI"
}
],
"Notes": "Added a new toggleable \"极简黑白界面风格\" (Minimalist Monochrome UI) setting under Beautify options. Features serif typography, zero border-radius, line-based visual structure, and automatic dark mode support with charcoal tones."
}
}
}
Loading