contract-driven-delivery 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -0
- package/assets/AGENTS.template.md +21 -0
- package/assets/CLAUDE.template.md +159 -0
- package/assets/agents/backend-engineer.md +24 -0
- package/assets/agents/change-classifier.md +73 -0
- package/assets/agents/ci-cd-gatekeeper.md +40 -0
- package/assets/agents/contract-reviewer.md +42 -0
- package/assets/agents/e2e-resilience-engineer.md +25 -0
- package/assets/agents/frontend-engineer.md +22 -0
- package/assets/agents/monkey-test-engineer.md +29 -0
- package/assets/agents/qa-reviewer.md +49 -0
- package/assets/agents/repo-context-scanner.md +71 -0
- package/assets/agents/spec-architect.md +47 -0
- package/assets/agents/spec-drift-auditor.md +41 -0
- package/assets/agents/stress-soak-engineer.md +51 -0
- package/assets/agents/test-strategist.md +57 -0
- package/assets/agents/ui-ux-reviewer.md +42 -0
- package/assets/agents/visual-reviewer.md +44 -0
- package/assets/ci/gate-policy.md +51 -0
- package/assets/ci/github-actions/contract-driven-gates.yml +38 -0
- package/assets/ci/required-check-policy.md +13 -0
- package/assets/contracts/api/api-contract.md +20 -0
- package/assets/contracts/api/api-inventory.md +13 -0
- package/assets/contracts/api/error-format.md +19 -0
- package/assets/contracts/business/business-rules.md +13 -0
- package/assets/contracts/ci/ci-gate-contract.md +13 -0
- package/assets/contracts/css/css-contract.md +15 -0
- package/assets/contracts/css/design-tokens.md +13 -0
- package/assets/contracts/data/data-shape-contract.md +22 -0
- package/assets/contracts/env/.env.example.template +5 -0
- package/assets/contracts/env/env-contract.md +12 -0
- package/assets/contracts/env/env.schema.json +7 -0
- package/assets/skill/SKILL.md +102 -0
- package/assets/skill/agents/openai.yaml +2 -0
- package/assets/skill/references/api-contract-standard.md +55 -0
- package/assets/skill/references/business-logic-standard.md +32 -0
- package/assets/skill/references/ci-cd-policy.md +34 -0
- package/assets/skill/references/css-contract-standard.md +40 -0
- package/assets/skill/references/data-contract-standard.md +43 -0
- package/assets/skill/references/e2e-standard.md +33 -0
- package/assets/skill/references/env-contract-standard.md +30 -0
- package/assets/skill/references/monkey-operation-standard.md +32 -0
- package/assets/skill/references/qa-gates.md +37 -0
- package/assets/skill/references/sdd-tdd-policy.md +53 -0
- package/assets/skill/references/spec-drift-policy.md +28 -0
- package/assets/skill/references/stress-soak-standard.md +42 -0
- package/assets/skill/references/visual-review-standard.md +27 -0
- package/assets/skill/references/workflow-router.md +34 -0
- package/assets/skill/scripts/detect_project_profile.py +61 -0
- package/assets/skill/scripts/generate_change_scaffold.py +38 -0
- package/assets/skill/scripts/validate_ci_gates.py +14 -0
- package/assets/skill/scripts/validate_contracts.py +13 -0
- package/assets/skill/scripts/validate_env_contract.py +16 -0
- package/assets/skill/scripts/validate_spec_traceability.py +18 -0
- package/assets/skill/templates/archive.md +17 -0
- package/assets/skill/templates/change-classification.md +48 -0
- package/assets/skill/templates/change-request.md +15 -0
- package/assets/skill/templates/ci-gates.md +31 -0
- package/assets/skill/templates/contracts.md +37 -0
- package/assets/skill/templates/current-behavior.md +17 -0
- package/assets/skill/templates/design.md +23 -0
- package/assets/skill/templates/monkey-test-report.md +17 -0
- package/assets/skill/templates/project-profile.md +38 -0
- package/assets/skill/templates/proposal.md +17 -0
- package/assets/skill/templates/qa-report.md +26 -0
- package/assets/skill/templates/regression-report.md +21 -0
- package/assets/skill/templates/spec.md +23 -0
- package/assets/skill/templates/stress-soak-report.md +22 -0
- package/assets/skill/templates/tasks.md +43 -0
- package/assets/skill/templates/test-plan.md +31 -0
- package/assets/skill/templates/visual-review-report.md +33 -0
- package/assets/specs-templates/archive.md +17 -0
- package/assets/specs-templates/change-classification.md +48 -0
- package/assets/specs-templates/change-request.md +15 -0
- package/assets/specs-templates/ci-gates.md +31 -0
- package/assets/specs-templates/contracts.md +37 -0
- package/assets/specs-templates/current-behavior.md +17 -0
- package/assets/specs-templates/design.md +23 -0
- package/assets/specs-templates/monkey-test-report.md +17 -0
- package/assets/specs-templates/project-profile.md +38 -0
- package/assets/specs-templates/proposal.md +17 -0
- package/assets/specs-templates/qa-report.md +26 -0
- package/assets/specs-templates/regression-report.md +21 -0
- package/assets/specs-templates/spec.md +23 -0
- package/assets/specs-templates/stress-soak-report.md +22 -0
- package/assets/specs-templates/tasks.md +43 -0
- package/assets/specs-templates/test-plan.md +31 -0
- package/assets/specs-templates/visual-review-report.md +33 -0
- package/assets/tests-templates/data-boundary/malformed-data.spec.md +14 -0
- package/assets/tests-templates/e2e/critical-journey.spec.md +13 -0
- package/assets/tests-templates/monkey/operation-sequence.spec.md +11 -0
- package/assets/tests-templates/resilience/api-failure.spec.md +12 -0
- package/assets/tests-templates/soak/soak-profile.md +15 -0
- package/assets/tests-templates/stress/load-profile.md +15 -0
- package/bin/cdd.js +2 -0
- package/dist/cli/index.js +336 -0
- package/package.json +48 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: contract-driven-delivery
|
|
3
|
+
description: contract-driven delivery workflow for brownfield full-stack systems. use when handling software requests that require specification-driven development, test-driven development, api/css/env/data/business contracts, ci/cd gates, frontend visual review, e2e/resilience/monkey/stress/soak testing, qa fixback loops, or multi-iteration spec drift control.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Contract-Driven Delivery
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use this skill to turn software requests into traceable, testable, CI/CD-gated changes. This skill is optimized for brownfield internal production systems such as dashboards, reporting apps, workflow tools, and data-heavy full-stack applications.
|
|
11
|
+
|
|
12
|
+
## Workflow decision tree
|
|
13
|
+
|
|
14
|
+
1. Classify the request.
|
|
15
|
+
- Use `references/workflow-router.md`.
|
|
16
|
+
- Create or update `classification.md`.
|
|
17
|
+
2. Scan project context.
|
|
18
|
+
- Use `scripts/detect_project_profile.py` when useful.
|
|
19
|
+
- Capture stack, commands, contracts, tests, and CI/CD.
|
|
20
|
+
3. Select required artifacts.
|
|
21
|
+
- Use templates in `templates/`.
|
|
22
|
+
- Do not force every artifact for tiny changes, but do require `classification.md`, `test-plan.md`, and `ci-gates.md` for implementation changes.
|
|
23
|
+
4. Update contracts before or alongside implementation.
|
|
24
|
+
- API: `references/api-contract-standard.md`
|
|
25
|
+
- CSS/UI: `references/css-contract-standard.md`
|
|
26
|
+
- Env: `references/env-contract-standard.md`
|
|
27
|
+
- Data/report shape: `references/data-contract-standard.md`
|
|
28
|
+
- Business logic: `references/business-logic-standard.md`
|
|
29
|
+
- CI/CD: `references/ci-cd-policy.md`
|
|
30
|
+
5. Apply SDD + TDD discipline.
|
|
31
|
+
- Use `references/sdd-tdd-policy.md`.
|
|
32
|
+
- Tests should be planned before implementation and should fail first when feasible.
|
|
33
|
+
6. Implement through the right role.
|
|
34
|
+
- Backend/frontend work must follow contracts and tests.
|
|
35
|
+
- UI changes require UI/UX and visual review.
|
|
36
|
+
7. Run quality gates.
|
|
37
|
+
- Use `references/qa-gates.md`.
|
|
38
|
+
- CI/CD gate plan is mandatory.
|
|
39
|
+
8. Archive and audit drift.
|
|
40
|
+
- Use `references/spec-drift-policy.md`.
|
|
41
|
+
- Durable learnings must be promoted back to contracts or CLAUDE.md.
|
|
42
|
+
|
|
43
|
+
## Required gates by risk
|
|
44
|
+
|
|
45
|
+
### Low-risk documentation or prompt-only change
|
|
46
|
+
|
|
47
|
+
- classification
|
|
48
|
+
- affected artifact list
|
|
49
|
+
- no implementation gate unless code behavior changes
|
|
50
|
+
|
|
51
|
+
### Normal feature or enhancement
|
|
52
|
+
|
|
53
|
+
- classification
|
|
54
|
+
- current behavior if modifying existing feature
|
|
55
|
+
- proposal/spec/design as needed
|
|
56
|
+
- contracts
|
|
57
|
+
- test-plan
|
|
58
|
+
- ci-gates
|
|
59
|
+
- tasks
|
|
60
|
+
- QA report
|
|
61
|
+
|
|
62
|
+
### UI change
|
|
63
|
+
|
|
64
|
+
- CSS/UI contract review
|
|
65
|
+
- UI/UX review
|
|
66
|
+
- visual review evidence
|
|
67
|
+
- E2E or component interaction coverage
|
|
68
|
+
- accessibility check
|
|
69
|
+
|
|
70
|
+
### API/backend/data/report change
|
|
71
|
+
|
|
72
|
+
- API contract or data-shape contract
|
|
73
|
+
- unit, contract, integration tests
|
|
74
|
+
- route validation and fuzz tests for user-controlled inputs
|
|
75
|
+
- E2E or smoke path when user-visible
|
|
76
|
+
- CI/CD gate update
|
|
77
|
+
|
|
78
|
+
### High-risk production-reality change
|
|
79
|
+
|
|
80
|
+
Required when the change involves report generation, large queries, auto-refresh, cache, queues, workers, DB pools, exports, imports, long-running sessions, or concurrency.
|
|
81
|
+
|
|
82
|
+
- resilience tests
|
|
83
|
+
- data-boundary tests
|
|
84
|
+
- monkey-operation tests
|
|
85
|
+
- stress tests
|
|
86
|
+
- soak tests or scheduled long-run gate
|
|
87
|
+
- telemetry and threshold plan
|
|
88
|
+
|
|
89
|
+
## Output discipline
|
|
90
|
+
|
|
91
|
+
When using this skill, produce concrete artifact content instead of vague recommendations. Include exact files to create/update, exact gates to run, exact commands if detectable, and exact acceptance criteria.
|
|
92
|
+
|
|
93
|
+
## Scripts
|
|
94
|
+
|
|
95
|
+
- `scripts/detect_project_profile.py`: inspect a repository and emit a Markdown project profile.
|
|
96
|
+
- `scripts/generate_change_scaffold.py`: create a change folder from templates.
|
|
97
|
+
- `scripts/validate_contracts.py`: check for required contract files.
|
|
98
|
+
- `scripts/validate_env_contract.py`: check env contract basics.
|
|
99
|
+
- `scripts/validate_ci_gates.py`: check `ci-gates.md` structure.
|
|
100
|
+
- `scripts/validate_spec_traceability.py`: check coarse traceability between spec, tasks, tests, and CI gates.
|
|
101
|
+
|
|
102
|
+
Run scripts with Python 3 from the repository root.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# API Contract Standard
|
|
2
|
+
|
|
3
|
+
## Required API style decision
|
|
4
|
+
|
|
5
|
+
Every repository must define its API response style. Acceptable styles include:
|
|
6
|
+
|
|
7
|
+
- envelope response, for example `{ success, data, error, meta }`
|
|
8
|
+
- direct resource response with standardized error envelope
|
|
9
|
+
- framework-native response with documented exception mapping
|
|
10
|
+
|
|
11
|
+
The style may vary by repo, but it must be explicit.
|
|
12
|
+
|
|
13
|
+
## Required for every endpoint
|
|
14
|
+
|
|
15
|
+
- method and path
|
|
16
|
+
- auth and permission requirement
|
|
17
|
+
- request params/body schema
|
|
18
|
+
- response schema
|
|
19
|
+
- error response format
|
|
20
|
+
- status codes
|
|
21
|
+
- pagination/sorting/filtering behavior
|
|
22
|
+
- date/time format and timezone
|
|
23
|
+
- null and empty behavior
|
|
24
|
+
- compatibility notes
|
|
25
|
+
- frontend client/type impact
|
|
26
|
+
- test coverage
|
|
27
|
+
|
|
28
|
+
## Endpoint inventory
|
|
29
|
+
|
|
30
|
+
Repos should maintain an endpoint inventory. Any endpoint added, removed, renamed, moved, or exempted must update the inventory in the same change.
|
|
31
|
+
|
|
32
|
+
## Breaking changes
|
|
33
|
+
|
|
34
|
+
Breaking changes include:
|
|
35
|
+
|
|
36
|
+
- field removal or rename
|
|
37
|
+
- type change
|
|
38
|
+
- enum value change
|
|
39
|
+
- status code behavior change
|
|
40
|
+
- pagination behavior change
|
|
41
|
+
- error format change
|
|
42
|
+
- auth/permission change
|
|
43
|
+
- timing semantics change that clients depend on
|
|
44
|
+
|
|
45
|
+
Every breaking change requires migration/compatibility plan and explicit QA sign-off.
|
|
46
|
+
|
|
47
|
+
## API tests
|
|
48
|
+
|
|
49
|
+
Minimum API change coverage:
|
|
50
|
+
|
|
51
|
+
- contract test for response/error format
|
|
52
|
+
- validation test for invalid input
|
|
53
|
+
- compatibility test for existing clients when relevant
|
|
54
|
+
- malicious/fuzz payload test for user-controlled inputs
|
|
55
|
+
- smoke/E2E path if user-visible
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Business Logic Standard
|
|
2
|
+
|
|
3
|
+
Business logic changes must be explicit, example-driven, and regression-tested.
|
|
4
|
+
|
|
5
|
+
## Required sections
|
|
6
|
+
|
|
7
|
+
- current rule
|
|
8
|
+
- problem with current rule
|
|
9
|
+
- new rule
|
|
10
|
+
- decision table
|
|
11
|
+
- examples
|
|
12
|
+
- edge cases
|
|
13
|
+
- backward compatibility
|
|
14
|
+
- data migration impact
|
|
15
|
+
- audit/logging impact
|
|
16
|
+
- permission impact
|
|
17
|
+
- reporting/export impact
|
|
18
|
+
- regression tests
|
|
19
|
+
|
|
20
|
+
## Decision table template
|
|
21
|
+
|
|
22
|
+
| condition | old behavior | new behavior | expected output | test id |
|
|
23
|
+
|---|---|---|---|---|
|
|
24
|
+
|
|
25
|
+
## Example matrix template
|
|
26
|
+
|
|
27
|
+
| input | old output | new output | reason |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
|
|
30
|
+
## Guardrail
|
|
31
|
+
|
|
32
|
+
If a developer cannot describe the rule in a decision table, implementation is premature.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# CI/CD Policy
|
|
2
|
+
|
|
3
|
+
CI/CD is a required delivery artifact.
|
|
4
|
+
|
|
5
|
+
## Gate tiers
|
|
6
|
+
|
|
7
|
+
| tier | name | purpose | default merge behavior |
|
|
8
|
+
|---:|---|---|---|
|
|
9
|
+
| 0 | local fast gate | quick feedback before commit/PR | local only |
|
|
10
|
+
| 1 | PR required gate | block unsafe merges | required |
|
|
11
|
+
| 2 | PR informational gate | collect signal before promotion | non-blocking |
|
|
12
|
+
| 3 | nightly real-infra gate | detect real infrastructure failures | non-blocking unless stable |
|
|
13
|
+
| 4 | weekly soak/stress gate | detect long-run/load issues | scheduled/manual |
|
|
14
|
+
| 5 | manual production-like gate | high-risk release confidence | manual approval |
|
|
15
|
+
|
|
16
|
+
## Required for every change
|
|
17
|
+
|
|
18
|
+
`ci-gates.md` must state:
|
|
19
|
+
|
|
20
|
+
- which gates apply
|
|
21
|
+
- which are required
|
|
22
|
+
- which are informational
|
|
23
|
+
- workflow or command name
|
|
24
|
+
- expected artifact/log location
|
|
25
|
+
- promotion criteria for new gates
|
|
26
|
+
- rollback path if gate fails after merge
|
|
27
|
+
|
|
28
|
+
## Promotion policy
|
|
29
|
+
|
|
30
|
+
New expensive or flaky gates should start as informational. Promote to required only after a stability window, for example 20 days or 60 runs with acceptable pass rate and known failure triage.
|
|
31
|
+
|
|
32
|
+
## CI truthfulness rule
|
|
33
|
+
|
|
34
|
+
CI green only proves the exact configured gates passed. Do not claim coverage that the pipeline did not execute.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# CSS/UI Contract Standard
|
|
2
|
+
|
|
3
|
+
## Principles
|
|
4
|
+
|
|
5
|
+
- Tokens are the source of visual truth.
|
|
6
|
+
- Shared components define allowed variants and states.
|
|
7
|
+
- One-off visual hacks must be justified or avoided.
|
|
8
|
+
- UI changes require visual evidence.
|
|
9
|
+
|
|
10
|
+
## Required definitions
|
|
11
|
+
|
|
12
|
+
- token source of truth
|
|
13
|
+
- component variants
|
|
14
|
+
- component sizes
|
|
15
|
+
- component states: default, hover, focus, active, disabled, loading, error, empty
|
|
16
|
+
- responsive behavior
|
|
17
|
+
- accessibility requirements
|
|
18
|
+
- allowed overrides
|
|
19
|
+
- forbidden overrides
|
|
20
|
+
|
|
21
|
+
## Forbidden by default
|
|
22
|
+
|
|
23
|
+
- hard-coded colors when token system exists
|
|
24
|
+
- arbitrary spacing when scale exists
|
|
25
|
+
- global style leakage
|
|
26
|
+
- overriding shared component internals from feature CSS
|
|
27
|
+
- unreviewed z-index additions
|
|
28
|
+
- UI states without loading/error/empty handling
|
|
29
|
+
- browser dialogs when design system dialog/toast exists
|
|
30
|
+
|
|
31
|
+
## Visual review requirements
|
|
32
|
+
|
|
33
|
+
For UI output changes, check:
|
|
34
|
+
|
|
35
|
+
- desktop, tablet, mobile viewports
|
|
36
|
+
- long text and empty data
|
|
37
|
+
- loading and error states
|
|
38
|
+
- keyboard focus and tab order
|
|
39
|
+
- modal/dropdown/tooltip overflow
|
|
40
|
+
- visual diff or screenshot evidence
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Data Shape Contract Standard
|
|
2
|
+
|
|
3
|
+
Use this standard for reports, dashboards, exports, imports, tables, charts, and any feature that transforms tabular or semi-structured data.
|
|
4
|
+
|
|
5
|
+
## Required definitions
|
|
6
|
+
|
|
7
|
+
- required columns
|
|
8
|
+
- optional columns
|
|
9
|
+
- column types
|
|
10
|
+
- nullability
|
|
11
|
+
- allowed values
|
|
12
|
+
- timezone and date format
|
|
13
|
+
- numeric precision and rounding
|
|
14
|
+
- row limits
|
|
15
|
+
- pagination or truncation behavior
|
|
16
|
+
- empty dataset behavior
|
|
17
|
+
- malformed data behavior
|
|
18
|
+
- export format and encoding
|
|
19
|
+
- backward compatibility rules
|
|
20
|
+
|
|
21
|
+
## Invalid data behavior
|
|
22
|
+
|
|
23
|
+
| condition | required decision |
|
|
24
|
+
|---|---|
|
|
25
|
+
| missing required column | reject or default with warning |
|
|
26
|
+
| wrong type | reject, coerce, or mark invalid |
|
|
27
|
+
| duplicate key | deterministic merge or explicit error |
|
|
28
|
+
| empty dataset | safe empty state, not 500 |
|
|
29
|
+
| over row limit | truncate with metadata or reject |
|
|
30
|
+
| unexpected enum | display fallback or reject |
|
|
31
|
+
| malformed date | validation error with user-friendly message |
|
|
32
|
+
|
|
33
|
+
## Required tests
|
|
34
|
+
|
|
35
|
+
- valid representative dataset
|
|
36
|
+
- empty dataset
|
|
37
|
+
- large dataset
|
|
38
|
+
- missing column
|
|
39
|
+
- wrong type
|
|
40
|
+
- null values
|
|
41
|
+
- unexpected enum
|
|
42
|
+
- malicious strings
|
|
43
|
+
- export boundary if export exists
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# E2E and Resilience Standard
|
|
2
|
+
|
|
3
|
+
E2E tests prove user-visible workflows. Resilience tests prove safe behavior under failure.
|
|
4
|
+
|
|
5
|
+
## Critical journey E2E
|
|
6
|
+
|
|
7
|
+
Cover at least:
|
|
8
|
+
|
|
9
|
+
- page load
|
|
10
|
+
- primary task completion
|
|
11
|
+
- validation errors
|
|
12
|
+
- empty data
|
|
13
|
+
- reload and URL state restoration
|
|
14
|
+
- browser back/forward
|
|
15
|
+
- permission or session error when applicable
|
|
16
|
+
|
|
17
|
+
## Resilience coverage
|
|
18
|
+
|
|
19
|
+
Cover as applicable:
|
|
20
|
+
|
|
21
|
+
- API 500/503
|
|
22
|
+
- timeout
|
|
23
|
+
- aborted request
|
|
24
|
+
- slow network
|
|
25
|
+
- stale cache/snapshot
|
|
26
|
+
- Redis/cache disabled
|
|
27
|
+
- worker/job pending/running/failed
|
|
28
|
+
- double submit prevention
|
|
29
|
+
- repeated filter changes
|
|
30
|
+
|
|
31
|
+
## Evidence
|
|
32
|
+
|
|
33
|
+
E2E changes should record commands, test files, screenshots/videos/traces when available, and CI gate placement.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Env Contract Standard
|
|
2
|
+
|
|
3
|
+
## Required fields for every env var
|
|
4
|
+
|
|
5
|
+
| field | description |
|
|
6
|
+
|---|---|
|
|
7
|
+
| name | exact variable name |
|
|
8
|
+
| scope | frontend, backend, build, runtime, test, deploy |
|
|
9
|
+
| environments | local, dev, staging, production, CI |
|
|
10
|
+
| required | yes/no |
|
|
11
|
+
| secret | yes/no |
|
|
12
|
+
| default | safe default or none |
|
|
13
|
+
| example | non-secret example |
|
|
14
|
+
| owner | responsible area |
|
|
15
|
+
| validation | type/range/allowed values |
|
|
16
|
+
| restart required | yes/no |
|
|
17
|
+
| failure behavior | what happens if missing/invalid |
|
|
18
|
+
|
|
19
|
+
## Public frontend env rule
|
|
20
|
+
|
|
21
|
+
Variables with prefixes such as `VITE_`, `NEXT_PUBLIC_`, `PUBLIC_`, or similar are browser-exposed and must never contain secrets.
|
|
22
|
+
|
|
23
|
+
## Required updates for env changes
|
|
24
|
+
|
|
25
|
+
- env contract
|
|
26
|
+
- `.env.example`
|
|
27
|
+
- runtime validation/config loader
|
|
28
|
+
- deployment docs or workflow secrets
|
|
29
|
+
- tests for missing/invalid values when high-risk
|
|
30
|
+
- rollback/default behavior
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Monkey Operation Standard
|
|
2
|
+
|
|
3
|
+
Monkey testing must be structured, not random noise. The goal is to prevent and detect real production misuse.
|
|
4
|
+
|
|
5
|
+
## Preventive spec checklist
|
|
6
|
+
|
|
7
|
+
Every user-facing feature should define behavior for:
|
|
8
|
+
|
|
9
|
+
- double click / repeated submit
|
|
10
|
+
- rapid filter changes
|
|
11
|
+
- invalid date range
|
|
12
|
+
- missing required field
|
|
13
|
+
- very long input
|
|
14
|
+
- Unicode and special characters
|
|
15
|
+
- SQL-like/script-like strings
|
|
16
|
+
- hidden tab / visibility change
|
|
17
|
+
- browser back/forward
|
|
18
|
+
- stale session
|
|
19
|
+
- wrong data shape
|
|
20
|
+
- network abort
|
|
21
|
+
|
|
22
|
+
## Test approaches
|
|
23
|
+
|
|
24
|
+
- Playwright action sequences
|
|
25
|
+
- route fuzz payloads
|
|
26
|
+
- property-based tests
|
|
27
|
+
- malformed fixture datasets
|
|
28
|
+
- randomized but bounded user operations
|
|
29
|
+
|
|
30
|
+
## Assertion rule
|
|
31
|
+
|
|
32
|
+
A monkey test must assert a safe outcome: validation message, disabled action, stable URL state, retained last snapshot, no duplicate job, no 500, or recoverable error state.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# QA Gates
|
|
2
|
+
|
|
3
|
+
## Gate families
|
|
4
|
+
|
|
5
|
+
- lint
|
|
6
|
+
- typecheck
|
|
7
|
+
- build
|
|
8
|
+
- unit
|
|
9
|
+
- contract
|
|
10
|
+
- integration
|
|
11
|
+
- E2E
|
|
12
|
+
- visual
|
|
13
|
+
- data-boundary
|
|
14
|
+
- resilience
|
|
15
|
+
- monkey/fuzz
|
|
16
|
+
- stress
|
|
17
|
+
- soak
|
|
18
|
+
- security where applicable
|
|
19
|
+
- deployment smoke
|
|
20
|
+
|
|
21
|
+
## QA rule
|
|
22
|
+
|
|
23
|
+
QA approval requires evidence. Evidence may be command output, CI links, logs, screenshots, videos, traces, metrics, or artifact files.
|
|
24
|
+
|
|
25
|
+
## Fixback rule
|
|
26
|
+
|
|
27
|
+
Failures must be routed to the correct owner:
|
|
28
|
+
|
|
29
|
+
- contract mismatch -> contract reviewer + implementing engineer
|
|
30
|
+
- backend/API failure -> backend engineer
|
|
31
|
+
- frontend/UI failure -> frontend engineer
|
|
32
|
+
- visual failure -> visual reviewer + frontend engineer
|
|
33
|
+
- UX failure -> UI/UX reviewer + frontend engineer
|
|
34
|
+
- CI/CD failure -> CI/CD gatekeeper
|
|
35
|
+
- stress/soak failure -> stress-soak engineer
|
|
36
|
+
- monkey/data-boundary failure -> monkey or E2E/resilience engineer
|
|
37
|
+
- unclear systemic issue -> spec architect
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# SDD + TDD Policy
|
|
2
|
+
|
|
3
|
+
## SDD policy
|
|
4
|
+
|
|
5
|
+
Specifications are the source of intent. Code serves the specification, not the other way around.
|
|
6
|
+
|
|
7
|
+
A good spec must include:
|
|
8
|
+
|
|
9
|
+
- user/business intent
|
|
10
|
+
- in-scope and out-of-scope boundaries
|
|
11
|
+
- acceptance criteria
|
|
12
|
+
- edge cases
|
|
13
|
+
- non-functional requirements
|
|
14
|
+
- compatibility constraints
|
|
15
|
+
- observable success signals
|
|
16
|
+
|
|
17
|
+
For existing systems, never write a future spec without documenting current behavior when the change modifies existing behavior.
|
|
18
|
+
|
|
19
|
+
## TDD policy
|
|
20
|
+
|
|
21
|
+
Tests define expected behavior before or alongside implementation.
|
|
22
|
+
|
|
23
|
+
Preferred order:
|
|
24
|
+
|
|
25
|
+
1. write or update spec
|
|
26
|
+
2. write or update contracts
|
|
27
|
+
3. write test plan
|
|
28
|
+
4. write failing tests when feasible
|
|
29
|
+
5. implement minimal production code
|
|
30
|
+
6. run local gate
|
|
31
|
+
7. run CI/CD gate
|
|
32
|
+
8. archive learning
|
|
33
|
+
|
|
34
|
+
## Test-first exceptions
|
|
35
|
+
|
|
36
|
+
Test-first can be softened for exploratory spikes, but spikes must not be merged as production work until tests, contracts, and CI gates exist.
|
|
37
|
+
|
|
38
|
+
## Production-reality TDD
|
|
39
|
+
|
|
40
|
+
For dashboards, reports, long-running jobs, auto-refresh, and data-heavy views, TDD includes:
|
|
41
|
+
|
|
42
|
+
- malformed input
|
|
43
|
+
- wrong columns and wrong types
|
|
44
|
+
- empty data
|
|
45
|
+
- large data
|
|
46
|
+
- partial data
|
|
47
|
+
- slow network
|
|
48
|
+
- aborted requests
|
|
49
|
+
- double submit
|
|
50
|
+
- repeated clicks
|
|
51
|
+
- back/forward navigation
|
|
52
|
+
- cache stale/miss behavior
|
|
53
|
+
- long-run memory and pool stability
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Spec Drift Policy
|
|
2
|
+
|
|
3
|
+
Spec drift happens when requirements, contracts, tests, CI gates, and code evolve at different speeds.
|
|
4
|
+
|
|
5
|
+
## Audit triggers
|
|
6
|
+
|
|
7
|
+
Run a drift audit when:
|
|
8
|
+
|
|
9
|
+
- a feature had multiple iterations
|
|
10
|
+
- production behavior differs from archived spec
|
|
11
|
+
- tests were added after implementation
|
|
12
|
+
- CI gates were changed
|
|
13
|
+
- a bug fix updates behavior but not spec
|
|
14
|
+
- a contract changed without client/test update
|
|
15
|
+
- tasks are marked complete but evidence is unclear
|
|
16
|
+
|
|
17
|
+
## Audit checks
|
|
18
|
+
|
|
19
|
+
- spec acceptance criteria map to tests
|
|
20
|
+
- contracts map to implementation and tests
|
|
21
|
+
- CI gates run relevant tests
|
|
22
|
+
- tasks marked complete have code/test evidence
|
|
23
|
+
- archive promotes durable learnings
|
|
24
|
+
- deprecated behavior is removed or documented
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
Use `templates/regression-report.md` or create `spec-drift-audit.md` when the audit is standalone.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Stress and Soak Standard
|
|
2
|
+
|
|
3
|
+
Use stress and soak tests for high-load, long-running, cache-heavy, queue-heavy, report, dashboard, export, import, and auto-refresh behavior.
|
|
4
|
+
|
|
5
|
+
## Stress test
|
|
6
|
+
|
|
7
|
+
Stress tests answer: what happens under high concurrency or high data volume?
|
|
8
|
+
|
|
9
|
+
Define:
|
|
10
|
+
|
|
11
|
+
- concurrent users or requests
|
|
12
|
+
- request mix
|
|
13
|
+
- data size
|
|
14
|
+
- ramp-up and duration
|
|
15
|
+
- success criteria
|
|
16
|
+
- error budget
|
|
17
|
+
- system metrics
|
|
18
|
+
|
|
19
|
+
## Soak test
|
|
20
|
+
|
|
21
|
+
Soak tests answer: what happens after sustained operation?
|
|
22
|
+
|
|
23
|
+
Define:
|
|
24
|
+
|
|
25
|
+
- duration
|
|
26
|
+
- refresh interval
|
|
27
|
+
- cache TTL expectations
|
|
28
|
+
- DB/worker/cache pool stability
|
|
29
|
+
- RSS/memory trend
|
|
30
|
+
- queue backlog trend
|
|
31
|
+
- temp file growth
|
|
32
|
+
- circuit breaker transitions
|
|
33
|
+
- artifacts retained
|
|
34
|
+
|
|
35
|
+
## Required outputs
|
|
36
|
+
|
|
37
|
+
- workload model
|
|
38
|
+
- thresholds
|
|
39
|
+
- commands/workflows
|
|
40
|
+
- raw logs or metrics
|
|
41
|
+
- pass/fail conclusion
|
|
42
|
+
- follow-up issues for degraded but non-blocking findings
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Visual Review Standard
|
|
2
|
+
|
|
3
|
+
Visual review is required when frontend output changes.
|
|
4
|
+
|
|
5
|
+
## Required dimensions
|
|
6
|
+
|
|
7
|
+
- affected pages/screens
|
|
8
|
+
- changed components
|
|
9
|
+
- desktop, tablet, and mobile viewports
|
|
10
|
+
- default, loading, empty, error, disabled, focus, hover, long text, no permission states
|
|
11
|
+
- modal, drawer, dropdown, tooltip overflow behavior
|
|
12
|
+
- table overflow and column width behavior
|
|
13
|
+
- dark mode or theme behavior when applicable
|
|
14
|
+
- accessibility: focus, keyboard, labels, contrast
|
|
15
|
+
|
|
16
|
+
## Evidence levels
|
|
17
|
+
|
|
18
|
+
| level | evidence |
|
|
19
|
+
|---|---|
|
|
20
|
+
| basic | manual checklist with viewports and states |
|
|
21
|
+
| standard | screenshots before/after or after-only for new UI |
|
|
22
|
+
| strong | visual regression diff with accepted changes |
|
|
23
|
+
| high-risk | video/trace plus visual diff and UX review |
|
|
24
|
+
|
|
25
|
+
## Review output
|
|
26
|
+
|
|
27
|
+
Use `templates/visual-review-report.md`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Workflow Router
|
|
2
|
+
|
|
3
|
+
## Change classification
|
|
4
|
+
|
|
5
|
+
Classify every request before implementation. A request may have more than one type.
|
|
6
|
+
|
|
7
|
+
| Change type | Required path |
|
|
8
|
+
|---|---|
|
|
9
|
+
| new-feature | proposal, spec, design, contracts, test-plan, ci-gates, tasks |
|
|
10
|
+
| feature-enhancement | current-behavior, diff spec, regression scope, contracts, test-plan, ci-gates |
|
|
11
|
+
| business-logic-change | current rule, new rule, decision table, examples, edge cases, regression tests |
|
|
12
|
+
| bug-fix | reproduction, root cause, failing test, fix, regression test, QA evidence |
|
|
13
|
+
| regression-fix | broken prior behavior, regression source, failing test, rollback or forward fix |
|
|
14
|
+
| ui-only-change | CSS/UI contract, UI/UX review, visual review, E2E/interaction coverage |
|
|
15
|
+
| api-only-change | API contract, endpoint inventory, client/type impact, contract tests |
|
|
16
|
+
| env-change | env contract, `.env.example`, deployment impact, secret/public scope review |
|
|
17
|
+
| data-contract-change | column/type/nullability contract, malformed data behavior, data-boundary tests |
|
|
18
|
+
| performance-change | baseline, target, load profile, stress/soak plan, telemetry thresholds |
|
|
19
|
+
| refactor | no behavior change proof, regression tests, architecture note |
|
|
20
|
+
| ci-cd-change | pipeline contract, required check impact, rollback policy |
|
|
21
|
+
| test-hardening-change | target risk, new test signal, mutation check, CI gate placement |
|
|
22
|
+
|
|
23
|
+
## Artifact rule
|
|
24
|
+
|
|
25
|
+
Do not create heavyweight artifacts when a tiny change does not need them. However, any implementation change must record:
|
|
26
|
+
|
|
27
|
+
- what kind of change it is
|
|
28
|
+
- which contracts are affected
|
|
29
|
+
- which tests prove it
|
|
30
|
+
- which CI/CD gates must run
|
|
31
|
+
|
|
32
|
+
## Iteration rule
|
|
33
|
+
|
|
34
|
+
Update an existing change when intent is the same and scope overlap remains high. Start a new change when intent changes, scope explodes, or the original work can be completed independently.
|