archik 0.14.0 → 0.15.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.
- package/README.md +28 -0
- package/commands/self-evolving.md +67 -0
- package/dist/cli/archik.mjs +535 -389
- package/dist/ui/assets/index-CAPTCctF.js +226 -0
- package/dist/ui/assets/index-CV6lgiRK.css +1 -0
- package/dist/ui/index.html +2 -2
- package/package.json +2 -1
- package/patterns/evolution-loop.blueprint.yaml +69 -0
- package/patterns/evolution-loop.md +64 -0
- package/patterns/feedback-pipeline.md +52 -0
- package/patterns/learned-overlay.md +52 -0
- package/patterns/sidecar-approval-gate.md +52 -0
- package/patterns/truth-chain.md +54 -0
- package/skills/archik/SKILL.md +28 -1
- package/dist/ui/assets/index-Cd7sGYmr.js +0 -226
- package/dist/ui/assets/index-EA4oKR1S.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-rose-700:oklch(51.4% .222 16.935);--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-semibold:600;--tracking-tight:-.025em;--radius-md:.375rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-auto{margin-top:auto}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-full{height:100%}.h-screen{height:100vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.w-72{width:calc(var(--spacing) * 72)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.flex-1{flex:1}.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-baseline{align-items:baseline}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-left{text-align:left}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.whitespace-pre-wrap{white-space:pre-wrap}.text-rose-700{color:var(--color-rose-700)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.hover\:no-underline:hover{text-decoration-line:none}}}:root,[data-theme=light]{--archik-canvas:#f8fafc;--archik-panel:#fff;--archik-surface:#f1f5f9;--archik-surface-hover:#e2e8f0;--archik-fg:#0f172a;--archik-fg-dim:#475569;--archik-fg-muted:#94a3b8;--archik-border:#e2e8f0;--archik-border-strong:#cbd5e1;--archik-accent:#2563eb;--archik-accent-bright:#3b82f6;--archik-magenta:#db2777;--archik-success:#10b981;--archik-warning:#d97706;--archik-danger:#e11d48;--archik-node-fill:#fff;--archik-node-fill-tinted:#f1f5f9;--archik-node-fill-frame:#fff;--archik-node-stroke:#0f172a;--archik-node-stroke-soft:#475569;--archik-container-border:#94a3b8;--archik-node-text:#0f172a;--archik-node-text-dim:#475569;--archik-node-caption:#64748b;--archik-node-chrome-dot:#cbd5f5;--archik-edge-filled:#0f172a;--archik-edge-open:#334155;--archik-edge-dim:#64748b;--archik-edge-async:#2563eb;--archik-grid-minor:#e2e8f0;--archik-grid-major:#cbd5e1;--archik-selected:#2563eb;--archik-selected-glow:#2563eb2e;--archik-status-proposed:#6366f1;--archik-status-deprecated:#d97706;--archik-stereotype-boundary:#0369a1;--archik-stereotype-control:#b45309;--archik-stereotype-entity:#15803d;color-scheme:light}[data-theme=dark]{--archik-canvas:#050912;--archik-panel:#0c1426;--archik-surface:#14203a;--archik-surface-hover:#1c2c4d;--archik-fg:#e6edf7;--archik-fg-dim:#8b9bb8;--archik-fg-muted:#5b6a87;--archik-border:#1d2b48;--archik-border-strong:#2c3e63;--archik-accent:#22d3ee;--archik-accent-bright:#67e8f9;--archik-magenta:#f472b6;--archik-success:#34d399;--archik-warning:#fbbf24;--archik-danger:#fb7185;--archik-node-fill:#0c1426;--archik-node-fill-tinted:#142037;--archik-node-fill-frame:#14203a;--archik-node-stroke:#2c3e63;--archik-node-stroke-soft:#1d2b48;--archik-container-border:#3a4f7a;--archik-node-text:#e6edf7;--archik-node-text-dim:#b6c2d8;--archik-node-caption:#67e8f9;--archik-node-chrome-dot:#475878;--archik-edge-filled:#cbd5e1;--archik-edge-open:#94a3b8;--archik-edge-dim:#64748b;--archik-edge-async:#67e8f9;--archik-grid-minor:#0d1830;--archik-grid-major:#182748;--archik-selected:#22d3ee;--archik-selected-glow:#22d3ee47;--archik-status-proposed:#818cf8;--archik-status-deprecated:#fbbf24;--archik-stereotype-boundary:#38bdf8;--archik-stereotype-control:#f59e0b;--archik-stereotype-entity:#22c55e;color-scheme:dark}html,body,#root{background:var(--archik-canvas);height:100%;color:var(--archik-fg);-webkit-font-smoothing:antialiased;margin:0;font-family:Inter,system-ui,sans-serif}.archik-panel{background:var(--archik-panel);border:1px solid var(--archik-border);border-radius:8px}.archik-input{background:var(--archik-surface);color:var(--archik-fg);border:1px solid var(--archik-border);font:inherit;border-radius:4px;outline:none;padding:4px 8px;font-size:12px;transition:border-color .12s,box-shadow .12s}.archik-input:focus{border-color:var(--archik-accent);box-shadow:0 0 0 3px var(--archik-selected-glow)}.archik-btn{background:var(--archik-surface);color:var(--archik-fg);border:1px solid var(--archik-border);cursor:pointer;border-radius:4px;align-items:center;gap:4px;padding:5px 10px;font-size:12px;font-weight:500;transition:background .12s,border-color .12s,color .12s;display:inline-flex}.archik-btn:hover{background:var(--archik-surface-hover);border-color:var(--archik-border-strong)}.archik-btn:disabled{opacity:.5;cursor:not-allowed}.archik-btn-primary{background:var(--archik-accent);border-color:var(--archik-accent);color:#050912}.archik-btn-primary:hover{background:var(--archik-accent-bright);border-color:var(--archik-accent-bright)}[data-theme=light] .archik-btn-primary{color:#fff}.archik-btn-danger{color:var(--archik-danger);border-color:var(--archik-danger);background:0 0;border-style:dashed}.archik-btn-danger:hover{background:var(--archik-danger);color:#050912;border-style:solid}.archik-pill{letter-spacing:.02em;border:1px solid #0000;border-radius:999px;align-items:center;gap:4px;padding:2px 8px;font-size:11px;display:inline-flex}.archik-pill--info{color:var(--archik-accent);border-color:var(--archik-border-strong);background:var(--archik-accent)}@supports (color:color-mix(in lab,red,red)){.archik-pill--info{background:color-mix(in oklab,var(--archik-accent) 8%,transparent)}}.archik-pill--success{color:var(--archik-success);background:var(--archik-success)}@supports (color:color-mix(in lab,red,red)){.archik-pill--success{background:color-mix(in oklab,var(--archik-success) 12%,transparent)}}.archik-pill--warning{color:var(--archik-warning);background:var(--archik-warning)}@supports (color:color-mix(in lab,red,red)){.archik-pill--warning{background:color-mix(in oklab,var(--archik-warning) 14%,transparent)}}.archik-pill--danger{color:var(--archik-danger);background:var(--archik-danger)}@supports (color:color-mix(in lab,red,red)){.archik-pill--danger{background:color-mix(in oklab,var(--archik-danger) 14%,transparent)}}.archik-label{letter-spacing:.12em;text-transform:uppercase;color:var(--archik-fg-muted);margin-bottom:4px;font-size:10px;display:block}.archik-mono{color:var(--archik-fg);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.archik-divider{border-top:1px solid var(--archik-border)}.archik-grid{background-color:var(--archik-canvas);background-image:radial-gradient(var(--archik-grid-minor) 1px,transparent 1px),radial-gradient(var(--archik-grid-major) 1px,transparent 1px);background-position:0 0,0 0;background-size:20px 20px,100px 100px}.archik-selected-glow{filter:drop-shadow(0 0 6px var(--archik-selected-glow)) drop-shadow(0 0 2px var(--archik-selected-glow));animation:1.8s ease-in-out infinite archikPulse}[data-archik-node-id][data-archik-status=proposed]{opacity:.82}[data-archik-node-id][data-archik-status=proposed] rect,[data-archik-node-id][data-archik-status=proposed] path,[data-archik-node-id][data-archik-status=proposed] ellipse,[data-archik-node-id][data-archik-status=proposed] line{stroke:var(--archik-status-proposed);stroke-dasharray:5 3}[data-archik-node-id][data-archik-status=deprecated]{opacity:.7}[data-archik-node-id][data-archik-status=deprecated] rect,[data-archik-node-id][data-archik-status=deprecated] path,[data-archik-node-id][data-archik-status=deprecated] ellipse,[data-archik-node-id][data-archik-status=deprecated] line{stroke:var(--archik-status-deprecated);stroke-dasharray:2 4}[data-archik-node-id][data-archik-status=deprecated] text{text-decoration:line-through;text-decoration-thickness:1px;-webkit-text-decoration-color:var(--archik-status-deprecated);text-decoration-color:var(--archik-status-deprecated)}.archik-stereotype-band{pointer-events:none}[data-archik-stereotype=boundary] .archik-stereotype-band{fill:var(--archik-stereotype-boundary)}[data-archik-stereotype=control] .archik-stereotype-band{fill:var(--archik-stereotype-control)}[data-archik-stereotype=entity] .archik-stereotype-band{fill:var(--archik-stereotype-entity)}.archik-stereotype-pill{letter-spacing:.08em;border:1px solid #0000;border-radius:10px;align-self:flex-start;align-items:center;padding:3px 10px;font-size:10px;font-weight:700;display:inline-flex}.archik-stereotype-pill[data-stereotype=boundary]{background:var(--archik-stereotype-boundary)}@supports (color:color-mix(in lab,red,red)){.archik-stereotype-pill[data-stereotype=boundary]{background:color-mix(in srgb,var(--archik-stereotype-boundary) 15%,transparent)}}.archik-stereotype-pill[data-stereotype=boundary]{border-color:var(--archik-stereotype-boundary);color:var(--archik-stereotype-boundary)}.archik-stereotype-pill[data-stereotype=control]{background:var(--archik-stereotype-control)}@supports (color:color-mix(in lab,red,red)){.archik-stereotype-pill[data-stereotype=control]{background:color-mix(in srgb,var(--archik-stereotype-control) 15%,transparent)}}.archik-stereotype-pill[data-stereotype=control]{border-color:var(--archik-stereotype-control);color:var(--archik-stereotype-control)}.archik-stereotype-pill[data-stereotype=entity]{background:var(--archik-stereotype-entity)}@supports (color:color-mix(in lab,red,red)){.archik-stereotype-pill[data-stereotype=entity]{background:color-mix(in srgb,var(--archik-stereotype-entity) 15%,transparent)}}.archik-stereotype-pill[data-stereotype=entity]{border-color:var(--archik-stereotype-entity);color:var(--archik-stereotype-entity)}@keyframes archikPulse{0%,to{filter:drop-shadow(0 0 4px var(--archik-selected-glow)) drop-shadow(0 0 1px var(--archik-selected-glow))}50%{filter:drop-shadow(0 0 12px var(--archik-selected-glow)) drop-shadow(0 0 3px var(--archik-selected-glow))}}.archik-modal-overlay{z-index:50;background:var(--archik-canvas);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}@supports (color:color-mix(in lab,red,red)){.archik-modal-overlay{background:color-mix(in oklab,var(--archik-canvas) 70%,transparent)}}.archik-modal-overlay{-webkit-backdrop-filter:blur(4px);animation:.14s ease-out archikFadeIn}.archik-modal{background:var(--archik-panel);border:1px solid var(--archik-border);width:360px;max-width:calc(100vw - 32px);box-shadow:0 12px 40px #00000059,0 0 0 1px var(--archik-border-strong);border-radius:8px;padding:16px;animation:.2s cubic-bezier(.2,.8,.2,1) archikModalIn}.archik-selected-outline{fill:none;stroke:var(--archik-selected);stroke-width:2px;pointer-events:none}@keyframes archikEdgeFlow{0%{stroke-dashoffset:0}to{stroke-dashoffset:calc(-1 * var(--archik-dash-period,8) * 1px)}}.archik-edge-flowing{animation:1.4s linear infinite archikEdgeFlow}@media(prefers-reduced-motion:reduce){.archik-edge-flowing{animation:none}}.archik-popover{background:var(--archik-panel);border:1px solid var(--archik-border-strong);border-radius:6px;flex-direction:column;max-height:min(80vh,600px);padding:4px;animation:.16s cubic-bezier(.2,.8,.2,1) archikModalIn;display:flex;overflow:hidden;box-shadow:0 12px 32px #00000059}.archik-menu-item{width:100%;color:var(--archik-fg);cursor:pointer;text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:8px;padding:6px 10px;font-size:12px;display:flex}.archik-menu-item:hover{background:var(--archik-surface-hover)}.archik-menu-item--danger{color:var(--archik-danger)}@keyframes archikFadeIn{0%{opacity:0}to{opacity:1}}@keyframes archikModalIn{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:none}}.archik-drawer-shell{flex-direction:column;min-width:0;transition:width .22s cubic-bezier(.2,.8,.2,1),opacity .2s,margin-left .22s cubic-bezier(.2,.8,.2,1);display:flex;overflow:hidden}.archik-drawer-shell--open{opacity:1;width:320px;margin-left:16px}.archik-drawer-shell--closed{opacity:0;pointer-events:none;width:0;margin-left:0}.archik-drawer-content{flex-shrink:0;width:320px;height:100%}.archik-drawer-fade{animation:.22s ease-out archikFadeIn}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
|
package/dist/ui/index.html
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
}
|
|
15
15
|
} catch {}
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-CAPTCctF.js"></script>
|
|
18
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CV6lgiRK.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
21
21
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "archik",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "The shared vocabulary between you and Claude Code, at the engineering level. Plain-YAML architecture diagrams with a live browser canvas, headless SVG render in CI, and an installable Claude skill so the model treats the diagram as the spec.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"architecture",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"docs/templates/principles/functional.md",
|
|
40
40
|
"skills",
|
|
41
41
|
"commands",
|
|
42
|
+
"patterns",
|
|
42
43
|
".claude-plugin",
|
|
43
44
|
"README.md",
|
|
44
45
|
"LICENSE"
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Blueprint fragment merged into your diagram by `archik patterns apply
|
|
2
|
+
# evolution-loop`. All nodes are `status: proposed` — they describe what
|
|
3
|
+
# you are about to build, so no sourcePath is required yet. Rename ids
|
|
4
|
+
# and fill in sourcePaths as you implement each piece.
|
|
5
|
+
nodes:
|
|
6
|
+
- id: evo-event-log
|
|
7
|
+
kind: database
|
|
8
|
+
name: Event Log
|
|
9
|
+
status: proposed
|
|
10
|
+
description: >-
|
|
11
|
+
Append-only store of usage events (actions, outcomes, corrections).
|
|
12
|
+
Sanitized at capture time; local to the project; opt-in.
|
|
13
|
+
- id: evo-reflect-engine
|
|
14
|
+
kind: module
|
|
15
|
+
name: Reflect Engine
|
|
16
|
+
status: proposed
|
|
17
|
+
description: >-
|
|
18
|
+
Pure rules that turn events into insights with evidence, e.g.
|
|
19
|
+
"the same failure happened 5 times this week". Deterministic and
|
|
20
|
+
unit-testable; an LLM can reflect more deeply on the same data.
|
|
21
|
+
- id: evo-proposal-store
|
|
22
|
+
kind: database
|
|
23
|
+
name: Proposal Store
|
|
24
|
+
status: proposed
|
|
25
|
+
description: >-
|
|
26
|
+
One readable file per proposed self-improvement, with evidence
|
|
27
|
+
and a status (pending / approved / rejected / applied).
|
|
28
|
+
- id: evo-approval-gate
|
|
29
|
+
kind: module
|
|
30
|
+
name: Approval Gate
|
|
31
|
+
status: proposed
|
|
32
|
+
description: >-
|
|
33
|
+
The human yes/no step. Approved proposals are applied as normal,
|
|
34
|
+
reviewable changes; rejected ones are recorded as signals too.
|
|
35
|
+
- id: evo-learned-overlay
|
|
36
|
+
kind: prompt
|
|
37
|
+
name: Learned Overlay
|
|
38
|
+
status: proposed
|
|
39
|
+
description: >-
|
|
40
|
+
Append-only file of approved lessons, read by the AI at session
|
|
41
|
+
start. The system gets smarter without code or prompt redeploys.
|
|
42
|
+
- id: evo-metrics
|
|
43
|
+
kind: module
|
|
44
|
+
name: Evolution Metrics
|
|
45
|
+
status: proposed
|
|
46
|
+
description: >-
|
|
47
|
+
Before/after trend reports (error rate, acceptance rate) that
|
|
48
|
+
prove an applied proposal actually helped.
|
|
49
|
+
edges:
|
|
50
|
+
- id: evo-reflect-reads-log
|
|
51
|
+
from: evo-reflect-engine
|
|
52
|
+
to: evo-event-log
|
|
53
|
+
relationship: reads
|
|
54
|
+
- id: evo-reflect-writes-proposals
|
|
55
|
+
from: evo-reflect-engine
|
|
56
|
+
to: evo-proposal-store
|
|
57
|
+
relationship: writes
|
|
58
|
+
- id: evo-gate-reads-proposals
|
|
59
|
+
from: evo-approval-gate
|
|
60
|
+
to: evo-proposal-store
|
|
61
|
+
relationship: reads
|
|
62
|
+
- id: evo-gate-writes-overlay
|
|
63
|
+
from: evo-approval-gate
|
|
64
|
+
to: evo-learned-overlay
|
|
65
|
+
relationship: writes
|
|
66
|
+
- id: evo-metrics-reads-log
|
|
67
|
+
from: evo-metrics
|
|
68
|
+
to: evo-event-log
|
|
69
|
+
relationship: reads
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Evolution Loop
|
|
2
|
+
|
|
3
|
+
> Intent: Make a system improve itself in small, safe, visible steps.
|
|
4
|
+
|
|
5
|
+
## The idea in one line
|
|
6
|
+
|
|
7
|
+
The system watches its own use, finds weak spots, suggests fixes,
|
|
8
|
+
and applies them — but only after a human says yes.
|
|
9
|
+
|
|
10
|
+
## The six stages
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
observe → reflect → propose → validate → apply → measure
|
|
14
|
+
↑ │
|
|
15
|
+
└────────────────────────────────────────────────┘
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
| Stage | Question it answers | Example |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| Observe | What is really happening? | Log every command run and its outcome |
|
|
21
|
+
| Reflect | What patterns repeat? | "Validation failed 5 times this week" |
|
|
22
|
+
| Propose | What should change? | A written proposal file a human can read |
|
|
23
|
+
| Validate | Is the change safe? | Schema check + "would the system still work?" |
|
|
24
|
+
| Apply | Make the change — gated | Human approves; change lands as a normal diff |
|
|
25
|
+
| Measure | Did it actually help? | Compare error rates before and after |
|
|
26
|
+
|
|
27
|
+
## When to use
|
|
28
|
+
|
|
29
|
+
- Your system has users who correct it (accept/reject, edit, undo).
|
|
30
|
+
- The same mistakes happen again and again.
|
|
31
|
+
- You want improvement without a human redesigning things each time.
|
|
32
|
+
|
|
33
|
+
## Rules that keep it safe
|
|
34
|
+
|
|
35
|
+
1. **Observation is opt-in and local.** No silent data collection.
|
|
36
|
+
2. **Every proposal is a readable file.** Evidence included.
|
|
37
|
+
3. **Nothing applies without approval.** The gate is explicit.
|
|
38
|
+
4. **Rejection is also a signal.** The loop records "no" and learns from it.
|
|
39
|
+
5. **Measure or it didn't happen.** A change with no metric is a guess.
|
|
40
|
+
|
|
41
|
+
## Trade-offs
|
|
42
|
+
|
|
43
|
+
- Costs storage and a little time on every action (keep logging cheap).
|
|
44
|
+
- Deterministic heuristics find less than an LLM would — but they are
|
|
45
|
+
testable and free. Best of both: deterministic core, LLM on top.
|
|
46
|
+
|
|
47
|
+
## Blueprint
|
|
48
|
+
|
|
49
|
+
`archik patterns apply evolution-loop` stages these components into
|
|
50
|
+
your diagram (as `status: proposed` nodes you fill in later):
|
|
51
|
+
|
|
52
|
+
- `evo-event-log` — append-only store of usage events
|
|
53
|
+
- `evo-reflect-engine` — pure rules: events in, insights out
|
|
54
|
+
- `evo-proposal-store` — proposals waiting for review
|
|
55
|
+
- `evo-approval-gate` — the human yes/no step
|
|
56
|
+
- `evo-learned-overlay` — approved knowledge the system reads back
|
|
57
|
+
- `evo-metrics` — before/after trend reports
|
|
58
|
+
|
|
59
|
+
## Seen in archik
|
|
60
|
+
|
|
61
|
+
`archik evolution` implements this loop for archik itself:
|
|
62
|
+
events in `.archik/evolution/events.jsonl`, proposals in
|
|
63
|
+
`.archik/evolution/proposals/`, the gate is `archik evolution approve`,
|
|
64
|
+
and `archik evolution report` is the measure stage.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Feedback Pipeline
|
|
2
|
+
|
|
3
|
+
> Intent: Turn every user correction into a recorded signal a system can learn from.
|
|
4
|
+
|
|
5
|
+
## The idea in one line
|
|
6
|
+
|
|
7
|
+
Users already tell your system what is wrong — by rejecting, undoing,
|
|
8
|
+
and re-editing. Record those moments; they are free training data.
|
|
9
|
+
|
|
10
|
+
## Structure
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
user action (accept / reject / edit / undo / retry)
|
|
14
|
+
↓ capture at the boundary, not inside features
|
|
15
|
+
event log (append-only, sanitized, local)
|
|
16
|
+
↓
|
|
17
|
+
reflection (heuristics or LLM) → insights with evidence
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- Your system makes suggestions users can act on.
|
|
23
|
+
- You want learning signals **without** asking users to fill surveys.
|
|
24
|
+
- You are building toward an Evolution Loop and need its observe stage.
|
|
25
|
+
|
|
26
|
+
## Rules that keep it safe
|
|
27
|
+
|
|
28
|
+
1. **Capture at one boundary** (dispatcher, middleware, API gateway) —
|
|
29
|
+
features stay unaware they are observed.
|
|
30
|
+
2. **Sanitize at capture time.** Record *that* something happened and
|
|
31
|
+
its outcome — names and counts, never contents or values.
|
|
32
|
+
3. **Failure to record must never break the user's action.**
|
|
33
|
+
4. **Opt-in.** The user turns the pipeline on, and can read every
|
|
34
|
+
byte it stores.
|
|
35
|
+
|
|
36
|
+
## Trade-offs
|
|
37
|
+
|
|
38
|
+
- Boundary capture sees less detail than in-feature capture; start
|
|
39
|
+
coarse, add detail only where an insight needs it.
|
|
40
|
+
- Logs grow; rotate or window them.
|
|
41
|
+
|
|
42
|
+
## Blueprint
|
|
43
|
+
|
|
44
|
+
Doc-only pattern — model it as `cli/gateway --writes--> event-log` plus
|
|
45
|
+
`reflect-engine --reads--> event-log` (see Evolution Loop blueprint).
|
|
46
|
+
|
|
47
|
+
## Seen in archik
|
|
48
|
+
|
|
49
|
+
The dispatcher hook in `src/cli/observe.ts`: every finished command
|
|
50
|
+
appends sanitized events to `.archik/evolution/events.jsonl`, and
|
|
51
|
+
`suggest accept` / `suggest reject` become first-class accept/reject
|
|
52
|
+
signals — the corrections the loop learns from.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Learned Overlay
|
|
2
|
+
|
|
3
|
+
> Intent: Let an AI system get smarter across sessions without changing its code or base prompt.
|
|
4
|
+
|
|
5
|
+
## The idea in one line
|
|
6
|
+
|
|
7
|
+
Keep the base prompt fixed; append approved lessons to a separate
|
|
8
|
+
file the AI reads at the start of every session.
|
|
9
|
+
|
|
10
|
+
## Structure
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
base prompt / skill (fixed, versioned, shipped)
|
|
14
|
+
+
|
|
15
|
+
learned.md (grows over time, one approved note per line)
|
|
16
|
+
↓
|
|
17
|
+
the agent reads BOTH and behaves better than last week
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- The same correction keeps being made to the AI's behaviour.
|
|
23
|
+
- You cannot (or do not want to) redeploy a prompt for every lesson.
|
|
24
|
+
- You need an audit trail: *why* does the agent behave this way?
|
|
25
|
+
|
|
26
|
+
## Rules that keep it safe
|
|
27
|
+
|
|
28
|
+
1. **Append-only, human-gated.** A note enters the overlay only
|
|
29
|
+
through an approval step (see Evolution Loop).
|
|
30
|
+
2. **Every note carries its origin** — date and proposal id — so any
|
|
31
|
+
behaviour can be traced back to evidence.
|
|
32
|
+
3. **The overlay is plain text in the repo.** Review it, diff it,
|
|
33
|
+
delete a bad lesson with a normal commit.
|
|
34
|
+
4. Keep it short. If the overlay grows past a page, promote stable
|
|
35
|
+
lessons into the base prompt and clear them from the overlay.
|
|
36
|
+
|
|
37
|
+
## Trade-offs
|
|
38
|
+
|
|
39
|
+
- The overlay consumes context tokens each session.
|
|
40
|
+
- Conflicting notes confuse the agent — the approval gate must reject
|
|
41
|
+
notes that contradict existing ones.
|
|
42
|
+
|
|
43
|
+
## Blueprint
|
|
44
|
+
|
|
45
|
+
Doc-only pattern — model it as a node `learned-overlay` (kind:
|
|
46
|
+
`prompt`) with an edge `agent --reads--> learned-overlay`.
|
|
47
|
+
|
|
48
|
+
## Seen in archik
|
|
49
|
+
|
|
50
|
+
`.archik/evolution/learned.md`, written only by
|
|
51
|
+
`archik evolution approve`, read by the archik Claude skill at session
|
|
52
|
+
start and exposed to other agents as the MCP resource `archik://learned`.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Sidecar Approval Gate
|
|
2
|
+
|
|
3
|
+
> Intent: Let a machine propose changes to a file a human owns — without ever touching the file itself.
|
|
4
|
+
|
|
5
|
+
## The idea in one line
|
|
6
|
+
|
|
7
|
+
The machine writes its draft to a *sidecar* file next to the real one;
|
|
8
|
+
the human sees a diff and decides; only "accept" touches the real file.
|
|
9
|
+
|
|
10
|
+
## Structure
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
main.yaml ← owned by the human, never written by the machine
|
|
14
|
+
main.suggested.yaml ← the machine's full proposed end state
|
|
15
|
+
│
|
|
16
|
+
[show diff] → human → accept (sidecar replaces main)
|
|
17
|
+
→ reject (sidecar deleted)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- An AI agent (or any tool) wants to edit configuration, models,
|
|
23
|
+
or documents that a human is responsible for.
|
|
24
|
+
- You want review to be a *diff*, not a wall of text.
|
|
25
|
+
- You want "no" to be cheap: rejecting must cost one command.
|
|
26
|
+
|
|
27
|
+
## Rules that keep it safe
|
|
28
|
+
|
|
29
|
+
1. The sidecar holds the **complete end state**, not a patch — so the
|
|
30
|
+
diff is always computable and the apply is always atomic.
|
|
31
|
+
2. The sidecar passes **the same validation** as the real file. An
|
|
32
|
+
invalid draft never reaches the human.
|
|
33
|
+
3. The machine **refuses to write the main file**, even if asked.
|
|
34
|
+
4. One pending sidecar at a time. A second proposal must wait.
|
|
35
|
+
|
|
36
|
+
## Trade-offs
|
|
37
|
+
|
|
38
|
+
- One extra file and one extra step per change.
|
|
39
|
+
- Whole-file proposals can conflict if the main file moves underneath;
|
|
40
|
+
re-validate at accept time.
|
|
41
|
+
|
|
42
|
+
## Blueprint
|
|
43
|
+
|
|
44
|
+
Doc-only pattern (it is a workflow, not components) — model it as an
|
|
45
|
+
edge in your diagram: `agent --writes--> sidecar`, `human --reads--> diff`,
|
|
46
|
+
`gate --writes--> main`.
|
|
47
|
+
|
|
48
|
+
## Seen in archik
|
|
49
|
+
|
|
50
|
+
`archik suggest set / show / accept / reject`, and the canvas diff
|
|
51
|
+
overlay. The evolution loop reuses the same gate: an approved
|
|
52
|
+
`update-node` proposal becomes a sidecar, never a direct write.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Truth Chain
|
|
2
|
+
|
|
3
|
+
> Intent: Prove a model is true at every altitude — against itself, against the code, and against production.
|
|
4
|
+
|
|
5
|
+
## The idea in one line
|
|
6
|
+
|
|
7
|
+
One check is an opinion; a chain of independent checks at different
|
|
8
|
+
altitudes is proof.
|
|
9
|
+
|
|
10
|
+
## Structure
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
model ──(validate)── is the model consistent with itself?
|
|
14
|
+
model ──(drift)───── does the model match the source code?
|
|
15
|
+
model ──(traffic)─── does the model match what production really does?
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Each check has a different blind spot, so together they cover what
|
|
19
|
+
no single check can:
|
|
20
|
+
|
|
21
|
+
| Check | Catches | Blind to |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| Self-consistency | broken references, rule violations | reality |
|
|
24
|
+
| Code comparison | renamed/moved/deleted code | runtime behaviour |
|
|
25
|
+
| Production comparison | calls nobody declared | code that never runs |
|
|
26
|
+
|
|
27
|
+
## When to use
|
|
28
|
+
|
|
29
|
+
- You keep a model/diagram/spec of a system that changes under you.
|
|
30
|
+
- "The docs are stale" is a sentence people say in your team.
|
|
31
|
+
- A self-evolving system needs ground truth to learn against —
|
|
32
|
+
without it, the system optimizes toward its own mistakes.
|
|
33
|
+
|
|
34
|
+
## Rules that keep it safe
|
|
35
|
+
|
|
36
|
+
1. Checks must be **independent** — different inputs, different code.
|
|
37
|
+
2. Each check is **mechanical and CI-gateable** (exit code, JSON).
|
|
38
|
+
3. Undeclared reality **fails** the check; declared-but-unseen is a
|
|
39
|
+
warning (it may simply not have run yet).
|
|
40
|
+
|
|
41
|
+
## Trade-offs
|
|
42
|
+
|
|
43
|
+
- Three checks to maintain instead of one.
|
|
44
|
+
- Production comparison needs tracing infrastructure (e.g. OTel).
|
|
45
|
+
|
|
46
|
+
## Blueprint
|
|
47
|
+
|
|
48
|
+
Doc-only pattern — in your diagram, give the three verifier components
|
|
49
|
+
edges pointing at the model node, each labelled with its altitude.
|
|
50
|
+
|
|
51
|
+
## Seen in archik
|
|
52
|
+
|
|
53
|
+
`archik validate` (model vs itself), `archik drift --edges` (model vs
|
|
54
|
+
the import graph), `archik otel check` (model vs production traffic).
|
package/skills/archik/SKILL.md
CHANGED
|
@@ -11,6 +11,7 @@ description: Use whenever .archik/main.archik.yaml or architecture.archik.yaml e
|
|
|
11
11
|
- **The CLI is your only interface to it.** You never read, write, or edit archik files directly. Every read goes through `npx archik q ...`; every write goes through `npx archik suggest set` → user accepts via `/archik:accept`.
|
|
12
12
|
- **Two command surfaces:** the user types `/archik:*` slash commands; you run `npx archik ...` directly. They're not interchangeable — see the tables below.
|
|
13
13
|
- **Actors first, one use case to ship.** When a user hands you a brief on a fresh project, the right opening move is *model the actors, then propose the first use case to ship* — never "let me sketch your whole system." Actors-first because you can't validate a use case without knowing who initiates it. Pick exactly one because forcing priorities into the open before any code lands is the entire point of the loop. "To ship" because the use case names its test paths from message one — slices start `status: proposed` (the tests don't exist on disk yet) and flip to `status: active` automatically when the tests land in BUILD. The project's commitments live in the YAML, not in the chat log.
|
|
14
|
+
- **Read the learned overlay at session start.** If `.archik/evolution/learned.md` exists, read it (with the Read tool — it is docs, not an archik YAML) before your first archik action and treat every note as binding guidance. Each note is a lesson this project's evolution loop gathered from real usage and a human approved. After a suggestion of yours is rejected, run `npx archik evolution reflect` — repeated rejections become proposals the user can review.
|
|
14
15
|
|
|
15
16
|
## Command surfaces
|
|
16
17
|
|
|
@@ -32,6 +33,7 @@ These are the user's entry points. They're triggered by the user typing `/archik
|
|
|
32
33
|
| `/archik:usecase <name>` | Author a use case — flows + slices + tests (direct-write) |
|
|
33
34
|
| `/archik:trace` | Coverage matrix + concrete next action |
|
|
34
35
|
| `/archik:alpha [show \| promote]` | Read or move project alphas with a machine-checked criteria |
|
|
36
|
+
| `/archik:self-evolving <idea>` | Design a self-evolving architecture for the user's idea, using the pattern library |
|
|
35
37
|
|
|
36
38
|
The full protocol for each lives at `commands/<name>.md` in the repo (or `.claude/commands/archik/<name>.md` once installed in a project). Follow it when invoked.
|
|
37
39
|
|
|
@@ -45,6 +47,7 @@ These are the verbs you reach for during the loop. Default to `npx archik` (no g
|
|
|
45
47
|
| Inspect the current diagram | `npx archik q list \| edges \| stats` |
|
|
46
48
|
| Look up one node | `npx archik q describe <id>` |
|
|
47
49
|
| Find dependencies / impact | `npx archik q deps \| dependents \| impact <id>` |
|
|
50
|
+
| See one node + its neighbors | `npx archik q neighbors <id> [--depth N]` |
|
|
48
51
|
| List use cases (filter by actor) | `npx archik q usecases [--actor <id>]` |
|
|
49
52
|
| Describe one use case | `npx archik q describe-usecase <id>` |
|
|
50
53
|
| List actors | `npx archik q actors` |
|
|
@@ -55,13 +58,19 @@ These are the verbs you reach for during the loop. Default to `npx archik` (no g
|
|
|
55
58
|
| Alpha state snapshot | `npx archik alpha show [--json]` |
|
|
56
59
|
| Promote / demote an alpha state | `npx archik alpha promote\|demote <alpha> <state>` |
|
|
57
60
|
| Validate a file | `npx archik validate <path>` |
|
|
61
|
+
| Spot over-complex files / hubs | `npx archik complexity [--fail-on-warn]` |
|
|
58
62
|
| Stage a proposed change | `npx archik suggest set --note '…' - <<'YAML' … YAML` |
|
|
59
63
|
| Show / accept / reject pending | `npx archik suggest show \| accept \| reject` |
|
|
60
64
|
| Render an SVG | `npx archik render --out diagram.svg` |
|
|
65
|
+
| Render a slice / drop weak edges | `npx archik render --focus <id>` / `--hide-structural` |
|
|
61
66
|
| Diff two files or git refs | `npx archik diff a.yaml b.yaml` / `npx archik diff origin/main` |
|
|
62
67
|
| Detect drift vs source tree | `npx archik drift` |
|
|
63
68
|
| Open the live canvas (foreground) | `npx archik dev` |
|
|
64
69
|
| Open the canvas (detached) | `npx archik start` / `stop` / `status` |
|
|
70
|
+
| Evolution loop state | `npx archik evolution status [--json]` |
|
|
71
|
+
| Turn usage history into proposals | `npx archik evolution reflect` |
|
|
72
|
+
| File a proposal yourself | `npx archik evolution propose - <<'YAML' … YAML` |
|
|
73
|
+
| Self-evolution pattern library | `npx archik patterns list \| show <id> \| apply <id>` |
|
|
65
74
|
| Per-command help | `npx archik <cmd> --help` |
|
|
66
75
|
|
|
67
76
|
## Hard rule: the CLI is the only interface to archik files
|
|
@@ -133,6 +142,7 @@ Other common queries:
|
|
|
133
142
|
```bash
|
|
134
143
|
npx archik q describe orders-api # node detail + edges
|
|
135
144
|
npx archik q deps orders-api # what does this node depend on?
|
|
145
|
+
npx archik q neighbors orders-api # this node + its immediate neighbors (depth 1)
|
|
136
146
|
npx archik q impact payments-db # what would break if this is removed?
|
|
137
147
|
npx archik q list --kind service # all services
|
|
138
148
|
npx archik q list --kind queue # all queues
|
|
@@ -393,13 +403,22 @@ Run a candidate through this checklist before staging a sidecar. Each item is a
|
|
|
393
403
|
- **One reason to change.** Each new node has a single responsibility expressible in one sentence. If `description` rambles, decompose.
|
|
394
404
|
- **Bounded contexts.** Name the context this change belongs to. A change spanning two contexts usually means a missing third (orchestrator, port, gateway).
|
|
395
405
|
- **Async at context boundaries.** Default cross-context coupling to `publishes` / `subscribes` over a stream/queue. `http_call` across contexts is allowed but should be justified (sync-required RPC, query for read-side data).
|
|
396
|
-
- **Composition over sprawl.** Group related nodes under a `module` parent via `parentId`. Flat top-level lists past ~8 nodes are a smell.
|
|
406
|
+
- **Composition over sprawl.** Group related nodes under a `module` parent via `parentId`. Flat top-level lists past ~8 nodes are a smell. Run `npx archik complexity` to catch this objectively — it flags over-large files, over-stuffed containers, hub nodes, and deep nesting, each with a concrete fix.
|
|
397
407
|
- **Ports & adapters at the edge.** External integrations sit behind an `external` node, never inline in a service. Port (interface) + adapter (concrete) is preferred when the integration could swap.
|
|
398
408
|
- **Public traffic → gateway/auth upstream.** Anything user-facing routes through a `gateway`/`auth` node, not directly to a service.
|
|
399
409
|
- **Failure modes.** Async producers imply DLQ/retry on the consumer; `http_call` implies timeout + circuit. Don't draw the happy path alone.
|
|
400
410
|
- **Use case participation → ECB classification.** If a node appears in any active use case slice (check `npx archik q usecases` or trace output), it needs a `stereotype: boundary | control | entity` before the seq diagram is authored. An unclassified node in a `realizes`-linked seq passes structurally but defeats ECB rule enforcement. Classify now; the validator will catch violations at seq-authoring time, not at code-review time.
|
|
401
411
|
- **Lifecycle honesty.** Code-bearing node without code on disk → `status: proposed`. About to be removed → `status: deprecated`.
|
|
402
412
|
|
|
413
|
+
## Keep views small
|
|
414
|
+
|
|
415
|
+
A big model isn't read by staring at one giant map — it's read one question at a time. Many small views beat one wall of nodes.
|
|
416
|
+
|
|
417
|
+
- **Answer questions with a query, not the whole diagram.** "What does X talk to?" → `npx archik q neighbors X` (or `q describe X`). Don't render the full map to answer a local question.
|
|
418
|
+
- **Let `complexity` tell you when to split.** Run `npx archik complexity` (advisory; `--fail-on-warn` for CI/hooks). When it flags a file or container, decompose: move a subsystem into its own `archikFile`, or group nodes under a `module` parent via `parentId`. Strict default limits — 15 nodes/file, 20 edges/file, 6 children/container, degree 6, nesting depth 3. These are hints, not blockers.
|
|
419
|
+
- **Slice when rendering.** `npx archik render --focus <id> [--depth N]` renders only a node's neighborhood; `--hide-structural` (or `--hide-rel`/`--only-rel`) drops weak edges (`uses`, `depends_on`, `has_a`, `implements`, `extends`) so the runtime shape stands out.
|
|
420
|
+
- **For humans on the canvas:** the live canvas has matching controls — collapse/expand containers, hide weak edges, and focus mode (select a node → "Focus on this node", with a depth stepper, Esc to exit). These are view-only and never change the YAML.
|
|
421
|
+
|
|
403
422
|
## When to propose, when to defer
|
|
404
423
|
|
|
405
424
|
**Propose a sidecar (don't silently apply) when work changes shape:**
|
|
@@ -647,6 +666,7 @@ npx archik schema # the document shape (start here when au
|
|
|
647
666
|
|
|
648
667
|
npx archik q describe <id> | deps <id> | dependents <id>
|
|
649
668
|
list | edges | impact <id> | stats
|
|
669
|
+
neighbors <id> [--depth <n>] # node + everything within N hops (default 1)
|
|
650
670
|
sequences [--node <id>] # list seq diagrams; --node filters to flows involving a node
|
|
651
671
|
usecases [--actor <id>] # list use cases; filter by actor
|
|
652
672
|
describe-usecase <id> # one use case in detail
|
|
@@ -665,8 +685,15 @@ npx archik alpha show [--json] # alpha state snapshot with verification
|
|
|
665
685
|
alpha demote <alpha> <state>
|
|
666
686
|
|
|
667
687
|
npx archik validate <path> [--json] # schema + cross-file + governance constraints
|
|
688
|
+
# prints an advisory complexity-hint count (never fails on it)
|
|
689
|
+
npx archik complexity [path] [--json] # advisory report: over-large files, hub nodes, deep nesting
|
|
690
|
+
[--fail-on-warn] # exit 1 if any finding (CI / pre-commit gate)
|
|
691
|
+
[--max-nodes N] [--max-edges N] [--max-children N]
|
|
692
|
+
[--max-degree N] [--max-depth N] # override the strict defaults
|
|
668
693
|
npx archik render --out diagram.svg --theme light|dark
|
|
669
694
|
render --seq <path> --out seq.svg --theme light|dark
|
|
695
|
+
render --focus <id> [--depth N] # render only a node's neighborhood
|
|
696
|
+
render --hide-structural | --hide-rel <a,b> | --only-rel <a,b> # filter edges
|
|
670
697
|
npx archik diff <a> [b] [--out diff.svg] [--json]
|
|
671
698
|
# each side: YAML file OR git ref;
|
|
672
699
|
# one arg = that ref vs working tree
|