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: 38 additions & 0 deletions .claude/skills/format/SKILL.md

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm a bit scepitcal when it comes to any skills

Isn't this general rust knowledge of Claude to figure out these command?
Aren't commands already existing in CLAUDE.md sufficient?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can understand your scepticism but this way we're explicitly stating what we expect from Claude.
Things like linting and formatting rarely change so it won't be a maintenance burden

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think CLAUDE.md is enough, I just tell format and it does all "rustfmt, taplo, zepter"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Specifying explicitly wherever possible, always helps. Cant bank on Claude to assume, so explicit is better here.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: format
description: Run all formatting, linting and cleaning checks before committing code
---

Run all formatting, linting, and cleaning tasks that should be done before committing code. Fix any issues found automatically where possible.

## Steps

1. **Rust formatting** (requires nightly):
```bash
cargo +nightly fmt --all
```

2. **TOML formatting**:
```bash
taplo format --config .config/taplo.toml
```

3. **Zepter checks** (feature propagation):
```bash
zepter run --config .config/zepter.yaml
```

4. **Clippy linting**:
```bash
cargo clippy --all-targets --all-features --workspace -- -D warnings
```

## Notes

- Run formatting commands (steps 1-3) first as they may auto-fix issues
- Clippy warnings should be treated as errors (`-D warnings`)
- If `taplo` or `zepter` are not installed, inform the user how to install them:
- `cargo install taplo-cli`
- `cargo install zepter`
- If nightly fmt is not installed help user install with `rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt`
- Report all errors found and fix them where possible
Comment thread
mudigal marked this conversation as resolved.
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
- NEVER add Co-Authored-By lines to commits
- NEVER use git push --force or git push -f

**Automatic formatting:**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should probably be moved to a hook

@mudigal mudigal Feb 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see the value in using a git hook for automatic enforcement. However, one consideration is that adding formatting to a pre-push hook would add time to every push — the hook would run formatting on all files before allowing the push to complete. For our codebases, this could add noticeable delay (30+ seconds) to each push.

IMO, the Skills.md approach provides more flexibility.

- ALWAYS run `/format` after generating or modifying Rust code
- ALWAYS run `/format` before creating any git commit
- This ensures all code follows project formatting standards (Rust, TOML, feature propagation) and passes clippy

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wouldn't these be enough without the SKILL.md ?

@x3c41a x3c41a Feb 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/format will be both undeclared and undefined then and Claude won't know what to do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Anthropic merged commands and skills. So by having this skill you can tell claude to /format and it'll do it or you can tell it to format and it would figure out to use this skill

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes, but I didn't mean to leave /format while removing the SKILL.md - I mean change to something like

- ALWAYS run format after generating or modifying Rust code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

all these commands we also have mentioned inside CLAUDE.md, does separate skill bring any value ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

and what about bloating the context window with unnecessary stuff ? that's my biggest concern with all those skills that are introducing knowledge which is already generally available

@mudigal mudigal Feb 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't these be enough without the SKILL.md ?

No it wont. If we just put it in this file and not as a skill, we are then forcing people to use claude for commit, pull, push everything. We should provide an option to the user to use claude for what they want to. With skills we will give an option for people to use /format in claude to format everything and then if they can use git commands on their own.

Adding in this file (Claude.md) for those who want to use claude even for git commands.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wouldn't these be enough without the SKILL.md ?

No it wont. If we just put it in this file and not as a skill, we are then forcing people to use claude for commit, pull, push everything. We should provide an option to the user to use claude for what they want to. With skills we will give an option for people to use /format in claude to format everything and then if they can use git commands on their own.

Adding in this file (Claude.md) for those who want to use claude even for git commands.

Sorry @mudigal but I dont understand. Could rephrase maybe ?

Nothing in CLAUDE.md can force me to use Claude instead of git command if I wish to.

Maybe I explained it poorly but I'm arguing that having exactly the same commands in both files Claude.md and Skill.md - doesn't bring any new value to Claude. Claude by being aware of Claude.md already knows how to format and lint and all - bringing another file to Claude looks like bloating the context for no gain

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The key distinction here is how different configuration files behave:

Claude.md — Instructions here only apply when you explicitly run Claude (e.g., "commit and push"). If we document "check for formatting before committing" in Claude.md, it will only trigger when you use Claude for the commit. This is automatic behavior that Claude follows whenever it's invoked.

Skills.md — This defines explicit skills that users can invoke on demand, like /format. When a user runs /format through Claude, it performs only that specific task (formatting) and nothing else.

This approach gives users flexibility:

  • They can let Claude handle everything automatically via Claude.md instructions, or
  • They can explicitly invoke specific skills (like /format) when they only need that particular action

The user stays in control of what they want Claude to do. Having this choice is valuable for different workflows and preferences.

@x3c41a x3c41a Feb 27, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and what about bloating the context window with unnecessary stuff ?

Let's be honest, the context won't blow if you add a few extra lines to it. Claude is smart enough to strip or compact the context whenever needed.

If it comes to skills, only their short description is loaded into Claude's context. The full description is lazily uploaded into the context memory whenever needed, so I would not worry about skills overflowing the context window either, especially with modern context windows of 1M+ tokens


## Project Overview

Polkadot Bulletin Chain is a specialized blockchain providing distributed data storage and retrieval infrastructure for the Polkadot ecosystem. It serves as a storage solution primarily for the People/Proof-of-Personhood chain, functioning as a bridge-connected parachain with integrated IPFS support.
Expand Down
8 changes: 4 additions & 4 deletions pallets/transaction-storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,13 +1040,13 @@ pub mod pallet {
};

if consume {
if Authorizations::<T>::mutate(&scope, consume_authorization)? {
Self::authorization_removed(&scope);
if Authorizations::<T>::mutate(scope, consume_authorization)? {
Self::authorization_removed(scope);
}
} else {
// Note we call consume_authorization on a temporary; the authorization in storage
// is untouched and doesn't actually get consumed
let mut authorization = Authorizations::<T>::get(&scope);
let mut authorization = Authorizations::<T>::get(scope);
consume_authorization(&mut authorization)?;
}

Expand All @@ -1057,7 +1057,7 @@ pub mod pallet {
fn check_authorization_expired(
scope: &AuthorizationScopeFor<T>,
) -> Result<(), TransactionValidityError> {
let Some(authorization) = Authorizations::<T>::get(&scope) else {
let Some(authorization) = Authorizations::<T>::get(scope) else {
return Err(AUTHORIZATION_NOT_FOUND.into());
};
if Self::expired(authorization.expiration) {
Expand Down