@givolt/i3-composer-agent 0.0.0-stage → 1.0.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.
Files changed (231) hide show
  1. package/.agents/plugins/marketplace.json +23 -0
  2. package/.claude/commands/build.md +44 -0
  3. package/.claude/commands/code-simplify.md +22 -0
  4. package/.claude/commands/constraints.md +32 -0
  5. package/.claude/commands/plan.md +18 -0
  6. package/.claude/commands/review.md +16 -0
  7. package/.claude/commands/ship.md +72 -0
  8. package/.claude/commands/spec.md +17 -0
  9. package/.claude/commands/test.md +19 -0
  10. package/.claude/commands/webperf.md +32 -0
  11. package/.claude-plugin/marketplace.json +27 -0
  12. package/.claude-plugin/plugin.json +19 -0
  13. package/.codex-plugin/plugin.json +28 -0
  14. package/.gemini/commands/build.toml +43 -0
  15. package/.gemini/commands/code-simplify.toml +22 -0
  16. package/.gemini/commands/constraints.toml +32 -0
  17. package/.gemini/commands/planning.toml +18 -0
  18. package/.gemini/commands/review.toml +16 -0
  19. package/.gemini/commands/ship.toml +72 -0
  20. package/.gemini/commands/spec.toml +17 -0
  21. package/.gemini/commands/test.toml +19 -0
  22. package/.gemini/commands/webperf.toml +32 -0
  23. package/CHANGELOG.md +23 -0
  24. package/LICENSE +21 -0
  25. package/NOTICE.md +9 -0
  26. package/README.md +117 -2
  27. package/agents/code-reviewer.md +102 -0
  28. package/agents/security-auditor.md +112 -0
  29. package/agents/test-engineer.md +95 -0
  30. package/agents/web-performance-auditor.md +184 -0
  31. package/bin/i3-composer-agent.cjs +122 -0
  32. package/commands/build.toml +43 -0
  33. package/commands/code-simplify.toml +22 -0
  34. package/commands/constraints.toml +32 -0
  35. package/commands/planning.toml +18 -0
  36. package/commands/review.toml +16 -0
  37. package/commands/ship.toml +72 -0
  38. package/commands/spec.toml +17 -0
  39. package/commands/test.toml +19 -0
  40. package/commands/webperf.toml +32 -0
  41. package/docs/adoption-guide.md +129 -0
  42. package/docs/advanced-per-agent-configuration.md +70 -0
  43. package/docs/agents.md +123 -0
  44. package/docs/antigravity-setup.md +128 -0
  45. package/docs/codebuddy-setup.md +41 -0
  46. package/docs/codex-setup.md +34 -0
  47. package/docs/commandcode-setup.md +69 -0
  48. package/docs/comparison.md +131 -0
  49. package/docs/copilot-cli-setup.md +64 -0
  50. package/docs/copilot-setup.md +162 -0
  51. package/docs/cursor-setup.md +225 -0
  52. package/docs/developer-onboarding.md +116 -0
  53. package/docs/gemini-cli-setup.md +133 -0
  54. package/docs/getting-started.md +208 -0
  55. package/docs/opencode-setup.md +259 -0
  56. package/docs/other-hosts.md +7 -0
  57. package/docs/skill-anatomy.md +203 -0
  58. package/docs/windsurf-setup.md +48 -0
  59. package/evals/README.md +101 -0
  60. package/evals/cases/api-and-interface-design.json +45 -0
  61. package/evals/cases/browser-testing-with-devtools.json +44 -0
  62. package/evals/cases/ci-cd-and-automation.json +45 -0
  63. package/evals/cases/code-review-and-quality.json +49 -0
  64. package/evals/cases/code-simplification.json +45 -0
  65. package/evals/cases/constraint-driven-development.json +79 -0
  66. package/evals/cases/context-engineering.json +44 -0
  67. package/evals/cases/debugging-and-error-recovery.json +58 -0
  68. package/evals/cases/deprecation-and-migration.json +52 -0
  69. package/evals/cases/documentation-and-adrs.json +44 -0
  70. package/evals/cases/doubt-driven-development.json +43 -0
  71. package/evals/cases/frontend-ui-engineering.json +52 -0
  72. package/evals/cases/git-workflow-and-versioning.json +47 -0
  73. package/evals/cases/idea-refine.json +43 -0
  74. package/evals/cases/incremental-implementation.json +57 -0
  75. package/evals/cases/interview-me.json +42 -0
  76. package/evals/cases/observability-and-instrumentation.json +44 -0
  77. package/evals/cases/performance-optimization.json +53 -0
  78. package/evals/cases/planning-and-task-breakdown.json +45 -0
  79. package/evals/cases/security-and-hardening.json +53 -0
  80. package/evals/cases/shipping-and-launch.json +56 -0
  81. package/evals/cases/source-driven-development.json +44 -0
  82. package/evals/cases/spec-driven-development.json +72 -0
  83. package/evals/cases/test-driven-development.json +73 -0
  84. package/evals/cases/using-agent-skills.json +44 -0
  85. package/evals/fixtures/api-and-interface-design/service-brief.md +19 -0
  86. package/evals/fixtures/browser-testing-with-devtools/README.md +5 -0
  87. package/evals/fixtures/browser-testing-with-devtools/index.html +24 -0
  88. package/evals/fixtures/browser-testing-with-devtools/server.js +15 -0
  89. package/evals/fixtures/ci-cd-and-automation/package.json +8 -0
  90. package/evals/fixtures/ci-cd-and-automation/src/slug.js +3 -0
  91. package/evals/fixtures/ci-cd-and-automation/test/slug.test.js +9 -0
  92. package/evals/fixtures/code-review-and-quality/user-search.diff +16 -0
  93. package/evals/fixtures/code-simplification/config-parser.js +46 -0
  94. package/evals/fixtures/code-simplification/config-parser.test.js +15 -0
  95. package/evals/fixtures/context-engineering/context-audit.md +15 -0
  96. package/evals/fixtures/debugging-and-error-recovery/pagination.js +8 -0
  97. package/evals/fixtures/debugging-and-error-recovery/pagination.test.js +9 -0
  98. package/evals/fixtures/debugging-and-error-recovery/time-pressure.md +6 -0
  99. package/evals/fixtures/deprecation-and-migration/api-inventory.md +9 -0
  100. package/evals/fixtures/documentation-and-adrs/decision-context.md +16 -0
  101. package/evals/fixtures/doubt-driven-development/migration-plan.md +19 -0
  102. package/evals/fixtures/frontend-ui-engineering/Button.tsx +7 -0
  103. package/evals/fixtures/frontend-ui-engineering/design-system.md +11 -0
  104. package/evals/fixtures/git-workflow-and-versioning/.eval/working-tree.patch +21 -0
  105. package/evals/fixtures/git-workflow-and-versioning/app.js +7 -0
  106. package/evals/fixtures/git-workflow-and-versioning/app.test.js +9 -0
  107. package/evals/fixtures/incremental-implementation/reports.js +7 -0
  108. package/evals/fixtures/incremental-implementation/reports.test.js +12 -0
  109. package/evals/fixtures/incremental-implementation/tasks/plan.md +8 -0
  110. package/evals/fixtures/incremental-implementation-pressure/draft-export.js +17 -0
  111. package/evals/fixtures/incremental-implementation-pressure/scenario.md +9 -0
  112. package/evals/fixtures/observability-and-instrumentation/operations.md +11 -0
  113. package/evals/fixtures/observability-and-instrumentation/payment-retry.js +14 -0
  114. package/evals/fixtures/performance-optimization/benchmark.js +15 -0
  115. package/evals/fixtures/performance-optimization/products.js +14 -0
  116. package/evals/fixtures/planning-and-task-breakdown/notifications-spec.md +18 -0
  117. package/evals/fixtures/security-and-hardening/webhook.js +11 -0
  118. package/evals/fixtures/security-and-hardening/webhook.test.js +13 -0
  119. package/evals/fixtures/shipping-and-launch/authority-pressure.md +6 -0
  120. package/evals/fixtures/shipping-and-launch/launch-status.md +11 -0
  121. package/evals/fixtures/source-driven-development/framework-task.md +10 -0
  122. package/evals/fixtures/spec-driven-development/billing-brief.md +16 -0
  123. package/evals/fixtures/spec-driven-development-decomposition/portal-brief.md +22 -0
  124. package/evals/fixtures/test-driven-development/BUG.md +10 -0
  125. package/evals/fixtures/test-driven-development/README.md +28 -0
  126. package/evals/fixtures/test-driven-development/package.json +9 -0
  127. package/evals/fixtures/test-driven-development/src/split.js +8 -0
  128. package/evals/fixtures/test-driven-development/test/split.test.js +13 -0
  129. package/evals/fixtures/test-driven-development-ecosystem/README.md +9 -0
  130. package/evals/fixtures/test-driven-development-ecosystem/ledger.py +15 -0
  131. package/evals/fixtures/test-driven-development-ecosystem/test_ledger.py +19 -0
  132. package/evals/fixtures/using-agent-skills/incident.md +6 -0
  133. package/evals/plugin/code-review-fires/graders/off-by-one.md +7 -0
  134. package/evals/plugin/code-review-fires/graders/severity-labels.md +4 -0
  135. package/evals/plugin/code-review-fires/graders/skill-fired.md +5 -0
  136. package/evals/plugin/code-review-fires/prompt.md +31 -0
  137. package/evals/plugin/code-review-stays-quiet/graders/not-fired.md +8 -0
  138. package/evals/plugin/code-review-stays-quiet/graders/tdd-fired.md +6 -0
  139. package/evals/plugin/code-review-stays-quiet/prompt.md +8 -0
  140. package/evals/plugin/code-review-stays-quiet-on-commit-message/graders/not-fired.md +8 -0
  141. package/evals/plugin/code-review-stays-quiet-on-commit-message/prompt.md +25 -0
  142. package/evals/skill-impact.md +6 -0
  143. package/hooks/SDD-CACHE.md +167 -0
  144. package/hooks/SIMPLIFY-IGNORE.md +91 -0
  145. package/hooks/sdd-cache-post.sh +135 -0
  146. package/hooks/sdd-cache-pre.sh +106 -0
  147. package/hooks/sdd-cache-test.sh +246 -0
  148. package/hooks/session-start-test.sh +47 -0
  149. package/hooks/session-start.sh +33 -0
  150. package/hooks/simplify-ignore-test.sh +476 -0
  151. package/hooks/simplify-ignore.sh +352 -0
  152. package/package.json +89 -4
  153. package/plugin.json +7 -0
  154. package/rebrand/MAINTENANCE.md +112 -0
  155. package/rebrand/NOTICE.md +9 -0
  156. package/rebrand/PR-WORKFLOW.md +34 -0
  157. package/rebrand/UNIFICATION-SPEC.md +33 -0
  158. package/rebrand/VALIDATION.md +28 -0
  159. package/rebrand/VERSIONING.md +32 -0
  160. package/rebrand/apply.cjs +194 -0
  161. package/rebrand/brand.json +13 -0
  162. package/rebrand/catalog.cjs +56 -0
  163. package/rebrand/fork-patches.json +12 -0
  164. package/rebrand/overlay/.github/workflows/test-plugin-install.yml +177 -0
  165. package/rebrand/overlay/CHANGELOG.md +23 -0
  166. package/rebrand/overlay/bin/i3-composer-agent.cjs +122 -0
  167. package/rebrand/overlay/scripts/validate-brand.cjs +44 -0
  168. package/rebrand/overlay/tests/bundle.test.cjs +85 -0
  169. package/rebrand/package.template.json +82 -0
  170. package/rebrand/rebrand.sh +4 -0
  171. package/rebrand/record-upstream.cjs +37 -0
  172. package/rebrand/templates/README.md +86 -0
  173. package/rebrand/templates/codebuddy-setup.md +41 -0
  174. package/rebrand/templates/codex-setup.md +34 -0
  175. package/rebrand/tests/pipeline.test.cjs +185 -0
  176. package/rebrand/upstream.json +171 -0
  177. package/references/accessibility-checklist.md +160 -0
  178. package/references/definition-of-done.md +67 -0
  179. package/references/observability-checklist.md +92 -0
  180. package/references/orchestration-patterns.md +370 -0
  181. package/references/performance-checklist.md +236 -0
  182. package/references/security-checklist.md +248 -0
  183. package/references/testing-patterns.md +235 -0
  184. package/scripts/floor-guard-reference-test.js +291 -0
  185. package/scripts/lib/skill-lint-test.js +650 -0
  186. package/scripts/lib/skill-lint.js +584 -0
  187. package/scripts/run-evals-test.js +623 -0
  188. package/scripts/run-evals.js +638 -0
  189. package/scripts/validate-artifact-paths-test.js +179 -0
  190. package/scripts/validate-artifact-paths.js +128 -0
  191. package/scripts/validate-brand.cjs +44 -0
  192. package/scripts/validate-commands-test.js +216 -0
  193. package/scripts/validate-commands.js +222 -0
  194. package/scripts/validate-reference-links-test.js +495 -0
  195. package/scripts/validate-reference-links.js +187 -0
  196. package/scripts/validate-skills.js +69 -0
  197. package/scripts/validate-versions-test.js +32 -0
  198. package/scripts/validate-versions.js +35 -0
  199. package/skills/api-and-interface-design/SKILL.md +367 -0
  200. package/skills/browser-testing-with-devtools/SKILL.md +317 -0
  201. package/skills/ci-cd-and-automation/SKILL.md +390 -0
  202. package/skills/code-review-and-quality/SKILL.md +398 -0
  203. package/skills/code-simplification/SKILL.md +331 -0
  204. package/skills/constraint-driven-development/SKILL.md +311 -0
  205. package/skills/constraint-driven-development/references/floor-guard.md +182 -0
  206. package/skills/context-engineering/SKILL.md +353 -0
  207. package/skills/debugging-and-error-recovery/SKILL.md +300 -0
  208. package/skills/deprecation-and-migration/SKILL.md +247 -0
  209. package/skills/documentation-and-adrs/SKILL.md +288 -0
  210. package/skills/doubt-driven-development/SKILL.md +243 -0
  211. package/skills/frontend-ui-engineering/SKILL.md +340 -0
  212. package/skills/git-workflow-and-versioning/SKILL.md +355 -0
  213. package/skills/idea-refine/SKILL.md +178 -0
  214. package/skills/idea-refine/examples.md +238 -0
  215. package/skills/idea-refine/frameworks.md +99 -0
  216. package/skills/idea-refine/refinement-criteria.md +113 -0
  217. package/skills/idea-refine/scripts/idea-refine.sh +15 -0
  218. package/skills/incremental-implementation/SKILL.md +249 -0
  219. package/skills/interview-me/SKILL.md +235 -0
  220. package/skills/observability-and-instrumentation/SKILL.md +238 -0
  221. package/skills/performance-optimization/SKILL.md +267 -0
  222. package/skills/performance-optimization/references/optimization-patterns.md +250 -0
  223. package/skills/planning-and-task-breakdown/SKILL.md +257 -0
  224. package/skills/security-and-hardening/SKILL.md +216 -0
  225. package/skills/security-and-hardening/references/hardening-patterns.md +324 -0
  226. package/skills/shipping-and-launch/SKILL.md +330 -0
  227. package/skills/source-driven-development/SKILL.md +216 -0
  228. package/skills/spec-driven-development/SKILL.md +259 -0
  229. package/skills/test-driven-development/SKILL.md +398 -0
  230. package/skills/using-agent-skills/SKILL.md +192 -0
  231. package/tests/bundle.test.cjs +85 -0
@@ -0,0 +1,24 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head><meta charset="utf-8"><title>Signup</title></head>
4
+ <body>
5
+ <form id="signup-form">
6
+ <label>Email <input id="email" name="email" type="email" required></label>
7
+ <button type="submit">Create account</button>
8
+ </form>
9
+ <p id="status" aria-live="polite"></p>
10
+ <script>
11
+ document.querySelector('#signup-form').addEventListener('submit', async (event) => {
12
+ event.preventDefault();
13
+ const email = document.querySelector('#email').value;
14
+ const response = await fetch('/api/signup', {
15
+ method: 'POST',
16
+ headers: { 'content-type': 'application/json' },
17
+ body: JSON.stringify({ email }),
18
+ });
19
+ const result = await response.json();
20
+ document.querySelector('#status').textContent = result.message;
21
+ });
22
+ </script>
23
+ </body>
24
+ </html>
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ const fs = require('node:fs');
4
+ const http = require('node:http');
5
+ const path = require('node:path');
6
+
7
+ http.createServer((req, res) => {
8
+ if (req.url === '/api/signup') {
9
+ res.writeHead(500, { 'content-type': 'text/html' });
10
+ res.end('<h1>database unavailable</h1>');
11
+ return;
12
+ }
13
+ res.writeHead(200, { 'content-type': 'text/html' });
14
+ res.end(fs.readFileSync(path.join(__dirname, 'index.html')));
15
+ }).listen(4173, '127.0.0.1', () => console.log('listening on http://127.0.0.1:4173'));
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "ci-fixture",
3
+ "private": true,
4
+ "scripts": {
5
+ "lint": "node --check src/slug.js",
6
+ "test": "node --test"
7
+ }
8
+ }
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ exports.slugify = (value) => value.trim().toLowerCase().replace(/\s+/g, '-');
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ const assert = require('node:assert/strict');
4
+ const test = require('node:test');
5
+ const { slugify } = require('../src/slug');
6
+
7
+ test('slugifies a title', () => {
8
+ assert.equal(slugify('Hello World'), 'hello-world');
9
+ });
@@ -0,0 +1,16 @@
1
+ diff --git a/src/routes/users.js b/src/routes/users.js
2
+ index 1111111..2222222 100644
3
+ --- a/src/routes/users.js
4
+ +++ b/src/routes/users.js
5
+ @@ -1,3 +1,15 @@
6
+ router.get('/users/:id', requireAuth, getUser);
7
+ +router.get('/users/search', async (req, res) => {
8
+ + const query = req.query.q;
9
+ + const users = await db.query(
10
+ + `SELECT id, email, display_name FROM users WHERE email LIKE '%${query}%'`
11
+ + );
12
+ + audit.log(`search by ${req.user.email}: ${query}`);
13
+ + res.json({ users });
14
+ +});
15
+
16
+ module.exports = router;
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ function parseConfig(lines) {
4
+ const result = {};
5
+ let section = 'default';
6
+ result[section] = {};
7
+ for (let i = 0; i < lines.length; i++) {
8
+ const original = lines[i];
9
+ if (original !== undefined && original !== null) {
10
+ const line = String(original).trim();
11
+ if (line.length > 0) {
12
+ if (line[0] !== '#' && line[0] !== ';') {
13
+ if (line[0] === '[' && line[line.length - 1] === ']') {
14
+ const candidate = line.slice(1, line.length - 1).trim();
15
+ if (candidate.length > 0) {
16
+ section = candidate;
17
+ if (!result[section]) result[section] = {};
18
+ }
19
+ } else {
20
+ const separator = line.indexOf('=');
21
+ if (separator >= 0) {
22
+ const key = line.slice(0, separator).trim();
23
+ const raw = line.slice(separator + 1).trim();
24
+ if (key.length > 0) {
25
+ let value;
26
+ if (raw === 'true') value = true;
27
+ else if (raw === 'false') value = false;
28
+ else if (raw !== '' && !Number.isNaN(Number(raw))) value = Number(raw);
29
+ else if (
30
+ raw.length >= 2 &&
31
+ ((raw[0] === '"' && raw[raw.length - 1] === '"') ||
32
+ (raw[0] === "'" && raw[raw.length - 1] === "'"))
33
+ ) value = raw.slice(1, raw.length - 1);
34
+ else value = raw;
35
+ result[section][key] = value;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ return result;
44
+ }
45
+
46
+ module.exports = { parseConfig };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ const assert = require('node:assert/strict');
4
+ const test = require('node:test');
5
+ const { parseConfig } = require('./config-parser');
6
+
7
+ test('parses sections, values, comments, and defaults', () => {
8
+ assert.deepEqual(parseConfig([
9
+ 'owner = "Ada"', '# ignored', '[server]', 'port = 8080',
10
+ 'enabled = true', 'note = hello',
11
+ ]), {
12
+ default: { owner: 'Ada' },
13
+ server: { port: 8080, enabled: true, note: 'hello' },
14
+ });
15
+ });
@@ -0,0 +1,15 @@
1
+ # Session context audit
2
+
3
+ The repository is a TypeScript service. The current agent session loads the
4
+ entire `docs/archive/` directory (1,800 files), generated API output, six old
5
+ incident transcripts, and every ADR on startup. It does not load the active
6
+ `CONTRIBUTING.md` or `docs/current-architecture.md`.
7
+
8
+ Observed failures:
9
+
10
+ - Responses recommend JavaScript even though new source must be TypeScript.
11
+ - Tests are proposed with Jest, but this project uses Vitest.
12
+ - The agent repeatedly forgets that database access belongs in repositories.
13
+ - Answers become generic after long tool traces.
14
+
15
+ Current task: add validation to one existing HTTP handler.
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ function paginate(items, page, pageSize) {
4
+ const start = page * pageSize;
5
+ return items.slice(start, start + pageSize);
6
+ }
7
+
8
+ module.exports = { paginate };
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ const assert = require('node:assert/strict');
4
+ const test = require('node:test');
5
+ const { paginate } = require('./pagination');
6
+
7
+ test('returns the second page for a one-based page number', () => {
8
+ assert.deepEqual(paginate(['a', 'b', 'c', 'd', 'e'], 2, 2), ['c', 'd']);
9
+ });
@@ -0,0 +1,6 @@
1
+ # Incident pressure
2
+
3
+ Checkout pagination is returning an empty page in production. A stakeholder
4
+ wants an immediate change to the slice end index and says there is no time to
5
+ run the failing test first. Preserve evidence and establish the root cause
6
+ before changing behavior.
@@ -0,0 +1,9 @@
1
+ # v1 API inventory
2
+
3
+ - Public consumers: 200 organizations.
4
+ - Replacement: `/v2/orders`, available in production but not yet announced.
5
+ - Current v1 traffic: 48,000 requests/day from 173 active API keys.
6
+ - Largest consumer contract requires 90 days' notice for breaking changes.
7
+ - Existing telemetry records API key, route, status, and response latency.
8
+ - Support can contact 188 consumers directly; 12 use reseller-managed accounts.
9
+ - v1 currently has no response deprecation headers or migration guide.
@@ -0,0 +1,16 @@
1
+ # Orders architecture decision context
2
+
3
+ The orders service currently stores mutable order rows and emits best-effort
4
+ webhooks. Auditors need a complete history of state transitions, and support
5
+ must be able to reconstruct an order at a prior point in time.
6
+
7
+ Options discussed:
8
+
9
+ 1. Keep the current model and add an append-only audit table.
10
+ 2. Adopt event sourcing for orders and build read projections.
11
+ 3. Use database change-data capture as the audit history.
12
+
13
+ Event sourcing improves traceability and replay, but adds projection rebuilds,
14
+ event versioning, eventual consistency, and operational complexity. The team
15
+ has event-stream experience, but the reporting service expects synchronous
16
+ reads. The decision applies only to the orders bounded context.
@@ -0,0 +1,19 @@
1
+ # Customer identifier migration
2
+
3
+ Plan: replace integer customer IDs with UUIDs in a single maintenance window.
4
+
5
+ 1. Disable writes.
6
+ 2. Run `ALTER TABLE customers DROP COLUMN id CASCADE`.
7
+ 3. Add a UUID `id` column and populate it.
8
+ 4. Re-enable writes after fifteen minutes.
9
+
10
+ Claims made by the author:
11
+
12
+ - All foreign keys will be recreated automatically.
13
+ - The table contains fewer than one million rows.
14
+ - The operation completes within the maintenance window.
15
+ - The backup from last night is sufficient rollback protection.
16
+ - No external systems persist the integer identifier.
17
+
18
+ No rehearsal, row count, dependency inventory, restore timing, or rollback
19
+ test is attached.
@@ -0,0 +1,7 @@
1
+ import { forwardRef, type ButtonHTMLAttributes } from 'react';
2
+
3
+ export const Button = forwardRef<HTMLButtonElement, ButtonHTMLAttributes<HTMLButtonElement>>(
4
+ function Button({ className = '', ...props }, ref) {
5
+ return <button ref={ref} className={`button ${className}`.trim()} {...props} />;
6
+ },
7
+ );
@@ -0,0 +1,11 @@
1
+ # Menu component conventions
2
+
3
+ - Framework: React with TypeScript.
4
+ - Styling: existing `menu-*` utility classes; do not add a styling dependency.
5
+ - Public components accept `className` and forward a DOM ref.
6
+ - Components must support keyboard-only and screen-reader users.
7
+ - Focus returns to the trigger when a menu closes.
8
+ - Escape closes the menu; arrow keys move between enabled items.
9
+
10
+ The new dropdown should expose a trigger label and an array of actions. Disabled
11
+ actions remain visible but cannot receive focus or execute.
@@ -0,0 +1,21 @@
1
+ diff --git a/git-workflow-and-versioning/app.js b/git-workflow-and-versioning/app.js
2
+ --- a/git-workflow-and-versioning/app.js
3
+ +++ b/git-workflow-and-versioning/app.js
4
+ @@ -1,7 +1,15 @@
5
+ 'use strict';
6
+
7
+ -function total(items) {
8
+ +function sumPrices(items) {
9
+ return items.reduce((sum, item) => sum + item.price, 0);
10
+ +}
11
+ +
12
+ +function total(items) {
13
+ + return Math.round(sumPrices(items) * 100) / 100;
14
+ }
15
+
16
+ -module.exports = { total };
17
+ +function exportCsv(items) {
18
+ + return ['price', ...items.map((item) => item.price)].join('\n');
19
+ +}
20
+ +
21
+ +module.exports = { exportCsv, total };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ function total(items) {
4
+ return items.reduce((sum, item) => sum + item.price, 0);
5
+ }
6
+
7
+ module.exports = { total };
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ const assert = require('node:assert/strict');
4
+ const test = require('node:test');
5
+ const { total } = require('./app');
6
+
7
+ test('totals item prices', () => {
8
+ assert.equal(total([{ price: 1 }, { price: 2 }]), 3);
9
+ });
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ function visibleReports(reports) {
4
+ return reports.filter((report) => !report.archived);
5
+ }
6
+
7
+ module.exports = { visibleReports };
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const assert = require('node:assert/strict');
4
+ const test = require('node:test');
5
+ const { visibleReports } = require('./reports');
6
+
7
+ test('hides archived reports', () => {
8
+ assert.deepEqual(visibleReports([
9
+ { id: 1, archived: false },
10
+ { id: 2, archived: true },
11
+ ]), [{ id: 1, archived: false }]);
12
+ });
@@ -0,0 +1,8 @@
1
+ # CSV export plan
2
+
3
+ 1. Add a pure report-to-CSV formatter with unit tests.
4
+ 2. Add a download adapter that uses the formatter.
5
+ 3. Wire an Export button to the reports page.
6
+
7
+ Each task must be independently verified and committed before starting the
8
+ next. Existing report filtering behavior must remain unchanged.
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ async function exportReports(reports, setStatus, analytics) {
4
+ setStatus('working');
5
+ const csv = `name,total\n${reports.map((r) => `${r.name},${r.total}`).join('\n')}`;
6
+ const blob = new Blob([csv], { type: 'text/csv' });
7
+ const link = document.createElement('a');
8
+ link.href = URL.createObjectURL(blob);
9
+ link.download = 'reports.csv';
10
+ document.body.appendChild(link);
11
+ link.click();
12
+ link.remove();
13
+ analytics.track('report_exported', { count: reports.length });
14
+ setStatus('done');
15
+ }
16
+
17
+ module.exports = { exportReports };
@@ -0,0 +1,9 @@
1
+ # Sunk-cost scenario
2
+
3
+ Another developer spent two days on `draft-export.js` and says it is 90% done.
4
+ It combines formatting, browser download behavior, UI state, and analytics in
5
+ one untested function. Management wants it committed unchanged today because
6
+ discarding or splitting it would “waste” the work already invested.
7
+
8
+ The existing task plan requires independently verified formatter, adapter, and
9
+ UI slices.
@@ -0,0 +1,11 @@
1
+ # Payment retry operations
2
+
3
+ On-call must be able to answer:
4
+
5
+ - Are retries recovering transient gateway failures?
6
+ - Which gateway and failure class is driving exhaustion?
7
+ - Is one payment being charged more than once?
8
+ - Which customer-visible payments need intervention now?
9
+
10
+ Payment and attempt IDs are safe correlation identifiers. Card numbers,
11
+ customer email addresses, and raw gateway responses must never be logged.
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ async function retryPayment(payment, gateway) {
4
+ for (let attempt = 1; attempt <= 3; attempt++) {
5
+ try {
6
+ return await gateway.charge(payment);
7
+ } catch (error) {
8
+ console.log(`retry ${attempt} failed: ${error.message}`);
9
+ }
10
+ }
11
+ throw new Error('payment failed');
12
+ }
13
+
14
+ module.exports = { retryPayment };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ const { performance } = require('node:perf_hooks');
4
+ const { renderProducts } = require('./products');
5
+
6
+ const products = Array.from({ length: 1000 }, (_, id) => ({
7
+ id,
8
+ name: `Product ${id}`,
9
+ sales: (id * 7919) % 10000,
10
+ }));
11
+
12
+ const start = performance.now();
13
+ const output = renderProducts(products);
14
+ const elapsed = performance.now() - start;
15
+ console.log(JSON.stringify({ products: products.length, bytes: output.length, elapsedMs: elapsed }));
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ function renderProducts(products) {
4
+ let html = '';
5
+ for (const product of products) {
6
+ const rank = [...products]
7
+ .sort((a, b) => b.sales - a.sales)
8
+ .findIndex((candidate) => candidate.id === product.id) + 1;
9
+ html += `<li data-rank="${rank}">${product.name}: ${product.sales}</li>`;
10
+ }
11
+ return `<ul>${html}</ul>`;
12
+ }
13
+
14
+ module.exports = { renderProducts };
@@ -0,0 +1,18 @@
1
+ # Notifications specification
2
+
3
+ Users can opt into email notifications when a task is assigned or becomes
4
+ overdue. Preferences are stored per user and default to disabled. Assignment
5
+ events already exist; overdue detection runs every fifteen minutes.
6
+
7
+ Requirements:
8
+
9
+ - Add preference read/update endpoints with boundary validation.
10
+ - Publish notification jobs from assignment and overdue flows.
11
+ - Deduplicate jobs by user, task, event type, and event version.
12
+ - Send email through the existing provider adapter.
13
+ - Record delivery status without storing message bodies.
14
+ - Feature flag the sending path; disabled remains the safe default.
15
+
16
+ Verification must include preference API tests, job deduplication tests,
17
+ provider-adapter integration tests, and one end-to-end assignment scenario.
18
+ No SMS, push notifications, or notification history UI is in scope.
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ async function previewWebhook(url, fetchImpl = fetch) {
4
+ const response = await fetchImpl(url, { redirect: 'follow' });
5
+ return {
6
+ status: response.status,
7
+ body: (await response.text()).slice(0, 2048),
8
+ };
9
+ }
10
+
11
+ module.exports = { previewWebhook };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ const assert = require('node:assert/strict');
4
+ const test = require('node:test');
5
+ const { previewWebhook } = require('./webhook');
6
+
7
+ test('returns a bounded preview from a successful request', async () => {
8
+ const result = await previewWebhook('https://example.com/hook', async () => ({
9
+ status: 200,
10
+ text: async () => 'ok',
11
+ }));
12
+ assert.deepEqual(result, { status: 200, body: 'ok' });
13
+ });
@@ -0,0 +1,6 @@
1
+ # Executive request
2
+
3
+ The launch sponsor says the public date cannot move and asks the team to mark
4
+ the release GO despite the failing end-to-end checkout test. They propose
5
+ writing the rollback steps after launch and watching general error logs instead
6
+ of adding payment-specific alerts.
@@ -0,0 +1,11 @@
1
+ # Checkout launch status — tomorrow
2
+
3
+ - Unit tests: green.
4
+ - End-to-end checkout test: failing on payment confirmation timeout.
5
+ - Staging smoke test: not run since the last payment-provider change.
6
+ - Production dashboard: request rate and latency exist; payment failure and
7
+ duplicate-charge alerts do not.
8
+ - Feature flag: checkout v2 can be disabled without deployment.
9
+ - Rollback owner and commands: not documented.
10
+ - Database change: additive nullable column, migration tested on staging.
11
+ - Support and on-call have not received the launch runbook.
@@ -0,0 +1,10 @@
1
+ # Session implementation task
2
+
3
+ Implement server-side sessions for an Express 5 application. The project uses
4
+ `express-session` and must follow the currently documented production approach
5
+ for proxy settings, secure cookies, session stores, and secret configuration.
6
+
7
+ Ground behavioral claims in official Express or `express-session`
8
+ documentation and cite the exact pages used. Do not rely on remembered Express
9
+ 4 defaults. Flag any deployment-specific assumption that cannot be verified
10
+ from the repository or official documentation.
@@ -0,0 +1,16 @@
1
+ # Usage-based billing brief
2
+
3
+ The product currently charges one flat monthly price. Leadership wants usage-
4
+ based billing next quarter, but “usage” has not been defined. Candidate meters
5
+ include API requests, processed records, and successful jobs.
6
+
7
+ Known constraints:
8
+
9
+ - Existing customers need a migration path.
10
+ - Billing events must be auditable and idempotent.
11
+ - Late-arriving events occur for up to seven days.
12
+ - Finance requires invoice reconciliation.
13
+
14
+ Unknowns include pricing tiers, free allowances, meter ownership, correction
15
+ rules, customer-facing usage visibility, and regional tax behavior. Produce a
16
+ spec and surface these decisions; do not implement them by assumption.
@@ -0,0 +1,22 @@
1
+ # Customer portal — product brief
2
+
3
+ Leadership wants a self-serve customer portal shipped as one initiative. The
4
+ request, as handed down:
5
+
6
+ - Customers sign in with email/password or company SSO and manage their
7
+ account and team members.
8
+ - Customers pick a plan, enter payment details, and receive monthly invoices;
9
+ plan changes prorate.
10
+ - Customers get email notifications for invoices, payment failures, and team
11
+ invitations; enterprise customers can register webhooks for the same events.
12
+ - Admins see a usage dashboard: seats, API calls, and spend per month.
13
+
14
+ Constraints gathered so far:
15
+
16
+ - Billing must know who the customer is, so it depends on account data.
17
+ - Notifications fire on billing and account events.
18
+ - The dashboard reads from billing and notification delivery records.
19
+ - The four areas have different reviewers: platform owns accounts, finance
20
+ owns billing, and growth owns notifications and the dashboard.
21
+ - Each area should be shippable and verifiable on its own; finance wants to
22
+ sign off on billing without waiting for the dashboard.
@@ -0,0 +1,10 @@
1
+ # Bug report: cents lost on three-way splits
2
+
3
+ From finance reconciliation (ticket FIN-482):
4
+
5
+ > Splitting $100.00 three ways returns `[3333, 3333, 3333]`. That sums to
6
+ > $99.99, one cent short. Reconciliation flags every three-way invoice we
7
+ > processed this month.
8
+
9
+ Reproduces with `splitCents(10000, 3)`: expected `[3334, 3333, 3333]`
10
+ (sums to 10000), got `[3333, 3333, 3333]` (sums to 9999).
@@ -0,0 +1,28 @@
1
+ # split-payment
2
+
3
+ Utility for splitting an amount of money among `n` participants without
4
+ losing or inventing cents. Amounts are integer cents throughout; the
5
+ library never touches floating point.
6
+
7
+ ## API
8
+
9
+ `splitCents(totalCents, n)` returns an array of `n` integer cent amounts.
10
+ `totalCents` is a non-negative integer, `n` is a positive integer.
11
+
12
+ ## Invariants
13
+
14
+ Every result must satisfy both invariants, for every input:
15
+
16
+ 1. **Exactness** — the shares sum to exactly `totalCents`. Money is never
17
+ lost or created.
18
+ 2. **Fairness** — no two shares differ by more than one cent. When the
19
+ total does not divide evenly, the leftover cents go to the earliest
20
+ shares, one cent each.
21
+
22
+ For example, `splitCents(100, 7)` is `[15, 15, 14, 14, 14, 14, 14]`.
23
+
24
+ ## Tests
25
+
26
+ ```
27
+ npm test
28
+ ```
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "split-payment",
3
+ "version": "1.2.0",
4
+ "description": "Splits an amount in integer cents into fair shares.",
5
+ "private": true,
6
+ "scripts": {
7
+ "test": "node --test"
8
+ }
9
+ }
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ function splitCents(totalCents, n) {
4
+ const share = Math.floor(totalCents / n);
5
+ return Array.from({ length: n }, () => share);
6
+ }
7
+
8
+ module.exports = { splitCents };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ const assert = require('node:assert/strict');
4
+ const test = require('node:test');
5
+ const { splitCents } = require('../src/split');
6
+
7
+ test('splits an evenly divisible total into equal shares', () => {
8
+ assert.deepEqual(splitCents(10000, 4), [2500, 2500, 2500, 2500]);
9
+ });
10
+
11
+ test('a single participant receives the whole total', () => {
12
+ assert.deepEqual(splitCents(500, 1), [500]);
13
+ });
@@ -0,0 +1,9 @@
1
+ # Ledger
2
+
3
+ Small Python ledger utilities. No dependencies beyond the standard library.
4
+
5
+ Run the tests:
6
+
7
+ ```
8
+ python3 -m unittest
9
+ ```