Compare commits
4 Commits
d6f6d98f6f
...
957d0a412a
| Author | SHA1 | Date |
|---|---|---|
|
|
957d0a412a | |
|
|
7624239fe4 | |
|
|
3b3cb4fb7c | |
|
|
96fb79ecd1 |
|
|
@ -151,22 +151,13 @@ 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 the written **patch** was assisted by claude-code,
|
When commits assisted by claude-code (4 instances), include:
|
||||||
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
|
||||||
|
|
@ -6,7 +6,12 @@ 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: Bash(git *), Read, Grep, Glob, Write
|
allowed-tools:
|
||||||
|
- Bash(git *)
|
||||||
|
- Read
|
||||||
|
- Grep
|
||||||
|
- Glob
|
||||||
|
- Write
|
||||||
---
|
---
|
||||||
|
|
||||||
## Current staged changes
|
## Current staged changes
|
||||||
|
|
@ -15,45 +20,251 @@ allowed-tools: Bash(git *), Read, Grep, Glob, Write
|
||||||
## Recent commit style reference
|
## Recent commit style reference
|
||||||
!`git log --oneline -10`
|
!`git log --oneline -10`
|
||||||
|
|
||||||
# Piker Git Commit Message Generator
|
# Piker Git Commit Message Style Guide
|
||||||
|
|
||||||
Generate a commit message from the staged diff above
|
Learned from analyzing 500 commits from the piker
|
||||||
following the piker project's conventions (learned from
|
repository. If `$ARGUMENTS` is provided, use it as
|
||||||
analyzing 500 repo commits).
|
scope or description context for the commit message.
|
||||||
|
|
||||||
If `$ARGUMENTS` is provided, use it as scope or
|
## Subject Line Rules
|
||||||
description context for the commit message.
|
|
||||||
|
|
||||||
For the full style guide with verb frequencies,
|
### Length
|
||||||
section markers, abbreviations, piker-specific terms,
|
- Target: ~50 characters (avg: 50.5 chars)
|
||||||
and examples, see
|
- Maximum: 67 chars (hard limit)
|
||||||
[style-guide-reference.md](./style-guide-reference.md).
|
- Keep concise and descriptive
|
||||||
|
|
||||||
## Quick Reference
|
### Structure
|
||||||
|
- 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)
|
||||||
|
|
||||||
- **Subject**: ~50 chars, present tense verb, use
|
### Opening Verbs (by frequency)
|
||||||
backticks for code refs
|
Primary verbs to use:
|
||||||
- **Body**: only for complex/multi-file changes,
|
- **Add** (8.4%) - New features, files, functionality
|
||||||
67 char line max
|
- **Drop** (3.2%) - Remove features, deps, code
|
||||||
- **Section markers**: Also, / Deats, / Other,
|
- **Fix** (2.2%) - Bug fixes, corrections
|
||||||
- **Bullets**: use `-` style
|
- **Use** (2.2%) - Switch to different approach/tool
|
||||||
- **Tone**: technical but casual (piker style)
|
- **Port** (2.0%) - Migrate code, adapt from elsewhere
|
||||||
|
- **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
|
||||||
|
|
||||||
## Claude-code Footer
|
Casual/informal verbs (used occasionally):
|
||||||
|
- **Woops,** (1.4%) - Fixing mistakes
|
||||||
|
- **Lul,** (0.6%) - Humorous corrections
|
||||||
|
|
||||||
When the written **patch** was assisted by
|
### Code References
|
||||||
claude-code, include:
|
Use backticks heavily for:
|
||||||
|
- **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 commits 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
|
## Piker-Specific Terms
|
||||||
claude-code (human wrote the patch), use:
|
|
||||||
|
### 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
|
||||||
```
|
```
|
||||||
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
|
Add `MktPair.fqme` property for symbol resolution
|
||||||
[claude-code-gh]: https://github.com/anthropics/claude-code
|
```
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
@ -66,16 +277,12 @@ 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 from the
|
conventions above.
|
||||||
[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 in the repo's
|
5. Write the message to a file per the instructions
|
||||||
`.claude/` subdir with filename format:
|
in `CLAUDE.md` (timestamp + hash filename format
|
||||||
`<timestamp>_<first-7-chars-of-last-commit-hash>_commit_msg.md`
|
in `.claude/` subdir, plus a copy to
|
||||||
where `<timestamp>` is from `date --iso-8601=seconds`.
|
`.claude/git_commit_msg_LATEST.md`).
|
||||||
Also write a copy to
|
|
||||||
`.claude/git_commit_msg_LATEST.md`
|
|
||||||
(overwrite if exists).
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
- `iface` = interface
|
- `iface` = interface
|
||||||
- `deats` = details
|
- `deats` = details
|
||||||
- `hilevel` = high level
|
- `hilevel` = high level
|
||||||
- `Bo` = a "wow expression"; a dev with "sunglasses and mouth open" emoji
|
- `Bo` = bro/dude (can also be standalone filler)
|
||||||
|
|
||||||
## Expressions & Phrases
|
## Expressions & Phrases
|
||||||
|
|
||||||
|
|
@ -70,8 +70,8 @@
|
||||||
## Emoji & Emoticon Usage
|
## Emoji & Emoticon Usage
|
||||||
|
|
||||||
**Standard set:**
|
**Standard set:**
|
||||||
- `XD` - laughing out loud emoji
|
- `XD` - most versatile, use liberally
|
||||||
- `B)` - satisfaction, coolness; dev with sunglasses smiling emoji
|
- `B)` - satisfaction, coolness
|
||||||
- `:rofl:` - genuinely funny (use sparingly)
|
- `:rofl:` - genuinely funny (use sparingly)
|
||||||
- `:facepalm:` - obvious mistakes
|
- `:facepalm:` - obvious mistakes
|
||||||
|
|
||||||
|
|
@ -80,29 +80,29 @@
|
||||||
Piker is a trading system, so trader slang applies:
|
Piker is a trading system, so trader slang applies:
|
||||||
|
|
||||||
- `up` / `down` - direction (price, perf, mood)
|
- `up` / `down` - direction (price, perf, mood)
|
||||||
- `yeet` / `damp` - direction (price, perf, mood)
|
|
||||||
- `gap` - missing data in timeseries
|
- `gap` - missing data in timeseries
|
||||||
- `fill` - complete missing data or a transaction clearing
|
- `fill` - complete missing data
|
||||||
- `slippage` - performance degradation
|
- `slippage` - performance degradation
|
||||||
- `alpha` - edge, advantage (usually ironic:
|
- `alpha` - edge, advantage (usually ironic:
|
||||||
"that optimization was pure alpha")
|
"that optimization was pure alpha")
|
||||||
- `degen` - degenerate (trader or dev, term of
|
- `degen` - degenerate (trader or dev, term of
|
||||||
endearment, contrarian and/or position of disbelief in standard
|
endearment)
|
||||||
narrative)
|
- `rekt` - destroyed, broken, failed
|
||||||
- `rekt` - destroyed, broken, failed catastrophically
|
catastrophically
|
||||||
- `moon` - massive improvement, large up movement ("perf to the moon")
|
- `moon` - massive improvement ("perf to the moon")
|
||||||
- `ded` - dead, broken, unrecoverable
|
- `ded` - dead, broken, unrecoverable
|
||||||
|
|
||||||
## Domain-Specific Terms
|
## Domain-Specific Terms
|
||||||
|
|
||||||
**Always use piker terminology:**
|
**Always use piker terminology:**
|
||||||
|
|
||||||
- `fqme` = fully qualified market endpoint (tsla.nasdaq.ib)
|
- `fqme` = fully qualified market endpoint
|
||||||
- `viz` = (data) visualization (ex. chart graphics)
|
(tsla.nasdaq.ib)
|
||||||
|
- `viz` = visualization (chart graphics)
|
||||||
- `shm` = shared memory (not "shared memory array")
|
- `shm` = shared memory (not "shared memory array")
|
||||||
- `brokerd` = broker daemon actor
|
- `brokerd` = broker daemon actor
|
||||||
- `pikerd` = root-process piker daemon
|
- `pikerd` = main piker daemon
|
||||||
- `annot` = annotation (not "annotation")
|
- `annot` = annotation (not "annotation")
|
||||||
- `actl` = annotation control (AnnotCtl)
|
- `actl` = annotation control (AnnotCtl)
|
||||||
- `tf` = timeframe (usually in seconds: 60s, 1s)
|
- `tf` = timeframe (usually in seconds: 60s, 1s)
|
||||||
- `OHLC` / `OHLCV` - open/high/low/close(/volume) sampling scheme
|
- `OHLC` / `OHLCV` - open/high/low/close(/volume)
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,6 @@ ENV/
|
||||||
|
|
||||||
# :Obsession .
|
# :Obsession .
|
||||||
Session.vim
|
Session.vim
|
||||||
|
|
||||||
# gitea local `.md`-files
|
# gitea local `.md`-files
|
||||||
# TODO? would this be handy to also commit and sync with
|
# TODO? would this be handy to also commit and sync with
|
||||||
# wtv git hosting service tho?
|
# wtv git hosting service tho?
|
||||||
|
|
|
||||||
50
ai/README.md
50
ai/README.md
|
|
@ -1,50 +0,0 @@
|
||||||
# AI Tooling Integrations
|
|
||||||
|
|
||||||
Documentation and usage guides for AI-assisted
|
|
||||||
development tools integrated with this repo.
|
|
||||||
|
|
||||||
Each subdirectory corresponds to a specific AI tool
|
|
||||||
or frontend and contains usage docs for the
|
|
||||||
custom skills/prompts/workflows configured for it.
|
|
||||||
|
|
||||||
Originally introduced in
|
|
||||||
[PR #69](https://www.pikers.dev/pikers/piker/pulls/69);
|
|
||||||
track new integration ideas and proposals in
|
|
||||||
[issue #79](https://www.pikers.dev/pikers/piker/issues/79).
|
|
||||||
|
|
||||||
## Integrations
|
|
||||||
|
|
||||||
| Tool | Directory | Status |
|
|
||||||
|------|-----------|--------|
|
|
||||||
| [Claude Code](https://github.com/anthropics/claude-code) | [`claude-code/`](claude-code/) | active |
|
|
||||||
|
|
||||||
## Adding a New Integration
|
|
||||||
|
|
||||||
Create a subdirectory named after the tool (use
|
|
||||||
lowercase + hyphens), then add:
|
|
||||||
|
|
||||||
1. A `README.md` covering setup, available
|
|
||||||
skills/commands, and usage examples
|
|
||||||
2. Any tool-specific config or prompt files
|
|
||||||
|
|
||||||
```
|
|
||||||
ai/
|
|
||||||
├── README.md # <- you are here
|
|
||||||
├── claude-code/
|
|
||||||
│ └── README.md
|
|
||||||
├── opencode/ # future
|
|
||||||
│ └── README.md
|
|
||||||
└── <your-tool>/
|
|
||||||
└── README.md
|
|
||||||
```
|
|
||||||
|
|
||||||
## Conventions
|
|
||||||
|
|
||||||
- Skill/command names use **hyphen-case**
|
|
||||||
(`commit-msg`, not `commit_msg`)
|
|
||||||
- Each integration doc should describe **what**
|
|
||||||
the skill does, **how** to invoke it, and any
|
|
||||||
**output** artifacts it produces
|
|
||||||
- Keep docs concise; link to the actual skill
|
|
||||||
source files (under `.claude/skills/`, etc.)
|
|
||||||
rather than duplicating content
|
|
||||||
|
|
@ -1,183 +0,0 @@
|
||||||
# Claude Code Integration
|
|
||||||
|
|
||||||
[Claude Code](https://github.com/anthropics/claude-code)
|
|
||||||
skills and workflows for piker development.
|
|
||||||
|
|
||||||
## Skills
|
|
||||||
|
|
||||||
| Skill | Invocable | Description |
|
|
||||||
|-------|-----------|-------------|
|
|
||||||
| [`commit-msg`](#commit-msg) | `/commit-msg` | Generate piker-style commit messages |
|
|
||||||
| `piker-profiling` | auto | `Profiler` API patterns for perf work |
|
|
||||||
| `piker-slang` | auto | Communication style + slang guide |
|
|
||||||
| `pyqtgraph-optimization` | auto | Batch rendering patterns |
|
|
||||||
| `timeseries-optimization` | auto | NumPy/Polars perf patterns |
|
|
||||||
|
|
||||||
Skills marked **auto** are background knowledge
|
|
||||||
applied automatically when Claude detects relevance.
|
|
||||||
Only `commit-msg` is user-invoked via slash command.
|
|
||||||
|
|
||||||
Skill source files live under
|
|
||||||
`.claude/skills/<skill-name>/SKILL.md`.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## `/commit-msg`
|
|
||||||
|
|
||||||
Generate piker-style git commit messages trained on
|
|
||||||
500+ commits from the repo history.
|
|
||||||
|
|
||||||
### Quick Start
|
|
||||||
|
|
||||||
```
|
|
||||||
# basic - analyzes staged diff automatically
|
|
||||||
/commit-msg
|
|
||||||
|
|
||||||
# with scope hint
|
|
||||||
/commit-msg .ib.feed: fix bar trimming
|
|
||||||
|
|
||||||
# with description context
|
|
||||||
/commit-msg refactor position tracking
|
|
||||||
```
|
|
||||||
|
|
||||||
### What It Does
|
|
||||||
|
|
||||||
1. **Reads staged changes** via dynamic context
|
|
||||||
injection (`git diff --staged --stat`)
|
|
||||||
2. **Reads recent commits** for style reference
|
|
||||||
(`git log --oneline -10`)
|
|
||||||
3. **Generates** a commit message following
|
|
||||||
piker conventions (verb choice, backtick refs,
|
|
||||||
colon prefixes, section markers, etc.)
|
|
||||||
4. **Writes** the message to two files:
|
|
||||||
- `.claude/<timestamp>_<hash>_commit_msg.md`
|
|
||||||
- `.claude/git_commit_msg_LATEST.md`
|
|
||||||
(overwritten each time)
|
|
||||||
|
|
||||||
### Arguments
|
|
||||||
|
|
||||||
The optional argument after `/commit-msg` is
|
|
||||||
passed as `$ARGUMENTS` and used as scope or
|
|
||||||
description context. Examples:
|
|
||||||
|
|
||||||
| Invocation | Effect |
|
|
||||||
|------------|--------|
|
|
||||||
| `/commit-msg` | Infer scope from diff |
|
|
||||||
| `/commit-msg .ib.feed` | Use `.ib.feed:` prefix |
|
|
||||||
| `/commit-msg fix the null seg crash` | Use as description hint |
|
|
||||||
|
|
||||||
### Output Format
|
|
||||||
|
|
||||||
**Subject line:**
|
|
||||||
- ~50 chars target, 67 max
|
|
||||||
- Present tense verb (Add, Drop, Fix, Factor..)
|
|
||||||
- Backtick-wrapped code refs
|
|
||||||
- Optional module prefix (`.ib.feed: ...`)
|
|
||||||
|
|
||||||
**Body** (when needed):
|
|
||||||
- 67 char line max
|
|
||||||
- Section markers: `Also,`, `Deats,`, `Further,`
|
|
||||||
- `-` bullet lists for multiple changes
|
|
||||||
- Piker abbreviations (`msg`, `mod`, `impl`,
|
|
||||||
`deps`, `bc`, `obvi`, `prolly`..)
|
|
||||||
|
|
||||||
**Footer** (always):
|
|
||||||
```
|
|
||||||
(this patch was generated in some part by
|
|
||||||
[`claude-code`][claude-code-gh])
|
|
||||||
[claude-code-gh]: https://github.com/anthropics/claude-code
|
|
||||||
```
|
|
||||||
|
|
||||||
### Output Files
|
|
||||||
|
|
||||||
After generation, the commit message is written to:
|
|
||||||
|
|
||||||
```
|
|
||||||
.claude/
|
|
||||||
├── <timestamp>_<hash>_commit_msg.md # archived
|
|
||||||
└── git_commit_msg_LATEST.md # latest
|
|
||||||
```
|
|
||||||
|
|
||||||
Where `<timestamp>` is ISO-8601 with seconds and
|
|
||||||
`<hash>` is the first 7 chars of the current
|
|
||||||
`HEAD` commit.
|
|
||||||
|
|
||||||
Use the latest file to feed into `git commit`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git commit -F .claude/git_commit_msg_LATEST.md
|
|
||||||
```
|
|
||||||
|
|
||||||
Or review/edit before committing:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cat .claude/git_commit_msg_LATEST.md
|
|
||||||
# edit if needed, then:
|
|
||||||
git commit -F .claude/git_commit_msg_LATEST.md
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
**Simple one-liner output:**
|
|
||||||
```
|
|
||||||
Add `MktPair.fqme` property for symbol resolution
|
|
||||||
```
|
|
||||||
|
|
||||||
**Multi-file change output:**
|
|
||||||
```
|
|
||||||
Factor `.claude/skills/` into proper subdirs
|
|
||||||
|
|
||||||
Deats,
|
|
||||||
- `commit_msg/` -> `commit-msg/` w/ enhanced
|
|
||||||
frontmatter
|
|
||||||
- all background skills set `user-invocable: false`
|
|
||||||
- content split into supporting files
|
|
||||||
|
|
||||||
(this patch was generated in some part by
|
|
||||||
[`claude-code`][claude-code-gh])
|
|
||||||
[claude-code-gh]: https://github.com/anthropics/claude-code
|
|
||||||
```
|
|
||||||
|
|
||||||
### Frontmatter Reference
|
|
||||||
|
|
||||||
The skill's `SKILL.md` uses these Claude Code
|
|
||||||
frontmatter fields:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
name: commit-msg
|
|
||||||
description: >
|
|
||||||
Generate piker-style git commit messages...
|
|
||||||
argument-hint: "[optional-scope-or-description]"
|
|
||||||
disable-model-invocation: true
|
|
||||||
allowed-tools:
|
|
||||||
- Bash(git *)
|
|
||||||
- Read
|
|
||||||
- Grep
|
|
||||||
- Glob
|
|
||||||
- Write
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
| Field | Purpose |
|
|
||||||
|-------|---------|
|
|
||||||
| `argument-hint` | Shows hint in autocomplete |
|
|
||||||
| `disable-model-invocation` | Only user can trigger via `/commit-msg` |
|
|
||||||
| `allowed-tools` | Tools the skill can use |
|
|
||||||
|
|
||||||
### Dynamic Context
|
|
||||||
|
|
||||||
The skill injects live data at invocation time
|
|
||||||
via `!`backtick`` syntax in the `SKILL.md`:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
## Current staged changes
|
|
||||||
!`git diff --staged --stat`
|
|
||||||
|
|
||||||
## Recent commit style reference
|
|
||||||
!`git log --oneline -10`
|
|
||||||
```
|
|
||||||
|
|
||||||
This means the staged diff stats and recent log
|
|
||||||
are always fresh when the skill runs -- no stale
|
|
||||||
context.
|
|
||||||
Loading…
Reference in New Issue