forked from cs-util/TemplateJs
-
Notifications
You must be signed in to change notification settings - Fork 0
V4 #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
V4 #12
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
9d21e66
Spec for iteration 2
cs-util 5b1b7b8
Applied latest template repo changes
cs-util 9c5b97b
applied latest changes from template repo
cs-util 88175aa
Ran auto format on repo
cs-util efffc15
Add tests for palette variations and prompts normalization
cs-util 102a8ca
Implement Iteration 2 iterative workflow
cs-util 816ea53
Swapped parseFlashImageResponse to emit inline data URLs instead of U…
cs-util 033a330
Esc key handler now attaches only while the final modal is visible (a…
cs-util dbd2343
Auto formatted
cs-util 9a552b9
Expanded the iteration timeline container to the full viewport width,…
cs-util 64ad1df
Revert "Swapped parseFlashImageResponse to emit inline data URLs inst…
cs-util 47bc252
Swapped the inline aspect-ratio declaration for the existing aspect-[…
cs-util 7f270e4
Replaced the unused tile "Details" button with a click-to-expand desc…
cs-util c165bad
- Clarified iteration, gallery, and finalization prompts so Gemini ke…
cs-util e3c2233
- Moved the first-iteration launch control into its own post-brief se…
cs-util 73405d5
Updated app.js so the generate bar now toggles both the Tailwind hidd…
cs-util ab68675
- Swapped the static Silent Room Brief copy for editable inputs so th…
cs-util b740b83
- Reinforced iteration, gallery, and finalization prompts so doors, w…
cs-util f65e671
- Simplified the iteration prompt wording to mirror the Iteration 2 s…
cs-util b227688
Update Iteration2Spec.md
cs-util 13602a4
Restored the Tailwind build script in package.json, so npm run build:…
cs-util e0a47ab
Merge commit 'b227688947def34e1d9e3341e8f3e06d33b3f4ef' into v4
cs-util File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "singleQuote": true, | ||
| "trailingComma": "es5", | ||
| "semi": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,106 +1,49 @@ | ||
| # AGENTS.md — TemplateJs | ||
|
|
||
| Canonical instructions for coding agents. Human-facing docs are in `README.md`. | ||
| # Rules | ||
|
|
||
| ## Quick facts | ||
| - Minimal single-page web app (static HTML + modular JS) | ||
| ## General | ||
| - Minimal local first web app (static HTML + modular JS) | ||
| - Entrypoint: `index.html` (+ static pages in `pages/`) | ||
| - Source in `src/` with colocated tests | ||
| - Deploy via GitHub Pages from `main` (static assets) | ||
| - Preferred dev env: Codespaces (optional) | ||
|
|
||
| ## Runbook | ||
| - Before commit: `npm run check:all` then `npm test` | ||
| - Before PR/release: `npm run validate:all` (tests + checks + mutation) | ||
| - Always run commands in a real terminal and include actual output in notes/PRs. | ||
| - Source composed of small, focused modules in `src/` (`components/`, `utils/`, ..) with colocated tests | ||
| - Frequently during development and before each commit: run `npm test` | ||
| - `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 | ||
| - Static app => serve `index.html` with simple static server (e.g., VS Code Live Server) | ||
| - Only change code directly related to the current task; keep diffs small | ||
| - Preserve existing comments & docs; add concise, long-lived comments where useful and avoid narrating changes via comments | ||
| - 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") | ||
|
|
||
| ## Build/Serve | ||
| - Static app; serve `index.html` with a simple static server (e.g., VS Code Live Server) | ||
| ## Dependencies & no-build approach to use | ||
| This project follows a no-build, static workflow: | ||
| - Use native ES modules and `<script type="importmap">` to map bare specifiers when needed. | ||
| - Then load your entry/module scripts with `<script type="module">` and import using the mapped specifiers. | ||
| - Prefer CDN URLs from unpkg.com for third-party modules compatible with ESM. | ||
| - Do not add bundlers/build chains unless explicitly requested in an issue/PR. | ||
|
|
||
| ## Tests | ||
| - Run all tests: `npm test` | ||
| - Tests live near code: `src/**/foo.test.js`, `*.property.test.js` | ||
| ## Test layout | ||
| - Unit specs: `*.test.js` | ||
| - Property-based specs: `*.property.test.js` | ||
| - Property-based tests are important, don't omit them for important components | ||
| - Keep tests deterministic and fast; avoid E2E unless asked | ||
|
|
||
| Failure loop | ||
| 1) Prefer the simplest fix | ||
| 2) Make minimal, focused changes | ||
| 3) Re-run failing tests immediately and include real output | ||
| 4) Iterate until green | ||
|
|
||
| ## Coding guidelines | ||
| - Small, focused modules in `src/` (`components/`, `utils/`) | ||
| - Keep public HTML under `pages/` stable; don’t break URLs | ||
| - Use existing lint/format scripts if present | ||
|
|
||
| ## Commits & PRs | ||
| - Commits: concise; Conventional Commits preferred (e.g., `feat: add person card`); don’t churn history for formatting | ||
| - PRs: small, scoped diffs; explain what you ran (install/tests/validation); add/update tests for changed behavior | ||
|
|
||
| Checklist | ||
| - [ ] `npm ci` and `npm run validate:all` pass locally | ||
| - [ ] Tests added/updated for new behavior | ||
| - [ ] No unrelated refactors/drive-bys | ||
| - [ ] PR description includes summary, commands run, brief test output | ||
|
|
||
| ## Safety & guardrails | ||
| - No secrets (.env/tokens/creds) | ||
| - No deploy changes (Pages/release flows) | ||
| - Least privilege: prefer read-only changes | ||
|
|
||
| ## File map (read before changing code) | ||
| - `README.md` | ||
| - `package.json` source of truth for commands | ||
| - `index.html`, `pages/` static entry points | ||
| - `src/` — app code and tests | ||
|
|
||
| ## When in doubt — ask before | ||
| - Large refactors | ||
| - Changing public URLs or Pages config | ||
| ## TDD Failure loop to use | ||
| 1. Prefer the simplest fix first | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| 2. Use TDD: Add a failing test first and run `npm test` to verify it's failing | ||
| 3. Make minimal, focused changes | ||
| 4. Re-run `npm test` after each fix and document real output | ||
| 5. Iterate until green | ||
|
|
||
| ## Feature development process (for agents) | ||
| ## Feature development process to use | ||
|
|
||
| Follow this lightweight spec-first flow before coding: | ||
|
|
||
| 1) Requirements gathering | ||
| - Ask one question at a time and iterate until requirements are complete. | ||
| - Build each question on previous answers; prefer numbered response options to keep it structured. | ||
| - Ask one question at a time and iterate until requirements are clear. | ||
| - Build each question on previous answers; prefer 4+ numbered response options for the user to select from. | ||
| - For larger changes: draft a high-level implementation plan and pause for explicit user approval before modifying code. | ||
|
|
||
| 2) Specification development | ||
| - 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. | ||
| - Smaller changes: clearly state what changes, how it integrates, and key edge cases. | ||
| - Smaller changes: clearly state what changes, how it integrates, testing strategy and key edge cases. | ||
| - 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. | ||
|
|
||
| 3) Final specification | ||
| - Compile a concise developer-ready spec markdown next to new components if any were added | ||
|
|
||
| ## Implementation guidelines | ||
| - Only change code directly related to the current task; keep diffs small | ||
| - Preserve existing comments/docs; add concise, long-lived docs where useful and avoid narrating changes via comments | ||
|
|
||
| ## Quality checks | ||
| - During development: run frequently | ||
| - `npm run check:all` | ||
| - `npm test` | ||
| - Before PR: `npm run validate:all` (tests + checks + mutation) | ||
|
|
||
| Test structure | ||
| - `*.test.js` — unit | ||
| - `*.property.test.js` — property-based (fast-check) | ||
| - Mutation: `npm run mutation` (CI too); aim >50% | ||
|
|
||
| Failure triage loop | ||
| 1. Simplest fix first | ||
| 2. Minimal changes | ||
| 3. Re-run the specific failing scope | ||
| 4. Iterate until green | ||
|
|
||
| Verification discipline | ||
| - Only claim pass/fail with real command output | ||
|
|
||
| ## Dependencies & no-build approach | ||
|
|
||
| This project follows a no-build, static workflow: | ||
| - Use native ES modules and `<script type="importmap">` to map bare specifiers when needed. | ||
| - Then load your entry/module scripts with `<script type="module">` and import using the mapped specifiers. | ||
| - Prefer CDN URLs from unpkg.com for third-party modules compatible with ESM. | ||
| - Do not add bundlers/build chains unless explicitly requested in an issue/PR. | ||
| - 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. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line has a trailing whitespace character at the end, which should be removed for consistent formatting.