agentme 0.3.2 → 0.5.0
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/.xdrs/agentme/edrs/application/003-javascript-project-tooling.md +23 -6
- package/.xdrs/agentme/edrs/application/010-golang-project-tooling.md +5 -0
- package/.xdrs/agentme/edrs/application/014-python-project-tooling.md +112 -0
- package/.xdrs/agentme/edrs/application/015-cli-tool-standards.md +107 -0
- package/.xdrs/agentme/edrs/application/skills/001-create-javascript-project/SKILL.md +76 -37
- package/.xdrs/agentme/edrs/application/skills/005-create-python-project/SKILL.md +289 -0
- package/.xdrs/agentme/edrs/devops/005-monorepo-structure.md +5 -0
- package/.xdrs/agentme/edrs/devops/006-github-pipelines.md +6 -1
- package/.xdrs/agentme/edrs/devops/008-common-targets.md +5 -0
- package/.xdrs/agentme/edrs/devops/skills/002-monorepo-setup/SKILL.md +2 -2
- package/.xdrs/agentme/edrs/governance/013-contributing-guide-requirements.md +5 -0
- package/.xdrs/agentme/edrs/index.md +2 -0
- package/.xdrs/agentme/edrs/observability/011-service-health-check-endpoint.md +5 -0
- package/.xdrs/agentme/edrs/principles/002-coding-best-practices.md +5 -0
- package/.xdrs/agentme/edrs/principles/004-unit-test-requirements.md +5 -0
- package/.xdrs/agentme/edrs/principles/007-project-quality-standards.md +7 -2
- package/.xdrs/agentme/edrs/principles/009-error-handling.md +5 -0
- package/.xdrs/agentme/edrs/principles/012-continuous-xdr-enrichment.md +6 -1
- package/.xdrs/agentme/edrs/principles/articles/001-continuous-xdr-improvement.md +3 -3
- package/README.md +18 -10
- package/package.json +23 -3
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-003-javascript-project-tooling-and-structure
|
|
3
|
+
description: Defines the standard JavaScript and TypeScript project toolchain and layout using Mise, pnpm, TypeScript, ESLint, Jest, and Makefiles. Use when scaffolding or reviewing JavaScript projects.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-003: JavaScript project tooling and structure
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -8,7 +13,7 @@ What tooling and project structure should JavaScript/TypeScript projects follow
|
|
|
8
13
|
|
|
9
14
|
## Decision Outcome
|
|
10
15
|
|
|
11
|
-
**Use pnpm, tsc, esbuild, eslint, and jest
|
|
16
|
+
**Use a Mise-managed Node.js and pnpm toolchain together with pnpm, tsc, esbuild, eslint, and jest in a standard layout separating library code (`lib/`) from runnable usage examples (`examples/`), coordinated by root-level Makefiles.**
|
|
12
17
|
|
|
13
18
|
Clear, consistent tooling and layout enable fast onboarding, reliable CI pipelines, and a predictable developer experience across projects.
|
|
14
19
|
|
|
@@ -18,30 +23,40 @@ Clear, consistent tooling and layout enable fast onboarding, reliable CI pipelin
|
|
|
18
23
|
|
|
19
24
|
| Tool | Purpose |
|
|
20
25
|
|------|---------|
|
|
26
|
+
| **Mise** | Tool version management for Node.js, pnpm, and project CLIs |
|
|
21
27
|
| **pnpm** | Package manager — strict linking, workspace support, fast installs |
|
|
22
28
|
| **tsc** | TypeScript compilation — type checking, declaration generation |
|
|
23
29
|
| **esbuild** | Bundling — fast bundling for distribution or single-binary outputs |
|
|
24
30
|
| **eslint** | Linting — code style and quality enforcement |
|
|
25
31
|
| **jest** | Testing — unit and integration test runner |
|
|
26
32
|
|
|
27
|
-
All commands are run exclusively through Makefiles, not through `package.json` scripts.
|
|
33
|
+
All commands are run exclusively through Makefiles, not through `package.json` scripts. The repository root must define a `.mise.toml` that pins at least Node.js and pnpm, and Makefile targets must run through `mise exec --` or an activated Mise shell.
|
|
28
34
|
|
|
29
35
|
#### ESLint
|
|
30
36
|
|
|
31
|
-
Use
|
|
37
|
+
Use `lib/eslint.config.mjs` as the ESLint entry point and configure it with `@stutzlab/eslint-config` plus `FlatCompat` from `@eslint/eslintrc`. Keep `package.json` in CommonJS mode without adding `"type": "module"`.
|
|
38
|
+
|
|
39
|
+
In flat-config mode, Makefile lint targets MUST NOT use `--ext`; file matching is defined in `eslint.config.mjs` instead. The flat config MUST declare TypeScript file globs such as `src/**/*.ts` and point `parserOptions.project` to `./tsconfig.json`.
|
|
40
|
+
|
|
41
|
+
#### TypeScript and Jest
|
|
42
|
+
|
|
43
|
+
Use a single `lib/tsconfig.json` for both build and type-aware linting. Keep co-located `*.test.ts` files included in that config so ESLint can resolve them through `parserOptions.project`, and rely on the Makefile cleanup step to remove compiled test artifacts from `dist/` after `tsc` runs.
|
|
44
|
+
|
|
45
|
+
When `tsconfig.json` extends `@tsconfig/node24/tsconfig.json`, the default `module` is `nodenext`. `ts-jest` still runs in CommonJS mode by default, so `lib/jest.config.js` MUST configure the `ts-jest` transform with an inline `tsconfig` override that sets `module: 'commonjs'`. Do not use the deprecated `globals['ts-jest']` configuration style.
|
|
32
46
|
|
|
33
47
|
#### Project structure
|
|
34
48
|
|
|
35
49
|
```
|
|
36
50
|
/ # workspace root
|
|
51
|
+
├── .mise.toml # pinned Node.js and pnpm versions
|
|
37
52
|
├── Makefile # delegates build/lint/test to /lib and /examples
|
|
38
53
|
├── README.md # Quick Start first; used as npm registry page
|
|
39
54
|
├── lib/ # the published npm package
|
|
40
55
|
│ ├── Makefile # build, lint, test, publish targets
|
|
41
56
|
│ ├── package.json # package manifest
|
|
42
|
-
│ ├── tsconfig.json # TypeScript config
|
|
57
|
+
│ ├── tsconfig.json # TypeScript config for build and linting
|
|
43
58
|
│ ├── jest.config.js # Jest config
|
|
44
|
-
│ ├── eslint.config.
|
|
59
|
+
│ ├── eslint.config.mjs # ESLint config (ESLint 9 flat config)
|
|
45
60
|
│ └── src/ # all TypeScript source files
|
|
46
61
|
│ ├── index.ts # public API re-exports
|
|
47
62
|
│ └── *.test.ts # test files co-located with source
|
|
@@ -53,7 +68,9 @@ Use `@stutzlab/eslint-config` as the base ESLint config. Use ESLint 9 flat confi
|
|
|
53
68
|
└── package.json
|
|
54
69
|
```
|
|
55
70
|
|
|
56
|
-
The root `Makefile` delegates every target to `/lib` then `/examples` in sequence.
|
|
71
|
+
The root `Makefile` delegates every target to `/lib` then `/examples` in sequence and is expected to execute module commands inside the repository's Mise-managed environment.
|
|
72
|
+
|
|
73
|
+
The commands below assume they are invoked through `mise exec -- make <target>` or from an activated Mise shell.
|
|
57
74
|
|
|
58
75
|
#### lib/Makefile targets
|
|
59
76
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-010-go-project-tooling-and-structure
|
|
3
|
+
description: Defines the standard Go project toolchain, layout, and Makefile workflow for agentme-based projects. Use when scaffolding or reviewing Go projects.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-010: Go project tooling and structure
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-014-python-project-tooling-and-structure
|
|
3
|
+
description: Defines the standard Python project toolchain, layout, and Makefile workflow using uv, ruff, pyright, pytest, and pip-audit. Use when scaffolding or reviewing Python projects.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# agentme-edr-014: Python project tooling and structure
|
|
7
|
+
|
|
8
|
+
## Context and Problem Statement
|
|
9
|
+
|
|
10
|
+
Python projects often drift into mixed dependency managers, duplicated configuration files, and ad hoc quality checks, which makes onboarding and CI pipelines inconsistent.
|
|
11
|
+
|
|
12
|
+
What tooling and project structure should Python projects follow to ensure consistency, quality, and ease of development?
|
|
13
|
+
|
|
14
|
+
## Decision Outcome
|
|
15
|
+
|
|
16
|
+
**Use a uv-managed Python project with `pyproject.toml`, `ruff`, `pyright`, `pytest`, `pytest-cov`, `pip-audit`, and a Makefile as the only development entry point.**
|
|
17
|
+
|
|
18
|
+
A single dependency manager, one canonical config file, and standard targets keep Python projects predictable for contributors and CI.
|
|
19
|
+
|
|
20
|
+
### Implementation Details
|
|
21
|
+
|
|
22
|
+
#### Tooling
|
|
23
|
+
|
|
24
|
+
| Tool | Purpose |
|
|
25
|
+
|------|---------|
|
|
26
|
+
| **uv** | Dependency management, lockfile management, virtualenv sync, build, publish |
|
|
27
|
+
| **pyproject.toml** | Single source of truth for package metadata and tool configuration |
|
|
28
|
+
| **ruff** | Formatting, import sorting, linting, and common code-quality checks |
|
|
29
|
+
| **pyright** | Static type checking |
|
|
30
|
+
| **pytest** | Test runner |
|
|
31
|
+
| **pytest-cov** | Coverage reporting and threshold enforcement |
|
|
32
|
+
| **pip-audit** | Dependency CVE audit |
|
|
33
|
+
|
|
34
|
+
All routine commands must run through the project `Makefile`, never by calling `uv`, `ruff`, `pytest`, or `pyright` directly in docs, CI, or daily development workflows.
|
|
35
|
+
|
|
36
|
+
When the repository defines a root `.mise.toml`, Python and uv must be pinned there and commands should run through `mise exec --` or an activated Mise shell.
|
|
37
|
+
|
|
38
|
+
#### Project structure
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
/
|
|
42
|
+
├── .mise.toml # optional but required when the repo uses Mise
|
|
43
|
+
├── Makefile # single entry point for build/lint/test/run tasks
|
|
44
|
+
├── pyproject.toml # package metadata + tool config
|
|
45
|
+
├── uv.lock # committed lockfile
|
|
46
|
+
├── README.md # Getting Started near the top
|
|
47
|
+
├── src/
|
|
48
|
+
│ └── <package_name>/
|
|
49
|
+
│ ├── __init__.py
|
|
50
|
+
│ ├── __main__.py # when the project exposes a CLI
|
|
51
|
+
│ └── ...
|
|
52
|
+
├── tests/
|
|
53
|
+
│ ├── conftest.py # shared fixtures when needed
|
|
54
|
+
│ └── test_*.py
|
|
55
|
+
└── examples/ # required for libraries and shared utilities
|
|
56
|
+
├── Makefile
|
|
57
|
+
└── basic-usage/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Use the `src/` layout for import safety and packaging clarity. Keep tests under `tests/` and shared test setup in `tests/conftest.py`. Do not introduce `requirements.txt`, `setup.py`, `setup.cfg`, `tox.ini`, `ruff.toml`, or `pyrightconfig.json` by default; keep project metadata and tool configuration in `pyproject.toml`.
|
|
61
|
+
|
|
62
|
+
Libraries and shared utilities must include an `examples/` folder and wire example execution into the root `test` flow, following [agentme-edr-007](../principles/007-project-quality-standards.md).
|
|
63
|
+
|
|
64
|
+
#### `pyproject.toml`
|
|
65
|
+
|
|
66
|
+
- Runtime dependencies belong in `[project.dependencies]`.
|
|
67
|
+
- Development-only tooling belongs in `[dependency-groups].dev`.
|
|
68
|
+
- Configure Ruff, Pyright, and Pytest in `pyproject.toml` under their `tool.*` sections.
|
|
69
|
+
- Commit `uv.lock` and keep it in sync with `pyproject.toml`.
|
|
70
|
+
- Expose CLI entry points with `[project.scripts]` when the project provides commands.
|
|
71
|
+
|
|
72
|
+
Ruff is the default formatter and linter. Do not add Black, isort, or Flake8 unless another XDR for that repository explicitly requires them.
|
|
73
|
+
|
|
74
|
+
Pyright must run on every lint pass. `typeCheckingMode = "standard"` is the minimum baseline; projects may raise this to `strict` when the codebase is ready.
|
|
75
|
+
|
|
76
|
+
Pytest coverage must fail below 80% line and branch coverage, following [agentme-edr-004](../principles/004-unit-test-requirements.md).
|
|
77
|
+
|
|
78
|
+
#### Makefile targets
|
|
79
|
+
|
|
80
|
+
The commands below assume invocation through `mise exec -- make <target>` when the repository uses Mise, or plain `make <target>` inside an activated project environment.
|
|
81
|
+
|
|
82
|
+
| Target | Description |
|
|
83
|
+
|--------|-------------|
|
|
84
|
+
| `install` | `uv sync --frozen --all-extras --dev` |
|
|
85
|
+
| `build` | `uv sync --frozen --all-extras --dev && uv build` |
|
|
86
|
+
| `lint` | `uv run ruff format --check . && uv run ruff check . && uv run pyright && uv run pip-audit` |
|
|
87
|
+
| `lint-fix` | `uv run ruff format . && uv run ruff check . --fix && uv run pyright && uv run pip-audit` |
|
|
88
|
+
| `test-unit` | `uv run pytest --cov=src/<package_name> --cov-branch --cov-report=term-missing --cov-fail-under=80` |
|
|
89
|
+
| `test-examples` | Run `examples/` through its own `Makefile` when the project is a library/utility |
|
|
90
|
+
| `test` | Run `test-unit`, then `test-examples` when applicable |
|
|
91
|
+
| `clean` | Remove `.venv/`, `dist/`, `.pytest_cache/`, `.ruff_cache/`, `.coverage`, `htmlcov/` |
|
|
92
|
+
| `all` | `build lint test` |
|
|
93
|
+
| `update-lockfile` | `uv lock --upgrade` |
|
|
94
|
+
| `run` | `uv run python -m <package_name>` or the project CLI entry point |
|
|
95
|
+
| `dev` | Same as `run`, optionally with repository-specific dev defaults |
|
|
96
|
+
| `publish` | `uv publish` after versioning and packaging are complete |
|
|
97
|
+
|
|
98
|
+
The root `Makefile` must remain the only contract for CI and contributors, in line with [agentme-edr-008](../devops/008-common-targets.md).
|
|
99
|
+
|
|
100
|
+
## Considered Options
|
|
101
|
+
|
|
102
|
+
* (REJECTED) **Mixed Python tooling** - Separate tools and config files such as `pip`, `requirements.txt`, `setup.cfg`, `flake8`, and `mypy`.
|
|
103
|
+
* Reason: Increases cognitive load, duplicates configuration, and weakens the standard command surface across projects.
|
|
104
|
+
* (CHOSEN) **uv + `pyproject.toml` + Ruff/Pyright/Pytest toolchain** - One dependency manager, one config file, and one Makefile entry point.
|
|
105
|
+
* Reason: Keeps packaging, dependency locking, static analysis, security auditing, and test execution consistent.
|
|
106
|
+
|
|
107
|
+
## References
|
|
108
|
+
|
|
109
|
+
- [agentme-edr-004](../principles/004-unit-test-requirements.md) - Coverage and unit-test baseline
|
|
110
|
+
- [agentme-edr-007](../principles/007-project-quality-standards.md) - Examples and quality requirements
|
|
111
|
+
- [agentme-edr-008](../devops/008-common-targets.md) - Standard Makefile target names
|
|
112
|
+
- [005-create-python-project](skills/005-create-python-project/SKILL.md) - Scaffold a project following this EDR
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-015-cli-tool-standards
|
|
3
|
+
description: Defines how distributable CLI tools should separate command handling from library logic and expose consistent command behavior. Use when designing or reviewing CLI interfaces.
|
|
4
|
+
applied-to: Distributable CLI tools and their standalone libraries
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# agentme-edr-015: CLI tool standards
|
|
8
|
+
|
|
9
|
+
## Context and Problem Statement
|
|
10
|
+
|
|
11
|
+
CLI projects often mix command parsing, business logic, config loading, and output formatting in one entry point, making them hard to reuse as libraries and inconsistent to operate.
|
|
12
|
+
|
|
13
|
+
What structure and interface rules should distributable CLI tools follow so they remain discoverable, scriptable, and reusable outside the command line?
|
|
14
|
+
|
|
15
|
+
## Decision Outcome
|
|
16
|
+
|
|
17
|
+
**Use a command-oriented CLI as a thin adapter over a standalone library, with CLI-owned config discovery, mandatory help/version/verbose flags, and consistent progress and exit behavior.**
|
|
18
|
+
|
|
19
|
+
This keeps the user-facing command predictable while preserving a clean library API for embedding, testing, and automation.
|
|
20
|
+
|
|
21
|
+
### Implementation Details
|
|
22
|
+
|
|
23
|
+
#### CLI command surface
|
|
24
|
+
|
|
25
|
+
- CLI tools should default to the format `[tool] [command] [options] [arguments]`.
|
|
26
|
+
- Example: `filedist extract --packages=test mydir`
|
|
27
|
+
- A single-action tool may omit `[command]` only when adding a subcommand would be artificial and there is no meaningful action split.
|
|
28
|
+
- Every CLI tool must expose:
|
|
29
|
+
- `--help` on the root command
|
|
30
|
+
- `--version` on the root command
|
|
31
|
+
- `--verbose` on the root command and on subcommands when flags are parsed per command
|
|
32
|
+
- Root `--help` output must list all available commands, key options, and usage examples. Command-specific help must describe that command's arguments and options.
|
|
33
|
+
|
|
34
|
+
#### CLI to library separation
|
|
35
|
+
|
|
36
|
+
- Structure the software as `cli -> lib`.
|
|
37
|
+
- The CLI layer must only parse arguments, load config, call the library, and format output.
|
|
38
|
+
- Domain logic must live in the library and be usable without CLI globals such as `argv`, `stdout`, or process exit handlers.
|
|
39
|
+
- Every feature available through the CLI must also be available through the library API.
|
|
40
|
+
- Organize the library by action so the mapping stays direct and obvious.
|
|
41
|
+
- `extract` command -> `extract(...)`
|
|
42
|
+
- `validate` command -> `validate(...)`
|
|
43
|
+
- Avoid one generic library `run()` entry point that hides action-specific contracts behind switches or string commands.
|
|
44
|
+
|
|
45
|
+
#### Library API shape
|
|
46
|
+
|
|
47
|
+
- Each CLI action should map to a dedicated exported API with typed inputs and outputs appropriate for the language.
|
|
48
|
+
- Library APIs should accept in-memory options objects or typed parameters, not require config files or environment variables unless library-level config-file support is an explicit requirement.
|
|
49
|
+
- The CLI layer is responsible for translating flags, positional arguments, and config-file contents into library inputs.
|
|
50
|
+
- The library should return explicit results and errors so the CLI can decide what to print and which exit code to use.
|
|
51
|
+
|
|
52
|
+
#### Configuration
|
|
53
|
+
|
|
54
|
+
- Prefer flags and positional arguments for simple inputs.
|
|
55
|
+
- When configuration becomes long, nested, or repetitive, support a config file instead of pushing all values into flags.
|
|
56
|
+
- By default, config-file discovery and loading must happen in the CLI layer, not in the library layer.
|
|
57
|
+
- When a config file is supported, the CLI should try to load a JSON config file from `[cwd]/.[cli-name]rc` by default.
|
|
58
|
+
- The CLI should also support an explicit config path flag such as `--config`.
|
|
59
|
+
- For JavaScript tools, `cosmiconfig` is an acceptable implementation. Equivalent discovery libraries are acceptable in other ecosystems.
|
|
60
|
+
- The library must not depend on the presence of the config file; it should receive parsed configuration values from the CLI layer.
|
|
61
|
+
- The library may load or parse config files only when that behavior is an explicit requirement of the library contract for non-CLI consumers as well.
|
|
62
|
+
|
|
63
|
+
#### Output and progress
|
|
64
|
+
|
|
65
|
+
- Standard output must show a start message when work begins and a result message when work completes successfully.
|
|
66
|
+
- When processing is long-running or multi-stage, print concise intermediate progress messages.
|
|
67
|
+
- `--verbose` must reveal more internal detail about what the tool is doing without changing the meaning of the command result.
|
|
68
|
+
- Default output should stay concise and readable for humans.
|
|
69
|
+
- Errors should be written to standard error with an actionable message. Stack traces or raw internal errors should stay hidden by default and may be shown in verbose mode.
|
|
70
|
+
|
|
71
|
+
#### Exit behavior
|
|
72
|
+
|
|
73
|
+
- Exit with `0` only when the requested action completed successfully.
|
|
74
|
+
- Exit with `1` when the requested action could not be completed.
|
|
75
|
+
- The library should surface failure as return values, result objects, or language-idiomatic errors; the CLI is responsible for converting that outcome into user-facing messages and process exit codes.
|
|
76
|
+
|
|
77
|
+
#### Documentation
|
|
78
|
+
|
|
79
|
+
- `README.md` must include at least 4 CLI usage examples.
|
|
80
|
+
- `README.md` must include at least 2 library API examples for the same operation also available through the CLI.
|
|
81
|
+
- If the tool supports config files, at least 1 README example should show config-file usage.
|
|
82
|
+
- Examples must use the public command and public library API, not internal modules or private files.
|
|
83
|
+
|
|
84
|
+
#### Distribution and versioning
|
|
85
|
+
|
|
86
|
+
- The implementation language is project-dependent, but the packaging and entry-point strategy must match how users are expected to run the tool.
|
|
87
|
+
- Choose language tooling that stays compatible with ecosystem launchers such as `npx`, `pnpm dlx`, `uvx`, or equivalent distribution commands for that ecosystem.
|
|
88
|
+
- `--version` must print the same version declared in the published package or release artifact metadata.
|
|
89
|
+
- Do not hard-code a second version string that can drift from the published package version.
|
|
90
|
+
- Language-specific project structure and packaging rules still apply and should be combined with this XDR, especially [agentme-edr-003](003-javascript-project-tooling.md), [agentme-edr-010](010-golang-project-tooling.md), and [agentme-edr-014](014-python-project-tooling.md).
|
|
91
|
+
|
|
92
|
+
## Considered Options
|
|
93
|
+
|
|
94
|
+
* (REJECTED) **Ad hoc CLIs with embedded business logic** - Keep parsing, processing, config loading, and output formatting inside a single entry point.
|
|
95
|
+
* Reason: Makes the tool hard to test, hard to reuse as a library, and inconsistent across commands.
|
|
96
|
+
* (CHOSEN) **Thin CLI adapter over action-oriented library APIs** - Keep the CLI responsible for user interaction and the library responsible for the actual behavior.
|
|
97
|
+
* Reason: Preserves a clean programmatic API, keeps command behavior discoverable, and makes the CLI-to-library mapping easy to maintain.
|
|
98
|
+
|
|
99
|
+
## References
|
|
100
|
+
|
|
101
|
+
- [agentme-edr-003](003-javascript-project-tooling.md) - JavaScript project packaging and structure
|
|
102
|
+
- [agentme-edr-007](../principles/007-project-quality-standards.md) - README and examples baseline
|
|
103
|
+
- [agentme-edr-008](../devops/008-common-targets.md) - Standard command names for project entry points
|
|
104
|
+
- [agentme-edr-009](../principles/009-error-handling.md) - Process error signaling and error handling expectations
|
|
105
|
+
- [agentme-edr-010](010-golang-project-tooling.md) - Go CLI structure and verbose logging baseline
|
|
106
|
+
- [agentme-edr-014](014-python-project-tooling.md) - Python packaging and CLI entry-point guidance
|
|
107
|
+
- [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig) - Example JSON configuration discovery library for JavaScript CLIs
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: 001-create-javascript-project
|
|
3
3
|
description: >
|
|
4
4
|
Scaffolds the initial boilerplate structure for a JavaScript/TypeScript library project following
|
|
5
|
-
the standard tooling and layout defined in
|
|
5
|
+
the standard tooling and layout defined in agentme-edr-003. Activate this skill when the user
|
|
6
6
|
asks to create, scaffold, or initialize a new JavaScript or TypeScript library project, npm
|
|
7
7
|
package, or similar project structure.
|
|
8
8
|
metadata:
|
|
@@ -42,27 +42,30 @@ Delegates every make target to `/lib` then `/examples` in sequence:
|
|
|
42
42
|
|
|
43
43
|
```makefile
|
|
44
44
|
SHELL := /bin/bash
|
|
45
|
+
MISE := mise exec --
|
|
45
46
|
%:
|
|
46
47
|
@echo ''
|
|
47
48
|
@echo '>>> Running /lib:$@...'
|
|
48
|
-
|
|
49
|
+
@$(MISE) $(MAKE) -C lib $@
|
|
49
50
|
@echo ''
|
|
50
51
|
@echo '>>> Running /examples:$@...'
|
|
51
|
-
|
|
52
|
+
@STAGE=dev $(MISE) $(MAKE) -C examples $@
|
|
52
53
|
|
|
53
54
|
publish:
|
|
54
|
-
|
|
55
|
+
@$(MISE) $(MAKE) -C lib publish
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
setup:
|
|
58
|
+
mise install
|
|
58
59
|
```
|
|
59
60
|
|
|
60
|
-
**`./.
|
|
61
|
+
**`./.mise.toml`**
|
|
61
62
|
|
|
62
63
|
```
|
|
63
|
-
|
|
64
|
+
[tools]
|
|
65
|
+
node = "24.0.0"
|
|
66
|
+
pnpm = "10.14.0"
|
|
64
67
|
```
|
|
65
|
-
(Replace `24` with the chosen Node.js version.)
|
|
68
|
+
(Replace `24.0.0` with the chosen Node.js version and pin any additional project CLIs here.)
|
|
66
69
|
|
|
67
70
|
**`./.gitignore`**
|
|
68
71
|
|
|
@@ -101,30 +104,31 @@ describe('hello', () => {
|
|
|
101
104
|
|
|
102
105
|
```makefile
|
|
103
106
|
SHELL := /bin/bash
|
|
107
|
+
MISE := mise exec --
|
|
104
108
|
|
|
105
109
|
build: install
|
|
106
110
|
@rm -rf dist
|
|
107
|
-
|
|
111
|
+
$(MISE) pnpm exec tsc --outDir dist
|
|
108
112
|
@-find ./dist \( -regex '.*\.test\..*' -o -regex '.*__tests.*' \) -exec rm -rf {} \; 2> /dev/null
|
|
109
113
|
@# Create pack for use by examples to simulate real external usage
|
|
110
|
-
|
|
114
|
+
$(MISE) pnpm pack --pack-destination dist
|
|
111
115
|
|
|
112
116
|
build-module: install
|
|
113
117
|
@rm -rf dist
|
|
114
|
-
|
|
118
|
+
$(MISE) pnpm exec tsc --outDir dist
|
|
115
119
|
@-find ./dist \( -regex '.*\.test\..*' -o -regex '.*__tests.*' \) -exec rm -rf {} \; 2> /dev/null
|
|
116
120
|
|
|
117
121
|
lint:
|
|
118
|
-
|
|
122
|
+
$(MISE) pnpm exec eslint ./src
|
|
119
123
|
|
|
120
124
|
lint-fix:
|
|
121
|
-
|
|
125
|
+
$(MISE) pnpm exec eslint ./src --fix
|
|
122
126
|
|
|
123
127
|
test-watch:
|
|
124
|
-
|
|
128
|
+
$(MISE) pnpm exec jest --watch
|
|
125
129
|
|
|
126
130
|
test:
|
|
127
|
-
|
|
131
|
+
$(MISE) pnpm exec jest --verbose
|
|
128
132
|
|
|
129
133
|
clean:
|
|
130
134
|
rm -rf node_modules
|
|
@@ -133,22 +137,25 @@ clean:
|
|
|
133
137
|
all: build lint test
|
|
134
138
|
|
|
135
139
|
install:
|
|
136
|
-
|
|
140
|
+
mise install
|
|
141
|
+
$(MISE) pnpm install --frozen-lockfile --config.dedupe-peer-dependents=false
|
|
137
142
|
|
|
138
143
|
publish:
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
$(MISE) npx -y monotag@1.26.0 current --bump-action=latest --prefix=
|
|
145
|
+
@VERSION=$$($(MISE) node -p "require('./package.json').version"); \
|
|
141
146
|
if echo "$$VERSION" | grep -q '-'; then \
|
|
142
147
|
TAG=$$(echo "$$VERSION" | sed 's/[0-9]*\.[0-9]*\.[0-9]*-\([a-zA-Z][a-zA-Z0-9]*\).*/\1/'); \
|
|
143
148
|
echo "Prerelease version $$VERSION detected, publishing with --tag $$TAG"; \
|
|
144
|
-
|
|
149
|
+
$(MISE) npm publish --no-git-checks --provenance --tag "$$TAG"; \
|
|
145
150
|
else \
|
|
146
|
-
|
|
151
|
+
$(MISE) npm publish --no-git-checks --provenance; \
|
|
147
152
|
fi
|
|
148
153
|
```
|
|
149
154
|
|
|
150
155
|
**`lib/package.json`** (replace `[package-name]`, `[description]`, `[author]`, `[owner]`, `[repo]`):
|
|
151
156
|
|
|
157
|
+
Use this dependency set.
|
|
158
|
+
|
|
152
159
|
```json
|
|
153
160
|
{
|
|
154
161
|
"name": "[package-name]",
|
|
@@ -161,7 +168,7 @@ publish:
|
|
|
161
168
|
"package.json",
|
|
162
169
|
"README.md"
|
|
163
170
|
],
|
|
164
|
-
"packageManager": "pnpm@
|
|
171
|
+
"packageManager": "pnpm@10.14.0",
|
|
165
172
|
"scripts": {},
|
|
166
173
|
"repository": {
|
|
167
174
|
"type": "git",
|
|
@@ -174,19 +181,23 @@ publish:
|
|
|
174
181
|
},
|
|
175
182
|
"homepage": "https://github.com/[owner]/[repo]#readme",
|
|
176
183
|
"devDependencies": {
|
|
177
|
-
"@
|
|
184
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
178
185
|
"@stutzlab/eslint-config": "^3.2.1",
|
|
179
|
-
"@tsconfig/node24": "^24.0.
|
|
180
|
-
"@types/jest": "^29.5.
|
|
186
|
+
"@tsconfig/node24": "^24.0.1",
|
|
187
|
+
"@types/jest": "^29.5.14",
|
|
188
|
+
"@typescript-eslint/eslint-plugin": "^8.31.0",
|
|
189
|
+
"@typescript-eslint/parser": "^8.31.0",
|
|
181
190
|
"esbuild": "^0.20.0",
|
|
182
|
-
"eslint": "^
|
|
191
|
+
"eslint": "^9.25.1",
|
|
183
192
|
"jest": "^29.7.0",
|
|
184
|
-
"ts-jest": "^29.
|
|
185
|
-
"typescript": "^5.
|
|
193
|
+
"ts-jest": "^29.4.0",
|
|
194
|
+
"typescript": "^5.9.0"
|
|
186
195
|
}
|
|
187
196
|
}
|
|
188
197
|
```
|
|
189
198
|
|
|
199
|
+
Keep `package.json` without `"type": "module"`. Use `eslint.config.mjs` as the ESLint entry point so Jest can continue to run with its default CommonJS runtime.
|
|
200
|
+
|
|
190
201
|
**`lib/tsconfig.json`**:
|
|
191
202
|
|
|
192
203
|
```json
|
|
@@ -200,39 +211,65 @@ publish:
|
|
|
200
211
|
"sourceMap": true
|
|
201
212
|
},
|
|
202
213
|
"include": ["src/**/*"],
|
|
203
|
-
"exclude": ["node_modules", "dist"
|
|
214
|
+
"exclude": ["node_modules", "dist"]
|
|
204
215
|
}
|
|
205
216
|
```
|
|
206
217
|
|
|
218
|
+
Use this single tsconfig for both build and type-aware linting. Keep `*.test.ts` included so ESLint can resolve them through `parserOptions.project`, and rely on the existing `dist/` cleanup in the Makefile to remove emitted test files after compilation.
|
|
219
|
+
|
|
207
220
|
**`lib/jest.config.js`**:
|
|
208
221
|
|
|
209
222
|
```javascript
|
|
210
223
|
module.exports = {
|
|
211
|
-
preset: 'ts-jest',
|
|
212
224
|
testEnvironment: 'node',
|
|
213
225
|
testMatch: ['**/*.test.ts'],
|
|
214
226
|
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.test.ts'],
|
|
227
|
+
transform: {
|
|
228
|
+
'^.+\\.tsx?$': [
|
|
229
|
+
'ts-jest',
|
|
230
|
+
{
|
|
231
|
+
tsconfig: {
|
|
232
|
+
module: 'commonjs',
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
},
|
|
215
237
|
};
|
|
216
238
|
```
|
|
217
239
|
|
|
218
|
-
|
|
240
|
+
This avoids the deprecated `globals['ts-jest']` configuration style while forcing `ts-jest` to transpile with CommonJS instead of the `nodenext` default inherited from `@tsconfig/node24`.
|
|
241
|
+
|
|
242
|
+
**`lib/eslint.config.mjs`** (ESLint 9 flat config format):
|
|
219
243
|
|
|
220
244
|
```js
|
|
245
|
+
import path from 'node:path';
|
|
246
|
+
import { fileURLToPath } from 'node:url';
|
|
247
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
221
248
|
import baseConfig from '@stutzlab/eslint-config';
|
|
222
249
|
|
|
250
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
251
|
+
const __dirname = path.dirname(__filename);
|
|
252
|
+
|
|
253
|
+
const compat = new FlatCompat({
|
|
254
|
+
baseDirectory: __dirname,
|
|
255
|
+
});
|
|
256
|
+
|
|
223
257
|
export default [
|
|
224
|
-
...baseConfig,
|
|
258
|
+
...compat.config(baseConfig),
|
|
225
259
|
{
|
|
260
|
+
files: ['src/**/*.ts'],
|
|
226
261
|
languageOptions: {
|
|
227
262
|
parserOptions: {
|
|
228
263
|
project: ['./tsconfig.json'],
|
|
229
|
-
tsconfigRootDir:
|
|
264
|
+
tsconfigRootDir: __dirname,
|
|
230
265
|
},
|
|
231
266
|
},
|
|
232
267
|
},
|
|
233
268
|
];
|
|
234
269
|
```
|
|
235
270
|
|
|
271
|
+
Do not name this file `eslint.config.js` unless the generated package also opts into ESM with `"type": "module"`, because that produces Node.js warnings and conflicts with the recommended Jest CommonJS setup.
|
|
272
|
+
|
|
236
273
|
---
|
|
237
274
|
|
|
238
275
|
### Phase 4: Create `examples/`
|
|
@@ -335,17 +372,19 @@ Review all created files and confirm:
|
|
|
335
372
|
- [ ] `lib/src/index.ts` exports at least one symbol
|
|
336
373
|
- [ ] `lib/src/index.test.ts` has at least one passing test
|
|
337
374
|
- [ ] `lib/package.json` has `main`, `types`, and `files` set correctly
|
|
375
|
+
- [ ] `lib/tsconfig.json` includes co-located `src/**/*.test.ts` files for ESLint type-aware parsing
|
|
376
|
+
- [ ] `lib/eslint.config.mjs` points `parserOptions.project` to `tsconfig.json`
|
|
338
377
|
- [ ] `README.md` starts with Quick Start containing a code example
|
|
339
378
|
- [ ] All `[package-name]` placeholders are replaced with the actual name
|
|
340
|
-
- [ ] Structure matches the layout in [
|
|
379
|
+
- [ ] Structure matches the layout in [agentme-edr-003](../../003-javascript-project-tooling.md)
|
|
341
380
|
|
|
342
381
|
## Examples
|
|
343
382
|
|
|
344
383
|
**User:** "Create a new TypeScript library project called `retry-client`"
|
|
345
384
|
|
|
346
385
|
**Agent action:** Gathers: name=`retry-client`, default Node.js 24, then creates:
|
|
347
|
-
- `./Makefile`, `./.
|
|
348
|
-
- `lib/src/index.ts`, `lib/src/index.test.ts`, `lib/Makefile`, `lib/package.json`, `lib/tsconfig.json`, `lib/jest.config.js`, `lib/eslint.config.
|
|
386
|
+
- `./Makefile`, `./.mise.toml`, `./.gitignore`
|
|
387
|
+
- `lib/src/index.ts`, `lib/src/index.test.ts`, `lib/Makefile`, `lib/package.json`, `lib/tsconfig.json`, `lib/jest.config.js`, `lib/eslint.config.mjs`
|
|
349
388
|
- `examples/Makefile`, `examples/usage-basic/package.json`, `examples/usage-basic/index.js`
|
|
350
389
|
- `README.md` (Quick Start first)
|
|
351
390
|
|
|
@@ -354,7 +393,7 @@ All `[package-name]` replaced with `retry-client`.
|
|
|
354
393
|
## Edge Cases
|
|
355
394
|
|
|
356
395
|
- **Existing files** — skip creation; adapt references to the existing structure
|
|
357
|
-
- **Different Node.js version** — update `.
|
|
396
|
+
- **Different Node.js version** — update `.mise.toml` and `tsconfig.json` `extends` (e.g. `@tsconfig/node22`)
|
|
358
397
|
- **CLI tool** — add `"bin": "dist/main.js"` to `package.json` and create `lib/src/main.ts` as the CLI entry point; add `esbuild` bundle target in `lib/Makefile`
|
|
359
398
|
- **No examples needed** — omit the `examples/` directory; remove the `examples` delegation from root `Makefile`
|
|
360
399
|
- **Binary bundling (Lambda/browser)** — add an esbuild step to `lib/Makefile`: `pnpm exec esbuild src/main.ts --bundle --platform=node --outfile=dist/bundle.js`
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 005-create-python-project
|
|
3
|
+
description: >
|
|
4
|
+
Scaffolds the initial boilerplate structure for a Python library or CLI project following the
|
|
5
|
+
standard tooling and layout defined in agentme-edr-014. Activate this skill when the user asks
|
|
6
|
+
to create, scaffold, or initialize a new Python package, CLI, library, or similar project
|
|
7
|
+
structure.
|
|
8
|
+
metadata:
|
|
9
|
+
author: flaviostutz
|
|
10
|
+
version: "1.0"
|
|
11
|
+
compatibility: Python 3.12+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Creates a complete Python project from scratch using `uv`, `pyproject.toml`, Ruff, Pyright,
|
|
17
|
+
Pytest, and Makefiles. The default layout uses `src/<package_name>/`, `tests/`, and `examples/`
|
|
18
|
+
for libraries and shared utilities.
|
|
19
|
+
|
|
20
|
+
Related EDR: [agentme-edr-014](../../014-python-project-tooling.md)
|
|
21
|
+
|
|
22
|
+
## Instructions
|
|
23
|
+
|
|
24
|
+
### Phase 1: Gather information
|
|
25
|
+
|
|
26
|
+
Ask for or infer from context:
|
|
27
|
+
|
|
28
|
+
- **Package name** - Python distribution/import name, e.g. `my_tool`
|
|
29
|
+
- **Short description** - one sentence
|
|
30
|
+
- **Author** name or GitHub username
|
|
31
|
+
- **Python version** - default `3.13`
|
|
32
|
+
- **Project kind** - `library` or `cli`
|
|
33
|
+
- **Primary entry point** - first module or command name to scaffold
|
|
34
|
+
- **GitHub repo URL** - optional, for project metadata
|
|
35
|
+
- **Confirm target directory** - default: current workspace root
|
|
36
|
+
|
|
37
|
+
### Phase 2: Create root files
|
|
38
|
+
|
|
39
|
+
Create these files first.
|
|
40
|
+
|
|
41
|
+
**`./Makefile`**
|
|
42
|
+
|
|
43
|
+
```makefile
|
|
44
|
+
SHELL := /bin/bash
|
|
45
|
+
|
|
46
|
+
PACKAGE_NAME ?= your_package
|
|
47
|
+
MISE := mise exec --
|
|
48
|
+
|
|
49
|
+
all: build lint test
|
|
50
|
+
|
|
51
|
+
install:
|
|
52
|
+
uv sync --frozen --all-extras --dev
|
|
53
|
+
|
|
54
|
+
build: install
|
|
55
|
+
uv build
|
|
56
|
+
|
|
57
|
+
lint:
|
|
58
|
+
uv run ruff format --check .
|
|
59
|
+
uv run ruff check .
|
|
60
|
+
uv run pyright
|
|
61
|
+
uv run pip-audit
|
|
62
|
+
|
|
63
|
+
lint-fix:
|
|
64
|
+
uv run ruff format .
|
|
65
|
+
uv run ruff check . --fix
|
|
66
|
+
uv run pyright
|
|
67
|
+
uv run pip-audit
|
|
68
|
+
|
|
69
|
+
test: test-unit test-examples
|
|
70
|
+
|
|
71
|
+
test-unit:
|
|
72
|
+
uv run pytest --cov=src/$(PACKAGE_NAME) --cov-branch --cov-report=term-missing --cov-fail-under=80
|
|
73
|
+
|
|
74
|
+
test-examples:
|
|
75
|
+
@if [ -d examples ]; then $(MAKE) -C examples test PACKAGE_NAME=$(PACKAGE_NAME); else echo "No examples/ directory. Skipping"; fi
|
|
76
|
+
|
|
77
|
+
run:
|
|
78
|
+
uv run python -m $(PACKAGE_NAME)
|
|
79
|
+
|
|
80
|
+
dev: run
|
|
81
|
+
|
|
82
|
+
update-lockfile:
|
|
83
|
+
uv lock --upgrade
|
|
84
|
+
|
|
85
|
+
clean:
|
|
86
|
+
rm -rf .venv dist .pytest_cache .ruff_cache .coverage htmlcov
|
|
87
|
+
find . -type d -name __pycache__ -prune -exec rm -rf {} +
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
If the repository already uses Mise, adapt the commands to `$(MISE) uv ...` and pin both Python and uv in `.mise.toml`.
|
|
91
|
+
|
|
92
|
+
**`./pyproject.toml`**
|
|
93
|
+
|
|
94
|
+
Replace placeholders such as `[package-name]`, `[description]`, `[author]`, and `[python-version]`.
|
|
95
|
+
|
|
96
|
+
```toml
|
|
97
|
+
[project]
|
|
98
|
+
name = "[package-name]"
|
|
99
|
+
version = "0.0.1"
|
|
100
|
+
description = "[description]"
|
|
101
|
+
readme = "README.md"
|
|
102
|
+
requires-python = ">=[python-version]"
|
|
103
|
+
dependencies = []
|
|
104
|
+
|
|
105
|
+
[[project.authors]]
|
|
106
|
+
name = "[author]"
|
|
107
|
+
|
|
108
|
+
[project.optional-dependencies]
|
|
109
|
+
dev = []
|
|
110
|
+
|
|
111
|
+
[dependency-groups]
|
|
112
|
+
dev = [
|
|
113
|
+
"pip-audit>=2.9.0",
|
|
114
|
+
"pyright>=1.1.400",
|
|
115
|
+
"pytest>=8.4.0",
|
|
116
|
+
"pytest-cov>=6.1.0",
|
|
117
|
+
"ruff>=0.11.0",
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
[build-system]
|
|
121
|
+
requires = ["hatchling>=1.27.0"]
|
|
122
|
+
build-backend = "hatchling.build"
|
|
123
|
+
|
|
124
|
+
[tool.ruff]
|
|
125
|
+
line-length = 100
|
|
126
|
+
target-version = "py313"
|
|
127
|
+
|
|
128
|
+
[tool.ruff.lint]
|
|
129
|
+
select = ["E", "F", "I", "B", "UP"]
|
|
130
|
+
|
|
131
|
+
[tool.pyright]
|
|
132
|
+
include = ["src", "tests"]
|
|
133
|
+
venvPath = "."
|
|
134
|
+
venv = ".venv"
|
|
135
|
+
typeCheckingMode = "standard"
|
|
136
|
+
|
|
137
|
+
[tool.pytest.ini_options]
|
|
138
|
+
testpaths = ["tests"]
|
|
139
|
+
addopts = "-q"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use `pyproject.toml` as the single configuration file. Do not add `requirements.txt`,
|
|
143
|
+
`setup.py`, `setup.cfg`, `ruff.toml`, or `pyrightconfig.json` by default.
|
|
144
|
+
|
|
145
|
+
**`./.gitignore`**
|
|
146
|
+
|
|
147
|
+
```gitignore
|
|
148
|
+
.venv/
|
|
149
|
+
dist/
|
|
150
|
+
build/
|
|
151
|
+
.pytest_cache/
|
|
152
|
+
.ruff_cache/
|
|
153
|
+
.coverage
|
|
154
|
+
htmlcov/
|
|
155
|
+
__pycache__/
|
|
156
|
+
*.pyc
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**`./README.md`**
|
|
160
|
+
|
|
161
|
+
Put Getting Started near the top.
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
# [package-name]
|
|
165
|
+
|
|
166
|
+
[description]
|
|
167
|
+
|
|
168
|
+
## Getting Started
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
uv sync --dev
|
|
172
|
+
make test
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
from [package-name] import hello
|
|
177
|
+
|
|
178
|
+
print(hello("world"))
|
|
179
|
+
```
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Phase 3: Create the package and tests
|
|
183
|
+
|
|
184
|
+
Create this baseline structure.
|
|
185
|
+
|
|
186
|
+
**`src/[package_name]/__init__.py`**
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
from .core import hello
|
|
190
|
+
|
|
191
|
+
__all__ = ["hello"]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**`src/[package_name]/core.py`**
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
def hello(name: str) -> str:
|
|
198
|
+
return f"Hello, {name}!"
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**`src/[package_name]/__main__.py`**
|
|
202
|
+
|
|
203
|
+
Use this only for CLI-oriented projects.
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
from .core import hello
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def main() -> None:
|
|
210
|
+
print(hello("world"))
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
if __name__ == "__main__":
|
|
214
|
+
main()
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**`tests/test_core.py`**
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
from [package_name].core import hello
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def test_hello() -> None:
|
|
224
|
+
assert hello("world") == "Hello, world!"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
If two or more test files need shared fixtures, create `tests/conftest.py` and move shared setup there.
|
|
228
|
+
|
|
229
|
+
### Phase 4: Create examples for libraries and utilities
|
|
230
|
+
|
|
231
|
+
If the project is a library or shared utility, add an `examples/` directory and execute it from the root `test` target.
|
|
232
|
+
|
|
233
|
+
**`examples/Makefile`**
|
|
234
|
+
|
|
235
|
+
```makefile
|
|
236
|
+
test:
|
|
237
|
+
$(MAKE) -C basic-usage run PACKAGE_NAME=$(PACKAGE_NAME)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**`examples/basic-usage/Makefile`**
|
|
241
|
+
|
|
242
|
+
```makefile
|
|
243
|
+
run:
|
|
244
|
+
uv run python main.py
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**`examples/basic-usage/main.py`**
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
from [package_name] import hello
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
print(hello("world"))
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Examples must import the built package as a consumer would. Avoid relative imports back into `src/`.
|
|
257
|
+
|
|
258
|
+
### Phase 5: Verify
|
|
259
|
+
|
|
260
|
+
After creating the files:
|
|
261
|
+
|
|
262
|
+
1. Run `uv lock`.
|
|
263
|
+
2. Run `make lint-fix`.
|
|
264
|
+
3. Run `make test`.
|
|
265
|
+
4. Run `make build`.
|
|
266
|
+
5. Fix all failures before finishing.
|
|
267
|
+
|
|
268
|
+
## Examples
|
|
269
|
+
|
|
270
|
+
**Input:** "Create a Python library called `event_tools`"
|
|
271
|
+
- Create `pyproject.toml`, `Makefile`, `src/event_tools/`, `tests/`, and `examples/`
|
|
272
|
+
- Configure `uv`, Ruff, Pyright, Pytest, `pytest-cov`, and `pip-audit`
|
|
273
|
+
- Verify with `make lint-fix`, `make test`, and `make build`
|
|
274
|
+
|
|
275
|
+
**Input:** "Scaffold a Python CLI package"
|
|
276
|
+
- Add `src/<package_name>/__main__.py`
|
|
277
|
+
- Add `[project.scripts]` in `pyproject.toml` when the command name must differ from the module name
|
|
278
|
+
- Keep the same Makefile and quality checks
|
|
279
|
+
|
|
280
|
+
## Edge Cases
|
|
281
|
+
|
|
282
|
+
- If the repository already has a root `.mise.toml`, pin Python and uv there instead of assuming host-installed tools.
|
|
283
|
+
- If the project is fewer than 100 lines and explicitly marked as a spike or experiment, examples and linting may be skipped only when another applicable XDR allows it.
|
|
284
|
+
- If the user asks for an app with framework-specific needs such as FastAPI or Django, keep this baseline and add the framework config on top instead of replacing it.
|
|
285
|
+
|
|
286
|
+
## References
|
|
287
|
+
|
|
288
|
+
- [agentme-edr-014](../../014-python-project-tooling.md)
|
|
289
|
+
- [_core-adr-003 - Skill standards](../../../../../_core/adrs/principles/003-skill-standards.md)
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-005-monorepo-structure
|
|
3
|
+
description: Defines the standard monorepo layout, naming, and build conventions using shared areas, Mise, and Makefiles. Use when creating or reviewing monorepos.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-005: Monorepo structure
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-006-github-ci-cd-pipelines
|
|
3
|
+
description: Defines the standard GitHub Actions workflow split for CI, release tagging, and publishing. Use when configuring project automation.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-006: GitHub CI/CD pipelines
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -129,7 +134,7 @@ jobs:
|
|
|
129
134
|
|
|
130
135
|
*Why rebuild on publish:* The checkout is done from the exact tag commit. Rebuilding ensures the published artifact matches exactly what is tagged, rather than relying on a prior CI artifact.
|
|
131
136
|
|
|
132
|
-
*Why `id-token: write`:* Required for npm provenance attestation via `npm publish --provenance`, as specified in [agentme-edr-003](003-javascript-project-tooling.md).
|
|
137
|
+
*Why `id-token: write`:* Required for npm provenance attestation via `npm publish --provenance`, as specified in [agentme-edr-003](../application/003-javascript-project-tooling.md).
|
|
133
138
|
|
|
134
139
|
---
|
|
135
140
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-008-common-development-script-names
|
|
3
|
+
description: Defines standard development command names and lifecycle groups across projects, regardless of the underlying runner. Use when designing build, lint, test, and release entry points.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-008: Common development script names
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -13,12 +13,12 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
## Overview
|
|
15
15
|
|
|
16
|
-
Creates or extends a monorepo that follows the standard layout from [agentme-edr-005](
|
|
16
|
+
Creates or extends a monorepo that follows the standard layout from [agentme-edr-005](../../005-monorepo-structure.md):
|
|
17
17
|
top-level application folders, a shared library area, Mise-managed tooling, and Makefiles at every
|
|
18
18
|
level so any contributor can build, lint, and test any part of the monorepo with a single,
|
|
19
19
|
predictable command.
|
|
20
20
|
|
|
21
|
-
Related EDRs: [agentme-edr-005](
|
|
21
|
+
Related EDRs: [agentme-edr-005](../../005-monorepo-structure.md), [agentme-edr-013](../../../governance/013-contributing-guide-requirements.md)
|
|
22
22
|
|
|
23
23
|
## Instructions
|
|
24
24
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-013-contributing-guide-requirements
|
|
3
|
+
description: Defines the minimum contributor workflow guidance required in root CONTRIBUTING.md files. Use when scaffolding or reviewing contribution processes.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-013: Contributing guide requirements
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -26,6 +26,8 @@ Language and framework-specific tooling and project structure.
|
|
|
26
26
|
|
|
27
27
|
- [agentme-edr-003](application/003-javascript-project-tooling.md) - **JavaScript project tooling and structure** *(includes skill: [001-create-javascript-project](application/skills/001-create-javascript-project/SKILL.md))*
|
|
28
28
|
- [agentme-edr-010](application/010-golang-project-tooling.md) - **Go project tooling and structure** *(includes skill: [003-create-golang-project](application/skills/003-create-golang-project/SKILL.md))*
|
|
29
|
+
- [agentme-edr-014](application/014-python-project-tooling.md) - **Python project tooling and structure** *(includes skill: [005-create-python-project](application/skills/005-create-python-project/SKILL.md))*
|
|
30
|
+
- [agentme-edr-015](application/015-cli-tool-standards.md) - **CLI tool standards**
|
|
29
31
|
- [004-select-relevant-xdrs](application/skills/004-select-relevant-xdrs/SKILL.md) - **Select relevant XDRs**
|
|
30
32
|
|
|
31
33
|
## Devops
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-011-service-health-check-endpoint
|
|
3
|
+
description: Defines the required health endpoint contract for service availability and dependency readiness checks. Use when implementing or reviewing service health endpoints.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-011: Service health check endpoint
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-002-coding-best-practices
|
|
3
|
+
description: Defines cross-language coding practices for keeping code readable, modular, and synchronized with tests and documentation. Apply across projects adopting agentme engineering standards.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-002: Coding best practices
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-004-unit-test-requirements
|
|
3
|
+
description: Defines unit test requirements for assertions, offline execution, coverage, shared setup, and real-code preference. Use when writing or reviewing tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-004: Unit test requirements
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-007-project-quality-standards
|
|
3
|
+
description: Defines minimum project quality standards for README onboarding, testing, linting, XDR compliance, and runnable examples. Use when scaffolding or reviewing projects.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-007: Project quality standards
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -60,7 +65,7 @@ A unit test suite must run automatically before every release. Failing tests mus
|
|
|
60
65
|
|
|
61
66
|
### 3. The project MUST comply with all applicable workspace XDRs
|
|
62
67
|
|
|
63
|
-
All XDRs that apply to the project's scope (as listed in [.xdrs/index.md](
|
|
68
|
+
All XDRs that apply to the project's scope (as listed in [.xdrs/index.md](../../../index.md)) must be followed. A deviation requires a project-local XDR documenting the override.
|
|
64
69
|
|
|
65
70
|
**Requirements:**
|
|
66
71
|
- Review applicable XDRs before any significant implementation
|
|
@@ -80,7 +85,7 @@ Projects larger than 10 files or 200 lines of code must have a linter configured
|
|
|
80
85
|
|
|
81
86
|
**Exception:** Projects with fewer than 100 lines of code, or whose `README.md` prominently marks them as a **Spike** or **Experiment**, are exempt from this requirement. Such projects must never be deployed to production.
|
|
82
87
|
|
|
83
|
-
**Reference:** [agentme-edr-003](003-javascript-project-tooling.md) for JavaScript-specific tooling.
|
|
88
|
+
**Reference:** [agentme-edr-003](../application/003-javascript-project-tooling.md) for JavaScript-specific tooling.
|
|
84
89
|
|
|
85
90
|
---
|
|
86
91
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-009-error-handling
|
|
3
|
+
description: Defines error handling practices for catching, propagating, surfacing, and testing failures consistently across projects. Use when implementing interfaces and failure paths.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-009: Error handling
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme-edr-012-continuous-xdr-improvement-policy
|
|
3
|
+
description: Defines how teams should promote reusable implementation guidance into shared XDRs instead of keeping it in prompts or local habits. Use when recurring decisions surface during delivery.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# agentme-edr-012: Continuous xdr improvement policy
|
|
2
7
|
|
|
3
8
|
## Context and Problem Statement
|
|
@@ -33,7 +38,7 @@ Developers must treat reusable missing guidance discovered during implementation
|
|
|
33
38
|
|
|
34
39
|
## References
|
|
35
40
|
|
|
36
|
-
- [_core-adr-001](../../../_core/adrs/principles/001-
|
|
41
|
+
- [_core-adr-001](../../../_core/adrs/principles/001-xdrs-core.md)
|
|
37
42
|
- [_core-article-001](../../../_core/adrs/principles/articles/001-xdrs-overview.md)
|
|
38
43
|
- [agentme-article-001](articles/001-continuous-xdr-improvement.md)
|
|
39
44
|
- [002-write-xdr skill](../../../../.github/skills/002-write-xdr/SKILL.md)
|
|
@@ -51,7 +51,7 @@ Good opening questions:
|
|
|
51
51
|
|
|
52
52
|
### How should you organize the XDR?
|
|
53
53
|
|
|
54
|
-
Follow the XDR template from [_core-adr-001](
|
|
54
|
+
Follow the XDR template from [_core-adr-001](../../../../_core/adrs/principles/001-xdrs-core.md). Keep the document small, explicit, and decision-focused.
|
|
55
55
|
|
|
56
56
|
Use this checklist:
|
|
57
57
|
|
|
@@ -87,7 +87,7 @@ If the same clarification would likely be needed in another feature, by another
|
|
|
87
87
|
|
|
88
88
|
## References
|
|
89
89
|
|
|
90
|
-
- [_core-adr-001](
|
|
91
|
-
- [_core-article-001](
|
|
90
|
+
- [_core-adr-001](../../../../_core/adrs/principles/001-xdrs-core.md) - XDR structure, numbering, and mandatory template
|
|
91
|
+
- [_core-article-001](../../../../_core/adrs/principles/articles/001-xdrs-overview.md) - XDR introduction and general adoption guidance
|
|
92
92
|
- [agentme-edr-012](../012-continuous-xdr-enrichment.md) - Shared-first XDR enrichment policy and 80% coverage target
|
|
93
93
|
- [002-write-xdr skill](../../../../../.github/skills/002-write-xdr/SKILL.md) - Step-by-step procedure for drafting new XDRs
|
package/README.md
CHANGED
|
@@ -17,9 +17,9 @@ npx agentme
|
|
|
17
17
|
If you want the version pinned in a project, add `agentme` to a repository that already has a `package.json` and run it through the local dependency:
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
|
-
pnpm add -D agentme
|
|
21
|
-
pnpm exec agentme extract --output . --presets basic
|
|
22
|
-
pnpm exec agentme check --output . --presets basic
|
|
20
|
+
mise exec -- pnpm add -D agentme
|
|
21
|
+
mise exec -- pnpm exec agentme extract --output . --presets basic
|
|
22
|
+
mise exec -- pnpm exec agentme check --output . --presets basic
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Overview
|
|
@@ -80,19 +80,27 @@ This is useful when you want to:
|
|
|
80
80
|
|
|
81
81
|
## Development
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Install [Mise](https://mise.jdx.dev/getting-started.html), then sync the pinned toolchain:
|
|
84
84
|
|
|
85
85
|
```sh
|
|
86
|
-
|
|
87
|
-
make lint
|
|
88
|
-
make test
|
|
86
|
+
mise install
|
|
89
87
|
```
|
|
90
88
|
|
|
89
|
+
Use the root `Makefile` as the entry point for local verification inside the Mise-managed environment:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
mise exec -- make build
|
|
93
|
+
mise exec -- make lint
|
|
94
|
+
mise exec -- make test
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Running `make build`, `make lint`, or `make test` from an already activated Mise shell is equivalent.
|
|
98
|
+
|
|
91
99
|
What these targets do:
|
|
92
100
|
|
|
93
|
-
- `make build` installs dependencies and creates a local npm package in `dist/`.
|
|
94
|
-
- `make lint` runs the repository lint target.
|
|
95
|
-
- `make test` rebuilds the package and validates the consumer extraction flow through the runnable example in `examples/`.
|
|
101
|
+
- `mise exec -- make build` installs dependencies and creates a local npm package in `dist/`.
|
|
102
|
+
- `mise exec -- make lint` runs the repository lint target.
|
|
103
|
+
- `mise exec -- make test` rebuilds the package and validates the consumer extraction flow through the runnable example in `examples/`.
|
|
96
104
|
|
|
97
105
|
## Repository Map
|
|
98
106
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"filedist": "^0.26.0",
|
|
7
|
-
"xdrs-core": "^0.
|
|
7
|
+
"xdrs-core": "^0.16.0"
|
|
8
8
|
},
|
|
9
9
|
"bin": "bin/filedist.js",
|
|
10
10
|
"files": [
|
|
@@ -90,11 +90,30 @@
|
|
|
90
90
|
".github/agents/speckit*",
|
|
91
91
|
".github/prompts/speckit*",
|
|
92
92
|
".specify/**"
|
|
93
|
+
],
|
|
94
|
+
"exclude": [
|
|
95
|
+
".specify/templates/**"
|
|
93
96
|
]
|
|
94
97
|
},
|
|
95
98
|
"output": {
|
|
96
99
|
"path": ".",
|
|
97
|
-
"gitignore": false
|
|
100
|
+
"gitignore": false,
|
|
101
|
+
"readonly": true
|
|
102
|
+
},
|
|
103
|
+
"presets": [
|
|
104
|
+
"speckit"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"selector": {
|
|
109
|
+
"files": [
|
|
110
|
+
".specify/templates/**"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"output": {
|
|
114
|
+
"path": ".",
|
|
115
|
+
"gitignore": false,
|
|
116
|
+
"readonly": false
|
|
98
117
|
},
|
|
99
118
|
"presets": [
|
|
100
119
|
"speckit"
|
|
@@ -110,6 +129,7 @@
|
|
|
110
129
|
"path": ".",
|
|
111
130
|
"managed": false,
|
|
112
131
|
"skipIfExists": true,
|
|
132
|
+
"readonly": false,
|
|
113
133
|
"gitignore": false
|
|
114
134
|
},
|
|
115
135
|
"presets": [
|