lobsidian 1.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.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +186 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +15 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/commands/init.d.ts +2 -0
  7. package/dist/commands/init.js +24 -0
  8. package/dist/commands/init.js.map +1 -0
  9. package/dist/commands/validate.d.ts +2 -0
  10. package/dist/commands/validate.js +35 -0
  11. package/dist/commands/validate.js.map +1 -0
  12. package/dist/lib/content.d.ts +11 -0
  13. package/dist/lib/content.js +80 -0
  14. package/dist/lib/content.js.map +1 -0
  15. package/dist/lib/frontmatter.d.ts +29 -0
  16. package/dist/lib/frontmatter.js +372 -0
  17. package/dist/lib/frontmatter.js.map +1 -0
  18. package/dist/lib/scaffold.d.ts +7 -0
  19. package/dist/lib/scaffold.js +105 -0
  20. package/dist/lib/scaffold.js.map +1 -0
  21. package/dist/lib/slug.d.ts +13 -0
  22. package/dist/lib/slug.js +96 -0
  23. package/dist/lib/slug.js.map +1 -0
  24. package/dist/lib/validate/checks.d.ts +23 -0
  25. package/dist/lib/validate/checks.js +777 -0
  26. package/dist/lib/validate/checks.js.map +1 -0
  27. package/dist/lib/validate/fix.d.ts +7 -0
  28. package/dist/lib/validate/fix.js +75 -0
  29. package/dist/lib/validate/fix.js.map +1 -0
  30. package/dist/lib/validate/index.d.ts +37 -0
  31. package/dist/lib/validate/index.js +88 -0
  32. package/dist/lib/validate/index.js.map +1 -0
  33. package/dist/lib/validate/report.d.ts +3 -0
  34. package/dist/lib/validate/report.js +77 -0
  35. package/dist/lib/validate/report.js.map +1 -0
  36. package/dist/lib/vault.d.ts +28 -0
  37. package/dist/lib/vault.js +119 -0
  38. package/dist/lib/vault.js.map +1 -0
  39. package/dist/lib/wikilink.d.ts +45 -0
  40. package/dist/lib/wikilink.js +156 -0
  41. package/dist/lib/wikilink.js.map +1 -0
  42. package/embedded/agent.md +91 -0
  43. package/embedded/config.md.tmpl +48 -0
  44. package/embedded/dashboard.md +35 -0
  45. package/embedded/domains/default.md.tmpl +44 -0
  46. package/embedded/examples/example-cdn-caching.md +53 -0
  47. package/embedded/examples/example-configure-cloudfront.md +56 -0
  48. package/embedded/examples/example-website-performance.md +36 -0
  49. package/embedded/gitignore +4 -0
  50. package/embedded/procedures/cascade.md +33 -0
  51. package/embedded/procedures/context-extraction.md +43 -0
  52. package/embedded/procedures/facilitation.md +43 -0
  53. package/embedded/procedures/review-cycle.md +47 -0
  54. package/embedded/start-here.md +60 -0
  55. package/embedded/templates/decision.md +29 -0
  56. package/embedded/templates/domain.md +46 -0
  57. package/embedded/templates/log.md +12 -0
  58. package/embedded/templates/motive.md +25 -0
  59. package/embedded/templates/note.md +13 -0
  60. package/embedded/templates/task.md +39 -0
  61. package/package.json +50 -0
@@ -0,0 +1,156 @@
1
+ const wikiLinkRe = /\[\[([^\]]+)\]\]/g;
2
+ /** ExtractWikiLinks finds all [[target]] references in text. */
3
+ export function extractWikiLinks(text) {
4
+ const links = [];
5
+ // Reset lastIndex for global regex
6
+ wikiLinkRe.lastIndex = 0;
7
+ let match;
8
+ while ((match = wikiLinkRe.exec(text)) !== null) {
9
+ links.push({
10
+ raw: match[0],
11
+ target: match[1],
12
+ });
13
+ }
14
+ return links;
15
+ }
16
+ /** ExtractFromFrontmatter extracts wiki-links from all string values in frontmatter fields. */
17
+ export function extractFromFrontmatter(fields) {
18
+ const links = [];
19
+ for (const v of Object.values(fields)) {
20
+ links.push(...extractFromValue(v));
21
+ }
22
+ return links;
23
+ }
24
+ function extractFromValue(v) {
25
+ if (typeof v === 'string') {
26
+ return extractWikiLinks(v);
27
+ }
28
+ if (Array.isArray(v)) {
29
+ const links = [];
30
+ for (const item of v) {
31
+ links.push(...extractFromValue(item));
32
+ }
33
+ return links;
34
+ }
35
+ if (v !== null && typeof v === 'object' && !Array.isArray(v)) {
36
+ const links = [];
37
+ for (const item of Object.values(v)) {
38
+ links.push(...extractFromValue(item));
39
+ }
40
+ return links;
41
+ }
42
+ return [];
43
+ }
44
+ /**
45
+ * ResolveWikiLink resolves a wiki-link target against the vault index.
46
+ * Resolution order per spec:
47
+ * 1. Exact path match (target includes path separator)
48
+ * 2. Filename-only case-insensitive stem match
49
+ * 3. Archive/ fallback (same stem match in Archive/)
50
+ * Ambiguous = unresolved (multiple matches outside Archive/).
51
+ */
52
+ export function resolveWikiLink(link, idx) {
53
+ let target = link.target;
54
+ // Strip .md extension if present for matching
55
+ if (target.endsWith('.md')) {
56
+ target = target.slice(0, -3);
57
+ }
58
+ const result = {
59
+ link,
60
+ resolved: false,
61
+ matchPath: '',
62
+ ambiguous: false,
63
+ matchCount: 0,
64
+ };
65
+ // 1. Exact path match
66
+ const pathWithExt = target + '.md';
67
+ const fiByExt = idx.filesByPath[pathWithExt];
68
+ if (fiByExt) {
69
+ result.resolved = true;
70
+ result.matchPath = fiByExt.relPath;
71
+ result.matchCount = 1;
72
+ return result;
73
+ }
74
+ // Also try without .md (might already be exact)
75
+ const fiExact = idx.filesByPath[target];
76
+ if (fiExact) {
77
+ result.resolved = true;
78
+ result.matchPath = fiExact.relPath;
79
+ result.matchCount = 1;
80
+ return result;
81
+ }
82
+ // 2. Filename-only case-insensitive match
83
+ let stem = target.toLowerCase();
84
+ // If target has path separators, extract just the filename part
85
+ const slashIdx = stem.lastIndexOf('/');
86
+ if (slashIdx >= 0) {
87
+ stem = stem.slice(slashIdx + 1);
88
+ }
89
+ const matches = idx.filesByStem[stem];
90
+ if (!matches || matches.length === 0) {
91
+ result.matchCount = 0;
92
+ return result;
93
+ }
94
+ // Filter: prefer non-Archive matches
95
+ const nonArchive = [];
96
+ const archive = [];
97
+ for (const m of matches) {
98
+ if (m.relPath.startsWith('Archive/')) {
99
+ archive.push(m);
100
+ }
101
+ else {
102
+ nonArchive.push(m);
103
+ }
104
+ }
105
+ if (nonArchive.length === 1) {
106
+ result.resolved = true;
107
+ result.matchPath = nonArchive[0].relPath;
108
+ result.matchCount = 1;
109
+ return result;
110
+ }
111
+ if (nonArchive.length > 1) {
112
+ // Ambiguous
113
+ result.ambiguous = true;
114
+ result.matchCount = nonArchive.length;
115
+ return result;
116
+ }
117
+ // 3. Archive/ fallback
118
+ if (archive.length === 1) {
119
+ result.resolved = true;
120
+ result.matchPath = archive[0].relPath;
121
+ result.matchCount = 1;
122
+ return result;
123
+ }
124
+ if (archive.length > 1) {
125
+ result.ambiguous = true;
126
+ result.matchCount = archive.length;
127
+ return result;
128
+ }
129
+ return result;
130
+ }
131
+ /** ValidateWikiLinks checks all wiki-links in the vault for broken references. */
132
+ export function validateWikiLinks(idx) {
133
+ const broken = [];
134
+ for (const fi of Object.values(idx.filesByPath)) {
135
+ if (!fi.frontmatter)
136
+ continue;
137
+ // Extract from frontmatter fields
138
+ const fmLinks = extractFromFrontmatter(fi.frontmatter.fields);
139
+ for (const link of fmLinks) {
140
+ const result = resolveWikiLink(link, idx);
141
+ if (!result.resolved) {
142
+ broken.push(result);
143
+ }
144
+ }
145
+ // Extract from body
146
+ const bodyLinks = extractWikiLinks(fi.frontmatter.body);
147
+ for (const link of bodyLinks) {
148
+ const result = resolveWikiLink(link, idx);
149
+ if (!result.resolved) {
150
+ broken.push(result);
151
+ }
152
+ }
153
+ }
154
+ return broken;
155
+ }
156
+ //# sourceMappingURL=wikilink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wikilink.js","sourceRoot":"","sources":["../../src/lib/wikilink.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAmCvC,gEAAgE;AAChE,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,mCAAmC;IACnC,UAAU,CAAC,SAAS,GAAG,CAAC,CAAC;IACzB,IAAI,KAA6B,CAAC;IAClC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,CA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,CAAC,QAAQ,EAAE,CAAC;gBACrB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,91 @@
1
+ # Lobsidian Agent Skill
2
+
3
+ You operate in a Lobsidian vault -- a structured markdown knowledge system. Follow these conventions exactly.
4
+
5
+ ## Quick Start
6
+
7
+ 1. **READ** this file to load conventions
8
+ 2. **READ** `_lobsidian/config.md` to resolve your identity:
9
+ - `LOBSIDIAN_AGENT_NAME` env var, OR matching `agents[]` entry (case-insensitive), OR fallback `"agent"`
10
+ 3. **READ** your domain file (from config) to load scope
11
+ 4. **SCAN** `Tasks/` for your `claimed`/`in-progress` tasks -- recover or release; scan for `pending` tasks
12
+ 5. **SCAN** `Decisions/` for `review_date <= today AND status: active` -- flag overdue reviews
13
+ 6. **UPDATE** `_lobsidian/dashboard.md` -- refresh status snapshot
14
+ 7. **READY** -- report status, await instructions or claim work
15
+
16
+ ## File Types
17
+
18
+ ### motive (`Motives/YYYY-MM-DD-slug.md`)
19
+ Why something needs attention. Required: `type`, `title`, `status` (open|addressed|obsolete), `situation`, `need`, `created`, `source`, `created_by`. Optional: `parent`, `bootstrapped`, `effect`, `confidence`, `updated`, `tags`, `log`.
20
+
21
+ ### decision (`Decisions/YYYY-MM-DD-slug.md`)
22
+ What was decided. Required: `type`, `title`, `status` (draft|proposed|active|under-review|superseded|retired), `motive`, `version`, `proposal`, `success_criteria`, `review_date`, `created`, `source`, `created_by`. Optional: `responsible`, `review_frequency`, `superseded_by`, `concerns`, `objections_considered`, `confidence`, `updated`, `tags`, `log`.
23
+
24
+ ### task (`Tasks/YYYY-MM-DD-slug.md`)
25
+ Concrete work. Required: `type`, `title`, `status` (pending|claimed|in-progress|blocked|done|cancelled), `created`, `source`, `created_by`. Optional: `motive`, `decision`, `assignee`, `priority` (int, lower=higher, default 5), `claimed_at`, `deliverable_format`, `deliverable_location`, `deliverable_criteria`, `timebox_minutes`, `due_date`, `outcome` (required when done), `completed_at` (required when done), `confidence`, `updated`, `tags`, `log`.
26
+
27
+ ### domain (`_lobsidian/domains/*.md`)
28
+ Scope and permissions. Fields: `type`, `name`, `purpose`, `motive`, `motives`, `includes`, `excludes`, `filled_by`, `autonomous_decisions`, `requires_consent`, `wip_limit`, `max_timebox_minutes`, `key_metrics`, `dependencies`, `review_date`, `created`, `updated`.
29
+
30
+ ### log (`Journal/YYYY-MM-DD.md`)
31
+ Chronological entries. Required: `type`, `subtype` (daily|activity|meeting|reflection), `date`, `created_by`, `source`. Optional: `motive`, `tags`, `confidence`.
32
+
33
+ ### note (`Knowledge/topic-slug.md`)
34
+ Knowledge artifacts. Required: `type`, `title`, `source`, `created_by`, `created`. Optional: `topics`, `confidence`, `updated`, `tags`.
35
+
36
+ ## Folder & Naming
37
+
38
+ | Folder | Content | Naming |
39
+ |--------|---------|--------|
40
+ | `Motives/` | Problems, opportunities | `YYYY-MM-DD-slug.md` |
41
+ | `Decisions/` | What was decided | `YYYY-MM-DD-slug.md` |
42
+ | `Tasks/` | Work items | `YYYY-MM-DD-slug.md` |
43
+ | `Knowledge/` | Reference material | `topic-slug.md` |
44
+ | `Journal/` | Daily/activity logs | `YYYY-MM-DD.md` |
45
+ | `Inbox/` | Unprocessed items | any name |
46
+ | `Archive/` | Completed items | mirrors source folders |
47
+ | `_lobsidian/` | System (read-only*) | managed by protocol |
48
+
49
+ Slugs: lowercase `[a-z0-9-]`, max 60 chars, derived from title. Collision: append `-2`, `-3`.
50
+
51
+ Wiki-links: always quoted `"[[filename]]"`. Scan all folders recursively.
52
+
53
+ *`_lobsidian/` write exceptions: domain `motives[]` array, `dashboard.md`, `index.json` (v1.1).
54
+
55
+ ## Behavioral Rules
56
+
57
+ 1. **Transparency**: Log every create/modify/archive action in the file's `log` array. Format: `"ISO-timestamp agent-name: action description"`. Keep 20 most recent entries; summarize older on archive.
58
+
59
+ 2. **Accountability**: Every task has an assignee. Blocked tasks surface explicitly. If unable to complete, release with a note.
60
+
61
+ 3. **Empiricism**: Agent-created content includes `confidence` (high|medium|low). Claims cite their basis.
62
+
63
+ 4. **Effectiveness**: Before creating a file, verify it serves a stated motive. No speculative content.
64
+
65
+ 5. **Continuous Improvement**: Check for overdue `review_date` at session start. Do NOT unilaterally change vault conventions.
66
+
67
+ 6. **Consent**: Agent-created decisions start as `draft` or `proposed`. NEVER set `status: active` on your own decisions. Human consent required for: decision activation, file deletion, domain changes.
68
+
69
+ ## Domain & Pull System
70
+
71
+ - Check your domain's `includes`/`excludes` before any file operation
72
+ - Check `autonomous_decisions` vs `requires_consent` before acting
73
+ - **Pull system**: Scan `status: pending AND assignee: null`, claim lowest priority number, respect WIP limit (default 3)
74
+ - Set `assignee`, `status: claimed`, `claimed_at` on claim; `status: done`, `outcome`, `completed_at` on completion
75
+
76
+ ## Consent Gate
77
+
78
+ Decisions require human approval. When proposing:
79
+ 1. Create with `status: proposed`
80
+ 2. Ask: *"Before I proceed: is there anything about this that would cause problems?"*
81
+ 3. Wait for explicit consent before setting `status: active`
82
+ 4. Log consent with timestamp and method
83
+
84
+ ## Procedures (load on demand)
85
+
86
+ | Trigger | Load |
87
+ |---------|------|
88
+ | Obsoleting a parent motive | `_lobsidian/procedures/cascade.md` |
89
+ | User mentions a problem or goal | `_lobsidian/procedures/facilitation.md` |
90
+ | Decision `review_date` reached | `_lobsidian/procedures/review-cycle.md` |
91
+ | Initial vault setup / onboarding | `_lobsidian/procedures/context-extraction.md` |
@@ -0,0 +1,48 @@
1
+ ---
2
+ type: config
3
+ vault_name: "{{.VaultName}}"
4
+ protocol_version: "1.0.0"
5
+
6
+ agents:
7
+ - name: {{.AgentName}}
8
+ domain: "[[_lobsidian/domains/default.md]]"
9
+
10
+ defaults:
11
+ review_frequency: quarterly
12
+ wip_limit: 3
13
+ inbox_stale_days: 14
14
+ archive_completed_after_days: 7
15
+ default_priority: 5
16
+ claim_wait_seconds: 2
17
+ claim_file_timeout_seconds: 300
18
+ stale_task_timeout_minutes: 120
19
+ min_motives_to_run: 8
20
+ min_cluster_size: 4
21
+ default_domain_scope:
22
+ - "Motives/"
23
+ - "Decisions/"
24
+ - "Tasks/"
25
+ - "Knowledge/"
26
+ - "Journal/"
27
+ - "Inbox/"
28
+ ---
29
+
30
+ # Vault Configuration
31
+
32
+ This file configures the Lobsidian protocol for this vault.
33
+
34
+ ## Agent Identity Resolution
35
+
36
+ 1. `LOBSIDIAN_AGENT_NAME` environment variable
37
+ 2. Matching entry in `agents[]` list (case-insensitive)
38
+ 3. Fallback: `"agent"`
39
+
40
+ Agent names must be unique, case-insensitive, kebab-case `[a-z0-9-]`.
41
+
42
+ ## Adding Agents
43
+
44
+ Add entries to the `agents[]` list above. Each agent needs a unique name and a domain reference.
45
+
46
+ ## Defaults
47
+
48
+ All defaults can be overridden per-domain or per-file. Precedence: per-file > domain-level > defaults.
@@ -0,0 +1,35 @@
1
+ ---
2
+ type: dashboard
3
+ updated_at: null
4
+ updated_by: null
5
+ ---
6
+
7
+ ## Pending Consents
8
+
9
+ Decisions with `status: proposed` awaiting human review.
10
+
11
+ _None yet._
12
+
13
+ ## Overdue Reviews
14
+
15
+ Decisions with `review_date` in the past and `status: active`.
16
+
17
+ _None yet._
18
+
19
+ ## Available Tasks
20
+
21
+ Tasks with `status: pending` and `assignee: null`, sorted by priority.
22
+
23
+ _None yet._
24
+
25
+ ## Blocked Tasks
26
+
27
+ Tasks with `status: blocked`, grouped by reason.
28
+
29
+ _None yet._
30
+
31
+ ## Recent Completions
32
+
33
+ Tasks completed in the last 7 days.
34
+
35
+ _None yet._
@@ -0,0 +1,44 @@
1
+ ---
2
+ type: domain
3
+ name: "Default"
4
+ purpose: >
5
+ General-purpose domain for {{.VaultName}}. Covers all standard vault folders.
6
+ motive: null
7
+ motives: []
8
+
9
+ includes:
10
+ - "Motives/"
11
+ - "Decisions/"
12
+ - "Tasks/"
13
+ - "Knowledge/"
14
+ - "Journal/"
15
+ - "Inbox/"
16
+ excludes:
17
+ - "_lobsidian/"
18
+ - "*.env"
19
+
20
+ filled_by: {{.AgentName}}
21
+ autonomous_decisions:
22
+ - "Create and edit files within included paths"
23
+ - "Claim tasks whose deliverable location is within scope"
24
+ - "Create motive files for problems observed within scope"
25
+ requires_consent:
26
+ - "Delete any file"
27
+ - "Modify domain definitions"
28
+ - "Create decisions"
29
+ - "Move files outside domain scope"
30
+
31
+ wip_limit: 3
32
+ max_timebox_minutes: 120
33
+
34
+ key_metrics: []
35
+ dependencies: []
36
+
37
+ review_date: {{.ReviewDate}}
38
+ created: {{.Date}}
39
+ updated: {{.Date}}
40
+ ---
41
+
42
+ This is the default domain for this vault. It grants access to all standard folders.
43
+
44
+ To create additional domains, add files to `_lobsidian/domains/` and register agents in `_lobsidian/config.md`.
@@ -0,0 +1,53 @@
1
+ ---
2
+ type: decision
3
+ title: "Implement CDN caching for static assets"
4
+ status: active
5
+ motive: "[[2026-01-01-example-website-performance]]"
6
+ version: 1
7
+ proposal: >
8
+ Set up CloudFront as a CDN for all static assets (images, CSS, JS).
9
+ Configure cache headers for 30-day expiry on versioned assets.
10
+ Enable Brotli compression at the edge.
11
+ success_criteria:
12
+ - "Lighthouse performance score above 90"
13
+ - "Page load time under 2 seconds on 3G connection"
14
+ - "Cache hit ratio above 95% after 7 days"
15
+ review_date: 2026-04-01
16
+ review_frequency: quarterly
17
+ created: 2026-01-01
18
+ source: human
19
+ created_by: "human"
20
+ responsible: "{{.AgentName}}"
21
+ confidence: high
22
+ updated: 2026-01-01
23
+ tags:
24
+ - infrastructure
25
+ - performance
26
+ concerns: []
27
+ objections_considered:
28
+ - "Cost of CloudFront -- estimated $50/month, acceptable for expected traffic"
29
+ log:
30
+ - "2026-01-01T10:15:00Z human: created decision in response to website performance motive"
31
+ - "2026-01-01T10:20:00Z human: status set to proposed for review"
32
+ - "2026-01-01T10:25:00Z human: consented, status set to active"
33
+ ---
34
+
35
+ <!-- EXAMPLE: This is an example decision file. Delete it when you're ready. -->
36
+
37
+ <!-- EXAMPLE: `type: decision` captures WHAT was decided in response to a motive. -->
38
+ <!-- EXAMPLE: `motive` links back to the parent motive via wiki-link. -->
39
+ <!-- EXAMPLE: `proposal` explains the approach. -->
40
+ <!-- EXAMPLE: `success_criteria` defines measurable outcomes. -->
41
+ <!-- EXAMPLE: `review_date` is when this decision will be revisited. -->
42
+ <!-- EXAMPLE: `status` went through draft -> proposed -> active (consent flow). -->
43
+ <!-- EXAMPLE: This decision links to: Motives/2026-01-01-example-website-performance.md -->
44
+ <!-- EXAMPLE: Task created from this: Tasks/2026-01-01-example-configure-cloudfront.md -->
45
+
46
+ ## Rationale
47
+
48
+ CloudFront provides global edge locations with low latency. Combined with proper cache headers and Brotli compression, this should dramatically improve load times for static assets which make up 80% of page weight.
49
+
50
+ ## Alternatives Considered
51
+
52
+ - **Self-hosted Nginx caching**: Lower cost but requires server management and doesn't provide global edge coverage.
53
+ - **Cloudflare**: Similar capabilities but CloudFront integrates better with our existing AWS infrastructure.
@@ -0,0 +1,56 @@
1
+ ---
2
+ type: task
3
+ title: "Configure CloudFront distribution for static assets"
4
+ status: done
5
+ motive: "[[2026-01-01-example-website-performance]]"
6
+ decision: "[[2026-01-01-example-cdn-caching]]"
7
+ created: 2026-01-01
8
+ source: agent
9
+ created_by: "{{.AgentName}}"
10
+ assignee: "{{.AgentName}}"
11
+ priority: 2
12
+ claimed_at: "2026-01-01T11:00:00Z"
13
+ deliverable_format: "infrastructure configuration"
14
+ deliverable_location: "Knowledge/"
15
+ deliverable_criteria:
16
+ - "CloudFront distribution active and serving traffic"
17
+ - "Cache headers set to 30-day expiry for versioned assets"
18
+ - "Brotli compression enabled"
19
+ - "Lighthouse score measured and documented"
20
+ timebox_minutes: 120
21
+ due_date: 2026-01-08
22
+ outcome: >
23
+ CloudFront distribution configured and active. Lighthouse score
24
+ improved from 38 to 94. Page load time reduced to 1.4 seconds on
25
+ 3G. Cache hit ratio at 97% after initial warmup.
26
+ completed_at: "2026-01-03T16:45:00Z"
27
+ confidence: high
28
+ updated: 2026-01-03
29
+ tags:
30
+ - infrastructure
31
+ - performance
32
+ log:
33
+ - "2026-01-01T11:00:00Z {{.AgentName}}: claimed task, starting CloudFront setup"
34
+ - "2026-01-01T11:05:00Z {{.AgentName}}: status set to in-progress"
35
+ - "2026-01-02T14:30:00Z {{.AgentName}}: distribution created, configuring cache behaviors"
36
+ - "2026-01-03T16:45:00Z {{.AgentName}}: completed -- Lighthouse 94, load time 1.4s"
37
+ ---
38
+
39
+ <!-- EXAMPLE: This is an example task file. Delete it when you're ready. -->
40
+
41
+ <!-- EXAMPLE: `type: task` captures CONCRETE WORK to be done. -->
42
+ <!-- EXAMPLE: `motive` and `decision` link this task to its parent chain. -->
43
+ <!-- EXAMPLE: `assignee` shows who claimed this task (pull system). -->
44
+ <!-- EXAMPLE: `priority: 2` means high priority (lower number = higher priority). -->
45
+ <!-- EXAMPLE: `deliverable_*` fields specify what the output should be. -->
46
+ <!-- EXAMPLE: `outcome` is filled when `status: done` -- describes what was achieved. -->
47
+ <!-- EXAMPLE: `completed_at` is set when the task is finished. -->
48
+ <!-- EXAMPLE: The `log` array tracks all significant actions chronologically. -->
49
+
50
+ ## Notes
51
+
52
+ - Created CloudFront distribution with origin pointing to S3 bucket
53
+ - Configured cache behaviors: `*.js`, `*.css` with 30-day TTL; images with 90-day TTL
54
+ - Enabled Brotli compression via CloudFront function
55
+ - Updated DNS to route static asset subdomain through CloudFront
56
+ - Ran Lighthouse audit: score 94 (up from 38)
@@ -0,0 +1,36 @@
1
+ ---
2
+ type: motive
3
+ title: "Improve website performance"
4
+ status: addressed
5
+ situation: >
6
+ The company website takes over 6 seconds to load on mobile devices.
7
+ Lighthouse performance score is 38 out of 100.
8
+ need: >
9
+ Reduce page load time to under 2 seconds and achieve a Lighthouse
10
+ score above 90.
11
+ effect: >
12
+ Slow load times are causing a 40% bounce rate on mobile, directly
13
+ impacting lead generation and revenue.
14
+ created: 2026-01-01
15
+ source: human
16
+ created_by: "human"
17
+ confidence: high
18
+ updated: 2026-01-01
19
+ tags:
20
+ - infrastructure
21
+ - performance
22
+ log:
23
+ - "2026-01-01T10:00:00Z human: created motive from website audit findings"
24
+ - "2026-01-01T10:30:00Z human: status set to addressed after CDN decision activated"
25
+ ---
26
+
27
+ <!-- EXAMPLE: This is an example motive file. Delete it when you're ready. -->
28
+
29
+ <!-- EXAMPLE: `type: motive` captures WHY something needs attention. -->
30
+ <!-- EXAMPLE: `situation` describes what is objectively happening. -->
31
+ <!-- EXAMPLE: `need` describes what must change. -->
32
+ <!-- EXAMPLE: `effect` (optional) explains why this matters. -->
33
+ <!-- EXAMPLE: `status` is "addressed" because a decision (CDN caching) is active. -->
34
+ <!-- EXAMPLE: This motive links to: Decisions/2026-01-01-example-cdn-caching.md -->
35
+
36
+ The website audit revealed critical performance issues affecting user experience and business metrics. Core Web Vitals are failing across all mobile benchmarks.
@@ -0,0 +1,4 @@
1
+ _lobsidian/index.json
2
+ Tasks/.claims/
3
+ .DS_Store
4
+ .obsidian/workspace*.json
@@ -0,0 +1,33 @@
1
+ # Cascade-with-Confirmation
2
+
3
+ Load this procedure when obsoleting a parent motive.
4
+
5
+ ## Protocol (7 steps)
6
+
7
+ 1. **Set parent status**: Mark the parent motive `status: obsolete` with `cascade_in_progress: true`. This prevents new decisions from being linked during cascade.
8
+
9
+ 2. **Inventory**: Gather all affected items -- sub-motives, decisions, tasks -- linked to the parent motive. Write a checkpoint file to `Inbox/cascade-<parent-slug>.md` with `type: cascade-checkpoint`.
10
+
11
+ 3. **Present impact tree**: Show the user everything affected:
12
+ > "If we close this, here's what's affected: [N sub-motives, M decisions, K tasks]. Some of these may still be relevant on their own. Let me walk through them."
13
+
14
+ 4. **Disposition each sub-motive** (ask the user for each):
15
+ - **Obsolete**: cascade recursively (same protocol)
16
+ - **Reparent**: change `parent` to a different motive or `null` (top-level)
17
+ - **Keep as-is**: set `parent` to `null`, preserve status and content
18
+
19
+ 5. **Process decisions** linked to obsoleted motives:
20
+ - `active` or `under-review`: set to `retired`, archive
21
+ - `draft` or `proposed`: set to `retired`
22
+ - Decisions linked to reparented sub-motives: unaffected
23
+
24
+ 6. **Process tasks** linked to obsoleted motives or retired decisions:
25
+ - `done`: archive normally
26
+ - `pending` or `claimed`: set to `cancelled` with reason `"parent motive obsoleted"`
27
+ - `in-progress`: ask user -- cancel or finish first?
28
+
29
+ 7. **Complete**: Remove `cascade_in_progress` from parent motive. Archive all obsoleted/retired/cancelled items. Archive the checkpoint file.
30
+
31
+ ## Resumability
32
+
33
+ If interrupted, read `Inbox/cascade-<parent-slug>.md` to find the checkpoint. Resume from the last unprocessed item. Before starting a new cascade, check for existing checkpoints with the same `parent_slug`.
@@ -0,0 +1,43 @@
1
+ # Context Extraction (Phase 1 -- Paste Text)
2
+
3
+ Load this procedure during initial vault setup or onboarding.
4
+
5
+ ## When to Use
6
+
7
+ When a user is new to their vault and wants to bootstrap it with existing context. Ask:
8
+ *"What are you working on? Paste any notes, emails, or thoughts and I'll help you organize them."*
9
+
10
+ ## Steps
11
+
12
+ ### 1. Receive Text
13
+
14
+ User pastes text (emails, notes, thoughts) into conversation.
15
+
16
+ ### 2. Extract Candidates
17
+
18
+ Identify candidate motives from the text. For each, write to `Inbox/bootstrap-motives/YYYY-MM-DD-slug.md` with:
19
+ - `status: open`
20
+ - `confidence: low`
21
+ - `source: bootstrap`
22
+ - `bootstrapped: true`
23
+
24
+ ### 3. Present One at a Time
25
+
26
+ For each candidate:
27
+ *"It looks like this might matter: [situation]. Want to track it?"*
28
+
29
+ ### 4. Process Response
30
+
31
+ - **Accepted**: Move file to `Motives/`, keep `bootstrapped: true`
32
+ - **Edited**: Revise based on feedback, then promote
33
+ - **Skipped**: Leave in `Inbox/bootstrap-motives/` with `skipped: true` flag
34
+
35
+ ### 5. Wrap Up
36
+
37
+ After all candidates reviewed, run domain emergence check if motive count exceeds `min_motives_to_run` threshold (default: 8).
38
+
39
+ ## Edge Cases
40
+
41
+ - **Zero candidates**: *"I couldn't identify any clear motives from that text. Try describing a specific problem or goal you're facing, or paste different material."*
42
+ - **More than 10 candidates**: Present top 10 by confidence. Then offer: *"There are [N] more candidates. Want to continue, or save the rest for later?"*
43
+ - **Revisiting skipped**: On startup, if `Inbox/bootstrap-motives/` contains `skipped: true` files, mention: *"You have [N] skipped candidates from your initial setup. Want to revisit any?"*
@@ -0,0 +1,43 @@
1
+ # Facilitation Flow
2
+
3
+ Load this procedure when the user mentions a problem or goal.
4
+
5
+ ## Steps
6
+
7
+ ### 1. Surface a Motive
8
+
9
+ Ask three questions in natural conversation:
10
+ 1. *"What's happening right now?"* -- captures `situation`
11
+ 2. *"What's the impact? Why does this matter?"* -- captures `effect`
12
+ 3. *"What do you need to change?"* -- captures `need`
13
+
14
+ Create a `type: motive` file. If complex, propose decomposition into sub-motives.
15
+
16
+ Before creating, scan existing open motives for duplicates. If similar, link to existing rather than duplicate.
17
+
18
+ ### 2. Consider Constraints (complex motives only)
19
+
20
+ *"Before we decide what to do, here's what I think matters: [constraints, dependencies, alternatives]. Does this capture the important factors?"*
21
+
22
+ Skip for simple, obvious actions.
23
+
24
+ ### 3. Form a Decision
25
+
26
+ 1. *"What should we do about this?"* -- captures `proposal`
27
+ 2. *"How will we know it worked?"* -- captures `success_criteria`
28
+ 3. *"When should we check in on this?"* -- captures `review_date`
29
+
30
+ Create decision as `status: proposed`. Objection-seek:
31
+ *"Before I proceed: is there anything about this that would cause problems, or an important improvement I should make?"*
32
+
33
+ Human consent moves it to `active`.
34
+
35
+ ### 4. Break Into Tasks
36
+
37
+ *"To make this happen, here's what I think needs to be done: [list]. Should I get started?"*
38
+
39
+ Create `type: task` files with deliverable specs. Claim tasks within your domain scope.
40
+
41
+ ### 5. Ongoing Sensing
42
+
43
+ While working, watch for contradictions between files, recurring blockers, and stale content. Each tension can restart the cycle at Step 1.