@sallmarta/eye-hate-agent 1.0.2 → 1.0.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.
- package/README.md +56 -304
- package/bin/eha.js +203 -118
- package/docs/templates/project-docs-template/index.md +208 -0
- package/docs/templates/project-docs-template/technical-guidelines/index.md +81 -0
- package/docs/templates/reusable-prompts/00-project-docs-bootstrap.md +40 -0
- package/docs/{vibes → templates}/reusable-prompts/00-project-docs-parity.md +4 -6
- package/docs/{vibes → templates}/reusable-prompts/00-project-docs-refresh.md +11 -11
- package/docs/{vibes → templates}/reusable-prompts/01-sdd-execute.md +1 -1
- package/docs/{vibes → templates}/reusable-prompts/02-sdd-discuss.md +3 -3
- package/{.agents/rules/agent.md → docs/templates/rules/agent-rules.md} +7 -12
- package/docs/{vibes → templates}/skills/api-design/SKILL.md +14 -25
- package/docs/{vibes/skills/full-verification → templates/skills/code-audit}/SKILL.md +36 -54
- package/docs/templates/skills/db-schema-design/SKILL.md +120 -0
- package/docs/templates/skills/devops-ci-cd/SKILL.md +99 -0
- package/docs/templates/skills/observability/SKILL.md +99 -0
- package/docs/{vibes/skills/parity → templates/skills/parity-audit}/SKILL.md +26 -52
- package/docs/templates/skills/refactor/SKILL.md +100 -0
- package/docs/templates/skills/security-audit/SKILL.md +149 -0
- package/docs/{vibes/skills/analysis → templates/skills/system-analysis}/SKILL.md +19 -41
- package/docs/{vibes/skills/test-authoring → templates/skills/system-tester}/SKILL.md +28 -46
- package/docs/templates/skills/ui-ux-design/SKILL.md +102 -0
- package/docs/templates/skills/wireframing/SKILL.md +88 -0
- package/package.json +4 -6
- package/src/engine/index.js +9 -12
- package/src/engine/install.js +67 -165
- package/src/engine/runtime-adapters.js +266 -50
- package/src/engine/skill-registry.js +72 -0
- package/src/engine/state.js +29 -7
- package/src/engine/workflow-registry.js +14 -23
- package/.claude/commands/eha/README.md +0 -3
- package/.claude/commands/eha/eha-bootstrap.md +0 -9
- package/.claude/commands/eha/eha-discuss.md +0 -9
- package/.claude/commands/eha/eha-execute.md +0 -9
- package/.claude/commands/eha/eha-parity.md +0 -9
- package/.claude/commands/eha/eha-refresh.md +0 -9
- package/.claude/commands/eha/eha-verify.md +0 -9
- package/.claude/rules/agent-rules.md +0 -64
- package/.github/instructions/agent-rules.instructions.md +0 -63
- package/.github/instructions/eha-workflows.instructions.md +0 -21
- package/docs/eyehateagent-contract.md +0 -475
- package/docs/eyehateagent-maintenance.md +0 -103
- package/docs/project-docs/changelog.md +0 -299
- package/docs/project-docs/foundation/architecture.md +0 -117
- package/docs/project-docs/foundation/status.md +0 -32
- package/docs/project-docs/foundation/workflow.md +0 -63
- package/docs/project-docs/index.md +0 -20
- package/docs/project-docs/testing.md +0 -73
- package/docs/vibes/project-docs-template/foundation/architecture.md +0 -79
- package/docs/vibes/project-docs-template/foundation/changelog.md +0 -53
- package/docs/vibes/project-docs-template/foundation/feature-inventory.md +0 -46
- package/docs/vibes/project-docs-template/foundation/phases.md +0 -60
- package/docs/vibes/project-docs-template/foundation/prd.md +0 -69
- package/docs/vibes/project-docs-template/foundation/status.md +0 -57
- package/docs/vibes/project-docs-template/foundation/workflow.md +0 -59
- package/docs/vibes/project-docs-template/getting-started.md +0 -52
- package/docs/vibes/project-docs-template/index.md +0 -66
- package/docs/vibes/project-docs-template/operations/ci-cd.md +0 -56
- package/docs/vibes/project-docs-template/operations/compliance.md +0 -46
- package/docs/vibes/project-docs-template/operations/governance.md +0 -46
- package/docs/vibes/project-docs-template/operations/observability.md +0 -53
- package/docs/vibes/project-docs-template/operations/production-runbook.md +0 -62
- package/docs/vibes/project-docs-template/operations/security.md +0 -49
- package/docs/vibes/project-docs-template/technical/api-contract.md +0 -49
- package/docs/vibes/project-docs-template/technical/database.md +0 -59
- package/docs/vibes/project-docs-template/technical/error-handling.md +0 -54
- package/docs/vibes/project-docs-template/technical/internationalization.md +0 -46
- package/docs/vibes/project-docs-template/technical/testing.md +0 -57
- package/docs/vibes/project-docs-template/technical/ui-ux.md +0 -68
- package/docs/vibes/project-docs-template/technical-guidelines/index.md +0 -52
- package/docs/vibes/reusable-prompts/00-project-docs-bootstrap.md +0 -59
- package/docs/vibes/skills/code-audit/SKILL.md +0 -170
- package/docs/vibes/skills/project-elevation/SKILL.md +0 -157
- package/docs/vibes/skills/test-authoring/references/patterns.md +0 -116
- package/docs/vibes/skills/test-authoring/references/test-types.md +0 -52
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code-audit
|
|
3
|
-
description: "Project-aware expert-role code audit for bugs, risk, redundancy, dead code, weak boundaries, and logic flaws. Reads project docs first, then audits code against the repository's actual architecture and quality rules."
|
|
4
|
-
argument-hint: "Point to the code, file, module, or change to audit"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Code Audit — Project-Aware
|
|
8
|
-
|
|
9
|
-
Performs an **expert, systematic, critical audit** of code or code-related artifacts after first reading the project documentation that defines the repository's architecture, verification model, and constraints.
|
|
10
|
-
|
|
11
|
-
This skill is reusable across application code, backend services, scripts, automation, infrastructure code, and documentation-driven repositories.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Required Project Inputs
|
|
16
|
-
|
|
17
|
-
| Document | Why it matters |
|
|
18
|
-
| --- | --- |
|
|
19
|
-
|
|
20
|
-
| `docs/project-docs/foundation/architecture.md` | Defines boundaries, dependencies, stack choices, and anti-violation rules |
|
|
21
|
-
| `docs/project-docs/technical/testing.md` | Defines available validation and evidence strength |
|
|
22
|
-
| `docs/project-docs/foundation/prd.md` | Clarifies scope, non-goals, and project stage |
|
|
23
|
-
| Relevant feature or guideline docs | Clarify local behavior, workflows, APIs, schemas, or UX expectations |
|
|
24
|
-
| The target code and nearby tests | Provide actual evidence for findings |
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## When To Use
|
|
29
|
-
|
|
30
|
-
| Trigger | Example request |
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| Change review | "Audit this change for correctness and boundary risk" |
|
|
33
|
-
| Module or file review | "Audit this module for dead code and duplication" |
|
|
34
|
-
| Reliability check | "Audit this service for failure handling gaps" |
|
|
35
|
-
| Architecture review | "Audit this workflow for boundary violations" |
|
|
36
|
-
|
|
37
|
-
Use `full-verification` instead when the user wants one broad verification entry point across code, docs, contracts, and repository state rather than a code-first audit.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Procedure
|
|
42
|
-
|
|
43
|
-
### Step 1 — Understand intent
|
|
44
|
-
|
|
45
|
-
- What is this code supposed to do?
|
|
46
|
-
- What inputs, outputs, and side effects should it have?
|
|
47
|
-
- Which boundary does it sit behind?
|
|
48
|
-
- What project rules apply here?
|
|
49
|
-
|
|
50
|
-
### Step 2 — Check correctness risks
|
|
51
|
-
|
|
52
|
-
Look for:
|
|
53
|
-
|
|
54
|
-
- runtime crashes
|
|
55
|
-
- missing validation
|
|
56
|
-
- broken assumptions around nullability or absence
|
|
57
|
-
- incorrect state transitions
|
|
58
|
-
- failure to handle empty, partial, duplicate, or delayed inputs
|
|
59
|
-
- unsafe retry or transaction behavior
|
|
60
|
-
- concurrency or sequencing defects
|
|
61
|
-
- schema or serialization mismatches
|
|
62
|
-
|
|
63
|
-
### Step 3 — Check boundary violations
|
|
64
|
-
|
|
65
|
-
Use `architecture.md` to inspect:
|
|
66
|
-
|
|
67
|
-
- layer or module import violations
|
|
68
|
-
- leaked internal types across boundaries
|
|
69
|
-
- controllers or UI doing business logic that belongs elsewhere
|
|
70
|
-
- repositories or services depending on the wrong layer
|
|
71
|
-
- transport or persistence details leaking into durable domain concepts when the project forbids that
|
|
72
|
-
|
|
73
|
-
### Step 4 — Check risk and operability
|
|
74
|
-
|
|
75
|
-
Look for:
|
|
76
|
-
|
|
77
|
-
- security exposure
|
|
78
|
-
- data-loss potential
|
|
79
|
-
- missing error translation
|
|
80
|
-
- logging or observability gaps
|
|
81
|
-
- migration or compatibility risk
|
|
82
|
-
- unbounded memory, time, or query behavior
|
|
83
|
-
- hidden coupling to environment or deployment assumptions
|
|
84
|
-
|
|
85
|
-
### Step 5 — Check redundancy and dead paths
|
|
86
|
-
|
|
87
|
-
Look for:
|
|
88
|
-
|
|
89
|
-
- duplicated logic
|
|
90
|
-
- unused or unreachable branches
|
|
91
|
-
- stale abstractions
|
|
92
|
-
- helper functions with no callers
|
|
93
|
-
- repeated literal values that should be owned centrally
|
|
94
|
-
- duplicated normalization or mapping logic that should be shared
|
|
95
|
-
|
|
96
|
-
### Step 6 — Check logic quality
|
|
97
|
-
|
|
98
|
-
Look for:
|
|
99
|
-
|
|
100
|
-
- unnecessarily complicated logic
|
|
101
|
-
- wrong abstraction level
|
|
102
|
-
- mismatch between code shape and problem shape
|
|
103
|
-
- poor data-structure choice
|
|
104
|
-
- fragile condition ordering
|
|
105
|
-
- subtle off-by-one or ordering issues
|
|
106
|
-
- code that technically works but will be hard to maintain safely
|
|
107
|
-
|
|
108
|
-
### Step 7 — Prioritize findings
|
|
109
|
-
|
|
110
|
-
Classify findings by severity:
|
|
111
|
-
|
|
112
|
-
- critical
|
|
113
|
-
- high
|
|
114
|
-
- medium
|
|
115
|
-
- low
|
|
116
|
-
|
|
117
|
-
Each finding should include:
|
|
118
|
-
|
|
119
|
-
- location
|
|
120
|
-
- issue
|
|
121
|
-
- why it matters
|
|
122
|
-
- concrete corrective direction
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## Output Contract
|
|
127
|
-
|
|
128
|
-
Include:
|
|
129
|
-
|
|
130
|
-
1. audit summary
|
|
131
|
-
2. findings ordered by severity
|
|
132
|
-
3. positive observations where relevant
|
|
133
|
-
4. recommended next actions in priority order
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## Quality Checks
|
|
138
|
-
|
|
139
|
-
- No finding without evidence from the target artifact
|
|
140
|
-
- No severity inflation
|
|
141
|
-
- No style nitpicks disguised as bugs
|
|
142
|
-
- No architecture complaint without reference to actual project boundaries
|
|
143
|
-
- No recommendation that ignores project stage or available validation
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Anti-Patterns
|
|
148
|
-
|
|
149
|
-
- Calling something dead code without checking workspace usage
|
|
150
|
-
- Calling something a bug without defining the failure condition
|
|
151
|
-
- Criticizing a pattern that the project explicitly chose in `architecture.md`
|
|
152
|
-
- Recommending wide rewrites before testing a local fix or a smaller boundary change
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## Natural Prompt Shapes
|
|
157
|
-
|
|
158
|
-
- "Review this code for bugs, risks, and boundary issues."
|
|
159
|
-
- "Audit this module like a strict senior reviewer."
|
|
160
|
-
- "Check whether this implementation has correctness or security problems."
|
|
161
|
-
- "Find dead code, logic flaws, and maintainability risks in this change."
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Example Requests
|
|
166
|
-
|
|
167
|
-
- "Audit this service for boundary violations"
|
|
168
|
-
- "Review this change for correctness risks"
|
|
169
|
-
- "Check this module for dead code and duplication"
|
|
170
|
-
- "Audit this workflow implementation for operability gaps"
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: project-elevation
|
|
3
|
-
description: "Project-aware expert-role elevation analysis to identify missing capabilities, weak reliability, poor user or operator experience, and high-value next improvements. Reads project docs first, then suggests realistic upgrades for the repository's current stage."
|
|
4
|
-
argument-hint: "Point to the project, module, workflow, or feature to evaluate for improvement"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Project Elevation — Project-Aware
|
|
8
|
-
|
|
9
|
-
Performs an **expert forward-looking evaluation** of a project, feature, workflow, or module to find meaningful improvements in reliability, usability, maintainability, delivery readiness, and developer experience.
|
|
10
|
-
|
|
11
|
-
This skill is designed to avoid generic wish lists. It should recommend improvements that are realistic for the repository's actual scope, stage, and constraints.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Required Project Inputs
|
|
16
|
-
|
|
17
|
-
| Document | Why it matters |
|
|
18
|
-
| --- | --- |
|
|
19
|
-
|
|
20
|
-
| `docs/project-docs/foundation/prd.md` | Clarifies goals, stakeholders, non-goals, and success metrics |
|
|
21
|
-
| `docs/project-docs/foundation/architecture.md` | Defines stack, boundaries, and implementation constraints |
|
|
22
|
-
| `docs/project-docs/foundation/status.md` | Shows maturity, roadmap, and current execution state |
|
|
23
|
-
| `docs/project-docs/technical/testing.md` | Shows current verification maturity and release confidence |
|
|
24
|
-
| Relevant feature, API, workflow, or UX docs | Clarify what the system already promises |
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## When To Use
|
|
29
|
-
|
|
30
|
-
| Trigger | Example request |
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| Roadmap review | "Evaluate this project for the next highest-value improvements" |
|
|
33
|
-
| Feature assessment | "What is missing from this workflow before it is production-ready?" |
|
|
34
|
-
| Reliability review | "Where should this module be elevated for resilience first?" |
|
|
35
|
-
| Delivery readiness | "What should improve before we call this MVP complete?" |
|
|
36
|
-
|
|
37
|
-
Use `full-verification` instead when the user wants a broad verification pass across code, docs, contract, architecture, and project health rather than a forward-looking improvement plan.
|
|
38
|
-
|
|
39
|
-
Use `analysis` instead when the main question is why something behaves the way it does, whether a decision is correct, or which option is better.
|
|
40
|
-
|
|
41
|
-
Use `code-audit` instead when the main question is whether an existing implementation has correctness, logic, or boundary defects.
|
|
42
|
-
|
|
43
|
-
Use `test-authoring` instead when the main question is how a change or behavior should be verified.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Procedure
|
|
48
|
-
|
|
49
|
-
### Step 1 — Understand the current state
|
|
50
|
-
|
|
51
|
-
- What does the system already do?
|
|
52
|
-
- Who uses it or depends on it?
|
|
53
|
-
- What stage is it in: concept, prototype, MVP, production, maintenance?
|
|
54
|
-
- What is explicitly out of scope?
|
|
55
|
-
- What current constraints would make some improvements unrealistic right now?
|
|
56
|
-
|
|
57
|
-
### Step 2 — Scan for missing failure handling
|
|
58
|
-
|
|
59
|
-
Look for places where the system could fail silently or recover poorly.
|
|
60
|
-
|
|
61
|
-
Examples:
|
|
62
|
-
|
|
63
|
-
- no clear offline or dependency-failure behavior
|
|
64
|
-
- missing retry, timeout, or rollback behavior
|
|
65
|
-
- no error-state UX or operator feedback
|
|
66
|
-
- missing migration or compatibility handling
|
|
67
|
-
- no recovery path for partial success or interruption
|
|
68
|
-
|
|
69
|
-
### Step 3 — Scan for natural feature gaps
|
|
70
|
-
|
|
71
|
-
Look for missing capabilities that are implied by current user flows or system promises.
|
|
72
|
-
|
|
73
|
-
Examples:
|
|
74
|
-
|
|
75
|
-
- one-way workflows with no cleanup or reverse action
|
|
76
|
-
- creation or capture flow with no correction, update, archival, or removal path
|
|
77
|
-
- discovery or lookup behavior with no empty, degraded, or large-result handling
|
|
78
|
-
- output generation or save action with no review, history, or management path
|
|
79
|
-
- automation with no observability or intervention path
|
|
80
|
-
- release or rollout process with no rollback, verification, or recovery checks
|
|
81
|
-
|
|
82
|
-
### Step 4 — Scan for improvement opportunities
|
|
83
|
-
|
|
84
|
-
Evaluate:
|
|
85
|
-
|
|
86
|
-
- reliability
|
|
87
|
-
- security
|
|
88
|
-
- performance
|
|
89
|
-
- observability
|
|
90
|
-
- developer experience
|
|
91
|
-
- user experience
|
|
92
|
-
- maintainability
|
|
93
|
-
|
|
94
|
-
Prioritize changes that improve the system materially without violating the project's scope or stage.
|
|
95
|
-
|
|
96
|
-
### Step 5 — Prioritize recommendations
|
|
97
|
-
|
|
98
|
-
Classify each recommendation as:
|
|
99
|
-
|
|
100
|
-
- must-have
|
|
101
|
-
- high-value
|
|
102
|
-
- nice-to-have
|
|
103
|
-
- future
|
|
104
|
-
|
|
105
|
-
Tie the rating back to current goals and constraints from `prd.md` and `status.md`.
|
|
106
|
-
|
|
107
|
-
Prefer the smallest realistic next step over a broad rewrite when both could address the same gap.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Output Contract
|
|
112
|
-
|
|
113
|
-
Include:
|
|
114
|
-
|
|
115
|
-
1. elevation summary
|
|
116
|
-
2. missing error handling
|
|
117
|
-
3. missing features
|
|
118
|
-
4. improvement opportunities by category
|
|
119
|
-
5. recommended roadmap or next actions
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Quality Checks
|
|
124
|
-
|
|
125
|
-
- No gold-plating for an early-stage project
|
|
126
|
-
- No recommendation that conflicts with explicit non-goals
|
|
127
|
-
- No large rewrite suggestion without a clear payoff
|
|
128
|
-
- No generic checklist detached from the actual repository
|
|
129
|
-
- Recommendations are prioritized and actionable
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Anti-Patterns
|
|
134
|
-
|
|
135
|
-
- Suggesting enterprise-scale systems for a small internal or MVP project
|
|
136
|
-
- Ignoring what the project explicitly does not want to become
|
|
137
|
-
- Producing a long unranked list with no delivery guidance
|
|
138
|
-
- Using this skill as a generic root-cause analysis or code-review wrapper when `analysis` or `code-audit` is the real fit
|
|
139
|
-
- Recommending improvements that the current architecture cannot plausibly support without acknowledging that cost
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## Natural Prompt Shapes
|
|
144
|
-
|
|
145
|
-
- "What should we improve next in this project?"
|
|
146
|
-
- "What is still missing before this workflow is ready?"
|
|
147
|
-
- "Where are the biggest maturity or readiness gaps right now?"
|
|
148
|
-
- "What are the highest-value next improvements without overbuilding?"
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Example Requests
|
|
153
|
-
|
|
154
|
-
- "Evaluate this project for the next highest-value improvements"
|
|
155
|
-
- "What should improve before this workflow is production-ready?"
|
|
156
|
-
- "Where is the biggest reliability gap in this module?"
|
|
157
|
-
- "What should we add before calling this MVP complete?"
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# Test Patterns Reference — Project-Aware
|
|
2
|
-
|
|
3
|
-
Quick reference for common test-pattern shapes. Use these as **structural examples**, then adapt them using the repository's `testing.md`, `architecture.md`, and local conventions.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Pattern A: Narrow Unit Or Component Test
|
|
8
|
-
|
|
9
|
-
Use when you want the fastest check at a clear boundary.
|
|
10
|
-
|
|
11
|
-
### Pattern A Skeleton
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
Arrange inputs and collaborators
|
|
15
|
-
Act on one function, method, or component boundary
|
|
16
|
-
Assert on the returned value, state change, or emitted effect
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### Pattern A Good Fit
|
|
20
|
-
|
|
21
|
-
- pure functions
|
|
22
|
-
- mappers or transformers
|
|
23
|
-
- validators
|
|
24
|
-
- repository or service methods with mocked dependencies
|
|
25
|
-
- small boundary-level business logic
|
|
26
|
-
|
|
27
|
-
### Pattern A Checklist
|
|
28
|
-
|
|
29
|
-
- isolate one behavior
|
|
30
|
-
- keep collaborators fake or mocked when helpful
|
|
31
|
-
- assert on outcomes, not internal implementation noise
|
|
32
|
-
- name tests by observable behavior
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Pattern B: Persistence Or Contract Test
|
|
37
|
-
|
|
38
|
-
Use when you need confidence in schema, queries, serialization, or boundary compatibility.
|
|
39
|
-
|
|
40
|
-
### Pattern B Skeleton
|
|
41
|
-
|
|
42
|
-
```text
|
|
43
|
-
Set up an isolated persistence or contract environment
|
|
44
|
-
Insert or send representative inputs
|
|
45
|
-
Read back or decode the resulting output
|
|
46
|
-
Assert on correctness, constraints, and error cases
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Pattern B Good Fit
|
|
50
|
-
|
|
51
|
-
- database queries
|
|
52
|
-
- repository persistence rules
|
|
53
|
-
- schema evolution
|
|
54
|
-
- migration behavior
|
|
55
|
-
- request / response or message serialization
|
|
56
|
-
- interface compatibility checks
|
|
57
|
-
|
|
58
|
-
### Pattern B Checklist
|
|
59
|
-
|
|
60
|
-
- include one happy path
|
|
61
|
-
- include one invalid or edge case
|
|
62
|
-
- assert on durable outcomes, not just returned status
|
|
63
|
-
- use representative fixtures where that improves clarity
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Pattern C: Flow Or Interaction Test
|
|
68
|
-
|
|
69
|
-
Use when the value lies in verifying a user, operator, or system flow instead of an isolated unit.
|
|
70
|
-
|
|
71
|
-
### Pattern C Skeleton
|
|
72
|
-
|
|
73
|
-
```text
|
|
74
|
-
Start from a realistic entry point
|
|
75
|
-
Drive the interaction or workflow
|
|
76
|
-
Wait for the expected state transition
|
|
77
|
-
Assert on visible output, routed behavior, or side effects
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Pattern C Good Fit
|
|
81
|
-
|
|
82
|
-
- UI interactions
|
|
83
|
-
- endpoint-to-service flow
|
|
84
|
-
- command or job workflows
|
|
85
|
-
- integration boundaries
|
|
86
|
-
- navigation or routing flows
|
|
87
|
-
|
|
88
|
-
### Pattern C Checklist
|
|
89
|
-
|
|
90
|
-
- keep the flow focused on one meaningful outcome
|
|
91
|
-
- mock or isolate irrelevant external dependencies when possible
|
|
92
|
-
- assert on the behavior the caller or user experiences
|
|
93
|
-
- avoid testing multiple unrelated journeys in one case
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Common Assertions To Prefer
|
|
98
|
-
|
|
99
|
-
- returned values or result envelopes
|
|
100
|
-
- persisted state
|
|
101
|
-
- emitted events or messages
|
|
102
|
-
- visible UI state
|
|
103
|
-
- boundary calls that materially define behavior
|
|
104
|
-
- error category and recovery path
|
|
105
|
-
|
|
106
|
-
Prefer observable behavior over internal implementation details.
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Common Anti-Patterns
|
|
111
|
-
|
|
112
|
-
- testing too many branches in one test
|
|
113
|
-
- asserting on private implementation details
|
|
114
|
-
- using full integration tests when a narrow unit or contract test would falsify the same assumption
|
|
115
|
-
- naming tests after implementation rather than behavior
|
|
116
|
-
- copying framework-specific scaffolds without checking `testing.md`
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Test Type Decision Table — Project-Aware
|
|
2
|
-
|
|
3
|
-
Use this table to choose the smallest verification type that matches the actual boundary being changed. Confirm the final choice against the repository's `testing.md`.
|
|
4
|
-
|
|
5
|
-
| Scenario | Preferred check type | Why |
|
|
6
|
-
| --- | --- | --- |
|
|
7
|
-
| Pure function, mapper, validator, parser | Unit | Fastest falsifiable check with minimal setup |
|
|
8
|
-
| Internal service or repository rule | Unit or component | Verifies business behavior without unnecessary system setup |
|
|
9
|
-
| Persistence query, migration, or schema rule | Persistence / migration test | Verifies durable state and compatibility at the right boundary |
|
|
10
|
-
| Request, handler, controller, or public API contract | Contract or integration test | Verifies visible boundary behavior and schema expectations |
|
|
11
|
-
| UI or operator interaction flow | Flow / interaction test | Verifies user-visible behavior rather than isolated internals |
|
|
12
|
-
| Async job, workflow, or queue behavior | Component or integration test | Verifies sequencing, retry, and side-effect behavior |
|
|
13
|
-
| Documentation, reusable prompt, or platform instruction surfaces change | Structural consistency review | Executable tests may not exist; consistency becomes the real boundary |
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Test Type Summary
|
|
18
|
-
|
|
19
|
-
| Type | Best for | Typical cost | Isolation |
|
|
20
|
-
| --- | --- | --- | --- |
|
|
21
|
-
| Unit | Pure logic and narrow behavior | Lowest | Highest |
|
|
22
|
-
| Component | One internal boundary with collaborators | Low to medium | High |
|
|
23
|
-
| Persistence / contract | Durable state or schema behavior | Low to medium | Medium to high |
|
|
24
|
-
| Flow / interaction | User or system-visible path | Medium | Medium |
|
|
25
|
-
| Integration | Real dependency or end-to-end boundary | Highest | Lowest |
|
|
26
|
-
| Consistency review | Docs, reusable prompts, platform instruction surfaces, and template systems | Low | High |
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Selection Rules
|
|
31
|
-
|
|
32
|
-
1. Prefer the narrowest check that can prove the change is correct.
|
|
33
|
-
2. Escalate to broader tests only when the boundary truly requires it.
|
|
34
|
-
3. Use project docs to choose commands, harnesses, and file placement.
|
|
35
|
-
4. When no executable validation exists, make the structural review explicit rather than pretending the repo is fully testable.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Naming Guidance
|
|
40
|
-
|
|
41
|
-
Prefer behavior-driven names such as:
|
|
42
|
-
|
|
43
|
-
- `returns empty result when no records match`
|
|
44
|
-
- `rejects invalid payload when required field is missing`
|
|
45
|
-
- `shows retry state after dependency timeout`
|
|
46
|
-
- `persists latest progress after successful update`
|
|
47
|
-
|
|
48
|
-
Avoid placeholder names such as:
|
|
49
|
-
|
|
50
|
-
- `test1`
|
|
51
|
-
- `happy path`
|
|
52
|
-
- `error case`
|