Skip to content

Commit b7e3b63

Browse files
authored
Merge pull request #12 from cs-util-com/v4
V4
2 parents 8f920df + e0a47ab commit b7e3b63

39 files changed

+5191
-2465
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Stryker Mutation testing
22
.stryker-tmp/
3+
mutation-testing/reports/mutation-report.json
4+
mutation-testing/reports/html/
35

46
# Logs
57
logs
@@ -25,6 +27,8 @@ lib-cov
2527
# Coverage directory used by tools like istanbul
2628
coverage
2729
*.lcov
30+
playwright-report/
31+
test-results/
2832

2933
# nyc test coverage
3034
.nyc_output

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"semi": true
5+
}

AGENTS.md

Lines changed: 33 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,49 @@
1-
# AGENTS.md — TemplateJs
21

3-
Canonical instructions for coding agents. Human-facing docs are in `README.md`.
2+
# Rules
43

5-
## Quick facts
6-
- Minimal single-page web app (static HTML + modular JS)
4+
## General
5+
- Minimal local first web app (static HTML + modular JS)
76
- Entrypoint: `index.html` (+ static pages in `pages/`)
8-
- Source in `src/` with colocated tests
9-
- Deploy via GitHub Pages from `main` (static assets)
10-
- Preferred dev env: Codespaces (optional)
11-
12-
## Runbook
13-
- Before commit: `npm run check:all` then `npm test`
14-
- Before PR/release: `npm run validate:all` (tests + checks + mutation)
15-
- Always run commands in a real terminal and include actual output in notes/PRs.
7+
- Source composed of small, focused modules in `src/` (`components/`, `utils/`, ..) with colocated tests
8+
- Frequently during development and before each commit: run `npm test`
9+
- `README.md` typically contains big picture dev. spec and context. It should be kept up to date whenever the code is ready for a PR
10+
- Static app => serve `index.html` with simple static server (e.g., VS Code Live Server)
11+
- Only change code directly related to the current task; keep diffs small
12+
- Preserve existing comments & docs; add concise, long-lived comments where useful and avoid narrating changes via comments
13+
- When external documentation is needed and you lack a browsing/online search tool, ask the user to run an online search for you (e.g., "Please search for \"x\" and paste back the findings")
1614

17-
## Build/Serve
18-
- Static app; serve `index.html` with a simple static server (e.g., VS Code Live Server)
15+
## Dependencies & no-build approach to use
16+
This project follows a no-build, static workflow:
17+
- Use native ES modules and `<script type="importmap">` to map bare specifiers when needed.
18+
- Then load your entry/module scripts with `<script type="module">` and import using the mapped specifiers.
19+
- Prefer CDN URLs from unpkg.com for third-party modules compatible with ESM.
20+
- Do not add bundlers/build chains unless explicitly requested in an issue/PR.
1921

20-
## Tests
21-
- Run all tests: `npm test`
22-
- Tests live near code: `src/**/foo.test.js`, `*.property.test.js`
22+
## Test layout
23+
- Unit specs: `*.test.js`
24+
- Property-based specs: `*.property.test.js`
25+
- Property-based tests are important, don't omit them for important components
2326
- Keep tests deterministic and fast; avoid E2E unless asked
2427

25-
Failure loop
26-
1) Prefer the simplest fix
27-
2) Make minimal, focused changes
28-
3) Re-run failing tests immediately and include real output
29-
4) Iterate until green
30-
31-
## Coding guidelines
32-
- Small, focused modules in `src/` (`components/`, `utils/`)
33-
- Keep public HTML under `pages/` stable; don’t break URLs
34-
- Use existing lint/format scripts if present
35-
36-
## Commits & PRs
37-
- Commits: concise; Conventional Commits preferred (e.g., `feat: add person card`); don’t churn history for formatting
38-
- PRs: small, scoped diffs; explain what you ran (install/tests/validation); add/update tests for changed behavior
39-
40-
Checklist
41-
- [ ] `npm ci` and `npm run validate:all` pass locally
42-
- [ ] Tests added/updated for new behavior
43-
- [ ] No unrelated refactors/drive-bys
44-
- [ ] PR description includes summary, commands run, brief test output
45-
46-
## Safety & guardrails
47-
- No secrets (.env/tokens/creds)
48-
- No deploy changes (Pages/release flows)
49-
- Least privilege: prefer read-only changes
50-
51-
## File map (read before changing code)
52-
- `README.md`
53-
- `package.json` source of truth for commands
54-
- `index.html`, `pages/` static entry points
55-
- `src/` — app code and tests
56-
57-
## When in doubt — ask before
58-
- Large refactors
59-
- Changing public URLs or Pages config
28+
## TDD Failure loop to use
29+
1. Prefer the simplest fix first
30+
2. Use TDD: Add a failing test first and run `npm test` to verify it's failing
31+
3. Make minimal, focused changes
32+
4. Re-run `npm test` after each fix and document real output
33+
5. Iterate until green
6034

61-
## Feature development process (for agents)
35+
## Feature development process to use
6236

6337
Follow this lightweight spec-first flow before coding:
6438

6539
1) Requirements gathering
66-
- Ask one question at a time and iterate until requirements are complete.
67-
- Build each question on previous answers; prefer numbered response options to keep it structured.
40+
- Ask one question at a time and iterate until requirements are clear.
41+
- Build each question on previous answers; prefer 4+ numbered response options for the user to select from.
42+
- For larger changes: draft a high-level implementation plan and pause for explicit user approval before modifying code.
6843

6944
2) Specification development
70-
- Major features: capture functional requirements, architecture choices/integration points, data handling (I/O, validation), error handling and edge cases, testing strategy (unit, property-based, integration), and any UI/performance considerations.
71-
- Smaller changes: clearly state what changes, how it integrates, and key edge cases.
45+
- Smaller changes: clearly state what changes, how it integrates, testing strategy and key edge cases.
46+
- Major features: capture functional requirements, architecture choices/integration points, data handling (I/O, validation), error handling and edge cases, testing strategy (unit + property-based + integration), and any UI & performance considerations.
7247

7348
3) Final specification
74-
- Compile a concise developer-ready spec markdown next to new components if any were added
75-
76-
## Implementation guidelines
77-
- Only change code directly related to the current task; keep diffs small
78-
- Preserve existing comments/docs; add concise, long-lived docs where useful and avoid narrating changes via comments
79-
80-
## Quality checks
81-
- During development: run frequently
82-
- `npm run check:all`
83-
- `npm test`
84-
- Before PR: `npm run validate:all` (tests + checks + mutation)
85-
86-
Test structure
87-
- `*.test.js` — unit
88-
- `*.property.test.js` — property-based (fast-check)
89-
- Mutation: `npm run mutation` (CI too); aim >50%
90-
91-
Failure triage loop
92-
1. Simplest fix first
93-
2. Minimal changes
94-
3. Re-run the specific failing scope
95-
4. Iterate until green
96-
97-
Verification discipline
98-
- Only claim pass/fail with real command output
99-
100-
## Dependencies & no-build approach
101-
102-
This project follows a no-build, static workflow:
103-
- Use native ES modules and `<script type="importmap">` to map bare specifiers when needed.
104-
- Then load your entry/module scripts with `<script type="module">` and import using the mapped specifiers.
105-
- Prefer CDN URLs from unpkg.com for third-party modules compatible with ESM.
106-
- Do not add bundlers/build chains unless explicitly requested in an issue/PR.
49+
- Compile a concise developer-ready spec markdown next to new components if any were added. Include as a first line a summary that could also be used as a commit message for the change.

0 commit comments

Comments
 (0)