@givolt/i3-composer-agent 2.1.1 → 2.2.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/.agents/plugins/marketplace.json +2 -2
- package/.claude/commands/i3-build.md +13 -1
- package/.claude/commands/i3-code-simplify.md +13 -1
- package/.claude/commands/i3-constraints.md +13 -1
- package/.claude/commands/i3-plan.md +13 -1
- package/.claude/commands/i3-review.md +13 -1
- package/.claude/commands/i3-ship.md +18 -2
- package/.claude/commands/i3-spec.md +13 -1
- package/.claude/commands/i3-test.md +13 -1
- package/.claude/commands/i3-webperf.md +13 -1
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +7 -6
- package/.gemini/commands/i3-build.toml +13 -1
- package/.gemini/commands/i3-code-simplify.toml +13 -1
- package/.gemini/commands/i3-constraints.toml +13 -1
- package/.gemini/commands/i3-planning.toml +13 -1
- package/.gemini/commands/i3-review.toml +13 -1
- package/.gemini/commands/i3-ship.toml +13 -1
- package/.gemini/commands/i3-spec.toml +13 -1
- package/.gemini/commands/i3-test.toml +13 -1
- package/.gemini/commands/i3-webperf.toml +13 -1
- package/README.md +141 -109
- package/agents/code-reviewer.md +13 -1
- package/agents/security-auditor.md +13 -1
- package/agents/test-engineer.md +13 -1
- package/agents/web-performance-auditor.md +13 -1
- package/bin/asset-fingerprint.cjs +1 -0
- package/bin/i3-composer-agent.cjs +58 -52
- package/bin/install.cjs +42 -19
- package/bin/native-content.cjs +27 -17
- package/bin/tool-menu.cjs +9 -0
- package/bin/tool-selector.cjs +164 -0
- package/bin/wizard.cjs +19 -30
- package/commands/i3-build.toml +13 -1
- package/commands/i3-code-simplify.toml +13 -1
- package/commands/i3-constraints.toml +13 -1
- package/commands/i3-planning.toml +13 -1
- package/commands/i3-review.toml +13 -1
- package/commands/i3-ship.toml +13 -1
- package/commands/i3-spec.toml +13 -1
- package/commands/i3-test.toml +13 -1
- package/commands/i3-webperf.toml +13 -1
- package/docs/adoption-guide.md +8 -0
- package/docs/agents.md +8 -0
- package/docs/antigravity-setup.md +8 -0
- package/docs/codebuddy-setup.md +31 -62
- package/docs/codex-setup.md +18 -29
- package/docs/commandcode-setup.md +8 -0
- package/docs/copilot-cli-setup.md +8 -0
- package/docs/copilot-setup.md +8 -0
- package/docs/cursor-setup.md +8 -0
- package/docs/gemini-cli-setup.md +8 -0
- package/docs/getting-started.md +8 -0
- package/docs/opencode-setup.md +8 -0
- package/docs/other-hosts.md +8 -0
- package/docs/windsurf-setup.md +8 -0
- package/docs/workbuddy-setup.md +41 -65
- package/evals/README.md +86 -0
- package/evals/cases/i3-api-and-interface-design.json +45 -0
- package/evals/cases/i3-browser-testing-with-devtools.json +44 -0
- package/evals/cases/i3-ci-cd-and-automation.json +45 -0
- package/evals/cases/i3-code-review-and-quality.json +49 -0
- package/evals/cases/i3-code-simplification.json +45 -0
- package/evals/cases/i3-constraint-driven-development.json +79 -0
- package/evals/cases/i3-context-engineering.json +44 -0
- package/evals/cases/i3-debugging-and-error-recovery.json +58 -0
- package/evals/cases/i3-deprecation-and-migration.json +52 -0
- package/evals/cases/i3-documentation-and-adrs.json +44 -0
- package/evals/cases/i3-doubt-driven-development.json +43 -0
- package/evals/cases/i3-frontend-ui-engineering.json +52 -0
- package/evals/cases/i3-git-workflow-and-versioning.json +47 -0
- package/evals/cases/i3-idea-refine.json +43 -0
- package/evals/cases/i3-incremental-implementation.json +57 -0
- package/evals/cases/i3-interview-me.json +42 -0
- package/evals/cases/i3-observability-and-instrumentation.json +44 -0
- package/evals/cases/i3-performance-optimization.json +53 -0
- package/evals/cases/i3-planning-and-task-breakdown.json +45 -0
- package/evals/cases/i3-security-and-hardening.json +53 -0
- package/evals/cases/i3-shipping-and-launch.json +56 -0
- package/evals/cases/i3-source-driven-development.json +44 -0
- package/evals/cases/i3-spec-driven-development.json +72 -0
- package/evals/cases/i3-test-driven-development.json +73 -0
- package/evals/cases/i3-using-agent-skills.json +44 -0
- package/evals/fixtures/i3-api-and-interface-design/service-brief.md +19 -0
- package/evals/fixtures/i3-browser-testing-with-devtools/README.md +5 -0
- package/evals/fixtures/i3-browser-testing-with-devtools/index.html +24 -0
- package/evals/fixtures/i3-browser-testing-with-devtools/server.js +15 -0
- package/evals/fixtures/i3-ci-cd-and-automation/package.json +8 -0
- package/evals/fixtures/i3-ci-cd-and-automation/src/slug.js +3 -0
- package/evals/fixtures/i3-ci-cd-and-automation/test/slug.test.js +9 -0
- package/evals/fixtures/i3-code-review-and-quality/user-search.diff +16 -0
- package/evals/fixtures/i3-code-simplification/config-parser.js +46 -0
- package/evals/fixtures/i3-code-simplification/config-parser.test.js +15 -0
- package/evals/fixtures/i3-context-engineering/context-audit.md +15 -0
- package/evals/fixtures/i3-debugging-and-error-recovery/pagination.js +8 -0
- package/evals/fixtures/i3-debugging-and-error-recovery/pagination.test.js +9 -0
- package/evals/fixtures/i3-debugging-and-error-recovery/time-pressure.md +6 -0
- package/evals/fixtures/i3-deprecation-and-migration/api-inventory.md +9 -0
- package/evals/fixtures/i3-documentation-and-adrs/decision-context.md +16 -0
- package/evals/fixtures/i3-doubt-driven-development/migration-plan.md +19 -0
- package/evals/fixtures/i3-frontend-ui-engineering/Button.tsx +7 -0
- package/evals/fixtures/i3-frontend-ui-engineering/design-system.md +11 -0
- package/evals/fixtures/i3-git-workflow-and-versioning/.eval/working-tree.patch +21 -0
- package/evals/fixtures/i3-git-workflow-and-versioning/app.js +7 -0
- package/evals/fixtures/i3-git-workflow-and-versioning/app.test.js +9 -0
- package/evals/fixtures/i3-incremental-implementation/reports.js +7 -0
- package/evals/fixtures/i3-incremental-implementation/reports.test.js +12 -0
- package/evals/fixtures/i3-incremental-implementation/tasks/plan.md +8 -0
- package/evals/fixtures/i3-observability-and-instrumentation/operations.md +11 -0
- package/evals/fixtures/i3-observability-and-instrumentation/payment-retry.js +14 -0
- package/evals/fixtures/i3-performance-optimization/benchmark.js +15 -0
- package/evals/fixtures/i3-performance-optimization/products.js +14 -0
- package/evals/fixtures/i3-planning-and-task-breakdown/notifications-spec.md +18 -0
- package/evals/fixtures/i3-security-and-hardening/webhook.js +11 -0
- package/evals/fixtures/i3-security-and-hardening/webhook.test.js +13 -0
- package/evals/fixtures/i3-shipping-and-launch/authority-pressure.md +6 -0
- package/evals/fixtures/i3-shipping-and-launch/launch-status.md +11 -0
- package/evals/fixtures/i3-source-driven-development/framework-task.md +10 -0
- package/evals/fixtures/i3-spec-driven-development/billing-brief.md +16 -0
- package/evals/fixtures/i3-test-driven-development/BUG.md +10 -0
- package/evals/fixtures/i3-test-driven-development/README.md +28 -0
- package/evals/fixtures/i3-test-driven-development/package.json +9 -0
- package/evals/fixtures/i3-test-driven-development/src/split.js +8 -0
- package/evals/fixtures/i3-test-driven-development/test/split.test.js +13 -0
- package/evals/fixtures/i3-using-agent-skills/incident.md +6 -0
- package/evals/fixtures/incremental-implementation-pressure/draft-export.js +17 -0
- package/evals/fixtures/incremental-implementation-pressure/scenario.md +9 -0
- package/evals/fixtures/spec-driven-development-decomposition/portal-brief.md +22 -0
- package/evals/fixtures/test-driven-development-ecosystem/README.md +9 -0
- package/evals/fixtures/test-driven-development-ecosystem/ledger.py +15 -0
- package/evals/fixtures/test-driven-development-ecosystem/test_ledger.py +19 -0
- package/evals/plugin/code-review-fires/graders/off-by-one.md +7 -0
- package/evals/plugin/code-review-fires/graders/severity-labels.md +4 -0
- package/evals/plugin/code-review-fires/graders/skill-fired.md +5 -0
- package/evals/plugin/code-review-fires/prompt.md +31 -0
- package/evals/plugin/code-review-stays-quiet/graders/not-fired.md +8 -0
- package/evals/plugin/code-review-stays-quiet/graders/tdd-fired.md +6 -0
- package/evals/plugin/code-review-stays-quiet/prompt.md +8 -0
- package/evals/plugin/code-review-stays-quiet-on-commit-message/graders/not-fired.md +8 -0
- package/evals/plugin/code-review-stays-quiet-on-commit-message/prompt.md +25 -0
- package/evals/zh-CN/cases/i3-api-and-interface-design.json +46 -0
- package/evals/zh-CN/cases/i3-browser-testing-with-devtools.json +45 -0
- package/evals/zh-CN/cases/i3-ci-cd-and-automation.json +46 -0
- package/evals/zh-CN/cases/i3-code-review-and-quality.json +46 -0
- package/evals/zh-CN/cases/i3-code-simplification.json +46 -0
- package/evals/zh-CN/cases/i3-constraint-driven-development.json +70 -0
- package/evals/zh-CN/cases/i3-context-engineering.json +45 -0
- package/evals/zh-CN/cases/i3-debugging-and-error-recovery.json +60 -0
- package/evals/zh-CN/cases/i3-deprecation-and-migration.json +45 -0
- package/evals/zh-CN/cases/i3-documentation-and-adrs.json +45 -0
- package/evals/zh-CN/cases/i3-doubt-driven-development.json +45 -0
- package/evals/zh-CN/cases/i3-frontend-ui-engineering.json +45 -0
- package/evals/zh-CN/cases/i3-git-workflow-and-versioning.json +45 -0
- package/evals/zh-CN/cases/i3-idea-refine.json +44 -0
- package/evals/zh-CN/cases/i3-incremental-implementation.json +59 -0
- package/evals/zh-CN/cases/i3-interview-me.json +43 -0
- package/evals/zh-CN/cases/i3-observability-and-instrumentation.json +46 -0
- package/evals/zh-CN/cases/i3-performance-optimization.json +46 -0
- package/evals/zh-CN/cases/i3-planning-and-task-breakdown.json +46 -0
- package/evals/zh-CN/cases/i3-security-and-hardening.json +46 -0
- package/evals/zh-CN/cases/i3-shipping-and-launch.json +59 -0
- package/evals/zh-CN/cases/i3-source-driven-development.json +45 -0
- package/evals/zh-CN/cases/i3-spec-driven-development.json +62 -0
- package/evals/zh-CN/cases/i3-test-driven-development.json +76 -0
- package/evals/zh-CN/cases/i3-using-agent-skills.json +45 -0
- package/hooks/SDD-CACHE.md +8 -0
- package/hooks/SIMPLIFY-IGNORE.md +8 -0
- package/hooks/sdd-cache-pre.sh +5 -5
- package/hooks/session-start-test.sh +1 -1
- package/hooks/session-start.sh +3 -3
- package/hooks/simplify-ignore.sh +8 -8
- package/package.json +235 -6
- package/plugin.json +2 -2
- package/references/accessibility-checklist.md +8 -0
- package/references/definition-of-done.md +8 -0
- package/references/observability-checklist.md +8 -0
- package/references/orchestration-patterns.md +8 -0
- package/references/performance-checklist.md +8 -0
- package/references/security-checklist.md +8 -0
- package/references/testing-patterns.md +8 -0
- package/scripts/lib/skill-lint.js +586 -0
- package/scripts/run-evals.js +659 -0
- package/scripts/validate-artifact-paths.js +130 -0
- package/scripts/validate-commands.js +224 -0
- package/scripts/validate-reference-links.js +187 -0
- package/scripts/validate-skills.js +70 -0
- package/scripts/validate-versions.js +35 -0
- package/skills/i3-api-and-interface-design/SKILL.md +13 -1
- package/skills/i3-browser-testing-with-devtools/SKILL.md +13 -1
- package/skills/i3-ci-cd-and-automation/SKILL.md +13 -1
- package/skills/i3-code-review-and-quality/SKILL.md +13 -1
- package/skills/i3-code-simplification/SKILL.md +13 -1
- package/skills/i3-constraint-driven-development/SKILL.md +13 -1
- package/skills/i3-constraint-driven-development/references/floor-guard.md +8 -0
- package/skills/i3-context-engineering/SKILL.md +13 -1
- package/skills/i3-debugging-and-error-recovery/SKILL.md +13 -1
- package/skills/i3-deprecation-and-migration/SKILL.md +13 -1
- package/skills/i3-documentation-and-adrs/SKILL.md +13 -1
- package/skills/i3-doubt-driven-development/SKILL.md +13 -1
- package/skills/i3-frontend-ui-engineering/SKILL.md +13 -1
- package/skills/i3-git-workflow-and-versioning/SKILL.md +13 -1
- package/skills/i3-idea-refine/SKILL.md +13 -1
- package/skills/i3-idea-refine/examples.md +8 -0
- package/skills/i3-idea-refine/frameworks.md +8 -0
- package/skills/i3-idea-refine/refinement-criteria.md +8 -0
- package/skills/i3-idea-refine/scripts/idea-refine.sh +2 -2
- package/skills/i3-incremental-implementation/SKILL.md +13 -1
- package/skills/i3-interview-me/SKILL.md +13 -1
- package/skills/i3-observability-and-instrumentation/SKILL.md +13 -1
- package/skills/i3-performance-optimization/SKILL.md +13 -1
- package/skills/i3-performance-optimization/references/optimization-patterns.md +8 -0
- package/skills/i3-planning-and-task-breakdown/SKILL.md +13 -1
- package/skills/i3-security-and-hardening/SKILL.md +13 -1
- package/skills/i3-security-and-hardening/references/hardening-patterns.md +8 -0
- package/skills/i3-shipping-and-launch/SKILL.md +13 -1
- package/skills/i3-source-driven-development/SKILL.md +13 -1
- package/skills/i3-spec-driven-development/SKILL.md +13 -1
- package/skills/i3-test-driven-development/SKILL.md +13 -1
- package/skills/i3-using-agent-skills/SKILL.md +13 -1
|
@@ -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,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,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,6 @@
|
|
|
1
|
+
# Login regression report
|
|
2
|
+
|
|
3
|
+
The login page began returning HTTP 500 after yesterday's deployment. The
|
|
4
|
+
request reaches the authentication callback, then fails before a session cookie
|
|
5
|
+
is written. There is no confirmed root cause yet. The user asked for help
|
|
6
|
+
getting login working again, not for a new authentication design.
|
|
@@ -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,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,15 @@
|
|
|
1
|
+
"""Simple in-memory ledger utilities."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def apply_entries(balance, entries):
|
|
5
|
+
"""Apply entries to a starting balance and return the result.
|
|
6
|
+
|
|
7
|
+
Entries are (kind, amount) tuples. Only "credit" entries are
|
|
8
|
+
supported; anything else raises ValueError.
|
|
9
|
+
"""
|
|
10
|
+
for kind, amount in entries:
|
|
11
|
+
if kind == "credit":
|
|
12
|
+
balance += amount
|
|
13
|
+
else:
|
|
14
|
+
raise ValueError(f"unsupported entry kind: {kind}")
|
|
15
|
+
return balance
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
3
|
+
from ledger import apply_entries
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ApplyEntriesTest(unittest.TestCase):
|
|
7
|
+
def test_applies_a_single_credit(self):
|
|
8
|
+
self.assertEqual(apply_entries(100, [("credit", 25)]), 125)
|
|
9
|
+
|
|
10
|
+
def test_applies_multiple_credits_in_order(self):
|
|
11
|
+
self.assertEqual(apply_entries(0, [("credit", 10), ("credit", 5)]), 15)
|
|
12
|
+
|
|
13
|
+
def test_rejects_unknown_entry_kinds(self):
|
|
14
|
+
with self.assertRaises(ValueError):
|
|
15
|
+
apply_entries(0, [("transfer", 10)])
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if __name__ == "__main__":
|
|
19
|
+
unittest.main()
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: llm
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
PASS if the review points out that `rows.slice(start, start + size - 1)` returns one row fewer than `size` on every page (the end index of slice is exclusive) and treats it as something that must be fixed before merge, for example by labelling it Critical or leaving it unprefixed as a required change.
|
|
6
|
+
|
|
7
|
+
FAIL if the review does not mention that pages come back one row short, or files that finding as a Nit, Optional, Consider, or FYI.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: A review request that names the axes, with a small diff inline. The skill should fire (through the review command or directly) and the reply should carry its severity labels.
|
|
3
|
+
expected_outcome: A structured review with a verdict, findings labelled with the skill's severity taxonomy, and the off-by-one in pageOrders treated as a required change.
|
|
4
|
+
max_turns: 12
|
|
5
|
+
allowed_tools: [Read, Glob, Grep, Skill]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
I want a code review of this diff across correctness, readability, security and performance before merging. It adds paging to the orders endpoint.
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
diff --git a/src/orders.js b/src/orders.js
|
|
12
|
+
--- a/src/orders.js
|
|
13
|
+
+++ b/src/orders.js
|
|
14
|
+
@@ -12,3 +12,15 @@ function listOrders(db) {
|
|
15
|
+
return db.query('SELECT * FROM orders ORDER BY created_at DESC');
|
|
16
|
+
}
|
|
17
|
+
-module.exports = { listOrders };
|
|
18
|
+
+function pageOrders(db, page, size) {
|
|
19
|
+
+ const rows = db.query('SELECT * FROM orders ORDER BY created_at DESC');
|
|
20
|
+
+ const start = (page - 1) * size;
|
|
21
|
+
+ return rows.slice(start, start + size - 1);
|
|
22
|
+
+}
|
|
23
|
+
+
|
|
24
|
+
+app.get('/orders', (req, res) => {
|
|
25
|
+
+ const page = Number(req.query.page) || 1;
|
|
26
|
+
+ const size = Number(req.query.size) || 20;
|
|
27
|
+
+ res.json(pageOrders(db, page, size));
|
|
28
|
+
+});
|
|
29
|
+
+
|
|
30
|
+
+module.exports = { listOrders, pageOrders };
|
|
31
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: A test-first request that belongs to i3-test-driven-development. The review skill must not fire.
|
|
3
|
+
expected_outcome: The reply proposes a failing test first; i3-code-review-and-quality is never invoked.
|
|
4
|
+
max_turns: 12
|
|
5
|
+
allowed_tools: [Read, Glob, Grep, Skill]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Write a failing test for this bug before we fix it: splitCents(100, 3) returns [33, 33, 33] and a cent goes missing.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: A pasted diff with a request that belongs to i3-git-workflow-and-versioning. Guards the "even when the diff is pasted inline" clause of the review skill's description, since a pasted diff alone must not make the review skill fire.
|
|
3
|
+
expected_outcome: A commit message; i3-code-review-and-quality is never invoked.
|
|
4
|
+
max_turns: 12
|
|
5
|
+
allowed_tools: [Read, Glob, Grep, Skill]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Write me a commit message for this diff.
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
diff --git a/src/orders.js b/src/orders.js
|
|
12
|
+
--- a/src/orders.js
|
|
13
|
+
+++ b/src/orders.js
|
|
14
|
+
@@ -12,3 +12,9 @@ function listOrders(db) {
|
|
15
|
+
return db.query('SELECT * FROM orders ORDER BY created_at DESC');
|
|
16
|
+
}
|
|
17
|
+
-module.exports = { listOrders };
|
|
18
|
+
+function pageOrders(db, page, size) {
|
|
19
|
+
+ const rows = db.query('SELECT * FROM orders ORDER BY created_at DESC');
|
|
20
|
+
+ const start = (page - 1) * size;
|
|
21
|
+
+ return rows.slice(start, start + size);
|
|
22
|
+
+}
|
|
23
|
+
+
|
|
24
|
+
+module.exports = { listOrders, pageOrders };
|
|
25
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-api-and-interface-design",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "为短链接服务设计创建、解析与统计接口,给出稳定的 API 契约。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "这两个模块之间如何定义类型契约和公共接口?",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "请设计 REST 端点和前后端接口边界。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "注册表单提交没反应,请在真实浏览器检查 DOM、控制台和网络请求。",
|
|
21
|
+
"owner": "i3-browser-testing-with-devtools"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "请对这个 PR 做代码审查,检查正确性、可读性、架构、安全与性能。",
|
|
25
|
+
"owner": "i3-code-review-and-quality"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "为短链接服务设计公共 API,包括创建、解析、统计,并给出端点契约。",
|
|
33
|
+
"expected_output": "Endpoint contracts with methods, paths, request/response shapes, and explicit error semantics",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-api-and-interface-design"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"Error responses are specified with status codes and a consistent error shape, not just happy paths",
|
|
39
|
+
"Input validation at the boundary is addressed for user-supplied URLs",
|
|
40
|
+
"Versioning or compatibility strategy is stated",
|
|
41
|
+
"The response does not silently invent unstated requirements",
|
|
42
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-browser-testing-with-devtools",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "注册表单提交没反应,请在真实浏览器检查 DOM、控制台和网络请求。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "用 Chrome DevTools MCP 检查页面视觉结果与运行时错误。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "请打开浏览器复现这个按钮问题,并记录控制台与网络证据。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "为项目配置 CI/CD 流水线,自动运行构建和测试。",
|
|
21
|
+
"owner": "i3-ci-cd-and-automation"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "这个函数行为正确但太复杂,请在不改变行为的前提下简化。",
|
|
25
|
+
"owner": "i3-code-simplification"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "注册表单可以显示,但提交似乎没有反应。请在真实浏览器验证实际行为并报告发现。",
|
|
33
|
+
"expected_output": "Runtime evidence from the browser: console errors, network activity, DOM state, and a diagnosis",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-browser-testing-with-devtools"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"Findings are grounded in observed runtime data (console, network, DOM), not static code reading alone",
|
|
39
|
+
"The report distinguishes what was observed from what is inferred",
|
|
40
|
+
"A concrete next step or fix hypothesis is provided",
|
|
41
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-ci-cd-and-automation",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "为项目配置 CI/CD 流水线,自动运行构建和测试。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "每次 PR 执行 lint 和测试,失败必须阻止合并。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "请调整持续集成部署流程,增加自动化质量门禁。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "请对这个 PR 做代码审查,检查正确性、可读性、架构、安全与性能。",
|
|
21
|
+
"owner": "i3-code-review-and-quality"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "为项目制定覆盖率、性能和无障碍质量门槛,写入 CONSTRAINTS.md。",
|
|
25
|
+
"owner": "i3-constraint-driven-development"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "为 Node 项目创建 CI 流水线:每次 PR 安装依赖、执行 lint 和测试,失败时阻止合并。",
|
|
33
|
+
"expected_output": "A working workflow definition with correct triggers, steps, and failure behavior",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-ci-cd-and-automation"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"The workflow triggers on pull requests",
|
|
39
|
+
"Failure of any quality gate fails the pipeline run",
|
|
40
|
+
"Steps are ordered logically and cache or setup steps are sane",
|
|
41
|
+
"No secrets are hardcoded in the workflow",
|
|
42
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-code-review-and-quality",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "请对这个 PR 做代码审查,检查正确性、可读性、架构、安全与性能。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "合并前评审这份 diff,按严重程度报告代码质量问题。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "这次提交的代码改动是否有可读性和接口一致性问题?请做评审。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "这个函数行为正确但太复杂,请在不改变行为的前提下简化。",
|
|
21
|
+
"owner": "i3-code-simplification"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "代理新会话忘记项目约定,请优化上下文和规则文件。",
|
|
25
|
+
"owner": "i3-context-engineering"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "审查提供的用户搜索端点 diff,给出结构化代码评审。",
|
|
33
|
+
"expected_output": "A multi-axis review with severity-labelled findings and file:line references",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-code-review-and-quality"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"Findings cover more than one axis (correctness, readability, architecture, security, performance)",
|
|
39
|
+
"Every finding carries a severity label from the skill's taxonomy",
|
|
40
|
+
"Security of user input is explicitly considered for the new endpoint",
|
|
41
|
+
"The review leads with high-leverage findings rather than nits",
|
|
42
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|