rhachet-roles-ehmpathy 1.8.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/logic/roles/architect/.briefs/criteria.given_when_then.[seed].v3.md +87 -0
  2. package/dist/logic/roles/mechanic/.briefs/architecture/directional-dependencies.md +49 -40
  3. package/dist/logic/roles/mechanic/.briefs/criteria.practices/require.knowledge.externalized.md +17 -0
  4. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.contract.inputs.nameargs/bad-practice/forbid.positional-args.md +43 -0
  5. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.contract.inputs.nameargs/best-practice/require.namedargs.md +6 -0
  6. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.declarative/.readme.md +0 -0
  7. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.declarative/best-practice/declastruct.[demo].md +485 -0
  8. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.objects/bad-practices/blocker.has.attributes.nullable.md +13 -0
  9. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.objects/bad-practices/blocker.has.attributes.undefined.md +15 -0
  10. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.objects/bad-practices/blocker.refs.immuatble.md +9 -0
  11. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.objects/best-practice/ref.package.domain-objects.[readme].md +585 -0
  12. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.operations/best-practice/require.sync.names.md +14 -0
  13. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.errors.failfast/bad-practices/forbid.hide_errors.md +13 -0
  14. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.errors.failfast/best-practice/require.fail_fast.[demo].shell.md +17 -0
  15. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.errors.failfast/best-practice/require.fail_fast.md +28 -0
  16. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.repo.structure/best-practice/directional-dependencies.md +82 -0
  17. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.repo.structure/best-practice/dot-test-and-dot-temp.md +20 -0
  18. package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.typescript.utils/best-practice/ref.package.as-command.[tips].md +7 -0
  19. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.acceptance/best-practice/blackbox.md +5 -0
  20. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.run.[lesson].md +18 -0
  21. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.use.[lesson].md +20 -0
  22. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.write.[lesson].md +3 -0
  23. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.write.[lesson].on_scope.for_integ.md +8 -0
  24. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.write.[lesson].on_scope.for_units.md +9 -0
  25. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.write.bdd.[lesson].md +280 -0
  26. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/prefer.datadriven.md +41 -0
  27. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/ref.test-fns.[readme].md +185 -0
  28. package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/whento.snapshots.[lesson].md +23 -0
  29. package/dist/logic/roles/mechanic/.briefs/patterns/lang.terms/.readme.md +1 -0
  30. package/dist/logic/roles/mechanic/.briefs/patterns/lang.terms/domain=practices.terms=forbid_prefer_desire_require.md +13 -0
  31. package/dist/logic/roles/mechanic/.briefs/patterns/lang.terms/domain=software.terms=prodcode_vs_testcode.md +7 -0
  32. package/dist/logic/roles/mechanic/.briefs/patterns/lang.tones/.readme.md +3 -0
  33. package/dist/logic/roles/mechanic/.briefs/patterns/lang.tones/prefer.chill-nature.md +0 -0
  34. package/dist/logic/roles/mechanic/.briefs/patterns/lang.tones/prefer.lowercase.md +0 -0
  35. package/dist/logic/roles/mechanic/.skills/declapract.upgrade.sh +50 -0
  36. package/dist/logic/roles/mechanic/.skills/init.claude.hooks.sh +113 -0
  37. package/dist/logic/roles/mechanic/.skills/link.claude.transcripts.sh +43 -0
  38. package/dist/logic/roles/mechanic/.skills/run.test.sh +245 -0
  39. package/dist/logic/roles/mechanic/.skills/test.integration.sh +50 -0
  40. package/dist/logic/roles/mechanic/getMechanicRole.js +1 -1
  41. package/dist/logic/roles/mechanic/getMechanicRole.js.map +1 -1
  42. package/package.json +3 -3
  43. package/dist/logic/roles/architect/.briefs/criteria.given_when_then.[seed].[idea].md +0 -35
  44. package/dist/logic/roles/architect/.briefs/criteria.given_when_then.[seed].md +0 -20
  45. /package/dist/logic/roles/architect/.briefs/{criteria.practices → practices}/prefer.env_access.prep_over_dev.md +0 -0
@@ -0,0 +1,87 @@
1
+ use this brief to help you declare acceptance test criteria for .behavior
2
+
3
+ in BDD given/when/then format
4
+
5
+ ================================
6
+
7
+ recall:
8
+ - acceptance.criteria should only test BEHAVIOR; never internals
9
+ - acceptance.criteria should treat the system as a black box
10
+ - it doesn't care how it gets done and has no visibility into it
11
+ - it only cares that the usecases are satisfied for the given scenes
12
+ - it only engages with the system at the CONTRACT LAYER
13
+ - src/contract/endpoints (a.k.a. src/contract/handlers)
14
+ - src/contract/commands
15
+
16
+
17
+ distinguish the criteria into
18
+
19
+ BLOCKER = required; will not satisfy requireemnts without it
20
+ and
21
+ NITPICK = nicetohave, but not a show stoppeer
22
+
23
+
24
+ ================================
25
+
26
+ here's some examples of what i mean
27
+
28
+
29
+ [idea] = nest then's within sothat? when many thens support the same sothat?
30
+
31
+ when([t4] bastion IAM instance profile is provisioned via terraform)
32
+ sothat(SSM sessions can be established to bastion)
33
+ then(instance profile includes AmazonSSMManagedInstanceCore policy)
34
+ then(instance profile allows ssm:StartSession action)
35
+ sothat(auto-pause can detect when bastion is idle)
36
+ then(instance profile allows ec2:StopInstances for self-stop)
37
+ then(instance profile allows ec2:DescribeInstances to check instance state)
38
+ then(instance profile allows ssm:DescribeSessions to detect active sessions)
39
+ then(instance profile allows ssm:GetConnectionStatus to verify session state)
40
+
41
+
42
+ i.e.,
43
+
44
+ usecase(purpose)
45
+ given(scene)
46
+ when(cause)
47
+ sothat(benefit)
48
+ then(effect.1)
49
+ then(effect.2)
50
+
51
+
52
+ ---
53
+
54
+
55
+ e.g.,
56
+
57
+ usecase(eat dinner)
58
+ given(its dinner time)
59
+ when(dinner is served)
60
+ sothat(we can eat with cleanly)
61
+ then(we should have cutlery appropriate to the dish)
62
+ then(we should have plates appropriate to the dish)
63
+ then(we should have napkins to clean with)
64
+
65
+
66
+
67
+
68
+ criteria is best written in behavior-driven-development format
69
+
70
+ e.g.,
71
+
72
+ given(scene)
73
+ when([t0] nochange)
74
+ then(assert initial condition)
75
+ ...
76
+ when([t1] cause)
77
+ then(effect)
78
+ sothat(benefit) # optional
79
+ ...
80
+ when([t2] cause)
81
+ then(effect)
82
+ sothat(benefit) # optional
83
+ ...
84
+
85
+
86
+ dont forget that given and when can nest inside eachother; but then() goes at the root
87
+
@@ -5,7 +5,7 @@ enforce strict top-down dependency flow across layered system boundaries — low
5
5
 
6
6
  .scope
7
7
  - applies to all folders and modules within `src/`
8
- - required for `contract/`, `logic/`, `data/`, and `domain/` folders
8
+ - required for `contract/`, `access/`, `domain.objects/`, `domain.operations/`
9
9
  - governs imports, module references, and stitched flow boundaries
10
10
 
11
11
  .why
@@ -15,59 +15,68 @@ enforce strict top-down dependency flow across layered system boundaries — low
15
15
  - aligns with `arch:bounded-contexts` and enables predictable top-down orchestration
16
16
 
17
17
  .structure
18
- ```
18
+ \`\`\`
19
19
  src/
20
- contract/ // topmost — public interfaces, local commands
21
- endpoints/ // exposed APIs
22
- commands/ // internal entrypoints (e.g. CLI, scripts)
23
- logic/ // application procedures, stitched flows
24
- data/ // infrastructure layer (daos, sdks, services)
25
- daos/ // persistence logic — may reference domain objects
26
- sdks/ // external clients may reference domain types
27
- domain/ // lowestdomain models, business rules
28
- objects/ // canonical domain declarations
29
- ```
20
+ contract/ // topmost — public interfaces, local commands
21
+ api/ // public invocable api endpoints, deployed and exposed by the project; e.g., via `aws-lambda`
22
+ cmd/ // private internal use entrypoints, supported by the project; e.g., via `as-command`
23
+ sdk/ // public software development kit exports, supported by the project; e.g., `export ...`
24
+ cli/ // public command line interface contracts, supported by the project; e.g., via `commander`
25
+
26
+ access/ // infrastructure layer (daos, sdks, svcs)
27
+ daos/ // private persistence logic may reference domain objects
28
+ sdks/ // remote third party contracts, from any alt org — may declare their own domain.objects
29
+ svcs/ // remote first party contracts, from our own org — may declare their own domain.objects
30
+
31
+ domain.objects/ // canonical domain declarations
32
+ domain.operations/ // domain behavior + business rules
33
+
34
+ infra/ // infrastructure specific adapters
35
+ \`\`\`
30
36
 
31
37
  .how
32
38
  - each layer may depend **only on the layers below it**
33
- - `contract/` may depend on `logic/`, `data/`, `domain/`
34
- - `logic/` may depend on `data/`, `domain/`
35
- - `data/` may depend on `domain/`
36
- - `domain/` must not depend on anything outside its own layer
37
- - stitched flows live in `logic/` or `contract/commands/` and orchestrate downstream only
38
- - never import upward across layers (e.g. `domain/` importing `data/`)
39
- - shared types must follow same directional rules
39
+ - `contract/` may depend on `domain.objects/` and `domain.operations/`
40
+ - `access/` may depend on `domain.objects/` and `domain.operations/`
41
+ - `domain.operations/` may depend on `domain.objects/` or `infra/`
42
+ - `domain.objects/` must not depend on anything outside its own layer
43
+ - `infra/` must not depend on anything outside its own layer
44
+
45
+ - stitched flows live in `domain.operations/` or `contract/commands/` and orchestrate downstream only
46
+ - never import upward across layers (e.g., `domain.objects/` importing `access/`)
47
+ - shared types must follow the same directional rules
40
48
 
41
49
  .enforcement
42
- - imports that violate top-down boundary = BLOCKER
43
- - circular dependencies between layers = BLOCKER
44
- - logic in `domain/` must never reach into `data/`, `logic/`, or `contract/`
45
- - logic in `data/` may use `domain/`, but must stay decoupled from business rules
50
+ - imports that violate top-down boundary = **BLOCKER**
51
+ - circular dependencies between layers = **BLOCKER**
52
+ - logic in `domain.objects/` must never reach into `access/`, `contract/`, or `domain.operations/`
53
+ - logic in `domain.operations/` must not reference infrastructure concerns; they can can only leverage `infra/` adapters
54
+ - logic in `access/` may use domain layers but must remain free of domain knowledge and business rules
55
+ - logic in `infra/` must remain free of domain knowledge and business rules
46
56
 
47
57
  .examples
48
58
 
49
59
  ✅ positive
50
- ```ts
60
+ \`\`\`ts
51
61
  // contract/endpoints/sendInvoice.ts
52
- import { generateInvoice } from '@/logic/generateInvoice';
62
+ import { generateInvoice } from '@/domain.operations/generateInvoice';
63
+ import { invoiceDao } from '@/access/daos/invoiceDao';
53
64
 
54
- // logic/submitJob.ts
55
- import { Job } from '@/domain/objects/Job';
56
- import { jobDao } from '@/data/daos/jobDao';
65
+ // access/daos/jobDao.ts
66
+ import { Job } from '@/domain.objects/Job';
57
67
 
58
- // data/daos/jobDao.ts
59
- import { Job } from '@/domain/objects/Job';
60
- ```
68
+ // domain.operations/calculateTotal.ts
69
+ import { LineItem } from '@/domain.objects/LineItem';
70
+ \`\`\`
61
71
 
62
72
  ❌ negative
63
- ```ts
64
- // domain/Customer.ts
65
- import { customerDao } from '@/data/daos/customerDao'; // ⛔ illegal upward import
66
-
67
- // domain/Invoice.ts
68
- import { calculateTotal } from '@/logic/calculateTotal'; // ⛔ direction violation
73
+ \`\`\`ts
74
+ // domain.objects/Customer.ts
75
+ import { customerDao } from '@/access/daos/customerDao'; // ⛔ illegal upward import
69
76
 
70
- // data/sdkWrapper.ts
71
- import { dispatchFlow } from '@/logic/' // ⛔ bottom-up reference
72
- ```
77
+ // domain.operations/InvoiceOps.ts
78
+ import { runFlow } from '@/contract/commands'; // ⛔ direction violation
73
79
 
80
+ // access/svcs/sdkWrapper.ts
81
+ import { dispatchFlow } from '@/contract/'; // ⛔ bottom-up reference
82
+ \`\`\`
@@ -0,0 +1,17 @@
1
+ if using a tool dependency that is not already fully understood with internalized knowledge
2
+
3
+ first, it is mandatory to externalize knowledge about that tool
4
+
5
+ for example
6
+ - what is it
7
+ - when was it released
8
+ - how much does it cost
9
+ - how to use it
10
+
11
+ - what are advantages and devantages? boons and banes?
12
+
13
+ ---
14
+
15
+ research this always via a websearch first
16
+
17
+ and always cite your sources
@@ -0,0 +1,43 @@
1
+ positional args are
2
+ - hard to read
3
+ - easy to break
4
+
5
+ never use positional args if we can avoid them
6
+
7
+
8
+ even in bash!
9
+
10
+
11
+ ---
12
+
13
+ e.g., which one's easier to understand?
14
+
15
+
16
+ ```sh
17
+ # final attempt with fail_on_error=true (exits on hard failures, warns on timeout)
18
+ _try_start_port_forwarding "$instance_id" "$rds_endpoint" 60 true
19
+ ```
20
+
21
+
22
+ vs
23
+
24
+ ```sh
25
+
26
+ # final attempt with fail_on_error=true (exits on hard failures, warns on timeout)
27
+ _try_start_port_forwarding \
28
+ instance_id="$instance_id" \
29
+ rds_endpoint="$rds_endpoint" \
30
+ timeout=60 \
31
+ fail_on_error=true
32
+ ```
33
+
34
+
35
+ ---
36
+
37
+
38
+
39
+ - Self-documenting: You can see what each parameter is at the call site
40
+ - Order-independent: Arguments can be passed in any order
41
+ - Easier to maintain: Adding new optional parameters won't break existing calls
42
+ - Validation: Each function validates required parameters
43
+ - Usage examples: Included in function headers
@@ -0,0 +1,6 @@
1
+ always used named arguments on inputs
2
+
3
+ they make it clear when reading what the arguments are used for
4
+
5
+ they also make it possible to reorder arguments without breaking the contract (great for refactors, deprecations, renames, etc)
6
+