create-harness-vibe-coding 0.6.3 → 0.6.5
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/package.json +1 -1
- package/src/generator.js +466 -466
- package/src/index.js +355 -355
- package/templates/common/.claude/agents/architect.md +31 -35
- package/templates/common/.claude/agents/context-master.md +0 -1
- package/templates/common/.claude/agents/debugger.md +0 -1
- package/templates/common/.claude/agents/docs-researcher.md +41 -43
- package/templates/common/.claude/agents/implementer.md +0 -1
- package/templates/common/.claude/agents/memory-master.md +0 -1
- package/templates/common/.claude/agents/planner.md +0 -1
- package/templates/common/.claude/agents/researcher.md +0 -1
- package/templates/common/.claude/agents/reviewer.md +34 -35
- package/templates/common/.claude/agents/test-writer.md +0 -1
- package/templates/common/.claude/agents/verifier.md +0 -1
- package/templates/common/.claude/commands/wf-max.md +7 -0
- package/templates/common/.claude/commands/{update.md → wf-update.md} +4 -0
- package/templates/common/.claude/commands/wf.md +10 -3
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +2 -1
- package/templates/common/.claude/skills/wf-max/SKILL.md +29 -70
- package/templates/common/.claude/skills/{readme-optimizer → wf-readme}/SKILL.md +1 -1
- package/templates/common/.claude/skills/wf-review/SKILL.md +50 -50
- package/templates/common/.claude/skills/wf-update/SKILL.md +58 -58
- package/templates/common/CLAUDE.md +77 -76
- package/templates/common/MEMORY.md +73 -76
- package/templates/common/README.md +1 -1
- package/templates/common/SETUP.md +273 -341
- package/templates/common/docs/README.md +131 -145
- package/templates/common/docs/harness/WF.md +13 -1
- package/templates/common/docs/harness/agent-workflow.md +94 -94
- package/templates/common/docs/harness/architecture.md +1 -1
- package/templates/common/docs/harness/context-loading.md +104 -108
- package/templates/common/docs/harness/extension.md +70 -79
- package/templates/common/docs/harness/lifecycle.md +33 -33
- package/templates/common/docs/harness/subagents.md +1 -1
- package/templates/common/docs/research/PRD.md +65 -65
- package/templates/common/docs/research/README.md +169 -169
- package/templates/common/scripts/validate-harness.mjs +439 -460
- package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +42 -42
- package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +30 -0
- package/templates/optional/skills/browser-e2e/docs/workflows/browser-e2e.md +1 -1
- package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +40 -40
- package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +40 -40
- package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +43 -43
- package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +40 -40
- package/templates/common/.claude/skills/harness-build-loop/SKILL.md +0 -23
- package/templates/common/.claude/skills/harness-context/SKILL.md +0 -26
- package/templates/common/.claude/skills/harness-lifecycle/SKILL.md +0 -20
- package/templates/common/.claude/skills/harness-research/SKILL.md +0 -30
- package/templates/common/.claude/skills/harness-router/SKILL.md +0 -16
- package/templates/common/.claude/skills/wf-mode/SKILL.md +0 -55
- package/templates/common/docs/domain/ports.md +0 -76
- package/templates/common/docs/features/_template.md +0 -177
- package/templates/common/docs/harness/PLAN.md +0 -52
- package/templates/common/docs/harness/data-flow.md +0 -59
- package/templates/common/docs/harness/state-machines.md +0 -58
- /package/templates/common/.claude/commands/{learn.md → wf-learn.md} +0 -0
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Port Contracts — {{projectName}}
|
|
2
|
-
|
|
3
|
-
> **Responsibility**: Define cross-layer interface contracts. These are the "legal contracts" of a layered architecture. Each port documents not only its signature, but also preconditions, postconditions, and error semantics.
|
|
4
|
-
>
|
|
5
|
-
> **Principle**: Port documentation != API reference documentation. It is a contract that specifies caller obligations and implementer guarantees.
|
|
6
|
-
>
|
|
7
|
-
> Philosophical origins: Bertrand Meyer's Design by Contract (Eiffel) + Alistair Cockburn's hexagonal architecture port documentation.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## 1. Port Classification
|
|
12
|
-
|
|
13
|
-
Create a port only for a real boundary: external service, storage, SDK, process, browser/API boundary, permission boundary, or cross-layer dependency. Do not create a port only because an interface might be useful someday.
|
|
14
|
-
|
|
15
|
-
### 1.1 Driving Ports (Inbound — external calls application)
|
|
16
|
-
|
|
17
|
-
| Port | Definition Location | Purpose |
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| `{{INBOUND_PORT_1}}` | `{{LOCATION}}` | {{DESCRIPTION}} |
|
|
20
|
-
|
|
21
|
-
### 1.2 Driven Ports (Outbound — application calls external)
|
|
22
|
-
|
|
23
|
-
| Port | Definition Location | Purpose |
|
|
24
|
-
| --- | --- | --- |
|
|
25
|
-
| `{{OUTBOUND_PORT_1}}` | `{{LOCATION}}` | {{DESCRIPTION}} |
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## 2. Port Definition Template
|
|
30
|
-
|
|
31
|
-
Fill in each port using the format below:
|
|
32
|
-
|
|
33
|
-
- **Category**: Driving / Driven
|
|
34
|
-
- **Definition Location**: `{{FILE_PATH}}`
|
|
35
|
-
- **Contract Class**: `{{CLASS_OR_INTERFACE}}`
|
|
36
|
-
|
|
37
|
-
### Purpose
|
|
38
|
-
|
|
39
|
-
{{WHAT_THIS_PORT_DOES}}
|
|
40
|
-
|
|
41
|
-
### Methods
|
|
42
|
-
|
|
43
|
-
**Preconditions** (caller must guarantee):
|
|
44
|
-
- {{PRECONDITION_1}}
|
|
45
|
-
- {{PRECONDITION_2}}
|
|
46
|
-
|
|
47
|
-
**Postconditions** (implementer guarantees):
|
|
48
|
-
- {{POSTCONDITION_1}}
|
|
49
|
-
- {{POSTCONDITION_2}}
|
|
50
|
-
|
|
51
|
-
**Error Semantics**:
|
|
52
|
-
|
|
53
|
-
| Exception Type | Trigger Condition | Caller Should |
|
|
54
|
-
| --- | --- | --- |
|
|
55
|
-
| `{{EXCEPTION_TYPE}}` | {{CONDITION}} | {{CALLER_ACTION}} |
|
|
56
|
-
|
|
57
|
-
**Idempotency**: {{YES_NO_AND_DETAILS}}
|
|
58
|
-
|
|
59
|
-
### Known Implementations
|
|
60
|
-
|
|
61
|
-
| Adapter | Location | Purpose |
|
|
62
|
-
| --- | --- | --- |
|
|
63
|
-
| `{{ADAPTER_NAME}}` | `{{LOCATION}}` | {{PURPOSE}} |
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## 3. Cross-Port Invariants
|
|
68
|
-
|
|
69
|
-
- {{INVARIANT_1}}
|
|
70
|
-
- {{INVARIANT_2}}
|
|
71
|
-
- New ports must be defined in `domain/ports`; adapters go in `infrastructure/`.
|
|
72
|
-
- Each port needs one clear owner and at least one real caller. Avoid speculative ports without a concrete adapter or testability need.
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
> **Note**: The current ports.md is a template. Replace `{{...}}` placeholders with your project's domain details. Refer to `Harness/data-flow.md` to understand how ports are orchestrated.
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# {{FEATURE_NAME}}
|
|
2
|
-
|
|
3
|
-
> **When to use**: Every PRD scope item in `Harness/research/PRD.md` Section 2 must have a feature doc — either a new one from this template, or an iteration on an existing one. Do not code a PRD scope item without a corresponding features doc.
|
|
4
|
-
>
|
|
5
|
-
> **New vs iterate**: If the scope item has ≥85% overlap with an existing feature doc, iterate the existing doc (bump `Version`, add a `## Changelog` entry). If overlap is below 85%, create a new file from this template. When in doubt, ask the user.
|
|
6
|
-
|
|
7
|
-
> **Status**: Draft / In Progress / Blocked / Done
|
|
8
|
-
> **Created**: {{YYYY-MM-DD}}
|
|
9
|
-
> **Version**: 1
|
|
10
|
-
> **Owner**: {{OWNER_OR_AGENT}}
|
|
11
|
-
> **Related Docs**: {{PRD_OR_ARCH_DOC_LINKS}}
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 1. Requirements
|
|
16
|
-
|
|
17
|
-
### 1.1 Background
|
|
18
|
-
|
|
19
|
-
{{WHY_THIS_FEATURE_EXISTS}}
|
|
20
|
-
|
|
21
|
-
### 1.2 Goals
|
|
22
|
-
|
|
23
|
-
- {{GOAL_1}}
|
|
24
|
-
- {{GOAL_2}}
|
|
25
|
-
|
|
26
|
-
### 1.3 Non-Goals
|
|
27
|
-
|
|
28
|
-
- {{NON_GOAL_1}}
|
|
29
|
-
- {{NON_GOAL_2}}
|
|
30
|
-
|
|
31
|
-
### 1.4 Acceptance Criteria
|
|
32
|
-
|
|
33
|
-
- [ ] {{ACCEPTANCE_CRITERION_1}}
|
|
34
|
-
- [ ] {{ACCEPTANCE_CRITERION_2}}
|
|
35
|
-
- [ ] {{ACCEPTANCE_CRITERION_3}}
|
|
36
|
-
|
|
37
|
-
### 1.5 Optimistic UI Rollback
|
|
38
|
-
|
|
39
|
-
If any UI mutation happens before an async operation completes (DOM replacement,
|
|
40
|
-
state update, visual feedback), list the rollback path for when the operation fails:
|
|
41
|
-
|
|
42
|
-
| Mutation | Failure Recovery |
|
|
43
|
-
|----------|-----------------|
|
|
44
|
-
| {{MUTATION_1}} | {{ROLLBACK_1}} |
|
|
45
|
-
| Not applicable — no optimistic mutations are used. | |
|
|
46
|
-
|
|
47
|
-
### 1.6 UI Automation Hooks
|
|
48
|
-
|
|
49
|
-
For TS/React or browser workflows, define required stable accessible labels/roles and stable test hooks such as `data-testid` before implementation. These selectors must cover critical UI controls and states so CDP, Playwright, and manual verification can target inputs, buttons, filters, rows, empty/error/loading states, dialogs, navigation, and submitted/saved/error feedback without brittle DOM paths.
|
|
50
|
-
|
|
51
|
-
| Element / State | Accessible Role / Label | `data-testid` | Verification Target |
|
|
52
|
-
| --- | --- | --- | --- |
|
|
53
|
-
| {{INPUT_OR_CONTROL}} | {{ROLE_OR_LABEL}} | {{DATA_TESTID}} | {{PLAYWRIGHT_OR_MANUAL_CHECK}} |
|
|
54
|
-
| {{EMPTY_ERROR_LOADING_OR_ROW_STATE}} | {{ROLE_OR_LABEL}} | {{DATA_TESTID}} | {{PLAYWRIGHT_OR_MANUAL_CHECK}} |
|
|
55
|
-
| Not UI-facing | N/A | N/A | N/A |
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## 2. Design
|
|
60
|
-
|
|
61
|
-
### 2.1 Impact Scope
|
|
62
|
-
|
|
63
|
-
| Area | Impacted? | Notes |
|
|
64
|
-
| --- | --- | --- |
|
|
65
|
-
| `Harness/architecture.md` | {{YES_NO}} | {{NOTE}} |
|
|
66
|
-
| `Harness/domain/ports.md` | {{YES_NO}} | {{NOTE}} |
|
|
67
|
-
| `Harness/data-flow.md` | {{YES_NO}} | {{NOTE}} |
|
|
68
|
-
| `Harness/state-machines.md` | {{YES_NO}} | {{NOTE}} |
|
|
69
|
-
| tests | {{YES_NO}} | {{NOTE}} |
|
|
70
|
-
|
|
71
|
-
### 2.2 Allowed Write Set
|
|
72
|
-
|
|
73
|
-
- `{{PATH_OR_GLOB_1}}`
|
|
74
|
-
- `{{PATH_OR_GLOB_2}}`
|
|
75
|
-
|
|
76
|
-
### 2.3 Forbidden Scope
|
|
77
|
-
|
|
78
|
-
- `{{PATH_OR_BEHAVIOR_1}}`
|
|
79
|
-
- `{{PATH_OR_BEHAVIOR_2}}`
|
|
80
|
-
|
|
81
|
-
### 2.4 Approach
|
|
82
|
-
|
|
83
|
-
#### Candidate Approaches
|
|
84
|
-
|
|
85
|
-
| Approach | Pros | Cons | Decision |
|
|
86
|
-
| --- | --- | --- | --- |
|
|
87
|
-
| {{OPTION_A}} | {{PROS_A}} | {{CONS_A}} | {{ACCEPT_REJECT}} |
|
|
88
|
-
| {{OPTION_B}} | {{PROS_B}} | {{CONS_B}} | {{ACCEPT_REJECT}} |
|
|
89
|
-
|
|
90
|
-
#### Rationale
|
|
91
|
-
|
|
92
|
-
{{SELECTED_DESIGN_AND_RATIONALE}}
|
|
93
|
-
|
|
94
|
-
### 2.5 Edge Cases
|
|
95
|
-
|
|
96
|
-
- {{EDGE_CASE_1}} -> {{EXPECTED_BEHAVIOR_1}}
|
|
97
|
-
- {{EDGE_CASE_2}} -> {{EXPECTED_BEHAVIOR_2}}
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## 3. Tasks
|
|
102
|
-
|
|
103
|
-
> Every task must have a verification method. When a subagent is needed, define its role and write set first.
|
|
104
|
-
|
|
105
|
-
| # | Task | Owner | Write Set | Verify |
|
|
106
|
-
| --- | --- | --- | --- | --- |
|
|
107
|
-
| 1 | {{WRITE_FAILING_TEST_OR_DOC_CHECK}} | {{OWNER}} | `{{PATH}}` | `{{COMMAND_OR_CHECK}}` |
|
|
108
|
-
| 2 | {{IMPLEMENT_MINIMAL_CHANGE}} | {{OWNER}} | `{{PATH}}` | `{{COMMAND_OR_CHECK}}` |
|
|
109
|
-
| 3 | {{SYNC_DOCS_OR_BOUNDARIES}} | {{OWNER}} | `{{PATH}}` | `{{COMMAND_OR_CHECK}}` |
|
|
110
|
-
|
|
111
|
-
### Subagent Plan (required — justify if all No)
|
|
112
|
-
|
|
113
|
-
Estimate the context budget for this feature. If the main agent would need to read >5 files or modify >3 files, subagents are mandatory per `.claude/rules/ecc/common.md`.
|
|
114
|
-
|
|
115
|
-
| Agent / Pass | Required? | Mode | Read Boundary | Write Set | Verify |
|
|
116
|
-
| --- | --- | --- | --- | --- | --- |
|
|
117
|
-
| Planner | {{YES_NO}} | Parallel Read | `{{SCOPE}}` | none | `{{CHECK}}` |
|
|
118
|
-
| Researcher / Docs Researcher | {{YES_NO}} | Parallel Read | `{{SCOPE}}` | none | `{{CHECK}}` |
|
|
119
|
-
| Architect | {{YES_NO}} | Parallel Read | `{{SCOPE}}` | none | `{{CHECK}}` |
|
|
120
|
-
| Explorer Pass | {{YES_NO}} | Parallel Read | `{{SCOPE}}` | none | `{{CHECK}}` |
|
|
121
|
-
| Test Writer | {{YES_NO}} | Serial Write | `{{SCOPE}}` | `{{PATH}}` | `{{COMMAND}}` |
|
|
122
|
-
| Implementer / Debugger | {{YES_NO}} | Serial Write | `{{SCOPE}}` | `{{PATH}}` | `{{COMMAND}}` |
|
|
123
|
-
| Reviewer | {{YES_NO}} | Parallel Read | `{{SCOPE}}` | none | `{{CHECK}}` |
|
|
124
|
-
| Verifier | {{YES_NO}} | Parallel Read | `{{SCOPE}}` | none | `{{COMMANDS}}` |
|
|
125
|
-
|
|
126
|
-
**If all roles are No, justify:** {{WHY_MAIN_AGENT_CAN_HANDLE_ALONE}}
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## 4. Verification
|
|
131
|
-
|
|
132
|
-
### 4.1 Test Results
|
|
133
|
-
|
|
134
|
-
| Command | Result | Notes |
|
|
135
|
-
| --- | --- | --- |
|
|
136
|
-
| `{{TEST_COMMAND}}` | {{PASS_FAIL_NOT_RUN}} | {{NOTES}} |
|
|
137
|
-
| `{{OTHER_COMMAND}}` | {{PASS_FAIL_NOT_RUN}} | {{NOTES}} |
|
|
138
|
-
|
|
139
|
-
### 4.2 Review Findings
|
|
140
|
-
|
|
141
|
-
- {{FINDING_OR_NONE}}
|
|
142
|
-
|
|
143
|
-
### 4.3 Docs Sync
|
|
144
|
-
|
|
145
|
-
- [ ] `Harness/architecture.md`
|
|
146
|
-
- [ ] `Harness/domain/ports.md`
|
|
147
|
-
- [ ] `Harness/data-flow.md`
|
|
148
|
-
- [ ] `Harness/state-machines.md`
|
|
149
|
-
- [ ] `Harness/research/research-results.md`
|
|
150
|
-
- [ ] Not needed because {{REASON}}
|
|
151
|
-
|
|
152
|
-
### 4.4 Decision Log
|
|
153
|
-
|
|
154
|
-
| Date | Decision | Reason |
|
|
155
|
-
| --- | --- | --- |
|
|
156
|
-
| {{YYYY-MM-DD}} | {{DECISION}} | {{REASON}} |
|
|
157
|
-
|
|
158
|
-
### 4.5 Closeout
|
|
159
|
-
|
|
160
|
-
- [ ] Acceptance criteria satisfied.
|
|
161
|
-
- [ ] Tests or manual verification recorded.
|
|
162
|
-
- [ ] Boundary impact documented.
|
|
163
|
-
- [ ] Remaining risks listed or explicitly none.
|
|
164
|
-
- [ ] If docs/code/tests conflicted, Decision Log records how it was resolved.
|
|
165
|
-
|
|
166
|
-
Remaining risks:
|
|
167
|
-
- {{RISK_OR_NONE}}
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## 5. Changelog
|
|
172
|
-
|
|
173
|
-
> Only populate when iterating an existing feature doc (Version ≥ 2).
|
|
174
|
-
|
|
175
|
-
| Version | Date | What Changed | Reason |
|
|
176
|
-
| --- | --- | --- | --- |
|
|
177
|
-
| 1 | {{YYYY-MM-DD}} | Initial version | — |
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# PLAN.md — DEPRECATED
|
|
2
|
-
|
|
3
|
-
Workflow state has moved to task-capsule structure. Do not append new content here.
|
|
4
|
-
|
|
5
|
-
Active state:
|
|
6
|
-
- `Harness/PROGRESS.md` — global task index and cross-task decisions
|
|
7
|
-
- `Harness/tasks/<task-id>/PROGRESS.md` — per-task progress, phase, heartbeat
|
|
8
|
-
- `Harness/tasks/<task-id>/PLAN.md` — per-task implementation plan, verification evidence
|
|
9
|
-
|
|
10
|
-
Templates:
|
|
11
|
-
- `Harness/tasks/_template/` — copy this directory to create a new task
|
|
12
|
-
|
|
13
|
-
## Legacy Content (historical reference only)
|
|
14
|
-
|
|
15
|
-
The sections below are archived from the monolithic PLAN.md era. Active task data has been migrated to `Harness/tasks/`.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
### Historical: Dogfood Bootstrap
|
|
20
|
-
|
|
21
|
-
Goal: Dogfood the generated Harness scaffold inside this repository so future agents use root `Harness/` routing instead of stale `docs/harness/` guidance.
|
|
22
|
-
|
|
23
|
-
**Success Criteria** (all verified):
|
|
24
|
-
- [x] Root `CLAUDE.md` routes through `Harness/MEMORY.md` and `Harness/README.md`
|
|
25
|
-
- [x] Root `MEMORY.md` no longer contains stale `docs/harness/` paths or template placeholders
|
|
26
|
-
- [x] Root `Harness/` and `.claude/` dogfood runtime assets exist
|
|
27
|
-
- [x] Harness strict validation passes
|
|
28
|
-
- [x] Repository tests pass
|
|
29
|
-
|
|
30
|
-
**Decisions:**
|
|
31
|
-
| Date | Decision | Reason |
|
|
32
|
-
|------|----------|--------|
|
|
33
|
-
| 2026-06-24 | Dogfood root `Harness/` while keeping templates under `templates/` | Separate package source from operating harness |
|
|
34
|
-
| 2026-06-24 | memory-master + context-master added to commonAgents | Global memory and context management |
|
|
35
|
-
|
|
36
|
-
### Historical: WF Conflict Fix
|
|
37
|
-
|
|
38
|
-
Goal: Fix WF-mode orphaned files and conflicts: align commands/wf.md, resolve subagent count tension, fix README "may" vs "MUST", add memory-master and context-master agents.
|
|
39
|
-
|
|
40
|
-
**Subagent Dispatch:**
|
|
41
|
-
| Agent | Mode | Purpose | Status |
|
|
42
|
-
|-------|------|---------|--------|
|
|
43
|
-
| Subagent 1 | Serial Write | Create memory-master.md, context-master.md, update commands/wf.md | Verified |
|
|
44
|
-
| Subagent 2 | Serial Write | Fix agent-workflow.md, dispatch.md, README.md conflicts | Verified |
|
|
45
|
-
| Subagent 3 | Serial Write | Update WF.md, wf-mode/SKILL.md, subagents.md, MEMORY.md, context-loading.md, CLAUDE.md, validate-harness.mjs | Verified |
|
|
46
|
-
| Subagent 4 | Serial Write | Sync template changes to dogfood runtime files | Verified |
|
|
47
|
-
|
|
48
|
-
**Verification:**
|
|
49
|
-
| Check | Result | Notes |
|
|
50
|
-
|-------|--------|-------|
|
|
51
|
-
| `node Harness/scripts/validate-harness.mjs --strict` | Pass | all invariants preserved |
|
|
52
|
-
| `npm test` | Pass | 58/58 tests passed |
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Data Flow — {{projectName}}
|
|
2
|
-
|
|
3
|
-
> **Purpose**: Define the complete lifecycle of each event/request — happy path + all failure branches.
|
|
4
|
-
> **This is the most important runtime-flow file in `Harness/`** — what AI most often invents during implementation is failure-path behavior. Write it clearly and it won't.
|
|
5
|
-
>
|
|
6
|
-
> Philosophy source: EventCatalog pattern + arc42 Chapter 6 (Runtime View).
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 1. Event Catalog
|
|
11
|
-
|
|
12
|
-
| Event Type | Producer | Consumer | Payload Key Fields | Delivery Semantics | Ordering Requirements |
|
|
13
|
-
| --- | --- | --- | --- | --- | --- |
|
|
14
|
-
| `{{EVENT_1}}` | `{{PRODUCER}}` | `{{CONSUMERS}}` | `{{KEY_FIELDS}}` | {{SEMANTICS}} | {{ORDERING}} |
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 2. Core Flows
|
|
19
|
-
|
|
20
|
-
### 2.1 Happy Path
|
|
21
|
-
|
|
22
|
-
```mermaid
|
|
23
|
-
sequenceDiagram
|
|
24
|
-
participant Caller
|
|
25
|
-
participant Runner
|
|
26
|
-
participant Bus as EventBus/Audit
|
|
27
|
-
participant Port1 as {{PORT_NAME_1}}
|
|
28
|
-
participant Port2 as {{PORT_NAME_2}}
|
|
29
|
-
|
|
30
|
-
Caller->>Runner: {{ENTRY_POINT}}
|
|
31
|
-
Runner->>Bus: publish {{START_EVENT}}
|
|
32
|
-
Runner->>Port1: {{ACTION_1}}
|
|
33
|
-
Port1-->>Runner: {{RESULT_1}}
|
|
34
|
-
Runner->>Port2: {{ACTION_2}}
|
|
35
|
-
Port2-->>Runner: {{RESULT_2}}
|
|
36
|
-
Runner->>Bus: publish {{END_EVENT}}
|
|
37
|
-
Runner-->>Caller: {{FINAL_RESULT}}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### 2.2 Failure Paths
|
|
41
|
-
|
|
42
|
-
Each failure point must clearly document:
|
|
43
|
-
- **Trigger condition**
|
|
44
|
-
- **System behavior**
|
|
45
|
-
- **Event publishing**
|
|
46
|
-
- **Caller perception**
|
|
47
|
-
- **Recovery method**
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 3. Error Handling Conventions
|
|
52
|
-
|
|
53
|
-
- **Retryable errors**: {{POLICY}}
|
|
54
|
-
- **Non-retryable errors**: {{POLICY}}
|
|
55
|
-
- **Silent ignore**: {{POLICY}}
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
> **Note**: This data-flow.md is currently an empty template. Fill it in according to your project's actual flows. For format reference, see real project examples in the ECC repository.
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# State Machines — {{projectName}}
|
|
2
|
-
|
|
3
|
-
> **Responsibility**: Define the states, transitions, guard conditions, and boundary behaviors for every stateful component. The majority of bugs in long-running harness pipelines originate from illegal state transitions.
|
|
4
|
-
>
|
|
5
|
-
> Philosophical source: UML 2.5.1 Section 15.3.14 + "The transition table is the single most important artifact in the document."
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## State Machine Template
|
|
10
|
-
|
|
11
|
-
Fill out each stateful component using this format:
|
|
12
|
-
|
|
13
|
-
Before defining states, name the state owner and persistence level. State that crosses agent handoff, retry, browser session, API workflow, or release boundary must have explicit transitions; temporary derived state should stay local and should not become a new state machine.
|
|
14
|
-
|
|
15
|
-
### State Ownership
|
|
16
|
-
|
|
17
|
-
| State Slice | Owner | Persistence | Notes |
|
|
18
|
-
| --- | --- | --- | --- |
|
|
19
|
-
| `{{STATE_SLICE}}` | `{{OWNER}}` | durable / runtime / derived / external | {{NOTES}} |
|
|
20
|
-
|
|
21
|
-
### State Enumeration
|
|
22
|
-
|
|
23
|
-
| State | Description | Entry Condition | Exit Condition |
|
|
24
|
-
| --- | --- | --- | --- |
|
|
25
|
-
| `{{STATE_1}}` | {{DESCRIPTION}} | {{CONDITION}} | {{CONDITION}} |
|
|
26
|
-
| `{{STATE_2}}` | {{DESCRIPTION}} | {{CONDITION}} | {{CONDITION}} |
|
|
27
|
-
|
|
28
|
-
### State Transition Diagram
|
|
29
|
-
|
|
30
|
-
```mermaid
|
|
31
|
-
stateDiagram-v2
|
|
32
|
-
[*] --> {{INITIAL_STATE}}
|
|
33
|
-
{{INITIAL_STATE}} --> {{STATE_2}} : {{TRIGGER}}
|
|
34
|
-
{{STATE_2}} --> {{INITIAL_STATE}} : {{TRIGGER}}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Transition Table (Most Important)
|
|
38
|
-
|
|
39
|
-
| Current State ↓ / Event → | `{{EVENT_1}}` | `{{EVENT_2}}` | `{{EVENT_3}}` |
|
|
40
|
-
| --- | --- | --- | --- |
|
|
41
|
-
| **`{{STATE_1}}`** | {{TARGET}} | {{TARGET}} | {{TARGET}} |
|
|
42
|
-
| **`{{STATE_2}}`** | {{TARGET}} | {{TARGET}} | {{TARGET}} |
|
|
43
|
-
|
|
44
|
-
### Guard Conditions
|
|
45
|
-
|
|
46
|
-
| Transition | Guard Condition | Notes |
|
|
47
|
-
| --- | --- | --- |
|
|
48
|
-
| `{{SOURCE}} -> {{TARGET}}` | {{GUARD}} | {{NOTE}} |
|
|
49
|
-
|
|
50
|
-
### Illegal Transitions
|
|
51
|
-
|
|
52
|
-
| Transition | Why Illegal |
|
|
53
|
-
| --- | --- |
|
|
54
|
-
| `{{SOURCE}} -> {{TARGET}}` | {{REASON}} |
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
> **Note**: The current state-machines.md is an empty template. Please fill it in according to the project's actual stateful components.
|
|
File without changes
|