@chrisdudek/yg 0.3.4 → 1.1.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 +28 -2
- package/dist/bin.js +1818 -1232
- package/dist/bin.js.map +1 -1
- package/dist/templates/default-config.ts +3 -14
- package/dist/templates/rules.ts +272 -186
- package/graph-schemas/aspect.yaml +9 -0
- package/graph-schemas/config.yaml +39 -0
- package/graph-schemas/flow.yaml +10 -0
- package/graph-schemas/node.yaml +19 -0
- package/package.json +2 -2
- package/graph-templates/aspect.yaml +0 -2
- package/graph-templates/flow.yaml +0 -8
- package/graph-templates/knowledge.yaml +0 -2
- package/graph-templates/node.yaml +0 -17
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# config.yaml — Schema for the Yggdrasil project configuration
|
|
2
|
+
# Located at .yggdrasil/config.yaml — one per project.
|
|
3
|
+
# Edit this after running yg init to describe your project.
|
|
4
|
+
|
|
5
|
+
name: "My Project" # required — project display name
|
|
6
|
+
|
|
7
|
+
stack: # required — technology stack (freeform keys)
|
|
8
|
+
language: "TypeScript" # primary language
|
|
9
|
+
runtime: "Node.js" # runtime environment
|
|
10
|
+
# framework: "Express" # optional — any additional stack entries
|
|
11
|
+
# database: "PostgreSQL"
|
|
12
|
+
# testing: "Vitest"
|
|
13
|
+
|
|
14
|
+
standards: "" # optional — global coding conventions (free text)
|
|
15
|
+
|
|
16
|
+
node_types: # required — allowed node type names
|
|
17
|
+
- name: module # each type needs at least a 'name'
|
|
18
|
+
# required_aspects: [] # optional — aspects every node of this type must have
|
|
19
|
+
- name: service
|
|
20
|
+
- name: library
|
|
21
|
+
|
|
22
|
+
artifacts: # required — artifact type definitions
|
|
23
|
+
responsibility.md: # key = filename in node directories
|
|
24
|
+
required: always # always | never | { when: <condition> }
|
|
25
|
+
description: "What this node is responsible for, and what it is not"
|
|
26
|
+
structural_context: true # true = included in dependency context packages
|
|
27
|
+
interface.md:
|
|
28
|
+
required:
|
|
29
|
+
when: has_incoming_relations # conditions: has_incoming_relations, has_outgoing_relations, has_aspect:<id>
|
|
30
|
+
description: "Public API — methods, parameters, return types, contracts"
|
|
31
|
+
structural_context: true
|
|
32
|
+
# Additional artifact types: logic.md, constraints.md, errors.md, model.md, state.md, decisions.md
|
|
33
|
+
|
|
34
|
+
quality: # optional — quality thresholds
|
|
35
|
+
min_artifact_length: 50 # minimum characters for an artifact (warning if below)
|
|
36
|
+
max_direct_relations: 10 # maximum outgoing relations per node (warning if above)
|
|
37
|
+
context_budget: # token budget for context packages
|
|
38
|
+
warning: 10000 # tokens — warning threshold
|
|
39
|
+
error: 20000 # tokens — error threshold (suggests splitting)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 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).
|
|
4
|
+
|
|
5
|
+
name: EndToEndProcessName # required — display name
|
|
6
|
+
nodes: # required, non-empty — participant nodes
|
|
7
|
+
- orders/order-service # paths relative to model/
|
|
8
|
+
- payments/payment-service
|
|
9
|
+
- inventory/inventory-service
|
|
10
|
+
# aspects: [requires-saga] # optional — aspect tags propagated to ALL participants
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# 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 config.yaml.
|
|
4
|
+
|
|
5
|
+
name: ComponentName # required — display name
|
|
6
|
+
type: service # required — must match a type from config.node_types
|
|
7
|
+
aspects: [] # optional — list of aspect identifiers (directory paths under aspects/)
|
|
8
|
+
blackbox: false # optional, default false — if true, coarse-grained coverage without deep artifacts
|
|
9
|
+
|
|
10
|
+
relations: # optional — outgoing dependencies to other nodes
|
|
11
|
+
- target: other/module-path # required — path relative to model/
|
|
12
|
+
type: calls # required — calls | uses | extends | implements | emits | listens
|
|
13
|
+
consumes: [methodA, methodB] # optional — what is consumed from target
|
|
14
|
+
failure: 'retry 3x, then circuit-break' # optional — failure handling strategy
|
|
15
|
+
# event_name: OrderPlaced # optional — display name for event relations (emits, listens)
|
|
16
|
+
|
|
17
|
+
mapping: # optional — link to source files for ownership and drift detection
|
|
18
|
+
paths: # required when mapping is present — list of file or directory paths
|
|
19
|
+
- src/modules/component/ # paths are relative to repository root
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrisdudek/yg",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Make your repository self-aware. Persistent semantic memory and deterministic context assembly for AI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/",
|
|
11
|
-
"graph-
|
|
11
|
+
"graph-schemas/"
|
|
12
12
|
],
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=22"
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
name: ComponentName
|
|
2
|
-
type: service
|
|
3
|
-
tags: []
|
|
4
|
-
blackbox: false
|
|
5
|
-
|
|
6
|
-
relations:
|
|
7
|
-
- target: other/module-path
|
|
8
|
-
type: calls
|
|
9
|
-
consumes: [methodA, methodB]
|
|
10
|
-
failure: 'retry 3x, then circuit-break'
|
|
11
|
-
|
|
12
|
-
knowledge:
|
|
13
|
-
- decisions/001-choice-name
|
|
14
|
-
|
|
15
|
-
mapping:
|
|
16
|
-
paths:
|
|
17
|
-
- src/modules/component/
|