agent-bootstrap 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,171 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-bootstrap
3
+ Version: 0.1.0
4
+ Summary: Scaffold AI-agent-ready projects from curated templates, presets, or a dirtree layout
5
+ Author: marcelodevops
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 marcelodevops
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/marcelodevops/project_bootstrapper
29
+ Project-URL: Repository, https://github.com/marcelodevops/project_bootstrapper
30
+ Project-URL: Issues, https://github.com/marcelodevops/project_bootstrapper/issues
31
+ Keywords: scaffold,boilerplate,ai-agents,project-template,codegen,cli
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Environment :: Console
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Classifier: Programming Language :: Python :: 3.13
39
+ Classifier: Topic :: Software Development :: Code Generators
40
+ Requires-Python: >=3.11
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE
43
+ Requires-Dist: typer>=0.9
44
+ Requires-Dist: PyGithub>=2.0
45
+ Provides-Extra: dev
46
+ Requires-Dist: pytest>=8; extra == "dev"
47
+ Requires-Dist: build>=1.0; extra == "dev"
48
+ Dynamic: license-file
49
+
50
+ # agent-bootstrap (`projboot`)
51
+
52
+ Scaffold AI-agent-ready projects from curated language templates, customizable workflow presets, or a `tree`-style layout — locally first, with one-command GitHub repository creation.
53
+
54
+ ## Install
55
+
56
+ ```bash
57
+ pip install agent-bootstrap # installs both `projboot` and `agent-bootstrap`
58
+ pip install -e ".[dev]" # dev: + pytest for the test suite
59
+ ```
60
+
61
+ Requires Python 3.11+. Local scaffolding needs no token and no network; GitHub remote creation (`-r github --create`) uses `GITHUB_TOKEN`.
62
+
63
+ ---
64
+
65
+ ## Quickstart: AI Agent Project Bootstrapping (`projboot create`)
66
+
67
+ Create a new Python project pre-wired for **Claude Code** and **GitHub Copilot**, scaffolded locally and pushed to a new GitHub repository:
68
+
69
+ ```bash
70
+ projboot create new-project -l python -a claude -a gh-copilot -r github --create --clone
71
+ ```
72
+
73
+ Or scaffold locally with custom directories for generated outputs, helper scripts, an ordered prompts catalog, and architecture conventions (all automatically wired into `AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, etc.):
74
+
75
+ ```bash
76
+ projboot create new-project \
77
+ -l python \
78
+ -a claude -a gh-copilot -a codeassistant \
79
+ --arch hexagonal \
80
+ --outputs-dir artifacts/out \
81
+ --scripts-dir hack \
82
+ --prompts-file docs/PROMPTS.md
83
+ ```
84
+
85
+ ### What `projboot create` Generates
86
+
87
+ 1. **Base Language Stack (`-l / --lang`)**:
88
+ - `python` / `python-microservice`: `src/` layout, `pyproject.toml`, `Dockerfile`, GitHub CI
89
+ - `typescript`: `package.json`, `tsconfig.json`, `src/index.ts`, multi-stage `Dockerfile`
90
+ - `helm-chart`: `Chart.yaml`, `values.yaml`, `templates/`, `helm lint` CI
91
+ - `rails`: Minimal Rails skeleton
92
+ - `none`: Minimal agent-only repo (`README.md` + `.gitignore`)
93
+ 2. **Universal Agent Harness (Always Included)**:
94
+ - `AGENTS.md`: Project overview, `$arch` rules, directory map (`$outputs_dir/`, `$scripts_dir/`, `$prompts_file`), and `graphify` instructions
95
+ - `graphify-out/`: Knowledge graph folder (automatically updated via `graphify update .` if `graphify` is installed)
96
+ - `.remember/`: Persistent agent memory (`MEMORY.md` & `decisions.md`, or copied from `~/.config/projboot/remember/`)
97
+ - `.agents/skills/`: Reusable project skills (copied from `~/.config/projboot/skills/` or starter `project-conventions/SKILL.md`)
98
+ - `$prompts_file` (default `PROMPTS.md`): Ordered prompt catalog
99
+ - `$outputs_dir/` & `$scripts_dir/` directories
100
+ 3. **Assistant Overlays (`-a / --agent`, repeatable)**:
101
+ - `-a claude`: `CLAUDE.md` + `.claude/settings.json`
102
+ - `-a gh-copilot`: `.github/copilot-instructions.md` + `.github/prompts/bootstrap.prompt.md`
103
+ - `-a codeassistant`: `.codeassistant/instructions.md`
104
+ - `-a cursor`: `.cursor/rules/project.mdc`
105
+
106
+ ---
107
+
108
+ ## Presets & Personal User Store (`~/.config/projboot/`)
109
+
110
+ Initialize your personal `projboot` configuration directory (or set `PROJBOOT_HOME` to customize its path):
111
+
112
+ ```bash
113
+ projboot config-init
114
+ projboot list-presets
115
+ ```
116
+
117
+ This creates:
118
+ - `~/.config/projboot/presets.toml` — Define named presets (`default`, `clean-arch`, or your own) with default `arch`, `outputs_dir`, `scripts_dir`, `prompts_file`, and `agents`.
119
+ - `~/.config/projboot/skills/` — Any skill files placed here are automatically copied into `.agents/skills/` and rendered with your project's `$name`, `$arch`, `$outputs_dir`, `$scripts_dir`, and `$prompts_file` variables.
120
+ - `~/.config/projboot/remember/` — Starter memory templates copied into `.remember/` on every new project.
121
+
122
+ Use a named preset with `-p / --preset`:
123
+
124
+ ```bash
125
+ projboot create my-service -l python -p clean-arch
126
+ ```
127
+
128
+ ---
129
+
130
+ ## Classic Template & Dirtree Commands
131
+
132
+ List available base templates:
133
+
134
+ ```bash
135
+ projboot list-templates
136
+ ```
137
+
138
+ Scaffold directly from a base template (without the AI agent harness):
139
+
140
+ ```bash
141
+ projboot init --name my-svc --template python-microservice \
142
+ --description "My service" --license mit --holder "Your Name" --local
143
+ ```
144
+
145
+ Override or add template variables with `--var` (repeatable):
146
+
147
+ ```bash
148
+ projboot init --name demo --template typescript --var name=real-package-name --local
149
+ ```
150
+
151
+ Build a layout from a `tree`-style file — directories become paths, leaf files are materialized empty:
152
+
153
+ ```bash
154
+ projboot init-from-tree --name myproject --tree-file examples/tree.txt --gitkeep --local
155
+ ```
156
+
157
+ `--gitkeep` drops a `.gitkeep` in empty directories so they survive; `--force` allows overwriting a non-empty local target directory.
158
+
159
+ ---
160
+
161
+ ## How Templating Works
162
+
163
+ Templates render with Python's `string.Template` (`$name`, `$description`, `$year`, `$holder`, `$arch`, `$outputs_dir`, `$scripts_dir`, `$prompts_file`, plus any `--var`). This is deliberate: Helm's Go-template syntax (`{{ .Values.foo }}`) and GitHub Actions expressions (`${{ secrets.X }}`) contain no bare `$identifier`, so they pass through untouched. `str.format()` or Jinja2 would corrupt them.
164
+
165
+ ## Tests
166
+
167
+ ```bash
168
+ pytest -q
169
+ ```
170
+
171
+ The dirtree parser, template rendering, preset & user store loader, AI agent overlays, CLI (local + GitHub dispatch via mocks), and GitHub helper are all covered without any network access.
@@ -0,0 +1,15 @@
1
+ agent_bootstrap-0.1.0.dist-info/licenses/LICENSE,sha256=ROTPTYx7JJRaA9YLznUjB7n3do98U_pe1HPNkpnzVsQ,1070
2
+ bootstrapper/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
3
+ bootstrapper/__main__.py,sha256=wcCrL4PjG51r5wVKqJhcoJPTLfHW0wNbD31DrUN0MWI,28
4
+ bootstrapper/agents.py,sha256=DRs2WrI5Ho5HM3-LWWBZ4TnvwrpBHUU5Fn0otMVHh28,5903
5
+ bootstrapper/cli.py,sha256=-22u7Ci4Cb1EdDFYqC2v4QibjlLt3jRVSrvgdihxnuk,14202
6
+ bootstrapper/composer.py,sha256=B7EHYFID_gvur3-MAj0tZ6pQCAjBx2KpuhAWAxtUwP8,5991
7
+ bootstrapper/dirtree.py,sha256=Txwl_ZeLyvfCWxt-ldW2iD2YghvQmNM1cM3-q0IJARU,3667
8
+ bootstrapper/github_utils.py,sha256=gUzUpNMJtY516B9lNKzNxA9aVThSSTtl9zReaDzrq9A,2251
9
+ bootstrapper/presets.py,sha256=WDZAu8wvsMDsRFVhvUmvoQG0RgMaEEgutPaxQRCENNE,8350
10
+ bootstrapper/templates.py,sha256=w-LXbgKo8TO0I0TG_fp3PxSnoPk6WmCQhdOATrhiHq4,13686
11
+ agent_bootstrap-0.1.0.dist-info/METADATA,sha256=z4AQKhzVpAWz8QB5_Rs-MnNp_jyZslmwHJwTddqUDEo,7497
12
+ agent_bootstrap-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
13
+ agent_bootstrap-0.1.0.dist-info/entry_points.txt,sha256=ydhNCPAUwwuGj0ru5RTHOdAxKLHGIZaVYnutfjHpAMo,89
14
+ agent_bootstrap-0.1.0.dist-info/top_level.txt,sha256=RyaE32_UMIFaj-7Cm1LC4iQVSJ-zhXMC4RV982x-InQ,13
15
+ agent_bootstrap-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ agent-bootstrap = bootstrapper.cli:app
3
+ projboot = bootstrapper.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 marcelodevops
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 @@
1
+ bootstrapper
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,3 @@
1
+ from .cli import app
2
+
3
+ app()
bootstrapper/agents.py ADDED
@@ -0,0 +1,143 @@
1
+ """Universal AI agent harness and assistant-specific overlay templates."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+
7
+ from .presets import PresetConfig, load_user_store_files
8
+
9
+ AGENTS_MD_TEMPLATE = """\
10
+ # AGENTS.md — $name
11
+
12
+ $description
13
+
14
+ ## Project Architecture & Layout
15
+
16
+ - **Architecture Style**: `$arch`
17
+ - **Outputs Directory**: `$outputs_dir/` — place all generated artifacts, reports, and exports here.
18
+ - **Scripts Directory**: `$scripts_dir/` — store helper, automation, and maintenance scripts here.
19
+ - **Ordered Prompts File**: `$prompts_file` — maintain ordered prompts and reusable agent instructions here.
20
+ - **Persistent Memory**: `.remember/` — read `.remember/MEMORY.md` and `.remember/decisions.md` before starting work, and update them when key decisions are made.
21
+ - **Agent Skills**: `.agents/skills/` — project-specific reusable skills.
22
+
23
+ ## Knowledge Graph (`graphify`)
24
+
25
+ - When `graphify-out/graph.json` exists, prefer querying the graph before reading raw files:
26
+ - `graphify query "<question>"`
27
+ - `graphify path "<NodeA>" "<NodeB>"`
28
+ - `graphify explain "<concept>"`
29
+ - If `graphify-out/wiki/index.md` exists, navigate it first.
30
+ - After modifying code files, run `graphify update .` to keep `graphify-out/` current.
31
+ """
32
+
33
+ PROMPTS_MD_TEMPLATE = """\
34
+ # Ordered Prompts Catalog — $name
35
+
36
+ Keep project prompts ordered and versioned in this file.
37
+
38
+ ## 01. Architecture & Context Prompt
39
+ > Review `AGENTS.md`, `.remember/MEMORY.md`, and `graphify-out/` before proposing changes. Follow the `$arch` architecture pattern. Put outputs in `$outputs_dir/` and scripts in `$scripts_dir/`.
40
+
41
+ ## 02. Feature Implementation Prompt
42
+ > Implement the requested feature following `$arch` boundaries, add unit tests, and run `graphify update .` when finished.
43
+ """
44
+
45
+ AGENT_OVERLAYS: dict[str, dict[str, str]] = {
46
+ "claude": {
47
+ "CLAUDE.md": (
48
+ "# CLAUDE.md — $name\n\n"
49
+ "Read and follow @AGENTS.md and @.remember/MEMORY.md at the start of every session.\n\n"
50
+ "## Quick Conventions\n"
51
+ "- **Architecture**: `$arch`\n"
52
+ "- **Outputs folder**: `$outputs_dir/`\n"
53
+ "- **Scripts folder**: `$scripts_dir/`\n"
54
+ "- **Ordered prompts**: `$prompts_file`\n"
55
+ "- **Skills**: `.agents/skills/`\n"
56
+ "- **Knowledge graph**: `graphify-out/` (run `graphify update .` after code changes)\n"
57
+ ),
58
+ ".claude/settings.json": (
59
+ "{\n"
60
+ ' "project": "$name",\n'
61
+ ' "conventions": {\n'
62
+ ' "outputsDir": "$outputs_dir",\n'
63
+ ' "scriptsDir": "$scripts_dir",\n'
64
+ ' "promptsFile": "$prompts_file"\n'
65
+ " }\n"
66
+ "}\n"
67
+ ),
68
+ },
69
+ "gh-copilot": {
70
+ ".github/copilot-instructions.md": (
71
+ "# GitHub Copilot Instructions — $name\n\n"
72
+ "$description\n\n"
73
+ "## Workspace Conventions\n"
74
+ "- Follow the **$arch** architecture pattern.\n"
75
+ "- Read `AGENTS.md` and `.remember/MEMORY.md` for project context and decisions.\n"
76
+ "- Save generated outputs and reports in `$outputs_dir/`.\n"
77
+ "- Place helper and automation scripts in `$scripts_dir/`.\n"
78
+ "- Keep ordered prompts in `$prompts_file`.\n"
79
+ "- Check `.agents/skills/` for domain skills and `graphify-out/` for the project graph.\n"
80
+ ),
81
+ ".github/prompts/bootstrap.prompt.md": (
82
+ "---\n"
83
+ 'description: "Context-aware task execution for $name"\n'
84
+ "---\n\n"
85
+ "Review `AGENTS.md`, `.remember/MEMORY.md`, and `$prompts_file`.\n"
86
+ "Ensure generated outputs go into `$outputs_dir/` and scripts go into `$scripts_dir/`.\n"
87
+ ),
88
+ },
89
+ "codeassistant": {
90
+ ".codeassistant/instructions.md": (
91
+ "# CodeAssistant Instructions — $name\n\n"
92
+ "- **Architecture**: `$arch`\n"
93
+ "- **Outputs Directory**: `$outputs_dir/`\n"
94
+ "- **Scripts Directory**: `$scripts_dir/`\n"
95
+ "- **Prompts Log**: `$prompts_file`\n"
96
+ "- **Memory & Decisions**: `.remember/MEMORY.md`, `.remember/decisions.md`\n"
97
+ "- **Skills**: `.agents/skills/`\n"
98
+ "- **Graphify**: `graphify-out/` (refer to `AGENTS.md`)\n"
99
+ ),
100
+ },
101
+ "cursor": {
102
+ ".cursor/rules/project.mdc": (
103
+ "---\n"
104
+ "description: Core project architecture and directory rules for $name\n"
105
+ "globs: *\n"
106
+ "alwaysApply: true\n"
107
+ "---\n\n"
108
+ "# $name Rules\n\n"
109
+ "- Follow `$arch` architecture.\n"
110
+ "- Read `AGENTS.md` and `.remember/MEMORY.md`.\n"
111
+ "- Put outputs in `$outputs_dir/`, scripts in `$scripts_dir/`, and prompts in `$prompts_file`.\n"
112
+ ),
113
+ },
114
+ }
115
+
116
+ SUPPORTED_AGENTS: tuple[str, ...] = tuple(AGENT_OVERLAYS.keys())
117
+
118
+
119
+ def universal_harness_files(
120
+ preset: PresetConfig, config_dir: Path | None = None
121
+ ) -> dict[str, str]:
122
+ """Return unrendered template bodies for the universal AI agent harness."""
123
+ files: dict[str, str] = {
124
+ "AGENTS.md": AGENTS_MD_TEMPLATE,
125
+ "graphify-out/.gitkeep": "",
126
+ f"{preset.outputs_dir}/.gitkeep": "",
127
+ f"{preset.scripts_dir}/.gitkeep": "",
128
+ preset.prompts_file: PROMPTS_MD_TEMPLATE,
129
+ }
130
+ files.update(load_user_store_files(config_dir))
131
+ return files
132
+
133
+
134
+ def agent_overlay_files(agents: list[str]) -> dict[str, str]:
135
+ """Return unrendered template bodies for the selected `-a` assistant adapters."""
136
+ out: dict[str, str] = {}
137
+ for agent in agents:
138
+ key = agent.strip().lower()
139
+ if key not in AGENT_OVERLAYS:
140
+ available = ", ".join(SUPPORTED_AGENTS)
141
+ raise KeyError(f"Unknown agent '{agent}'. Available: {available}")
142
+ out.update(AGENT_OVERLAYS[key])
143
+ return out