cihai-cli 0.30.0__tar.gz → 0.31.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cihai_cli-0.31.0/.cursor/rules/avoid-debug-loops.mdc +57 -0
- cihai_cli-0.31.0/.cursor/rules/dev-loop.mdc +187 -0
- cihai_cli-0.31.0/.cursor/rules/git-commits.mdc +95 -0
- cihai_cli-0.31.0/.cursor/rules/notes-llms-txt.mdc +42 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.github/workflows/docs.yml +1 -1
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.github/workflows/tests.yml +2 -2
- cihai_cli-0.31.0/.tool-versions +2 -0
- cihai_cli-0.31.0/.windsurfrules +136 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/CHANGES +65 -10
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/PKG-INFO +33 -5
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/README.md +29 -1
- cihai_cli-0.31.0/docs/_static/favicon.ico +0 -0
- cihai_cli-0.31.0/docs/_static/img/cihai.svg +129 -0
- cihai_cli-0.31.0/docs/_static/img/icons/icon-128x128.png +0 -0
- cihai_cli-0.31.0/docs/_static/img/icons/icon-144x144.png +0 -0
- cihai_cli-0.31.0/docs/_static/img/icons/icon-152x152.png +0 -0
- cihai_cli-0.31.0/docs/_static/img/icons/icon-192x192.png +0 -0
- cihai_cli-0.31.0/docs/_static/img/icons/icon-384x384.png +0 -0
- cihai_cli-0.31.0/docs/_static/img/icons/icon-512x512.png +0 -0
- cihai_cli-0.31.0/docs/_static/img/icons/icon-72x72.png +0 -0
- cihai_cli-0.31.0/docs/_static/img/icons/icon-96x96.png +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/_templates/sidebar/projects.html +1 -1
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/cli/completion.md +18 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/conf.py +6 -4
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/quickstart.md +46 -2
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/pyproject.toml +30 -9
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/src/cihai_cli/__about__.py +3 -1
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/src/cihai_cli/cli.py +8 -7
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/conftest.py +3 -1
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/test_cli.py +5 -2
- cihai_cli-0.31.0/uv.lock +1737 -0
- cihai_cli-0.30.0/.tool-versions +0 -2
- cihai_cli-0.30.0/docs/_static/favicon.ico +0 -0
- cihai_cli-0.30.0/docs/_static/img/cihai.svg +0 -154
- cihai_cli-0.30.0/docs/_static/img/icons/icon-128x128.png +0 -0
- cihai_cli-0.30.0/docs/_static/img/icons/icon-144x144.png +0 -0
- cihai_cli-0.30.0/docs/_static/img/icons/icon-152x152.png +0 -0
- cihai_cli-0.30.0/docs/_static/img/icons/icon-192x192.png +0 -0
- cihai_cli-0.30.0/docs/_static/img/icons/icon-384x384.png +0 -0
- cihai_cli-0.30.0/docs/_static/img/icons/icon-512x512.png +0 -0
- cihai_cli-0.30.0/docs/_static/img/icons/icon-72x72.png +0 -0
- cihai_cli-0.30.0/docs/_static/img/icons/icon-96x96.png +0 -0
- cihai_cli-0.30.0/uv.lock +0 -1565
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.codecov.yml +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.github/dependabot.yml +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.gitignore +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.prettierrc +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.python-version +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.tmuxp.yaml +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/.vim/coc-settings.json +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/LICENSE +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/MANIFEST.in +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/MIGRATION +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/Makefile +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/Makefile +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/_static/css/custom.css +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/_static/img/icons/icon-512x512-centered.png +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/_templates/layout.html +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/api.md +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/cli/index.md +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/cli/info.md +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/cli/reverse.md +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/history.md +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/index.md +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/manifest.json +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/migration.md +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/docs/redirects.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/src/cihai_cli/__init__.py +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/__init__.py +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/Unihan_DictionaryIndices.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/Unihan_DictionaryLikeData.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/Unihan_IRGSources.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/Unihan_NumericValues.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/Unihan_OtherMappings.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/Unihan_RadicalStrokeCounts.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/Unihan_Readings.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/Unihan_Variants.txt +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tests/fixtures/test_config.yml +0 -0
- {cihai_cli-0.30.0 → cihai_cli-0.31.0}/tox.ini +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: When stuck in debugging loops, break the cycle by minimizing to an MVP, removing debugging cruft, and documenting the issue completely for a fresh approach
|
|
3
|
+
globs: *.py
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
# Avoid Debug Loops
|
|
7
|
+
|
|
8
|
+
When debugging becomes circular and unproductive, follow these steps:
|
|
9
|
+
|
|
10
|
+
## Detection
|
|
11
|
+
- You have made multiple unsuccessful attempts to fix the same issue
|
|
12
|
+
- You are adding increasingly complex code to address errors
|
|
13
|
+
- Each fix creates new errors in a cascading pattern
|
|
14
|
+
- You are uncertain about the root cause after 2-3 iterations
|
|
15
|
+
|
|
16
|
+
## Action Plan
|
|
17
|
+
|
|
18
|
+
1. **Pause and acknowledge the loop**
|
|
19
|
+
- Explicitly state that you are in a potential debug loop
|
|
20
|
+
- Review what approaches have been tried and failed
|
|
21
|
+
|
|
22
|
+
2. **Minimize to MVP**
|
|
23
|
+
- Remove all debugging cruft and experimental code
|
|
24
|
+
- Revert to the simplest version that demonstrates the issue
|
|
25
|
+
- Focus on isolating the core problem without added complexity
|
|
26
|
+
|
|
27
|
+
3. **Comprehensive Documentation**
|
|
28
|
+
- Provide a clear summary of the issue
|
|
29
|
+
- Include minimal but complete code examples that reproduce the problem
|
|
30
|
+
- Document exact error messages and unexpected behaviors
|
|
31
|
+
- Explain your current understanding of potential causes
|
|
32
|
+
|
|
33
|
+
4. **Format for Portability**
|
|
34
|
+
- Present the problem in quadruple backticks for easy copying:
|
|
35
|
+
|
|
36
|
+
````
|
|
37
|
+
# Problem Summary
|
|
38
|
+
[Concise explanation of the issue]
|
|
39
|
+
|
|
40
|
+
## Minimal Reproduction Code
|
|
41
|
+
```python
|
|
42
|
+
# Minimal code example that reproduces the issue
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Error/Unexpected Output
|
|
46
|
+
```
|
|
47
|
+
[Exact error messages or unexpected output]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Failed Approaches
|
|
51
|
+
[Brief summary of approaches already tried]
|
|
52
|
+
|
|
53
|
+
## Suspected Cause
|
|
54
|
+
[Your current hypothesis about what might be causing the issue]
|
|
55
|
+
````
|
|
56
|
+
|
|
57
|
+
This format enables the user to easily copy the entire problem statement into a fresh conversation for a clean-slate approach.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: QA every edit
|
|
3
|
+
globs: *.py
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Development Process
|
|
8
|
+
|
|
9
|
+
## Project Stack
|
|
10
|
+
|
|
11
|
+
The project uses the following tools and technologies:
|
|
12
|
+
|
|
13
|
+
- **uv** - Python package management and virtual environments
|
|
14
|
+
- **ruff** - Fast Python linter and formatter
|
|
15
|
+
- **py.test** - Testing framework
|
|
16
|
+
- **pytest-watcher** - Continuous test runner
|
|
17
|
+
- **mypy** - Static type checking
|
|
18
|
+
- **doctest** - Testing code examples in documentation
|
|
19
|
+
|
|
20
|
+
## 1. Start with Formatting
|
|
21
|
+
|
|
22
|
+
Format your code first:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
uv run ruff format .
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 2. Run Tests
|
|
29
|
+
|
|
30
|
+
Verify that your changes pass the tests:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
uv run py.test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For continuous testing during development, use pytest-watcher:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
# Watch all tests
|
|
40
|
+
uv run ptw .
|
|
41
|
+
|
|
42
|
+
# Watch and run tests immediately, including doctests
|
|
43
|
+
uv run ptw . --now --doctest-modules
|
|
44
|
+
|
|
45
|
+
# Watch specific files or directories
|
|
46
|
+
uv run ptw . --now --doctest-modules src/libtmux/_internal/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 3. Commit Initial Changes
|
|
50
|
+
|
|
51
|
+
Make an atomic commit for your changes using conventional commits.
|
|
52
|
+
Use `@git-commits.mdc` for assistance with commit message standards.
|
|
53
|
+
|
|
54
|
+
## 4. Run Linting and Type Checking
|
|
55
|
+
|
|
56
|
+
Check and fix linting issues:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
uv run ruff check . --fix --show-fixes
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Check typings:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
uv run mypy
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 5. Verify Tests Again
|
|
69
|
+
|
|
70
|
+
Ensure tests still pass after linting and type fixes:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
uv run py.test
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 6. Final Commit
|
|
77
|
+
|
|
78
|
+
Make a final commit with any linting/typing fixes.
|
|
79
|
+
Use `@git-commits.mdc` for assistance with commit message standards.
|
|
80
|
+
|
|
81
|
+
## Development Loop Guidelines
|
|
82
|
+
|
|
83
|
+
If there are any failures at any step due to your edits, fix them before proceeding to the next step.
|
|
84
|
+
|
|
85
|
+
## Python Code Standards
|
|
86
|
+
|
|
87
|
+
### Docstring Guidelines
|
|
88
|
+
|
|
89
|
+
For `src/**/*.py` files, follow these docstring guidelines:
|
|
90
|
+
|
|
91
|
+
1. **Use reStructuredText format** for all docstrings.
|
|
92
|
+
```python
|
|
93
|
+
"""Short description of the function or class.
|
|
94
|
+
|
|
95
|
+
Detailed description using reStructuredText format.
|
|
96
|
+
|
|
97
|
+
Parameters
|
|
98
|
+
----------
|
|
99
|
+
param1 : type
|
|
100
|
+
Description of param1
|
|
101
|
+
param2 : type
|
|
102
|
+
Description of param2
|
|
103
|
+
|
|
104
|
+
Returns
|
|
105
|
+
-------
|
|
106
|
+
type
|
|
107
|
+
Description of return value
|
|
108
|
+
"""
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
2. **Keep the main description on the first line** after the opening `"""`.
|
|
112
|
+
|
|
113
|
+
3. **Use NumPy docstyle** for parameter and return value documentation.
|
|
114
|
+
|
|
115
|
+
### Doctest Guidelines
|
|
116
|
+
|
|
117
|
+
For doctests in `src/**/*.py` files:
|
|
118
|
+
|
|
119
|
+
1. **Use narrative descriptions** for test sections rather than inline comments:
|
|
120
|
+
```python
|
|
121
|
+
"""Example function.
|
|
122
|
+
|
|
123
|
+
Examples
|
|
124
|
+
--------
|
|
125
|
+
Create an instance:
|
|
126
|
+
|
|
127
|
+
>>> obj = ExampleClass()
|
|
128
|
+
|
|
129
|
+
Verify a property:
|
|
130
|
+
|
|
131
|
+
>>> obj.property
|
|
132
|
+
'expected value'
|
|
133
|
+
"""
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
2. **Move complex examples** to dedicated test files at `tests/examples/<path_to_module>/test_<example>.py` if they require elaborate setup or multiple steps.
|
|
137
|
+
|
|
138
|
+
3. **Utilize pytest fixtures** via `doctest_namespace` for more complex test scenarios:
|
|
139
|
+
```python
|
|
140
|
+
"""Example with fixture.
|
|
141
|
+
|
|
142
|
+
Examples
|
|
143
|
+
--------
|
|
144
|
+
>>> # doctest_namespace contains all pytest fixtures from conftest.py
|
|
145
|
+
>>> example_fixture = getfixture('example_fixture')
|
|
146
|
+
>>> example_fixture.method()
|
|
147
|
+
'expected result'
|
|
148
|
+
"""
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
4. **Keep doctests simple and focused** on demonstrating usage rather than comprehensive testing.
|
|
152
|
+
|
|
153
|
+
5. **Add blank lines between test sections** for improved readability.
|
|
154
|
+
|
|
155
|
+
6. **Test your doctests continuously** using pytest-watcher during development:
|
|
156
|
+
```
|
|
157
|
+
# Watch specific modules for doctest changes
|
|
158
|
+
uv run ptw . --now --doctest-modules src/path/to/module.py
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Pytest Testing Guidelines
|
|
162
|
+
|
|
163
|
+
1. **Use existing fixtures over mocks**:
|
|
164
|
+
- Use fixtures from conftest.py instead of `monkeypatch` and `MagicMock` when available
|
|
165
|
+
- For instance, if using libtmux, use provided fixtures: `server`, `session`, `window`, and `pane`
|
|
166
|
+
- Document in test docstrings why standard fixtures weren't used for exceptional cases
|
|
167
|
+
|
|
168
|
+
2. **Preferred pytest patterns**:
|
|
169
|
+
- Use `tmp_path` (pathlib.Path) fixture over Python's `tempfile`
|
|
170
|
+
- Use `monkeypatch` fixture over `unittest.mock`
|
|
171
|
+
|
|
172
|
+
### Import Guidelines
|
|
173
|
+
|
|
174
|
+
1. **Prefer namespace imports**:
|
|
175
|
+
- Import modules and access attributes through the namespace instead of importing specific symbols
|
|
176
|
+
- Example: Use `import enum` and access `enum.Enum` instead of `from enum import Enum`
|
|
177
|
+
- This applies to standard library modules like `pathlib`, `os`, and similar cases
|
|
178
|
+
|
|
179
|
+
2. **Standard aliases**:
|
|
180
|
+
- For `typing` module, use `import typing as t`
|
|
181
|
+
- Access typing elements via the namespace: `t.NamedTuple`, `t.TypedDict`, etc.
|
|
182
|
+
- Note primitive types like unions can be done via `|` pipes and primitive types like list and dict can be done via `list` and `dict` directly.
|
|
183
|
+
|
|
184
|
+
3. **Benefits of namespace imports**:
|
|
185
|
+
- Improves code readability by making the source of symbols clear
|
|
186
|
+
- Reduces potential naming conflicts
|
|
187
|
+
- Makes import statements more maintainable
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: git-commits: Git commit message standards and AI assistance
|
|
3
|
+
globs: git-commits: Git commit message standards and AI assistance | *.git/* .gitignore .github/* CHANGELOG.md CHANGES.md
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
# Optimized Git Commit Standards
|
|
7
|
+
|
|
8
|
+
## Commit Message Format
|
|
9
|
+
```
|
|
10
|
+
Component/File(commit-type[Subcomponent/method]): Concise description
|
|
11
|
+
|
|
12
|
+
why: Explanation of necessity or impact.
|
|
13
|
+
what:
|
|
14
|
+
- Specific technical changes made
|
|
15
|
+
- Focused on a single topic
|
|
16
|
+
|
|
17
|
+
refs: #issue-number, breaking changes, or relevant links
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Component Patterns
|
|
21
|
+
### General Code Changes
|
|
22
|
+
```
|
|
23
|
+
Component/File(feat[method]): Add feature
|
|
24
|
+
Component/File(fix[method]): Fix bug
|
|
25
|
+
Component/File(refactor[method]): Code restructure
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Packages and Dependencies
|
|
29
|
+
| Language | Standard Packages | Dev Packages | Extras / Sub-packages |
|
|
30
|
+
|------------|------------------------------------|-------------------------------|-----------------------------------------------|
|
|
31
|
+
| General | `lang(deps):` | `lang(deps[dev]):` | |
|
|
32
|
+
| Python | `py(deps):` | `py(deps[dev]):` | `py(deps[extra]):` |
|
|
33
|
+
| JavaScript | `js(deps):` | `js(deps[dev]):` | `js(deps[subpackage]):`, `js(deps[dev{subpackage}]):` |
|
|
34
|
+
|
|
35
|
+
#### Examples
|
|
36
|
+
- `py(deps[dev]): Update pytest to v8.1`
|
|
37
|
+
- `js(deps[ui-components]): Upgrade Button component package`
|
|
38
|
+
- `js(deps[dev{linting}]): Add ESLint plugin`
|
|
39
|
+
|
|
40
|
+
### Documentation Changes
|
|
41
|
+
Prefix with `docs:`
|
|
42
|
+
```
|
|
43
|
+
docs(Component/File[Subcomponent/method]): Update API usage guide
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Test Changes
|
|
47
|
+
Prefix with `tests:`
|
|
48
|
+
```
|
|
49
|
+
tests(Component/File[Subcomponent/method]): Add edge case tests
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Commit Types Summary
|
|
53
|
+
- **feat**: New features or enhancements
|
|
54
|
+
- **fix**: Bug fixes
|
|
55
|
+
- **refactor**: Code restructuring without functional change
|
|
56
|
+
- **docs**: Documentation updates
|
|
57
|
+
- **chore**: Maintenance (dependencies, tooling, config)
|
|
58
|
+
- **test**: Test-related updates
|
|
59
|
+
- **style**: Code style and formatting
|
|
60
|
+
|
|
61
|
+
## General Guidelines
|
|
62
|
+
- Subject line: Maximum 50 characters
|
|
63
|
+
- Body lines: Maximum 72 characters
|
|
64
|
+
- Use imperative mood (e.g., "Add", "Fix", not "Added", "Fixed")
|
|
65
|
+
- Limit to one topic per commit
|
|
66
|
+
- Separate subject from body with a blank line
|
|
67
|
+
- Mark breaking changes clearly: `BREAKING:`
|
|
68
|
+
- Use `See also:` to provide external references
|
|
69
|
+
|
|
70
|
+
## AI Assistance Workflow in Cursor
|
|
71
|
+
- Stage changes with `git add`
|
|
72
|
+
- Use `@commit` to generate initial commit message
|
|
73
|
+
- Review and refine generated message
|
|
74
|
+
- Ensure adherence to these standards
|
|
75
|
+
|
|
76
|
+
## Good Commit Example
|
|
77
|
+
```
|
|
78
|
+
Pane(feat[capture_pane]): Add screenshot capture support
|
|
79
|
+
|
|
80
|
+
why: Provide visual debugging capability
|
|
81
|
+
what:
|
|
82
|
+
- Implement capturePane method with image export
|
|
83
|
+
- Integrate with existing Pane component logic
|
|
84
|
+
- Document usage in Pane README
|
|
85
|
+
|
|
86
|
+
refs: #485
|
|
87
|
+
See also: https://example.com/docs/pane-capture
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Bad Commit Example
|
|
91
|
+
```
|
|
92
|
+
fixed stuff and improved some functions
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
These guidelines ensure clear, consistent commit histories, facilitating easier code review and maintenance.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: LLM-friendly markdown format for notes directories
|
|
3
|
+
globs: notes/**/*.md,**/notes/**/*.md
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Instructions for Generating LLM-Optimized Markdown Content
|
|
8
|
+
|
|
9
|
+
When creating or editing markdown files within the specified directories, adhere to the following guidelines to ensure the content is optimized for LLM understanding and efficient token usage:
|
|
10
|
+
|
|
11
|
+
1. **Conciseness and Clarity**:
|
|
12
|
+
- **Be Brief**: Present information succinctly, avoiding unnecessary elaboration.
|
|
13
|
+
- **Use Clear Language**: Employ straightforward language to convey ideas effectively.
|
|
14
|
+
|
|
15
|
+
2. **Structured Formatting**:
|
|
16
|
+
- **Headings**: Utilize markdown headings (`#`, `##`, `###`, etc.) to organize content hierarchically.
|
|
17
|
+
- **Lists**: Use bullet points (`-`) or numbered lists (`1.`, `2.`, etc.) to enumerate items clearly.
|
|
18
|
+
- **Code Blocks**: Enclose code snippets within triple backticks (```) to distinguish them from regular text.
|
|
19
|
+
|
|
20
|
+
3. **Semantic Elements**:
|
|
21
|
+
- **Emphasis**: Use asterisks (`*`) or underscores (`_`) for italicizing text to denote emphasis.
|
|
22
|
+
- **Strong Emphasis**: Use double asterisks (`**`) or double underscores (`__`) for bold text to highlight critical points.
|
|
23
|
+
- **Inline Code**: Use single backticks (`) for inline code references.
|
|
24
|
+
|
|
25
|
+
4. **Linking and References**:
|
|
26
|
+
- **Hyperlinks**: Format links using `[Link Text](mdc:URL)` to provide direct access to external resources.
|
|
27
|
+
- **References**: When citing sources, use footnotes or inline citations to maintain readability.
|
|
28
|
+
|
|
29
|
+
5. **Avoid Redundancy**:
|
|
30
|
+
- **Eliminate Repetition**: Ensure that information is not unnecessarily repeated within the document.
|
|
31
|
+
- **Use Summaries**: Provide brief summaries where detailed explanations are not essential.
|
|
32
|
+
|
|
33
|
+
6. **Standard Compliance**:
|
|
34
|
+
- **llms.txt Conformance**: Structure the document in alignment with the `llms.txt` standard, which includes:
|
|
35
|
+
- An H1 heading with the project or site name.
|
|
36
|
+
- A blockquote summarizing the project's purpose.
|
|
37
|
+
- Additional markdown sections providing detailed information.
|
|
38
|
+
- H2-delimited sections containing lists of URLs for further details.
|
|
39
|
+
|
|
40
|
+
By following these guidelines, the markdown files will be tailored for optimal LLM processing, ensuring that the content is both accessible and efficiently tokenized for AI applications.
|
|
41
|
+
|
|
42
|
+
For more information on the `llms.txt` standard, refer to the official documentation: https://llmstxt.org/
|
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
strategy:
|
|
11
11
|
matrix:
|
|
12
|
-
python-version: ['3.
|
|
12
|
+
python-version: ['3.14']
|
|
13
13
|
steps:
|
|
14
14
|
- uses: actions/checkout@v4
|
|
15
15
|
|
|
@@ -52,7 +52,7 @@ jobs:
|
|
|
52
52
|
|
|
53
53
|
strategy:
|
|
54
54
|
matrix:
|
|
55
|
-
python-version: ['3.
|
|
55
|
+
python-version: ['3.14']
|
|
56
56
|
|
|
57
57
|
steps:
|
|
58
58
|
- uses: actions/checkout@v4
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# libtmux Python Project Rules
|
|
2
|
+
|
|
3
|
+
<project_stack>
|
|
4
|
+
- uv - Python package management and virtual environments
|
|
5
|
+
- ruff - Fast Python linter and formatter
|
|
6
|
+
- py.test - Testing framework
|
|
7
|
+
- pytest-watcher - Continuous test runner
|
|
8
|
+
- mypy - Static type checking
|
|
9
|
+
- doctest - Testing code examples in documentation
|
|
10
|
+
</project_stack>
|
|
11
|
+
|
|
12
|
+
<coding_style>
|
|
13
|
+
- Use a consistent coding style throughout the project
|
|
14
|
+
- Format code with ruff before committing
|
|
15
|
+
- Run linting and type checking before finalizing changes
|
|
16
|
+
- Verify tests pass after each significant change
|
|
17
|
+
</coding_style>
|
|
18
|
+
|
|
19
|
+
<python_docstrings>
|
|
20
|
+
- Use reStructuredText format for all docstrings in src/**/*.py files
|
|
21
|
+
- Keep the main description on the first line after the opening `"""`
|
|
22
|
+
- Use NumPy docstyle for parameter and return value documentation
|
|
23
|
+
- Format docstrings as follows:
|
|
24
|
+
```python
|
|
25
|
+
"""Short description of the function or class.
|
|
26
|
+
|
|
27
|
+
Detailed description using reStructuredText format.
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
param1 : type
|
|
32
|
+
Description of param1
|
|
33
|
+
param2 : type
|
|
34
|
+
Description of param2
|
|
35
|
+
|
|
36
|
+
Returns
|
|
37
|
+
-------
|
|
38
|
+
type
|
|
39
|
+
Description of return value
|
|
40
|
+
"""
|
|
41
|
+
```
|
|
42
|
+
</python_docstrings>
|
|
43
|
+
|
|
44
|
+
<python_doctests>
|
|
45
|
+
- Use narrative descriptions for test sections rather than inline comments
|
|
46
|
+
- Format doctests as follows:
|
|
47
|
+
```python
|
|
48
|
+
"""
|
|
49
|
+
Examples
|
|
50
|
+
--------
|
|
51
|
+
Create an instance:
|
|
52
|
+
|
|
53
|
+
>>> obj = ExampleClass()
|
|
54
|
+
|
|
55
|
+
Verify a property:
|
|
56
|
+
|
|
57
|
+
>>> obj.property
|
|
58
|
+
'expected value'
|
|
59
|
+
"""
|
|
60
|
+
```
|
|
61
|
+
- Add blank lines between test sections for improved readability
|
|
62
|
+
- Keep doctests simple and focused on demonstrating usage
|
|
63
|
+
- Move complex examples to dedicated test files at tests/examples/<path_to_module>/test_<example>.py
|
|
64
|
+
- Utilize pytest fixtures via doctest_namespace for complex scenarios
|
|
65
|
+
</python_doctests>
|
|
66
|
+
|
|
67
|
+
<testing_practices>
|
|
68
|
+
- Run tests with `uv run py.test` before committing changes
|
|
69
|
+
- Use pytest-watcher for continuous testing: `uv run ptw . --now --doctest-modules`
|
|
70
|
+
- Fix any test failures before proceeding with additional changes
|
|
71
|
+
</testing_practices>
|
|
72
|
+
|
|
73
|
+
<git_workflow>
|
|
74
|
+
- Make atomic commits with conventional commit messages
|
|
75
|
+
- Start with an initial commit of functional changes
|
|
76
|
+
- Follow with separate commits for formatting, linting, and type checking fixes
|
|
77
|
+
</git_workflow>
|
|
78
|
+
|
|
79
|
+
<git_commit_standards>
|
|
80
|
+
- Use the following commit message format:
|
|
81
|
+
```
|
|
82
|
+
Component/File(commit-type[Subcomponent/method]): Concise description
|
|
83
|
+
|
|
84
|
+
why: Explanation of necessity or impact.
|
|
85
|
+
what:
|
|
86
|
+
- Specific technical changes made
|
|
87
|
+
- Focused on a single topic
|
|
88
|
+
|
|
89
|
+
refs: #issue-number, breaking changes, or relevant links
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- Common commit types:
|
|
93
|
+
- **feat**: New features or enhancements
|
|
94
|
+
- **fix**: Bug fixes
|
|
95
|
+
- **refactor**: Code restructuring without functional change
|
|
96
|
+
- **docs**: Documentation updates
|
|
97
|
+
- **chore**: Maintenance (dependencies, tooling, config)
|
|
98
|
+
- **test**: Test-related updates
|
|
99
|
+
- **style**: Code style and formatting
|
|
100
|
+
|
|
101
|
+
- Prefix Python package changes with:
|
|
102
|
+
- `py(deps):` for standard packages
|
|
103
|
+
- `py(deps[dev]):` for development packages
|
|
104
|
+
- `py(deps[extra]):` for extras/sub-packages
|
|
105
|
+
|
|
106
|
+
- General guidelines:
|
|
107
|
+
- Subject line: Maximum 50 characters
|
|
108
|
+
- Body lines: Maximum 72 characters
|
|
109
|
+
- Use imperative mood (e.g., "Add", "Fix", not "Added", "Fixed")
|
|
110
|
+
- Limit to one topic per commit
|
|
111
|
+
- Separate subject from body with a blank line
|
|
112
|
+
- Mark breaking changes clearly: `BREAKING:`
|
|
113
|
+
</git_commit_standards>
|
|
114
|
+
|
|
115
|
+
<pytest_testing_guidelines>
|
|
116
|
+
- Use fixtures from conftest.py instead of monkeypatch and MagicMock when available
|
|
117
|
+
- For instance, if using libtmux, use provided fixtures: server, session, window, and pane
|
|
118
|
+
- Document in test docstrings why standard fixtures weren't used for exceptional cases
|
|
119
|
+
- Use tmp_path (pathlib.Path) fixture over Python's tempfile
|
|
120
|
+
- Use monkeypatch fixture over unittest.mock
|
|
121
|
+
</pytest_testing_guidelines>
|
|
122
|
+
|
|
123
|
+
<import_guidelines>
|
|
124
|
+
- Prefer namespace imports over importing specific symbols
|
|
125
|
+
- Import modules and access attributes through the namespace:
|
|
126
|
+
- Use `import enum` and access `enum.Enum` instead of `from enum import Enum`
|
|
127
|
+
- This applies to standard library modules like pathlib, os, and similar cases
|
|
128
|
+
- For typing, use `import typing as t` and access via the namespace:
|
|
129
|
+
- Access typing elements as `t.NamedTuple`, `t.TypedDict`, etc.
|
|
130
|
+
- Note primitive types like unions can be done via `|` pipes
|
|
131
|
+
- Primitive types like list and dict can be done via `list` and `dict` directly
|
|
132
|
+
- Benefits of namespace imports:
|
|
133
|
+
- Improves code readability by making the source of symbols clear
|
|
134
|
+
- Reduces potential naming conflicts
|
|
135
|
+
- Makes import statements more maintainable
|
|
136
|
+
</import_guidelines>
|
|
@@ -3,24 +3,61 @@
|
|
|
3
3
|
You can test the unpublished version of cihai-cli before its released, see
|
|
4
4
|
[developmental releases](https://cihai-cli.git-pull.com/quickstart.html#developmental-releases).
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
[pip](https://pip.pypa.io/en/stable/):
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
```console
|
|
9
|
+
$ pip install --user --upgrade --pre cihai-cli
|
|
10
|
+
```
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
[pipx](https://pypa.github.io/pipx/docs/):
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
```console
|
|
15
|
+
$ pipx install --suffix=@next 'cihai-cli' --pip-args '\--pre' --force
|
|
16
|
+
// Usage: cihai@next info 好
|
|
17
|
+
```
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
[uv](https://docs.astral.sh/uv/getting-started/features/#python-versions):
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
```console
|
|
22
|
+
$ uv add cihai-cli --prerelease allow
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[uvx](https://docs.astral.sh/uv/guides/tools/):
|
|
26
|
+
|
|
27
|
+
```console
|
|
28
|
+
$ uvx --from 'cihai-cli' --prerelease allow cihai
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## cihai-cli 0.32.x (unreleased)
|
|
21
32
|
|
|
22
33
|
<!-- Maintainers, insert changes / features for the next release here -->
|
|
23
34
|
|
|
35
|
+
- _Changes for the upcoming release go here._
|
|
36
|
+
|
|
37
|
+
## cihai-cli 0.31.0 (2025-11-01)
|
|
38
|
+
|
|
39
|
+
### Breaking changes
|
|
40
|
+
|
|
41
|
+
- Bump cihai 0.35.0 -> 0.36.0
|
|
42
|
+
- Drop support for Python 3.9; the new minimum is Python 3.10 (#330).
|
|
43
|
+
|
|
44
|
+
See also:
|
|
45
|
+
- [Python 3.9 EOL timeline](https://devguide.python.org/versions/#:~:text=Release%20manager-,3.9,-PEP%20596)
|
|
46
|
+
- [PEP 596](https://peps.python.org/pep-0596/)
|
|
47
|
+
|
|
48
|
+
### Development
|
|
49
|
+
|
|
50
|
+
- Add Python 3.14 to test matrix (#329)
|
|
51
|
+
|
|
52
|
+
#### chore: Implement PEP 563 deferred annotation resolution (#324)
|
|
53
|
+
|
|
54
|
+
- Add `from __future__ import annotations` to defer annotation resolution and reduce unnecessary runtime computations during type checking.
|
|
55
|
+
- Enable Ruff checks for PEP-compliant annotations:
|
|
56
|
+
- [non-pep585-annotation (UP006)](https://docs.astral.sh/ruff/rules/non-pep585-annotation/)
|
|
57
|
+
- [non-pep604-annotation (UP007)](https://docs.astral.sh/ruff/rules/non-pep604-annotation/)
|
|
58
|
+
|
|
59
|
+
For more details on PEP 563, see: https://peps.python.org/pep-0563/
|
|
60
|
+
|
|
24
61
|
## cihai-cli 0.30.0 (2024-12-21)
|
|
25
62
|
|
|
26
63
|
_Maintenance only, no bug fixes, or new features_
|
|
@@ -455,6 +492,24 @@ After (cihai 0.15+, cihai-cli 0.11+):
|
|
|
455
492
|
$ pip install cihai-cli
|
|
456
493
|
```
|
|
457
494
|
|
|
495
|
+
Modern uv-based workflows can either add the CLI to a project:
|
|
496
|
+
|
|
497
|
+
```console
|
|
498
|
+
$ uv add cihai-cli
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
Install it as a user-wide tool:
|
|
502
|
+
|
|
503
|
+
```console
|
|
504
|
+
$ uv tool install cihai-cli
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
Or run it on-demand:
|
|
508
|
+
|
|
509
|
+
```console
|
|
510
|
+
$ uvx --from cihai-cli cihai --version
|
|
511
|
+
```
|
|
512
|
+
|
|
458
513
|
This made deploying cihai + cihai-cli and pinning packages extremely laborious.
|
|
459
514
|
|
|
460
515
|
We can reinvestigate this model in the future.
|