agentsgen 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentsgen-0.2.1/LICENSE +21 -0
- agentsgen-0.2.1/PKG-INFO +538 -0
- agentsgen-0.2.1/README.md +513 -0
- agentsgen-0.2.1/pyproject.toml +79 -0
- agentsgen-0.2.1/setup.cfg +4 -0
- agentsgen-0.2.1/src/agentsgen/__init__.py +3 -0
- agentsgen-0.2.1/src/agentsgen/__main__.py +7 -0
- agentsgen-0.2.1/src/agentsgen/_smoke.py +123 -0
- agentsgen-0.2.1/src/agentsgen/actions.py +61 -0
- agentsgen-0.2.1/src/agentsgen/analyze.py +370 -0
- agentsgen-0.2.1/src/agentsgen/cli.py +35 -0
- agentsgen-0.2.1/src/agentsgen/cli_core.py +414 -0
- agentsgen-0.2.1/src/agentsgen/cli_extra.py +232 -0
- agentsgen-0.2.1/src/agentsgen/cli_pack.py +266 -0
- agentsgen-0.2.1/src/agentsgen/cli_support.py +213 -0
- agentsgen-0.2.1/src/agentsgen/cli_task.py +209 -0
- agentsgen-0.2.1/src/agentsgen/compat.py +18 -0
- agentsgen-0.2.1/src/agentsgen/config.py +248 -0
- agentsgen-0.2.1/src/agentsgen/config_io.py +15 -0
- agentsgen-0.2.1/src/agentsgen/constants.py +55 -0
- agentsgen-0.2.1/src/agentsgen/contracts.py +1262 -0
- agentsgen-0.2.1/src/agentsgen/detect/__init__.py +6 -0
- agentsgen-0.2.1/src/agentsgen/detect/detect.py +222 -0
- agentsgen-0.2.1/src/agentsgen/detect/fs.py +28 -0
- agentsgen-0.2.1/src/agentsgen/detect/github.py +21 -0
- agentsgen-0.2.1/src/agentsgen/detect/makefile.py +40 -0
- agentsgen-0.2.1/src/agentsgen/detect/model.py +35 -0
- agentsgen-0.2.1/src/agentsgen/detect/node.py +76 -0
- agentsgen-0.2.1/src/agentsgen/detect/python.py +127 -0
- agentsgen-0.2.1/src/agentsgen/flow_ops.py +249 -0
- agentsgen-0.2.1/src/agentsgen/generate.py +271 -0
- agentsgen-0.2.1/src/agentsgen/generated_artifacts.py +54 -0
- agentsgen-0.2.1/src/agentsgen/io_utils.py +35 -0
- agentsgen-0.2.1/src/agentsgen/llm.py +167 -0
- agentsgen-0.2.1/src/agentsgen/markers.py +167 -0
- agentsgen-0.2.1/src/agentsgen/mcp_server.py +384 -0
- agentsgen-0.2.1/src/agentsgen/meta.py +110 -0
- agentsgen-0.2.1/src/agentsgen/model.py +86 -0
- agentsgen-0.2.1/src/agentsgen/normalize.py +24 -0
- agentsgen-0.2.1/src/agentsgen/pack_engine.py +994 -0
- agentsgen-0.2.1/src/agentsgen/patch_engine.py +369 -0
- agentsgen-0.2.1/src/agentsgen/presets/__init__.py +63 -0
- agentsgen-0.2.1/src/agentsgen/presets/cli-node.agentsgen.json +52 -0
- agentsgen-0.2.1/src/agentsgen/presets/cli-python.agentsgen.json +53 -0
- agentsgen-0.2.1/src/agentsgen/presets/fastapi.agentsgen.json +52 -0
- agentsgen-0.2.1/src/agentsgen/presets/monorepo-js.agentsgen.json +53 -0
- agentsgen-0.2.1/src/agentsgen/presets/nextjs.agentsgen.json +53 -0
- agentsgen-0.2.1/src/agentsgen/presets/python-lib.agentsgen.json +52 -0
- agentsgen-0.2.1/src/agentsgen/providers/__init__.py +1 -0
- agentsgen-0.2.1/src/agentsgen/providers/anthropic.py +36 -0
- agentsgen-0.2.1/src/agentsgen/providers/openai.py +36 -0
- agentsgen-0.2.1/src/agentsgen/render.py +21 -0
- agentsgen-0.2.1/src/agentsgen/result_types.py +104 -0
- agentsgen-0.2.1/src/agentsgen/shared_sections.py +321 -0
- agentsgen-0.2.1/src/agentsgen/site_pack.py +154 -0
- agentsgen-0.2.1/src/agentsgen/stacks/__init__.py +18 -0
- agentsgen-0.2.1/src/agentsgen/stacks/base.py +20 -0
- agentsgen-0.2.1/src/agentsgen/stacks/node.py +79 -0
- agentsgen-0.2.1/src/agentsgen/stacks/python.py +60 -0
- agentsgen-0.2.1/src/agentsgen/stacks/static.py +27 -0
- agentsgen-0.2.1/src/agentsgen/task_loop.py +487 -0
- agentsgen-0.2.1/src/agentsgen/templates/common/prompts/execspec.md +14 -0
- agentsgen-0.2.1/src/agentsgen/templates/node/AGENTS.md.tpl +60 -0
- agentsgen-0.2.1/src/agentsgen/templates/node/RUNBOOK.md.tpl +19 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/CONTRIBUTING_AI.md.tpl +16 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/LLMS.md.tpl +25 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/README_SNIPPETS.md.tpl +23 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/SECURITY_AI.md.tpl +14 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/architecture.md.tpl +14 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/data-contracts.md.tpl +16 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/how-to-run.md.tpl +18 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/how-to-test.md.tpl +19 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/node/llms.txt.tpl +23 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/CONTRIBUTING_AI.md.tpl +16 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/LLMS.md.tpl +25 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/README_SNIPPETS.md.tpl +23 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/SECURITY_AI.md.tpl +14 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/architecture.md.tpl +14 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/data-contracts.md.tpl +16 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/how-to-run.md.tpl +18 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/how-to-test.md.tpl +19 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/python/llms.txt.tpl +23 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/CONTRIBUTING_AI.md.tpl +16 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/LLMS.md.tpl +25 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/README_SNIPPETS.md.tpl +23 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/SECURITY_AI.md.tpl +14 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/architecture.md.tpl +14 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/data-contracts.md.tpl +16 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/how-to-run.md.tpl +18 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/how-to-test.md.tpl +19 -0
- agentsgen-0.2.1/src/agentsgen/templates/pack/static/llms.txt.tpl +23 -0
- agentsgen-0.2.1/src/agentsgen/templates/python/AGENTS.md.tpl +60 -0
- agentsgen-0.2.1/src/agentsgen/templates/python/RUNBOOK.md.tpl +19 -0
- agentsgen-0.2.1/src/agentsgen/templates/shared/guardrails.md.j2 +59 -0
- agentsgen-0.2.1/src/agentsgen/templates/shared/repo_context.md.j2 +124 -0
- agentsgen-0.2.1/src/agentsgen/templates/shared/style.md.j2 +31 -0
- agentsgen-0.2.1/src/agentsgen/templates/shared/verification.md.j2 +30 -0
- agentsgen-0.2.1/src/agentsgen/templates/shared/workflow.md.j2 +43 -0
- agentsgen-0.2.1/src/agentsgen/templates/static/AGENTS.md.tpl +60 -0
- agentsgen-0.2.1/src/agentsgen/templates/static/RUNBOOK.md.tpl +19 -0
- agentsgen-0.2.1/src/agentsgen/templates.py +19 -0
- agentsgen-0.2.1/src/agentsgen/understand.py +51 -0
- agentsgen-0.2.1/src/agentsgen/understand_ast.py +326 -0
- agentsgen-0.2.1/src/agentsgen/understand_context.py +936 -0
- agentsgen-0.2.1/src/agentsgen/validators.py +168 -0
- agentsgen-0.2.1/src/agentsgen.egg-info/PKG-INFO +538 -0
- agentsgen-0.2.1/src/agentsgen.egg-info/SOURCES.txt +129 -0
- agentsgen-0.2.1/src/agentsgen.egg-info/dependency_links.txt +1 -0
- agentsgen-0.2.1/src/agentsgen.egg-info/entry_points.txt +3 -0
- agentsgen-0.2.1/src/agentsgen.egg-info/requires.txt +17 -0
- agentsgen-0.2.1/src/agentsgen.egg-info/top_level.txt +1 -0
- agentsgen-0.2.1/tests/test_actions_compat.py +63 -0
- agentsgen-0.2.1/tests/test_analyze_cli.py +103 -0
- agentsgen-0.2.1/tests/test_check_aggregate_cli.py +107 -0
- agentsgen-0.2.1/tests/test_cli_json_contracts.py +195 -0
- agentsgen-0.2.1/tests/test_contract_schema_snapshots.py +21 -0
- agentsgen-0.2.1/tests/test_contract_validators.py +658 -0
- agentsgen-0.2.1/tests/test_detect.py +69 -0
- agentsgen-0.2.1/tests/test_golden_outputs.py +78 -0
- agentsgen-0.2.1/tests/test_llm_enhance.py +195 -0
- agentsgen-0.2.1/tests/test_markers_property.py +44 -0
- agentsgen-0.2.1/tests/test_mcp_contracts.py +192 -0
- agentsgen-0.2.1/tests/test_meta_cli.py +116 -0
- agentsgen-0.2.1/tests/test_pack.py +135 -0
- agentsgen-0.2.1/tests/test_pack_cli.py +227 -0
- agentsgen-0.2.1/tests/test_presets_cli.py +58 -0
- agentsgen-0.2.1/tests/test_smoke_runtime.py +100 -0
- agentsgen-0.2.1/tests/test_snippets_cli.py +91 -0
- agentsgen-0.2.1/tests/test_status_cli.py +79 -0
- agentsgen-0.2.1/tests/test_task_cli.py +217 -0
- agentsgen-0.2.1/tests/test_understand_cli.py +340 -0
agentsgen-0.2.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anton Biletskiy
|
|
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.
|
agentsgen-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentsgen
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Generate and safely update AGENTS.md and RUNBOOK.md for coding agents
|
|
5
|
+
Author: Anton
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: typer<1.0,>=0.12
|
|
11
|
+
Requires-Dist: rich<14,>=13
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: pytest<10,>=8; extra == "dev"
|
|
14
|
+
Requires-Dist: pytest-cov<6,>=5; extra == "dev"
|
|
15
|
+
Requires-Dist: mypy<2,>=1.11; extra == "dev"
|
|
16
|
+
Requires-Dist: hypothesis<7,>=6.112; extra == "dev"
|
|
17
|
+
Requires-Dist: syrupy<5,>=4.7; extra == "dev"
|
|
18
|
+
Requires-Dist: ruff==0.6.9; extra == "dev"
|
|
19
|
+
Provides-Extra: llm
|
|
20
|
+
Requires-Dist: openai<2,>=1.35; extra == "llm"
|
|
21
|
+
Requires-Dist: anthropic<1,>=0.34; extra == "llm"
|
|
22
|
+
Provides-Extra: mcp
|
|
23
|
+
Requires-Dist: mcp<2,>=1.9; extra == "mcp"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# AGENTS.md Generator (`agentsgen`)
|
|
27
|
+
|
|
28
|
+
**Stop writing `AGENTS.md` by hand.** `agentsgen` generates and safely updates repo contracts for AI coding agents in seconds, without overwriting handwritten docs.
|
|
29
|
+
|
|
30
|
+
[](https://github.com/markoblogo/AGENTS.md_generator/actions/workflows/ci.yml)
|
|
31
|
+
[](https://github.com/markoblogo/AGENTS.md_generator/releases)
|
|
32
|
+
[](LICENSE)
|
|
33
|
+
[](pyproject.toml)
|
|
34
|
+
[](https://github.com/markoblogo/AGENTS.md_generator/actions/workflows/pages/pages-build-deployment)
|
|
35
|
+
|
|
36
|
+
Landing: https://agentsmd.abvx.xyz/
|
|
37
|
+
Manifest: https://github.com/markoblogo/AGENTS.md_generator/blob/main/docs/manifest.md
|
|
38
|
+
ID integration: https://github.com/markoblogo/ID/blob/main/docs/AGENTSGEN_INTEGRATION.md
|
|
39
|
+
Listed on ABVX Lab: https://lab.abvx.xyz/
|
|
40
|
+
Orchestrated with SET: https://github.com/markoblogo/SET
|
|
41
|
+
Human context with ID: https://github.com/markoblogo/ID
|
|
42
|
+
Reusable skills: https://github.com/markoblogo/abvx-agent-skills
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
## Why this exists
|
|
47
|
+
|
|
48
|
+
Most agent tooling still asks teams to hand-maintain repo instructions, copy/paste prompts, and hope nothing drifts.
|
|
49
|
+
`agentsgen` turns that into a small, reviewable system:
|
|
50
|
+
|
|
51
|
+
- generate `AGENTS.md` and `RUNBOOK.md`
|
|
52
|
+
- update only inside explicit markers
|
|
53
|
+
- emit machine-readable repo context for CI, MCP, and pack workflows
|
|
54
|
+
- fail safely to `*.generated.md` when a file is not marker-managed
|
|
55
|
+
|
|
56
|
+
## Works great with
|
|
57
|
+
|
|
58
|
+
- Cursor
|
|
59
|
+
- Claude Code
|
|
60
|
+
- Codex
|
|
61
|
+
- Copilot Workspace
|
|
62
|
+
- Aider
|
|
63
|
+
|
|
64
|
+
`agentsgen` is the repo-intelligence runtime in the ABVX ecosystem: use it directly in a repo, or call it through `SET` when you want one thin orchestration entrypoint.
|
|
65
|
+
It now ships a reliability-first core with split CLI/actions/understand modules, versioned JSON contracts across CLI and MCP surfaces, and opt-in LLM enhancement that falls back cleanly to local-only behavior.
|
|
66
|
+
Pair it with `ID` when you also need portable human-AI context and repo-local integration hooks across tools: `agentsgen pack` now emits a repo-local handoff manifest at `docs/ai/id-context.json` for that bridge. `ID` remains the human/profile layer: https://github.com/markoblogo/ID
|
|
67
|
+
Pair it with `abvx-agent-skills` when the agent needs reusable expert workflows for coding, frontend, audits, debugging, research, token economy, handoffs, and browser verification without bloating each repo's always-loaded AGENTS.md.
|
|
68
|
+
|
|
69
|
+
Small, production-grade CLI to generate and safely update:
|
|
70
|
+
|
|
71
|
+
- `AGENTS.md` (strict repo contract for coding agents)
|
|
72
|
+
- `RUNBOOK.md` (human-friendly command/run cheatsheet)
|
|
73
|
+
- proof-loop task artifacts under `docs/ai/tasks/`
|
|
74
|
+
|
|
75
|
+
## Why teams adopt it
|
|
76
|
+
|
|
77
|
+
| Option | Safe updates | Machine-readable output | Good for PR review | Repeatable across repos |
|
|
78
|
+
| --- | --- | --- | --- | --- |
|
|
79
|
+
| Handwritten `AGENTS.md` | No | No | Medium | Low |
|
|
80
|
+
| Ad-hoc prompt files | No | No | Low | Low |
|
|
81
|
+
| `agentsgen` | Yes | Yes | High | High |
|
|
82
|
+
|
|
83
|
+
## References
|
|
84
|
+
|
|
85
|
+
- https://arxiv.org/abs/2602.11988
|
|
86
|
+
- https://arxiv.org/abs/2602.20478
|
|
87
|
+
|
|
88
|
+
## ABVX companion layers
|
|
89
|
+
|
|
90
|
+
- `agentsgen` owns repo-scoped agent context: AGENTS.md, RUNBOOK.md, pack docs, command manifests, and drift checks.
|
|
91
|
+
- `ID` owns portable human context: preferences, privacy, handshakes, and cross-tool continuity.
|
|
92
|
+
- `SET` owns workflow execution: CI entrypoint, orchestration, registry flows, and proof loops.
|
|
93
|
+
- `abvx-agent-skills` owns reusable agent capabilities: compact SKILL.md workflows for coding, frontend, audits, debugging, research, token economy, handoffs, and browser verification, with skill cards, attribution, validation, and risk gates.
|
|
94
|
+
|
|
95
|
+
## Safety Model
|
|
96
|
+
|
|
97
|
+
The tool is safe-by-default and follows a strict 3-mode policy per file:
|
|
98
|
+
|
|
99
|
+
1. File missing: create it with marker sections.
|
|
100
|
+
2. File exists and markers exist: update only content inside markers.
|
|
101
|
+
3. File exists but markers missing: do not modify it; write `*.generated.md` instead.
|
|
102
|
+
|
|
103
|
+
- Optional review guideline for coding agents: `docs/agent-guidelines.md`.
|
|
104
|
+
|
|
105
|
+
Marker format:
|
|
106
|
+
|
|
107
|
+
```md
|
|
108
|
+
<!-- AGENTSGEN:START section=commands -->
|
|
109
|
+
... generated content ...
|
|
110
|
+
<!-- AGENTSGEN:END section=commands -->
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Install
|
|
114
|
+
|
|
115
|
+
Current stable install path:
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
pipx install git+https://github.com/markoblogo/AGENTS.md_generator.git
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
PyPI publishing is prepared in CI via trusted publishing. Once the package is live on PyPI, the install path becomes:
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
pip install agentsgen
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Contributor install:
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
python3 -m venv .venv
|
|
131
|
+
. .venv/bin/activate
|
|
132
|
+
pip install -e ".[dev]"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Optional experimental extras:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
pip install -e ".[llm,mcp]"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Quickstart
|
|
142
|
+
|
|
143
|
+
Canonical onboarding path for a new repo:
|
|
144
|
+
|
|
145
|
+
1. Install:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
pipx install git+https://github.com/markoblogo/AGENTS.md_generator.git
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
2. Bootstrap docs with autodetect:
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
agentsgen init . --defaults --autodetect
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Or start from a built-in preset:
|
|
158
|
+
|
|
159
|
+
```sh
|
|
160
|
+
agentsgen init . --preset nextjs
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
3. Add PR guard workflow (`.github/workflows/agentsgen-ci.yml`):
|
|
164
|
+
|
|
165
|
+
```yaml
|
|
166
|
+
name: agentsgen guard + pack check
|
|
167
|
+
|
|
168
|
+
on:
|
|
169
|
+
pull_request:
|
|
170
|
+
push:
|
|
171
|
+
branches: [ main ]
|
|
172
|
+
|
|
173
|
+
permissions:
|
|
174
|
+
contents: read
|
|
175
|
+
pull-requests: write
|
|
176
|
+
|
|
177
|
+
jobs:
|
|
178
|
+
agentsgen:
|
|
179
|
+
runs-on: ubuntu-latest
|
|
180
|
+
steps:
|
|
181
|
+
- uses: actions/checkout@v4
|
|
182
|
+
- uses: markoblogo/AGENTS.md_generator/.github/actions/agentsgen-guard@main
|
|
183
|
+
with:
|
|
184
|
+
comment: "true"
|
|
185
|
+
files: "AGENTS.md,RUNBOOK.md"
|
|
186
|
+
pack_check: "true"
|
|
187
|
+
pack_format: "json"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
4. Read-only repo snapshot:
|
|
191
|
+
|
|
192
|
+
```sh
|
|
193
|
+
agentsgen status .
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
5. Canonical README extracts for agents and CI:
|
|
197
|
+
|
|
198
|
+
```sh
|
|
199
|
+
agentsgen snippets .
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
6. Optional AI docs bundle:
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
agentsgen pack . --autodetect
|
|
206
|
+
cat agents.entrypoints.json
|
|
207
|
+
cat docs/ai/id-context.json
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
For public website mode:
|
|
211
|
+
|
|
212
|
+
```sh
|
|
213
|
+
agentsgen pack . --site https://example.com
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Companion guide for site-oriented AI visibility work: `docs/assets/llmo-quick-start.pdf`. For multi-repo orchestration, use `SET`: `https://github.com/markoblogo/SET`. For portable human-AI context across tools, pair with `ID`: `https://github.com/markoblogo/ID`
|
|
217
|
+
|
|
218
|
+
7. Profit: fewer agent mistakes, safer updates, better indexable repo context, and a stable machine-readable surface for CI/MCP callers.
|
|
219
|
+
|
|
220
|
+
Deep dives:
|
|
221
|
+
- Action options: `docs/gh-action.md`
|
|
222
|
+
- Pack bundle details: `docs/llmo-pack.md`
|
|
223
|
+
- Free AI visibility guide (PDF): `docs/assets/llmo-quick-start.pdf`
|
|
224
|
+
- Release process: `docs/release-checklist.md`
|
|
225
|
+
|
|
226
|
+
## Demo
|
|
227
|
+
|
|
228
|
+
Fastest manual walkthrough:
|
|
229
|
+
|
|
230
|
+
```sh
|
|
231
|
+
mkdir -p /tmp/agentsgen-demo && cd /tmp/agentsgen-demo
|
|
232
|
+
agentsgen init . --defaults --autodetect
|
|
233
|
+
agentsgen status .
|
|
234
|
+
agentsgen snippets .
|
|
235
|
+
agentsgen check . --all --ci
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Extended demo notes: [`demo/README.md`](demo/README.md)
|
|
239
|
+
|
|
240
|
+
## Presets
|
|
241
|
+
|
|
242
|
+
Presets are conservative starter `.agentsgen.json` templates for common repo shapes.
|
|
243
|
+
Use them to get explicit commands quickly, then edit the generated config to match your real toolchain. Pair them with `agentsgen status` for a read-only snapshot and `agentsgen snippets` for canonical README extracts.
|
|
244
|
+
|
|
245
|
+
```sh
|
|
246
|
+
agentsgen presets
|
|
247
|
+
agentsgen init . --preset nextjs
|
|
248
|
+
agentsgen init . --preset cli-python
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Recipes
|
|
252
|
+
|
|
253
|
+
Copy-paste starter kits (each includes an example `.agentsgen.json` with explicit commands + a PR Guard workflow snippet):
|
|
254
|
+
Pick one → copy .agentsgen.json to your repo root → run: agentsgen init . --defaults --autodetect
|
|
255
|
+
|
|
256
|
+
- **Python library (Poetry + pytest):** [`recipes/python-lib/`](recipes/python-lib/)
|
|
257
|
+
- **Next.js app (pnpm):** [`recipes/nextjs-app/`](recipes/nextjs-app/)
|
|
258
|
+
- **JS monorepo (workspaces):** [`recipes/monorepo-js/`](recipes/monorepo-js/)
|
|
259
|
+
- **Node CLI tool:** [`recipes/cli-tool/`](recipes/cli-tool/)
|
|
260
|
+
|
|
261
|
+
## GitHub Action: PR Guard
|
|
262
|
+
|
|
263
|
+
Use the reusable `agentsgen-guard` action to fail PRs when `AGENTS.md` / `RUNBOOK.md` are missing or out of date.
|
|
264
|
+
|
|
265
|
+
```yaml
|
|
266
|
+
name: agentsgen-guard
|
|
267
|
+
|
|
268
|
+
on:
|
|
269
|
+
pull_request:
|
|
270
|
+
|
|
271
|
+
permissions:
|
|
272
|
+
contents: read
|
|
273
|
+
# pull-requests: write # only if comment: "true"
|
|
274
|
+
|
|
275
|
+
jobs:
|
|
276
|
+
guard:
|
|
277
|
+
runs-on: ubuntu-latest
|
|
278
|
+
steps:
|
|
279
|
+
- uses: actions/checkout@v4
|
|
280
|
+
- uses: markoblogo/AGENTS.md_generator/.github/actions/agentsgen-guard@main
|
|
281
|
+
with:
|
|
282
|
+
path: "."
|
|
283
|
+
files: "AGENTS.md,RUNBOOK.md"
|
|
284
|
+
comment: "true"
|
|
285
|
+
pack_check: "true"
|
|
286
|
+
pack_format: "json"
|
|
287
|
+
# pack_autodetect: "true"
|
|
288
|
+
# pack_llms_format: "md"
|
|
289
|
+
# pack_output_dir: "docs/ai"
|
|
290
|
+
# pack_files: |
|
|
291
|
+
# llms
|
|
292
|
+
# SECURITY_AI.md
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
- Optional PR comment: use `comment: "false"` if you prefer log-only mode.
|
|
296
|
+
- Fork-safe by default: no extra secrets required.
|
|
297
|
+
- Most users only need these inputs: `comment`, `files`, `pack_check`.
|
|
298
|
+
- Advanced knobs: `pack_format`, `pack_autodetect`, `pack_llms_format`, `pack_output_dir`, `pack_files`.
|
|
299
|
+
- `files` input is an action-level filter for reported file findings; core validation still runs through `check_repo`.
|
|
300
|
+
- `pack_check: "true"` enforces `agentsgen pack --autodetect --check` in the same guard run.
|
|
301
|
+
- `pack` is still supported as a backward-compatible alias (deprecated; prefer `pack_check`).
|
|
302
|
+
- Example workflow: `.github/workflows/agentsgen-guard.example.yml`
|
|
303
|
+
- Full action docs: `docs/gh-action.md`
|
|
304
|
+
|
|
305
|
+
## Usage
|
|
306
|
+
|
|
307
|
+
```sh
|
|
308
|
+
agentsgen init
|
|
309
|
+
agentsgen presets
|
|
310
|
+
agentsgen init . --preset nextjs
|
|
311
|
+
agentsgen update
|
|
312
|
+
agentsgen pack
|
|
313
|
+
agentsgen snippets .
|
|
314
|
+
agentsgen snippets . --check
|
|
315
|
+
agentsgen check
|
|
316
|
+
agentsgen check . --pack-check
|
|
317
|
+
agentsgen check . --all --ci
|
|
318
|
+
agentsgen check . --format json
|
|
319
|
+
agentsgen doctor . --all --ci
|
|
320
|
+
agentsgen status .
|
|
321
|
+
agentsgen status . --format json
|
|
322
|
+
agentsgen detect . --format json
|
|
323
|
+
agentsgen analyze https://example.com
|
|
324
|
+
agentsgen meta https://example.com
|
|
325
|
+
agentsgen task init proof-loop-v0 . --summary "Capture proof artifacts for this task"
|
|
326
|
+
agentsgen task evidence proof-loop-v0 . --check "pytest=passed" --check "ruff=passed"
|
|
327
|
+
agentsgen task verdict proof-loop-v0 . --status needs-review --summary "Manual review still pending"
|
|
328
|
+
agentsgen init --defaults --stack python --dry-run --print-diff
|
|
329
|
+
pipx uninstall agentsgen
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
agentsgen status is a read-only overview of managed files, markers, generated fallbacks, and pack drift.
|
|
333
|
+
It is lighter and more diagnostic than `agentsgen check`, which focuses on repo readiness errors/warnings.
|
|
334
|
+
`agentsgen doctor` is an exact alias for `agentsgen check`.
|
|
335
|
+
Invalid `.agentsgen.json` files now fail as structured CLI errors instead of raw tracebacks.
|
|
336
|
+
`agentsgen status --format json` includes pack-level findings and pack-level errors for machine consumers.
|
|
337
|
+
`agentsgen task evidence` and `agentsgen task verdict` now write richer summaries for checks, artifacts, decision state, and review readiness under `docs/ai/tasks/<task-id>/`.
|
|
338
|
+
|
|
339
|
+
`agentsgen check` can also aggregate optional drift checks:
|
|
340
|
+
- `agentsgen check . --pack-check` adds `pack --check`
|
|
341
|
+
- `agentsgen check . --all` enables both pack and snippets checks
|
|
342
|
+
- `agentsgen check . --format json` emits a stable machine-readable payload
|
|
343
|
+
- `agentsgen check . --ci` prints a compact CI summary without path-heavy log noise
|
|
344
|
+
- `agentsgen pack . --site https://example.com` generates a site-oriented `llms.txt` from the homepage and sitemap
|
|
345
|
+
|
|
346
|
+
## Experimental surfaces
|
|
347
|
+
|
|
348
|
+
These features are opt-in and do not change the default local-only CLI path.
|
|
349
|
+
|
|
350
|
+
- `agentsgen init . --llm-enhance --llm-provider openai`
|
|
351
|
+
- `agentsgen update . --llm-enhance --llm-provider anthropic`
|
|
352
|
+
- `agentsgen mcp`
|
|
353
|
+
|
|
354
|
+
Experimental notes:
|
|
355
|
+
|
|
356
|
+
- `--llm-enhance` only appends narrative context sections grounded in local `understand` artifacts.
|
|
357
|
+
- Provider failures and timeouts fall back to local-only generation.
|
|
358
|
+
- MCP currently exposes read and write tools with versioned JSON contracts for `status`, `check`, `detect`, `understand`, `init`, `update`, and `pack`.
|
|
359
|
+
- Install optional extras first: `pip install -e ".[llm,mcp]"`.
|
|
360
|
+
- Provider-specific notes: `docs/experimental-llm.md`.
|
|
361
|
+
|
|
362
|
+
## README Snippets (mini-validator)
|
|
363
|
+
|
|
364
|
+
Use snippet markers in `README.md` to define canonical agent-facing extracts without editing generated output by hand.
|
|
365
|
+
The command writes `README_SNIPPETS.generated.md`.
|
|
366
|
+
|
|
367
|
+
Marker format:
|
|
368
|
+
|
|
369
|
+
```md
|
|
370
|
+
<!-- AGENTSGEN:SNIPPET name=install -->
|
|
371
|
+
python -m pip install -e ".[dev]"
|
|
372
|
+
<!-- AGENTSGEN:ENDSNIPPET -->
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
```sh
|
|
376
|
+
agentsgen snippets .
|
|
377
|
+
agentsgen snippets . --check
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Proof-loop v0
|
|
381
|
+
|
|
382
|
+
For larger tasks, `agentsgen` can keep a lightweight proof bundle in-repo:
|
|
383
|
+
|
|
384
|
+
- `docs/ai/tasks/<task-id>/contract.md`
|
|
385
|
+
- `docs/ai/tasks/<task-id>/evidence.json`
|
|
386
|
+
- `docs/ai/tasks/<task-id>/verdict.json`
|
|
387
|
+
|
|
388
|
+
```sh
|
|
389
|
+
agentsgen task init proof-loop-v0 . --summary "Capture proof artifacts for this task"
|
|
390
|
+
agentsgen task evidence proof-loop-v0 . --check "pytest=passed"
|
|
391
|
+
agentsgen task verdict proof-loop-v0 . --status needs-review --summary "Manual review still pending"
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Pack bundle
|
|
395
|
+
|
|
396
|
+
`agentsgen pack` generates an AI-readable documentation bundle:
|
|
397
|
+
|
|
398
|
+
- `llms.txt` (or `LLMS.md` with `--llms-format md`)
|
|
399
|
+
- `agents.entrypoints.json` (machine-readable command manifest for agents/CI)
|
|
400
|
+
- `docs/ai/id-context.json` (machine-readable repo handoff manifest for `ID`-compatible flows)
|
|
401
|
+
- `docs/ai/how-to-run.md`
|
|
402
|
+
- `docs/ai/how-to-test.md`
|
|
403
|
+
- `docs/ai/architecture.md`
|
|
404
|
+
- `docs/ai/data-contracts.md`
|
|
405
|
+
- `SECURITY_AI.md`
|
|
406
|
+
- `CONTRIBUTING_AI.md`
|
|
407
|
+
- `README_SNIPPETS.md`
|
|
408
|
+
|
|
409
|
+
New:
|
|
410
|
+
- `agents.entrypoints.json` — a machine-readable manifest of repo commands (install/test/lint/build/run) derived from `.agentsgen.json` / autodetect.
|
|
411
|
+
- `docs/ai/id-context.json` — a repo-scoped handoff manifest that gives `ID` a stable entrypoint into repo docs, command manifests, repomap artifacts, and proof-loop surfaces.
|
|
412
|
+
|
|
413
|
+
By default, pack writes AI docs into docs/ai/ (override via pack_output_dir).
|
|
414
|
+
Use --print-plan to preview what pack will write.
|
|
415
|
+
|
|
416
|
+
What it is:
|
|
417
|
+
- a compact, agent-first context bundle for coding agents and LLM indexing.
|
|
418
|
+
|
|
419
|
+
## Repo understanding artifacts
|
|
420
|
+
|
|
421
|
+
`agentsgen understand` generates a deterministic repo map, compact token-budgeted map, import graph, and machine-readable knowledge file.
|
|
422
|
+
It uses local heuristics only: no network calls, no LLM calls.
|
|
423
|
+
Artifacts are written with the same safe update policy used elsewhere in `agentsgen`.
|
|
424
|
+
|
|
425
|
+
`agentsgen understand .`
|
|
426
|
+
`agentsgen understand . --compact-budget 4000`
|
|
427
|
+
`agentsgen understand . --focus cli`
|
|
428
|
+
`agentsgen understand . --changed`
|
|
429
|
+
|
|
430
|
+
Artifacts:
|
|
431
|
+
- `docs/ai/repomap.md`
|
|
432
|
+
- `docs/ai/repomap.compact.md`
|
|
433
|
+
- `docs/ai/graph.mmd`
|
|
434
|
+
- `agents.knowledge.json`
|
|
435
|
+
|
|
436
|
+
`repomap.compact.md` ranks files by import graph signals, entrypoint proximity, and local git changes, then trims the output to an approximate token budget for agent context handoff.
|
|
437
|
+
Use `--focus <query>` for a query-specific slice, or `--changed` to bias the compact map toward current git changes and their immediate import neighbors.
|
|
438
|
+
|
|
439
|
+
What it is not:
|
|
440
|
+
- not a traffic/SEO promise, and not a full developer handbook replacement.
|
|
441
|
+
|
|
442
|
+
`agentsgen analyze` audits a public URL and writes `docs/ai/llmo-score.json`.
|
|
443
|
+
It uses deterministic heuristics by default and can add an optional advisory AI review with `--use-ai`.
|
|
444
|
+
|
|
445
|
+
`agentsgen meta` generates `docs/ai/llmo-meta.json` with AI-oriented title, description, keywords, and short description suggestions for a public URL.
|
|
446
|
+
|
|
447
|
+
Companion guide for these public-site workflows: `docs/assets/llmo-quick-start.pdf`.
|
|
448
|
+
|
|
449
|
+
### Why it matters
|
|
450
|
+
- **Less agent babysitting.** Repos with `AGENTS.md` + `docs/ai/` reduce back-and-forth and "where is X?" questions for Codex/Claude.
|
|
451
|
+
- **Safer automation by default.** Marker-only updates + `*.generated.*` fallback prevents accidental overwrites of hand-written docs.
|
|
452
|
+
- **CI keeps it honest.** `agentsgen-guard` + `agentsgen pack --check` catches drift early, before docs rot and agents start hallucinating.
|
|
453
|
+
|
|
454
|
+
Safety model is identical to `init`/`update`:
|
|
455
|
+
|
|
456
|
+
1. Missing file -> create with markers.
|
|
457
|
+
2. Existing file with markers -> update only marker sections.
|
|
458
|
+
3. Existing file without markers -> keep original and write `*.generated.*`.
|
|
459
|
+
|
|
460
|
+
See full details: `docs/llmo-pack.md`.
|
|
461
|
+
|
|
462
|
+
## Known Limitations
|
|
463
|
+
|
|
464
|
+
- Auto-detect is intentionally conservative (file heuristics only; no “smart” analysis).
|
|
465
|
+
- Monorepos may detect as `mixed`, and commands can be empty on purpose (better empty than wrong).
|
|
466
|
+
- If a Makefile exists, Makefile targets win over other toolchains by design.
|
|
467
|
+
- Templates are still intentionally minimal: `python`, `node`, `static`.
|
|
468
|
+
- The tool only owns content inside `AGENTSGEN` marker sections; keep custom content outside markers.
|
|
469
|
+
|
|
470
|
+
## Landing Page (GitHub Pages)
|
|
471
|
+
|
|
472
|
+
This repo includes a minimal one-page landing in `docs/index.html`.
|
|
473
|
+
|
|
474
|
+
- GitHub: Settings -> Pages
|
|
475
|
+
- Source: Deploy from a branch
|
|
476
|
+
- Branch: `main`
|
|
477
|
+
- Folder: `/docs`
|
|
478
|
+
|
|
479
|
+
## Experimental: ASCII theme (landing)
|
|
480
|
+
|
|
481
|
+
- The landing page includes an experimental ASCII theme as a visual/UX experiment.
|
|
482
|
+
- Toggle it from the header next to the light/dark switch.
|
|
483
|
+
- The setting is saved in localStorage.
|
|
484
|
+
- This is UI-only and does not affect the generator output.
|
|
485
|
+
- Reuse pointers:
|
|
486
|
+
- `docs/ascii/ascii.css`
|
|
487
|
+
- `docs/ascii/ascii.js`
|
|
488
|
+
|
|
489
|
+
## Snapshot Commits
|
|
490
|
+
|
|
491
|
+
If you want cheap “backup commits” with a green-test gate:
|
|
492
|
+
|
|
493
|
+
```sh
|
|
494
|
+
make snapshot
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
This runs `ruff format`, `ruff check`, `pytest`, then commits only if there are changes and tests are green.
|
|
498
|
+
|
|
499
|
+
## Local Smoke
|
|
500
|
+
|
|
501
|
+
Run the built-in smoke entrypoint directly from the activated virtualenv:
|
|
502
|
+
|
|
503
|
+
```sh
|
|
504
|
+
python -m agentsgen._smoke
|
|
505
|
+
pytest -q
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
Release automation uses the same smoke entrypoint before tagging.
|
|
509
|
+
|
|
510
|
+
## Definition Of Done (DoD)
|
|
511
|
+
|
|
512
|
+
- `agentsgen init` works in an empty folder and creates:
|
|
513
|
+
- `.agentsgen.json`
|
|
514
|
+
- `AGENTS.md`
|
|
515
|
+
- `RUNBOOK.md`
|
|
516
|
+
- `agentsgen update`:
|
|
517
|
+
- updates only marker sections
|
|
518
|
+
- preserves content outside markers
|
|
519
|
+
- writes `*.generated.md` if markers are missing
|
|
520
|
+
- `agentsgen check` returns non-zero exit code on problems
|
|
521
|
+
- 3 builtin smoke tests exist: `python -m agentsgen._smoke`
|
|
522
|
+
- init in empty dir creates files
|
|
523
|
+
- edit outside markers persists after update
|
|
524
|
+
- no-markers files produce `*.generated.md` and leave originals untouched
|
|
525
|
+
- recommended local smoke entrypoint: `python -m agentsgen._smoke`
|
|
526
|
+
|
|
527
|
+
## Contributing
|
|
528
|
+
|
|
529
|
+
Template PRs welcome (shared sections and stack-specific notes).
|
|
530
|
+
|
|
531
|
+
## Releasing
|
|
532
|
+
|
|
533
|
+
- Use checklist: `docs/release-checklist.md`
|
|
534
|
+
- Run releases from an activated venv (`. .venv/bin/activate`); the script also auto-prefers `.venv/bin/python` when present.
|
|
535
|
+
- Write release notes: `RELEASES/template.md -> RELEASES/vX.Y.Z.md`
|
|
536
|
+
- Run: `./scripts/release.sh vX.Y.Z A|B|C`
|
|
537
|
+
- Shorthand: `./scripts/release.sh A` (auto-suggests next version)
|
|
538
|
+
- Tags follow `vX.Y.Z` and should point to the release commit
|