agents-md-kit 0.0.0-stage → 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +162 -2
- package/bin/agent-kit.js +6 -0
- package/core/files/.claude/settings.json +16 -0
- package/core/files/.claude/skills/agent-memory-protocol/SKILL.md +117 -0
- package/core/files/.claude/skills/api-design-rest/SKILL.md +126 -0
- package/core/files/.claude/skills/backend-architecture-principles/SKILL.md +116 -0
- package/core/files/.claude/skills/backend-security/SKILL.md +117 -0
- package/core/files/.claude/skills/changelog-and-versioning/SKILL.md +169 -0
- package/core/files/.claude/skills/database-best-practices/SKILL.md +104 -0
- package/core/files/.claude/skills/git-commit-and-workflow/SKILL.md +140 -0
- package/core/files/.claude/skills/project-management-workflow/SKILL.md +181 -0
- package/core/files/CLAUDE.md +1 -0
- package/core/files/MEMORY.md +77 -0
- package/core/files/docs/adr/0000-template.md +21 -0
- package/core/fragments/agents-core.md +61 -0
- package/core/manifest.txt +21 -0
- package/docs/monorepo.md +72 -0
- package/package.json +50 -4
- package/packs/github/files/.github/ISSUE_TEMPLATE/bug_report.md +22 -0
- package/packs/github/files/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/packs/github/files/.github/pull_request_template.md +24 -0
- package/packs/github/files/.github/workflows/pr-title.yml +37 -0
- package/packs/github/manifest.txt +6 -0
- package/packs/web/files/.claude/skills/html-syntax-and-semantics/SKILL.md +127 -0
- package/packs/web/files/.claude/skills/seo-best-practices/SKILL.md +158 -0
- package/packs/web/fragments/agents-web.md +11 -0
- package/packs/web/manifest.txt +5 -0
- package/presets/node-backend/docs/node-backend.md +60 -0
- package/presets/node-backend/files/.editorconfig +12 -0
- package/presets/node-backend/files/.husky/commit-msg +1 -0
- package/presets/node-backend/files/.husky/pre-commit +1 -0
- package/presets/node-backend/files/.lintstagedrc.json +4 -0
- package/presets/node-backend/files/.prettierrc.json +7 -0
- package/presets/node-backend/files/.release-please-manifest.json +3 -0
- package/presets/node-backend/files/CHANGELOG.md +5 -0
- package/presets/node-backend/files/commitlint.config.mjs +12 -0
- package/presets/node-backend/files/eslint.config.mjs +38 -0
- package/presets/node-backend/files/release-please-config.json +25 -0
- package/presets/node-backend/fragments/agents-node-backend-github.md +7 -0
- package/presets/node-backend/fragments/agents-node-backend.md +13 -0
- package/presets/node-backend/fragments/gitignore.txt +19 -0
- package/presets/node-backend/fragments/prettierignore.txt +16 -0
- package/presets/node-backend/github/dependabot.yml +21 -0
- package/presets/node-backend/github/workflows/ci.yml +38 -0
- package/presets/node-backend/github/workflows/release-please.yml +21 -0
- package/presets/node-backend/manifest.txt +30 -0
- package/presets/python/docs/python.md +66 -0
- package/presets/python/files/.editorconfig +15 -0
- package/presets/python/files/.pre-commit-config.yaml +32 -0
- package/presets/python/files/.release-please-manifest.json +3 -0
- package/presets/python/files/CHANGELOG.md +5 -0
- package/presets/python/files/mypy.ini +5 -0
- package/presets/python/files/pytest.ini +6 -0
- package/presets/python/files/release-please-config.json +25 -0
- package/presets/python/files/ruff.toml +17 -0
- package/presets/python/fragments/agents-python-github.md +7 -0
- package/presets/python/fragments/agents-python.md +14 -0
- package/presets/python/fragments/gitignore.txt +25 -0
- package/presets/python/github/dependabot.yml +18 -0
- package/presets/python/github/workflows/ci.yml +37 -0
- package/presets/python/github/workflows/release-please.yml +21 -0
- package/presets/python/manifest.txt +25 -0
- package/presets/react-typescript/docs/react-typescript.md +71 -0
- package/presets/react-typescript/files/.claude/skills/react-principles/SKILL.md +264 -0
- package/presets/react-typescript/files/.editorconfig +12 -0
- package/presets/react-typescript/files/.husky/commit-msg +1 -0
- package/presets/react-typescript/files/.husky/pre-commit +1 -0
- package/presets/react-typescript/files/.lintstagedrc.json +4 -0
- package/presets/react-typescript/files/.prettierrc.json +7 -0
- package/presets/react-typescript/files/.release-please-manifest.json +3 -0
- package/presets/react-typescript/files/CHANGELOG.md +5 -0
- package/presets/react-typescript/files/commitlint.config.mjs +12 -0
- package/presets/react-typescript/files/eslint.config.mjs +55 -0
- package/presets/react-typescript/files/release-please-config.json +25 -0
- package/presets/react-typescript/fragments/agents-react-typescript-github.md +7 -0
- package/presets/react-typescript/fragments/agents-react-typescript.md +17 -0
- package/presets/react-typescript/fragments/gitignore.txt +22 -0
- package/presets/react-typescript/fragments/prettierignore.txt +17 -0
- package/presets/react-typescript/github/dependabot.yml +21 -0
- package/presets/react-typescript/github/workflows/ci.yml +38 -0
- package/presets/react-typescript/github/workflows/release-please.yml +21 -0
- package/presets/react-typescript/manifest.txt +32 -0
- package/src/blocks.js +132 -0
- package/src/cli.js +159 -0
- package/src/fsutil.js +123 -0
- package/src/install.js +223 -0
- package/src/manifest.js +187 -0
- package/src/validate.js +324 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# description: Node.js + TypeScript backend tooling: ESLint (typescript-eslint, Node globals), Prettier, commitlint + husky + lint-staged. With --pack github: CI, release-please, Dependabot.
|
|
2
|
+
|
|
3
|
+
# Commands the installer prints for the user (it never edits package.json / pyproject.toml):
|
|
4
|
+
# run: npm install -D eslint @eslint/js typescript typescript-eslint globals eslint-config-prettier prettier husky lint-staged @commitlint/cli @commitlint/config-conventional
|
|
5
|
+
# run: npm pkg set scripts.prepare="husky" scripts.lint="eslint ." scripts.format="prettier --write ." scripts.format:check="prettier --check ." scripts.typecheck="tsc --noEmit"
|
|
6
|
+
# run: npm run prepare
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
block node-backend AGENTS.md agents-node-backend.md
|
|
10
|
+
copy eslint.config.mjs
|
|
11
|
+
copy .prettierrc.json
|
|
12
|
+
block node-backend .prettierignore prettierignore.txt style=hash
|
|
13
|
+
copy .editorconfig
|
|
14
|
+
block node-backend .gitignore gitignore.txt style=hash
|
|
15
|
+
copy .lintstagedrc.json
|
|
16
|
+
copy .husky/pre-commit
|
|
17
|
+
copy .husky/commit-msg
|
|
18
|
+
copy commitlint.config.mjs
|
|
19
|
+
copy docs/agent-kit/node-backend.md from=docs/node-backend.md
|
|
20
|
+
|
|
21
|
+
# GitHub-only: CI, Dependabot and release-please (release-please runs as a GitHub Action,
|
|
22
|
+
# so its config and the generated CHANGELOG.md come with it; without GitHub, the
|
|
23
|
+
# changelog-and-versioning skill uses manual mode).
|
|
24
|
+
block node-backend-github AGENTS.md agents-node-backend-github.md requires=github
|
|
25
|
+
copy .github/workflows/ci.yml requires=github from=github/workflows/ci.yml
|
|
26
|
+
copy .github/workflows/release-please.yml requires=github from=github/workflows/release-please.yml
|
|
27
|
+
copy .github/dependabot.yml requires=github from=github/dependabot.yml
|
|
28
|
+
copy release-please-config.json requires=github
|
|
29
|
+
copy .release-please-manifest.json requires=github
|
|
30
|
+
copy-once CHANGELOG.md requires=github
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# python preset: setup
|
|
2
|
+
|
|
3
|
+
Installed by agent-kit. This preset adds Python tooling that does **not** need Node in your project: Ruff (lint + format), pytest, optional mypy, and git hooks through the [pre-commit](https://pre-commit.com) framework (Conventional Commit messages, Ruff, YAML/TOML/JSON syntax checks). With `--pack github` it also adds CI, release-please (`release-type: python`) and Dependabot.
|
|
4
|
+
|
|
5
|
+
All configuration lives in standalone files (`ruff.toml`, `pytest.ini`, `mypy.ini`, `.pre-commit-config.yaml`). The installer never edits `pyproject.toml`. Keep tool settings out of it too, or the two sources will disagree. Note that `pytest.ini` takes precedence over `[tool.pytest.ini_options]`.
|
|
6
|
+
|
|
7
|
+
## 1. Install the tools and the hooks
|
|
8
|
+
|
|
9
|
+
Use whatever you use for dev dependencies (pip, uv, Poetry, pipx). With pip in a virtualenv:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
python -m pip install ruff==0.17.4 pytest pre-commit # add mypy if you keep mypy.ini
|
|
13
|
+
pre-commit install # installs the pre-commit and commit-msg hooks
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`default_install_hook_types` in `.pre-commit-config.yaml` makes `pre-commit install` set up both hook types. The pinned hook revisions (verified 2026-11-11):
|
|
17
|
+
|
|
18
|
+
| Hook repo | rev | Hooks |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `astral-sh/ruff-pre-commit` | `v0.17.4` | `ruff-check --fix`, `ruff-format` |
|
|
21
|
+
| `pre-commit/pre-commit-hooks` | `v6.0.0` | `check-yaml`, `check-toml`, `check-json`, `check-merge-conflict`, `check-added-large-files` |
|
|
22
|
+
| `compilerla/conventional-pre-commit` | `v4.5.0` | `conventional-pre-commit` (commit-msg stage) |
|
|
23
|
+
|
|
24
|
+
Update them with `pre-commit autoupdate`, and keep the `ruff==` pin in `.github/workflows/ci.yml` in sync with the ruff-pre-commit rev.
|
|
25
|
+
|
|
26
|
+
## 2. Check it works
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
ruff check .
|
|
30
|
+
ruff format --check .
|
|
31
|
+
pytest
|
|
32
|
+
mypy src # optional
|
|
33
|
+
git commit -m "Added stuff." # rejected by the commit-msg hook
|
|
34
|
+
git commit -m "feat: add totals" # accepted
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The commit-msg hook checks the Conventional Commits format and the allowed types. It does not enforce the 72-character header limit that commitlint enforces in the Node presets. Keep headers short anyway (see the `git-commit-and-workflow` skill).
|
|
38
|
+
|
|
39
|
+
## 3. GitHub repository settings (only with `--pack github`)
|
|
40
|
+
|
|
41
|
+
1. **Pull requests: allow squash merging only**, with *Default to pull request title* as the commit message. This makes the PR title the release note.
|
|
42
|
+
2. **Branch protection on `main`**: require a pull request, require the `checks` and `pr-title` status checks, block force pushes.
|
|
43
|
+
3. **Actions > General > Workflow permissions**: *Read and write*, and tick **Allow GitHub Actions to create and approve pull requests** (needed by release-please).
|
|
44
|
+
4. Optional: add a `RELEASE_PLEASE_TOKEN` secret (PAT or GitHub App token) and pass it in `.github/workflows/release-please.yml`, so CI also runs on the release PR.
|
|
45
|
+
|
|
46
|
+
CI (`.github/workflows/ci.yml`) installs Ruff and pytest, then `requirements.txt` / `requirements-dev.txt` if present and the project itself (`pip install -e .`) if `pyproject.toml` exists, and runs `ruff check`, `ruff format --check` and `pytest`. Adjust the install step if you use uv or Poetry. pytest exits with code 5 when it collects no tests, so add at least one test before enabling CI.
|
|
47
|
+
|
|
48
|
+
## 4. What release-please expects (only with `--pack github`)
|
|
49
|
+
|
|
50
|
+
With `release-type: python`, merging the release PR updates `CHANGELOG.md`, tags `vX.Y.Z`, and bumps the version in these files when they exist:
|
|
51
|
+
|
|
52
|
+
- `pyproject.toml`: a **static** `version = "..."` under `[project]` (or `[tool.poetry]`). A `dynamic = ["version"]` setup is not bumped.
|
|
53
|
+
- `setup.py` and `setup.cfg`.
|
|
54
|
+
- `<package>/__init__.py` or `src/<package>/__init__.py` (`__version__ = "..."`), where the package name comes from `[project] name` (dashes also tried as underscores).
|
|
55
|
+
- Any `version.py`.
|
|
56
|
+
|
|
57
|
+
The first release starts from `0.0.0` in `.release-please-manifest.json`. Set `version = "0.0.0"` in `pyproject.toml` to match, or put your current version in the manifest. `feat` is Added, `fix` is Fixed, `perf` and `revert` are Changed; other types are hidden.
|
|
58
|
+
|
|
59
|
+
Without the github pack, release-please files are not installed and the `changelog-and-versioning` skill uses manual mode.
|
|
60
|
+
|
|
61
|
+
## 5. Customize
|
|
62
|
+
|
|
63
|
+
- **Rules:** edit `select` in `ruff.toml`. Set `target-version` there if you have no `requires-python`.
|
|
64
|
+
- **Types:** delete `mypy.ini` if you don't type-check; otherwise add mypy to CI and, if you like, as a pre-commit hook (`pre-commit/mirrors-mypy`).
|
|
65
|
+
- **Ignore lists:** add your own lines to `.gitignore` outside the `agent-kit` markers.
|
|
66
|
+
- **Not using release-please?** Delete `release-please-config.json`, `.release-please-manifest.json` and `.github/workflows/release-please.yml`; the `changelog-and-versioning` skill switches to manual mode.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 4
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.{yml,yaml,json,toml}]
|
|
12
|
+
indent_size = 2
|
|
13
|
+
|
|
14
|
+
[*.md]
|
|
15
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Git hooks via the pre-commit framework (https://pre-commit.com). No Node needed.
|
|
2
|
+
# Run once per clone: pre-commit install
|
|
3
|
+
# (default_install_hook_types makes that install both the pre-commit and commit-msg hooks.)
|
|
4
|
+
# Update the pinned revs with: pre-commit autoupdate
|
|
5
|
+
default_install_hook_types: [pre-commit, commit-msg]
|
|
6
|
+
# Hooks without an explicit `stages` run only before commits, not again on the message.
|
|
7
|
+
default_stages: [pre-commit]
|
|
8
|
+
|
|
9
|
+
repos:
|
|
10
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
11
|
+
rev: v0.17.4
|
|
12
|
+
hooks:
|
|
13
|
+
- id: ruff-check
|
|
14
|
+
args: [--fix]
|
|
15
|
+
- id: ruff-format
|
|
16
|
+
|
|
17
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
18
|
+
rev: v6.0.0
|
|
19
|
+
hooks:
|
|
20
|
+
- id: check-yaml
|
|
21
|
+
- id: check-toml
|
|
22
|
+
- id: check-json
|
|
23
|
+
- id: check-merge-conflict
|
|
24
|
+
- id: check-added-large-files
|
|
25
|
+
|
|
26
|
+
# Conventional Commits on every commit message (types match the git-commit-and-workflow skill).
|
|
27
|
+
- repo: https://github.com/compilerla/conventional-pre-commit
|
|
28
|
+
rev: v4.5.0
|
|
29
|
+
hooks:
|
|
30
|
+
- id: conventional-pre-commit
|
|
31
|
+
stages: [commit-msg]
|
|
32
|
+
args: [feat, fix, perf, refactor, docs, test, build, ci, style, chore, revert]
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# pytest configuration. Kept in its own file so agent-kit never edits pyproject.toml.
|
|
2
|
+
# Note: pytest.ini takes precedence over [tool.pytest.ini_options] in pyproject.toml.
|
|
3
|
+
[pytest]
|
|
4
|
+
testpaths = tests
|
|
5
|
+
addopts = -ra --strict-markers --strict-config
|
|
6
|
+
xfail_strict = true
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
|
3
|
+
"release-type": "python",
|
|
4
|
+
"include-component-in-tag": false,
|
|
5
|
+
"bump-minor-pre-major": true,
|
|
6
|
+
"bump-patch-for-minor-pre-major": false,
|
|
7
|
+
"packages": {
|
|
8
|
+
".": {
|
|
9
|
+
"changelog-path": "CHANGELOG.md"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"changelog-sections": [
|
|
13
|
+
{ "type": "feat", "section": "Added" },
|
|
14
|
+
{ "type": "fix", "section": "Fixed" },
|
|
15
|
+
{ "type": "perf", "section": "Changed" },
|
|
16
|
+
{ "type": "revert", "section": "Changed" },
|
|
17
|
+
{ "type": "docs", "section": "Documentation", "hidden": true },
|
|
18
|
+
{ "type": "style", "section": "Styles", "hidden": true },
|
|
19
|
+
{ "type": "refactor", "section": "Refactoring", "hidden": true },
|
|
20
|
+
{ "type": "test", "section": "Tests", "hidden": true },
|
|
21
|
+
{ "type": "build", "section": "Build", "hidden": true },
|
|
22
|
+
{ "type": "ci", "section": "CI", "hidden": true },
|
|
23
|
+
{ "type": "chore", "section": "Chores", "hidden": true }
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Ruff linter and formatter (https://docs.astral.sh/ruff/).
|
|
2
|
+
# Kept in its own file so agent-kit never edits pyproject.toml.
|
|
3
|
+
# target-version: when unset, Ruff infers it from `requires-python` in pyproject.toml.
|
|
4
|
+
|
|
5
|
+
line-length = 100
|
|
6
|
+
extend-exclude = ["build", "dist"]
|
|
7
|
+
|
|
8
|
+
[lint]
|
|
9
|
+
# E4/E7/E9/F: pyflakes + error-prone pycodestyle; W: warnings; I: import order;
|
|
10
|
+
# B: bugbear; UP: pyupgrade; S: bandit security; SIM: simplify; RUF: ruff-specific.
|
|
11
|
+
select = ["E4", "E7", "E9", "F", "W", "I", "B", "UP", "S", "SIM", "RUF"]
|
|
12
|
+
|
|
13
|
+
[lint.per-file-ignores]
|
|
14
|
+
"tests/**" = ["S101"] # assert is how pytest works
|
|
15
|
+
|
|
16
|
+
[format]
|
|
17
|
+
docstring-code-format = true
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
### GitHub automation (python preset + github pack)
|
|
2
|
+
|
|
3
|
+
| Tool | Config | Enforces |
|
|
4
|
+
|---|---|---|
|
|
5
|
+
| CI | `.github/workflows/ci.yml` | Ruff lint, Ruff format check, pytest |
|
|
6
|
+
| release-please | `release-please-config.json`, `.release-please-manifest.json`, `.github/workflows/release-please.yml` | Version bumps (`pyproject.toml` and related files), `CHANGELOG.md`, tags. Don't hand-edit `CHANGELOG.md` or version fields |
|
|
7
|
+
| Dependabot | `.github/dependabot.yml` | Weekly pip and GitHub Actions updates with Conventional Commit messages |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## Python
|
|
2
|
+
|
|
3
|
+
### Tooling (installed by the python preset; don't work around it)
|
|
4
|
+
|
|
5
|
+
| Tool | Config | Enforces |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| pre-commit `commit-msg` | `.pre-commit-config.yaml` (conventional-pre-commit) | Conventional Commit format on every commit |
|
|
8
|
+
| pre-commit `pre-commit` | `.pre-commit-config.yaml` | Ruff lint (with fixes) and format; YAML/TOML/JSON syntax; merge markers; large files |
|
|
9
|
+
| Ruff | `ruff.toml` | Lint rules (pyflakes, bugbear, bandit, pyupgrade, imports) and formatting |
|
|
10
|
+
| pytest | `pytest.ini` | Test discovery in `tests/`, strict markers and config |
|
|
11
|
+
| mypy (optional) | `mypy.ini` | Strict type checking |
|
|
12
|
+
| EditorConfig | `.editorconfig` | Charset, line endings, indentation |
|
|
13
|
+
|
|
14
|
+
Never bypass these (`--no-verify`, disabling rules to make a check pass). Fix the underlying issue. Keep this configuration out of `pyproject.toml`. Setup and versions: `docs/agent-kit/python.md`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.venv/
|
|
5
|
+
venv/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
*.egg-info/
|
|
9
|
+
.pytest_cache/
|
|
10
|
+
.ruff_cache/
|
|
11
|
+
.mypy_cache/
|
|
12
|
+
.coverage
|
|
13
|
+
htmlcov/
|
|
14
|
+
|
|
15
|
+
# Environment and secrets (keep .env.example)
|
|
16
|
+
.env
|
|
17
|
+
.env.*
|
|
18
|
+
!.env.example
|
|
19
|
+
|
|
20
|
+
# Logs and OS/editor files
|
|
21
|
+
*.log
|
|
22
|
+
.DS_Store
|
|
23
|
+
.idea/
|
|
24
|
+
.vscode/*
|
|
25
|
+
!.vscode/extensions.json
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: pip
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
open-pull-requests-limit: 5
|
|
8
|
+
commit-message:
|
|
9
|
+
prefix: build
|
|
10
|
+
include: scope # produces "build(deps): bump ..."
|
|
11
|
+
|
|
12
|
+
- package-ecosystem: github-actions
|
|
13
|
+
directory: /
|
|
14
|
+
schedule:
|
|
15
|
+
interval: weekly
|
|
16
|
+
commit-message:
|
|
17
|
+
prefix: ci
|
|
18
|
+
include: scope
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ci-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
checks:
|
|
17
|
+
name: checks
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.13' # adjust to your project's supported Python version
|
|
25
|
+
|
|
26
|
+
- name: Install tools and the project
|
|
27
|
+
run: |
|
|
28
|
+
python -m pip install --upgrade pip
|
|
29
|
+
# Keep the ruff version in sync with .pre-commit-config.yaml.
|
|
30
|
+
python -m pip install ruff==0.17.4 pytest
|
|
31
|
+
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
|
|
32
|
+
if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi
|
|
33
|
+
if [ -f pyproject.toml ]; then python -m pip install -e .; fi
|
|
34
|
+
|
|
35
|
+
- run: ruff check .
|
|
36
|
+
- run: ruff format --check .
|
|
37
|
+
- run: pytest
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: release-please
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release-please:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: googleapis/release-please-action@v4
|
|
16
|
+
with:
|
|
17
|
+
config-file: release-please-config.json
|
|
18
|
+
manifest-file: .release-please-manifest.json
|
|
19
|
+
# PRs opened with the default GITHUB_TOKEN do not trigger other workflows (e.g. CI).
|
|
20
|
+
# If you want CI to run on the release PR, create a PAT or GitHub App token
|
|
21
|
+
# and pass it here: token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# description: Python tooling without Node: Ruff (lint + format), pytest, optional mypy, pre-commit hooks (Conventional Commits, Ruff). With --pack github: CI, release-please (python), Dependabot.
|
|
2
|
+
|
|
3
|
+
# Commands the installer prints for the user (it never edits package.json / pyproject.toml):
|
|
4
|
+
# run: python -m pip install ruff==0.17.4 pytest pre-commit
|
|
5
|
+
# run: pre-commit install
|
|
6
|
+
|
|
7
|
+
block python AGENTS.md agents-python.md
|
|
8
|
+
copy ruff.toml
|
|
9
|
+
copy pytest.ini
|
|
10
|
+
copy mypy.ini
|
|
11
|
+
copy .pre-commit-config.yaml
|
|
12
|
+
copy .editorconfig
|
|
13
|
+
block python .gitignore gitignore.txt style=hash
|
|
14
|
+
copy docs/agent-kit/python.md from=docs/python.md
|
|
15
|
+
|
|
16
|
+
# GitHub-only: CI, Dependabot and release-please. release-please runs as a GitHub Action,
|
|
17
|
+
# so its config and the generated CHANGELOG.md come with it; without GitHub, the
|
|
18
|
+
# changelog-and-versioning skill uses manual mode.
|
|
19
|
+
block python-github AGENTS.md agents-python-github.md requires=github
|
|
20
|
+
copy .github/workflows/ci.yml requires=github from=github/workflows/ci.yml
|
|
21
|
+
copy .github/workflows/release-please.yml requires=github from=github/workflows/release-please.yml
|
|
22
|
+
copy .github/dependabot.yml requires=github from=github/dependabot.yml
|
|
23
|
+
copy release-please-config.json requires=github
|
|
24
|
+
copy .release-please-manifest.json requires=github
|
|
25
|
+
copy-once CHANGELOG.md requires=github
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# react-typescript preset: setup
|
|
2
|
+
|
|
3
|
+
Installed by agent-kit. This preset adds React + TypeScript tooling and the `react-principles` skill. It always brings the `web` pack (HTML/accessibility and SEO skills). With `--pack github` it also adds CI, release-please and Dependabot.
|
|
4
|
+
|
|
5
|
+
The installer never edits `package.json`. Run the commands below yourself.
|
|
6
|
+
|
|
7
|
+
## 1. Install the tooling
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -D \
|
|
11
|
+
eslint@9 @eslint/js@9 typescript typescript-eslint globals \
|
|
12
|
+
eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y eslint-config-prettier \
|
|
13
|
+
prettier husky lint-staged @commitlint/cli @commitlint/config-conventional
|
|
14
|
+
|
|
15
|
+
npm pkg set scripts.prepare="husky"
|
|
16
|
+
npm pkg set scripts.lint="eslint ."
|
|
17
|
+
npm pkg set scripts.format="prettier --write ."
|
|
18
|
+
npm pkg set scripts.format:check="prettier --check ."
|
|
19
|
+
npm pkg set scripts.typecheck="tsc --noEmit"
|
|
20
|
+
|
|
21
|
+
npm run prepare # activates the git hooks in .husky/ (sets core.hooksPath)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`test` and `build` scripts come from your framework scaffold (Vite, Next.js, etc.). Add `tsconfig.json`, the framework config and a test runner (Vitest or Jest + React Testing Library) from your scaffolder. They are intentionally not included.
|
|
25
|
+
|
|
26
|
+
Using pnpm or yarn? Swap the install commands, replace `npm ci` / `npm audit` in `.github/workflows/ci.yml`, and change `npx` in `.husky/*` to `pnpm exec` / `yarn`.
|
|
27
|
+
|
|
28
|
+
### Why `eslint@9`?
|
|
29
|
+
|
|
30
|
+
Verified on 2026-11-11: plain `npm install eslint` resolves ESLint 10, but `eslint-plugin-jsx-a11y@6.10.2` only declares support up to ESLint 9, so npm fails with `ERESOLVE`. Forcing it with `--legacy-peer-deps` also pulls in TypeScript 7, which `typescript-eslint` rejects (it needs TypeScript 6.x). npm prints a "no longer supported" warning for ESLint 9; that is expected.
|
|
31
|
+
|
|
32
|
+
Once `eslint-plugin-jsx-a11y` supports ESLint 10 (`npm view eslint-plugin-jsx-a11y peerDependencies`), drop the `@9` pins and check that `npm run lint` still passes. Consider recording this in your `MEMORY.md` under Gotchas:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
- [2026-11-11] Keep `eslint` and `@eslint/js` pinned to `@9` until eslint-plugin-jsx-a11y supports ESLint 10 (npm ERESOLVE otherwise). See docs/agent-kit/react-typescript.md. (verified)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 2. Check it works
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
echo "feat(auth): add passkey login" | npx commitlint # passes
|
|
42
|
+
echo "Added stuff." | npx commitlint # fails
|
|
43
|
+
npm run lint
|
|
44
|
+
npx prettier --check .
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Husky v9 hook files have no shebang and need the exec bit on macOS/Linux (the installer sets it there). On Windows, run `git update-index --chmod=+x .husky/pre-commit .husky/commit-msg` before committing them, so they work for colleagues on other systems.
|
|
48
|
+
|
|
49
|
+
## 3. GitHub repository settings (only with `--pack github`)
|
|
50
|
+
|
|
51
|
+
1. **Pull requests: allow squash merging only**, with *Default to pull request title* as the commit message. This makes the PR title the release note.
|
|
52
|
+
2. **Branch protection on `main`**: require a pull request, require the `checks` and `pr-title` status checks, block force pushes.
|
|
53
|
+
3. **Actions > General > Workflow permissions**: *Read and write*, and tick **Allow GitHub Actions to create and approve pull requests** (needed by release-please).
|
|
54
|
+
4. Optional: add a `RELEASE_PLEASE_TOKEN` secret (PAT or GitHub App token) and pass it in `.github/workflows/release-please.yml`. PRs opened with the default `GITHUB_TOKEN` do not trigger other workflows, so without it CI does not run on the release PR.
|
|
55
|
+
|
|
56
|
+
## 4. How releases work (only with `--pack github`)
|
|
57
|
+
|
|
58
|
+
1. Merge PRs to `main` with Conventional Commit titles.
|
|
59
|
+
2. release-please opens (and keeps updating) a **release PR** with the next version and the generated `CHANGELOG.md` section.
|
|
60
|
+
3. Review and merge the release PR. release-please tags `vX.Y.Z` and creates the GitHub Release.
|
|
61
|
+
|
|
62
|
+
Version bumps: `fix` is patch, `feat` is minor, `!` or a `BREAKING CHANGE:` footer is major (below 1.0.0, breaking changes bump minor). The first release starts from `0.0.0` in `.release-please-manifest.json`. Changelog sections use Keep a Changelog names: `feat` is Added, `fix` is Fixed, `perf` and `revert` are Changed; other types are hidden.
|
|
63
|
+
|
|
64
|
+
Without the github pack, release-please files are not installed and the `changelog-and-versioning` skill uses manual mode.
|
|
65
|
+
|
|
66
|
+
## 5. Customize
|
|
67
|
+
|
|
68
|
+
- **Scopes:** uncomment `scope-enum` in `commitlint.config.mjs`.
|
|
69
|
+
- **Changelog sections:** edit `changelog-sections` in `release-please-config.json`.
|
|
70
|
+
- **Ignore lists:** add your own lines to `.gitignore` / `.prettierignore` outside the `agent-kit` markers. The installer only manages the text between the markers.
|
|
71
|
+
- **Not using release-please?** Delete `release-please-config.json`, `.release-please-manifest.json` and `.github/workflows/release-please.yml`. The `changelog-and-versioning` skill switches to manual mode when `release-please-config.json` is absent.
|