@interf/compiler 0.1.8
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/LICENSE +183 -0
- package/README.md +1008 -0
- package/TRADEMARKS.md +19 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +30 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/benchmark.d.ts +3 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +400 -0
- package/dist/commands/benchmark.js.map +1 -0
- package/dist/commands/compile.d.ts +3 -0
- package/dist/commands/compile.d.ts.map +1 -0
- package/dist/commands/compile.js +139 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/create.d.ts +49 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +813 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/default.d.ts +3 -0
- package/dist/commands/default.d.ts.map +1 -0
- package/dist/commands/default.js +52 -0
- package/dist/commands/default.js.map +1 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +146 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +235 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +32 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/reset.d.ts +3 -0
- package/dist/commands/reset.d.ts.map +1 -0
- package/dist/commands/reset.js +136 -0
- package/dist/commands/reset.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +67 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/verify.d.ts +3 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +112 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/agents.d.ts +59 -0
- package/dist/lib/agents.d.ts.map +1 -0
- package/dist/lib/agents.js +760 -0
- package/dist/lib/agents.js.map +1 -0
- package/dist/lib/benchmark.d.ts +30 -0
- package/dist/lib/benchmark.d.ts.map +1 -0
- package/dist/lib/benchmark.js +325 -0
- package/dist/lib/benchmark.js.map +1 -0
- package/dist/lib/config.d.ts +6 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +15 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/discovery.d.ts +8 -0
- package/dist/lib/discovery.d.ts.map +1 -0
- package/dist/lib/discovery.js +80 -0
- package/dist/lib/discovery.js.map +1 -0
- package/dist/lib/executors.d.ts +33 -0
- package/dist/lib/executors.d.ts.map +1 -0
- package/dist/lib/executors.js +44 -0
- package/dist/lib/executors.js.map +1 -0
- package/dist/lib/filesystem.d.ts +4 -0
- package/dist/lib/filesystem.d.ts.map +1 -0
- package/dist/lib/filesystem.js +61 -0
- package/dist/lib/filesystem.js.map +1 -0
- package/dist/lib/interf.d.ts +37 -0
- package/dist/lib/interf.d.ts.map +1 -0
- package/dist/lib/interf.js +1104 -0
- package/dist/lib/interf.js.map +1 -0
- package/dist/lib/local-workflows.d.ts +35 -0
- package/dist/lib/local-workflows.d.ts.map +1 -0
- package/dist/lib/local-workflows.js +149 -0
- package/dist/lib/local-workflows.js.map +1 -0
- package/dist/lib/parse.d.ts +9 -0
- package/dist/lib/parse.d.ts.map +1 -0
- package/dist/lib/parse.js +51 -0
- package/dist/lib/parse.js.map +1 -0
- package/dist/lib/registry.d.ts +28 -0
- package/dist/lib/registry.d.ts.map +1 -0
- package/dist/lib/registry.js +80 -0
- package/dist/lib/registry.js.map +1 -0
- package/dist/lib/runtime.d.ts +59 -0
- package/dist/lib/runtime.d.ts.map +1 -0
- package/dist/lib/runtime.js +615 -0
- package/dist/lib/runtime.js.map +1 -0
- package/dist/lib/schema.d.ts +705 -0
- package/dist/lib/schema.d.ts.map +1 -0
- package/dist/lib/schema.js +443 -0
- package/dist/lib/schema.js.map +1 -0
- package/dist/lib/state.d.ts +49 -0
- package/dist/lib/state.d.ts.map +1 -0
- package/dist/lib/state.js +633 -0
- package/dist/lib/state.js.map +1 -0
- package/dist/lib/summarize-plan.d.ts +16 -0
- package/dist/lib/summarize-plan.d.ts.map +1 -0
- package/dist/lib/summarize-plan.js +112 -0
- package/dist/lib/summarize-plan.js.map +1 -0
- package/dist/lib/user-config.d.ts +6 -0
- package/dist/lib/user-config.d.ts.map +1 -0
- package/dist/lib/user-config.js +16 -0
- package/dist/lib/user-config.js.map +1 -0
- package/dist/lib/validate.d.ts +149 -0
- package/dist/lib/validate.d.ts.map +1 -0
- package/dist/lib/validate.js +838 -0
- package/dist/lib/validate.js.map +1 -0
- package/dist/lib/workflow-definitions.d.ts +79 -0
- package/dist/lib/workflow-definitions.d.ts.map +1 -0
- package/dist/lib/workflow-definitions.js +565 -0
- package/dist/lib/workflow-definitions.js.map +1 -0
- package/dist/lib/workflows.d.ts +125 -0
- package/dist/lib/workflows.d.ts.map +1 -0
- package/dist/lib/workflows.js +1107 -0
- package/dist/lib/workflows.js.map +1 -0
- package/package.json +73 -0
- package/skills/benchmark/SKILL.md +129 -0
- package/skills/interface/analyze/SKILL.md +140 -0
- package/skills/interface/compile/SKILL.md +153 -0
- package/skills/interface/compile/references/output-format.md +48 -0
- package/skills/interface/create/SKILL.md +264 -0
- package/skills/interface/create/references/compile-plan-format.md +109 -0
- package/skills/interface/create/references/workflows.md +50 -0
- package/skills/interface/query/SKILL.md +34 -0
- package/skills/interface/retrieve/SKILL.md +166 -0
- package/skills/knowledge-base/compile/SKILL.md +220 -0
- package/skills/knowledge-base/compile/references/output-format.md +48 -0
- package/skills/knowledge-base/compile/references/stage-claims.md +60 -0
- package/skills/knowledge-base/compile/references/stage-entities.md +46 -0
- package/skills/knowledge-base/query/SKILL.md +33 -0
- package/skills/knowledge-base/summarize/SKILL.md +122 -0
- package/skills/workflow/create/SKILL.md +126 -0
- package/templates/interface/README.md +158 -0
- package/templates/interface/interfaces.md +99 -0
- package/templates/knowledge-base/README.md +138 -0
- package/templates/knowledge-base/interfignore +19 -0
- package/templates/knowledge-base/registry.md +118 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"name": "knowledge-base/compile",
|
|
4
|
+
"description": "Compile the cross-file knowledge layer from summaries in a knowledge base. Discovers entities, claims, relationships, and navigation outputs. Builds knowledge/ and home.md layers. Use when asked to compile a knowledge base, build graph, update knowledge, or connect the dots."
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Compile Knowledge Base
|
|
9
|
+
|
|
10
|
+
Read `interf.json` for the config. Must have `type: knowledge-base`.
|
|
11
|
+
|
|
12
|
+
Local runtime reference:
|
|
13
|
+
- active stage contract: `.interf/stage-contract.json`
|
|
14
|
+
- active run ledger: `.interf/run.json`
|
|
15
|
+
- local config: `interf.json`
|
|
16
|
+
- local instruction docs: the files listed by `.interf/stage-contract.json`
|
|
17
|
+
|
|
18
|
+
When this skill is embedded into a generated knowledge base, do not try to open SDK repo docs or source files outside the current workspace. The local contract and local docs are the source of truth for this run.
|
|
19
|
+
|
|
20
|
+
This skill builds the cross-file intelligence layer from existing summaries. This is the knowledge-layer contract for a knowledge base. For per-file evidence generation, use the bundled file-evidence stage first.
|
|
21
|
+
If local docs are listed by the stage contract, read them before compiling. They may `extend` or `override` the bundled workflow instructions for this stage, but they do not bypass the stage contract.
|
|
22
|
+
|
|
23
|
+
Harness role:
|
|
24
|
+
- This skill is an internal harness step normally invoked by `interf compile`.
|
|
25
|
+
- For standard operation, prefer the CLI or another higher-level tool over calling this skill directly.
|
|
26
|
+
|
|
27
|
+
## CLI status contract
|
|
28
|
+
|
|
29
|
+
When this skill is launched by the Interf CLI, do not narrate intent or planning. Only emit user-visible updates that begin with `STATUS:`, `DONE:`, `BLOCKED:`, or `ERROR:`.
|
|
30
|
+
|
|
31
|
+
If `.interf/stage-contract.json` exists, treat it as the authoritative stage contract for this run. It defines required artifacts, counts, and execution notes. Follow it instead of improvising a different workflow.
|
|
32
|
+
|
|
33
|
+
Use this sequence:
|
|
34
|
+
- `STATUS: loaded compile plan N summary files`
|
|
35
|
+
- `STATUS: inventoried N/N` after the inventory pass is complete
|
|
36
|
+
- `STATUS: read X/N` after each deep-read batch or every 25 files, whichever comes first
|
|
37
|
+
- `STATUS: wrote graph outputs` after `knowledge/` and `home.md` are updated
|
|
38
|
+
- `DONE: compiled N/N` when `.interf/state.json` is updated successfully
|
|
39
|
+
|
|
40
|
+
If you are blocked or hit an unrecoverable issue, emit `BLOCKED:` or `ERROR:` once with the concrete reason.
|
|
41
|
+
|
|
42
|
+
## Prerequisites check
|
|
43
|
+
|
|
44
|
+
Read `.interf/state.json`. Compare `summarized` vs `compiled`.
|
|
45
|
+
|
|
46
|
+
- If `summarized == compiled` and both are current: "Knowledge base is up to date. Nothing to do." Stop.
|
|
47
|
+
- If `summarized == 0` or source folder has unprocessed files: "File-evidence stage not ready yet." Stop.
|
|
48
|
+
- Otherwise: proceed.
|
|
49
|
+
|
|
50
|
+
## Execution checklist
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Knowledge-base compile:
|
|
54
|
+
- [ ] 1. Read interf.json
|
|
55
|
+
- [ ] 2a. Inventory — scan ALL frontmatter, write .interf/inventory.json
|
|
56
|
+
- [ ] 2b. Local evidence reading — batch-read abstracts/overviews, update inventory per file
|
|
57
|
+
- [ ] 3. Canonicalize entities, threads, and aliases
|
|
58
|
+
- [ ] 4. Extract cross-file claims and relationships
|
|
59
|
+
- [ ] 5. Build retrieval indexes and navigation
|
|
60
|
+
- [ ] 6. Update state (.interf/state.json)
|
|
61
|
+
- [ ] 7. Validate
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 1. Read interf.json + local stage docs
|
|
65
|
+
|
|
66
|
+
Read `interf.json` for knowledge-base identity and paths. Read `.interf/stage-contract.json` for the active stage contract. Then read any local docs listed by the contract. The summaries in `summaries/` have this structure:
|
|
67
|
+
|
|
68
|
+
- **Frontmatter fields**: source, source_kind, evidence_tier, truth_mode, state, abstract
|
|
69
|
+
- **Sections**: overview, key claims, references when needed
|
|
70
|
+
|
|
71
|
+
This is what you're working with. Every summary has:
|
|
72
|
+
- `source` → the exact source file path
|
|
73
|
+
- `source_kind`, `evidence_tier`, `truth_mode`, `state` → use these to weight evidence and avoid flattening weak material into strong claims
|
|
74
|
+
- `abstract` → quick routing summary for inventory and interface retrieve
|
|
75
|
+
- `overview` / `key claims` → source-grounded detail for deeper reads
|
|
76
|
+
|
|
77
|
+
The compile job is to turn these file-level evidence objects into a retrieval-ready knowledge base. Use the active stage contract plus any local docs listed by it for entity discovery rules, claim derivation logic, and quality requirements.
|
|
78
|
+
|
|
79
|
+
### 2. Scan summaries and create inventory
|
|
80
|
+
|
|
81
|
+
This step has two phases — inventory (deterministic, must be complete) then analysis (can span sessions).
|
|
82
|
+
|
|
83
|
+
**Phase A: Inventory (MUST be complete before any analysis)**
|
|
84
|
+
|
|
85
|
+
Scan ALL summaries/ frontmatter. Every file. Write `.interf/inventory.json`:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"total": 2460,
|
|
90
|
+
"files": [
|
|
91
|
+
{
|
|
92
|
+
"file": "summaries/readiness assessment language.md",
|
|
93
|
+
"source": "notes/readiness.md",
|
|
94
|
+
"source_kind": "note",
|
|
95
|
+
"evidence_tier": "primary",
|
|
96
|
+
"truth_mode": "stated",
|
|
97
|
+
"state": "active",
|
|
98
|
+
"frontmatter_scanned": true,
|
|
99
|
+
"abstract_read": false,
|
|
100
|
+
"full_read": false
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"summary_map": {
|
|
104
|
+
"source_kind": {"note": 340, "plan": 280},
|
|
105
|
+
"evidence_tier": {"primary": 600, "secondary": 400},
|
|
106
|
+
"truth_mode": {"stated": 700, "reported": 120},
|
|
107
|
+
"state": {"active": 640, "draft": 80}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Verify: `total` in inventory MUST equal actual summaries/ file count. If not, stop.
|
|
113
|
+
|
|
114
|
+
This is deterministic — read frontmatter from every file, write the inventory. No analysis, no interpretation. Fast.
|
|
115
|
+
|
|
116
|
+
**Phase B: Deep read (batched, resumable across sessions)**
|
|
117
|
+
|
|
118
|
+
Work through inventory.json. For each file where `abstract_read: false`:
|
|
119
|
+
- Read the abstract section
|
|
120
|
+
- Update inventory: `abstract_read: true`
|
|
121
|
+
- Extract entity mentions, thread markers, and potential claims
|
|
122
|
+
|
|
123
|
+
For higher-weight files (`tier_1_authoritative`, `tier_2_direct_record`, or otherwise critical) where `full_read: false`:
|
|
124
|
+
- Read the full overview
|
|
125
|
+
- Update inventory: `full_read: true`
|
|
126
|
+
- Extract deeper evidence
|
|
127
|
+
|
|
128
|
+
**Batching:** Process ~200 files per batch. After each batch:
|
|
129
|
+
- Write updated inventory.json
|
|
130
|
+
- Report progress: "Abstract read: 400/2460 (16%)"
|
|
131
|
+
|
|
132
|
+
If the session ends mid-batch, the next run reads inventory.json and continues from where it left off. No work is lost.
|
|
133
|
+
|
|
134
|
+
### 3. Canonicalize entities, threads, and aliases
|
|
135
|
+
|
|
136
|
+
**Prerequisite:** inventory.json must have ALL files scanned (frontmatter_scanned: true). Deep reads (abstract_read) should be substantially complete — at least 80% of files. If not, continue Phase B first.
|
|
137
|
+
|
|
138
|
+
Use the inventory summary_map plus deep-read evidence to identify canonical entities and recurring threads. Create canonical notes in knowledge/entities/ for recurring actors:
|
|
139
|
+
- people, companies, products, concepts, projects, and durable threads
|
|
140
|
+
- Resolve aliases to one canonical note
|
|
141
|
+
- Include: summary, evidence links, related entities, first/last seen
|
|
142
|
+
- Prefer explicit wikilinks to related summaries, entities, and claims so future agents can climb outward through backlinks instead of rereading from scratch
|
|
143
|
+
|
|
144
|
+
### 4. Extract cross-file claims and relationships
|
|
145
|
+
|
|
146
|
+
**Prerequisite:** Same as entities — inventory must be complete.
|
|
147
|
+
|
|
148
|
+
Use inventory data plus deep reads to identify patterns across files. Create notes in knowledge/claims/ for cross-file observations:
|
|
149
|
+
- Must have 2+ supporting sources unless explicitly marked unresolved or exploratory
|
|
150
|
+
- Use prose-as-title: filename IS the claim
|
|
151
|
+
- Include: the claim, why it matters, evidence links, and a clear sense of evidence strength
|
|
152
|
+
- Link claims back to the supporting summaries and related entities so navigation can move claim -> evidence -> source trail cleanly
|
|
153
|
+
|
|
154
|
+
### 5. Build retrieval indexes and navigation
|
|
155
|
+
|
|
156
|
+
Create aggregate navigation in knowledge/indexes/:
|
|
157
|
+
- People.md, Companies.md, Timeline.md, Themes.md, Projects.md, Threads.md
|
|
158
|
+
- Link to canonical entities, high-signal summaries, and major claims
|
|
159
|
+
- Make the result useful for interface creation and retrieve, not just for human browsing
|
|
160
|
+
- Treat backlinks as part of the retrieval surface: notes should make it obvious how to move from a high-level concept to the supporting summaries and back again
|
|
161
|
+
|
|
162
|
+
Update `home.md` every compile run so it becomes the knowledge-base landing layer for agents.
|
|
163
|
+
|
|
164
|
+
### 6. Update state
|
|
165
|
+
|
|
166
|
+
Update `.interf/state.json` with proof of work:
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"compiled": 2460,
|
|
171
|
+
"last_compile": "2026-03-30T18:10:00Z",
|
|
172
|
+
"entity_count": 85,
|
|
173
|
+
"claim_count": 142,
|
|
174
|
+
"inventory_complete": true,
|
|
175
|
+
"abstracts_read": 2460,
|
|
176
|
+
"full_reads": 400
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The inventory at `.interf/inventory.json` has per-file detail. State.json has the summary. Both must be consistent. If `abstracts_read` < total, the compile is incomplete — next run continues.
|
|
181
|
+
|
|
182
|
+
Refresh `.interf/health.json` after state is updated. The CLI refreshes `.interf/view-spec.json` after stage completion so viewers keep a stable knowledge-base-level presentation contract.
|
|
183
|
+
|
|
184
|
+
### 7. Validate
|
|
185
|
+
|
|
186
|
+
- [ ] All output files exist and are non-empty
|
|
187
|
+
- [ ] Entity notes have evidence links
|
|
188
|
+
- [ ] Claims preserve evidence strength and do not overstate exploratory material
|
|
189
|
+
- [ ] No wikilinks to nonexistent files
|
|
190
|
+
- [ ] home.md is current
|
|
191
|
+
|
|
192
|
+
## Graph quality rules
|
|
193
|
+
|
|
194
|
+
- Canonicalize aliases to one entity note
|
|
195
|
+
- Remove stale duplicates
|
|
196
|
+
- Repair broken wikilinks
|
|
197
|
+
- Prefer explicit wikilinks over vague prose
|
|
198
|
+
- Use properties for machine filtering, tags for Obsidian surfacing
|
|
199
|
+
|
|
200
|
+
After compile, prefer running:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
interf verify compile --json
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
If it fails, fix inventory/state/output consistency before treating the knowledge base as ready for interface creation or retrieval.
|
|
207
|
+
|
|
208
|
+
Report:
|
|
209
|
+
```
|
|
210
|
+
Step 2/2 complete — Knowledge-base compile
|
|
211
|
+
Entities: 85, Claims: 142
|
|
212
|
+
home.md updated.
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
When the required outputs, state, and health files are written, emit the required `DONE:` line and stop. Do not keep browsing or auditing after the compile contract is satisfied.
|
|
216
|
+
|
|
217
|
+
## What this skill does NOT do
|
|
218
|
+
|
|
219
|
+
- Does not generate per-file summaries (use `knowledge-base/summarize`)
|
|
220
|
+
- Does not work on interfaces (use `interface/retrieve` to start interface compile)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Output Format Guide
|
|
2
|
+
|
|
3
|
+
All outputs are plain markdown. They work standalone for any agent and render well in Obsidian. Obsidian is supported but not required.
|
|
4
|
+
|
|
5
|
+
## Properties (JSON frontmatter)
|
|
6
|
+
|
|
7
|
+
Use Obsidian-compatible properties for filtering:
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
---
|
|
11
|
+
{
|
|
12
|
+
"entity_type": "person",
|
|
13
|
+
"status": "active",
|
|
14
|
+
"confidence": "high",
|
|
15
|
+
"tags": ["type/entity", "entity/person"]
|
|
16
|
+
}
|
|
17
|
+
---
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Properties = machine filtering. Tags = human browsing.
|
|
21
|
+
|
|
22
|
+
## Wikilinks
|
|
23
|
+
|
|
24
|
+
Use `[[wikilinks]]` for all internal references. Never raw file paths.
|
|
25
|
+
|
|
26
|
+
## Wiki-link-as-prose
|
|
27
|
+
|
|
28
|
+
Links read as sentences:
|
|
29
|
+
> This note is where [[readiness assessment language first appears in the knowledge base]]
|
|
30
|
+
|
|
31
|
+
## home.md
|
|
32
|
+
|
|
33
|
+
Entry point. Links to key sections, current counts, last compile date. Update every compile.
|
|
34
|
+
|
|
35
|
+
## .base files
|
|
36
|
+
|
|
37
|
+
Optional Obsidian-specific JSON files for filterable table/card views. The knowledge base works without them.
|
|
38
|
+
|
|
39
|
+
## Graph optimization
|
|
40
|
+
|
|
41
|
+
- Wikilinks consistently (every link = edge)
|
|
42
|
+
- One canonical note per entity (no duplicates)
|
|
43
|
+
- Home.md and indexes as high-connectivity hubs
|
|
44
|
+
- Tags for color-coding in graph view
|
|
45
|
+
|
|
46
|
+
## Independence
|
|
47
|
+
|
|
48
|
+
Everything works without Obsidian. Wikilinks are `[[plain text]]`. Properties use JSON frontmatter. Tags are strings. Any agent can read the files directly.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Stage: Extract Claims
|
|
2
|
+
|
|
3
|
+
Create notes in knowledge/claims/ for cross-file observations backed by evidence.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. Read summaries/ overviews looking for patterns that appear across 2+ files
|
|
8
|
+
2. Group related observations into claims
|
|
9
|
+
3. For each claim: create a note with evidence links
|
|
10
|
+
|
|
11
|
+
## What qualifies as a claim
|
|
12
|
+
|
|
13
|
+
- A pattern observed in 2+ sources
|
|
14
|
+
- A decision or pivot with supporting evidence
|
|
15
|
+
- A risk identified from multiple signals
|
|
16
|
+
- A relationship between entities backed by evidence
|
|
17
|
+
- A metric or milestone confirmed by locked/confirmed sources
|
|
18
|
+
|
|
19
|
+
Do NOT create claims from single observations unless marked as unresolved/hypothesis.
|
|
20
|
+
|
|
21
|
+
## Claim note format
|
|
22
|
+
|
|
23
|
+
Use prose-as-title: the filename IS the claim.
|
|
24
|
+
|
|
25
|
+
Example filename: `GATHR and Aon act as paid R&D for the product thesis.md`
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
---
|
|
29
|
+
{
|
|
30
|
+
"claim_type": "pattern | decision | risk | milestone | relationship | metric",
|
|
31
|
+
"status": "active | historical | unresolved",
|
|
32
|
+
"evidence_count": "N",
|
|
33
|
+
"confidence": "high | medium | low",
|
|
34
|
+
"tags": ["type/claim", "claim/{claim_type}"]
|
|
35
|
+
}
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Claim
|
|
39
|
+
|
|
40
|
+
{The observation in one tight paragraph.}
|
|
41
|
+
|
|
42
|
+
## Why it matters
|
|
43
|
+
|
|
44
|
+
{Why this matters for future querying and decision-making.}
|
|
45
|
+
|
|
46
|
+
## Evidence
|
|
47
|
+
|
|
48
|
+
- [[{summary title}]]: {one-line evidence}
|
|
49
|
+
- [[{summary title}]]: {one-line evidence}
|
|
50
|
+
|
|
51
|
+
## Related
|
|
52
|
+
|
|
53
|
+
- [[{related entity or claim}]]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Confidence levels
|
|
57
|
+
|
|
58
|
+
- **high**: 3+ locked/confirmed sources agree
|
|
59
|
+
- **medium**: 2+ sources, at least one confirmed
|
|
60
|
+
- **low**: 2+ draft sources, or sources partially conflict
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Stage: Discover Entities
|
|
2
|
+
|
|
3
|
+
Create canonical notes in knowledge/entities/ for recurring actors in the knowledge base.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. Scan all summaries/ `people:` frontmatter fields → build frequency map
|
|
8
|
+
2. Scan abstracts and overviews for company names, product names, concepts
|
|
9
|
+
3. For each actor appearing 3+ times:
|
|
10
|
+
- Create a canonical entity note
|
|
11
|
+
- Resolve aliases (e.g., "Matt" and "Matteo" → one note)
|
|
12
|
+
- Link to all supporting summaries/ files via wikilinks
|
|
13
|
+
|
|
14
|
+
## Entity note format
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
---
|
|
18
|
+
{
|
|
19
|
+
"entity_type": "person | company | product | concept",
|
|
20
|
+
"status": "active | historical",
|
|
21
|
+
"first_seen": "YYYY-MM-DD",
|
|
22
|
+
"last_seen": "YYYY-MM-DD",
|
|
23
|
+
"evidence_count": "N",
|
|
24
|
+
"tags": ["type/entity", "entity/{entity_type}"]
|
|
25
|
+
}
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Summary
|
|
29
|
+
|
|
30
|
+
{Who/what this is and why it matters. 2-3 sentences.}
|
|
31
|
+
|
|
32
|
+
## Evidence
|
|
33
|
+
|
|
34
|
+
- [[{summary title}]]: {one-line context}
|
|
35
|
+
|
|
36
|
+
## Related
|
|
37
|
+
|
|
38
|
+
- [[{related entity or claim}]]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Alias resolution
|
|
42
|
+
|
|
43
|
+
When multiple names refer to the same actor:
|
|
44
|
+
- Pick the most complete name as canonical (e.g., "Matteo Cassese" not "Matt")
|
|
45
|
+
- Mention aliases in the summary
|
|
46
|
+
- All evidence links point to the one canonical note
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"name": "knowledge-base/query",
|
|
4
|
+
"description": "Manual-use skill for answering questions from inside a compiled knowledge base. Navigates AGENTS.md, home.md, knowledge/, summaries/, backlinks, and raw sources only when reachable. Use when a user opens an agent inside a knowledge base and asks questions against it."
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Knowledge Base Query
|
|
9
|
+
|
|
10
|
+
Use this skill in manual agent sessions inside a compiled knowledge base.
|
|
11
|
+
|
|
12
|
+
Start with:
|
|
13
|
+
- `AGENTS.md`
|
|
14
|
+
- `home.md`
|
|
15
|
+
- `knowledge/`
|
|
16
|
+
- `summaries/`
|
|
17
|
+
|
|
18
|
+
Default loop:
|
|
19
|
+
- use `knowledge/` indexes, entities, and claims first
|
|
20
|
+
- follow wikilinks and backlinks outward before treating one note as complete
|
|
21
|
+
- use `summaries/` for deeper evidence
|
|
22
|
+
- use raw source files only when needed for verification, direct quotes, ambiguity, or missing context
|
|
23
|
+
|
|
24
|
+
Raw-source gate:
|
|
25
|
+
- inspect `.interf/source-access.json`
|
|
26
|
+
- verify one `suggested_checks` path is actually readable from this session before claiming raw-file verification
|
|
27
|
+
- if the path is not reachable or permission is not granted, say the answer is based on compiled knowledge-base artifacts only
|
|
28
|
+
|
|
29
|
+
When confidence is low:
|
|
30
|
+
- expand outward through linked claims, entities, indexes, and summaries
|
|
31
|
+
- do not over-read a single summary title as final truth
|
|
32
|
+
|
|
33
|
+
This skill is for manual question-answering behavior. It does not change summarize or compile runtime contracts.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"name": "knowledge-base/summarize",
|
|
4
|
+
"description": "Generate summaries for unprocessed source files in a knowledge base. Reads interf.json for format rules. Creates one summaries/ file per source file with abstract, overview, metadata, and wikilinks. Use when asked to summarize, process files, generate summaries, or after adding new files to a knowledge base."
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Summarize Source Files into Summaries
|
|
9
|
+
|
|
10
|
+
Read `interf.json`, `.interf/stage-contract.json`, and `.interf/run.json` first.
|
|
11
|
+
|
|
12
|
+
Use only local workspace files for this run:
|
|
13
|
+
- `interf.json`
|
|
14
|
+
- `.interf/stage-contract.json`
|
|
15
|
+
- `.interf/summarize-targets.json` when present
|
|
16
|
+
- `.interf/source-access.json` when raw-file access needs a quick check
|
|
17
|
+
- local instruction docs explicitly listed by `.interf/stage-contract.json`
|
|
18
|
+
|
|
19
|
+
Do not open SDK repo docs or source files outside the current workspace. The local contract and local docs are the source of truth.
|
|
20
|
+
|
|
21
|
+
Harness role:
|
|
22
|
+
- This skill is normally invoked as one of the file-evidence stages inside `interf compile`.
|
|
23
|
+
- When launched by the CLI, follow the stage contract exactly and keep user-visible output to `STATUS:`, `DONE:`, `BLOCKED:`, or `ERROR:` lines only.
|
|
24
|
+
|
|
25
|
+
## Required sequence
|
|
26
|
+
|
|
27
|
+
1. Read `interf.json` and confirm `type: knowledge-base`.
|
|
28
|
+
2. Read `.interf/stage-contract.json` and treat it as authoritative.
|
|
29
|
+
3. Read `.interf/summarize-targets.json` when present and treat `targets[]` as the source of truth for which files to summarize.
|
|
30
|
+
4. Read any local docs listed by the stage contract.
|
|
31
|
+
5. Create one summary file in `summaries/` for each target source file.
|
|
32
|
+
6. Write `.interf/inventory.json`.
|
|
33
|
+
7. Update `.interf/state.json`.
|
|
34
|
+
8. Refresh `.interf/health.json`.
|
|
35
|
+
9. Emit `DONE:` and stop.
|
|
36
|
+
|
|
37
|
+
If the CLI provided a summarize plan, do not re-audit the whole knowledge base before writing summaries.
|
|
38
|
+
|
|
39
|
+
## Status contract
|
|
40
|
+
|
|
41
|
+
When launched by the Interf CLI:
|
|
42
|
+
- emit exactly one startup line: `STATUS: loaded summarize plan N files`
|
|
43
|
+
- emit `STATUS: batch committed` only after summary files, inventory, and state were actually written
|
|
44
|
+
- emit `DONE: summarized N/N` when the required writes are complete
|
|
45
|
+
- do not emit per-file progress
|
|
46
|
+
|
|
47
|
+
## Summary output format
|
|
48
|
+
|
|
49
|
+
Create one markdown file per source file under `summaries/`.
|
|
50
|
+
Every summary filename must end in `.md`, even when the source file is `.txt`, `.pdf`, or another format.
|
|
51
|
+
|
|
52
|
+
Each summary must include JSON frontmatter with:
|
|
53
|
+
- `source`
|
|
54
|
+
- `source_kind`
|
|
55
|
+
- `evidence_tier`
|
|
56
|
+
- `truth_mode`
|
|
57
|
+
- `state`
|
|
58
|
+
- `abstract`
|
|
59
|
+
|
|
60
|
+
Use JSON frontmatter wrapped in `---` markers. Do not use YAML `key: value` frontmatter.
|
|
61
|
+
|
|
62
|
+
Example:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
---
|
|
66
|
+
{
|
|
67
|
+
"source": "go-to-market-notes.txt",
|
|
68
|
+
"source_kind": "note",
|
|
69
|
+
"evidence_tier": "primary",
|
|
70
|
+
"truth_mode": "proposed",
|
|
71
|
+
"state": "draft",
|
|
72
|
+
"abstract": "Short source-grounded description."
|
|
73
|
+
}
|
|
74
|
+
---
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Each summary must include these sections:
|
|
78
|
+
- `## Overview`
|
|
79
|
+
- `## Key Takeaways`
|
|
80
|
+
|
|
81
|
+
`## References` is optional.
|
|
82
|
+
|
|
83
|
+
Keep summaries source-grounded:
|
|
84
|
+
- do not overstate certainty
|
|
85
|
+
- keep titles descriptive and conservative
|
|
86
|
+
- preserve evidence tiers and truth modes
|
|
87
|
+
- keep links sparse and obvious
|
|
88
|
+
|
|
89
|
+
This is a per-file evidence stage only. Cross-file synthesis belongs to `knowledge-base/compile`.
|
|
90
|
+
|
|
91
|
+
## Inventory and state
|
|
92
|
+
|
|
93
|
+
Write `.interf/inventory.json` so every source file is accounted for.
|
|
94
|
+
|
|
95
|
+
Minimum shape:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"total": 3,
|
|
100
|
+
"files": [
|
|
101
|
+
{
|
|
102
|
+
"raw": "company-overview.md",
|
|
103
|
+
"summary": "summaries/company overview.md",
|
|
104
|
+
"status": "summarized"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Update `.interf/state.json` with:
|
|
111
|
+
- `pending`
|
|
112
|
+
- `summarized`
|
|
113
|
+
- `last_summarize`
|
|
114
|
+
|
|
115
|
+
Refresh `.interf/health.json` after state is updated.
|
|
116
|
+
|
|
117
|
+
## Guardrails
|
|
118
|
+
|
|
119
|
+
- Do not modify source files.
|
|
120
|
+
- Do not emit `STATUS: batch committed` before files exist on disk.
|
|
121
|
+
- Do not keep browsing after the required writes are complete.
|
|
122
|
+
- If a required path is missing or unreadable, emit one `BLOCKED:` or `ERROR:` line with the concrete reason and stop.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"name": "workflow/create",
|
|
4
|
+
"description": "Create or refine an Interf workflow package. Use when asked to define a KB or interface workflow, author workflow.json, shape compile stages, or add declarative stage acceptance criteria."
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Create Workflow
|
|
9
|
+
|
|
10
|
+
Use this skill when shaping a reusable Interf workflow package.
|
|
11
|
+
|
|
12
|
+
Prefer the CLI first:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
interf create workflow
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
That wizard should create the initial package under:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
interf/workflows/<type>/<workflow-id>/
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then refine the package in place.
|
|
25
|
+
|
|
26
|
+
## What a workflow is
|
|
27
|
+
|
|
28
|
+
A workflow is a package, not just a JSON file.
|
|
29
|
+
|
|
30
|
+
It has two layers:
|
|
31
|
+
|
|
32
|
+
- `workflow.json` = machine-readable stage graph and contract mapping
|
|
33
|
+
- local docs = human/agent method layer
|
|
34
|
+
|
|
35
|
+
Typical shape:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
interf/workflows/knowledge-base/<workflow-id>/
|
|
39
|
+
workflow.json
|
|
40
|
+
README.md
|
|
41
|
+
create/
|
|
42
|
+
SKILL.md
|
|
43
|
+
compile/
|
|
44
|
+
stages/
|
|
45
|
+
<stage-id>/
|
|
46
|
+
SKILL.md
|
|
47
|
+
use/
|
|
48
|
+
query/
|
|
49
|
+
SKILL.md
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## What `workflow.json` should define
|
|
53
|
+
|
|
54
|
+
Keep it declarative.
|
|
55
|
+
|
|
56
|
+
- `id`
|
|
57
|
+
- `type`
|
|
58
|
+
- `label`
|
|
59
|
+
- `hint`
|
|
60
|
+
- optional `extends`
|
|
61
|
+
- optional `placeholder`
|
|
62
|
+
- optional `stages`
|
|
63
|
+
- optional `stage_policy_notes`
|
|
64
|
+
|
|
65
|
+
Each stage can define:
|
|
66
|
+
|
|
67
|
+
- `id`
|
|
68
|
+
- `label`
|
|
69
|
+
- `contract_type`
|
|
70
|
+
- optional `skill_dir`
|
|
71
|
+
- optional `description`
|
|
72
|
+
- optional `acceptance`
|
|
73
|
+
|
|
74
|
+
## Contract kinds
|
|
75
|
+
|
|
76
|
+
Use the shipped contract families only.
|
|
77
|
+
|
|
78
|
+
Knowledge-base stages:
|
|
79
|
+
- `kb-file-evidence`
|
|
80
|
+
- `kb-knowledge-layer`
|
|
81
|
+
|
|
82
|
+
Interface stages:
|
|
83
|
+
- `interface-retrieval`
|
|
84
|
+
- `interface-analysis`
|
|
85
|
+
- `interface-output`
|
|
86
|
+
|
|
87
|
+
Do not invent new engine contract kinds in a local workflow package.
|
|
88
|
+
|
|
89
|
+
## Declarative acceptance
|
|
90
|
+
|
|
91
|
+
Use stage `acceptance` for deterministic stage checks that the CLI can compare against runtime state.
|
|
92
|
+
|
|
93
|
+
Current acceptance fields:
|
|
94
|
+
|
|
95
|
+
- `artifacts_exist`
|
|
96
|
+
- `state_truthy`
|
|
97
|
+
- `state_equals_counts`
|
|
98
|
+
- `state_at_least`
|
|
99
|
+
- `state_at_least_counts`
|
|
100
|
+
|
|
101
|
+
Use dynamic counts when possible.
|
|
102
|
+
|
|
103
|
+
Good:
|
|
104
|
+
- `"summarized": "target_files"`
|
|
105
|
+
- `"frontmatter_scanned": "knowledge_base_summary_total"`
|
|
106
|
+
|
|
107
|
+
Avoid hardcoding fixed file counts unless the workflow really requires them.
|
|
108
|
+
|
|
109
|
+
## Builder rules
|
|
110
|
+
|
|
111
|
+
- keep `workflow.json` readable and declarative
|
|
112
|
+
- put execution guidance in `SKILL.md` files, not in dense JSON prose
|
|
113
|
+
- let the CLI own runtime state, verification, and pass/fail
|
|
114
|
+
- use `AGENTS.md` as the workspace router after scaffolding, not as the reusable workflow spec
|
|
115
|
+
- prefer extending shipped workflows before inventing a new stage graph
|
|
116
|
+
|
|
117
|
+
## Outcome
|
|
118
|
+
|
|
119
|
+
A good workflow package gives Interf:
|
|
120
|
+
|
|
121
|
+
- a compile pipeline
|
|
122
|
+
- stage-to-contract mapping
|
|
123
|
+
- readable local docs for executors
|
|
124
|
+
- optional declarative acceptance checks
|
|
125
|
+
|
|
126
|
+
The goal is not to write code inside the workflow. The goal is to define a stage pipeline that Interf can enforce.
|