agentme 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/.github/agents/speckit.analyze.agent.md +184 -0
- package/.github/agents/speckit.checklist.agent.md +295 -0
- package/.github/agents/speckit.clarify.agent.md +181 -0
- package/.github/agents/speckit.constitution.agent.md +84 -0
- package/.github/agents/speckit.implement.agent.md +198 -0
- package/.github/agents/speckit.plan.agent.md +90 -0
- package/.github/agents/speckit.specify.agent.md +237 -0
- package/.github/agents/speckit.tasks.agent.md +200 -0
- package/.github/agents/speckit.taskstoissues.agent.md +30 -0
- package/.github/prompts/speckit.analyze.prompt.md +3 -0
- package/.github/prompts/speckit.checklist.prompt.md +3 -0
- package/.github/prompts/speckit.clarify.prompt.md +3 -0
- package/.github/prompts/speckit.constitution.prompt.md +3 -0
- package/.github/prompts/speckit.implement.prompt.md +3 -0
- package/.github/prompts/speckit.plan.prompt.md +3 -0
- package/.github/prompts/speckit.specify.prompt.md +3 -0
- package/.github/prompts/speckit.tasks.prompt.md +3 -0
- package/.github/prompts/speckit.taskstoissues.prompt.md +3 -0
- package/.specify/memory/constitution.md +119 -0
- package/.specify/scripts/bash/check-prerequisites.sh +190 -0
- package/.specify/scripts/bash/common.sh +253 -0
- package/.specify/scripts/bash/create-new-feature.sh +333 -0
- package/.specify/scripts/bash/setup-plan.sh +73 -0
- package/.specify/scripts/bash/update-agent-context.sh +808 -0
- package/.specify/templates/agent-file-template.md +28 -0
- package/.specify/templates/checklist-template.md +40 -0
- package/.specify/templates/constitution-template.md +50 -0
- package/.specify/templates/plan-template.md +110 -0
- package/.specify/templates/spec-template.md +115 -0
- package/.specify/templates/tasks-template.md +251 -0
- package/.vscode/settings.json +14 -0
- package/.xdrs/agentme/edrs/application/003-javascript-project-tooling.md +89 -0
- package/.xdrs/agentme/edrs/application/010-golang-project-tooling.md +141 -0
- package/.xdrs/agentme/edrs/application/skills/001-create-javascript-project/SKILL.md +360 -0
- package/.xdrs/agentme/edrs/application/skills/003-create-golang-project/SKILL.md +311 -0
- package/.xdrs/agentme/edrs/devops/005-monorepo-structure.md +104 -0
- package/.xdrs/agentme/edrs/devops/006-github-pipelines.md +170 -0
- package/.xdrs/agentme/edrs/devops/008-common-targets.md +207 -0
- package/.xdrs/agentme/edrs/devops/skills/002-monorepo-setup/SKILL.md +270 -0
- package/.xdrs/agentme/edrs/index.md +41 -0
- package/.xdrs/agentme/edrs/observability/011-service-health-check-endpoint.md +78 -0
- package/.xdrs/agentme/edrs/principles/002-coding-best-practices.md +110 -0
- package/.xdrs/agentme/edrs/principles/004-unit-test-requirements.md +97 -0
- package/.xdrs/agentme/edrs/principles/007-project-quality-standards.md +156 -0
- package/.xdrs/agentme/edrs/principles/009-error-handling.md +327 -0
- package/.xdrs/index.md +32 -0
- package/README.md +119 -0
- package/bin/npmdata.js +3 -0
- package/package.json +102 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# agentme-edr-008: Common development script names
|
|
2
|
+
|
|
3
|
+
## Context and Problem Statement
|
|
4
|
+
|
|
5
|
+
Software projects use a wide variety of commands and tooling to perform the same fundamental tasks — building, testing, linting, and deploying. This diversity is amplified across language ecosystems, meaning developers must re-learn project-specific conventions every time they switch contexts. CI pipelines suffer from the same fragmentation, each one requiring bespoke scripts.
|
|
6
|
+
|
|
7
|
+
What standard set of command names and conventions should projects adopt so that any developer or CI pipeline can immediately operate on any project without needing to read documentation first?
|
|
8
|
+
|
|
9
|
+
## Decision Outcome
|
|
10
|
+
|
|
11
|
+
**Every project must expose its development actions using a defined set of standardized script names, grouped by lifecycle phase. These names apply regardless of the script runner used — Makefile, npm scripts, shell scripts, or any other tool — so that `build`, `test`, `lint`, and related commands work predictably across all projects and languages.**
|
|
12
|
+
|
|
13
|
+
Standardizing script names removes the cognitive overhead of learning per-project conventions, makes CI pipelines reusable across projects, and gives new developers an immediately operational entry point. The names are the contract; the underlying runner is an implementation detail.
|
|
14
|
+
|
|
15
|
+
### Implementation Details
|
|
16
|
+
|
|
17
|
+
#### 1. Every project MUST have a root-level entry point exposing the standard script names
|
|
18
|
+
|
|
19
|
+
The project root must contain a single authoritative entry point — a `Makefile`, `package.json` scripts section, a shell wrapper, or equivalent — that exposes the standard target names defined in rule 2. Developers and CI pipelines must invoke actions through this entry point exclusively, never by calling underlying tools directly.
|
|
20
|
+
|
|
21
|
+
**Preferred runner: Makefile.** A `Makefile` is the default recommended choice because it is language-agnostic, universally available, and provides a consistent invocation syntax (`make <target>`) across all ecosystems.
|
|
22
|
+
|
|
23
|
+
**Alternative runners** are acceptable when a Makefile is not practical for the project's ecosystem:
|
|
24
|
+
|
|
25
|
+
| Runner | Invocation example | When appropriate |
|
|
26
|
+
|--------|--------------------|------------------|
|
|
27
|
+
| Makefile | `make build` | Default; recommended for all projects |
|
|
28
|
+
| npm scripts | `npm run build` | Pure Node.js/frontend projects without a Makefile |
|
|
29
|
+
| Shell script | `./dev.sh build` | Projects where `make` is unavailable or impractical |
|
|
30
|
+
| Other (Taskfile, just, etc.) | `task build` | When agreed upon at the project or org level |
|
|
31
|
+
|
|
32
|
+
Whichever runner is chosen, the **target names** defined in rule 2 must be used unchanged. The runner is an implementation detail; the names are the shared contract.
|
|
33
|
+
|
|
34
|
+
*Why:* A single entry point means developers and CI pipelines use near-identical commands regardless of the underlying language or tooling. Any tooling change is then contained to the entry-point file and does not require updating CI pipelines or developer documentation.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
#### 2. Standard script groups and names
|
|
39
|
+
|
|
40
|
+
Scripts are organized into five lifecycle groups. Projects must use these names regardless of the script runner in use. Extensions are allowed (see rule 4) but the core names must not be repurposed.
|
|
41
|
+
|
|
42
|
+
##### Developer group
|
|
43
|
+
|
|
44
|
+
| Script | Purpose |
|
|
45
|
+
|--------|---------|
|
|
46
|
+
| `setup` | Install any tools required on the developer machine (e.g., nvm, brew, python, golang). Typically run once per project checkout. In CI, tooling is usually pre-provisioned via runner images or workflow steps instead. |
|
|
47
|
+
| `all` | Alias that runs `build`, `lint`, and `test` in sequence. Must be the default target (i.e., running `make` or the runner with no arguments invokes `all`). Used by developers as a fast pre-push check to verify the software meets minimum quality standards in one command. |
|
|
48
|
+
| `clean` | Remove all temporary or generated files created during build, lint, or test (e.g., `node_modules`, virtual environments, compiled binaries, generated files). Used both locally and in CI for a clean slate. |
|
|
49
|
+
| `dev` | Run the software locally for development (e.g., start a Node.js API server, open a Jupyter notebook, launch a React dev server). May have debugging tools, verbose logging, or hot reloading features enabled. |
|
|
50
|
+
| `run` | Run the software in production mode (e.g., start a compiled binary, launch a production server). No debugging or development-only features should be enabled. |
|
|
51
|
+
| `update-lockfile` | Update the dependency lockfile to reflect the latest resolved versions of all dependencies. |
|
|
52
|
+
|
|
53
|
+
##### Build group
|
|
54
|
+
|
|
55
|
+
| Script | Purpose |
|
|
56
|
+
|--------|---------|
|
|
57
|
+
| `build` | Install dependencies, compile, and package the software. The full `install → compile → package` workflow. |
|
|
58
|
+
| `install` | Download and install all project dependencies. Assumes the language runtime is already available (installed via `setup`). |
|
|
59
|
+
| `compile` | Compile source files into binaries or transpiled output. Assumes dependencies are already installed. |
|
|
60
|
+
| `package` | Assemble a distributable package from compiled files and other resources. Use the `VERSION` environment variable to set the package version explicitly. |
|
|
61
|
+
| `bump` | Automatically upgrade dependencies to the latest version that satisfies the semver range declared in the dependency manifest (e.g., `package.json`, `go.mod`, `pyproject.toml`). Does not widen or change the declared range — only resolves to the highest compatible version within it. After bumping, updates the lockfile and stages the changes. Useful for routine dependency maintenance without risking breaking semver contracts. |
|
|
62
|
+
|
|
63
|
+
##### Lint group
|
|
64
|
+
|
|
65
|
+
| Script | Purpose |
|
|
66
|
+
|--------|---------|
|
|
67
|
+
| `lint` | Run **all static quality checks** outside of tests. This MUST include: code formatting validation, code style enforcement, code smell detection, static analysis, dependency audits for known CVEs, security vulnerability scans (e.g., SAST), and project/configuration structure checks. All checks must be non-destructive (read-only); fixes are handled by `lint-fix`. |
|
|
68
|
+
| `lint-fix` | Automatically fix linting and formatting issues where possible. || `lint-format` | *(Optional)* Check code formatting only (e.g., Prettier, gofmt, Black). |
|
|
69
|
+
##### Test group
|
|
70
|
+
|
|
71
|
+
| Script | Purpose |
|
|
72
|
+
|--------|---------|
|
|
73
|
+
| `test` | Run **all tests** required for the project. This MUST include unit tests (with coverage enforcement — the build MUST fail if coverage thresholds are not met) and integration/end-to-end tests. Normally delegates to `test-unit` and `test-integration` in sequence. |
|
|
74
|
+
| `test-unit` | Run unit tests only, including coverage report generation and coverage threshold enforcement. |
|
|
75
|
+
| `test-integration` | *(Optional)* Run integration and end-to-end tests only. Projects without integration tests may omit this target. |
|
|
76
|
+
| `test-smoke` | *(Optional)* Run a fast, minimal subset of tests to verify the software is basically functional. Useful as a post-deploy health check. |
|
|
77
|
+
|
|
78
|
+
##### Release group
|
|
79
|
+
|
|
80
|
+
| Script | Purpose |
|
|
81
|
+
|--------|---------|
|
|
82
|
+
| `release` | Determine the next version (e.g., via semantic versioning and git tags), generate changelogs and release notes, tag the repository, and create a release artifact. Normally invokes `docgen`. |
|
|
83
|
+
| `docgen` | Generate documentation (API docs, static sites, changelogs, example outputs). |
|
|
84
|
+
| `publish` | Upload the versioned package to the appropriate registry (npm, PyPI, DockerHub, GitHub Releases, blob storage, etc.). Depends on `release` and `package` having been run first. |
|
|
85
|
+
| `deploy` | Provision the software on a running environment. Use the `STAGE` environment variable to select the target environment (e.g., `STAGE=dev make deploy`). |
|
|
86
|
+
| `undeploy` | Deactivate or remove the software from an environment. Use the `STAGE` environment variable in the same way as `deploy`. Useful for tearing down ephemeral PR environments. |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
#### 3. Standard environment variables
|
|
91
|
+
|
|
92
|
+
Two environment variables have defined semantics and must be used consistently.
|
|
93
|
+
|
|
94
|
+
| Variable | Purpose |
|
|
95
|
+
|----------|---------|
|
|
96
|
+
| `STAGE` | Identifies the runtime environment. Format: `[prefix][-variant]`. Common prefixes: `dev`, `tst`, `acc`, `prd`. Examples: `dev`, `dev-pr123`, `tst`, `prd-blue`. May be required by any target that is environment-aware (build, lint, deploy, etc.). |
|
|
97
|
+
| `VERSION` | Sets the explicit version used during packaging and deployment. Used when there is no automatic version-tagging utility, or to override it. |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
#### 4. Extending scripts with prefixes
|
|
102
|
+
|
|
103
|
+
Projects may add custom scripts beyond the standard set. Custom scripts must be named by prefixing a standard script name with a descriptive qualifier, keeping the naming intuitive and consistent with the group it belongs to.
|
|
104
|
+
|
|
105
|
+
**Examples:**
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
build-dev # prepare a build specifically for STAGE=dev
|
|
109
|
+
build-docker # build a Docker image with the application
|
|
110
|
+
test-smoke # run a fast subset of unit tests on critical paths
|
|
111
|
+
test-examples # run the examples/ folder as integration tests
|
|
112
|
+
publish-npm # publish to the npm registry specifically
|
|
113
|
+
publish-docker # publish a Docker image
|
|
114
|
+
run-docker # run the application inside a Docker container
|
|
115
|
+
start-debugger # launch the software with a visual debugger attached
|
|
116
|
+
deploy-infra # deploy only the infrastructure layer
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The prefix convention ensures developers can infer the purpose of any script without documentation.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
#### 5. Monorepo usage
|
|
124
|
+
|
|
125
|
+
In a monorepo, each module has its own `Makefile` with its own `build`, `lint`, `test`, and `deploy` targets scoped to that module. Parent-level Makefiles (at the application or repo root) delegate to module Makefiles in sequence.
|
|
126
|
+
|
|
127
|
+
```makefile
|
|
128
|
+
# root Makefile — delegates to all modules
|
|
129
|
+
build:
|
|
130
|
+
$(MAKE) -C module-a build
|
|
131
|
+
$(MAKE) -C module-b build
|
|
132
|
+
|
|
133
|
+
test:
|
|
134
|
+
$(MAKE) -C module-a test
|
|
135
|
+
$(MAKE) -C module-b test
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
A developer can run `make test` at the repo root to test everything, or `cd module-a && make test` to test a single module. Both must work.
|
|
139
|
+
|
|
140
|
+
**Reference:** See [agentme-edr-005](005-monorepo-structure.md) for the full monorepo layout convention.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
#### 6. Quick-reference — commands a developer can always rely on
|
|
145
|
+
|
|
146
|
+
Any project following this EDR supports the following actions. Examples show Makefile syntax; substitute your project's runner (e.g., `npm run build`, `./dev.sh build`) if a Makefile is not used.
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
# install required development tools
|
|
150
|
+
make setup
|
|
151
|
+
|
|
152
|
+
# build the software (install deps, compile, package)
|
|
153
|
+
make build
|
|
154
|
+
|
|
155
|
+
# run all tests (unit + integration)
|
|
156
|
+
make test
|
|
157
|
+
|
|
158
|
+
# check code formatting, style, code smells, CVE audits, security scans, and project structure
|
|
159
|
+
make lint
|
|
160
|
+
|
|
161
|
+
# auto-fix lint/formatting issues
|
|
162
|
+
make lint-fix
|
|
163
|
+
|
|
164
|
+
# run the software in dev mode (may have hot reload, debug tools enabled, verbose logging etc)
|
|
165
|
+
make dev
|
|
166
|
+
|
|
167
|
+
# run the software in production mode
|
|
168
|
+
make run
|
|
169
|
+
|
|
170
|
+
# generate next version, changelogs, and tag the repo; then package
|
|
171
|
+
make release package
|
|
172
|
+
|
|
173
|
+
# publish the release to a registry (e.g., npm, PyPI)
|
|
174
|
+
make publish
|
|
175
|
+
|
|
176
|
+
# deploy to the dev environment
|
|
177
|
+
STAGE=dev make deploy
|
|
178
|
+
|
|
179
|
+
# remove all temporary/generated files
|
|
180
|
+
make clean
|
|
181
|
+
|
|
182
|
+
# run build + lint + test in one shot (pre-push check)
|
|
183
|
+
make all
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Equivalent examples for npm scripts and shell:**
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
# npm scripts (package.json)
|
|
190
|
+
npm run build
|
|
191
|
+
npm run test
|
|
192
|
+
npm run lint
|
|
193
|
+
STAGE=dev npm run deploy
|
|
194
|
+
|
|
195
|
+
# shell wrapper
|
|
196
|
+
./dev.sh build
|
|
197
|
+
./dev.sh test
|
|
198
|
+
STAGE=dev ./dev.sh deploy
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Considered Options
|
|
202
|
+
|
|
203
|
+
* (REJECTED) **Language-native entry points only** - Use `npm run`, `python -m`, `go run` etc. directly as the standard without a unifying name convention
|
|
204
|
+
* Reason: Ties CI pipelines and developer muscle memory to language-specific tooling; breaks the abstraction when the underlying tool changes; target names vary per ecosystem
|
|
205
|
+
|
|
206
|
+
* (CHOSEN) **Standardized script names, runner-agnostic** - A common, language-agnostic command vocabulary that must be used regardless of whether the runner is a Makefile, npm scripts, a shell wrapper, or another tool; with Makefile as the preferred default
|
|
207
|
+
* Reason: Separating the names (the contract) from the runner (the implementation) gives every developer and CI pipeline a predictable interface while allowing each project to choose the most practical runner for its ecosystem.
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 002-monorepo-setup
|
|
3
|
+
description: >
|
|
4
|
+
Step-by-step instructions for setting up and scaffolding a new monorepo following the standard
|
|
5
|
+
layout, naming conventions, Makefiles, Mise tooling, and README requirements defined in
|
|
6
|
+
agentme-edr-005. Activate this skill when the user asks to create, initialize, or set up a
|
|
7
|
+
monorepo, add a new application or module to an existing monorepo, or verify that a monorepo
|
|
8
|
+
complies with the standard structure.
|
|
9
|
+
metadata:
|
|
10
|
+
author: flaviostutz
|
|
11
|
+
version: "1.0"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Creates or extends a monorepo that follows the standard layout from [agentme-edr-005](../../005-monorepo-structure.md):
|
|
17
|
+
top-level application folders, a shared library area, Mise-managed tooling, and Makefiles at every
|
|
18
|
+
level so any contributor can build, lint, and test any part of the monorepo with a single,
|
|
19
|
+
predictable command.
|
|
20
|
+
|
|
21
|
+
Related EDR: [agentme-edr-005](../../005-monorepo-structure.md)
|
|
22
|
+
|
|
23
|
+
## Instructions
|
|
24
|
+
|
|
25
|
+
### Phase 1: Gather information
|
|
26
|
+
|
|
27
|
+
1. Ask for (or infer from context):
|
|
28
|
+
- **Applications** — names and short descriptions of the top-level applications to scaffold.
|
|
29
|
+
- **Modules** — modules inside each application (e.g., `renderer`, `dataloader`, `cli`).
|
|
30
|
+
- **Primary language(s)** — Go, Python, TypeScript, etc., to choose the right build commands.
|
|
31
|
+
- **Tool versions** — versions to pin in `.mise.toml` (compilers, runtimes, CLI tools).
|
|
32
|
+
2. Confirm the target directory (default: current workspace root).
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### Phase 2: Create root-level files
|
|
37
|
+
|
|
38
|
+
#### `.mise.toml`
|
|
39
|
+
|
|
40
|
+
Pin all required tool versions. Example for a Go + Node.js monorepo:
|
|
41
|
+
|
|
42
|
+
```toml
|
|
43
|
+
[tools]
|
|
44
|
+
go = "1.22"
|
|
45
|
+
node = "24"
|
|
46
|
+
golangci-lint = "1.57"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Root `Makefile`
|
|
50
|
+
|
|
51
|
+
Coordinates `build`, `lint`, and `test` across all applications. Also exposes a `setup` target.
|
|
52
|
+
|
|
53
|
+
```makefile
|
|
54
|
+
.PHONY: build lint test setup
|
|
55
|
+
|
|
56
|
+
APPS := <app1> <app2> # replace with actual application names
|
|
57
|
+
|
|
58
|
+
build:
|
|
59
|
+
$(foreach app,$(APPS),$(MAKE) -C $(app) build &&) true
|
|
60
|
+
|
|
61
|
+
lint:
|
|
62
|
+
$(foreach app,$(APPS),$(MAKE) -C $(app) lint &&) true
|
|
63
|
+
|
|
64
|
+
test:
|
|
65
|
+
$(foreach app,$(APPS),$(MAKE) -C $(app) test &&) true
|
|
66
|
+
|
|
67
|
+
setup:
|
|
68
|
+
@echo "Install Mise: https://mise.jdx.dev/getting-started.html"
|
|
69
|
+
@echo "Then run: mise install"
|
|
70
|
+
@echo "See README.md for full setup instructions."
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### Root `README.md`
|
|
74
|
+
|
|
75
|
+
Must include four sections:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
# <Monorepo Name>
|
|
79
|
+
|
|
80
|
+
## Overview
|
|
81
|
+
<What this monorepo contains and its high-level structure.>
|
|
82
|
+
|
|
83
|
+
## Machine setup
|
|
84
|
+
1. Install [Mise](https://mise.jdx.dev/getting-started.html).
|
|
85
|
+
2. Clone the repository and run `mise install`.
|
|
86
|
+
3. <Any OS-level prerequisites.>
|
|
87
|
+
|
|
88
|
+
## Quickstart
|
|
89
|
+
<Instructions to run at least one project locally as a concrete working example.>
|
|
90
|
+
|
|
91
|
+
## Repository map
|
|
92
|
+
| Folder | Description |
|
|
93
|
+
|---------------------|------------------------------------|
|
|
94
|
+
| `shared/` | Libraries and scripts shared across all apps |
|
|
95
|
+
| `<app1>/` | <Short description of app1> |
|
|
96
|
+
| `<app2>/` | <Short description of app2> |
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### Phase 3: Create the `shared/` area
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
shared/
|
|
105
|
+
├── libs/ # Reusable libraries consumed by applications
|
|
106
|
+
└── scripts/ # Build/CI/dev scripts used across applications
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Create these folders; populate only if shared content already exists.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### Phase 4: Scaffold each application
|
|
114
|
+
|
|
115
|
+
For each application:
|
|
116
|
+
|
|
117
|
+
1. **Create the application folder** using lowercase, hyphen-separated names (e.g., `graph-visualizer`).
|
|
118
|
+
|
|
119
|
+
2. **Create `<app>/README.md`** with the four required sections:
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
# <Application Name>
|
|
123
|
+
|
|
124
|
+
## Purpose
|
|
125
|
+
<What this application does and why it exists.>
|
|
126
|
+
|
|
127
|
+
## Architecture overview
|
|
128
|
+
| Module | Description |
|
|
129
|
+
|---------------|------------------------------------|
|
|
130
|
+
| `<module1>/` | <What it does and what it produces>|
|
|
131
|
+
|
|
132
|
+
## How to build
|
|
133
|
+
Run `make build` from this folder or from the repository root.
|
|
134
|
+
|
|
135
|
+
## How to run
|
|
136
|
+
<Minimal working example.>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
3. **Create `<app>/Makefile`** that delegates to each module:
|
|
140
|
+
|
|
141
|
+
```makefile
|
|
142
|
+
.PHONY: build lint test
|
|
143
|
+
|
|
144
|
+
MODULES := <module1> <module2> # replace with actual module names
|
|
145
|
+
|
|
146
|
+
build:
|
|
147
|
+
$(foreach mod,$(MODULES),$(MAKE) -C $(mod) build &&) true
|
|
148
|
+
|
|
149
|
+
lint:
|
|
150
|
+
$(foreach mod,$(MODULES),$(MAKE) -C $(mod) lint &&) true
|
|
151
|
+
|
|
152
|
+
test:
|
|
153
|
+
$(foreach mod,$(MODULES),$(MAKE) -C $(mod) test &&) true
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
4. **Create `<app>/shared/`** — leave empty if no cross-module shared code exists yet.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### Phase 5: Scaffold each module
|
|
161
|
+
|
|
162
|
+
For each module inside an application:
|
|
163
|
+
|
|
164
|
+
1. **Create the module folder** using lowercase, hyphen-separated names (e.g., `data-loader`).
|
|
165
|
+
|
|
166
|
+
2. **Create `<app>/<module>/Makefile`** with the three required targets, adapted to the module's language:
|
|
167
|
+
|
|
168
|
+
**Go:**
|
|
169
|
+
```makefile
|
|
170
|
+
.PHONY: build lint test
|
|
171
|
+
|
|
172
|
+
build:
|
|
173
|
+
go build ./...
|
|
174
|
+
|
|
175
|
+
lint:
|
|
176
|
+
golangci-lint run ./...
|
|
177
|
+
|
|
178
|
+
test:
|
|
179
|
+
go test ./... -cover
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Node.js / TypeScript:**
|
|
183
|
+
```makefile
|
|
184
|
+
.PHONY: build lint test
|
|
185
|
+
|
|
186
|
+
build:
|
|
187
|
+
npm run build
|
|
188
|
+
|
|
189
|
+
lint:
|
|
190
|
+
npm run lint
|
|
191
|
+
|
|
192
|
+
test:
|
|
193
|
+
npm test
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Python:**
|
|
197
|
+
```makefile
|
|
198
|
+
.PHONY: build lint test
|
|
199
|
+
|
|
200
|
+
build:
|
|
201
|
+
pip install -e .
|
|
202
|
+
|
|
203
|
+
lint:
|
|
204
|
+
ruff check .
|
|
205
|
+
|
|
206
|
+
test:
|
|
207
|
+
pytest
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
3. **Add source files** appropriate to the language, placing them inside the module folder.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### Phase 6: Verify and report
|
|
215
|
+
|
|
216
|
+
After scaffolding, run the following checks and fix any issues:
|
|
217
|
+
|
|
218
|
+
- `make build` at the repository root succeeds.
|
|
219
|
+
- `make lint` at the repository root passes.
|
|
220
|
+
- `make test` at the repository root passes.
|
|
221
|
+
- All folder and file names are lowercase and use hyphens.
|
|
222
|
+
- Every application folder has a `README.md` covering all four required sections.
|
|
223
|
+
- A `.mise.toml` exists at the repository root with all required tool versions pinned.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Examples
|
|
228
|
+
|
|
229
|
+
### Example: adding a new `pcb-devices` application with a `firmware` module (Go)
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
pcb-devices/
|
|
233
|
+
├── README.md
|
|
234
|
+
├── Makefile
|
|
235
|
+
├── shared/
|
|
236
|
+
└── firmware/
|
|
237
|
+
└── Makefile
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
`pcb-devices/Makefile`:
|
|
241
|
+
```makefile
|
|
242
|
+
.PHONY: build lint test
|
|
243
|
+
MODULES := firmware
|
|
244
|
+
build:
|
|
245
|
+
$(foreach mod,$(MODULES),$(MAKE) -C $(mod) build &&) true
|
|
246
|
+
lint:
|
|
247
|
+
$(foreach mod,$(MODULES),$(MAKE) -C $(mod) lint &&) true
|
|
248
|
+
test:
|
|
249
|
+
$(foreach mod,$(MODULES),$(MAKE) -C $(mod) test &&) true
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
`pcb-devices/firmware/Makefile`:
|
|
253
|
+
```makefile
|
|
254
|
+
.PHONY: build lint test
|
|
255
|
+
build:
|
|
256
|
+
go build ./...
|
|
257
|
+
lint:
|
|
258
|
+
golangci-lint run ./...
|
|
259
|
+
test:
|
|
260
|
+
go test ./... -cover
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Edge Cases
|
|
266
|
+
|
|
267
|
+
- **Cross-application dependency requested:** Refuse and suggest publishing the shared code as a library in `shared/libs/` instead.
|
|
268
|
+
- **Module with no compilable output (e.g., pure scripts):** Still create the Makefile; `build` can be a no-op (`@true`) but the target must exist.
|
|
269
|
+
- **Language not listed above:** Mirror the pattern — `build` produces an artifact, `lint` runs static analysis, `test` runs tests. Adapt commands to the actual toolchain.
|
|
270
|
+
- **Existing files:** Never overwrite existing `README.md` or `Makefile` files without user confirmation. Diff and propose additions instead.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# agentme EDRs Index
|
|
2
|
+
|
|
3
|
+
Engineering decisions specific to the agentme project: a curated library of XDRs and skills encoding best practices for AI coding agents.
|
|
4
|
+
|
|
5
|
+
Propose changes via pull request. All changes must be verified for clarity and non-conflict before merging.
|
|
6
|
+
|
|
7
|
+
## Related scope indexes
|
|
8
|
+
|
|
9
|
+
- [_core EDRs Index](../../_core/edrs/index.md) - Cross-business general standards (overridden by this scope where conflicts are documented)
|
|
10
|
+
|
|
11
|
+
XDRs in scopes listed last override the ones listed first.
|
|
12
|
+
|
|
13
|
+
## Principles
|
|
14
|
+
|
|
15
|
+
Foundational standards, principles, and guidelines.
|
|
16
|
+
|
|
17
|
+
- [agentme-edr-002](principles/002-coding-best-practices.md) - **Coding best practices**
|
|
18
|
+
- [agentme-edr-004](principles/004-unit-test-requirements.md) - **Unit test requirements**
|
|
19
|
+
- [agentme-edr-007](principles/007-project-quality-standards.md) - **Project quality standards**
|
|
20
|
+
- [agentme-edr-009](principles/009-error-handling.md) - **Error handling**
|
|
21
|
+
|
|
22
|
+
## Application
|
|
23
|
+
|
|
24
|
+
Language and framework-specific tooling and project structure.
|
|
25
|
+
|
|
26
|
+
- [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))*
|
|
27
|
+
- [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))*
|
|
28
|
+
|
|
29
|
+
## Devops
|
|
30
|
+
|
|
31
|
+
Repository structure, build conventions, and CI/CD pipelines.
|
|
32
|
+
|
|
33
|
+
- [agentme-edr-005](devops/005-monorepo-structure.md) - **Monorepo structure** *(includes skill: [002-monorepo-setup](devops/skills/002-monorepo-setup/SKILL.md))*
|
|
34
|
+
- [agentme-edr-006](devops/006-github-pipelines.md) - **GitHub CI/CD pipelines**
|
|
35
|
+
- [agentme-edr-008](devops/008-common-targets.md) - **Common development script names**
|
|
36
|
+
|
|
37
|
+
## Observability
|
|
38
|
+
|
|
39
|
+
Health, metrics, logging, and monitoring standards.
|
|
40
|
+
|
|
41
|
+
- [agentme-edr-011](observability/011-service-health-check-endpoint.md) - **Service health check endpoint**
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# agentme-edr-011: Service health check endpoint
|
|
2
|
+
|
|
3
|
+
## Context and Problem Statement
|
|
4
|
+
|
|
5
|
+
Services in distributed environments need standardized health endpoints so load balancers, orchestrators, and monitoring systems can determine availability and readiness. Without consistent health checks, infrastructure cannot make informed routing decisions and operational teams lack visibility into dependency status.
|
|
6
|
+
|
|
7
|
+
How should services expose their health status and validate operational readiness?
|
|
8
|
+
|
|
9
|
+
## Decision Outcome
|
|
10
|
+
|
|
11
|
+
**Standardized `/health` endpoint with dependency validation**
|
|
12
|
+
|
|
13
|
+
All services must expose a `GET /health` endpoint that validates external dependencies using read-only operations and returns structured status with appropriate HTTP codes.
|
|
14
|
+
|
|
15
|
+
### Implementation Details
|
|
16
|
+
|
|
17
|
+
**Endpoint contract:**
|
|
18
|
+
|
|
19
|
+
| Aspect | Requirement |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| Path | `/health` |
|
|
22
|
+
| Method | `GET` |
|
|
23
|
+
| Authentication | None (publicly accessible) |
|
|
24
|
+
| Timeout | 30 seconds maximum |
|
|
25
|
+
|
|
26
|
+
**HTTP status codes:**
|
|
27
|
+
|
|
28
|
+
| Code | State | Infrastructure action |
|
|
29
|
+
|------|-------|-----------------------|
|
|
30
|
+
| `200` | `OK` | Route traffic normally |
|
|
31
|
+
| `210` | `WARNING` | Route normally, trigger alerts |
|
|
32
|
+
| `503` | `ERROR` | Remove from load balancer rotation |
|
|
33
|
+
|
|
34
|
+
**Response body:**
|
|
35
|
+
```json
|
|
36
|
+
{ "health": "OK|WARNING|ERROR", "latencyMs": 156, "message": "All dependencies operational" }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- `health` (required): overall state — `OK`, `WARNING`, or `ERROR`
|
|
40
|
+
- `latencyMs` (required): total milliseconds to run all checks
|
|
41
|
+
- `message` (required): human-readable summary; must never expose credentials, internal IPs, or stack traces
|
|
42
|
+
|
|
43
|
+
**Dependency validation rules:**
|
|
44
|
+
|
|
45
|
+
- Check all external dependencies (databases, downstream APIs, queues, caches) using read-only operations (e.g., `SELECT 1`, lightweight GET, connection ping)
|
|
46
|
+
- Never execute write operations or create side effects
|
|
47
|
+
- `OK`: all dependencies healthy within expected thresholds
|
|
48
|
+
- `WARNING`: non-critical dependency degraded, or elevated but acceptable response times
|
|
49
|
+
- `ERROR`: critical dependency unavailable or service unable to process requests
|
|
50
|
+
|
|
51
|
+
**Implementation guidelines:**
|
|
52
|
+
|
|
53
|
+
- Run dependency checks in parallel to minimize latency
|
|
54
|
+
- Cache check results for 5–10 seconds to avoid overwhelming dependencies
|
|
55
|
+
- Apply per-dependency timeouts (5–10 seconds each)
|
|
56
|
+
- Use circuit breaker patterns to fail fast on known-bad dependencies
|
|
57
|
+
- Log failures for debugging; avoid excessive logging on every successful check
|
|
58
|
+
|
|
59
|
+
**Integration points:**
|
|
60
|
+
|
|
61
|
+
- Load balancers: 30 s interval, 2 consecutive failures to mark unhealthy, 2 successes to restore
|
|
62
|
+
- Container orchestrators (ECS, Kubernetes): use `/health` for liveness and readiness probes
|
|
63
|
+
- Monitoring: periodic polling with alerts on `210` and `503` responses
|
|
64
|
+
- CI/CD: poll `/health` to confirm deployment success
|
|
65
|
+
|
|
66
|
+
## Considered Options
|
|
67
|
+
|
|
68
|
+
* (REJECTED) **No health checks** — detect failures through request errors
|
|
69
|
+
* Reason: Reactive; customer-visible failures occur before detection; no degraded-state visibility
|
|
70
|
+
* (REJECTED) **Simple ping returning 200** — no dependency validation
|
|
71
|
+
* Reason: A service can appear healthy while critical dependencies are down
|
|
72
|
+
* (CHOSEN) **Standardized `/health` with dependency validation** — single aggregated endpoint
|
|
73
|
+
* Reason: Actionable health info without exposing internals; enables infrastructure automation; balances operational visibility with security
|
|
74
|
+
|
|
75
|
+
## References
|
|
76
|
+
|
|
77
|
+
- [Health Check Response Format for HTTP APIs (IETF draft)](https://datatracker.ietf.org/doc/html/draft-inadarei-api-health-check)
|
|
78
|
+
- [AWS ALB Health Checks](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html)
|