agent-scaffold-cli 0.1.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 (103) hide show
  1. agent_scaffold_cli-0.1.1/.env.example +15 -0
  2. agent_scaffold_cli-0.1.1/.github/workflows/ci.yml +35 -0
  3. agent_scaffold_cli-0.1.1/.github/workflows/publish.yml +32 -0
  4. agent_scaffold_cli-0.1.1/.gitignore +36 -0
  5. agent_scaffold_cli-0.1.1/CLAUDE.md +37 -0
  6. agent_scaffold_cli-0.1.1/LICENSE +21 -0
  7. agent_scaffold_cli-0.1.1/Makefile +17 -0
  8. agent_scaffold_cli-0.1.1/PKG-INFO +147 -0
  9. agent_scaffold_cli-0.1.1/README.md +115 -0
  10. agent_scaffold_cli-0.1.1/pyproject.toml +103 -0
  11. agent_scaffold_cli-0.1.1/scripts/sync_deployments.sh +25 -0
  12. agent_scaffold_cli-0.1.1/src/agent_scaffold/__init__.py +8 -0
  13. agent_scaffold_cli-0.1.1/src/agent_scaffold/__main__.py +6 -0
  14. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/__init__.py +15 -0
  15. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/cross-cutting/README.md +15 -0
  16. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/cross-cutting/auth-jwt.md +235 -0
  17. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/cross-cutting/logging-structured.md +196 -0
  18. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/cross-cutting/observability.md +259 -0
  19. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/cross-cutting/rate-limiting.md +171 -0
  20. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/cross-cutting/testing-strategy.md +261 -0
  21. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/frameworks/README.md +22 -0
  22. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/frameworks/crewai.md +91 -0
  23. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/frameworks/langgraph.md +79 -0
  24. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/frameworks/mastra.md +74 -0
  25. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/frameworks/pydantic-ai.md +77 -0
  26. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/frameworks/vercel-ai-sdk.md +83 -0
  27. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/README.md +26 -0
  28. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/memory.md +82 -0
  29. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/multi-agent-flat.md +72 -0
  30. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/multi-agent-hierarchical.md +83 -0
  31. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/parallel-calls.md +73 -0
  32. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/plan-execute-reflect.md +77 -0
  33. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/prompt-chaining.md +73 -0
  34. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/rag.md +84 -0
  35. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/react.md +77 -0
  36. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/patterns/routing-tool-use.md +69 -0
  37. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/README.md +39 -0
  38. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/code-review-agent.md +518 -0
  39. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/content-pipeline.md +525 -0
  40. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/customer-support-triage.md +1679 -0
  41. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/docs-rag-qa.md +1254 -0
  42. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/hierarchical-agent.md +554 -0
  43. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/memory-assistant.md +499 -0
  44. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/ops-crew.md +457 -0
  45. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/parallel-enricher.md +457 -0
  46. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/recipes/research-assistant.md +1096 -0
  47. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/README.md +19 -0
  48. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/api-fastapi.md +112 -0
  49. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/api-hono.md +108 -0
  50. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/cache-redis.md +85 -0
  51. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/eval-deepeval-ragas-promptfoo.md +164 -0
  52. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/llm-claude.md +105 -0
  53. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/relational-postgres.md +122 -0
  54. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/tool-protocol-mcp.md +275 -0
  55. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/tracing-langfuse.md +108 -0
  56. agent_scaffold_cli-0.1.1/src/agent_scaffold/_bundled_deployments/docs/stack/vector-qdrant.md +121 -0
  57. agent_scaffold_cli-0.1.1/src/agent_scaffold/cache.py +32 -0
  58. agent_scaffold_cli-0.1.1/src/agent_scaffold/cli.py +512 -0
  59. agent_scaffold_cli-0.1.1/src/agent_scaffold/config.py +117 -0
  60. agent_scaffold_cli-0.1.1/src/agent_scaffold/context.py +253 -0
  61. agent_scaffold_cli-0.1.1/src/agent_scaffold/contract.py +141 -0
  62. agent_scaffold_cli-0.1.1/src/agent_scaffold/discovery.py +112 -0
  63. agent_scaffold_cli-0.1.1/src/agent_scaffold/generator.py +213 -0
  64. agent_scaffold_cli-0.1.1/src/agent_scaffold/languages/__init__.py +0 -0
  65. agent_scaffold_cli-0.1.1/src/agent_scaffold/languages/python.yaml +28 -0
  66. agent_scaffold_cli-0.1.1/src/agent_scaffold/languages/typescript.yaml +25 -0
  67. agent_scaffold_cli-0.1.1/src/agent_scaffold/prompts/__init__.py +0 -0
  68. agent_scaffold_cli-0.1.1/src/agent_scaffold/prompts/repair.md +9 -0
  69. agent_scaffold_cli-0.1.1/src/agent_scaffold/prompts/system.md +21 -0
  70. agent_scaffold_cli-0.1.1/src/agent_scaffold/prompts/user_template.md +43 -0
  71. agent_scaffold_cli-0.1.1/src/agent_scaffold/validator.py +133 -0
  72. agent_scaffold_cli-0.1.1/src/agent_scaffold/writer.py +171 -0
  73. agent_scaffold_cli-0.1.1/tests/__init__.py +0 -0
  74. agent_scaffold_cli-0.1.1/tests/conftest.py +32 -0
  75. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/cross-cutting/auth.md +3 -0
  76. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/cross-cutting/logging.md +3 -0
  77. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/cross-cutting/rate-limiting.md +3 -0
  78. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/cross-cutting/testing.md +3 -0
  79. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/frameworks/langgraph.md +3 -0
  80. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/frameworks/pydantic-ai.md +3 -0
  81. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/frameworks/vercel-ai-sdk.md +3 -0
  82. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/patterns/loop-a.md +3 -0
  83. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/patterns/loop-b.md +3 -0
  84. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/patterns/rag.md +3 -0
  85. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/patterns/react.md +6 -0
  86. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/recipes/customer-support-triage.md +24 -0
  87. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/recipes/cycle-recipe.md +5 -0
  88. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/recipes/docs-rag-qa.md +9 -0
  89. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/recipes/lonely-recipe.md +5 -0
  90. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/recipes/missing-ref-recipe.md +3 -0
  91. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/recipes/no-h1-recipe.md +1 -0
  92. agent_scaffold_cli-0.1.1/tests/fixtures/mock_deployments/docs/stack/qdrant.md +3 -0
  93. agent_scaffold_cli-0.1.1/tests/fixtures/mock_responses/malformed.txt +1 -0
  94. agent_scaffold_cli-0.1.1/tests/fixtures/mock_responses/valid_python.json +33 -0
  95. agent_scaffold_cli-0.1.1/tests/fixtures/mock_responses/valid_python_fenced.txt +15 -0
  96. agent_scaffold_cli-0.1.1/tests/test_cli_e2e.py +165 -0
  97. agent_scaffold_cli-0.1.1/tests/test_config.py +99 -0
  98. agent_scaffold_cli-0.1.1/tests/test_context.py +97 -0
  99. agent_scaffold_cli-0.1.1/tests/test_contract.py +139 -0
  100. agent_scaffold_cli-0.1.1/tests/test_discovery.py +55 -0
  101. agent_scaffold_cli-0.1.1/tests/test_generator.py +147 -0
  102. agent_scaffold_cli-0.1.1/tests/test_writer.py +161 -0
  103. agent_scaffold_cli-0.1.1/uv.lock +744 -0
@@ -0,0 +1,15 @@
1
+ # Anthropic API key used by agent-scaffold to generate projects.
2
+ ANTHROPIC_API_KEY=
3
+
4
+ # Optional: override the default model (default: claude-opus-4-7).
5
+ # AGENT_SCAFFOLD_MODEL=claude-opus-4-7
6
+
7
+ # Optional: default path to your local agent-deployments repo.
8
+ # AGENT_SCAFFOLD_DEPLOYMENTS_PATH=/absolute/path/to/agent-deployments
9
+
10
+ # Optional: override the cache root (default: ~/.cache/agent-scaffold).
11
+ # Used for the failures/ subdirectory where malformed LLM responses are saved.
12
+ # AGENT_SCAFFOLD_CACHE_DIR=~/.cache/agent-scaffold
13
+
14
+ # Optional: override the TOML config path (default: ~/.config/agent-scaffold/config.toml).
15
+ # AGENT_SCAFFOLD_CONFIG_PATH=~/.config/agent-scaffold/config.toml
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v3
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ run: uv python install ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: uv sync --dev
27
+
28
+ - name: Lint
29
+ run: uv run ruff check src/ tests/
30
+
31
+ - name: Type check
32
+ run: uv run mypy src/
33
+
34
+ - name: Test
35
+ run: uv run pytest --cov=agent_scaffold --cov-report=term-missing
@@ -0,0 +1,32 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+ contents: read
10
+
11
+ jobs:
12
+ build-and-publish:
13
+ runs-on: ubuntu-latest
14
+ environment: pypi
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v3
21
+
22
+ - name: Set up Python
23
+ run: uv python install 3.11
24
+
25
+ - name: Sync bundled deployments
26
+ run: bash scripts/sync_deployments.sh
27
+
28
+ - name: Build wheel and sdist
29
+ run: uv build
30
+
31
+ - name: Publish to PyPI
32
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,36 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ *.egg
6
+ .pytest_cache/
7
+ .mypy_cache/
8
+ .ruff_cache/
9
+ .coverage
10
+ htmlcov/
11
+ dist/
12
+ build/
13
+
14
+ # Virtual envs
15
+ .venv/
16
+ venv/
17
+ env/
18
+
19
+ # OS
20
+ .DS_Store
21
+ Thumbs.db
22
+ # Allow the test fixture that intentionally exercises hidden-file filtering.
23
+ !tests/fixtures/mock_deployments/**/.DS_Store
24
+
25
+ # Editor
26
+ .idea/
27
+ .vscode/
28
+ *.swp
29
+
30
+ # Project local
31
+ .env
32
+ .env.local
33
+
34
+ # Bundled deployments docs (fetched at build time via scripts/sync_deployments.sh)
35
+ src/agent_scaffold/_bundled_deployments/docs/*
36
+ !src/agent_scaffold/_bundled_deployments/docs/.gitkeep
@@ -0,0 +1,37 @@
1
+ # agent-scaffold
2
+
3
+ Generate runnable AI agent projects from markdown specs in an `agent-deployments` repo.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ uv run pytest # run tests
9
+ uv run pytest -m integration # run integration tests only
10
+ uv run ruff check src/ tests/ # lint
11
+ uv run ruff format src/ tests/ # format
12
+ uv run mypy src/ # type check
13
+ uv run agent-scaffold --help # CLI usage
14
+ ```
15
+
16
+ ## Architecture
17
+
18
+ Pipeline: `config → discovery → context → generator → contract → writer → validator`
19
+
20
+ | Module | Responsibility |
21
+ |--------|---------------|
22
+ | `config.py` | Load env vars + TOML config, resolve `Config` |
23
+ | `discovery.py` | Scan `agent-deployments/docs/recipes/` for markdown recipe specs |
24
+ | `context.py` | Assemble recipe + linked docs into a single prompt context |
25
+ | `generator.py` | Call Anthropic API with system/user prompts, retry on transient errors |
26
+ | `contract.py` | Parse + validate JSON response (path safety, required files) |
27
+ | `writer.py` | Atomic file writing with skip/diff/overwrite modes |
28
+ | `validator.py` | Post-generation validation: static lint, build, smoke check |
29
+ | `cli.py` | Typer CLI orchestrating the full pipeline |
30
+
31
+ ## Conventions
32
+
33
+ - Python 3.11+, strict mypy, ruff for lint+format
34
+ - Pydantic models for all data structures
35
+ - Custom exceptions carry context (e.g., `ContractParseError.raw`, `.reason`)
36
+ - Tests use monkeypatching for Anthropic client; fixtures in `tests/fixtures/`
37
+ - src layout: `src/agent_scaffold/`
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jagadesh Varma Nadimpalli
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,17 @@
1
+ .PHONY: sync-deployments build test lint typecheck
2
+
3
+ sync-deployments:
4
+ bash scripts/sync_deployments.sh
5
+
6
+ build: sync-deployments
7
+ uv build
8
+
9
+ test:
10
+ uv run pytest --cov=agent_scaffold
11
+
12
+ lint:
13
+ uv run ruff check src/ tests/
14
+ uv run mypy src/
15
+
16
+ typecheck:
17
+ uv run mypy src/
@@ -0,0 +1,147 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-scaffold-cli
3
+ Version: 0.1.1
4
+ Summary: Generate runnable AI agent projects from markdown specs in the agent-deployments repo.
5
+ Project-URL: Homepage, https://github.com/jagguvarma15/agent-scaffold
6
+ Project-URL: Repository, https://github.com/jagguvarma15/agent-scaffold
7
+ Project-URL: Issues, https://github.com/jagguvarma15/agent-scaffold/issues
8
+ Project-URL: Changelog, https://github.com/jagguvarma15/agent-scaffold/releases
9
+ Author: agent-scaffold contributors
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: agent,ai,anthropic,claude,cli,code-generation,scaffolding
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Build Tools
22
+ Classifier: Topic :: Software Development :: Code Generators
23
+ Requires-Python: >=3.11
24
+ Requires-Dist: anthropic==0.39.0
25
+ Requires-Dist: click<8.2
26
+ Requires-Dist: pydantic==2.7.4
27
+ Requires-Dist: pyyaml==6.0.2
28
+ Requires-Dist: questionary==2.0.1
29
+ Requires-Dist: rich==13.7.1
30
+ Requires-Dist: typer==0.12.5
31
+ Description-Content-Type: text/markdown
32
+
33
+ # agent-scaffold
34
+
35
+ `agent-scaffold` generates runnable AI agent projects from markdown specs. It ships with bundled knowledge from [agent-deployments](https://github.com/jagguvarma15/agent-deployments) — pick a recipe, target language, and framework, and the CLI assembles the relevant docs, asks Claude to emit a complete project, validates the response, and writes the files atomically into your destination of choice.
36
+
37
+ ## Install
38
+
39
+ The package is published on PyPI as **`agent-scaffold-cli`** (the CLI command itself is still `agent-scaffold`).
40
+
41
+ ```bash
42
+ pipx install agent-scaffold-cli
43
+ # or
44
+ uv tool install agent-scaffold-cli
45
+ # or, for one-off use:
46
+ uvx --from agent-scaffold-cli agent-scaffold --help
47
+ ```
48
+
49
+ ### Local development
50
+
51
+ ```bash
52
+ git clone https://github.com/jagguvarma15/agent-scaffold
53
+ cd agent-scaffold
54
+ uv sync
55
+ ```
56
+
57
+ ## Quickstart
58
+
59
+ ```bash
60
+ export ANTHROPIC_API_KEY=sk-ant-...
61
+ agent-scaffold new
62
+ ```
63
+
64
+ The bundled recipes work out of the box. To use a custom agent-deployments checkout instead:
65
+
66
+ ```bash
67
+ export AGENT_SCAFFOLD_DEPLOYMENTS_PATH=/path/to/agent-deployments
68
+ agent-scaffold new
69
+ ```
70
+
71
+ The interactive `new` flow walks you through:
72
+
73
+ 1. The path to your `agent-deployments` repo (default from config).
74
+ 2. A recipe from `docs/recipes/*.md`.
75
+ 3. A target language (Python or TypeScript).
76
+ 4. A framework (e.g. `pydantic_ai`, `langgraph`, `vercel_ai_sdk`, or `none`).
77
+ 5. A project name and destination directory.
78
+
79
+ You'll see a context summary, a generation step, a static validation pass, and a "next steps" footer with the smoke-check command.
80
+
81
+ ## Configuration
82
+
83
+ | Source | Variable / key | Purpose |
84
+ | --- | --- | --- |
85
+ | Env | `ANTHROPIC_API_KEY` | Required. The Anthropic API key used by the generator. |
86
+ | Env | `AGENT_SCAFFOLD_DEPLOYMENTS_PATH` | Default path to your `agent-deployments` checkout. |
87
+ | Env | `AGENT_SCAFFOLD_MODEL` | Override the model (default `claude-opus-4-7`). |
88
+ | Env | `AGENT_SCAFFOLD_CACHE_DIR` | Override the cache root (default `~/.cache/agent-scaffold`). |
89
+ | Env | `AGENT_SCAFFOLD_CONFIG_PATH` | Override the TOML fallback location. |
90
+ | TOML | `~/.config/agent-scaffold/config.toml` | Fallback for `deployments_path` and `model`. |
91
+
92
+ Run `uv run agent-scaffold config` to print the resolved configuration (the API key is masked).
93
+
94
+ A typical config file:
95
+
96
+ ```toml
97
+ deployments_path = "/Users/me/code/agent-deployments"
98
+ model = "claude-opus-4-7"
99
+ ```
100
+
101
+ ## Pointing at your own `agent-deployments`
102
+
103
+ Either set `AGENT_SCAFFOLD_DEPLOYMENTS_PATH`, write `deployments_path` to the TOML config, or pass `--deployments-path` to `agent-scaffold new`. The directory must contain `docs/recipes/*.md` files; cross-cutting / framework / pattern / stack docs are picked up automatically based on the recipe's references.
104
+
105
+ ## Adding a new target language
106
+
107
+ Drop a YAML file into [`src/agent_scaffold/languages/`](src/agent_scaffold/languages/) modeled after [python.yaml](src/agent_scaffold/languages/python.yaml) or [typescript.yaml](src/agent_scaffold/languages/typescript.yaml). Required keys:
108
+
109
+ - `language`, `package_manager`, `project_layout`, `entry_point`, `manifest`
110
+ - `required_tools` (formatter / type_checker / test)
111
+ - `pinned_dependencies`, `framework_dependencies`
112
+ - `forbidden`, `smoke_check`
113
+
114
+ The CLI reads them on demand; no code changes needed unless you also want a language-specific static-validation tier (see [`src/agent_scaffold/validator.py`](src/agent_scaffold/validator.py)).
115
+
116
+ ## Troubleshooting
117
+
118
+ ### Contract parse failures
119
+
120
+ If Claude returns malformed JSON, agent-scaffold:
121
+
122
+ 1. Saves the raw response to `~/.cache/agent-scaffold/failures/<timestamp>.json`.
123
+ 2. Prints a warning and asks Claude to repair the response.
124
+ 3. If the repair still fails, saves that raw response too and aborts with file pointers.
125
+
126
+ You can re-run `agent-scaffold new` with `AGENT_SCAFFOLD_CACHE_DIR` set to inspect failures elsewhere.
127
+
128
+ ### `--write-mode` choices
129
+
130
+ | Mode | Behavior |
131
+ | --- | --- |
132
+ | `abort` (default) | Refuse to write into a non-empty destination. |
133
+ | `skip` | Keep existing files, write only new ones. |
134
+ | `diff` | Show a unified diff per file and prompt before overwriting. |
135
+ | `overwrite` | Replace everything. |
136
+
137
+ All writes stage to a sibling temp directory and `os.replace` into place, so a failure mid-generation leaves the destination untouched.
138
+
139
+ ### Re-running validation
140
+
141
+ `agent-scaffold validate /path/to/generated --tier static|build|smoke` reruns one of the post-generation tiers without re-invoking the LLM.
142
+
143
+
144
+
145
+ ## License
146
+
147
+ MIT (see [LICENSE](LICENSE)).
@@ -0,0 +1,115 @@
1
+ # agent-scaffold
2
+
3
+ `agent-scaffold` generates runnable AI agent projects from markdown specs. It ships with bundled knowledge from [agent-deployments](https://github.com/jagguvarma15/agent-deployments) — pick a recipe, target language, and framework, and the CLI assembles the relevant docs, asks Claude to emit a complete project, validates the response, and writes the files atomically into your destination of choice.
4
+
5
+ ## Install
6
+
7
+ The package is published on PyPI as **`agent-scaffold-cli`** (the CLI command itself is still `agent-scaffold`).
8
+
9
+ ```bash
10
+ pipx install agent-scaffold-cli
11
+ # or
12
+ uv tool install agent-scaffold-cli
13
+ # or, for one-off use:
14
+ uvx --from agent-scaffold-cli agent-scaffold --help
15
+ ```
16
+
17
+ ### Local development
18
+
19
+ ```bash
20
+ git clone https://github.com/jagguvarma15/agent-scaffold
21
+ cd agent-scaffold
22
+ uv sync
23
+ ```
24
+
25
+ ## Quickstart
26
+
27
+ ```bash
28
+ export ANTHROPIC_API_KEY=sk-ant-...
29
+ agent-scaffold new
30
+ ```
31
+
32
+ The bundled recipes work out of the box. To use a custom agent-deployments checkout instead:
33
+
34
+ ```bash
35
+ export AGENT_SCAFFOLD_DEPLOYMENTS_PATH=/path/to/agent-deployments
36
+ agent-scaffold new
37
+ ```
38
+
39
+ The interactive `new` flow walks you through:
40
+
41
+ 1. The path to your `agent-deployments` repo (default from config).
42
+ 2. A recipe from `docs/recipes/*.md`.
43
+ 3. A target language (Python or TypeScript).
44
+ 4. A framework (e.g. `pydantic_ai`, `langgraph`, `vercel_ai_sdk`, or `none`).
45
+ 5. A project name and destination directory.
46
+
47
+ You'll see a context summary, a generation step, a static validation pass, and a "next steps" footer with the smoke-check command.
48
+
49
+ ## Configuration
50
+
51
+ | Source | Variable / key | Purpose |
52
+ | --- | --- | --- |
53
+ | Env | `ANTHROPIC_API_KEY` | Required. The Anthropic API key used by the generator. |
54
+ | Env | `AGENT_SCAFFOLD_DEPLOYMENTS_PATH` | Default path to your `agent-deployments` checkout. |
55
+ | Env | `AGENT_SCAFFOLD_MODEL` | Override the model (default `claude-opus-4-7`). |
56
+ | Env | `AGENT_SCAFFOLD_CACHE_DIR` | Override the cache root (default `~/.cache/agent-scaffold`). |
57
+ | Env | `AGENT_SCAFFOLD_CONFIG_PATH` | Override the TOML fallback location. |
58
+ | TOML | `~/.config/agent-scaffold/config.toml` | Fallback for `deployments_path` and `model`. |
59
+
60
+ Run `uv run agent-scaffold config` to print the resolved configuration (the API key is masked).
61
+
62
+ A typical config file:
63
+
64
+ ```toml
65
+ deployments_path = "/Users/me/code/agent-deployments"
66
+ model = "claude-opus-4-7"
67
+ ```
68
+
69
+ ## Pointing at your own `agent-deployments`
70
+
71
+ Either set `AGENT_SCAFFOLD_DEPLOYMENTS_PATH`, write `deployments_path` to the TOML config, or pass `--deployments-path` to `agent-scaffold new`. The directory must contain `docs/recipes/*.md` files; cross-cutting / framework / pattern / stack docs are picked up automatically based on the recipe's references.
72
+
73
+ ## Adding a new target language
74
+
75
+ Drop a YAML file into [`src/agent_scaffold/languages/`](src/agent_scaffold/languages/) modeled after [python.yaml](src/agent_scaffold/languages/python.yaml) or [typescript.yaml](src/agent_scaffold/languages/typescript.yaml). Required keys:
76
+
77
+ - `language`, `package_manager`, `project_layout`, `entry_point`, `manifest`
78
+ - `required_tools` (formatter / type_checker / test)
79
+ - `pinned_dependencies`, `framework_dependencies`
80
+ - `forbidden`, `smoke_check`
81
+
82
+ The CLI reads them on demand; no code changes needed unless you also want a language-specific static-validation tier (see [`src/agent_scaffold/validator.py`](src/agent_scaffold/validator.py)).
83
+
84
+ ## Troubleshooting
85
+
86
+ ### Contract parse failures
87
+
88
+ If Claude returns malformed JSON, agent-scaffold:
89
+
90
+ 1. Saves the raw response to `~/.cache/agent-scaffold/failures/<timestamp>.json`.
91
+ 2. Prints a warning and asks Claude to repair the response.
92
+ 3. If the repair still fails, saves that raw response too and aborts with file pointers.
93
+
94
+ You can re-run `agent-scaffold new` with `AGENT_SCAFFOLD_CACHE_DIR` set to inspect failures elsewhere.
95
+
96
+ ### `--write-mode` choices
97
+
98
+ | Mode | Behavior |
99
+ | --- | --- |
100
+ | `abort` (default) | Refuse to write into a non-empty destination. |
101
+ | `skip` | Keep existing files, write only new ones. |
102
+ | `diff` | Show a unified diff per file and prompt before overwriting. |
103
+ | `overwrite` | Replace everything. |
104
+
105
+ All writes stage to a sibling temp directory and `os.replace` into place, so a failure mid-generation leaves the destination untouched.
106
+
107
+ ### Re-running validation
108
+
109
+ `agent-scaffold validate /path/to/generated --tier static|build|smoke` reruns one of the post-generation tiers without re-invoking the LLM.
110
+
111
+
112
+
113
+ ## License
114
+
115
+ MIT (see [LICENSE](LICENSE)).
@@ -0,0 +1,103 @@
1
+ [project]
2
+ name = "agent-scaffold-cli"
3
+ version = "0.1.1"
4
+ description = "Generate runnable AI agent projects from markdown specs in the agent-deployments repo."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = { text = "MIT" }
8
+ authors = [{ name = "agent-scaffold contributors" }]
9
+ keywords = ["ai", "agent", "anthropic", "claude", "cli", "code-generation", "scaffolding"]
10
+ classifiers = [
11
+ "Development Status :: 4 - Beta",
12
+ "Environment :: Console",
13
+ "Intended Audience :: Developers",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Operating System :: OS Independent",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Topic :: Software Development :: Code Generators",
20
+ "Topic :: Software Development :: Build Tools",
21
+ ]
22
+ dependencies = [
23
+ "typer==0.12.5",
24
+ "click<8.2",
25
+ "questionary==2.0.1",
26
+ "rich==13.7.1",
27
+ "anthropic==0.39.0",
28
+ "pydantic==2.7.4",
29
+ "pyyaml==6.0.2",
30
+ ]
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/jagguvarma15/agent-scaffold"
34
+ Repository = "https://github.com/jagguvarma15/agent-scaffold"
35
+ Issues = "https://github.com/jagguvarma15/agent-scaffold/issues"
36
+ Changelog = "https://github.com/jagguvarma15/agent-scaffold/releases"
37
+
38
+ [project.scripts]
39
+ agent-scaffold = "agent_scaffold.cli:app"
40
+
41
+ [build-system]
42
+ requires = ["hatchling>=1.24"]
43
+ build-backend = "hatchling.build"
44
+
45
+ [tool.hatch.build]
46
+ exclude = ["**/.gitkeep"]
47
+
48
+ [tool.hatch.build.targets.wheel]
49
+ packages = ["src/agent_scaffold"]
50
+
51
+ # Bundled deployments docs are .gitignored (synced by scripts/sync_deployments.sh
52
+ # at build time), so the default VCS-aware package walk skips them. Force-include
53
+ # them into both the wheel and the sdist explicitly.
54
+ [tool.hatch.build.targets.wheel.force-include]
55
+ "src/agent_scaffold/_bundled_deployments/docs" = "agent_scaffold/_bundled_deployments/docs"
56
+
57
+ [tool.hatch.build.targets.sdist.force-include]
58
+ "src/agent_scaffold/_bundled_deployments/docs" = "src/agent_scaffold/_bundled_deployments/docs"
59
+
60
+ [tool.ruff]
61
+ line-length = 100
62
+ target-version = "py311"
63
+
64
+ [tool.ruff.lint]
65
+ select = ["E", "F", "I", "B", "UP", "W"]
66
+ ignore = ["E501"]
67
+
68
+ [tool.ruff.lint.per-file-ignores]
69
+ "tests/**" = ["B008"]
70
+ "src/agent_scaffold/cli.py" = ["B008"]
71
+
72
+ [tool.mypy]
73
+ python_version = "3.11"
74
+ strict = true
75
+ warn_unused_ignores = true
76
+ warn_redundant_casts = true
77
+ disallow_untyped_decorators = false
78
+ plugins = ["pydantic.mypy"]
79
+
80
+ [[tool.mypy.overrides]]
81
+ module = ["questionary.*"]
82
+ ignore_missing_imports = true
83
+
84
+ [tool.pytest.ini_options]
85
+ testpaths = ["tests"]
86
+ addopts = "-ra -q"
87
+ markers = ["integration: marks tests requiring network or external tools"]
88
+
89
+ [dependency-groups]
90
+ dev = [
91
+ "pytest==8.2.2",
92
+ "pytest-cov==5.0.0",
93
+ "ruff==0.6.9",
94
+ "mypy==1.11.2",
95
+ "types-PyYAML==6.0.12.20240917",
96
+ ]
97
+
98
+ [tool.coverage.run]
99
+ source = ["agent_scaffold"]
100
+
101
+ [tool.coverage.report]
102
+ show_missing = true
103
+ skip_empty = true
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+ # Sync agent-deployments docs into the bundled package data directory.
3
+ # Run this before building a release wheel.
4
+ set -euo pipefail
5
+
6
+ REPO_URL="${AGENT_DEPLOYMENTS_REPO:-https://github.com/jagguvarma15/agent-deployments.git}"
7
+ DEST="src/agent_scaffold/_bundled_deployments/docs"
8
+ TMP_DIR=$(mktemp -d)
9
+
10
+ echo "Cloning agent-deployments (shallow)..."
11
+ git clone --depth 1 "$REPO_URL" "$TMP_DIR"
12
+
13
+ echo "Copying docs into $DEST..."
14
+ rm -rf "$DEST"
15
+ mkdir -p "$DEST"
16
+
17
+ for subdir in recipes patterns frameworks stack cross-cutting; do
18
+ if [ -d "$TMP_DIR/docs/$subdir" ]; then
19
+ cp -r "$TMP_DIR/docs/$subdir" "$DEST/"
20
+ echo " copied docs/$subdir"
21
+ fi
22
+ done
23
+
24
+ rm -rf "$TMP_DIR"
25
+ echo "Done. Bundled docs ready at $DEST"
@@ -0,0 +1,8 @@
1
+ """agent-scaffold: generate runnable AI agent projects from markdown specs."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ try:
6
+ __version__ = version("agent-scaffold-cli")
7
+ except PackageNotFoundError:
8
+ __version__ = "0.0.0+unknown"
@@ -0,0 +1,6 @@
1
+ """Enable `python -m agent_scaffold`."""
2
+
3
+ from agent_scaffold.cli import app
4
+
5
+ if __name__ == "__main__":
6
+ app()
@@ -0,0 +1,15 @@
1
+ """Bundled agent-deployments docs for zero-config usage.
2
+
3
+ The docs/ directory is populated at build time by scripts/sync_deployments.sh.
4
+ When installed via PyPI/Homebrew, the bundled docs allow agent-scaffold to work
5
+ without requiring a separate agent-deployments clone.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from pathlib import Path
11
+
12
+
13
+ def bundled_docs_path() -> Path:
14
+ """Return the path to the bundled deployments root (contains docs/)."""
15
+ return Path(__file__).parent
@@ -0,0 +1,15 @@
1
+ # Cross-cutting Concerns
2
+
3
+ Shared production plumbing used by all agents. Each file answers: **"What production scaffolding do I need?"**
4
+
5
+ | Concern | Library (Py / TS) | Reference |
6
+ |---------|-------------------|-----------|
7
+ | [Auth](auth-jwt.md) | python-jose / hono-jwt | Inline implementation below |
8
+ | [Logging](logging-structured.md) | structlog / pino | Inline implementation below |
9
+ | [Observability](observability.md) | Langfuse SDK | Inline implementation below |
10
+ | [Rate Limiting](rate-limiting.md) | slowapi / hono-rate-limiter | Inline implementation below |
11
+ | [Testing](testing-strategy.md) | pytest + DeepEval / vitest + Promptfoo | Inline implementation below |
12
+
13
+ ## The 11-point production checklist
14
+
15
+ Every blueprint specifies these concerns. See [playbook/production-checklist.md](../playbook/production-checklist.md) for the full checklist.