somesh-j-framework 0.1.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.
Files changed (23) hide show
  1. somesh_j_framework-0.1.0/.gitignore +5 -0
  2. somesh_j_framework-0.1.0/LICENSE +21 -0
  3. somesh_j_framework-0.1.0/PKG-INFO +232 -0
  4. somesh_j_framework-0.1.0/README.md +213 -0
  5. somesh_j_framework-0.1.0/pyproject.toml +39 -0
  6. somesh_j_framework-0.1.0/src/somesh_j_framework/__init__.py +5 -0
  7. somesh_j_framework-0.1.0/src/somesh_j_framework/__main__.py +6 -0
  8. somesh_j_framework-0.1.0/src/somesh_j_framework/cli.py +129 -0
  9. somesh_j_framework-0.1.0/src/somesh_j_framework/doctor.py +127 -0
  10. somesh_j_framework-0.1.0/src/somesh_j_framework/install.py +169 -0
  11. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/SKILL.md +241 -0
  12. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/architect.md +109 -0
  13. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/audit.md +104 -0
  14. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/capabilities.md +110 -0
  15. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/debugging.md +92 -0
  16. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/delivery.md +78 -0
  17. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/flow.md +89 -0
  18. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/frontend.md +83 -0
  19. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/lenses.md +46 -0
  20. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/product.md +82 -0
  21. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/qa.md +60 -0
  22. somesh_j_framework-0.1.0/src/somesh_j_framework/skill/somesh-j-framework/references/security.md +80 -0
  23. somesh_j_framework-0.1.0/src/somesh_j_framework/targets.py +73 -0
@@ -0,0 +1,5 @@
1
+ dist/
2
+ build/
3
+ *.egg-info/
4
+ __pycache__/
5
+ .venv/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Somesh J
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,232 @@
1
+ Metadata-Version: 2.5
2
+ Name: somesh-j-framework
3
+ Version: 0.1.0
4
+ Summary: An end-to-end software engineering skill for AI coding agents, with an installer for Claude Code, Codex, Antigravity, Cursor, or a single pasteable prompt.
5
+ Project-URL: Repository, https://github.com/Somesh-J/Somesh-J-FrameWork
6
+ Project-URL: Issues, https://github.com/Somesh-J/Somesh-J-FrameWork/issues
7
+ Project-URL: LinkedIn, https://www.linkedin.com/in/somesh-j/
8
+ Author-email: Somesh J <someshj777@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: agents,ai,claude-code,codex,cursor,skills,software-engineering
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Software Development
17
+ Requires-Python: >=3.9
18
+ Description-Content-Type: text/markdown
19
+
20
+ # Somesh J Framework
21
+
22
+ One engineering skill for AI coding agents. It takes a new idea or an
23
+ existing repository through discovery, specification, design, build,
24
+ security review, testing, deployment and operation, and it reports proof
25
+ instead of claims.
26
+
27
+ It is a set of instructions plus a small installer. It does not run code on
28
+ its own, call any network service, or install tools for you.
29
+
30
+ ## Install
31
+
32
+ ```bash
33
+ pip install somesh-j-framework
34
+ ```
35
+
36
+ Python 3.9 or newer. No dependencies.
37
+
38
+ ## Quick start
39
+
40
+ In your project folder:
41
+
42
+ ```bash
43
+ pip install somesh-j-framework
44
+ somesh start
45
+ ```
46
+
47
+ Then open your AI coding tool in that folder and say:
48
+
49
+ ```text
50
+ somesh framework start
51
+ ```
52
+
53
+ followed by what you want to build, fix, review or have explained. That is
54
+ all.
55
+
56
+ `somesh start` copies the skill into `.claude/skills/` (Claude Code) and
57
+ `.agents/skills/` (Codex, Antigravity), and into `.cursor/skills/` if the
58
+ project has a `.cursor` folder. It never overwrites files you have edited.
59
+
60
+ Things to ask for once it is set up:
61
+
62
+ | Say | You get |
63
+ |---|---|
64
+ | "somesh framework start: build <idea>" | Interview, spec, design, build, tests, deploy plan |
65
+ | "somesh framework start: fix <bug>" | Root cause, fix and proof |
66
+ | "somesh framework start: audit this repo" | Verified and broken flows, and a launch verdict |
67
+ | "somesh framework start: explain this application" | A written explanation and one HTML page of every flow, in `.somesh/flows/` |
68
+
69
+ ## For AI agents: set it up yourself
70
+
71
+ If you are an AI coding agent and the user asked you to set up or use this
72
+ framework, run these yourself from the repository root. Do not ask the user
73
+ to run them.
74
+
75
+ ```bash
76
+ pip install somesh-j-framework
77
+ somesh start
78
+ ```
79
+
80
+ Use the project's virtual environment if it has one. Then:
81
+
82
+ 1. Read the `SKILL.md` in the folder the command printed and follow it.
83
+ 2. Tell the user in one line what was installed and where.
84
+
85
+ If your tool reads none of those folders, or you cannot tell, run
86
+ `somesh install --target prompt --project .` instead, read the file it
87
+ writes, and follow it for the rest of the session.
88
+
89
+ Rules for agents:
90
+
91
+ - If a command stops because existing files have local edits, do not add
92
+ `--force` on your own. Tell the user and ask.
93
+ - Install into the user folder (`somesh install --target <tool>` with no
94
+ `--project`) only if the user asks for the skill in all their projects.
95
+ - `somesh doctor` is safe to run at any time; it only reads. Do not install
96
+ any tool it lists as missing unless the user approves.
97
+
98
+ ## Other commands
99
+
100
+ Install the skill for one tool, for all your projects:
101
+
102
+ ```bash
103
+ somesh install --target claude
104
+ ```
105
+
106
+ Install it into one repository instead:
107
+
108
+ ```bash
109
+ somesh install --target claude --project /path/to/repo
110
+ somesh install --target codex --project # the current folder
111
+ ```
112
+
113
+ See what would be written without writing anything:
114
+
115
+ ```bash
116
+ somesh install --target cursor --project . --dry-run
117
+ ```
118
+
119
+ Export one markdown file to paste into any chat tool:
120
+
121
+ ```bash
122
+ somesh install --target prompt --dest ./framework-prompt.md
123
+ ```
124
+
125
+ Check which recommended CLIs and MCP servers you already have. This only
126
+ reads; it installs nothing and prints no values from your config files:
127
+
128
+ ```bash
129
+ somesh doctor
130
+ ```
131
+
132
+ ### Options
133
+
134
+ | Option | Meaning |
135
+ |---|---|
136
+ | `--target` | `claude`, `codex`, `antigravity`, `cursor` or `prompt` |
137
+ | `--project [PATH]` | Install into that repository. Without it, the skill goes to your user folder |
138
+ | `--dest PATH` | Install into this skills folder instead of the tool's default. For `prompt`, the output file or folder |
139
+ | `--dry-run` | List every file and its state; write nothing |
140
+ | `--force` | Overwrite installed files you have edited. Without it, the install stops and writes nothing |
141
+
142
+ ### Where each target installs
143
+
144
+ Checked against each tool's documentation on 27 Nov 2026.
145
+
146
+ | Target | With `--project` | Without (user folder) | Status |
147
+ |---|---|---|---|
148
+ | claude | `.claude/skills/` | `~/.claude/skills/` | Confirmed |
149
+ | codex | `.agents/skills/` | `~/.agents/skills/` | Confirmed; one official page still shows `.codex/skills` |
150
+ | antigravity | `.agents/skills/` | `~/.gemini/config/skills/` | Project confirmed; user folder **unverified** (doc pages differ) |
151
+ | cursor | `.cursor/skills/` | `~/.cursor/skills/` | Project confirmed; user folder **unverified** |
152
+ | prompt | `<project>/somesh-j-framework-prompt.md` | current folder | n/a |
153
+
154
+ If your tool reads a different folder, pass it with `--dest`.
155
+
156
+ ## What gets installed
157
+
158
+ ```text
159
+ somesh-j-framework/
160
+ ├── SKILL.md the workflow and router
161
+ └── references/
162
+ ├── product.md idea pressure test, interview, acceptance criteria
163
+ ├── architect.md design, data, APIs, performance, AI and agent systems
164
+ ├── security.md threat model, secure defaults, pre-push review
165
+ ├── qa.md what to test and what to run
166
+ ├── delivery.md CI/CD, cloud deployment, release, observability
167
+ ├── audit.md does an existing codebase do what it claims
168
+ ├── frontend.md interface design, accessibility, browser check
169
+ ├── debugging.md root cause and end-to-end flow tracing
170
+ ├── flow.md explain a whole application: document plus HTML page
171
+ ├── lenses.md privacy, cost, stakeholders, non-web software
172
+ └── capabilities.md catalog of free tools, MCP servers and skills
173
+ ```
174
+
175
+ The agent reads `SKILL.md` and opens a reference file only when that role is
176
+ needed.
177
+
178
+ ## How it works
179
+
180
+ Every task is sized first:
181
+
182
+ - **T0 trivial:** change it, run one check, report.
183
+ - **T1 standard:** short criteria, plan, implement, verify, report.
184
+ - **T2 significant** (new project, data model, auth, payments,
185
+ infrastructure): all steps, with your approval before build and before any
186
+ production action.
187
+
188
+ Two entry points use the same steps. For an existing repository the agent
189
+ surveys, audits what the task touches, then fixes or extends. For a new idea
190
+ it interviews you, researches, specifies, designs, builds and ships.
191
+
192
+ Rules it keeps:
193
+
194
+ - Tests are written after implementation, once, before push. Only tests
195
+ related to the change run locally; the full suite is left to CI.
196
+ - Security work happens during design, build and pre-push review.
197
+ - Nothing destructive or in production happens without your approval.
198
+ - Results are shown as a command and its output, or marked NOT VERIFIED.
199
+
200
+ The agent keeps its working notes in a `.somesh/` folder in your repository.
201
+
202
+ ## Limits
203
+
204
+ - This package has been tested to install correctly. Whether it makes an
205
+ agent produce better software has not been measured yet.
206
+ - Following the security practices in it is not certification against any
207
+ standard.
208
+ - The tools catalog and install paths go stale. Each has a date checked.
209
+
210
+ ## Develop
211
+
212
+ ```bash
213
+ pip install -e .
214
+ python -m unittest discover -s tests -v
215
+ ```
216
+
217
+ The skill text lives in `src/somesh_j_framework/skill/somesh-j-framework/`.
218
+ It is the only copy; every install target is generated from it.
219
+
220
+ ## Build and publish
221
+
222
+ ```bash
223
+ python -m pip install build twine
224
+ python -m build
225
+ python -m twine check dist/*
226
+ python -m twine upload --repository testpypi dist/* # try TestPyPI first
227
+ python -m twine upload dist/*
228
+ ```
229
+
230
+ ## License
231
+
232
+ MIT. See `LICENSE`.
@@ -0,0 +1,213 @@
1
+ # Somesh J Framework
2
+
3
+ One engineering skill for AI coding agents. It takes a new idea or an
4
+ existing repository through discovery, specification, design, build,
5
+ security review, testing, deployment and operation, and it reports proof
6
+ instead of claims.
7
+
8
+ It is a set of instructions plus a small installer. It does not run code on
9
+ its own, call any network service, or install tools for you.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install somesh-j-framework
15
+ ```
16
+
17
+ Python 3.9 or newer. No dependencies.
18
+
19
+ ## Quick start
20
+
21
+ In your project folder:
22
+
23
+ ```bash
24
+ pip install somesh-j-framework
25
+ somesh start
26
+ ```
27
+
28
+ Then open your AI coding tool in that folder and say:
29
+
30
+ ```text
31
+ somesh framework start
32
+ ```
33
+
34
+ followed by what you want to build, fix, review or have explained. That is
35
+ all.
36
+
37
+ `somesh start` copies the skill into `.claude/skills/` (Claude Code) and
38
+ `.agents/skills/` (Codex, Antigravity), and into `.cursor/skills/` if the
39
+ project has a `.cursor` folder. It never overwrites files you have edited.
40
+
41
+ Things to ask for once it is set up:
42
+
43
+ | Say | You get |
44
+ |---|---|
45
+ | "somesh framework start: build <idea>" | Interview, spec, design, build, tests, deploy plan |
46
+ | "somesh framework start: fix <bug>" | Root cause, fix and proof |
47
+ | "somesh framework start: audit this repo" | Verified and broken flows, and a launch verdict |
48
+ | "somesh framework start: explain this application" | A written explanation and one HTML page of every flow, in `.somesh/flows/` |
49
+
50
+ ## For AI agents: set it up yourself
51
+
52
+ If you are an AI coding agent and the user asked you to set up or use this
53
+ framework, run these yourself from the repository root. Do not ask the user
54
+ to run them.
55
+
56
+ ```bash
57
+ pip install somesh-j-framework
58
+ somesh start
59
+ ```
60
+
61
+ Use the project's virtual environment if it has one. Then:
62
+
63
+ 1. Read the `SKILL.md` in the folder the command printed and follow it.
64
+ 2. Tell the user in one line what was installed and where.
65
+
66
+ If your tool reads none of those folders, or you cannot tell, run
67
+ `somesh install --target prompt --project .` instead, read the file it
68
+ writes, and follow it for the rest of the session.
69
+
70
+ Rules for agents:
71
+
72
+ - If a command stops because existing files have local edits, do not add
73
+ `--force` on your own. Tell the user and ask.
74
+ - Install into the user folder (`somesh install --target <tool>` with no
75
+ `--project`) only if the user asks for the skill in all their projects.
76
+ - `somesh doctor` is safe to run at any time; it only reads. Do not install
77
+ any tool it lists as missing unless the user approves.
78
+
79
+ ## Other commands
80
+
81
+ Install the skill for one tool, for all your projects:
82
+
83
+ ```bash
84
+ somesh install --target claude
85
+ ```
86
+
87
+ Install it into one repository instead:
88
+
89
+ ```bash
90
+ somesh install --target claude --project /path/to/repo
91
+ somesh install --target codex --project # the current folder
92
+ ```
93
+
94
+ See what would be written without writing anything:
95
+
96
+ ```bash
97
+ somesh install --target cursor --project . --dry-run
98
+ ```
99
+
100
+ Export one markdown file to paste into any chat tool:
101
+
102
+ ```bash
103
+ somesh install --target prompt --dest ./framework-prompt.md
104
+ ```
105
+
106
+ Check which recommended CLIs and MCP servers you already have. This only
107
+ reads; it installs nothing and prints no values from your config files:
108
+
109
+ ```bash
110
+ somesh doctor
111
+ ```
112
+
113
+ ### Options
114
+
115
+ | Option | Meaning |
116
+ |---|---|
117
+ | `--target` | `claude`, `codex`, `antigravity`, `cursor` or `prompt` |
118
+ | `--project [PATH]` | Install into that repository. Without it, the skill goes to your user folder |
119
+ | `--dest PATH` | Install into this skills folder instead of the tool's default. For `prompt`, the output file or folder |
120
+ | `--dry-run` | List every file and its state; write nothing |
121
+ | `--force` | Overwrite installed files you have edited. Without it, the install stops and writes nothing |
122
+
123
+ ### Where each target installs
124
+
125
+ Checked against each tool's documentation on 27 Nov 2026.
126
+
127
+ | Target | With `--project` | Without (user folder) | Status |
128
+ |---|---|---|---|
129
+ | claude | `.claude/skills/` | `~/.claude/skills/` | Confirmed |
130
+ | codex | `.agents/skills/` | `~/.agents/skills/` | Confirmed; one official page still shows `.codex/skills` |
131
+ | antigravity | `.agents/skills/` | `~/.gemini/config/skills/` | Project confirmed; user folder **unverified** (doc pages differ) |
132
+ | cursor | `.cursor/skills/` | `~/.cursor/skills/` | Project confirmed; user folder **unverified** |
133
+ | prompt | `<project>/somesh-j-framework-prompt.md` | current folder | n/a |
134
+
135
+ If your tool reads a different folder, pass it with `--dest`.
136
+
137
+ ## What gets installed
138
+
139
+ ```text
140
+ somesh-j-framework/
141
+ ├── SKILL.md the workflow and router
142
+ └── references/
143
+ ├── product.md idea pressure test, interview, acceptance criteria
144
+ ├── architect.md design, data, APIs, performance, AI and agent systems
145
+ ├── security.md threat model, secure defaults, pre-push review
146
+ ├── qa.md what to test and what to run
147
+ ├── delivery.md CI/CD, cloud deployment, release, observability
148
+ ├── audit.md does an existing codebase do what it claims
149
+ ├── frontend.md interface design, accessibility, browser check
150
+ ├── debugging.md root cause and end-to-end flow tracing
151
+ ├── flow.md explain a whole application: document plus HTML page
152
+ ├── lenses.md privacy, cost, stakeholders, non-web software
153
+ └── capabilities.md catalog of free tools, MCP servers and skills
154
+ ```
155
+
156
+ The agent reads `SKILL.md` and opens a reference file only when that role is
157
+ needed.
158
+
159
+ ## How it works
160
+
161
+ Every task is sized first:
162
+
163
+ - **T0 trivial:** change it, run one check, report.
164
+ - **T1 standard:** short criteria, plan, implement, verify, report.
165
+ - **T2 significant** (new project, data model, auth, payments,
166
+ infrastructure): all steps, with your approval before build and before any
167
+ production action.
168
+
169
+ Two entry points use the same steps. For an existing repository the agent
170
+ surveys, audits what the task touches, then fixes or extends. For a new idea
171
+ it interviews you, researches, specifies, designs, builds and ships.
172
+
173
+ Rules it keeps:
174
+
175
+ - Tests are written after implementation, once, before push. Only tests
176
+ related to the change run locally; the full suite is left to CI.
177
+ - Security work happens during design, build and pre-push review.
178
+ - Nothing destructive or in production happens without your approval.
179
+ - Results are shown as a command and its output, or marked NOT VERIFIED.
180
+
181
+ The agent keeps its working notes in a `.somesh/` folder in your repository.
182
+
183
+ ## Limits
184
+
185
+ - This package has been tested to install correctly. Whether it makes an
186
+ agent produce better software has not been measured yet.
187
+ - Following the security practices in it is not certification against any
188
+ standard.
189
+ - The tools catalog and install paths go stale. Each has a date checked.
190
+
191
+ ## Develop
192
+
193
+ ```bash
194
+ pip install -e .
195
+ python -m unittest discover -s tests -v
196
+ ```
197
+
198
+ The skill text lives in `src/somesh_j_framework/skill/somesh-j-framework/`.
199
+ It is the only copy; every install target is generated from it.
200
+
201
+ ## Build and publish
202
+
203
+ ```bash
204
+ python -m pip install build twine
205
+ python -m build
206
+ python -m twine check dist/*
207
+ python -m twine upload --repository testpypi dist/* # try TestPyPI first
208
+ python -m twine upload dist/*
209
+ ```
210
+
211
+ ## License
212
+
213
+ MIT. See `LICENSE`.
@@ -0,0 +1,39 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "somesh-j-framework"
7
+ dynamic = ["version"]
8
+ description = "An end-to-end software engineering skill for AI coding agents, with an installer for Claude Code, Codex, Antigravity, Cursor, or a single pasteable prompt."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Somesh J", email = "someshj777@gmail.com" }]
14
+ keywords = ["ai", "agents", "skills", "claude-code", "codex", "cursor", "software-engineering"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Software Development",
21
+ ]
22
+ dependencies = []
23
+
24
+ [project.urls]
25
+ Repository = "https://github.com/Somesh-J/Somesh-J-FrameWork"
26
+ Issues = "https://github.com/Somesh-J/Somesh-J-FrameWork/issues"
27
+ LinkedIn = "https://www.linkedin.com/in/somesh-j/"
28
+
29
+ [project.scripts]
30
+ somesh = "somesh_j_framework.cli:main"
31
+
32
+ [tool.hatch.version]
33
+ path = "src/somesh_j_framework/__init__.py"
34
+
35
+ [tool.hatch.build.targets.wheel]
36
+ packages = ["src/somesh_j_framework"]
37
+
38
+ [tool.hatch.build.targets.sdist]
39
+ include = ["src", "README.md", "LICENSE"]
@@ -0,0 +1,5 @@
1
+ """Somesh J Framework: an engineering skill for AI coding agents, plus its installer."""
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ SKILL_NAME = "somesh-j-framework"
@@ -0,0 +1,6 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ if __name__ == "__main__":
6
+ sys.exit(main())
@@ -0,0 +1,129 @@
1
+ """Command line entry point: `somesh install` and `somesh doctor`."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ from . import __version__, doctor, install
10
+ from .targets import ALL_TARGET_NAMES, PROMPT_TARGET
11
+
12
+ START_PHRASE = "somesh framework start"
13
+
14
+
15
+ def _parser() -> argparse.ArgumentParser:
16
+ p = argparse.ArgumentParser(
17
+ prog="somesh",
18
+ description="Install the Somesh J Framework skill into an AI coding tool.",
19
+ )
20
+ p.add_argument("--version", action="version", version=f"somesh-j-framework {__version__}")
21
+ sub = p.add_subparsers(dest="command", required=True)
22
+
23
+ i = sub.add_parser("install", help="copy the skill into a tool, or export one prompt file")
24
+ i.add_argument("--target", required=True, choices=ALL_TARGET_NAMES)
25
+ i.add_argument(
26
+ "--project",
27
+ nargs="?",
28
+ const=".",
29
+ default=None,
30
+ metavar="PATH",
31
+ help="install into this repository (default: current folder) instead of your user folder",
32
+ )
33
+ i.add_argument(
34
+ "--dest",
35
+ metavar="PATH",
36
+ help="skills folder to install into, overriding the tool's default; "
37
+ "for --target prompt, the output file or folder",
38
+ )
39
+ i.add_argument("--dry-run", action="store_true", help="show what would be written; write nothing")
40
+ i.add_argument("--force", action="store_true", help="overwrite existing files that differ")
41
+
42
+ s = sub.add_parser(
43
+ "start",
44
+ help="set the framework up in this repository for every supported tool, in one step",
45
+ )
46
+ s.add_argument("--project", default=".", metavar="PATH", help="repository to set up (default: current folder)")
47
+ s.add_argument("--dry-run", action="store_true", help="show what would be written; write nothing")
48
+
49
+ d = sub.add_parser("doctor", help="list recommended CLIs and MCP servers that are present")
50
+ d.add_argument("--project", default=".", metavar="PATH", help="repository to check (default: current folder)")
51
+ return p
52
+
53
+
54
+ def _install(args) -> int:
55
+ plan = install.plan(args.target, dest=args.dest, project=args.project)
56
+ for w in plan.warnings:
57
+ print(f"note: {w}")
58
+ counts = {"new": 0, "unchanged": 0, "differs": 0}
59
+ for f in plan.files:
60
+ counts[f.state] += 1
61
+ what = "prompt file" if args.target == PROMPT_TARGET else "skill folder"
62
+ print(f"{what}: {plan.root}")
63
+ print(f"files: {counts['new']} new, {counts['unchanged']} unchanged, {counts['differs']} differ")
64
+ if args.dry_run:
65
+ for f in plan.files:
66
+ print(f" [{f.state}] {f.path}")
67
+ print("dry run: nothing was written")
68
+ return 0
69
+ written = install.apply(plan, force=args.force)
70
+ print(f"wrote {written} file(s)")
71
+ return 0
72
+
73
+
74
+ def start_targets(project: Path) -> list[str]:
75
+ """Targets `start` installs for.
76
+
77
+ .claude/skills is read by Claude Code, and .agents/skills by Codex and
78
+ Antigravity. .cursor/skills is added only when the repository already has
79
+ a .cursor folder.
80
+ """
81
+ targets = ["claude", "codex"]
82
+ if (project / ".cursor").is_dir():
83
+ targets.append("cursor")
84
+ return targets
85
+
86
+
87
+ def _start(args) -> int:
88
+ project = Path(args.project)
89
+ plans = [install.plan(t, project=str(project)) for t in start_targets(project)]
90
+ # Check every plan before writing any of them.
91
+ conflicts = [f for p in plans for f in p.conflicts]
92
+ if conflicts and not args.dry_run:
93
+ raise install.InstallError(
94
+ f"{len(conflicts)} installed file(s) have local edits (first: {conflicts[0].path}). "
95
+ "Nothing was written. Use `somesh install --target <tool> --project . --force` to replace them."
96
+ )
97
+ for p in plans:
98
+ if args.dry_run:
99
+ pending = sum(f.state != "unchanged" for f in p.files)
100
+ print(f"{p.root}: would write {pending} file(s)")
101
+ else:
102
+ print(f"{p.root}: wrote {install.apply(p)} file(s)")
103
+ if args.dry_run:
104
+ print("dry run: nothing was written")
105
+ return 0
106
+ print()
107
+ print("Ready. Open your AI coding tool in this repository and say:")
108
+ print(f" {START_PHRASE}")
109
+ print("followed by what you want to build, fix, review or have explained.")
110
+ return 0
111
+
112
+
113
+ def main(argv: list[str] | None = None) -> int:
114
+ args = _parser().parse_args(argv)
115
+ try:
116
+ if args.command == "install":
117
+ return _install(args)
118
+ if args.command == "start":
119
+ return _start(args)
120
+ result = doctor.check(Path(args.project).resolve(), Path.home())
121
+ print(doctor.render(result))
122
+ return 0
123
+ except install.InstallError as e:
124
+ print(f"error: {e}", file=sys.stderr)
125
+ return 1
126
+
127
+
128
+ if __name__ == "__main__":
129
+ sys.exit(main())