praxis-bob 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 (28) hide show
  1. praxis_bob-0.1.0/LICENSE +21 -0
  2. praxis_bob-0.1.0/PKG-INFO +331 -0
  3. praxis_bob-0.1.0/README.md +305 -0
  4. praxis_bob-0.1.0/praxis/__init__.py +10 -0
  5. praxis_bob-0.1.0/praxis/__main__.py +12 -0
  6. praxis_bob-0.1.0/praxis/cli.py +429 -0
  7. praxis_bob-0.1.0/praxis/detect.py +272 -0
  8. praxis_bob-0.1.0/praxis/generate.py +585 -0
  9. praxis_bob-0.1.0/praxis/inference_prompts.py +289 -0
  10. praxis_bob-0.1.0/praxis/methodology.py +171 -0
  11. praxis_bob-0.1.0/praxis/templates/bob/AGENTS.md.template +58 -0
  12. praxis_bob-0.1.0/praxis/templates/bob/PRAXIS_CONTRACT.md.template +101 -0
  13. praxis_bob-0.1.0/praxis/templates/bob/bobignore.template +33 -0
  14. praxis_bob-0.1.0/praxis/templates/bob/custom_modes.yaml.template +76 -0
  15. praxis_bob-0.1.0/praxis/templates/bob/methodology_skill.md.template +67 -0
  16. praxis_bob-0.1.0/praxis/templates/bob/python_skill.md.template +130 -0
  17. praxis_bob-0.1.0/praxis/templates/claude_code/CLAUDE.md.template +47 -0
  18. praxis_bob-0.1.0/praxis/templates/cursor/methodology.mdc.template +47 -0
  19. praxis_bob-0.1.0/praxis/templates/cursor/python.mdc.template +26 -0
  20. praxis_bob-0.1.0/praxis_bob.egg-info/PKG-INFO +331 -0
  21. praxis_bob-0.1.0/praxis_bob.egg-info/SOURCES.txt +26 -0
  22. praxis_bob-0.1.0/praxis_bob.egg-info/dependency_links.txt +1 -0
  23. praxis_bob-0.1.0/praxis_bob.egg-info/entry_points.txt +2 -0
  24. praxis_bob-0.1.0/praxis_bob.egg-info/requires.txt +3 -0
  25. praxis_bob-0.1.0/praxis_bob.egg-info/top_level.txt +1 -0
  26. praxis_bob-0.1.0/pyproject.toml +49 -0
  27. praxis_bob-0.1.0/setup.cfg +4 -0
  28. praxis_bob-0.1.0/tests/test_two_phase_smoke.py +425 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mathew Carballo López
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,331 @@
1
+ Metadata-Version: 2.4
2
+ Name: praxis-bob
3
+ Version: 0.1.0
4
+ Summary: Methodology transfer tool for IBM Bob IDE, Claude Code, and Cursor.
5
+ Author: Mathew Carballo López
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/ContraInfinito/bob-praxis
8
+ Project-URL: Repository, https://github.com/ContraInfinito/bob-praxis
9
+ Project-URL: Issues, https://github.com/ContraInfinito/bob-praxis/issues
10
+ Keywords: bob-ide,claude-code,cursor,ai-development,methodology,code-conventions
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Code Generators
19
+ Classifier: Operating System :: OS Independent
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Provides-Extra: dev
24
+ Requires-Dist: pyyaml>=6.0; extra == "dev"
25
+ Dynamic: license-file
26
+
27
+ # Praxis
28
+
29
+ **Every time you switch AI coding assistants, you re-teach it your conventions. Praxis stops that.**
30
+
31
+ Praxis is a methodology transfer tool. It takes how you want an AI partner to work — the principles, the conventions, the moments when you want it to stop and ask — and projects them onto any project as configuration files that three different AI agents understand: **Bob IDE**, **Claude Code**, and **Cursor**.
32
+
33
+ Same methodology. Three idiomatic outputs. Loadable on day one without any manual import step.
34
+
35
+ The name *Praxis* is Greek for "the practical application of theory." It turns methodology theory (how I want to work with AI) into concrete configuration (rules, contracts, conventions) applied to a specific project.
36
+
37
+ ---
38
+
39
+ ## What Praxis Does
40
+
41
+ Given either an existing codebase or a planning document, Praxis generates the configuration files each agent expects, in the format that agent expects, in the location that agent automatically loads.
42
+
43
+ ### For Bob IDE
44
+
45
+ A loadable project-scoped Bob mode plus supporting documentation:
46
+
47
+ - `.bob/custom_modes.yaml` — auto-discovered by Bob when the project is opened. The mode encodes the methodology, the trigger keywords, and the session-start checklist.
48
+ - `praxis_output/AGENTS.md` — project context, the seven methodology principles, and an "Open Questions for the Developer" section when generated from a planning document.
49
+ - `praxis_output/PRAXIS_CONTRACT.md` — the methodology contract in full form, including the strict-mode rider on Principle 1.
50
+ - `praxis_output/python_skill.md` — stack-specific conventions (Flask, FastAPI, Django, pytest, pandas/numpy patterns).
51
+ - `praxis_output/methodology_skill.md` — the seven principles as an enforcement guide.
52
+ - `praxis_output/.bobignore` — files Bob should never read or modify.
53
+
54
+ ### For Claude Code
55
+
56
+ A single `CLAUDE.md` at the project root. Auto-loaded by Claude Code on session start. Contains the seven principles, the trigger-keyword section, project conventions, and the "Open Questions" list when generated from a planning document.
57
+
58
+ ### For Cursor
59
+
60
+ Two `.mdc` files under `.cursor/rules/`. Auto-discovered when the project is opened in Cursor:
61
+
62
+ - `methodology.mdc` — project context and methodology principles, applied project-wide (`alwaysApply: true`).
63
+ - `python.mdc` — Python-language conventions, attached when editing `.py` files (`globs: "**/*.py"`).
64
+
65
+ ### Target selection
66
+
67
+ The default target is Bob. To select a different target, the user includes a phrase in their natural-language invocation:
68
+
69
+ - `Apply Praxis to ./my-project` → Bob (default)
70
+ - `Apply Praxis to ./my-project for Claude Code` → Claude Code
71
+ - `Apply Praxis to ./my-project as CLAUDE.md` → Claude Code (alternative phrasing)
72
+ - `Apply Praxis to ./my-project for Cursor` → Cursor
73
+ - `Apply Praxis to ./my-project target Cursor` → Cursor (alternative phrasing)
74
+
75
+ The chosen target is announced in the first line of the response so the developer can catch a misinterpretation before any file is written.
76
+
77
+ ---
78
+
79
+ ## The Seven Methodology Principles
80
+
81
+ Praxis ships with seven hardcoded methodology defaults. Developers can override them by editing the generated configuration files.
82
+
83
+ 1. **Prompt-first execution** — Rewrite vague user input into structured prompts before acting. *Strict mode (triggered by the keywords `design` or `scope`):* produce a six-field structured prompt and wait for explicit approval before any action, even if the request seems clear.
84
+ 2. **Proactive issue resolution** — Fix adjacent issues you spot; log what was done.
85
+ 3. **Code review by a second agent** — Every change critiqued before presentation.
86
+ 4. **Logging discipline** — Every session produces a timestamped changelog entry.
87
+ 5. **Definitional rigor** — Define every technical term before using it.
88
+ 6. **Simplicity bias** — Simplest solution that fully solves the problem.
89
+ 7. **Security baseline** — Never plaintext credentials; scan for secrets; honor `.bobignore`.
90
+
91
+ ### Trigger keywords
92
+
93
+ When a user's message contains the keyword `design` or `scope` (case-insensitive, anywhere in the message), the agent enters strict prompt-first mode and produces a six-field structured prompt before any action:
94
+
95
+ 1. **Restated request** — bullet-point reformulation of what the agent thinks the user wants
96
+ 2. **Assumptions** — every assumption the agent would make if it proceeded as-is
97
+ 3. **Scope IN** — what is included in the work
98
+ 4. **Scope OUT** — what is deliberately excluded
99
+ 5. **Proposed approach** — one or two sentences summarizing the implementation strategy
100
+ 6. **Open questions** — anything the agent needs clarified before starting
101
+
102
+ The agent then waits for the developer to approve, edit, or reject the structured prompt. No code changes, file writes, or commands execute until approval.
103
+
104
+ This trigger surfaces redundantly across each agent's config: a dedicated top-of-file `Trigger Keywords` section AND a strict-mode rider embedded inside Principle 1's full description. Even if an agent skims past one, the other catches the trigger.
105
+
106
+ ---
107
+
108
+ ## Plan mode: surface what the planning doc didn't say
109
+
110
+ When given a planning document (`.md`, `.markdown`, or `.txt`) instead of an existing codebase, Praxis runs in **plan mode**. Plan mode generates the same per-target configuration, plus a list of clarifying questions about gaps in the planning document.
111
+
112
+ The questions land in two places:
113
+
114
+ - In the agent's chat response immediately, so the developer can answer them in conversation.
115
+ - Verbatim in the generated configuration's "Open Questions for the Developer" section, so future sessions (or future agents loading the project) see them too.
116
+
117
+ This is the architectural enforcement of Principle 1: the methodology doesn't trust the agent to remember to ask. It bakes the asking into the project's documentation.
118
+
119
+ ---
120
+
121
+ ## Two-phase handshake architecture
122
+
123
+ Praxis is a CLI that runs in two phases. The host agent (Bob, or any compatible orchestrator) bridges them.
124
+
125
+ **Phase 1: `praxis context-prompt <mode> <path> --target <target>`**
126
+
127
+ - Reads project files (analyze mode) or the planning document (plan mode).
128
+ - Detects stack and frameworks deterministically (no LLM call here).
129
+ - Builds a natural-language prompt for the host agent to answer.
130
+ - Emits JSON to stdout containing `prompt_for_bob`, `partial_context` (deterministic fields), and `meta`.
131
+
132
+ **Phase 2: `praxis generate --context-file <path> --output-root <dir>`**
133
+
134
+ - Reads the host agent's JSON answer plus the Phase 1 context from a file.
135
+ - Validates the schema.
136
+ - Renders the per-target templates.
137
+ - Writes files to the appropriate per-target locations.
138
+ - Prints generated file paths to stdout.
139
+
140
+ The `--context-file` flag avoids shell-quoting fragility on Windows (em-dashes, embedded quotes, newlines in JSON content all survive cleanly). An inline `--context '<json>'` flag is also accepted for trivially small payloads.
141
+
142
+ Both phases print machine-parseable output to stdout and human-readable status to stderr — clean for piping, clean for orchestration.
143
+
144
+ ---
145
+
146
+ ## Installation
147
+
148
+ ### Prerequisites
149
+
150
+ - Python 3.11 or higher
151
+ - Bob IDE (for the Bob-orchestrated workflow), Claude Code (to consume Claude Code targets), or Cursor (to consume Cursor targets)
152
+
153
+ **No external API credentials are required.** Praxis has zero runtime dependencies as of v0.1.0. The host agent supplies the inference; Praxis only writes files.
154
+
155
+ ### Setup
156
+
157
+ 1. **Clone the repository**:
158
+ ```bash
159
+ git clone https://github.com/ContraInfinito/bob-praxis.git
160
+ cd bob-praxis
161
+ ```
162
+
163
+ 2. **(Optional) Create and activate a virtual environment**. Praxis itself doesn't need any pip-installed dependencies, so this is only necessary if you plan to run the smoke tests (which need `pyyaml`):
164
+ ```bash
165
+ python -m venv venv
166
+
167
+ # On Windows:
168
+ venv\Scripts\activate
169
+
170
+ # On macOS/Linux:
171
+ source venv/bin/activate
172
+
173
+ pip install -r requirements.txt
174
+ ```
175
+
176
+ 3. **Run the smoke test** to verify the install:
177
+ ```bash
178
+ python tests/test_two_phase_smoke.py
179
+ ```
180
+ Expected: all 7 paths and 2 mutex checks pass.
181
+
182
+ ---
183
+
184
+ ## Usage
185
+
186
+ ### As a Bob custom mode (recommended)
187
+
188
+ Praxis ships as a project-scoped Bob mode in `.bob/custom_modes.yaml`. When you open this repository in Bob IDE, the **🛠️ Praxis** mode automatically appears in the mode list — no manual import needed.
189
+
190
+ 1. Open this repository in Bob IDE.
191
+ 2. Select **🛠️ Praxis** from Bob's mode selector.
192
+ 3. Invoke with natural language:
193
+ - **Apply to an existing codebase**: `Apply Praxis to ./tests/sample_python_project`
194
+ - **Apply with a non-default target**: `Apply Praxis to ./tests/sample_python_project for Claude Code`
195
+ - **Bootstrap from a planning document**: `Apply Praxis to ./tests/sample_planning_doc.md`
196
+
197
+ The Bob mode handles both phases of the CLI handshake transparently. It runs Phase 1, generates the inference internally, and invokes Phase 2 with `--context-file` (file-based handoff, safe across Windows/POSIX shells).
198
+
199
+ For planning-document input, Bob will surface any clarifying questions Praxis generated and wait for the developer to answer them before treating the configuration as final.
200
+
201
+ ### As a standalone CLI
202
+
203
+ You can also drive Praxis directly without Bob, as long as you supply the inference yourself:
204
+
205
+ ```bash
206
+ # Phase 1: read files, emit a prompt for the host agent
207
+ python -m praxis context-prompt analyze ./my-project --target bob > phase1.json
208
+
209
+ # Build a Phase 2 context blob: combine partial_context (from phase1.json),
210
+ # your bob_inference answer (the host agent's response), and meta into one JSON file.
211
+ # Write the combined blob to phase2.json.
212
+
213
+ # Phase 2: consume the combined blob, write output files
214
+ python -m praxis generate --context-file phase2.json --output-root ./my-project
215
+ ```
216
+
217
+ The smoke test (`tests/test_two_phase_smoke.py`) is a working example of the standalone flow with a synthetic host-agent answer.
218
+
219
+ ### As a global Bob meta-mode (apply to other projects on your machine)
220
+
221
+ To use Praxis on projects other than this repository:
222
+
223
+ 1. Open Bob's Settings → Modes tab.
224
+ 2. Click "Create new mode" (or equivalent).
225
+ 3. Paste the YAML fields (`slug`, `name`, `roleDefinition`, `whenToUse`, `groups`, `customInstructions`) from this repo's `.bob/custom_modes.yaml` into the corresponding form fields.
226
+ 4. Save.
227
+
228
+ The mode is now available in every project. Praxis's Python module (`python -m praxis`) must be importable in the target project's environment — clone this repo somewhere on `PYTHONPATH`, or add it to a project's virtualenv.
229
+
230
+ After Praxis runs against another project, its generated `.bob/custom_modes.yaml` is auto-discovered the next time that project opens in Bob. The Praxis meta-mode is a bootstrapper — once a project has its own generated mode, use that going forward.
231
+
232
+ ---
233
+
234
+ ## What's supported
235
+
236
+ - **Stack detection**: Python (Flask, FastAPI, Django, pandas, numpy, pytest)
237
+ - **Targets**: Bob IDE, Claude Code, Cursor
238
+ - **Modes**: `analyze` (existing codebase), `plan` (planning document)
239
+ - **Operating system**: developed and tested on Windows; Linux/macOS should work but are untested in v0.1.0
240
+ - **Generic fallback** for non-Python stacks returns a `NotImplementedError` in v0.1.0; multi-language support is deferred to v2
241
+
242
+ ---
243
+
244
+ ## Project structure
245
+
246
+ ```
247
+ bob-praxis/
248
+ ├── praxis/ # Main Python package
249
+ │ ├── __init__.py
250
+ │ ├── __main__.py # Entry point for `python -m praxis`
251
+ │ ├── cli.py # Argparse CLI (context-prompt + generate subcommands)
252
+ │ ├── detect.py # Stack and framework detection
253
+ │ ├── methodology.py # The seven methodology principles
254
+ │ ├── inference_prompts.py # Phase 1 prompt construction for the host agent
255
+ │ ├── generate.py # Phase 2 template rendering and per-target dispatch
256
+ │ └── templates/ # Per-target template families
257
+ │ ├── bob/ # AGENTS.md, PRAXIS_CONTRACT.md, custom_modes.yaml, etc.
258
+ │ ├── claude_code/ # CLAUDE.md
259
+ │ └── cursor/ # methodology.mdc, python.mdc
260
+ ├── tests/
261
+ │ ├── test_two_phase_smoke.py # End-to-end smoke test (7 paths + 2 mutex checks)
262
+ │ ├── sample_python_project/ # Test fixture for analyze mode
263
+ │ └── sample_planning_doc.md # Test fixture for plan mode
264
+ ├── bob_sessions/ # Exported Bob sessions and demo transcripts
265
+ ├── .bob/
266
+ │ └── custom_modes.yaml # The Praxis Bob mode definition for this repository
267
+ ├── requirements.txt # pyyaml (smoke tests only)
268
+ ├── .gitignore
269
+ ├── LICENSE
270
+ ├── README.md
271
+ ├── CHANGELOG.md
272
+ └── BOBCOIN_LOG.md
273
+ ```
274
+
275
+ ---
276
+
277
+ ## Verification
278
+
279
+ A two-phase smoke test exercises every (mode × target) combination plus both flag variants of the Phase 2 input:
280
+
281
+ ```
282
+ python tests/test_two_phase_smoke.py
283
+ ```
284
+
285
+ Coverage:
286
+
287
+ - 6 paths: {analyze, plan} × {bob, claude-code, cursor}
288
+ - 1 path: analyze + bob via `--context-file` (the Windows-safe alternative)
289
+ - 2 paths: argparse mutex checks rejecting both flags or neither
290
+
291
+ All 9 must pass for the build to be considered healthy.
292
+
293
+ ---
294
+
295
+ ## Status
296
+
297
+ Built for the IBM Bob Hackathon, May 15–17, 2026.
298
+
299
+ - **Phase 0**: Project setup, security baseline, documentation
300
+ - **Phase 1**: CLI skeleton + Python stack support
301
+ - **Phase 2**: Planning-doc mode
302
+ - **Phase 3**: Bob custom mode wrapper
303
+ - **Phase 4**: Two-phase handshake, multi-target (Bob/Claude Code/Cursor), trigger keywords, plan-mode clarifying questions, Windows-safe Phase 2 via `--context-file`
304
+ - **Phase 5**: Demo recording, slides, submission
305
+
306
+ See `CHANGELOG.md` for sub-task-level progress.
307
+
308
+ ---
309
+
310
+ ## Acknowledgments
311
+
312
+ Built for the IBM Bob Hackathon 2026.
313
+
314
+ - **Bob IDE** (https://bob.ibm.com) — the methodology's primary host agent and the CLI's first orchestrator.
315
+ - **Claude Code** and **Cursor** — the additional target ecosystems whose configurations Praxis generates.
316
+ - **Claude (Anthropic)** — second-agent reviewer during methodology and architecture design.
317
+
318
+ The seven methodology principles encoded in Praxis are derived from the author's working preferences with Claude over many months of collaborative development. Praxis is the act of writing those preferences down in a form other agents can read.
319
+
320
+ ---
321
+
322
+ ## Contact
323
+
324
+ - GitHub: [@ContraInfinito](https://github.com/ContraInfinito)
325
+ - Repository: [bob-praxis](https://github.com/ContraInfinito/bob-praxis)
326
+
327
+ ---
328
+
329
+ ## License
330
+
331
+ MIT — see [LICENSE](LICENSE) file. Copyright (c) 2026 Mathew Carballo López.
@@ -0,0 +1,305 @@
1
+ # Praxis
2
+
3
+ **Every time you switch AI coding assistants, you re-teach it your conventions. Praxis stops that.**
4
+
5
+ Praxis is a methodology transfer tool. It takes how you want an AI partner to work — the principles, the conventions, the moments when you want it to stop and ask — and projects them onto any project as configuration files that three different AI agents understand: **Bob IDE**, **Claude Code**, and **Cursor**.
6
+
7
+ Same methodology. Three idiomatic outputs. Loadable on day one without any manual import step.
8
+
9
+ The name *Praxis* is Greek for "the practical application of theory." It turns methodology theory (how I want to work with AI) into concrete configuration (rules, contracts, conventions) applied to a specific project.
10
+
11
+ ---
12
+
13
+ ## What Praxis Does
14
+
15
+ Given either an existing codebase or a planning document, Praxis generates the configuration files each agent expects, in the format that agent expects, in the location that agent automatically loads.
16
+
17
+ ### For Bob IDE
18
+
19
+ A loadable project-scoped Bob mode plus supporting documentation:
20
+
21
+ - `.bob/custom_modes.yaml` — auto-discovered by Bob when the project is opened. The mode encodes the methodology, the trigger keywords, and the session-start checklist.
22
+ - `praxis_output/AGENTS.md` — project context, the seven methodology principles, and an "Open Questions for the Developer" section when generated from a planning document.
23
+ - `praxis_output/PRAXIS_CONTRACT.md` — the methodology contract in full form, including the strict-mode rider on Principle 1.
24
+ - `praxis_output/python_skill.md` — stack-specific conventions (Flask, FastAPI, Django, pytest, pandas/numpy patterns).
25
+ - `praxis_output/methodology_skill.md` — the seven principles as an enforcement guide.
26
+ - `praxis_output/.bobignore` — files Bob should never read or modify.
27
+
28
+ ### For Claude Code
29
+
30
+ A single `CLAUDE.md` at the project root. Auto-loaded by Claude Code on session start. Contains the seven principles, the trigger-keyword section, project conventions, and the "Open Questions" list when generated from a planning document.
31
+
32
+ ### For Cursor
33
+
34
+ Two `.mdc` files under `.cursor/rules/`. Auto-discovered when the project is opened in Cursor:
35
+
36
+ - `methodology.mdc` — project context and methodology principles, applied project-wide (`alwaysApply: true`).
37
+ - `python.mdc` — Python-language conventions, attached when editing `.py` files (`globs: "**/*.py"`).
38
+
39
+ ### Target selection
40
+
41
+ The default target is Bob. To select a different target, the user includes a phrase in their natural-language invocation:
42
+
43
+ - `Apply Praxis to ./my-project` → Bob (default)
44
+ - `Apply Praxis to ./my-project for Claude Code` → Claude Code
45
+ - `Apply Praxis to ./my-project as CLAUDE.md` → Claude Code (alternative phrasing)
46
+ - `Apply Praxis to ./my-project for Cursor` → Cursor
47
+ - `Apply Praxis to ./my-project target Cursor` → Cursor (alternative phrasing)
48
+
49
+ The chosen target is announced in the first line of the response so the developer can catch a misinterpretation before any file is written.
50
+
51
+ ---
52
+
53
+ ## The Seven Methodology Principles
54
+
55
+ Praxis ships with seven hardcoded methodology defaults. Developers can override them by editing the generated configuration files.
56
+
57
+ 1. **Prompt-first execution** — Rewrite vague user input into structured prompts before acting. *Strict mode (triggered by the keywords `design` or `scope`):* produce a six-field structured prompt and wait for explicit approval before any action, even if the request seems clear.
58
+ 2. **Proactive issue resolution** — Fix adjacent issues you spot; log what was done.
59
+ 3. **Code review by a second agent** — Every change critiqued before presentation.
60
+ 4. **Logging discipline** — Every session produces a timestamped changelog entry.
61
+ 5. **Definitional rigor** — Define every technical term before using it.
62
+ 6. **Simplicity bias** — Simplest solution that fully solves the problem.
63
+ 7. **Security baseline** — Never plaintext credentials; scan for secrets; honor `.bobignore`.
64
+
65
+ ### Trigger keywords
66
+
67
+ When a user's message contains the keyword `design` or `scope` (case-insensitive, anywhere in the message), the agent enters strict prompt-first mode and produces a six-field structured prompt before any action:
68
+
69
+ 1. **Restated request** — bullet-point reformulation of what the agent thinks the user wants
70
+ 2. **Assumptions** — every assumption the agent would make if it proceeded as-is
71
+ 3. **Scope IN** — what is included in the work
72
+ 4. **Scope OUT** — what is deliberately excluded
73
+ 5. **Proposed approach** — one or two sentences summarizing the implementation strategy
74
+ 6. **Open questions** — anything the agent needs clarified before starting
75
+
76
+ The agent then waits for the developer to approve, edit, or reject the structured prompt. No code changes, file writes, or commands execute until approval.
77
+
78
+ This trigger surfaces redundantly across each agent's config: a dedicated top-of-file `Trigger Keywords` section AND a strict-mode rider embedded inside Principle 1's full description. Even if an agent skims past one, the other catches the trigger.
79
+
80
+ ---
81
+
82
+ ## Plan mode: surface what the planning doc didn't say
83
+
84
+ When given a planning document (`.md`, `.markdown`, or `.txt`) instead of an existing codebase, Praxis runs in **plan mode**. Plan mode generates the same per-target configuration, plus a list of clarifying questions about gaps in the planning document.
85
+
86
+ The questions land in two places:
87
+
88
+ - In the agent's chat response immediately, so the developer can answer them in conversation.
89
+ - Verbatim in the generated configuration's "Open Questions for the Developer" section, so future sessions (or future agents loading the project) see them too.
90
+
91
+ This is the architectural enforcement of Principle 1: the methodology doesn't trust the agent to remember to ask. It bakes the asking into the project's documentation.
92
+
93
+ ---
94
+
95
+ ## Two-phase handshake architecture
96
+
97
+ Praxis is a CLI that runs in two phases. The host agent (Bob, or any compatible orchestrator) bridges them.
98
+
99
+ **Phase 1: `praxis context-prompt <mode> <path> --target <target>`**
100
+
101
+ - Reads project files (analyze mode) or the planning document (plan mode).
102
+ - Detects stack and frameworks deterministically (no LLM call here).
103
+ - Builds a natural-language prompt for the host agent to answer.
104
+ - Emits JSON to stdout containing `prompt_for_bob`, `partial_context` (deterministic fields), and `meta`.
105
+
106
+ **Phase 2: `praxis generate --context-file <path> --output-root <dir>`**
107
+
108
+ - Reads the host agent's JSON answer plus the Phase 1 context from a file.
109
+ - Validates the schema.
110
+ - Renders the per-target templates.
111
+ - Writes files to the appropriate per-target locations.
112
+ - Prints generated file paths to stdout.
113
+
114
+ The `--context-file` flag avoids shell-quoting fragility on Windows (em-dashes, embedded quotes, newlines in JSON content all survive cleanly). An inline `--context '<json>'` flag is also accepted for trivially small payloads.
115
+
116
+ Both phases print machine-parseable output to stdout and human-readable status to stderr — clean for piping, clean for orchestration.
117
+
118
+ ---
119
+
120
+ ## Installation
121
+
122
+ ### Prerequisites
123
+
124
+ - Python 3.11 or higher
125
+ - Bob IDE (for the Bob-orchestrated workflow), Claude Code (to consume Claude Code targets), or Cursor (to consume Cursor targets)
126
+
127
+ **No external API credentials are required.** Praxis has zero runtime dependencies as of v0.1.0. The host agent supplies the inference; Praxis only writes files.
128
+
129
+ ### Setup
130
+
131
+ 1. **Clone the repository**:
132
+ ```bash
133
+ git clone https://github.com/ContraInfinito/bob-praxis.git
134
+ cd bob-praxis
135
+ ```
136
+
137
+ 2. **(Optional) Create and activate a virtual environment**. Praxis itself doesn't need any pip-installed dependencies, so this is only necessary if you plan to run the smoke tests (which need `pyyaml`):
138
+ ```bash
139
+ python -m venv venv
140
+
141
+ # On Windows:
142
+ venv\Scripts\activate
143
+
144
+ # On macOS/Linux:
145
+ source venv/bin/activate
146
+
147
+ pip install -r requirements.txt
148
+ ```
149
+
150
+ 3. **Run the smoke test** to verify the install:
151
+ ```bash
152
+ python tests/test_two_phase_smoke.py
153
+ ```
154
+ Expected: all 7 paths and 2 mutex checks pass.
155
+
156
+ ---
157
+
158
+ ## Usage
159
+
160
+ ### As a Bob custom mode (recommended)
161
+
162
+ Praxis ships as a project-scoped Bob mode in `.bob/custom_modes.yaml`. When you open this repository in Bob IDE, the **🛠️ Praxis** mode automatically appears in the mode list — no manual import needed.
163
+
164
+ 1. Open this repository in Bob IDE.
165
+ 2. Select **🛠️ Praxis** from Bob's mode selector.
166
+ 3. Invoke with natural language:
167
+ - **Apply to an existing codebase**: `Apply Praxis to ./tests/sample_python_project`
168
+ - **Apply with a non-default target**: `Apply Praxis to ./tests/sample_python_project for Claude Code`
169
+ - **Bootstrap from a planning document**: `Apply Praxis to ./tests/sample_planning_doc.md`
170
+
171
+ The Bob mode handles both phases of the CLI handshake transparently. It runs Phase 1, generates the inference internally, and invokes Phase 2 with `--context-file` (file-based handoff, safe across Windows/POSIX shells).
172
+
173
+ For planning-document input, Bob will surface any clarifying questions Praxis generated and wait for the developer to answer them before treating the configuration as final.
174
+
175
+ ### As a standalone CLI
176
+
177
+ You can also drive Praxis directly without Bob, as long as you supply the inference yourself:
178
+
179
+ ```bash
180
+ # Phase 1: read files, emit a prompt for the host agent
181
+ python -m praxis context-prompt analyze ./my-project --target bob > phase1.json
182
+
183
+ # Build a Phase 2 context blob: combine partial_context (from phase1.json),
184
+ # your bob_inference answer (the host agent's response), and meta into one JSON file.
185
+ # Write the combined blob to phase2.json.
186
+
187
+ # Phase 2: consume the combined blob, write output files
188
+ python -m praxis generate --context-file phase2.json --output-root ./my-project
189
+ ```
190
+
191
+ The smoke test (`tests/test_two_phase_smoke.py`) is a working example of the standalone flow with a synthetic host-agent answer.
192
+
193
+ ### As a global Bob meta-mode (apply to other projects on your machine)
194
+
195
+ To use Praxis on projects other than this repository:
196
+
197
+ 1. Open Bob's Settings → Modes tab.
198
+ 2. Click "Create new mode" (or equivalent).
199
+ 3. Paste the YAML fields (`slug`, `name`, `roleDefinition`, `whenToUse`, `groups`, `customInstructions`) from this repo's `.bob/custom_modes.yaml` into the corresponding form fields.
200
+ 4. Save.
201
+
202
+ The mode is now available in every project. Praxis's Python module (`python -m praxis`) must be importable in the target project's environment — clone this repo somewhere on `PYTHONPATH`, or add it to a project's virtualenv.
203
+
204
+ After Praxis runs against another project, its generated `.bob/custom_modes.yaml` is auto-discovered the next time that project opens in Bob. The Praxis meta-mode is a bootstrapper — once a project has its own generated mode, use that going forward.
205
+
206
+ ---
207
+
208
+ ## What's supported
209
+
210
+ - **Stack detection**: Python (Flask, FastAPI, Django, pandas, numpy, pytest)
211
+ - **Targets**: Bob IDE, Claude Code, Cursor
212
+ - **Modes**: `analyze` (existing codebase), `plan` (planning document)
213
+ - **Operating system**: developed and tested on Windows; Linux/macOS should work but are untested in v0.1.0
214
+ - **Generic fallback** for non-Python stacks returns a `NotImplementedError` in v0.1.0; multi-language support is deferred to v2
215
+
216
+ ---
217
+
218
+ ## Project structure
219
+
220
+ ```
221
+ bob-praxis/
222
+ ├── praxis/ # Main Python package
223
+ │ ├── __init__.py
224
+ │ ├── __main__.py # Entry point for `python -m praxis`
225
+ │ ├── cli.py # Argparse CLI (context-prompt + generate subcommands)
226
+ │ ├── detect.py # Stack and framework detection
227
+ │ ├── methodology.py # The seven methodology principles
228
+ │ ├── inference_prompts.py # Phase 1 prompt construction for the host agent
229
+ │ ├── generate.py # Phase 2 template rendering and per-target dispatch
230
+ │ └── templates/ # Per-target template families
231
+ │ ├── bob/ # AGENTS.md, PRAXIS_CONTRACT.md, custom_modes.yaml, etc.
232
+ │ ├── claude_code/ # CLAUDE.md
233
+ │ └── cursor/ # methodology.mdc, python.mdc
234
+ ├── tests/
235
+ │ ├── test_two_phase_smoke.py # End-to-end smoke test (7 paths + 2 mutex checks)
236
+ │ ├── sample_python_project/ # Test fixture for analyze mode
237
+ │ └── sample_planning_doc.md # Test fixture for plan mode
238
+ ├── bob_sessions/ # Exported Bob sessions and demo transcripts
239
+ ├── .bob/
240
+ │ └── custom_modes.yaml # The Praxis Bob mode definition for this repository
241
+ ├── requirements.txt # pyyaml (smoke tests only)
242
+ ├── .gitignore
243
+ ├── LICENSE
244
+ ├── README.md
245
+ ├── CHANGELOG.md
246
+ └── BOBCOIN_LOG.md
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Verification
252
+
253
+ A two-phase smoke test exercises every (mode × target) combination plus both flag variants of the Phase 2 input:
254
+
255
+ ```
256
+ python tests/test_two_phase_smoke.py
257
+ ```
258
+
259
+ Coverage:
260
+
261
+ - 6 paths: {analyze, plan} × {bob, claude-code, cursor}
262
+ - 1 path: analyze + bob via `--context-file` (the Windows-safe alternative)
263
+ - 2 paths: argparse mutex checks rejecting both flags or neither
264
+
265
+ All 9 must pass for the build to be considered healthy.
266
+
267
+ ---
268
+
269
+ ## Status
270
+
271
+ Built for the IBM Bob Hackathon, May 15–17, 2026.
272
+
273
+ - **Phase 0**: Project setup, security baseline, documentation
274
+ - **Phase 1**: CLI skeleton + Python stack support
275
+ - **Phase 2**: Planning-doc mode
276
+ - **Phase 3**: Bob custom mode wrapper
277
+ - **Phase 4**: Two-phase handshake, multi-target (Bob/Claude Code/Cursor), trigger keywords, plan-mode clarifying questions, Windows-safe Phase 2 via `--context-file`
278
+ - **Phase 5**: Demo recording, slides, submission
279
+
280
+ See `CHANGELOG.md` for sub-task-level progress.
281
+
282
+ ---
283
+
284
+ ## Acknowledgments
285
+
286
+ Built for the IBM Bob Hackathon 2026.
287
+
288
+ - **Bob IDE** (https://bob.ibm.com) — the methodology's primary host agent and the CLI's first orchestrator.
289
+ - **Claude Code** and **Cursor** — the additional target ecosystems whose configurations Praxis generates.
290
+ - **Claude (Anthropic)** — second-agent reviewer during methodology and architecture design.
291
+
292
+ The seven methodology principles encoded in Praxis are derived from the author's working preferences with Claude over many months of collaborative development. Praxis is the act of writing those preferences down in a form other agents can read.
293
+
294
+ ---
295
+
296
+ ## Contact
297
+
298
+ - GitHub: [@ContraInfinito](https://github.com/ContraInfinito)
299
+ - Repository: [bob-praxis](https://github.com/ContraInfinito/bob-praxis)
300
+
301
+ ---
302
+
303
+ ## License
304
+
305
+ MIT — see [LICENSE](LICENSE) file. Copyright (c) 2026 Mathew Carballo López.
@@ -0,0 +1,10 @@
1
+ """
2
+ Praxis — A methodology transfer tool for IBM Bob IDE.
3
+
4
+ Praxis takes a developer's AI-collaboration methodology and projects it onto
5
+ a specific codebase or planning document, generating tailored Bob IDE configuration
6
+ files that make Bob behave consistently with that methodology on the project.
7
+ """
8
+
9
+ __version__ = "0.1.0"
10
+
@@ -0,0 +1,12 @@
1
+ """
2
+ Praxis package entry point.
3
+
4
+ Allows the package to be invoked as: python -m praxis
5
+ """
6
+
7
+ import sys
8
+ from praxis.cli import main
9
+
10
+ if __name__ == "__main__":
11
+ sys.exit(main())
12
+