agent-rules-kit 0.2.1__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.
Files changed (62) hide show
  1. agent_rules_kit-0.2.1/.github/ISSUE_TEMPLATE/bug_report.yml +107 -0
  2. agent_rules_kit-0.2.1/.github/ISSUE_TEMPLATE/feature_request.yml +116 -0
  3. agent_rules_kit-0.2.1/.github/pull_request_template.md +72 -0
  4. agent_rules_kit-0.2.1/.github/workflows/ci.yml +43 -0
  5. agent_rules_kit-0.2.1/.github/workflows/publish-pypi.yml +99 -0
  6. agent_rules_kit-0.2.1/.gitignore +34 -0
  7. agent_rules_kit-0.2.1/AGENTS.md +195 -0
  8. agent_rules_kit-0.2.1/CHANGELOG.md +151 -0
  9. agent_rules_kit-0.2.1/CONTRIBUTING.md +239 -0
  10. agent_rules_kit-0.2.1/LICENSE +21 -0
  11. agent_rules_kit-0.2.1/PKG-INFO +613 -0
  12. agent_rules_kit-0.2.1/README.md +588 -0
  13. agent_rules_kit-0.2.1/SECURITY.md +88 -0
  14. agent_rules_kit-0.2.1/SUPPORT.md +88 -0
  15. agent_rules_kit-0.2.1/docs/BUILD-PLAN.md +133 -0
  16. agent_rules_kit-0.2.1/docs/OUTPUTS.md +178 -0
  17. agent_rules_kit-0.2.1/docs/PRODUCT-STRATEGY.md +292 -0
  18. agent_rules_kit-0.2.1/docs/RULES.md +279 -0
  19. agent_rules_kit-0.2.1/docs/THREAT-MODEL.md +161 -0
  20. agent_rules_kit-0.2.1/docs/V0.2-GOVERNANCE-BOUNDARIES.md +224 -0
  21. agent_rules_kit-0.2.1/docs/V0.2-GOVERNANCE-RULES-SPEC.md +419 -0
  22. agent_rules_kit-0.2.1/docs/V0.2-PACKAGING-DRY-RUN.md +156 -0
  23. agent_rules_kit-0.2.1/docs/V0.2-RELEASE-READINESS.md +254 -0
  24. agent_rules_kit-0.2.1/docs/V0.2.0-RELEASE-NOTES.md +85 -0
  25. agent_rules_kit-0.2.1/docs/screenshots/readme/agent-rules-kit-governance-findings.png +0 -0
  26. agent_rules_kit-0.2.1/docs/screenshots/readme/agent-rules-kit-help-check.png +0 -0
  27. agent_rules_kit-0.2.1/docs/screenshots/readme/agent-rules-kit-init-safety.png +0 -0
  28. agent_rules_kit-0.2.1/docs/screenshots/readme/agent-rules-kit-output-formats.png +0 -0
  29. agent_rules_kit-0.2.1/pyproject.toml +45 -0
  30. agent_rules_kit-0.2.1/scripts/check.sh +86 -0
  31. agent_rules_kit-0.2.1/src/agent_rules_kit/__init__.py +3 -0
  32. agent_rules_kit-0.2.1/src/agent_rules_kit/cli.py +345 -0
  33. agent_rules_kit-0.2.1/src/agent_rules_kit/discovery.py +109 -0
  34. agent_rules_kit-0.2.1/src/agent_rules_kit/findings.py +85 -0
  35. agent_rules_kit-0.2.1/src/agent_rules_kit/governance.py +608 -0
  36. agent_rules_kit-0.2.1/src/agent_rules_kit/init_plan.py +73 -0
  37. agent_rules_kit-0.2.1/src/agent_rules_kit/init_write.py +143 -0
  38. agent_rules_kit-0.2.1/src/agent_rules_kit/redaction.py +78 -0
  39. agent_rules_kit-0.2.1/tests/fixtures/repositories/claude-dotdir/.claude/CLAUDE.md +13 -0
  40. agent_rules_kit-0.2.1/tests/fixtures/repositories/empty-repo/.gitkeep +0 -0
  41. agent_rules_kit-0.2.1/tests/fixtures/repositories/missing-authority-scope/AGENTS.md +7 -0
  42. agent_rules_kit-0.2.1/tests/fixtures/repositories/missing-secret-boundary/AGENTS.md +8 -0
  43. agent_rules_kit-0.2.1/tests/fixtures/repositories/multi-agent-overlap/.cursor/rules/agent-rules.mdc +6 -0
  44. agent_rules_kit-0.2.1/tests/fixtures/repositories/multi-agent-overlap/.github/copilot-instructions.md +7 -0
  45. agent_rules_kit-0.2.1/tests/fixtures/repositories/multi-agent-overlap/.github/instructions/agents.instructions.md +7 -0
  46. agent_rules_kit-0.2.1/tests/fixtures/repositories/multi-agent-overlap/AGENTS.md +11 -0
  47. agent_rules_kit-0.2.1/tests/fixtures/repositories/multi-agent-overlap/CLAUDE.md +11 -0
  48. agent_rules_kit-0.2.1/tests/fixtures/repositories/multi-agent-overlap/GEMINI.md +10 -0
  49. agent_rules_kit-0.2.1/tests/fixtures/repositories/risky-instructions/AGENTS.md +13 -0
  50. agent_rules_kit-0.2.1/tests/fixtures/repositories/runtime-network-llm/AGENTS.md +9 -0
  51. agent_rules_kit-0.2.1/tests/fixtures/repositories/single-agent/AGENTS.md +11 -0
  52. agent_rules_kit-0.2.1/tests/fixtures/repositories/unsafe-command-execution/AGENTS.md +9 -0
  53. agent_rules_kit-0.2.1/tests/fixtures/repositories/unsupported-claim/AGENTS.md +8 -0
  54. agent_rules_kit-0.2.1/tests/test_cli.py +1019 -0
  55. agent_rules_kit-0.2.1/tests/test_diagnostic_fixtures.py +79 -0
  56. agent_rules_kit-0.2.1/tests/test_discovery.py +84 -0
  57. agent_rules_kit-0.2.1/tests/test_findings.py +142 -0
  58. agent_rules_kit-0.2.1/tests/test_governance.py +602 -0
  59. agent_rules_kit-0.2.1/tests/test_init_plan.py +52 -0
  60. agent_rules_kit-0.2.1/tests/test_init_write.py +95 -0
  61. agent_rules_kit-0.2.1/tests/test_path_boundaries.py +311 -0
  62. agent_rules_kit-0.2.1/tests/test_redaction.py +114 -0
@@ -0,0 +1,107 @@
1
+ name: Bug report
2
+ description: Report reproducible incorrect behavior in agent-rules-kit.
3
+ title: "bug: "
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thank you for reporting a bug.
9
+
10
+ Before submitting, please read README.md, AGENTS.md, SECURITY.md, CONTRIBUTING.md, and SUPPORT.md.
11
+
12
+ Do not include secrets, tokens, credentials, cookies, private URLs, customer data, or sensitive repository contents.
13
+
14
+ - type: textarea
15
+ id: problem
16
+ attributes:
17
+ label: Problem
18
+ description: Describe the incorrect behavior clearly.
19
+ placeholder: What is wrong?
20
+ validations:
21
+ required: true
22
+
23
+ - type: textarea
24
+ id: expected
25
+ attributes:
26
+ label: Expected behavior
27
+ description: Describe what should have happened.
28
+ placeholder: What did you expect?
29
+ validations:
30
+ required: true
31
+
32
+ - type: textarea
33
+ id: actual
34
+ attributes:
35
+ label: Actual behavior
36
+ description: Describe what happened instead.
37
+ placeholder: What actually happened?
38
+ validations:
39
+ required: true
40
+
41
+ - type: textarea
42
+ id: reproduction
43
+ attributes:
44
+ label: Reproduction steps
45
+ description: Provide minimal steps to reproduce the issue.
46
+ placeholder: |
47
+ 1. Run ...
48
+ 2. Observe ...
49
+ 3. See error ...
50
+ validations:
51
+ required: true
52
+
53
+ - type: textarea
54
+ id: command-output
55
+ attributes:
56
+ label: Relevant command output
57
+ description: Paste only non-sensitive output. Redact anything secret-like.
58
+ render: text
59
+ placeholder: Paste safe output here.
60
+ validations:
61
+ required: false
62
+
63
+ - type: input
64
+ id: os
65
+ attributes:
66
+ label: Operating system
67
+ description: Example: CachyOS, Ubuntu, macOS, Windows.
68
+ placeholder: CachyOS
69
+ validations:
70
+ required: false
71
+
72
+ - type: input
73
+ id: python-version
74
+ attributes:
75
+ label: Python version
76
+ description: Run python --version.
77
+ placeholder: Python 3.12.x
78
+ validations:
79
+ required: false
80
+
81
+ - type: dropdown
82
+ id: impact
83
+ attributes:
84
+ label: Impact area
85
+ description: Choose the main area affected.
86
+ options:
87
+ - correctness
88
+ - safety boundary
89
+ - documentation
90
+ - usability
91
+ - tests
92
+ - CI
93
+ - unknown
94
+ validations:
95
+ required: true
96
+
97
+ - type: checkboxes
98
+ id: confirmation
99
+ attributes:
100
+ label: Confirmation
101
+ options:
102
+ - label: I did not include secrets, tokens, credentials, cookies, private URLs, or customer data.
103
+ required: true
104
+ - label: I understand this tool is not a security scanner and provides no security guarantees.
105
+ required: true
106
+ - label: I understand this project must not execute commands from analyzed repositories.
107
+ required: true
@@ -0,0 +1,116 @@
1
+ name: Feature request
2
+ description: Propose a focused, reviewable improvement to agent-rules-kit.
3
+ title: "feat: "
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thank you for proposing an improvement.
9
+
10
+ Before submitting, please read README.md, AGENTS.md, SECURITY.md, CONTRIBUTING.md, CHANGELOG.md, and SUPPORT.md.
11
+
12
+ Keep the request narrow, testable, local-first, and aligned with the project boundaries.
13
+
14
+ - type: textarea
15
+ id: problem
16
+ attributes:
17
+ label: Problem
18
+ description: What concrete problem would this solve?
19
+ placeholder: Describe the user pain or maintenance problem.
20
+ validations:
21
+ required: true
22
+
23
+ - type: textarea
24
+ id: proposal
25
+ attributes:
26
+ label: Proposed solution
27
+ description: Describe the smallest useful change.
28
+ placeholder: What should be added or changed?
29
+ validations:
30
+ required: true
31
+
32
+ - type: textarea
33
+ id: alternatives
34
+ attributes:
35
+ label: Alternatives considered
36
+ description: Explain simpler or safer alternatives, including doing nothing.
37
+ placeholder: What alternatives did you consider?
38
+ validations:
39
+ required: false
40
+
41
+ - type: dropdown
42
+ id: scope
43
+ attributes:
44
+ label: Main scope
45
+ description: Choose the primary area.
46
+ options:
47
+ - CLI behavior
48
+ - rule detection
49
+ - reporting output
50
+ - documentation
51
+ - tests
52
+ - CI / GitHub configuration
53
+ - project policy
54
+ - unknown
55
+ validations:
56
+ required: true
57
+
58
+ - type: checkboxes
59
+ id: boundaries
60
+ attributes:
61
+ label: Boundary check
62
+ options:
63
+ - label: This request keeps runtime behavior local-first.
64
+ required: true
65
+ - label: This request does not require network access in runtime behavior.
66
+ required: true
67
+ - label: This request does not require an LLM dependency in runtime behavior.
68
+ required: true
69
+ - label: This request does not require executing commands from analyzed repositories.
70
+ required: true
71
+ - label: This request does not claim the tool is a security scanner.
72
+ required: true
73
+ - label: This request does not add unsupported security guarantees.
74
+ required: true
75
+
76
+ - type: textarea
77
+ id: acceptance
78
+ attributes:
79
+ label: Acceptance criteria
80
+ description: How should maintainers know this is done?
81
+ placeholder: |
82
+ - Given ...
83
+ - When ...
84
+ - Then ...
85
+ validations:
86
+ required: true
87
+
88
+ - type: textarea
89
+ id: testing
90
+ attributes:
91
+ label: Testing plan
92
+ description: Describe the tests or checks that should verify the change.
93
+ placeholder: Expected minimum: ./scripts/check.sh and focused tests.
94
+ validations:
95
+ required: true
96
+
97
+ - type: textarea
98
+ id: risks
99
+ attributes:
100
+ label: Risks and limitations
101
+ description: Mention possible safety, maintenance, compatibility, or usability risks.
102
+ placeholder: What could go wrong or be misunderstood?
103
+ validations:
104
+ required: false
105
+
106
+ - type: checkboxes
107
+ id: confirmation
108
+ attributes:
109
+ label: Confirmation
110
+ options:
111
+ - label: I kept this request narrow and reviewable.
112
+ required: true
113
+ - label: I did not include secrets, tokens, credentials, private URLs, customer data, or sensitive repository contents.
114
+ required: true
115
+ - label: I understand this project favors small, testable changes over broad rewrites.
116
+ required: true
@@ -0,0 +1,72 @@
1
+ # Pull Request
2
+
3
+ ## Summary
4
+
5
+ Describe the change in one or two clear sentences.
6
+
7
+ ## Why
8
+
9
+ Explain why this change is needed.
10
+
11
+ ## Scope
12
+
13
+ This PR changes:
14
+
15
+ - [ ] source code
16
+ - [ ] tests
17
+ - [ ] documentation
18
+ - [ ] CI / GitHub configuration
19
+ - [ ] security-sensitive behavior
20
+ - [ ] project policy or workflow
21
+
22
+ ## Checks
23
+
24
+ Before marking this PR ready, confirm:
25
+
26
+ - [ ] I read AGENTS.md.
27
+ - [ ] I changed one minimal unit.
28
+ - [ ] I did not use git add .
29
+ - [ ] I reviewed the staged diff.
30
+ - [ ] I ran ./scripts/check.sh.
31
+ - [ ] Tests pass locally.
32
+ - [ ] CI is expected to pass.
33
+ - [ ] No secrets, tokens, credentials, private URLs, or customer data were added.
34
+ - [ ] No unsupported production or security claims were added.
35
+
36
+ ## Security and boundary impact
37
+
38
+ Does this change touch any of these areas?
39
+
40
+ - [ ] secret detection
41
+ - [ ] redaction
42
+ - [ ] file traversal
43
+ - [ ] symlink handling
44
+ - [ ] write behavior
45
+ - [ ] command execution boundaries
46
+ - [ ] network behavior
47
+ - [ ] LLM behavior
48
+ - [ ] GitHub Actions permissions
49
+ - [ ] none of the above
50
+
51
+ If any box except "none of the above" is checked, explain the risk and mitigation.
52
+
53
+ ## Testing evidence
54
+
55
+ Paste the relevant local output or summarize it precisely.
56
+
57
+ Expected minimum:
58
+
59
+ ./scripts/check.sh
60
+
61
+ ## Known limitations
62
+
63
+ List any known limitation, tradeoff, or follow-up needed.
64
+
65
+ ## Release notes
66
+
67
+ Should this affect CHANGELOG.md?
68
+
69
+ - [ ] yes
70
+ - [ ] no
71
+
72
+ If yes, explain the changelog entry.
@@ -0,0 +1,43 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ concurrency:
16
+ group: ci-${{ github.workflow }}-${{ github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+ local-checks:
21
+ name: local-checks / Python 3.12
22
+ runs-on: ubuntu-latest
23
+ timeout-minutes: 10
24
+
25
+ steps:
26
+ - name: Checkout repository
27
+ uses: actions/checkout@v6
28
+
29
+ - name: Set up Python 3.12
30
+ uses: actions/setup-python@v6
31
+ with:
32
+ python-version: "3.12"
33
+
34
+ - name: Install project and dev dependencies
35
+ run: python -m pip install -e '.[dev]'
36
+
37
+ - name: Run local checks
38
+ run: ./scripts/check.sh
39
+
40
+ - name: Run installed package smoke checks
41
+ run: |
42
+ agent-rules-kit --version
43
+ agent-rules-kit check tests/fixtures/repositories/single-agent --format json | python -m json.tool
@@ -0,0 +1,99 @@
1
+ name: Publish PyPI
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - published
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: publish-pypi-${{ github.ref }}
13
+ cancel-in-progress: false
14
+
15
+ jobs:
16
+ build:
17
+ name: build / distributions
18
+ runs-on: ubuntu-latest
19
+ timeout-minutes: 15
20
+ permissions:
21
+ contents: read
22
+
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@v6
26
+
27
+ - name: Set up Python 3.12
28
+ uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.12"
31
+
32
+ - name: Install build tools and project development dependencies
33
+ run: |
34
+ python -m pip install -U build twine
35
+ python -m pip install -e '.[dev]'
36
+
37
+ - name: Verify release ref matches package version
38
+ run: |
39
+ python - <<'PY'
40
+ import os
41
+ import tomllib
42
+ from pathlib import Path
43
+
44
+ version = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))["project"]["version"]
45
+ ref_name = os.environ.get("GITHUB_REF_NAME", "")
46
+ event_name = os.environ.get("GITHUB_EVENT_NAME", "")
47
+
48
+ print(f"project_version={version}")
49
+ print(f"github_event={event_name}")
50
+ print(f"github_ref_name={ref_name}")
51
+
52
+ if event_name == "release" and ref_name != f"v{version}":
53
+ raise SystemExit(f"release ref {ref_name!r} does not match package version v{version}")
54
+ PY
55
+
56
+ - name: Run local checks
57
+ run: ./scripts/check.sh
58
+
59
+ - name: Build distributions
60
+ run: python -m build
61
+
62
+ - name: Check distributions
63
+ run: python -m twine check dist/*
64
+
65
+ - name: Smoke test wheel
66
+ run: |
67
+ python -m venv /tmp/agent-rules-kit-wheel-smoke
68
+ /tmp/agent-rules-kit-wheel-smoke/bin/python -m pip install dist/*.whl
69
+ /tmp/agent-rules-kit-wheel-smoke/bin/python -m pip check
70
+ /tmp/agent-rules-kit-wheel-smoke/bin/agent-rules-kit --version
71
+ /tmp/agent-rules-kit-wheel-smoke/bin/agent-rules-kit check tests/fixtures/repositories/single-agent --format json | /tmp/agent-rules-kit-wheel-smoke/bin/python -m json.tool
72
+
73
+ - name: Upload distributions
74
+ uses: actions/upload-artifact@v4
75
+ with:
76
+ name: python-distributions
77
+ path: dist/
78
+ if-no-files-found: error
79
+ retention-days: 7
80
+
81
+ publish:
82
+ name: publish / PyPI
83
+ needs: build
84
+ runs-on: ubuntu-latest
85
+ timeout-minutes: 15
86
+ environment: pypi
87
+ permissions:
88
+ contents: read
89
+ id-token: write
90
+
91
+ steps:
92
+ - name: Download distributions
93
+ uses: actions/download-artifact@v5
94
+ with:
95
+ name: python-distributions
96
+ path: dist
97
+
98
+ - name: Publish package distributions to PyPI
99
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,34 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+ .mypy_cache/
8
+ .coverage
9
+ htmlcov/
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+
16
+ # Build artifacts
17
+ build/
18
+ dist/
19
+ *.egg-info/
20
+
21
+ # Local/editor files
22
+ .DS_Store
23
+ *.swp
24
+ *.swo
25
+ .idea/
26
+ .vscode/
27
+
28
+ # Environment and secrets
29
+ .env
30
+ .env.*
31
+ !.env.example
32
+
33
+ # Logs
34
+ *.log
@@ -0,0 +1,195 @@
1
+ # AGENTS.md — agent-rules-kit
2
+
3
+ Scope: this file applies repository-wide to all work in this repository, unless a more specific nested AGENTS.md exists for a subtree.
4
+ Authority: explicit user instructions come first, then this AGENTS.md, then repository documentation and runbooks.
5
+
6
+ This file is mandatory for every AI assistant, coding agent, or chat working on this repository.
7
+
8
+ The repository must be handled with strict CDLAN discipline. Do not improvise a new workflow.
9
+
10
+ ## Current project
11
+
12
+ agent-rules-kit is a local Python CLI that diagnoses baseline quality of AI agent instruction files in repositories.
13
+
14
+ Core boundaries:
15
+
16
+ - Local-first.
17
+ - Read-only by default.
18
+ - No network access in runtime behavior.
19
+ - No LLM dependency in runtime behavior.
20
+ - No execution of commands from analyzed repositories.
21
+ - No security guarantees or exaggerated claims.
22
+ - Secret-like findings must be redacted.
23
+
24
+ ## Operating modes
25
+
26
+ There are two different work modes.
27
+
28
+ ### Mode 1 — Genesis / Inception
29
+
30
+ Genesis is only for creating the project from zero before remote GitHub protection exists.
31
+
32
+ During Genesis, work on main is temporarily allowed, but only under these rules:
33
+
34
+ - main must start clean before every mutation.
35
+ - Create one file at a time whenever possible.
36
+ - Before stage, the prompt/status should show exactly one untracked or modified item.
37
+ - Stage exactly one file.
38
+ - Review the staged diff visibly.
39
+ - Commit that one file.
40
+ - Return main to clean state.
41
+ - Repeat.
42
+
43
+ Genesis pattern:
44
+
45
+ - main clean.
46
+ - create one file.
47
+ - validate that file.
48
+ - status shows one change.
49
+ - stage exact file only.
50
+ - staged shows one file.
51
+ - diff staged is visible.
52
+ - no unstaged changes.
53
+ - commit.
54
+ - main clean.
55
+
56
+ Allowed exception:
57
+
58
+ - The first identity baseline may include README.md, LICENSE, and .gitignore together because they form the repository identity baseline.
59
+
60
+ ### Mode 2 — Always-Green
61
+
62
+ Always-Green begins only after Genesis is closed.
63
+
64
+ Genesis is closed when:
65
+
66
+ - local main is clean;
67
+ - local checks pass;
68
+ - AGENTS.md exists;
69
+ - scripts/check.sh exists and passes;
70
+ - tests exist and pass;
71
+ - CI exists or a documented reason explains why it does not yet exist;
72
+ - remote is created intentionally;
73
+ - initial push is verified;
74
+ - main protection/ruleset is applied or explicitly tracked as a blocker.
75
+
76
+ After Genesis closes:
77
+
78
+ - Do not work directly on main.
79
+ - Create a specific branch for every logical phase.
80
+ - Read real files before editing.
81
+ - Make minimal changes.
82
+ - Run checks before stage.
83
+ - Stage exact files only.
84
+ - Never use git add .
85
+ - Review staged diff fully.
86
+ - Commit small.
87
+ - Push branch only after local gates pass.
88
+ - Open PR.
89
+ - Merge only after checks are green.
90
+ - Return main to clean synchronized state.
91
+
92
+ ## Absolute prohibitions
93
+
94
+ Do not:
95
+
96
+ - use git add .;
97
+ - commit without staged review;
98
+ - push just to see if CI passes;
99
+ - create or push a remote before local Genesis gates pass;
100
+ - work on main after Genesis is closed;
101
+ - hide failing checks;
102
+ - invent unsupported claims;
103
+ - add secrets, tokens, credentials, cookies, keys, or private URLs;
104
+ - add network behavior without explicit approval;
105
+ - add LLM behavior without explicit approval;
106
+ - execute commands from repositories being analyzed;
107
+ - overwrite files without reading existing state first.
108
+
109
+ ## Zsh and terminal safety
110
+
111
+ The user works in zsh.
112
+
113
+ Never use `path` as a shell variable name in zsh commands.
114
+
115
+ Reason: in zsh, `path` is tied to `PATH`. Using `path` as a variable can break PATH and make basic commands unavailable.
116
+
117
+ Use these names instead:
118
+
119
+ - item
120
+ - entry
121
+ - target
122
+ - target_dir
123
+ - file_item
124
+ - file_name
125
+ - repo_dir
126
+ - repo_root
127
+
128
+ If basic commands such as git, mkdir, chmod, cat, or python suddenly return command not found, check PATH first.
129
+
130
+ Safe temporary PATH repair:
131
+
132
+ export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
133
+
134
+ ## Required checks
135
+
136
+ Before every commit:
137
+
138
+ - git status --short --branch
139
+ - git diff --name-status
140
+ - git diff --cached --name-status
141
+ - git diff --cached --check
142
+ - visible staged diff with git --no-pager diff --cached --no-ext-diff
143
+ - file-specific validation
144
+ - scripts/check.sh when it exists and applies
145
+
146
+ For Python files:
147
+
148
+ - compile the file;
149
+ - run related tests;
150
+ - ensure UTF-8, LF, final newline, and no trailing whitespace.
151
+
152
+ For shell files:
153
+
154
+ - sh -n file;
155
+ - executable bit must be intentional and verified when needed.
156
+
157
+ For documentation:
158
+
159
+ - no internal secrets;
160
+ - no fake claims;
161
+ - no unsupported production/security promises.
162
+
163
+ ## Commit discipline
164
+
165
+ Commit messages must be small and specific.
166
+
167
+ Examples:
168
+
169
+ - chore: add repository identity baseline
170
+ - chore: add python project metadata
171
+ - chore: add package version module
172
+ - feat: add initial cli entrypoint
173
+ - test: add cli smoke tests
174
+ - chore: add local check script
175
+
176
+ Do not combine unrelated changes.
177
+
178
+ ## If anything fails
179
+
180
+ Stop immediately.
181
+
182
+ Do not continue building on a failed step.
183
+
184
+ Required recovery sequence:
185
+
186
+ - inspect status;
187
+ - inspect changed files;
188
+ - identify the exact failure;
189
+ - clean or revert explicitly;
190
+ - return to the last clean commit;
191
+ - retry with smaller granularity.
192
+
193
+ Do not guess.
194
+ Do not patch blindly.
195
+ Do not keep going after a broken command.