create-huenei-template 0.3.3 → 0.3.4

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 (139) hide show
  1. package/dist/core/skills-refresh.js +8 -3
  2. package/dist/templates/automation/_ci/cypress-ts/azure/azure-pipelines.yml +7 -0
  3. package/dist/templates/automation/_ci/cypress-ts/bitbucket/bitbucket-pipelines.yml +1 -0
  4. package/dist/templates/automation/_ci/cypress-ts/github/.github/workflows/e2e.yml +9 -0
  5. package/dist/templates/automation/_ci/cypress-ts/gitlab/.gitlab-ci.yml +2 -1
  6. package/dist/templates/automation/_ci/cypress-ts/jenkins/Jenkinsfile +3 -0
  7. package/dist/templates/automation/_ci/playwright-ts/azure/azure-pipelines.yml +7 -0
  8. package/dist/templates/automation/_ci/playwright-ts/github/.github/workflows/e2e.yml +10 -3
  9. package/dist/templates/automation/_ci/playwright-ts/jenkins/Jenkinsfile +2 -1
  10. package/dist/templates/automation/e2e-cypress-ts-app-actions/.cursor/skills/tdd/SKILL.md +38 -0
  11. package/dist/templates/automation/e2e-cypress-ts-app-actions/.cursor/skills/tdd/agents/openai.yaml +3 -0
  12. package/dist/templates/automation/e2e-cypress-ts-app-actions/.cursor/skills/tdd/mocking.md +59 -0
  13. package/dist/templates/automation/e2e-cypress-ts-app-actions/.cursor/skills/tdd/tests.md +77 -0
  14. package/dist/templates/automation/e2e-cypress-ts-app-actions/AGENTS.md +7 -7
  15. package/dist/templates/automation/e2e-cypress-ts-app-actions/README.md +1 -1
  16. package/dist/templates/automation/e2e-cypress-ts-app-actions/_skills-lock.json +6 -0
  17. package/dist/templates/automation/e2e-cypress-ts-app-actions/cypress.config.ts +44 -1
  18. package/dist/templates/automation/e2e-cypress-ts-app-actions/docs/HUB-INTEGRATION.md +51 -76
  19. package/dist/templates/automation/e2e-cypress-ts-app-actions/docs/agent-commands/new-e2e-scenario.md +34 -23
  20. package/dist/templates/automation/e2e-cypress-ts-app-actions/docs/agent-commands/new-e2e-test.md +46 -21
  21. package/dist/templates/automation/e2e-cypress-ts-app-actions/scenarios/INDEX.md +20 -0
  22. package/dist/templates/automation/e2e-cypress-ts-pom/.cursor/skills/tdd/SKILL.md +38 -0
  23. package/dist/templates/automation/e2e-cypress-ts-pom/.cursor/skills/tdd/agents/openai.yaml +3 -0
  24. package/dist/templates/automation/e2e-cypress-ts-pom/.cursor/skills/tdd/mocking.md +59 -0
  25. package/dist/templates/automation/e2e-cypress-ts-pom/.cursor/skills/tdd/tests.md +77 -0
  26. package/dist/templates/automation/e2e-cypress-ts-pom/AGENTS.md +7 -7
  27. package/dist/templates/automation/e2e-cypress-ts-pom/README.md +1 -1
  28. package/dist/templates/automation/e2e-cypress-ts-pom/_skills-lock.json +6 -0
  29. package/dist/templates/automation/e2e-cypress-ts-pom/cypress.config.ts +44 -1
  30. package/dist/templates/automation/e2e-cypress-ts-pom/docs/HUB-INTEGRATION.md +51 -76
  31. package/dist/templates/automation/e2e-cypress-ts-pom/docs/agent-commands/new-e2e-scenario.md +34 -23
  32. package/dist/templates/automation/e2e-cypress-ts-pom/docs/agent-commands/new-e2e-test.md +46 -21
  33. package/dist/templates/automation/e2e-cypress-ts-pom/scenarios/INDEX.md +20 -0
  34. package/dist/templates/automation/e2e-playwright-ts-app-actions/.cursor/skills/tdd/SKILL.md +38 -0
  35. package/dist/templates/automation/e2e-playwright-ts-app-actions/.cursor/skills/tdd/agents/openai.yaml +3 -0
  36. package/dist/templates/automation/e2e-playwright-ts-app-actions/.cursor/skills/tdd/mocking.md +59 -0
  37. package/dist/templates/automation/e2e-playwright-ts-app-actions/.cursor/skills/tdd/tests.md +77 -0
  38. package/dist/templates/automation/e2e-playwright-ts-app-actions/AGENTS.md +7 -6
  39. package/dist/templates/automation/e2e-playwright-ts-app-actions/README.md +1 -1
  40. package/dist/templates/automation/e2e-playwright-ts-app-actions/_skills-lock.json +6 -0
  41. package/dist/templates/automation/e2e-playwright-ts-app-actions/docs/HUB-INTEGRATION.md +51 -76
  42. package/dist/templates/automation/e2e-playwright-ts-app-actions/docs/agent-commands/new-e2e-scenario.md +33 -22
  43. package/dist/templates/automation/e2e-playwright-ts-app-actions/docs/agent-commands/new-e2e-test.md +56 -28
  44. package/dist/templates/automation/e2e-playwright-ts-app-actions/playwright.config.ts +6 -1
  45. package/dist/templates/automation/e2e-playwright-ts-app-actions/scenarios/INDEX.md +20 -0
  46. package/dist/templates/automation/e2e-playwright-ts-pom/.cursor/skills/tdd/SKILL.md +38 -0
  47. package/dist/templates/automation/e2e-playwright-ts-pom/.cursor/skills/tdd/agents/openai.yaml +3 -0
  48. package/dist/templates/automation/e2e-playwright-ts-pom/.cursor/skills/tdd/mocking.md +59 -0
  49. package/dist/templates/automation/e2e-playwright-ts-pom/.cursor/skills/tdd/tests.md +77 -0
  50. package/dist/templates/automation/e2e-playwright-ts-pom/AGENTS.md +7 -6
  51. package/dist/templates/automation/e2e-playwright-ts-pom/README.md +1 -1
  52. package/dist/templates/automation/e2e-playwright-ts-pom/_skills-lock.json +6 -0
  53. package/dist/templates/automation/e2e-playwright-ts-pom/docs/HUB-INTEGRATION.md +51 -76
  54. package/dist/templates/automation/e2e-playwright-ts-pom/docs/agent-commands/new-e2e-scenario.md +33 -22
  55. package/dist/templates/automation/e2e-playwright-ts-pom/docs/agent-commands/new-e2e-test.md +56 -28
  56. package/dist/templates/automation/e2e-playwright-ts-pom/playwright.config.ts +6 -1
  57. package/dist/templates/automation/e2e-playwright-ts-pom/scenarios/INDEX.md +20 -0
  58. package/dist/templates/automation/e2e-playwright-ts-screenplay/.cursor/skills/tdd/SKILL.md +38 -0
  59. package/dist/templates/automation/e2e-playwright-ts-screenplay/.cursor/skills/tdd/agents/openai.yaml +3 -0
  60. package/dist/templates/automation/e2e-playwright-ts-screenplay/.cursor/skills/tdd/mocking.md +59 -0
  61. package/dist/templates/automation/e2e-playwright-ts-screenplay/.cursor/skills/tdd/tests.md +77 -0
  62. package/dist/templates/automation/e2e-playwright-ts-screenplay/AGENTS.md +7 -6
  63. package/dist/templates/automation/e2e-playwright-ts-screenplay/README.md +1 -1
  64. package/dist/templates/automation/e2e-playwright-ts-screenplay/_skills-lock.json +6 -0
  65. package/dist/templates/automation/e2e-playwright-ts-screenplay/docs/HUB-INTEGRATION.md +51 -76
  66. package/dist/templates/automation/e2e-playwright-ts-screenplay/docs/agent-commands/new-e2e-scenario.md +33 -22
  67. package/dist/templates/automation/e2e-playwright-ts-screenplay/docs/agent-commands/new-e2e-test.md +56 -28
  68. package/dist/templates/automation/e2e-playwright-ts-screenplay/playwright.config.ts +6 -1
  69. package/dist/templates/automation/e2e-playwright-ts-screenplay/scenarios/INDEX.md +20 -0
  70. package/dist/test-cli.js +35 -4
  71. package/package.json +1 -1
  72. package/templates/automation/_ci/cypress-ts/azure/azure-pipelines.yml +7 -0
  73. package/templates/automation/_ci/cypress-ts/bitbucket/bitbucket-pipelines.yml +1 -0
  74. package/templates/automation/_ci/cypress-ts/github/.github/workflows/e2e.yml +9 -0
  75. package/templates/automation/_ci/cypress-ts/gitlab/.gitlab-ci.yml +2 -1
  76. package/templates/automation/_ci/cypress-ts/jenkins/Jenkinsfile +3 -0
  77. package/templates/automation/_ci/playwright-ts/azure/azure-pipelines.yml +7 -0
  78. package/templates/automation/_ci/playwright-ts/github/.github/workflows/e2e.yml +10 -3
  79. package/templates/automation/_ci/playwright-ts/jenkins/Jenkinsfile +2 -1
  80. package/templates/automation/e2e-cypress-ts-app-actions/.cursor/skills/tdd/SKILL.md +38 -0
  81. package/templates/automation/e2e-cypress-ts-app-actions/.cursor/skills/tdd/agents/openai.yaml +3 -0
  82. package/templates/automation/e2e-cypress-ts-app-actions/.cursor/skills/tdd/mocking.md +59 -0
  83. package/templates/automation/e2e-cypress-ts-app-actions/.cursor/skills/tdd/tests.md +77 -0
  84. package/templates/automation/e2e-cypress-ts-app-actions/AGENTS.md +7 -7
  85. package/templates/automation/e2e-cypress-ts-app-actions/README.md +1 -1
  86. package/templates/automation/e2e-cypress-ts-app-actions/_skills-lock.json +6 -0
  87. package/templates/automation/e2e-cypress-ts-app-actions/cypress.config.ts +44 -1
  88. package/templates/automation/e2e-cypress-ts-app-actions/docs/HUB-INTEGRATION.md +51 -76
  89. package/templates/automation/e2e-cypress-ts-app-actions/docs/agent-commands/new-e2e-scenario.md +34 -23
  90. package/templates/automation/e2e-cypress-ts-app-actions/docs/agent-commands/new-e2e-test.md +46 -21
  91. package/templates/automation/e2e-cypress-ts-app-actions/scenarios/INDEX.md +20 -0
  92. package/templates/automation/e2e-cypress-ts-pom/.cursor/skills/tdd/SKILL.md +38 -0
  93. package/templates/automation/e2e-cypress-ts-pom/.cursor/skills/tdd/agents/openai.yaml +3 -0
  94. package/templates/automation/e2e-cypress-ts-pom/.cursor/skills/tdd/mocking.md +59 -0
  95. package/templates/automation/e2e-cypress-ts-pom/.cursor/skills/tdd/tests.md +77 -0
  96. package/templates/automation/e2e-cypress-ts-pom/AGENTS.md +7 -7
  97. package/templates/automation/e2e-cypress-ts-pom/README.md +1 -1
  98. package/templates/automation/e2e-cypress-ts-pom/_skills-lock.json +6 -0
  99. package/templates/automation/e2e-cypress-ts-pom/cypress.config.ts +44 -1
  100. package/templates/automation/e2e-cypress-ts-pom/docs/HUB-INTEGRATION.md +51 -76
  101. package/templates/automation/e2e-cypress-ts-pom/docs/agent-commands/new-e2e-scenario.md +34 -23
  102. package/templates/automation/e2e-cypress-ts-pom/docs/agent-commands/new-e2e-test.md +46 -21
  103. package/templates/automation/e2e-cypress-ts-pom/scenarios/INDEX.md +20 -0
  104. package/templates/automation/e2e-playwright-ts-app-actions/.cursor/skills/tdd/SKILL.md +38 -0
  105. package/templates/automation/e2e-playwright-ts-app-actions/.cursor/skills/tdd/agents/openai.yaml +3 -0
  106. package/templates/automation/e2e-playwright-ts-app-actions/.cursor/skills/tdd/mocking.md +59 -0
  107. package/templates/automation/e2e-playwright-ts-app-actions/.cursor/skills/tdd/tests.md +77 -0
  108. package/templates/automation/e2e-playwright-ts-app-actions/AGENTS.md +7 -6
  109. package/templates/automation/e2e-playwright-ts-app-actions/README.md +1 -1
  110. package/templates/automation/e2e-playwright-ts-app-actions/_skills-lock.json +6 -0
  111. package/templates/automation/e2e-playwright-ts-app-actions/docs/HUB-INTEGRATION.md +51 -76
  112. package/templates/automation/e2e-playwright-ts-app-actions/docs/agent-commands/new-e2e-scenario.md +33 -22
  113. package/templates/automation/e2e-playwright-ts-app-actions/docs/agent-commands/new-e2e-test.md +56 -28
  114. package/templates/automation/e2e-playwright-ts-app-actions/playwright.config.ts +6 -1
  115. package/templates/automation/e2e-playwright-ts-app-actions/scenarios/INDEX.md +20 -0
  116. package/templates/automation/e2e-playwright-ts-pom/.cursor/skills/tdd/SKILL.md +38 -0
  117. package/templates/automation/e2e-playwright-ts-pom/.cursor/skills/tdd/agents/openai.yaml +3 -0
  118. package/templates/automation/e2e-playwright-ts-pom/.cursor/skills/tdd/mocking.md +59 -0
  119. package/templates/automation/e2e-playwright-ts-pom/.cursor/skills/tdd/tests.md +77 -0
  120. package/templates/automation/e2e-playwright-ts-pom/AGENTS.md +7 -6
  121. package/templates/automation/e2e-playwright-ts-pom/README.md +1 -1
  122. package/templates/automation/e2e-playwright-ts-pom/_skills-lock.json +6 -0
  123. package/templates/automation/e2e-playwright-ts-pom/docs/HUB-INTEGRATION.md +51 -76
  124. package/templates/automation/e2e-playwright-ts-pom/docs/agent-commands/new-e2e-scenario.md +33 -22
  125. package/templates/automation/e2e-playwright-ts-pom/docs/agent-commands/new-e2e-test.md +56 -28
  126. package/templates/automation/e2e-playwright-ts-pom/playwright.config.ts +6 -1
  127. package/templates/automation/e2e-playwright-ts-pom/scenarios/INDEX.md +20 -0
  128. package/templates/automation/e2e-playwright-ts-screenplay/.cursor/skills/tdd/SKILL.md +38 -0
  129. package/templates/automation/e2e-playwright-ts-screenplay/.cursor/skills/tdd/agents/openai.yaml +3 -0
  130. package/templates/automation/e2e-playwright-ts-screenplay/.cursor/skills/tdd/mocking.md +59 -0
  131. package/templates/automation/e2e-playwright-ts-screenplay/.cursor/skills/tdd/tests.md +77 -0
  132. package/templates/automation/e2e-playwright-ts-screenplay/AGENTS.md +7 -6
  133. package/templates/automation/e2e-playwright-ts-screenplay/README.md +1 -1
  134. package/templates/automation/e2e-playwright-ts-screenplay/_skills-lock.json +6 -0
  135. package/templates/automation/e2e-playwright-ts-screenplay/docs/HUB-INTEGRATION.md +51 -76
  136. package/templates/automation/e2e-playwright-ts-screenplay/docs/agent-commands/new-e2e-scenario.md +33 -22
  137. package/templates/automation/e2e-playwright-ts-screenplay/docs/agent-commands/new-e2e-test.md +56 -28
  138. package/templates/automation/e2e-playwright-ts-screenplay/playwright.config.ts +6 -1
  139. package/templates/automation/e2e-playwright-ts-screenplay/scenarios/INDEX.md +20 -0
@@ -7,7 +7,9 @@ const TEMPLATE_LOCK = "_skills-lock.json";
7
7
  const UPDATE_TIMEOUT_MS = 60_000;
8
8
  /**
9
9
  * Brings the vendored skills in `.cursor/skills/` up to date with their sources, silently.
10
- * `skills update` only downloads skills whose hash changed, into `.agents/skills/`.
10
+ * `skills update` only downloads skills whose hash changed, into `.agents/skills/`, but it also
11
+ * links them into every agent it detects (e.g. `.claude/skills/` outside Cursor), so anything it
12
+ * creates at the project root is removed: `applyAgentTarget` derives the agent layouts later.
11
13
  * Without network or npx the bundled copies are kept.
12
14
  */
13
15
  export async function refreshVendoredSkills(projectDir) {
@@ -16,6 +18,7 @@ export async function refreshVendoredSkills(projectDir) {
16
18
  return;
17
19
  const lock = path.join(projectDir, "skills-lock.json");
18
20
  const stagingDir = path.join(projectDir, ".agents");
21
+ const rootEntries = new Set(await readdir(projectDir));
19
22
  try {
20
23
  await rename(templateLock, lock);
21
24
  execSync("npx -y skills update --project --yes", {
@@ -37,7 +40,9 @@ export async function refreshVendoredSkills(projectDir) {
37
40
  }
38
41
  finally {
39
42
  await rm(templateLock, { force: true });
40
- await rm(lock, { force: true });
41
- await rm(stagingDir, { recursive: true, force: true });
43
+ for (const entry of await readdir(projectDir)) {
44
+ if (!rootEntries.has(entry))
45
+ await rm(path.join(projectDir, entry), { recursive: true, force: true });
46
+ }
42
47
  }
43
48
  }
@@ -40,6 +40,13 @@ steps:
40
40
  # TEST_ADMIN_EMAIL: $(TEST_ADMIN_EMAIL)
41
41
  # TEST_ADMIN_PASSWORD: $(TEST_ADMIN_PASSWORD)
42
42
 
43
+ - task: PublishPipelineArtifact@1
44
+ displayName: Upload Hub results
45
+ condition: succeededOrFailed()
46
+ inputs:
47
+ targetPath: test-results
48
+ artifact: test-results
49
+
43
50
  - task: PublishPipelineArtifact@1
44
51
  displayName: Upload screenshots on failure
45
52
  condition: failed()
@@ -14,6 +14,7 @@ definitions:
14
14
  - corepack pnpm lint
15
15
  - corepack pnpm test
16
16
  artifacts:
17
+ - test-results/**
17
18
  - cypress/screenshots/**
18
19
 
19
20
  pipelines:
@@ -39,6 +39,15 @@ jobs:
39
39
  - name: Run tests
40
40
  run: corepack pnpm test
41
41
 
42
+ - name: Upload Hub results
43
+ if: always()
44
+ uses: actions/upload-artifact@v4
45
+ with:
46
+ name: test-results
47
+ path: test-results/
48
+ retention-days: 7
49
+ if-no-files-found: ignore
50
+
42
51
  - name: Upload screenshots on failure
43
52
  if: failure()
44
53
  uses: actions/upload-artifact@v4
@@ -17,7 +17,8 @@ e2e:
17
17
  - corepack pnpm lint
18
18
  - corepack pnpm test
19
19
  artifacts:
20
- when: on_failure
20
+ when: always
21
21
  expire_in: 7 days
22
22
  paths:
23
+ - test-results/
23
24
  - cypress/screenshots/
@@ -46,6 +46,9 @@ pipeline {
46
46
  }
47
47
 
48
48
  post {
49
+ always {
50
+ archiveArtifacts artifacts: 'test-results/**', allowEmptyArchive: true
51
+ }
49
52
  failure {
50
53
  archiveArtifacts artifacts: 'cypress/screenshots/**', allowEmptyArchive: true
51
54
  }
@@ -55,3 +55,10 @@ steps:
55
55
  inputs:
56
56
  targetPath: playwright-report
57
57
  artifact: playwright-report
58
+
59
+ - task: PublishPipelineArtifact@1
60
+ displayName: Upload Hub results
61
+ condition: succeededOrFailed()
62
+ inputs:
63
+ targetPath: test-results
64
+ artifact: test-results
@@ -39,13 +39,20 @@ jobs:
39
39
  - name: Run tests
40
40
  run: corepack pnpm test
41
41
 
42
+ - name: Upload Hub results
43
+ if: always()
44
+ uses: actions/upload-artifact@v4
45
+ with:
46
+ name: test-results
47
+ path: test-results/
48
+ retention-days: 7
49
+ if-no-files-found: ignore
50
+
42
51
  - name: Upload report on failure
43
52
  if: failure()
44
53
  uses: actions/upload-artifact@v4
45
54
  with:
46
55
  name: playwright-report
47
- path: |
48
- playwright-report/
49
- test-results/
56
+ path: playwright-report/
50
57
  retention-days: 7
51
58
  if-no-files-found: ignore
@@ -49,9 +49,10 @@ pipeline {
49
49
  post {
50
50
  always {
51
51
  junit allowEmptyResults: true, testResults: 'test-results/junit.xml'
52
+ archiveArtifacts artifacts: 'test-results/**', allowEmptyArchive: true
52
53
  }
53
54
  failure {
54
- archiveArtifacts artifacts: 'playwright-report/**,test-results/**', allowEmptyArchive: true
55
+ archiveArtifacts artifacts: 'playwright-report/**', allowEmptyArchive: true
55
56
  }
56
57
  }
57
58
  }
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: tdd
3
+ description: Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
4
+ ---
5
+
6
+ # Test-Driven Development
7
+
8
+ TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle: consult them before and during the loop, not after.
9
+
10
+ When exploring the codebase, read `GLOSSARY.md` (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
11
+
12
+ ## What a good test is
13
+
14
+ Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification: "user can checkout with valid cart" tells you exactly what capability exists, and it survives refactors because it doesn't care about internal structure.
15
+
16
+ See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.
17
+
18
+ ## Seams: where tests go
19
+
20
+ A **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
21
+
22
+ **Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything, so agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.
23
+
24
+ Ask: "What's the public interface, and which seams should we test?" Give each proposed seam a one-line note on what it catches and what it misses.
25
+
26
+ When the shape of that interface is itself in question (how deep the module is, where the seam belongs, what the interface should expose), call the Skill tool with "codebase-design" for the vocabulary. It is the shared source of the module, interface, depth, seam, adapter, leverage and locality terms, and it is a reference to consult, not a session to run.
27
+
28
+ ## Anti-patterns
29
+
30
+ - **Implementation-coupled**: mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.
31
+ - **Tautological**: the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth: a known-good literal, a worked example, the spec.
32
+ - **Horizontal slicing**: writing all tests first, then all implementation. Bulk tests verify _imagined_ behavior: you test the _shape_ of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in **vertical slices** instead: one test → one implementation → repeat, each test a **tracer bullet** that responds to what the last cycle taught you.
33
+
34
+ ## Rules of the loop
35
+
36
+ - **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.
37
+ - **One slice at a time.** One seam, one test, one minimal implementation per cycle.
38
+ - **Refactoring is not part of the loop.** It belongs to the review stage (see the `code-review` skill), not the red → green implementation cycle.
@@ -0,0 +1,3 @@
1
+ interface:
2
+ display_name: "TDD"
3
+ short_description: "Test-driven red-green-refactor"
@@ -0,0 +1,59 @@
1
+ # When to Mock
2
+
3
+ Mock at **system boundaries** only:
4
+
5
+ - External APIs (payment, email, etc.)
6
+ - Databases (sometimes - prefer test DB)
7
+ - Time/randomness
8
+ - File system (sometimes)
9
+
10
+ Don't mock:
11
+
12
+ - Your own classes/modules
13
+ - Internal collaborators
14
+ - Anything you control
15
+
16
+ ## Designing for Mockability
17
+
18
+ At system boundaries, design interfaces that are easy to mock:
19
+
20
+ **1. Use dependency injection**
21
+
22
+ Pass external dependencies in rather than creating them internally:
23
+
24
+ ```typescript
25
+ // Easy to mock
26
+ function processPayment(order, paymentClient) {
27
+ return paymentClient.charge(order.total);
28
+ }
29
+
30
+ // Hard to mock
31
+ function processPayment(order) {
32
+ const client = new StripeClient(process.env.STRIPE_KEY);
33
+ return client.charge(order.total);
34
+ }
35
+ ```
36
+
37
+ **2. Prefer SDK-style interfaces over generic fetchers**
38
+
39
+ Create specific functions for each external operation instead of one generic function with conditional logic:
40
+
41
+ ```typescript
42
+ // GOOD: Each function is independently mockable
43
+ const api = {
44
+ getUser: (id) => fetch(`/users/${id}`),
45
+ getOrders: (userId) => fetch(`/users/${userId}/orders`),
46
+ createOrder: (data) => fetch('/orders', { method: 'POST', body: data }),
47
+ };
48
+
49
+ // BAD: Mocking requires conditional logic inside the mock
50
+ const api = {
51
+ fetch: (endpoint, options) => fetch(endpoint, options),
52
+ };
53
+ ```
54
+
55
+ The SDK approach means:
56
+ - Each mock returns one specific shape
57
+ - No conditional logic in test setup
58
+ - Easier to see which endpoints a test exercises
59
+ - Type safety per endpoint
@@ -0,0 +1,77 @@
1
+ # Good and Bad Tests
2
+
3
+ ## Good Tests
4
+
5
+ **Integration-style**: Test through real interfaces, not mocks of internal parts.
6
+
7
+ ```typescript
8
+ // GOOD: Tests observable behavior
9
+ test("user can checkout with valid cart", async () => {
10
+ const cart = createCart();
11
+ cart.add(product);
12
+ const result = await checkout(cart, paymentMethod);
13
+ expect(result.status).toBe("confirmed");
14
+ });
15
+ ```
16
+
17
+ Characteristics:
18
+
19
+ - Tests behavior users/callers care about
20
+ - Uses public API only
21
+ - Survives internal refactors
22
+ - Describes WHAT, not HOW
23
+ - One logical assertion per test
24
+
25
+ ## Bad Tests
26
+
27
+ **Implementation-detail tests**: Coupled to internal structure.
28
+
29
+ ```typescript
30
+ // BAD: Tests implementation details
31
+ test("checkout calls paymentService.process", async () => {
32
+ const mockPayment = jest.mock(paymentService);
33
+ await checkout(cart, payment);
34
+ expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
35
+ });
36
+ ```
37
+
38
+ Red flags:
39
+
40
+ - Mocking internal collaborators
41
+ - Testing private methods
42
+ - Asserting on call counts/order
43
+ - Test breaks when refactoring without behavior change
44
+ - Test name describes HOW not WHAT
45
+ - Verifying through external means instead of interface
46
+
47
+ ```typescript
48
+ // BAD: Bypasses interface to verify
49
+ test("createUser saves to database", async () => {
50
+ await createUser({ name: "Alice" });
51
+ const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
52
+ expect(row).toBeDefined();
53
+ });
54
+
55
+ // GOOD: Verifies through interface
56
+ test("createUser makes user retrievable", async () => {
57
+ const user = await createUser({ name: "Alice" });
58
+ const retrieved = await getUser(user.id);
59
+ expect(retrieved.name).toBe("Alice");
60
+ });
61
+ ```
62
+
63
+ **Tautological tests**: Expected value restates the implementation, so the test passes by construction.
64
+
65
+ ```typescript
66
+ // BAD: Expected value is recomputed the way the code computes it
67
+ test("calculateTotal sums line items", () => {
68
+ const items = [{ price: 10 }, { price: 5 }];
69
+ const expected = items.reduce((sum, i) => sum + i.price, 0);
70
+ expect(calculateTotal(items)).toBe(expected);
71
+ });
72
+
73
+ // GOOD: Expected value is an independent, known literal
74
+ test("calculateTotal sums line items", () => {
75
+ expect(calculateTotal([{ price: 10 }, { price: 5 }])).toBe(15);
76
+ });
77
+ ```
@@ -74,21 +74,20 @@ Funcionan en cualquier IDE o extensión. Si la persona escribe el comando, o pid
74
74
  | Comando | Qué hace | Seguir |
75
75
  | --- | --- | --- |
76
76
  | `/setup-project-context` | Briefing del SUT → sección `## Aplicación bajo prueba` en `AGENTS.md` | [docs/agent-commands/setup-project-context.md](docs/agent-commands/setup-project-context.md) |
77
- | `/new-e2e-scenario` | Entrevista a QA paso a paso y escribe el escenario en `scenarios/` y su set de datos en `cypress/fixtures/<id>.json` | [docs/agent-commands/new-e2e-scenario.md](docs/agent-commands/new-e2e-scenario.md) |
78
- | `/new-e2e-test` | Pide elegir un escenario e implementa su spec | [docs/agent-commands/new-e2e-test.md](docs/agent-commands/new-e2e-test.md) |
77
+ | `/new-e2e-scenario` | Completa un escenario a partir del borrador/contexto del Hub (o entrevista si no hay borrador) y escribe `scenarios/` + `cypress/fixtures/<id>.json` | [docs/agent-commands/new-e2e-scenario.md](docs/agent-commands/new-e2e-scenario.md) |
78
+ | `/new-e2e-test` | Implementa el spec con ciclo TDD (falla → pasa → puede fallar); no reescribe el escenario | [docs/agent-commands/new-e2e-test.md](docs/agent-commands/new-e2e-test.md) |
79
79
 
80
80
  Antes de cualquier tarea E2E, leer la sección `## Aplicación bajo prueba` de este archivo. Si aún tiene placeholders, sugerí `/setup-project-context`.
81
81
 
82
- Cursor, Claude Code (`.claude/commands/`) y Copilot (`.github/prompts/`) los ofrecen como comandos de barra; todos apuntan a esos archivos. En ejecuciones sin persona (Cloud Agents), no usarlos: anotar lo faltante en **Preguntas abiertas** del escenario y en el PR. Excepción: `/setup-project-context` invocado por el Hub con el contexto del proyecto corre en su modo pipeline, sin preguntas.
82
+ Cursor, Claude Code (`.claude/commands/`) y Copilot (`.github/prompts/`) los ofrecen como comandos de barra; todos apuntan a esos archivos. En ejecuciones sin persona (Cloud Agents), no usarlos: anotar lo faltante en **Preguntas abiertas** del escenario y en el PR. Excepción: `/setup-project-context` invocado por el Hub con el contexto del proyecto corre en su modo pipeline, sin preguntas. Excepción Hub: `/new-e2e-scenario` y `/new-e2e-test` en **modo Hub (borrador)** corren sin persona (sin grilling ni preguntas); los huecos van a **Preguntas abiertas**.
83
83
 
84
84
  ## Flujo para implementar un escenario
85
85
 
86
- 1. **Leer el escenario** en `scenarios/<ID>-<slug>.md` (formato en [scenarios/_template.md](scenarios/_template.md)) y su set de datos en `data_file`. Si la fixture no existe, generarla con las reglas de **Dónde se guarda** de `/new-e2e-scenario`. Si falta información imprescindible, dejarlo anotado en el PR en lugar de inventarla.
86
+ 1. **Leer** [scenarios/INDEX.md](scenarios/INDEX.md) (estado y Decisiones compartidas) y el escenario en `scenarios/<ID>-<slug>.md` (formato en [scenarios/_template.md](scenarios/_template.md)) y su set de datos en `data_file`. Si la fixture no existe, generarla con las reglas de **Dónde se guarda** de `/new-e2e-scenario`. Si falta información imprescindible, dejarlo anotado en el PR en lugar de inventarla.
87
87
  2. **Explorar la aplicación**: correr `pnpm env:check` para ver `BASE_URL` (la URL de la app vive en `.env`) y abrir `BASE_URL` + `target_path`; si el escenario tiene `session`, explorar con la sesión del rol según **Explorar una pantalla que requiere sesión** de la skill `e2e-cypress`: el login lo hace `cypress/auth/<rol>.cy.ts` con `pnpm auth`, y el agente nunca escribe contraseñas en el navegador. Usar el navegador disponible (Playwright MCP en el IDE, el navegador de la VM en Cloud Agents) para confirmar textos y atributos de test reales antes de escribir selectores.
88
88
  3. **Implementar según la arquitectura** descrita en [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md): reutilizar lo existente antes de crear algo nuevo.
89
- 4. **Escribir el test** en `cypress/e2e/`, importando los casos de la fixture de `data_file`, con `{ tags: ['@SC-001', '@smoke' | '@regression'] }`.
90
- 5. **Correr y corregir**: `pnpm typecheck`, `pnpm lint` y el spec nuevo deben pasar. Ante un fallo, revisar la captura en `cypress/screenshots/` antes de cambiar el test.
91
- 6. **Dejar el PR listo**: describir el escenario cubierto, los archivos creados y cualquier supuesto.
89
+ 5. **Correr y corregir (TDD)**: por caso, aplicar la skill `tdd` (falla → pasa → puede fallar). Luego `pnpm typecheck`, `pnpm lint` y el test deben pasar. Si la app difiere del escenario, anotar en **Preguntas abiertas** — no reescribir pasos ni resultados. Ante un fallo, revisar el trace (`test-results/`).
90
+ 6. **Dejar listo para revisión**: actualizar la fila del escenario en [scenarios/INDEX.md](scenarios/INDEX.md) (`implementado` o `bloqueado` con el motivo). En modo interactivo, abrir el PR con el escenario cubierto, archivos y supuestos. En **modo Hub (borrador)** de `/new-e2e-test`, el resumen agrupa archivos en el orden de commits de [docs/HUB-INTEGRATION.md](docs/HUB-INTEGRATION.md); el disparador del Hub abre el PR.
92
91
 
93
92
  ## Skills
94
93
 
@@ -101,6 +100,7 @@ En `.cursor/skills/`. Ante cualquier diferencia, este archivo, `.cursor/rules/`
101
100
  | `cypress-explain` | Explicar specs o APIs de Cypress sin modificar código |
102
101
  | `e2e-testing-patterns` | Criterios generales de E2E (qué automatizar, selectores estables, aislamiento) |
103
102
  | `grilling` | Entrevistar a la persona sobre el dominio antes de documentar contexto |
103
+ | `tdd` | Ciclo falla → pasa → puede fallar al implementar cada caso E2E |
104
104
  | `verification-before-completion` | No dar nada por terminado sin correr y leer typecheck, lint y tests |
105
105
 
106
106
  Antes de declarar un escenario terminado, aplicar `verification-before-completion`: correr `pnpm typecheck`, `pnpm lint` y el test nuevo, y citar el resultado.
@@ -57,7 +57,7 @@ WebKit en Cypress es experimental (`experimentalWebKitSupport` + `playwright-web
57
57
  cypress/e2e/ Specs y aserciones
58
58
  cypress/support/ App actions (app-actions.ts), plugins (e2e.ts), credentials.ts y factories de datos generados
59
59
  cypress/fixtures/ Set de datos de cada escenario (<id>.json) y catálogo de usuarios (users.json)
60
- scenarios/ Escenarios en lenguaje natural (contrato con el Hub)
60
+ scenarios/ Escenarios + INDEX.md (estados y Decisiones compartidas; contrato con el Hub)
61
61
  scripts/env-check.mjs Validación de .env (pnpm env:check)
62
62
  docs/agent-commands/ /new-e2e-scenario y /new-e2e-test, para cualquier agente
63
63
  docs/ARCHITECTURE.md El patrón App Actions y cuándo agregar capas
@@ -30,6 +30,12 @@
30
30
  "sourceType": "github",
31
31
  "skillPath": "skills/productivity/grilling/SKILL.md",
32
32
  "computedHash": "e40cc1d348f6d935e28f1e24474302d7368f0a400429271a43b35fe154891dc5"
33
+ },
34
+ "tdd": {
35
+ "source": "mattpocock/skills",
36
+ "sourceType": "github",
37
+ "skillPath": "skills/engineering/tdd/SKILL.md",
38
+ "computedHash": "daf55026f456af104a72fa43247f7bcec89e5127316dc5b1b8d675d6a9d8ce94"
33
39
  }
34
40
  }
35
41
  }
@@ -1,4 +1,6 @@
1
1
  import 'dotenv/config';
2
+ import { mkdirSync, writeFileSync } from 'node:fs';
3
+ import { dirname } from 'node:path';
2
4
  import { defineConfig } from 'cypress';
3
5
  import { plugin as cypressGrepPlugin } from '@cypress/grep/plugin';
4
6
 
@@ -10,13 +12,54 @@ if (!baseUrl) {
10
12
  // Every TEST_<KEY>_EMAIL / TEST_<KEY>_PASSWORD from .env, read in specs with emailOf()/passwordOf().
11
13
  const testUsers = Object.fromEntries(Object.entries(process.env).filter(([name]) => name.startsWith('TEST_')));
12
14
 
15
+ function writeHubResults(results: CypressCommandLine.CypressRunResult): void {
16
+ const outputFile = 'test-results/results.json';
17
+ mkdirSync(dirname(outputFile), { recursive: true });
18
+ const tests = (results.runs ?? []).flatMap((run) =>
19
+ (run.tests ?? []).map((test) => {
20
+ const titlePath = test.title ?? [];
21
+ const title = titlePath.join(' ');
22
+ const tagMatch = title.match(/@SC-[\w-]+/i);
23
+ return {
24
+ title: titlePath,
25
+ state: test.state,
26
+ tags: tagMatch ? [tagMatch[0]] : [],
27
+ spec: run.spec?.relative,
28
+ };
29
+ }),
30
+ );
31
+ writeFileSync(
32
+ outputFile,
33
+ JSON.stringify(
34
+ {
35
+ totalTests: results.totalTests,
36
+ totalPassed: results.totalPassed,
37
+ totalFailed: results.totalFailed,
38
+ totalPending: results.totalPending,
39
+ totalSkipped: results.totalSkipped,
40
+ startedTestsAt: results.startedTestsAt,
41
+ endedTestsAt: results.endedTestsAt,
42
+ tests,
43
+ },
44
+ null,
45
+ 2,
46
+ ),
47
+ );
48
+ }
49
+
13
50
  export default defineConfig({
14
51
  e2e: {
15
52
  baseUrl,
16
53
  specPattern: 'cypress/e2e/**/*.cy.ts',
17
54
  supportFile: 'cypress/support/e2e.ts',
18
- setupNodeEvents(_on, config) {
55
+ setupNodeEvents(on, config) {
19
56
  cypressGrepPlugin(config);
57
+ on('after:run', (results) => {
58
+ // cypress open: undefined. Failed boot: no runs. Hub reads this file from CI.
59
+ if (results && 'runs' in results) {
60
+ writeHubResults(results);
61
+ }
62
+ });
20
63
  return config;
21
64
  },
22
65
  },
@@ -1,91 +1,66 @@
1
1
  # Integración con el Hub
2
2
 
3
- Cómo el Hub puede pedirle a un agente de Cursor que implemente un escenario en este repo. El código del Hub y del worker vive fuera de este repositorio; acá está el contrato del lado del repo de pruebas.
3
+ Contrato entre este repo y el **Hub de Pre-Sales** (orquestador). El Hub no vive acá: solo se documenta qué espera de un proyecto generado con `create-huenei-template`.
4
4
 
5
5
  ## Generación del repo (pipeline)
6
6
 
7
- En el pipeline del Hub, este repo se crea y se configura en tres pasos:
7
+ Cuando el Hub crea el proyecto de automatización:
8
8
 
9
- 1. Un nodo reúne el contexto del proyecto (tipo de superficie, producto, problemas que resuelve, roles, flujos).
10
- 2. Otro nodo genera el repo en Azure con el CLI, para Cursor, Claude Code y VS Code:
9
+ 1. Corre `npx create-huenei-template` con `--template`, `--name`, `--agent both` y el resto de flags E2E (`--framework`, `--language`, `--architecture`, `--ci`).
10
+ 2. Corre `pnpm install` (descarga Chromium, Firefox y WebKit vía `postinstall` en Playwright; en Cypress, el binario vía `onlyBuiltDependencies`).
11
+ 3. Corre `/setup-project-context` en **modo pipeline**: el agente recibe el contexto del proyecto, escribe el briefing en `AGENTS.md` → `## Aplicación bajo prueba` sin grilling ni preguntas, y anota los huecos en `### Preguntas abiertas`.
12
+ 4. Genera escenarios con `/new-e2e-scenario` (y, si aplica, scripts con `/new-e2e-test`) en **modo Hub (borrador)**. Solo es posible cuando se cumple el preset: el repo ya está vinculado al proyecto del Hub, `BASE_URL` y la rama principal están configuradas, y `/setup-project-context` ya corrió.
11
13
 
12
- ```bash
13
- npx create-huenei-template --template e2e-automation --name "${PROYECTO}-automation" \
14
- --agent both --framework <playwright|cypress> --language ts --architecture <arquitectura> --ci azure
15
- ```
14
+ Si el contexto llega vacío o incompleto, el agente deja `### Preguntas abiertas` con lo que falta; no aborta el pipeline.
16
15
 
17
- 3. Un agente corre [`/setup-project-context`](agent-commands/setup-project-context.md) en ese repo con el contexto del paso 1. Va en su **modo pipeline**: sin preguntas, escribe el briefing en [AGENTS.md](../AGENTS.md) → `## Aplicación bajo prueba` y anota los huecos en `### Preguntas abiertas`.
16
+ ## Flujo borrador → PR
18
17
 
19
- Después, cada escenario sigue el contrato de abajo.
18
+ El Hub genera escenarios y scripts como **borrador**. Cuando una persona los revisa y aprueba, un disparador del Hub:
19
+
20
+ 1. Crea una rama desde la rama principal del repo.
21
+ 2. Hace commits separados y en orden (tabla abajo).
22
+ 3. Hace push y abre el PR.
23
+
24
+ Por eso `/new-e2e-scenario` y `/new-e2e-test` **no** crean ramas, commits ni PRs: escriben archivos en el workspace y terminan con un resumen para la revisión en el Hub.
25
+
26
+ ### Orden de commits (Conventional Commits + id del escenario)
27
+
28
+ | # | Mensaje | Contenido |
29
+ |---|---------|-----------|
30
+ | 1 | `test(e2e): add scenario SC-123` | Escenario + `cypress/fixtures/<id>.json` |
31
+ | 2 | `test(e2e): add role <rol>` | Catálogo de usuarios, login del rol y `.env.example` (solo si hay roles nuevos) |
32
+ | 3 | `test(e2e): add <abstracciones> for SC-123` | Page objects, tareas o app actions |
33
+ | 4 | `test(e2e): add spec SC-123` | Spec del escenario |
20
34
 
21
35
  ## Contrato
22
36
 
37
+ | Tema | Convención en este repo |
38
+ |------|-------------------------|
39
+ | Briefing del SUT | `AGENTS.md` → `## Aplicación bajo prueba` (fuente de verdad). `docs/PROJECT-CONTEXT.md` solo redirige ahí. |
40
+ | Escenarios | Markdown en `scenarios/` con frontmatter YAML (`id`, `title`, `priority`, `status`, `tags`, `target_path`). El `.md` es lo que el Hub sincroniza. Índice en `scenarios/INDEX.md` (estados y Decisiones compartidas). |
41
+ | Datos de prueba | `data/<scenario-id>/` referenciado desde el escenario. |
42
+ | Usuarios de prueba | Variables `TEST_<ROLE>_EMAIL` / `TEST_<ROLE>_PASSWORD` en `.env` (ver `.env.example`). |
43
+ | URL base | `BASE_URL` en `.env`; sin ella, `pnpm env:check` y el config de tests fallan. |
44
+ | Agente | Generado con `--agent both`: skills en `.claude/skills/` (Cursor las lee también), comandos en `.claude/commands/` y `.cursor/commands/`. |
45
+ | Diferencias app ↔ escenario | Solo `/new-e2e-scenario` reescribe el escenario. `/new-e2e-test` anota diferencias en **Preguntas abiertas** y las informa en el resumen / PR. |
46
+
23
47
  1. El Hub exporta el escenario a `scenarios/<ID>-<slug>.md` siguiendo [scenarios/_template.md](../scenarios/_template.md) (commit en la rama de trabajo, o incluido en el prompt), con `target_path` y la tabla **Set de datos**. La URL de la app no va en el escenario: el Hub la pasa como `BASE_URL` en `envVars`, junto con los usuarios de prueba. Si un escenario exportado todavía trae `base_url`, se ignora.
24
- 2. El agente sigue [AGENTS.md](../AGENTS.md): lee el escenario, genera su set de datos si el Hub no lo incluyó, corre `pnpm env:check`, explora la app en `BASE_URL` + `target_path`, implementa según [ARCHITECTURE.md](ARCHITECTURE.md), corre los tests y deja el PR.
48
+ 2. El agente sigue [AGENTS.md](../AGENTS.md): lee el escenario y [scenarios/INDEX.md](../scenarios/INDEX.md), genera su set de datos si el Hub no lo incluyó, corre `pnpm env:check`, explora la app en `BASE_URL` + `target_path`, implementa según [ARCHITECTURE.md](ARCHITECTURE.md), corre los tests, actualiza el índice y deja el trabajo listo. En modo Hub (borrador) no abre el PR: lo hace el disparador. El Hub puede leer `scenarios/INDEX.md` para ver estados.
25
49
  3. Cada test generado queda etiquetado con el id del escenario (`@SC-123`), lo que permite al Hub correrlo con `--grep @SC-123` y vincular resultados.
26
50
 
27
- ## Opción A: Cloud Agents API (worker del Hub)
28
-
29
- Para apps accesibles desde internet. El agente corre en una VM de Cursor con navegador propio y abre un PR.
30
-
31
- ```http
32
- POST https://api.cursor.com/v1/agents
33
- Authorization: Bearer <CURSOR_API_KEY>
34
- Content-Type: application/json
35
- ```
36
-
37
- ```json
38
- {
39
- "prompt": {
40
- "text": "Implementá el escenario scenarios/SC-123-checkout.md siguiendo AGENTS.md. Corré typecheck, lint y el test nuevo antes de terminar."
41
- },
42
- "repos": [
43
- { "url": "https://github.com/acme/e2e-tests", "startingRef": "main" }
44
- ],
45
- "autoCreatePR": true,
46
- "envVars": {
47
- "BASE_URL": "https://staging.example.com",
48
- "TEST_ADMIN_EMAIL": "<tomado del gestor de secretos del worker>",
49
- "TEST_ADMIN_PASSWORD": "<tomado del gestor de secretos del worker>"
50
- },
51
- "mcpServers": {
52
- "playwright": { "command": "npx", "args": ["-y", "@playwright/mcp@latest", "--headless"] },
53
- "playwright-session": { "command": "npx", "args": ["-y", "@playwright/mcp@latest", "--headless", "--isolated", "--storage-state", ".auth/session.json"] }
54
- }
55
- }
56
- ```
57
-
58
- - La respuesta incluye `agent.id` y `agent.url` (`https://cursor.com/agents/bc-…`). El Hub los guarda vinculados al escenario para que la persona abra el agente después.
59
- - Los Cloud Agents leen `AGENTS.md` y `.cursor/rules/`, y preparan el entorno con `.cursor/environment.json`. **No leen `.cursor/mcp.json`**: por eso el MCP se pasa en `mcpServers` (o se configura a nivel equipo en cursor.com/agents).
60
- - `envVars` lleva las variables de `.env.example`: `BASE_URL` (obligatoria), un `TEST_<ROL>_EMAIL` / `TEST_<ROL>_PASSWORD` por cada rol que use el escenario (ver [CREDENTIALS.md](CREDENTIALS.md)) y otros secretos si los hay. Con ellos el agente corre `pnpm env:check` y `pnpm auth` en la VM y explora las pantallas protegidas con `playwright-session` sin ver las contraseñas; verificar que la ruta relativa `.auth/session.json` se resuelva desde la raíz del repo.
61
- - Revisar en la documentación vigente de la API los nombres exactos de `envVars` y `mcpServers` antes de implementar el worker; la API v1 está en beta pública.
62
- - La API key vive solo en el worker, nunca en el navegador del Hub.
63
-
64
- ## Opción B: SDK local (app en red interna)
65
-
66
- Si la app solo es accesible desde la red de Huenei, la VM de Cursor no la ve (salvo con Tailscale, Cloudflare Tunnel o Self-Hosted Machines). En ese caso el worker usa `@cursor/sdk` sobre un checkout local:
67
-
68
- ```ts
69
- import { Agent } from '@cursor/sdk';
70
-
71
- const agent = await Agent.create({
72
- apiKey: process.env.CURSOR_API_KEY!,
73
- model: { id: '<modelo>' },
74
- local: { cwd: '/ruta/al/checkout/e2e-tests' },
75
- });
76
- ```
77
-
78
- En modo local las herramientas se aprueban automáticamente por defecto: correrlo en una máquina o contenedor dedicado.
79
-
80
- ## Opción C: handoff a una persona en el IDE
81
-
82
- Para que quien prueba vea la app en el navegador de Cursor mientras el agente escribe el script:
83
-
84
- 1. Abrir el checkout local en Cursor (`cursor <ruta>`; verificar este comando en las máquinas de QA, no está en la documentación oficial).
85
- 2. Abrir un deeplink con un prompt **corto** que apunte al escenario, no el escenario entero (límite de 10.000 caracteres):
86
-
87
- ```text
88
- cursor://anysphere.cursor-deeplink/prompt?text=Implementá%20scenarios%2FSC-123-checkout.md%20siguiendo%20AGENTS.md.%20Corré%20pnpm%20env%3Acheck%20y%20abrí%20BASE_URL%20en%20el%20navegador%20como%20referencia.
89
- ```
90
-
91
- 3. La persona revisa y envía el chat (el deeplink nunca se ejecuta solo y no elige el repo: cae en la ventana abierta). El agente abre la app con el navegador de Cursor y escribe el test.
51
+ ## Resultados para el Hub
52
+
53
+ CI publica bajo `test-results/`:
54
+
55
+ | Archivo | Origen |
56
+ |---------|--------|
57
+ | `test-results/junit.xml` | Reporter JUnit (Playwright) / si el pipeline lo configura |
58
+ | `test-results/results.json` | Reporter JSON (Playwright) o hook `after:run` (Cypress) |
59
+
60
+ Cada test lleva el tag `@SC-xxx` (Playwright: `tag` en el `test` / `describe`; Cypress: `@SC-xxx` en el título del `describe` y en `tags`). El Hub vincula resultados y métricas del dashboard por ese tag.
61
+
62
+ ## Fuera de alcance de este template
63
+
64
+ - UI del Hub, auth del Hub, colas o workers.
65
+ - Cómo el Hub inyecta el contexto del proyecto en el agente (API propia del Hub).
66
+ - El disparador (ramas, commits, push, PR) y el dashboard viven en el Hub; este template solo define el contrato.