Fix `commit-msg` skill for docs compliance
Refactor `SKILL.md` to adhere to claude-code skills docs and eliminate content duplication with the supporting file. Deats, - fix `allowed-tools` from YAML list to comma-separated string per frontmatter spec. * https://code.claude.com/docs/en/skills#frontmatter-reference - drop ~220 lines of inlined style-guide content that duplicated `style-guide-reference.md`; replace with compact "Quick Reference" section + markdown link to the full guide. - fix supporting file ref from backtick-code to proper markdown link syntax: `[style-guide-reference.md](./...)`. - inline the file-writing instructions (timestamp + hash filename format) directly, replacing the now-broken `CLAUDE.md` ref. Also, - add missing "commit msg" footer variant to `style-guide-reference.md` (previously only showed "patch"). - move `.claude/CLAUDE.md` -> `style-guide-reference.md` as proper skill supporting file. (this patch was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-codeclaudy_writes_ruff_conf
parent
0a36b63a9f
commit
b23285bbda
|
|
@ -6,12 +6,7 @@ description: >
|
||||||
style guide learned from 500 repo commits.
|
style guide learned from 500 repo commits.
|
||||||
argument-hint: "[optional-scope-or-description]"
|
argument-hint: "[optional-scope-or-description]"
|
||||||
disable-model-invocation: true
|
disable-model-invocation: true
|
||||||
allowed-tools:
|
allowed-tools: Bash(git *), Read, Grep, Glob, Write
|
||||||
- Bash(git *)
|
|
||||||
- Read
|
|
||||||
- Grep
|
|
||||||
- Glob
|
|
||||||
- Write
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Current staged changes
|
## Current staged changes
|
||||||
|
|
@ -20,258 +15,47 @@ allowed-tools:
|
||||||
## Recent commit style reference
|
## Recent commit style reference
|
||||||
!`git log --oneline -10`
|
!`git log --oneline -10`
|
||||||
|
|
||||||
# Piker Git Commit Message Style Guide
|
# Piker Git Commit Message Generator
|
||||||
|
|
||||||
Learned from analyzing 500 commits from the piker
|
Generate a commit message from the staged diff above
|
||||||
repository. If `$ARGUMENTS` is provided, use it as
|
following the piker project's conventions (learned from
|
||||||
scope or description context for the commit message.
|
analyzing 500 repo commits).
|
||||||
|
|
||||||
## Subject Line Rules
|
If `$ARGUMENTS` is provided, use it as scope or
|
||||||
|
description context for the commit message.
|
||||||
|
|
||||||
### Length
|
For the full style guide with verb frequencies,
|
||||||
- Target: ~50 characters (avg: 50.5 chars)
|
section markers, abbreviations, piker-specific terms,
|
||||||
- Maximum: 67 chars (hard limit)
|
and examples, see
|
||||||
- Keep concise and descriptive
|
[style-guide-reference.md](./style-guide-reference.md).
|
||||||
|
|
||||||
### Structure
|
## Quick Reference
|
||||||
- Use present tense verbs (Add, Drop, Fix, Move, etc.)
|
|
||||||
- 65.6% of commits use backticks for code references
|
|
||||||
- 33.0% use colon notation (`module.file:` prefix
|
|
||||||
or `: ` separator)
|
|
||||||
|
|
||||||
### Opening Verbs (by frequency)
|
- **Subject**: ~50 chars, present tense verb, use
|
||||||
Primary verbs to use:
|
backticks for code refs
|
||||||
- **Add** (8.4%) - New features, files, functionality
|
- **Body**: only for complex/multi-file changes,
|
||||||
- **Drop** (3.2%) - Remove features, deps, code
|
67 char line max
|
||||||
- **Fix** (2.2%) - Bug fixes, corrections
|
- **Section markers**: Also, / Deats, / Other,
|
||||||
- **Use** (2.2%) - Switch to different approach/tool
|
- **Bullets**: use `-` style
|
||||||
- **Port** (2.0%) - Migrate code, adapt from elsewhere
|
- **Tone**: technical but casual (piker style)
|
||||||
- **Move** (2.0%) - Relocate code, refactor structure
|
|
||||||
- **Always** (1.8%) - Enforce consistent behavior
|
|
||||||
- **Factor** (1.6%) - Refactoring, code organization
|
|
||||||
- **Bump** (1.6%) - Version/dependency updates
|
|
||||||
- **Update** (1.4%) - Modify existing functionality
|
|
||||||
- **Adjust** (1.0%) - Fine-tune, tweak behavior
|
|
||||||
- **Change** (1.0%) - Modify behavior or structure
|
|
||||||
|
|
||||||
Casual/informal verbs (used occasionally):
|
## Claude-code Footer
|
||||||
- **Woops,** (1.4%) - Fixing mistakes
|
|
||||||
- **Lul,** (0.6%) - Humorous corrections
|
|
||||||
|
|
||||||
### Code References
|
When the written **patch** was assisted by
|
||||||
Use backticks heavily for:
|
claude-code, include:
|
||||||
- **Module/package names**: `tractor`, `pikerd`,
|
|
||||||
`polars`, `ruff`
|
|
||||||
- **Data types**: `dict`, `float`, `str`, `None`
|
|
||||||
- **Classes**: `MktPair`, `Asset`, `Position`,
|
|
||||||
`Account`, `Flume`
|
|
||||||
- **Functions**: `dedupe()`, `push()`,
|
|
||||||
`get_client()`, `norm_trade()`
|
|
||||||
- **File paths**: `.tsp`, `.fqme`, `brokers.toml`,
|
|
||||||
`conf.toml`
|
|
||||||
- **CLI flags**: `--pdb`
|
|
||||||
- **Error types**: `NoData`
|
|
||||||
- **Tools**: `uv`, `uv sync`, `httpx`, `numpy`
|
|
||||||
|
|
||||||
### Colon Usage Patterns
|
|
||||||
1. **Module prefix**:
|
|
||||||
`.ib.feed: trim bars frame to start_dt`
|
|
||||||
2. **Separator**:
|
|
||||||
`Add support: new feature description`
|
|
||||||
|
|
||||||
### Tone
|
|
||||||
- Technical but casual (use XD, lol, .., Woops,
|
|
||||||
Lul when appropriate)
|
|
||||||
- Direct and concise
|
|
||||||
- Question marks rare (1.4%)
|
|
||||||
- Exclamation marks rare (1.4%)
|
|
||||||
|
|
||||||
## Body Structure
|
|
||||||
|
|
||||||
### Body Frequency
|
|
||||||
- 56.0% of commits have empty bodies (one-liners
|
|
||||||
are common)
|
|
||||||
- Use body for complex changes requiring explanation
|
|
||||||
|
|
||||||
### Bullet Lists
|
|
||||||
- Prefer `-` bullets (16.2% of commits)
|
|
||||||
- Rarely use `*` bullets (1.6%)
|
|
||||||
- Indent continuation lines appropriately
|
|
||||||
|
|
||||||
### Section Markers (in order of frequency)
|
|
||||||
Use these to organize complex commit bodies:
|
|
||||||
|
|
||||||
1. **Also,** (most common, 26 occurrences)
|
|
||||||
- Additional changes, side effects
|
|
||||||
- Example:
|
|
||||||
```
|
|
||||||
Main change described in subject.
|
|
||||||
|
|
||||||
Also,
|
|
||||||
- related change 1
|
|
||||||
- related change 2
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Deats,** (8 occurrences)
|
|
||||||
- Implementation details, technical specifics
|
|
||||||
|
|
||||||
3. **Further,** (4 occurrences)
|
|
||||||
- Additional context or future considerations
|
|
||||||
|
|
||||||
4. **Other,** (3 occurrences)
|
|
||||||
- Miscellaneous related changes
|
|
||||||
|
|
||||||
5. **Notes,** **TODO,** (rare, 1 each)
|
|
||||||
- Special annotations when needed
|
|
||||||
|
|
||||||
### Line Length
|
|
||||||
- Body lines: 67 character maximum
|
|
||||||
- Break longer lines appropriately
|
|
||||||
|
|
||||||
## Language Patterns
|
|
||||||
|
|
||||||
### Common Abbreviations (by frequency)
|
|
||||||
Use these freely in commit bodies:
|
|
||||||
- **msg** (29) - message
|
|
||||||
- **mod** (15) - module
|
|
||||||
- **vs** (14) - versus
|
|
||||||
- **impl** (12) - implementation
|
|
||||||
- **deps** (11) - dependencies
|
|
||||||
- **var** (6) - variable
|
|
||||||
- **ctx** (6) - context
|
|
||||||
- **bc** (5) - because
|
|
||||||
- **obvi** (4) - obviously
|
|
||||||
- **ep** (4) - endpoint
|
|
||||||
- **tn** (4) - task name
|
|
||||||
- **rn** (3) - right now
|
|
||||||
- **sig** (3) - signal/signature
|
|
||||||
- **env** (3) - environment
|
|
||||||
- **tho** (3) - though
|
|
||||||
- **fn** (2) - function
|
|
||||||
- **iface** (2) - interface
|
|
||||||
- **prolly** (2) - probably
|
|
||||||
|
|
||||||
Less common but acceptable:
|
|
||||||
- **dne**, **osenv**, **gonna**, **wtf**
|
|
||||||
|
|
||||||
### Tone Indicators
|
|
||||||
- **..** (77 occurrences) - trailing thoughts
|
|
||||||
- **XD** (17) - humor/irony
|
|
||||||
- **lol** (1) - rare, use sparingly
|
|
||||||
|
|
||||||
### Informal Patterns
|
|
||||||
- Casual contractions okay: Don't, won't
|
|
||||||
- Lowercase starts acceptable for file prefixes
|
|
||||||
- Direct, conversational tone
|
|
||||||
|
|
||||||
## Special Patterns
|
|
||||||
|
|
||||||
### Module/File Prefixes
|
|
||||||
Common in piker commits (33.0% use colons):
|
|
||||||
- `.ib.feed: description`
|
|
||||||
- `.ui._remote_ctl: description`
|
|
||||||
- `.data.tsp: description`
|
|
||||||
- `.accounting: description`
|
|
||||||
|
|
||||||
### Claude-code Footer
|
|
||||||
When written patch was assisted by claude-code, include:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
(this patch was generated in some part by [`claude-code`][claude-code-gh])
|
(this patch was generated in some part by [`claude-code`][claude-code-gh])
|
||||||
[claude-code-gh]: https://github.com/anthropics/claude-code
|
[claude-code-gh]: https://github.com/anthropics/claude-code
|
||||||
```
|
```
|
||||||
|
|
||||||
when only the commit msg was written by claude-code, use:
|
When only the **commit msg** was written by
|
||||||
|
claude-code (human wrote the patch), use:
|
||||||
```
|
```
|
||||||
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
|
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
|
||||||
[claude-code-gh]: https://github.com/anthropics/claude-code
|
[claude-code-gh]: https://github.com/anthropics/claude-code
|
||||||
```
|
```
|
||||||
|
|
||||||
## Piker-Specific Terms
|
|
||||||
|
|
||||||
### Core Components
|
|
||||||
- `pikerd` - piker daemon
|
|
||||||
- `brokerd` - broker daemon
|
|
||||||
- `tractor` - actor framework used
|
|
||||||
- `.tsp` - time series protocol/module
|
|
||||||
- `.fqme` - fully qualified market endpoint
|
|
||||||
|
|
||||||
### Data Structures
|
|
||||||
- `MktPair` - market pair
|
|
||||||
- `Asset` - asset representation
|
|
||||||
- `Position` - trading position
|
|
||||||
- `Account` - account data
|
|
||||||
- `Flume` - data stream
|
|
||||||
- `SymbologyCache` - symbol caching
|
|
||||||
|
|
||||||
### Common Functions
|
|
||||||
- `dedupe()` - deduplication
|
|
||||||
- `push()` - data pushing
|
|
||||||
- `get_client()` - client retrieval
|
|
||||||
- `norm_trade()` - trade normalization
|
|
||||||
- `open_trade_ledger()` - ledger opening
|
|
||||||
- `markup_gaps()` - gap marking
|
|
||||||
- `get_null_segs()` - null segment retrieval
|
|
||||||
- `remote_annotate()` - remote annotation
|
|
||||||
|
|
||||||
### Brokers & Integrations
|
|
||||||
- `binance` - Binance integration
|
|
||||||
- `.ib` - Interactive Brokers
|
|
||||||
- `bs_mktid` - broker-specific market ID
|
|
||||||
- `reqid` - request ID
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
- `brokers.toml` - broker configuration
|
|
||||||
- `conf.toml` - general configuration
|
|
||||||
|
|
||||||
### Development Tools
|
|
||||||
- `ruff` - Python linter
|
|
||||||
- `uv` / `uv sync` - package manager
|
|
||||||
- `--pdb` - debugger flag
|
|
||||||
- `pdbp` - debugger
|
|
||||||
- `httpx` - HTTP client
|
|
||||||
- `polars` - dataframe library
|
|
||||||
- `numpy` - numerical library
|
|
||||||
- `trio` - async framework
|
|
||||||
- `xonsh` - shell
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
### Simple one-liner
|
|
||||||
```
|
|
||||||
Add `MktPair.fqme` property for symbol resolution
|
|
||||||
```
|
|
||||||
|
|
||||||
### With module prefix
|
|
||||||
```
|
|
||||||
.ib.feed: trim bars frame to `start_dt`
|
|
||||||
```
|
|
||||||
|
|
||||||
### Casual fix
|
|
||||||
```
|
|
||||||
Woops, compare against first-dt in `.ib.feed`
|
|
||||||
```
|
|
||||||
|
|
||||||
### With body using "Also,"
|
|
||||||
```
|
|
||||||
Drop `poetry` for `uv` in dev workflow
|
|
||||||
|
|
||||||
Also,
|
|
||||||
- update deps in `pyproject.toml`
|
|
||||||
- add `uv sync` to CI pipeline
|
|
||||||
- remove old `poetry.lock`
|
|
||||||
```
|
|
||||||
|
|
||||||
### With implementation details
|
|
||||||
```
|
|
||||||
Factor position tracking into `Position` dataclass
|
|
||||||
|
|
||||||
Deats,
|
|
||||||
- move calc logic from `brokerd` to `.accounting`
|
|
||||||
- add `norm_trade()` helper for broker normalization
|
|
||||||
- use `MktPair.fqme` for consistent symbol refs
|
|
||||||
```
|
|
||||||
|
|
||||||
## Output Instructions
|
## Output Instructions
|
||||||
|
|
||||||
When generating a commit message:
|
When generating a commit message:
|
||||||
|
|
@ -282,12 +66,16 @@ When generating a commit message:
|
||||||
`.ib.feed`) or description, incorporate it into
|
`.ib.feed`) or description, incorporate it into
|
||||||
the subject line.
|
the subject line.
|
||||||
3. Write the subject line following verb + backtick
|
3. Write the subject line following verb + backtick
|
||||||
conventions above.
|
conventions from the
|
||||||
|
[style guide](./style-guide-reference.md).
|
||||||
4. Add body only for multi-file or complex changes.
|
4. Add body only for multi-file or complex changes.
|
||||||
5. Write the message to a file per the instructions
|
5. Write the message to a file in the repo's
|
||||||
in `CLAUDE.md` (timestamp + hash filename format
|
`.claude/` subdir with filename format:
|
||||||
in `.claude/` subdir, plus a copy to
|
`<timestamp>_<first-7-chars-of-last-commit-hash>_commit_msg.md`
|
||||||
`.claude/git_commit_msg_LATEST.md`).
|
where `<timestamp>` is from `date --iso-8601=seconds`.
|
||||||
|
Also write a copy to
|
||||||
|
`.claude/git_commit_msg_LATEST.md`
|
||||||
|
(overwrite if exists).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,13 +151,22 @@ Common in piker commits (33.0% use colons):
|
||||||
- No WIP commits in analyzed set
|
- No WIP commits in analyzed set
|
||||||
|
|
||||||
### Claude-code Footer
|
### Claude-code Footer
|
||||||
When commits assisted by claude-code (4 instances), include:
|
When the written **patch** was assisted by claude-code,
|
||||||
|
include:
|
||||||
|
|
||||||
```
|
```
|
||||||
(this patch was generated in some part by [`claude-code`][claude-code-gh])
|
(this patch was generated in some part by [`claude-code`][claude-code-gh])
|
||||||
[claude-code-gh]: https://github.com/anthropics/claude-code
|
[claude-code-gh]: https://github.com/anthropics/claude-code
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When only the **commit msg** was written by claude-code
|
||||||
|
(human wrote the patch), use:
|
||||||
|
|
||||||
|
```
|
||||||
|
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
|
||||||
|
[claude-code-gh]: https://github.com/anthropics/claude-code
|
||||||
|
```
|
||||||
|
|
||||||
## Piker-Specific Terms
|
## Piker-Specific Terms
|
||||||
|
|
||||||
### Core Components
|
### Core Components
|
||||||
Loading…
Reference in New Issue