-
Notifications
You must be signed in to change notification settings - Fork 24
Add Claude.md #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
benthecarman
wants to merge
1
commit into
lightningdevkit:main
Choose a base branch
from
benthecarman:claude.md
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Claude.md #112
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| See [CONTRIBUTING.md](CONTRIBUTING.md) for build commands, testing, code style, and development workflow. | ||
|
|
||
| ## Workspace Structure | ||
|
|
||
| - **ldk-server** - Main daemon server (entry point: `src/main.rs`) | ||
| - **ldk-server-cli** - CLI client using clap | ||
| - **ldk-server-client** - Reqwest-based client library | ||
| - **ldk-server-protos** - Protocol buffer definitions and generated Rust code | ||
|
|
||
| ## Development Rules | ||
|
|
||
| - Always ensure tests pass and lints are fixed before committing | ||
| - Run `cargo fmt --all` after every code change | ||
| - Never add new dependencies unless explicitly requested | ||
| - Please always disclose the use of any AI tools in commit messages and PR descriptions | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Contributing to LDK Server | ||
|
|
||
| Contributions are welcome and encouraged! Whether you're fixing bugs, adding features, improving documentation, or | ||
| helping with testing, we appreciate your help! | ||
|
|
||
| ## Building | ||
|
|
||
| ```bash | ||
| cargo build # Build all crates | ||
| cargo build --release # Production build (LTO enabled) | ||
| ``` | ||
|
|
||
| ## Running | ||
|
|
||
| ```bash | ||
| cargo run --bin ldk-server ./ldk-server/ldk-server-config.toml | ||
| ``` | ||
|
|
||
| ## Testing | ||
|
|
||
| ```bash | ||
| cargo test # Run all tests | ||
| cargo test --all-features # Run tests with all features | ||
| ``` | ||
|
|
||
| ## Code Quality | ||
|
|
||
| ```bash | ||
| cargo fmt --all # Format code | ||
| cargo fmt --all -- --check # Check formatting | ||
| cargo clippy --all-features -- -D warnings -A clippy::drop_non_drop # Lint (CI uses this on MSRV) | ||
| ``` | ||
|
|
||
| ## Code Style | ||
|
|
||
| - MSRV: Rust 1.85.0 | ||
| - Hard tabs, max width 100 chars | ||
| - Imports grouped: std, external crates, local crates | ||
|
|
||
| ## Protocol Buffer Generation | ||
|
|
||
| ```bash | ||
| RUSTFLAGS="--cfg genproto" cargo build -p ldk-server-protos | ||
| ``` | ||
|
|
||
| After regenerating, you must manually readd the copyright header to each generated file in `ldk-server-protos/src/` ( | ||
| `api.rs`, `types.rs`, `events.rs`, `error.rs`): | ||
|
|
||
| ``` | ||
| // This file is Copyright its original authors, visible in version control | ||
| // history. | ||
| // | ||
| // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE | ||
| // or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
| // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. | ||
| // You may not use this file except in accordance with one or both of these | ||
| // licenses. | ||
| ``` | ||
|
|
||
| Then run `cargo fmt --all` to format the generated code. | ||
|
|
||
| ## Adding a New API Endpoint | ||
|
|
||
| 1. Define request/response messages in `ldk-server-protos/src/proto/api.proto` | ||
| 2. Regenerate protos (see above) | ||
| 3. Create handler in `ldk-server/src/api/` (follow existing patterns) | ||
| 4. Add route in `ldk-server/src/service.rs` | ||
| 5. Add CLI command in `ldk-server-cli/src/main.rs` | ||
|
|
||
| ## Configuration | ||
|
|
||
| - Config template with all options: `ldk-server/ldk-server-config.toml` | ||
| - When updating config options, also update the tests in `ldk-server/src/util/config.rs` | ||
|
|
||
| ## Before Submitting | ||
|
|
||
| - Ensure all tests pass | ||
| - Ensure all lints are fixed | ||
| - Run `cargo fmt --all` | ||
| - Please disclose the use of any AI tools in commit messages and PR descriptions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could mention "Always ensure that tests pass and lints are fixed before committing". Also, maybe, "run
cargo +nightly fmtbefore committing ifnightlychannel Rust is locally installed already"? Or do you feel such things rather belong in the local/personal CLAUDE.md?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not put the nightly fmt in here. If we merge a PR without it, we don't want someone else's PR formatting other unrelated code