@chrisdudek/yg 2.12.0 → 4.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 +5 -89
- package/dist/bin.js +4376 -3074
- package/graph-schemas/yg-architecture.yaml +12 -0
- package/graph-schemas/yg-aspect.yaml +0 -4
- package/graph-schemas/yg-config.yaml +19 -29
- package/graph-schemas/yg-flow.yaml +1 -2
- package/graph-schemas/yg-node.yaml +13 -17
- package/package.json +13 -10
- package/dist/bin.js.map +0 -1
- package/dist/templates/default-config.ts +0 -36
- package/dist/templates/platform.ts +0 -257
- package/dist/templates/rules.ts +0 -662
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# yg-architecture.yaml — Schema for architecture constraints
|
|
2
|
+
# File: .yggdrasil/yg-architecture.yaml
|
|
3
|
+
# Defines node types with architectural constraints.
|
|
4
|
+
# All properties except description are optional — absence means no enforcement.
|
|
5
|
+
|
|
6
|
+
node_types:
|
|
7
|
+
<type-id>:
|
|
8
|
+
description: <string> # required — what this type is for
|
|
9
|
+
aspects: [<aspect-id>] # optional — required on every file of this type
|
|
10
|
+
parents: [<type-id>] # optional — allowed parent types
|
|
11
|
+
relations: # optional — allowed relation targets
|
|
12
|
+
<relation-type>: [<type-id>] # calls | uses | extends | implements | emits | listens
|
|
@@ -7,7 +7,3 @@
|
|
|
7
7
|
name: CrossCuttingRequirementName # required — display name
|
|
8
8
|
description: "Short description for discovery via yg aspects" # optional
|
|
9
9
|
# implies: [other-aspect, another-aspect] # optional — other aspect identifiers included automatically (recursive, must be acyclic)
|
|
10
|
-
# stability: protocol # optional — schema | protocol | implementation
|
|
11
|
-
# schema = enforced by data model (most stable)
|
|
12
|
-
# protocol = enforced by convention/contract
|
|
13
|
-
# implementation = specific mechanism (least stable, review after any code change)
|
|
@@ -2,36 +2,26 @@
|
|
|
2
2
|
# Located at .yggdrasil/yg-config.yaml — one per project.
|
|
3
3
|
# Edit this after running yg init to describe your project.
|
|
4
4
|
|
|
5
|
-
version: "
|
|
6
|
-
# that
|
|
7
|
-
# system to determine which migrations to run on upgrade.
|
|
5
|
+
version: "4.0.0" # managed by CLI — do not edit manually. Tracks the CLI version
|
|
6
|
+
# that last initialized or upgraded this config.
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
quality: # optional — quality thresholds
|
|
9
|
+
max_direct_relations: 10 # maximum outgoing relations per node (warning if above)
|
|
10
|
+
max_mapping_source_files: 10 # maximum source files per node (warning if above, for nodes with aspects)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
module: # key = type name used in yg-node.yaml
|
|
13
|
-
description: "Business logic unit with clear domain responsibility"
|
|
14
|
-
# required_aspects: [] # optional — aspects every node of this type must have
|
|
15
|
-
service:
|
|
16
|
-
description: "Component providing functionality to other nodes"
|
|
17
|
-
library:
|
|
18
|
-
description: "Shared utility code with no domain knowledge"
|
|
12
|
+
parallel: 1 # optional — concurrency limit for batch approve (positive integer, default: 1)
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
required: always # always | never | { when: <condition> }
|
|
23
|
-
description: "What this node is responsible for, and what it is not"
|
|
24
|
-
included_in_relations: true # true = included in dependency context packages
|
|
25
|
-
interface.md:
|
|
26
|
-
required:
|
|
27
|
-
when: has_incoming_relations # conditions: has_incoming_relations, has_outgoing_relations, has_aspect:<id>
|
|
28
|
-
description: "Public API — methods, parameters, return types, contracts"
|
|
29
|
-
included_in_relations: true
|
|
30
|
-
# Additional artifact types: logic.md, constraints.md, errors.md, model.md, state.md, decisions.md
|
|
14
|
+
debug: false # optional — when true, appends all command output to .yggdrasil/.debug.log
|
|
15
|
+
# Default: false (off). Log is append-only; rotate or delete manually.
|
|
31
16
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
reviewer: # required — aspect verification during yg approve
|
|
18
|
+
active: ollama # required when multiple providers configured
|
|
19
|
+
consensus: 1 # positive odd integer >= 1 (3+ for majority vote)
|
|
20
|
+
ollama: # provider-specific config
|
|
21
|
+
model: "qwen3.5:9b" # model ID
|
|
22
|
+
endpoint: "http://localhost:11434" # custom endpoint
|
|
23
|
+
temperature: 0 # reduces variability — keep at 0
|
|
24
|
+
max_tokens: auto # auto = query provider, or explicit number
|
|
25
|
+
context_length_field: "" # ollama model_info key for context window size
|
|
26
|
+
claude-code: # alternative provider — uses claude CLI subprocess
|
|
27
|
+
model: haiku # haiku, sonnet, or opus
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# yg-flow.yaml — Schema for end-to-end business flows
|
|
2
|
-
# Each flow is a directory under .yggdrasil/flows/ containing this file
|
|
3
|
-
# plus description.md with required sections (see rules).
|
|
2
|
+
# Each flow is a directory under .yggdrasil/flows/ containing this file.
|
|
4
3
|
|
|
5
4
|
name: EndToEndProcessName # required — display name
|
|
6
5
|
description: "Short description of this business process" # optional
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
# yg-node.yaml — Schema for model nodes
|
|
2
|
-
# Every node is a directory under .yggdrasil/model/ containing this file
|
|
3
|
-
# plus artifact .md files defined in yg-config.yaml.
|
|
2
|
+
# Every node is a directory under .yggdrasil/model/ containing this file.
|
|
4
3
|
|
|
5
4
|
name: ComponentName # required — display name
|
|
6
|
-
type: service # required — must match a type from
|
|
5
|
+
type: service # required — must match a type from yg-architecture.yaml
|
|
7
6
|
description: "Short description of what this node does" # optional
|
|
8
|
-
blackbox: false # optional, default false — if true, coarse-grained coverage without deep artifacts
|
|
9
7
|
|
|
10
|
-
aspects: # optional — list of aspect
|
|
11
|
-
- aspect
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
aspects: # optional — list of aspect identifiers
|
|
9
|
+
- aspect-id # aspect directory name under aspects/
|
|
10
|
+
|
|
11
|
+
ports: # optional — named entry points with required aspects (on target nodes)
|
|
12
|
+
port-name:
|
|
13
|
+
description: "What this port provides" # required
|
|
14
|
+
aspects: [aspect-id] # required — aspects consumers must satisfy
|
|
17
15
|
|
|
18
16
|
relations: # optional — outgoing dependencies to other nodes
|
|
19
17
|
- target: other/module-path # required — path relative to model/
|
|
20
18
|
type: calls # required — calls | uses | extends | implements | emits | listens
|
|
21
|
-
consumes: [
|
|
22
|
-
failure: 'retry 3x, then circuit-break' # optional — failure handling strategy
|
|
23
|
-
# event_name: OrderPlaced # optional — display name for event relations (emits, listens)
|
|
19
|
+
consumes: [port-name] # optional — port names consumed from target (required when target has ports)
|
|
24
20
|
|
|
25
|
-
mapping: # optional —
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
mapping: # optional — flat list of source file or directory paths
|
|
22
|
+
- src/modules/component/ # paths are relative to repository root
|
|
23
|
+
- src/modules/component.ts
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrisdudek/yg",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Continuous architecture enforcement for AI-assisted development. Aspects, review, enforcement.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"yg": "dist/bin.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"dist
|
|
10
|
+
"dist/**/*.js",
|
|
11
|
+
"dist/**/*.d.ts",
|
|
11
12
|
"graph-schemas/"
|
|
12
13
|
],
|
|
13
14
|
"engines": {
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
"dev": "tsup --watch",
|
|
19
20
|
"test": "vitest run",
|
|
20
21
|
"test:watch": "vitest",
|
|
22
|
+
"test:external": "vitest run --config vitest.external.config.ts",
|
|
21
23
|
"test:coverage": "vitest run --coverage",
|
|
22
24
|
"lint": "eslint src/",
|
|
23
25
|
"lint:fix": "eslint src/ --fix",
|
|
@@ -26,13 +28,13 @@
|
|
|
26
28
|
},
|
|
27
29
|
"keywords": [
|
|
28
30
|
"yggdrasil",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
31
|
+
"ai-agents",
|
|
32
|
+
"architecture-enforcement",
|
|
33
|
+
"code-review",
|
|
34
|
+
"ai-governance",
|
|
33
35
|
"cli",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
+
"developer-tools",
|
|
37
|
+
"ai-coding"
|
|
36
38
|
],
|
|
37
39
|
"author": "Krzysztof Dudek <me@chrisdudek.com>",
|
|
38
40
|
"license": "MIT",
|
|
@@ -50,6 +52,7 @@
|
|
|
50
52
|
"access": "public"
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
55
|
+
"@clack/prompts": "^1.2.0",
|
|
53
56
|
"chalk": "^5.6.2",
|
|
54
57
|
"commander": "^14.0.3",
|
|
55
58
|
"ignore": "^7.0.5",
|
|
@@ -64,7 +67,7 @@
|
|
|
64
67
|
"eslint": "^10.0.1",
|
|
65
68
|
"prettier": "^3.8.1",
|
|
66
69
|
"tsup": "^8.5.1",
|
|
67
|
-
"typescript": "^
|
|
70
|
+
"typescript": "^6.0.2",
|
|
68
71
|
"typescript-eslint": "^8.56.0",
|
|
69
72
|
"vitest": "^4.0.18"
|
|
70
73
|
}
|