yam-flow 0.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.
Files changed (52) hide show
  1. package/AGENTS.md +18 -0
  2. package/COMMANDS.md +152 -0
  3. package/DECISIONS.md +70 -0
  4. package/LICENSE +21 -0
  5. package/README.md +174 -0
  6. package/ROADMAP.md +313 -0
  7. package/dist/bin/yam.d.ts +2 -0
  8. package/dist/bin/yam.js +2005 -0
  9. package/dist/lib/trust-kernel.d.ts +99 -0
  10. package/dist/lib/trust-kernel.js +300 -0
  11. package/package.json +101 -0
  12. package/references/context-reuse.md +59 -0
  13. package/references/current-docs.md +45 -0
  14. package/references/db-supabase-safety-lite.md +40 -0
  15. package/references/doctor-scan.md +56 -0
  16. package/references/eye.md +30 -0
  17. package/references/final-report.md +61 -0
  18. package/references/honest-completion.md +61 -0
  19. package/references/hook-lite.md +55 -0
  20. package/references/markdown-management.md +56 -0
  21. package/references/memory.md +59 -0
  22. package/references/mission.md +86 -0
  23. package/references/question.md +25 -0
  24. package/references/quick.md +70 -0
  25. package/references/risk-escalation.md +27 -0
  26. package/references/runtime-orchestration.md +57 -0
  27. package/references/scout.md +38 -0
  28. package/references/token-budget-reporter.md +44 -0
  29. package/references/token-economy.md +61 -0
  30. package/references/tool-trust-layer.md +115 -0
  31. package/references/trust-kernel.md +55 -0
  32. package/references/truth-matrix.md +47 -0
  33. package/references/ueye-proof.md +109 -0
  34. package/references/ueye.md +174 -0
  35. package/references/ui-quality.md +23 -0
  36. package/references/verification-levels.md +53 -0
  37. package/skills/deep/SKILL.md +77 -0
  38. package/skills/mission/SKILL.md +105 -0
  39. package/skills/question/SKILL.md +45 -0
  40. package/skills/quick/SKILL.md +81 -0
  41. package/skills/scout/SKILL.md +71 -0
  42. package/skills/ueye/SKILL.md +132 -0
  43. package/src/bin/yam.ts +1988 -0
  44. package/src/lib/trust-kernel.ts +398 -0
  45. package/templates/mission-plan.md +46 -0
  46. package/templates/runtime-proof.md +54 -0
  47. package/templates/tuning-log.md +39 -0
  48. package/templates/ueye-comparison.md +78 -0
  49. package/templates/ueye-review.md +110 -0
  50. package/templates/yam.project.md +73 -0
  51. package/tsconfig.json +27 -0
  52. package/yam.manifest.json +48 -0
@@ -0,0 +1,99 @@
1
+ export declare const TRUTH_STATUSES: readonly ["verified", "proven", "partial", "fixture_only", "fixture_instrumented_real", "integration_optional", "real_required_missing", "skipped", "blocked", "assumed"];
2
+ export type TruthStatus = (typeof TRUTH_STATUSES)[number];
3
+ export type SafetyLevel = 'danger' | 'warning';
4
+ export type EvidenceKind = 'command' | 'evidence' | 'visual' | 'runtime' | 'skipped' | 'blocked' | 'assumption' | 'cleanup' | 'none';
5
+ export type RuntimeSubsystem = 'real_runtime' | 'tmux_physical' | 'process_cleanup' | 'browser_visual' | 'db_safety';
6
+ export interface SafetyHit {
7
+ level: SafetyLevel;
8
+ reason: string;
9
+ }
10
+ export interface DbSafetyScanResult {
11
+ hits: SafetyHit[];
12
+ recommendation: '$deep' | '$quick or current route';
13
+ truth: TruthStatus;
14
+ }
15
+ export interface EvidenceRow {
16
+ kind: EvidenceKind;
17
+ value: string;
18
+ truth: TruthStatus;
19
+ }
20
+ export interface RuntimeTruthRow {
21
+ subsystem: RuntimeSubsystem;
22
+ proof_level: TruthStatus;
23
+ required: boolean;
24
+ next_action: string;
25
+ }
26
+ export interface RuntimeTruthMatrix {
27
+ schema: 'yam.runtime-truth-matrix.v1';
28
+ ok: boolean;
29
+ rows: RuntimeTruthRow[];
30
+ blockers: string[];
31
+ }
32
+ export interface FakeRealPolicyResult {
33
+ schema: 'yam.fake-real-policy.v1';
34
+ ok: boolean;
35
+ proof_level: TruthStatus;
36
+ fake_claims: string[];
37
+ real_claims: string[];
38
+ blockers: string[];
39
+ }
40
+ export interface ProofSummary {
41
+ route?: unknown;
42
+ goal?: unknown;
43
+ truth?: unknown;
44
+ source?: unknown;
45
+ commands?: unknown;
46
+ evidence?: unknown;
47
+ visual?: unknown;
48
+ runtime?: unknown;
49
+ cleanup?: unknown;
50
+ changed?: unknown;
51
+ skipped?: unknown;
52
+ blocked?: unknown;
53
+ assumptions?: unknown;
54
+ unverified?: unknown;
55
+ }
56
+ export interface ProofOptions {
57
+ requireRealRuntime?: boolean;
58
+ requireVisual?: boolean;
59
+ requireTmux?: boolean;
60
+ }
61
+ export interface ProofTruthCaps {
62
+ truth: TruthStatus;
63
+ requestedTruth: TruthStatus;
64
+ evidenceRows: EvidenceRow[];
65
+ caps: string[];
66
+ blockers: string[];
67
+ unverified: string[];
68
+ fakeReal: FakeRealPolicyResult;
69
+ }
70
+ export interface YamCompletionProof {
71
+ schema: 'yam.completion-proof.v1';
72
+ generatedAt: string;
73
+ route: unknown;
74
+ goal: unknown;
75
+ truth: TruthStatus;
76
+ requestedTruth: TruthStatus;
77
+ source: unknown;
78
+ commands: string[];
79
+ evidence: string[];
80
+ visual: string[];
81
+ runtime: string[];
82
+ cleanup: unknown;
83
+ changed: string[];
84
+ skipped: string[];
85
+ blocked: string[];
86
+ assumptions: string[];
87
+ unverified: string[];
88
+ truthCaps: string[];
89
+ evidenceRows: EvidenceRow[];
90
+ fakeReal: FakeRealPolicyResult;
91
+ runtimeTruth: RuntimeTruthMatrix;
92
+ }
93
+ export declare function isTruthStatus(value?: unknown): value is TruthStatus;
94
+ export declare function weakestTruth(...statuses: unknown[]): TruthStatus;
95
+ export declare function detectDbSafetyText(text?: unknown): DbSafetyScanResult;
96
+ export declare function classifyEvidenceTruth(summary?: ProofSummary, options?: ProofOptions): EvidenceRow[];
97
+ export declare function applyProofTruthCaps(summary?: ProofSummary, options?: ProofOptions): ProofTruthCaps;
98
+ export declare function buildRuntimeTruthMatrix(summary?: ProofSummary, options?: ProofOptions): RuntimeTruthMatrix;
99
+ export declare function buildYamCompletionProof(summary?: ProofSummary, options?: ProofOptions): YamCompletionProof;
@@ -0,0 +1,300 @@
1
+ export const TRUTH_STATUSES = Object.freeze([
2
+ 'verified',
3
+ 'proven',
4
+ 'partial',
5
+ 'fixture_only',
6
+ 'fixture_instrumented_real',
7
+ 'integration_optional',
8
+ 'real_required_missing',
9
+ 'skipped',
10
+ 'blocked',
11
+ 'assumed'
12
+ ]);
13
+ const TRUTH_RANK = Object.freeze({
14
+ blocked: 0,
15
+ real_required_missing: 0,
16
+ skipped: 1,
17
+ assumed: 1,
18
+ fixture_only: 2,
19
+ integration_optional: 2,
20
+ fixture_instrumented_real: 3,
21
+ partial: 3,
22
+ verified: 4,
23
+ proven: 5
24
+ });
25
+ export function isTruthStatus(value = '') {
26
+ return TRUTH_STATUSES.includes(String(value || ''));
27
+ }
28
+ export function weakestTruth(...statuses) {
29
+ const valid = statuses.filter(isTruthStatus);
30
+ if (!valid.length)
31
+ return 'assumed';
32
+ return valid.reduce((weakest, status) => {
33
+ return TRUTH_RANK[status] < TRUTH_RANK[weakest] ? status : weakest;
34
+ }, valid[0]);
35
+ }
36
+ export function detectDbSafetyText(text = '') {
37
+ const value = String(text || '');
38
+ const hits = [];
39
+ const checks = [
40
+ ['danger', /\bdrop\s+(table|schema|database|view|index)\b/i, 'DROP statement can destroy database objects'],
41
+ ['danger', /\btruncate\s+(table\s+)?[a-z0-9_".]+/i, 'TRUNCATE statement can destroy table data'],
42
+ ['danger', /\bdelete\s+from\s+[a-z0-9_".]+/i, 'DELETE FROM can destroy row data'],
43
+ ['danger', /\bupdate\s+[a-z0-9_".]+\s+set\b/i, 'UPDATE can mutate row data'],
44
+ ['warning', /\balter\s+table\s+[a-z0-9_".]+/i, 'ALTER TABLE can change schema or lock production data'],
45
+ ['danger', /\bsupabase\s+db\s+(reset|push)\b/i, 'supabase db reset/push can mutate database state'],
46
+ ['warning', /\bsupabase\s+(migration|migrations|db\s+diff|db\s+pull)\b/i, 'Supabase migration/db command needs explicit environment awareness'],
47
+ ['danger', /\b(prisma\s+migrate\s+(deploy|reset|dev)|drizzle-kit\s+(push|drop|migrate)|knex\s+migrate|sequelize\s+db:migrate)\b/i, 'ORM migration command can mutate schema/data'],
48
+ ['danger', /\bpsql\b[\s\S]{0,160}\b(drop|truncate|delete\s+from|update\s+[a-z0-9_".]+\s+set|alter\s+table)\b/i, 'psql command contains destructive SQL'],
49
+ ['warning', /\b(create\s+policy|alter\s+policy|drop\s+policy|grant\s+|revoke\s+)/i, 'RLS/policy/permission change affects data access safety']
50
+ ];
51
+ for (const [level, pattern, reason] of checks) {
52
+ if (pattern.test(value))
53
+ hits.push({ level, reason });
54
+ }
55
+ const productionSignal = /\b(prod|production|live|remote|linked|service[_-]?role|database_url|--db-url|--linked|--remote|--project-ref)\b/i.test(value);
56
+ if (productionSignal)
57
+ hits.push({ level: 'warning', reason: 'production/remote credential or environment signal detected' });
58
+ const unique = [];
59
+ const seen = new Set();
60
+ for (const hit of hits) {
61
+ const key = `${hit.level}:${hit.reason}`;
62
+ if (seen.has(key))
63
+ continue;
64
+ seen.add(key);
65
+ unique.push(hit);
66
+ }
67
+ return {
68
+ hits: unique,
69
+ recommendation: unique.length ? '$deep' : '$quick or current route',
70
+ truth: 'assumed'
71
+ };
72
+ }
73
+ export function classifyEvidenceTruth(summary = {}, options = {}) {
74
+ const rows = [];
75
+ for (const command of asList(summary.commands)) {
76
+ rows.push(evidenceRow('command', command, commandPassed(command) ? 'verified' : 'partial'));
77
+ }
78
+ for (const evidence of asList(summary.evidence)) {
79
+ rows.push(evidenceRow('evidence', evidence, classifyTextEvidence(evidence)));
80
+ }
81
+ for (const visual of asList(summary.visual)) {
82
+ rows.push(evidenceRow('visual', visual, classifyVisualEvidence(visual)));
83
+ }
84
+ for (const runtime of asList(summary.runtime)) {
85
+ rows.push(evidenceRow('runtime', runtime, classifyRuntimeEvidence(runtime, options)));
86
+ }
87
+ for (const skipped of asList(summary.skipped))
88
+ rows.push(evidenceRow('skipped', skipped, 'skipped'));
89
+ for (const blocked of asList(summary.blocked))
90
+ rows.push(evidenceRow('blocked', blocked, 'blocked'));
91
+ for (const assumption of asList(summary.assumptions))
92
+ rows.push(evidenceRow('assumption', assumption, 'assumed'));
93
+ if (summary.cleanup)
94
+ rows.push(evidenceRow('cleanup', summary.cleanup, classifyCleanupEvidence(summary.cleanup)));
95
+ if (!rows.length)
96
+ rows.push(evidenceRow('none', 'no evidence supplied', 'assumed'));
97
+ return rows;
98
+ }
99
+ export function applyProofTruthCaps(summary = {}, options = {}) {
100
+ const evidenceRows = classifyEvidenceTruth(summary, options);
101
+ const blockers = [];
102
+ const unverified = [];
103
+ const caps = [];
104
+ const requested = isTruthStatus(summary.truth) ? summary.truth : 'assumed';
105
+ const evidenceCap = strongestSupportedTruth(evidenceRows);
106
+ let cappedTruth = weakestTruth(requested, evidenceCap);
107
+ if (asList(summary.blocked).length)
108
+ cappedTruth = 'blocked';
109
+ if (options.requireRealRuntime && !hasRuntimeProof(evidenceRows)) {
110
+ cappedTruth = 'real_required_missing';
111
+ blockers.push('real_runtime_required_missing');
112
+ }
113
+ if (options.requireVisual && !hasRealVisualProof(evidenceRows)) {
114
+ cappedTruth = weakestTruth(cappedTruth, 'partial');
115
+ unverified.push('real_visual_evidence_missing');
116
+ }
117
+ if (requested !== cappedTruth) {
118
+ caps.push(`requested ${requested} capped to ${cappedTruth} by evidence`);
119
+ }
120
+ const fakeReal = evaluateFakeRealPolicy({ summary, evidenceRows, options });
121
+ if (fakeReal.blockers.length) {
122
+ cappedTruth = weakestTruth(cappedTruth, fakeReal.proof_level);
123
+ blockers.push(...fakeReal.blockers);
124
+ }
125
+ return {
126
+ truth: cappedTruth,
127
+ requestedTruth: requested,
128
+ evidenceRows,
129
+ caps,
130
+ blockers: uniqueStrings(blockers),
131
+ unverified: uniqueStrings(unverified),
132
+ fakeReal
133
+ };
134
+ }
135
+ export function buildRuntimeTruthMatrix(summary = {}, options = {}) {
136
+ const evidenceRows = classifyEvidenceTruth(summary, options);
137
+ const rows = [
138
+ runtimeRow('real_runtime', hasRuntimeProof(evidenceRows) ? 'proven' : options.requireRealRuntime ? 'real_required_missing' : 'integration_optional', options.requireRealRuntime),
139
+ runtimeRow('tmux_physical', hasText(asList(summary.runtime), /tmux/i) ? runtimeLevelFor(evidenceRows, /tmux/i, options.requireTmux) : options.requireTmux ? 'real_required_missing' : 'integration_optional', options.requireTmux),
140
+ runtimeRow('process_cleanup', summary.cleanup ? classifyCleanupEvidence(summary.cleanup) : 'integration_optional', false),
141
+ runtimeRow('browser_visual', hasRealVisualProof(evidenceRows) ? 'verified' : options.requireVisual ? 'real_required_missing' : 'integration_optional', options.requireVisual),
142
+ runtimeRow('db_safety', asList(summary.evidence).some((item) => /db[_ -]?safety|supabase|database/i.test(String(item))) ? 'partial' : 'integration_optional', false)
143
+ ];
144
+ const blockers = rows
145
+ .filter((row) => row.required && ['blocked', 'real_required_missing', 'integration_optional'].includes(row.proof_level))
146
+ .map((row) => `${row.subsystem}_required_missing`);
147
+ return {
148
+ schema: 'yam.runtime-truth-matrix.v1',
149
+ ok: blockers.length === 0,
150
+ rows,
151
+ blockers
152
+ };
153
+ }
154
+ export function buildYamCompletionProof(summary = {}, options = {}) {
155
+ const capped = applyProofTruthCaps(summary, options);
156
+ const runtimeTruth = buildRuntimeTruthMatrix(summary, options);
157
+ return {
158
+ schema: 'yam.completion-proof.v1',
159
+ generatedAt: new Date().toISOString(),
160
+ route: summary.route || 'unspecified',
161
+ goal: summary.goal || '',
162
+ truth: capped.truth,
163
+ requestedTruth: capped.requestedTruth,
164
+ source: summary.source || '',
165
+ commands: asList(summary.commands),
166
+ evidence: asList(summary.evidence),
167
+ visual: asList(summary.visual),
168
+ runtime: asList(summary.runtime),
169
+ cleanup: summary.cleanup || '',
170
+ changed: asList(summary.changed),
171
+ skipped: asList(summary.skipped),
172
+ blocked: uniqueStrings([...asList(summary.blocked), ...capped.blockers]),
173
+ assumptions: asList(summary.assumptions),
174
+ unverified: uniqueStrings([...asList(summary.unverified), ...capped.unverified]),
175
+ truthCaps: capped.caps,
176
+ evidenceRows: capped.evidenceRows,
177
+ fakeReal: capped.fakeReal,
178
+ runtimeTruth
179
+ };
180
+ }
181
+ function classifyTextEvidence(value = '') {
182
+ const text = String(value || '');
183
+ if (/mock|fixture|stub|fake/i.test(text))
184
+ return 'fixture_only';
185
+ if (/browser|screenshot|playwright|test.*pass|passed|build.*pass|typecheck.*pass|lint.*pass|verified/i.test(text))
186
+ return 'verified';
187
+ if (/blocked|failed|error/i.test(text))
188
+ return 'blocked';
189
+ if (/read|inspect|review|inferred|assumed|source/i.test(text))
190
+ return 'assumed';
191
+ return 'partial';
192
+ }
193
+ function classifyVisualEvidence(value = '') {
194
+ const text = String(value || '');
195
+ if (/blocked|unavailable|could not|missing/i.test(text))
196
+ return 'blocked';
197
+ if (/reference[-_ ]?only|reference image|generated|annotation|mock|fixture|text[-_ ]?only|code[-_ ]?only/i.test(text))
198
+ return 'partial';
199
+ if (/browser|screenshot|screen capture|viewport|mobile|desktop|playwright|chrome/i.test(text))
200
+ return 'verified';
201
+ return 'partial';
202
+ }
203
+ function classifyRuntimeEvidence(value = '', options = {}) {
204
+ const text = String(value || '');
205
+ if (/blocked|missing|unavailable|failed/i.test(text))
206
+ return options.requireRealRuntime ? 'real_required_missing' : 'blocked';
207
+ if (/fixture|mock|fake/i.test(text))
208
+ return 'fixture_only';
209
+ if (/tmux|pid|process|port|server|watcher|browser qa|exit verified|closed|cleanup verified/i.test(text))
210
+ return 'proven';
211
+ return 'partial';
212
+ }
213
+ function classifyCleanupEvidence(value = '') {
214
+ const text = String(value || '');
215
+ if (/exit verified|closed|stopped|no runtime started|not started|intentionally left running/i.test(text))
216
+ return 'proven';
217
+ if (/not checked|unknown|assumed/i.test(text))
218
+ return 'assumed';
219
+ if (/blocked|failed|missing/i.test(text))
220
+ return 'blocked';
221
+ return 'partial';
222
+ }
223
+ function commandPassed(value = '') {
224
+ return /pass|passed|ok|success|exit\s*0|green/i.test(String(value || '')) && !/fail|failed|error|blocked/i.test(String(value || ''));
225
+ }
226
+ function strongestSupportedTruth(rows = []) {
227
+ if (rows.some((row) => row.truth === 'blocked'))
228
+ return 'blocked';
229
+ if (rows.some((row) => row.truth === 'real_required_missing'))
230
+ return 'real_required_missing';
231
+ if (rows.some((row) => row.truth === 'fixture_only'))
232
+ return 'fixture_only';
233
+ if (rows.some((row) => row.truth === 'proven'))
234
+ return 'proven';
235
+ if (rows.some((row) => row.truth === 'verified'))
236
+ return 'verified';
237
+ if (rows.some((row) => row.truth === 'partial'))
238
+ return 'partial';
239
+ if (rows.some((row) => row.truth === 'skipped'))
240
+ return 'skipped';
241
+ return 'assumed';
242
+ }
243
+ function evaluateFakeRealPolicy({ summary = {}, evidenceRows = [], options = {} }) {
244
+ const fakeClaims = evidenceRows.filter((row) => ['fixture_only'].includes(row.truth)).map((row) => `${row.kind}:${row.value}`);
245
+ const realClaims = evidenceRows.filter((row) => ['verified', 'proven'].includes(row.truth)).map((row) => `${row.kind}:${row.value}`);
246
+ const blockers = [];
247
+ if (options.requireRealRuntime && !hasRuntimeProof(evidenceRows))
248
+ blockers.push('real_runtime_required_missing');
249
+ if (summary.truth === 'verified' && fakeClaims.length && !realClaims.length)
250
+ blockers.push('fixture_or_fake_evidence_cannot_verify_real_status');
251
+ const proofLevel = blockers.length ? 'real_required_missing'
252
+ : fakeClaims.length && !realClaims.length ? 'fixture_only'
253
+ : realClaims.some((claim) => claim.startsWith('runtime:') || claim.startsWith('cleanup:')) ? 'proven'
254
+ : realClaims.length ? 'verified'
255
+ : 'assumed';
256
+ return {
257
+ schema: 'yam.fake-real-policy.v1',
258
+ ok: blockers.length === 0,
259
+ proof_level: proofLevel,
260
+ fake_claims: fakeClaims,
261
+ real_claims: realClaims,
262
+ blockers
263
+ };
264
+ }
265
+ function hasRuntimeProof(rows = []) {
266
+ return rows.some((row) => (row.kind === 'runtime' || row.kind === 'cleanup') && ['proven', 'verified'].includes(row.truth));
267
+ }
268
+ function hasRealVisualProof(rows = []) {
269
+ return rows.some((row) => row.kind === 'visual' && row.truth === 'verified');
270
+ }
271
+ function runtimeLevelFor(rows = [], pattern, required = false) {
272
+ const matching = rows.filter((row) => row.kind === 'runtime' && pattern.test(row.value));
273
+ if (!matching.length)
274
+ return required ? 'real_required_missing' : 'integration_optional';
275
+ return strongestSupportedTruth(matching);
276
+ }
277
+ function runtimeRow(subsystem, proofLevel, required) {
278
+ return {
279
+ subsystem,
280
+ proof_level: proofLevel,
281
+ required: Boolean(required),
282
+ next_action: proofLevel === 'integration_optional' || proofLevel === 'real_required_missing'
283
+ ? `collect ${subsystem} evidence when the claim requires it`
284
+ : 'no action required'
285
+ };
286
+ }
287
+ function evidenceRow(kind, value, truth) {
288
+ return { kind, value: String(value || ''), truth };
289
+ }
290
+ function hasText(values = [], pattern) {
291
+ return values.some((value) => pattern.test(String(value || '')));
292
+ }
293
+ function asList(value) {
294
+ if (!value)
295
+ return [];
296
+ return Array.isArray(value) ? value.filter(Boolean).map(String) : [String(value)].filter(Boolean);
297
+ }
298
+ function uniqueStrings(values = []) {
299
+ return [...new Set(values.filter(Boolean).map(String))];
300
+ }
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "yam-flow",
3
+ "version": "0.1.0",
4
+ "description": "Progressive proof-first agent flow: start fast, deepen deliberately, stay honest by design.",
5
+ "type": "module",
6
+ "author": "0kim0bos",
7
+ "homepage": "https://github.com/0kim0bos/yam#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/0kim0bos/yam.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/0kim0bos/yam/issues"
14
+ },
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
18
+ "bin": {
19
+ "yam": "dist/bin/yam.js"
20
+ },
21
+ "types": "dist/lib/trust-kernel.d.ts",
22
+ "exports": {
23
+ "./trust-kernel": {
24
+ "types": "./dist/lib/trust-kernel.d.ts",
25
+ "import": "./dist/lib/trust-kernel.js"
26
+ }
27
+ },
28
+ "files": [
29
+ "AGENTS.md",
30
+ "COMMANDS.md",
31
+ "DECISIONS.md",
32
+ "LICENSE",
33
+ "README.md",
34
+ "ROADMAP.md",
35
+ "dist",
36
+ "src",
37
+ "tsconfig.json",
38
+ "references",
39
+ "skills",
40
+ "templates",
41
+ "yam.manifest.json"
42
+ ],
43
+ "scripts": {
44
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
45
+ "build": "npm run clean && tsc -p tsconfig.json",
46
+ "typecheck": "tsc -p tsconfig.json --noEmit",
47
+ "install:skills": "node ./dist/bin/yam.js install",
48
+ "uninstall:skills": "node ./dist/bin/yam.js uninstall",
49
+ "status": "node ./dist/bin/yam.js status",
50
+ "verify": "node ./dist/bin/yam.js verify",
51
+ "doctor": "node ./dist/bin/yam.js doctor",
52
+ "list": "node ./dist/bin/yam.js list",
53
+ "examples": "node ./dist/bin/yam.js examples",
54
+ "verify:self": "npm run build && node --check ./dist/bin/yam.js && node --check ./dist/lib/trust-kernel.js && node ./dist/bin/yam.js verify && node ./dist/bin/yam.js doctor",
55
+ "prepare": "npm run build",
56
+ "prepack": "npm run verify:self",
57
+ "prepublishOnly": "npm run verify:self",
58
+ "pack:dry-run": "npm pack --dry-run",
59
+ "publish:dry": "npm publish --dry-run --access public",
60
+ "forbidden-names:check": "node ./scripts/check-forbidden-names.mjs",
61
+ "package-boundary:check": "node ./scripts/check-package-boundary.mjs",
62
+ "dist:freshness": "node ./scripts/check-dist-freshness.mjs",
63
+ "registry:check": "node ./scripts/check-registry-version.mjs",
64
+ "cli-smoke": "node ./scripts/cli-smoke.mjs",
65
+ "release:check": "npm run typecheck && npm run forbidden-names:check && npm run verify:self && npm run dist:freshness && npm run package-boundary:check && npm run registry:check && npm run cli-smoke",
66
+ "budget": "node ./dist/bin/yam.js budget",
67
+ "measure": "node ./dist/bin/yam.js measure",
68
+ "tools": "node ./dist/bin/yam.js tools",
69
+ "proof": "node ./dist/bin/yam.js proof",
70
+ "safety": "node ./dist/bin/yam.js safety",
71
+ "detect": "node ./dist/bin/yam.js detect",
72
+ "pack": "node ./dist/bin/yam.js pack",
73
+ "memory": "node ./dist/bin/yam.js memory",
74
+ "template": "node ./dist/bin/yam.js template",
75
+ "tune-log": "node ./dist/bin/yam.js tune-log",
76
+ "init-project": "node ./dist/bin/yam.js init-project"
77
+ },
78
+ "keywords": [
79
+ "codex",
80
+ "harness",
81
+ "codex-skills",
82
+ "ai-agents",
83
+ "developer-tools",
84
+ "verification",
85
+ "ui-review",
86
+ "proof-first",
87
+ "skills",
88
+ "proof",
89
+ "ui"
90
+ ],
91
+ "publishConfig": {
92
+ "access": "public",
93
+ "registry": "https://registry.npmjs.org/",
94
+ "tag": "latest"
95
+ },
96
+ "license": "MIT",
97
+ "devDependencies": {
98
+ "@types/node": "^25.9.1",
99
+ "typescript": "^6.0.3"
100
+ }
101
+ }
@@ -0,0 +1,59 @@
1
+ # Context Reuse
2
+
3
+ One purpose of `yam` is to avoid re-reading the whole project and re-planning from scratch every run.
4
+
5
+ Default order:
6
+
7
+ ```text
8
+ 1. Read project direction pack if present.
9
+ 2. Read `.yam/memory/summary.md` only when repeated mistakes or direction changes matter.
10
+ 3. Read the specific files needed for the request.
11
+ 4. Reuse known commands and constraints from the pack.
12
+ 5. Expand context only when evidence shows the pack is stale or incomplete.
13
+ ```
14
+
15
+ Preferred project pack:
16
+
17
+ ```text
18
+ yam.project.md
19
+ ```
20
+
21
+ What it should contain:
22
+
23
+ - Product direction.
24
+ - Current UI/design direction.
25
+ - Tech stack.
26
+ - Important commands.
27
+ - Test/build expectations.
28
+ - Key directories.
29
+ - Things not to do.
30
+ - Current known risks.
31
+ - Recent decisions.
32
+
33
+ Optional memory summary:
34
+
35
+ ```text
36
+ .yam/memory/summary.md
37
+ ```
38
+
39
+ Use it only for known wrong decisions, repeated mistakes, direction changes, and lessons that would otherwise be rediscovered.
40
+
41
+ Rules:
42
+
43
+ - Do not regenerate a broad plan when `yam.project.md` already answers the direction question.
44
+ - Do not reread architecture docs unless the task touches architecture.
45
+ - Do not reread full design docs for tiny UI work when the pack has the relevant style direction.
46
+ - If the pack is stale, update the pack narrowly instead of carrying stale assumptions in chat.
47
+ - Keep the pack short; it is a context-saving artifact, not a second README.
48
+ - Do not read every `.yam/memory/records/*.json` file by default; use `yam memory summary`.
49
+ - Follow `references/markdown-management.md` when creating or updating markdown surfaces.
50
+
51
+ Suggested size:
52
+
53
+ ```text
54
+ 500 to 1200 words.
55
+ ```
56
+
57
+ Truth rule:
58
+
59
+ If no project pack exists, say that direction was inferred from local files, not from a maintained project pack.
@@ -0,0 +1,45 @@
1
+ # Current Docs Rule
2
+
3
+ Use current docs proof only when stale knowledge is a realistic risk.
4
+
5
+ ## Require Current Docs Proof
6
+
7
+ Use Context7, official docs, or primary sources when the task depends on current behavior for:
8
+
9
+ - modern SDK/API syntax
10
+ - cloud services such as Supabase, Vercel, OpenAI, Stripe, or auth providers
11
+ - framework version behavior, migration, deprecation, or breaking changes
12
+ - CLI flags, deployment behavior, pricing/limits, security rules, or platform integrations
13
+ - user wording such as latest, current, recently changed, new version, official docs, migration, or upgrade
14
+
15
+ ## Usually Skip
16
+
17
+ Do not force current-docs proof for:
18
+
19
+ - stable programming concepts
20
+ - local codebase pattern matching
21
+ - small copy/CSS/UI polish
22
+ - questions answered by the project pack or local source
23
+ - implementation that follows already-installed project conventions without external API uncertainty
24
+
25
+ ## Output Line
26
+
27
+ Use one concise line:
28
+
29
+ ```text
30
+ Current-docs proof: Context7/official docs checked for <SDK/service>; result applied to <decision>.
31
+ ```
32
+
33
+ Or:
34
+
35
+ ```text
36
+ Current-docs proof: skipped because this was stable/local/non-SDK work.
37
+ ```
38
+
39
+ ## Design Baseline
40
+
41
+ Strict proof favors source-backed evidence for current tool behavior.
42
+
43
+ Modular skill workflows keep research/context selective and low-context.
44
+
45
+ Minimal-core design says the rule is useful only when it changes the answer.
@@ -0,0 +1,40 @@
1
+ # DB/Supabase Safety Lite
2
+
3
+ This is an advisory proof-first trust layer, not a database scanner.
4
+
5
+ Use it when a prompt, command, migration, or code change touches database mutation, Supabase, RLS, production data, or schema changes.
6
+
7
+ ## Risk Signals
8
+
9
+ Recommend `$deep` when you see:
10
+
11
+ - `DROP`, `TRUNCATE`, `DELETE FROM`, broad `UPDATE`, or `ALTER TABLE`.
12
+ - `supabase db reset`, `supabase db push`, migration generation, migration apply, or remote/linked project commands.
13
+ - ORM migration commands such as Prisma, Drizzle, Knex, or Sequelize migrations.
14
+ - RLS/policy/permission changes: `CREATE POLICY`, `ALTER POLICY`, `GRANT`, `REVOKE`.
15
+ - Production/remote signals: `prod`, `production`, `live`, `DATABASE_URL`, `service_role`, `--db-url`, `--linked`, `--remote`, or `--project-ref`.
16
+
17
+ ## Guardrail
18
+
19
+ Before claiming safe:
20
+
21
+ - identify local/staging/production target
22
+ - prefer read-only inspection first
23
+ - require explicit user approval for destructive or production writes
24
+ - know the rollback or backup path when data can be lost
25
+ - run the smallest honest verification that matches the claim
26
+
27
+ ## Truth Language
28
+
29
+ - Pattern detection is `assumed`, not proof.
30
+ - Read-only inspection can be `partial` or `verified` for the inspected surface.
31
+ - A successful migration command is not automatically safe; it only proves that command execution completed.
32
+ - Do not claim production safety without environment evidence.
33
+
34
+ ## Design Baseline
35
+
36
+ Strict proof would gate destructive DB work more aggressively.
37
+
38
+ Modular skill workflows keep the check selective and evidence-bound.
39
+
40
+ Minimal-core design keeps this as a short rule and a small detector, not a full DB policy engine.