Skip to content

Contributing Guide ​

Thank you for your interest in the Luker project! This document explains how to contribute code, documentation, and other improvements to Luker.

Setting Up the Development Environment ​

  1. Fork the repository: Fork the Luker repository to your own GitHub account.

  2. Clone locally:

bash
git clone https://github.com/<your-username>/Luker.git
cd Luker
  1. Install dependencies:
bash
npm install
  1. Start the development server:
bash
node server.js

By default it listens on http://localhost:8000. You can change the port via command-line arguments or config.yaml.

Branching Strategy ​

  • release — The stable branch, always kept in a releasable state. All PRs should target release.
  • Create feature branches from release for new development.
bash
git checkout -b feat/my-new-feature release

IMPORTANT

Luker's stable branch is release.

Recommended branch naming conventions:

PrefixPurposeExample
feat/New featurefeat/memory-graph-export
fix/Bug fixfix/chat-sync-race-condition
docs/Documentation improvementdocs/extension-api-examples
refactor/Code refactoringrefactor/preset-manager
chore/Build/toolchainchore/update-dependencies

Commit Convention ​

Luker follows the Conventional Commits specification:

<type>(<scope>): <description>

[optional body]

[optional footer(s)]

Types:

TypeDescription
featNew feature
fixBug fix
docsDocumentation changes
styleCode formatting (no logic changes)
refactorRefactoring (no new features or bug fixes)
perfPerformance optimization
testTest-related changes
choreBuild/toolchain/dependency updates

Examples:

feat(memory-graph): add hierarchical compression for event nodes

fix(search-tools): handle empty query in web search

docs(extension-api): add examples for registerExtensionApi

Pull Request Workflow ​

  1. Ensure code quality: Check code style and basic functionality before submitting.

  2. Push your branch:

bash
git push origin feat/my-new-feature
  1. Create a PR: Open a Pull Request on GitHub targeting the release branch.

  2. PR description: Clearly describe the changes, motivation, and impact. Reference any related Issues.

  3. Code review: Maintainers will review the code and provide feedback. Please respond to review comments promptly.

  4. Merge: Once the review is approved, maintainers will merge the PR.

Code Style ​

Basic Rules ​

  • Indentation: 4 spaces
  • Quotes: Single quotes (JavaScript)
  • Semicolons: Required
  • Line endings: LF (\n), do not use CRLF
  • End of file: Keep one trailing newline

IMPORTANT

All files must use LF line endings. Windows users should configure Git:

bash
git config core.autocrlf input

Or ensure * text=auto eol=lf is set in .gitattributes.

Naming Conventions ​

ContextStyleExample
Variables and functionscamelCaseloadSettings()
ConstantsUPPER_SNAKE_CASEDEFAULT_TIMEOUT
CSS class nameskebab-casechat-message-container
File nameskebab-casepreset-manager.js

Module System ​

  • Frontend code: ES Modules (import/export)
  • Backend code: ES Modules (import/export)

Comments ​

  • Key logic and public APIs should have JSDoc comments
  • Complex algorithms or business logic should include inline comments explaining intent
  • Avoid meaningless comments (e.g., // increment counter followed by counter++)

Project Structure Overview ​

Luker/
├── server.js              # Server entry point
├── src/                   # Backend source code
│   ├── endpoints/         # API routes
│   └── middleware/        # Middleware
├── public/                # Frontend assets
│   ├── scripts/           # Frontend scripts
│   │   ├── extensions/    # Built-in extensions
│   │   │   └── third-party/  # Third-party plugins
│   │   └── ...            # Core modules
│   └── ...                # Static assets
├── docs/                  # Documentation (English at root)
│   ├── zh-CN/             # Simplified Chinese documentation
│   └── zh-TW/             # Traditional Chinese documentation
└── config.yaml            # Server configuration

Testing ​

  • New features should include basic functional verification
  • Bug fixes should describe reproduction steps and the fix approach
  • Ensure changes do not break existing functionality
  • Test across multiple browsers and devices (where applicable)

Documentation Contributions ​

Documentation is located in the docs/ directory and uses Markdown format:

  • English documentation: docs/ (root)
  • Simplified Chinese documentation: docs/zh-CN/
  • Traditional Chinese documentation: docs/zh-TW/

Documentation contributions follow the same PR workflow described above. When writing documentation, please note:

  • Use accurate technical terminology
  • Keep code and API names in English
  • Use code blocks and tables where appropriate
  • For cross-references, English uses unprefixed paths (e.g., /development/contributing); Chinese versions use /zh-CN/ or /zh-TW/ prefixes
  • All files must use LF line endings

Reporting Issues ​

If you find a bug or have a feature suggestion, please submit it via GitHub Issues. When filing an Issue, please include:

  • Problem description
  • Reproduction steps (if applicable)
  • Expected behavior vs. actual behavior
  • Environment information (OS, Node.js version, browser)

Code of Conduct ​

Please respect all contributors and users. Maintain a friendly and professional tone in all communications.

Built upon SillyTavern