ai-rail 0.1.0a7__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.
- ai_rail-0.1.0a7/.gitignore +22 -0
- ai_rail-0.1.0a7/CHANGELOG.md +66 -0
- ai_rail-0.1.0a7/CONTRIBUTING.md +36 -0
- ai_rail-0.1.0a7/LICENSE +203 -0
- ai_rail-0.1.0a7/PKG-INFO +238 -0
- ai_rail-0.1.0a7/README.md +213 -0
- ai_rail-0.1.0a7/SECURITY.md +13 -0
- ai_rail-0.1.0a7/docs/ARCHITECTURE.md +186 -0
- ai_rail-0.1.0a7/docs/COMMANDS.md +112 -0
- ai_rail-0.1.0a7/docs/INSTALL.md +64 -0
- ai_rail-0.1.0a7/docs/MASTER_PROMPT.md +27 -0
- ai_rail-0.1.0a7/docs/QUICKSTART.md +99 -0
- ai_rail-0.1.0a7/docs/RELEASE.md +182 -0
- ai_rail-0.1.0a7/docs/ROADMAP.md +59 -0
- ai_rail-0.1.0a7/docs/THREE_MODELS.md +5 -0
- ai_rail-0.1.0a7/docs/WORKFLOWS.md +80 -0
- ai_rail-0.1.0a7/docs/assets/ai-rail.png +0 -0
- ai_rail-0.1.0a7/examples/demo-todo/DEMO_SCRIPT.md +38 -0
- ai_rail-0.1.0a7/examples/demo-todo/README.md +71 -0
- ai_rail-0.1.0a7/examples/demo-todo/issues/001-add-body-validation.md +31 -0
- ai_rail-0.1.0a7/examples/demo-todo/issues/002-delete-missing-404.md +24 -0
- ai_rail-0.1.0a7/examples/demo-todo/issues/003-add-health-endpoint.md +23 -0
- ai_rail-0.1.0a7/examples/demo-todo/package.json +7 -0
- ai_rail-0.1.0a7/examples/demo-todo/server.js +36 -0
- ai_rail-0.1.0a7/pyproject.toml +41 -0
- ai_rail-0.1.0a7/src/ai_rail/__init__.py +1 -0
- ai_rail-0.1.0a7/src/ai_rail/__main__.py +3 -0
- ai_rail-0.1.0a7/src/ai_rail/cli.py +1515 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/.gitignore +9 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/AGENTS.md +34 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/AI_CONTRACT.md +14 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/CHATGPT.md +28 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/CLAUDE.md +17 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/CODEX.md +18 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/PROJECT.md +19 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/README.md +48 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/THREE_MODELS.md +21 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/config.json +13 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/rail.py +1334 -0
- ai_rail-0.1.0a7/src/ai_rail/template/.rail/state/.gitignore +5 -0
- ai_rail-0.1.0a7/src/ai_rail/template/Makefile +60 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
.coverage
|
|
7
|
+
htmlcov/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
*.egg-info/
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
|
|
14
|
+
# Editors / OS
|
|
15
|
+
.DS_Store
|
|
16
|
+
Thumbs.db
|
|
17
|
+
.vscode/
|
|
18
|
+
.idea/
|
|
19
|
+
|
|
20
|
+
# Local env
|
|
21
|
+
.env
|
|
22
|
+
.env.*
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Maintained by Afshin Saberi.
|
|
4
|
+
|
|
5
|
+
## 0.1.0a7
|
|
6
|
+
|
|
7
|
+
- Made `rail init --force` safer when refreshing initialized repositories.
|
|
8
|
+
- Added `rail upgrade` to safely refresh repo-local AI Rail runtime/template files.
|
|
9
|
+
- Switched git path parsing to robust `porcelain -z` handling.
|
|
10
|
+
- Cleaned up cross-platform CI and documentation readiness.
|
|
11
|
+
- Added author/about metadata to public CLI output.
|
|
12
|
+
- Finished packaging readiness fixes for the alpha release.
|
|
13
|
+
|
|
14
|
+
## 0.1.0a6
|
|
15
|
+
|
|
16
|
+
- Added `rail demo` to print a copyable public demo walkthrough.
|
|
17
|
+
- Added `rail release-check` to validate public-alpha packaging and docs readiness.
|
|
18
|
+
- Added `docs/QUICKSTART.md`, `docs/COMMANDS.md`, and `docs/RELEASE.md`.
|
|
19
|
+
- Added `examples/demo-todo/DEMO_SCRIPT.md` and updated the demo README.
|
|
20
|
+
- Added a package test workflow under `.github/workflows/tests.yml`.
|
|
21
|
+
- Updated README and install docs for the final public-alpha workflow.
|
|
22
|
+
- Made repo detection during `rail init` prefer fast local git remote detection before falling back to `gh`.
|
|
23
|
+
|
|
24
|
+
## 0.1.0a5
|
|
25
|
+
|
|
26
|
+
- Added `rail export` to generate tool-specific context files from the AI Rail project brain.
|
|
27
|
+
- Added exports for root `AGENTS.md`, root `CLAUDE.md`, root `AIDER.md`, `.cursor/rules/ai-rail.mdc`, and `.github/copilot-instructions.md`.
|
|
28
|
+
- Added safe managed-block updates using `AI_RAIL_EXPORT` markers.
|
|
29
|
+
- Refuse to overwrite existing unmarked human files unless `--force` is used, with `.rail.bak` backups.
|
|
30
|
+
- Added `--target`, `--dry-run`, `--force`, `--no-snapshot`, and `--max-history` options for exports.
|
|
31
|
+
- Updated tests and docs for the one-project-brain/many-tool-files workflow.
|
|
32
|
+
|
|
33
|
+
## 0.1.0a4
|
|
34
|
+
|
|
35
|
+
- Added `rail snapshot` to generate a portable project brain under `.rail/brain/`.
|
|
36
|
+
- Added `rail handoff` to create paste-ready model-specific handoffs for ChatGPT, Codex, Claude, Cursor, Aider, or generic AI sessions.
|
|
37
|
+
- Added optional handoff inclusion for last review pack and last checks output.
|
|
38
|
+
- Saved handoff outputs under `.rail/state/last-handoff-*.md`.
|
|
39
|
+
- Updated docs and tests for the portable project brain workflow.
|
|
40
|
+
|
|
41
|
+
## 0.1.0a3
|
|
42
|
+
|
|
43
|
+
- Added commit/ship safety preflight requiring a fresh review pack and passed fresh checks by default.
|
|
44
|
+
- Added dangerous/generated path guard for `.env`, keys, local databases, build outputs, dependencies, caches, and `.rail/state/`.
|
|
45
|
+
- Changed commit staging to stage known changed paths instead of blindly staging the whole repository.
|
|
46
|
+
- Added small untracked text file contents to review packs so new files are visible during AI audit.
|
|
47
|
+
- Added first-push upstream handling with `git push -u origin HEAD` when needed.
|
|
48
|
+
- Added `--allow-missing-checks` and `--allow-stale` escape hatches for advanced users.
|
|
49
|
+
- Fixed legacy `mode=issue` active-state handling in the public wrapper.
|
|
50
|
+
- Aligned the embedded repo-local runtime version with the public alpha version after audit.
|
|
51
|
+
- Added Phase 3 regression tests for safety preflight, dangerous files, fresh review/check commit flow, and untracked review contents.
|
|
52
|
+
|
|
53
|
+
## 0.1.0a2
|
|
54
|
+
|
|
55
|
+
- Added short daily commands: `rail next`, `rail verify`, `rail ship`, and `rail resume`.
|
|
56
|
+
- Updated README/docs/demo templates to lead with the shorter daily workflow.
|
|
57
|
+
- Kept detailed legacy workflow commands available for manual control.
|
|
58
|
+
|
|
59
|
+
## 0.1.0a1
|
|
60
|
+
|
|
61
|
+
- Renamed project from AI Rail predecessor naming to `AI Rail`.
|
|
62
|
+
- Renamed install package to `ai-rail`.
|
|
63
|
+
- Renamed CLI entrypoint to `rail`.
|
|
64
|
+
- Renamed project state folder to `.rail/`.
|
|
65
|
+
- Renamed repo-local runtime file to `.rail/rail.py`.
|
|
66
|
+
- Updated docs, examples, templates, tests, and package metadata for the rename.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Project goals:
|
|
4
|
+
|
|
5
|
+
- keep AI Rail local-first
|
|
6
|
+
- keep the CLI small
|
|
7
|
+
- keep GitHub Issues as the task database
|
|
8
|
+
- keep AI workflows explicit and auditable
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install -e ".[dev]"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Tests
|
|
17
|
+
|
|
18
|
+
Run the full test suite:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
python -m pytest -q
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Also run the basic CLI checks:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
python -m py_compile src/ai_rail/cli.py
|
|
28
|
+
python -m ai_rail --version
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Before opening a PR
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -m pytest -q
|
|
35
|
+
python -m py_compile src/ai_rail/cli.py
|
|
36
|
+
```
|
ai_rail-0.1.0a7/LICENSE
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
https://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Afshin Saberi
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
+
the copyright owner that is granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
+
other entities that control, are controlled by, or are under common
|
|
19
|
+
control with that entity. For the purposes of this definition,
|
|
20
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
+
direction or management of such entity, whether by contract or
|
|
22
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
+
|
|
25
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
+
exercising permissions granted by this License.
|
|
27
|
+
|
|
28
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
+
including but not limited to software source code, documentation
|
|
30
|
+
source, and configuration files.
|
|
31
|
+
|
|
32
|
+
"Object" form shall mean any form resulting from mechanical
|
|
33
|
+
transformation or translation of a Source form, including but
|
|
34
|
+
not limited to compiled object code, generated documentation,
|
|
35
|
+
and conversions to other media types.
|
|
36
|
+
|
|
37
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
+
Object form, made available under the License, as indicated by a
|
|
39
|
+
copyright notice that is included in or attached to the work
|
|
40
|
+
(an example is provided in the Appendix below).
|
|
41
|
+
|
|
42
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
+
form, that is based on (or derived from) the Work and for which the
|
|
44
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
+
of this License, Derivative Works shall not include works that remain
|
|
47
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
+
the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
"Contribution" shall mean any work of authorship, including
|
|
51
|
+
the original version of the Work and any modifications or additions
|
|
52
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
+
means any form of electronic, verbal, or written communication sent
|
|
57
|
+
to the Licensor or its representatives, including but not limited to
|
|
58
|
+
communication on electronic mailing lists, source code control systems,
|
|
59
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
+
excluding communication that is conspicuously marked or otherwise
|
|
62
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
+
|
|
64
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
+
subsequently incorporated within the Work.
|
|
67
|
+
|
|
68
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
+
Work and such Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
(except as stated in this section) patent license to make, have made,
|
|
79
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
+
where such license applies only to those patent claims licensable
|
|
81
|
+
by such Contributor that are necessarily infringed by their
|
|
82
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
+
institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
+
or contributory patent infringement, then any patent licenses
|
|
88
|
+
granted to You under this License for that Work shall terminate
|
|
89
|
+
as of the date such litigation is filed.
|
|
90
|
+
|
|
91
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
+
modifications, and in Source or Object form, provided that You
|
|
94
|
+
meet the following conditions:
|
|
95
|
+
|
|
96
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
97
|
+
Works a copy of this License; and
|
|
98
|
+
|
|
99
|
+
(b) You must cause any modified files to carry prominent notices
|
|
100
|
+
stating that You changed the files; and
|
|
101
|
+
|
|
102
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
+
that You distribute, all copyright, patent, trademark, and
|
|
104
|
+
attribution notices from the Source form of the Work,
|
|
105
|
+
excluding those notices that do not pertain to any part of
|
|
106
|
+
the Derivative Works; and
|
|
107
|
+
|
|
108
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
+
distribution, then any Derivative Works that You distribute must
|
|
110
|
+
include a readable copy of the attribution notices contained
|
|
111
|
+
within such NOTICE file, excluding those notices that do not
|
|
112
|
+
pertain to any part of the Derivative Works, in at least one
|
|
113
|
+
of the following places: within a NOTICE text file distributed
|
|
114
|
+
as part of the Derivative Works; within the Source form or
|
|
115
|
+
documentation, if provided along with the Derivative Works; or,
|
|
116
|
+
within a display generated by the Derivative Works, if and
|
|
117
|
+
wherever such third-party notices normally appear. The contents
|
|
118
|
+
of the NOTICE file are for informational purposes only and
|
|
119
|
+
do not modify the License. You may add Your own attribution
|
|
120
|
+
notices within Derivative Works that You distribute, alongside
|
|
121
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
+
that such additional attribution notices cannot be construed
|
|
123
|
+
as modifying the License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing the
|
|
143
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
+
implied, including, without limitation, any warranties or conditions
|
|
150
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any
|
|
153
|
+
risks associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
+
unless required by applicable law (such as deliberate and grossly
|
|
158
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
+
liable to You for damages, including any direct, indirect, special,
|
|
160
|
+
incidental, or consequential damages of any character arising as a
|
|
161
|
+
result of this License or out of the use or inability to use the
|
|
162
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
+
other commercial damages or losses), even if such Contributor
|
|
165
|
+
has been advised of the possibility of such damages.
|
|
166
|
+
|
|
167
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
+
or other liability obligations and/or rights consistent with this
|
|
171
|
+
License. However, in accepting such obligations, You may act only
|
|
172
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
+
defend, and hold each Contributor harmless for any liability
|
|
175
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
+
of your accepting any such warranty or additional liability.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
+
|
|
182
|
+
To apply the Apache License to your work, attach the following
|
|
183
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
+
replaced with your own identifying information. (Don't include
|
|
185
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
+
comment syntax for the file format. We also recommend that a
|
|
187
|
+
file or class name and description of purpose be included on the
|
|
188
|
+
same "printed page" as the copyright notice for easier
|
|
189
|
+
identification within third-party archives.
|
|
190
|
+
|
|
191
|
+
Copyright 2026 Afshin Saberi
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
ai_rail-0.1.0a7/PKG-INFO
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ai-rail
|
|
3
|
+
Version: 0.1.0a7
|
|
4
|
+
Summary: A local-first workflow rail and portable project brain for AI-assisted development.
|
|
5
|
+
Project-URL: Homepage, https://theafshin.com
|
|
6
|
+
Project-URL: Repository, https://github.com/afshinsb/ai-rail
|
|
7
|
+
Project-URL: Documentation, https://github.com/afshinsb/ai-rail/tree/main/docs
|
|
8
|
+
Author: Afshin Saberi
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai,chatgpt,claude,cli,codex,cursor,developer-tools,github,workflow
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# AI Rail
|
|
27
|
+
|
|
28
|
+
[](https://github.com/afshinsb/ai-rail/actions/workflows/tests.yml)
|
|
29
|
+
[](pyproject.toml)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
[](docs/RELEASE.md)
|
|
32
|
+
|
|
33
|
+
**Never explain your project twice to AI.**
|
|
34
|
+
|
|
35
|
+
AI Rail is a local-first CLI that keeps AI-assisted development focused, repeatable, and safe.
|
|
36
|
+
|
|
37
|
+
It gives every Git repo a portable project brain, a simple daily workflow, and scoped prompts for tools like ChatGPT, Codex, Claude, Cursor, and Aider - so you can move between AI tools without re-explaining the codebase, losing context, or letting the coding agent drift into unrelated files.
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
rail n -> start the next scoped task
|
|
41
|
+
rail v -> review, run local checks, and create an audit prompt
|
|
42
|
+
rail s -> safely commit, push, close, and sync
|
|
43
|
+
rail h -> continue in a new AI chat with full project context
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
AI Rail keeps the coding agent on the active issue, keeps ChatGPT in the review loop, and lets your own machine run the tests - saving tokens, reducing over-coding, and making AI development feel controlled instead of chaotic.
|
|
47
|
+
|
|
48
|
+
<p align="center">
|
|
49
|
+
<img src="docs/assets/ai-rail.png" alt="AI Rail overview" width="900">
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
## Who This Is For
|
|
53
|
+
|
|
54
|
+
AI Rail is for developers who:
|
|
55
|
+
|
|
56
|
+
- use more than one AI coding tool on the same repo
|
|
57
|
+
- want GitHub Issues to be the task source of truth
|
|
58
|
+
- want repeatable prompts, review packs, checks, and handoffs
|
|
59
|
+
- prefer local-first tooling over hosted workflow state
|
|
60
|
+
- work solo or in small repos where conservative commit safety matters
|
|
61
|
+
|
|
62
|
+
## What AI Rail Is Not
|
|
63
|
+
|
|
64
|
+
AI Rail is not:
|
|
65
|
+
|
|
66
|
+
- an AI model, agent runtime, or hosted service
|
|
67
|
+
- a replacement for Git, GitHub Issues, or your test suite
|
|
68
|
+
- a project management system for large teams
|
|
69
|
+
- a tool that sends code to a remote service by itself
|
|
70
|
+
- a way to bypass review, checks, or secret-file safety
|
|
71
|
+
|
|
72
|
+
## Install
|
|
73
|
+
|
|
74
|
+
AI Rail is currently alpha software.
|
|
75
|
+
|
|
76
|
+
Recommended public install:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pipx install ai-rail
|
|
80
|
+
rail --version
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Latest source from GitHub:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pipx install git+https://github.com/afshinsb/ai-rail.git
|
|
87
|
+
rail --version
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Contributor install from this source checkout:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install -e ".[dev]"
|
|
94
|
+
rail --version
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Quick Demo
|
|
98
|
+
|
|
99
|
+
Print the built-in walkthrough:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
rail demo
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Try the bundled demo app:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
cd examples/demo-todo
|
|
109
|
+
rail init --stack node --project-name "AI Rail Demo TODO"
|
|
110
|
+
rail doctor
|
|
111
|
+
npm run check
|
|
112
|
+
gh issue create --title "Add todo body validation" --body-file issues/001-add-body-validation.md
|
|
113
|
+
rail next --copy
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## 60-Second Quickstart
|
|
117
|
+
|
|
118
|
+
Inside any Git repo:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
rail init --stack node --project-name "My Project"
|
|
122
|
+
rail doctor
|
|
123
|
+
rail resume
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Daily loop:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
rail next --copy
|
|
130
|
+
# paste/run the generated prompt in your AI coding tool
|
|
131
|
+
rail verify --copy
|
|
132
|
+
# paste the generated review prompt into ChatGPT/Claude for audit
|
|
133
|
+
rail ship "type(scope): message"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Short alias loop:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
rail n
|
|
140
|
+
# paste/run the generated prompt in your AI coding tool
|
|
141
|
+
rail v
|
|
142
|
+
# paste the generated review prompt into ChatGPT/Claude for audit
|
|
143
|
+
rail s "type(scope): message"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
When switching AI tools or opening a new chat:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
rail snapshot
|
|
150
|
+
rail handoff --for chatgpt --include-review --include-checks --copy
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
To update tool-specific AI instruction files from the same project brain:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
rail export
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Core Commands
|
|
160
|
+
|
|
161
|
+
| Command | Purpose |
|
|
162
|
+
|---|---|
|
|
163
|
+
| `rail init` | Add AI Rail files to a repo |
|
|
164
|
+
| `rail resume` | Show where you stopped |
|
|
165
|
+
| `rail next` | Start the next issue and generate the first prompt |
|
|
166
|
+
| `rail handoff` | Generate portable context for another AI session/model |
|
|
167
|
+
| `rail verify` | Capture review info, run checks, and generate an audit prompt |
|
|
168
|
+
| `rail ship` | Commit, push, close the issue, mark done, and sync |
|
|
169
|
+
| `rail snapshot` | Refresh `.rail/brain/` project-brain files |
|
|
170
|
+
| `rail export` | Generate `AGENTS.md`, `CLAUDE.md`, Cursor rules, `AIDER.md`, and Copilot instructions |
|
|
171
|
+
| `rail demo` | Print the public demo script |
|
|
172
|
+
| `rail release-check` | Check packaging/docs readiness |
|
|
173
|
+
|
|
174
|
+
Common aliases are thin wrappers over the long commands: `rail r` for `resume`, `rail n` for `next --copy`, `rail v` for `verify --copy`, `rail s` for `ship`, `rail snap` for `snapshot`, `rail h`/`hc`/`hg`/`hl` for handoffs, `rail x`/`xd`/`xf` for exports, and `rail rc` for `release-check`.
|
|
175
|
+
|
|
176
|
+
Detailed commands such as `rail start`, `rail prompt`, `rail review`, `rail checks`, `rail commit`, `rail issue-close`, `rail done`, and `rail sync` remain available for manual control.
|
|
177
|
+
|
|
178
|
+
## Portable Project Brain
|
|
179
|
+
|
|
180
|
+
`rail snapshot` writes:
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
.rail/brain/PROJECT.md
|
|
184
|
+
.rail/brain/CURRENT_TASK.md
|
|
185
|
+
.rail/brain/STATUS.md
|
|
186
|
+
.rail/brain/RECENT_HISTORY.md
|
|
187
|
+
.rail/brain/HANDOFF.md
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`rail handoff --for codex|chatgpt|claude|cursor|aider --copy` turns that brain into a paste-ready handoff so a new AI session can continue from the current project state.
|
|
191
|
+
|
|
192
|
+
## Tool-Specific Exports
|
|
193
|
+
|
|
194
|
+
`rail export` turns the single AI Rail project brain into files that different AI coding tools already know how to read:
|
|
195
|
+
|
|
196
|
+
```text
|
|
197
|
+
AGENTS.md
|
|
198
|
+
CLAUDE.md
|
|
199
|
+
AIDER.md
|
|
200
|
+
.cursor/rules/ai-rail.mdc
|
|
201
|
+
.github/copilot-instructions.md
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Exports are safe by default. AI Rail updates its own managed block when markers are present, but refuses to overwrite existing human files unless you pass `--force`, which first writes a `.rail.bak` backup.
|
|
205
|
+
|
|
206
|
+
## Safety Defaults
|
|
207
|
+
|
|
208
|
+
`rail ship` refuses unsafe commits by default when:
|
|
209
|
+
|
|
210
|
+
- the review pack is missing or stale
|
|
211
|
+
- checks are missing, failed, or stale
|
|
212
|
+
- dangerous/generated files such as `.env`, keys, local databases, `node_modules/`, `dist/`, or `.rail/state/` are changed
|
|
213
|
+
|
|
214
|
+
Escape hatches exist for advanced users, but the normal path is intentionally conservative.
|
|
215
|
+
|
|
216
|
+
## Local-First Privacy
|
|
217
|
+
|
|
218
|
+
AI Rail does not send your code anywhere by itself. It shells out to `git`, `gh`, and your configured local checks.
|
|
219
|
+
|
|
220
|
+
By default, `.rail/state/history.jsonl` is ignored by git to avoid committing personal workflow history into team repos.
|
|
221
|
+
|
|
222
|
+
License: Apache License 2.0.
|
|
223
|
+
|
|
224
|
+
## Author
|
|
225
|
+
|
|
226
|
+
- Afshin Saberi
|
|
227
|
+
- GitHub: https://github.com/afshinsb
|
|
228
|
+
- Website: https://theafshin.com
|
|
229
|
+
|
|
230
|
+
## Docs
|
|
231
|
+
|
|
232
|
+
- [Quickstart](docs/QUICKSTART.md)
|
|
233
|
+
- [Install](docs/INSTALL.md)
|
|
234
|
+
- [Commands](docs/COMMANDS.md)
|
|
235
|
+
- [Workflows](docs/WORKFLOWS.md)
|
|
236
|
+
- [Architecture](docs/ARCHITECTURE.md)
|
|
237
|
+
- [Release checklist](docs/RELEASE.md)
|
|
238
|
+
- [Roadmap](docs/ROADMAP.md)
|