opentology 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.
- package/LICENSE +21 -0
- package/README.md +609 -0
- package/dist/commands/context.d.ts +29 -0
- package/dist/commands/context.js +369 -0
- package/dist/commands/delete.d.ts +2 -0
- package/dist/commands/delete.js +46 -0
- package/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.js +43 -0
- package/dist/commands/drop.d.ts +2 -0
- package/dist/commands/drop.js +41 -0
- package/dist/commands/graph.d.ts +2 -0
- package/dist/commands/graph.js +130 -0
- package/dist/commands/infer.d.ts +2 -0
- package/dist/commands/infer.js +47 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +53 -0
- package/dist/commands/mcp.d.ts +2 -0
- package/dist/commands/mcp.js +9 -0
- package/dist/commands/prefix.d.ts +2 -0
- package/dist/commands/prefix.js +73 -0
- package/dist/commands/pull.d.ts +2 -0
- package/dist/commands/pull.js +43 -0
- package/dist/commands/push.d.ts +2 -0
- package/dist/commands/push.js +79 -0
- package/dist/commands/query.d.ts +2 -0
- package/dist/commands/query.js +119 -0
- package/dist/commands/shapes.d.ts +2 -0
- package/dist/commands/shapes.js +67 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +47 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.js +46 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +38 -0
- package/dist/lib/codebase-scanner.d.ts +41 -0
- package/dist/lib/codebase-scanner.js +360 -0
- package/dist/lib/config.d.ts +16 -0
- package/dist/lib/config.js +70 -0
- package/dist/lib/embedded-adapter.d.ts +45 -0
- package/dist/lib/embedded-adapter.js +202 -0
- package/dist/lib/http-adapter.d.ts +41 -0
- package/dist/lib/http-adapter.js +169 -0
- package/dist/lib/oxigraph.d.ts +62 -0
- package/dist/lib/oxigraph.js +323 -0
- package/dist/lib/reasoner.d.ts +19 -0
- package/dist/lib/reasoner.js +310 -0
- package/dist/lib/shacl.d.ts +22 -0
- package/dist/lib/shacl.js +105 -0
- package/dist/lib/sparql-utils.d.ts +28 -0
- package/dist/lib/sparql-utils.js +217 -0
- package/dist/lib/store-adapter.d.ts +50 -0
- package/dist/lib/store-adapter.js +1 -0
- package/dist/lib/store-factory.d.ts +9 -0
- package/dist/lib/store-factory.js +71 -0
- package/dist/lib/validator.d.ts +10 -0
- package/dist/lib/validator.js +40 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.js +1020 -0
- package/dist/templates/claude-md-context.d.ts +4 -0
- package/dist/templates/claude-md-context.js +104 -0
- package/dist/templates/otx-ontology.d.ts +2 -0
- package/dist/templates/otx-ontology.js +31 -0
- package/dist/templates/session-start-hook.d.ts +1 -0
- package/dist/templates/session-start-hook.js +94 -0
- package/dist/templates/slash-commands.d.ts +5 -0
- package/dist/templates/slash-commands.js +108 -0
- package/package.json +58 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const MARKER_BEGIN = "<!-- OPENTOLOGY:CONTEXT:BEGIN -->";
|
|
2
|
+
export declare const MARKER_END = "<!-- OPENTOLOGY:CONTEXT:END -->";
|
|
3
|
+
export declare function generateContextSection(projectId: string, graphUri: string): string;
|
|
4
|
+
export declare function updateClaudeMd(filePath: string, section: string): void;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
2
|
+
export const MARKER_BEGIN = '<!-- OPENTOLOGY:CONTEXT:BEGIN -->';
|
|
3
|
+
export const MARKER_END = '<!-- OPENTOLOGY:CONTEXT:END -->';
|
|
4
|
+
export function generateContextSection(projectId, graphUri) {
|
|
5
|
+
const contextUri = `${graphUri}/context`;
|
|
6
|
+
const sessionsUri = `${graphUri}/sessions`;
|
|
7
|
+
return `${MARKER_BEGIN}
|
|
8
|
+
## Context Management — OpenTology
|
|
9
|
+
|
|
10
|
+
This project uses OpenTology as its project context graph.
|
|
11
|
+
|
|
12
|
+
### Graph Structure
|
|
13
|
+
|
|
14
|
+
| Graph | URI | Purpose |
|
|
15
|
+
|-------|-----|---------|
|
|
16
|
+
| context | \`${contextUri}\` | Decisions, issues, knowledge |
|
|
17
|
+
| sessions | \`${sessionsUri}\` | Session work logs |
|
|
18
|
+
|
|
19
|
+
### Ontology (\`otx:\` prefix)
|
|
20
|
+
|
|
21
|
+
| Class | Description |
|
|
22
|
+
|-------|-------------|
|
|
23
|
+
| \`otx:Project\` | Project hub info |
|
|
24
|
+
| \`otx:Decision\` | Architecture/tech decisions |
|
|
25
|
+
| \`otx:Issue\` | Bugs and issues |
|
|
26
|
+
| \`otx:Knowledge\` | Reusable knowledge |
|
|
27
|
+
| \`otx:Session\` | Session logs |
|
|
28
|
+
| \`otx:Pattern\` | Recurring patterns/conventions |
|
|
29
|
+
|
|
30
|
+
| Property | Range | Description |
|
|
31
|
+
|----------|-------|-------------|
|
|
32
|
+
| \`otx:title\` | string | Title |
|
|
33
|
+
| \`otx:date\` | date | Date (YYYY-MM-DD) |
|
|
34
|
+
| \`otx:body\` | string | Body content |
|
|
35
|
+
| \`otx:status\` | string | Status (open/resolved/active) |
|
|
36
|
+
| \`otx:reason\` | string | Decision rationale |
|
|
37
|
+
| \`otx:nextTodo\` | string | Next action item |
|
|
38
|
+
| \`otx:relatedTo\` | resource | Related entity |
|
|
39
|
+
|
|
40
|
+
### When to Record
|
|
41
|
+
|
|
42
|
+
| Trigger | Type | Graph |
|
|
43
|
+
|---------|------|-------|
|
|
44
|
+
| Architecture/tech decision | \`otx:Decision\` | context |
|
|
45
|
+
| Bug/issue resolved | \`otx:Issue\` | context |
|
|
46
|
+
| Reusable knowledge | \`otx:Knowledge\` | context |
|
|
47
|
+
| Session end | \`otx:Session\` | sessions |
|
|
48
|
+
|
|
49
|
+
### Query Examples
|
|
50
|
+
|
|
51
|
+
\`\`\`sparql
|
|
52
|
+
# Recent sessions
|
|
53
|
+
PREFIX otx: <https://opentology.dev/vocab#>
|
|
54
|
+
SELECT ?title ?date ?nextTodo WHERE {
|
|
55
|
+
GRAPH <${sessionsUri}> {
|
|
56
|
+
?s a otx:Session ; otx:title ?title ; otx:date ?date .
|
|
57
|
+
OPTIONAL { ?s otx:nextTodo ?nextTodo }
|
|
58
|
+
}
|
|
59
|
+
} ORDER BY DESC(?date) LIMIT 5
|
|
60
|
+
|
|
61
|
+
# Open issues
|
|
62
|
+
PREFIX otx: <https://opentology.dev/vocab#>
|
|
63
|
+
SELECT ?title ?date WHERE {
|
|
64
|
+
GRAPH <${contextUri}> {
|
|
65
|
+
?s a otx:Issue ; otx:title ?title ; otx:date ?date ; otx:status "open" .
|
|
66
|
+
}
|
|
67
|
+
} ORDER BY DESC(?date)
|
|
68
|
+
\`\`\`
|
|
69
|
+
|
|
70
|
+
### Session End Reminder
|
|
71
|
+
|
|
72
|
+
At the end of each session, push a summary:
|
|
73
|
+
|
|
74
|
+
\`\`\`turtle
|
|
75
|
+
@prefix otx: <https://opentology.dev/vocab#> .
|
|
76
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
77
|
+
|
|
78
|
+
<urn:session:YYYY-MM-DD> a otx:Session ;
|
|
79
|
+
otx:title "Session summary here" ;
|
|
80
|
+
otx:date "YYYY-MM-DD"^^xsd:date ;
|
|
81
|
+
otx:body "What was done" ;
|
|
82
|
+
otx:nextTodo "What to do next" .
|
|
83
|
+
\`\`\`
|
|
84
|
+
${MARKER_END}`;
|
|
85
|
+
}
|
|
86
|
+
export function updateClaudeMd(filePath, section) {
|
|
87
|
+
if (!existsSync(filePath)) {
|
|
88
|
+
// Case 1: No file — create with just the section
|
|
89
|
+
writeFileSync(filePath, section + '\n', 'utf-8');
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
93
|
+
const beginIdx = content.indexOf(MARKER_BEGIN);
|
|
94
|
+
const endIdx = content.indexOf(MARKER_END);
|
|
95
|
+
if (beginIdx === -1 || endIdx === -1) {
|
|
96
|
+
// Case 2: File exists but no markers — append
|
|
97
|
+
writeFileSync(filePath, content.trimEnd() + '\n\n' + section + '\n', 'utf-8');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Case 3: File exists with markers — replace between markers
|
|
101
|
+
const before = content.substring(0, beginIdx);
|
|
102
|
+
const after = content.substring(endIdx + MARKER_END.length);
|
|
103
|
+
writeFileSync(filePath, before + section + after, 'utf-8');
|
|
104
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const OTX_BOOTSTRAP_TURTLE = "@prefix otx: <https://opentology.dev/vocab#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\notx:Project a owl:Class .\notx:Decision a owl:Class .\notx:Issue a owl:Class .\notx:Knowledge a owl:Class .\notx:Session a owl:Class .\notx:Pattern a owl:Class .\notx:Module a owl:Class .\n\notx:title a owl:DatatypeProperty ; rdfs:range xsd:string .\notx:date a owl:DatatypeProperty ; rdfs:range xsd:date .\notx:body a owl:DatatypeProperty ; rdfs:range xsd:string .\notx:status a owl:DatatypeProperty ; rdfs:range xsd:string .\notx:reason a owl:DatatypeProperty ; rdfs:range xsd:string .\notx:cause a owl:DatatypeProperty ; rdfs:range xsd:string .\notx:solution a owl:DatatypeProperty ; rdfs:range xsd:string .\notx:nextTodo a owl:DatatypeProperty ; rdfs:range xsd:string .\notx:relatedTo a owl:ObjectProperty .\notx:project a owl:ObjectProperty .\notx:dependsOn a owl:ObjectProperty ; rdfs:domain otx:Module ; rdfs:range otx:Module .\notx:stack a owl:DatatypeProperty ; rdfs:range xsd:string .\notx:alternative a owl:DatatypeProperty ; rdfs:range xsd:string .\n";
|
|
2
|
+
export declare function buildAskQuery(contextGraphUri: string): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const OTX_BOOTSTRAP_TURTLE = `\
|
|
2
|
+
@prefix otx: <https://opentology.dev/vocab#> .
|
|
3
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
4
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
5
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
6
|
+
|
|
7
|
+
otx:Project a owl:Class .
|
|
8
|
+
otx:Decision a owl:Class .
|
|
9
|
+
otx:Issue a owl:Class .
|
|
10
|
+
otx:Knowledge a owl:Class .
|
|
11
|
+
otx:Session a owl:Class .
|
|
12
|
+
otx:Pattern a owl:Class .
|
|
13
|
+
otx:Module a owl:Class .
|
|
14
|
+
|
|
15
|
+
otx:title a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
16
|
+
otx:date a owl:DatatypeProperty ; rdfs:range xsd:date .
|
|
17
|
+
otx:body a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
18
|
+
otx:status a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
19
|
+
otx:reason a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
20
|
+
otx:cause a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
21
|
+
otx:solution a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
22
|
+
otx:nextTodo a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
23
|
+
otx:relatedTo a owl:ObjectProperty .
|
|
24
|
+
otx:project a owl:ObjectProperty .
|
|
25
|
+
otx:dependsOn a owl:ObjectProperty ; rdfs:domain otx:Module ; rdfs:range otx:Module .
|
|
26
|
+
otx:stack a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
27
|
+
otx:alternative a owl:DatatypeProperty ; rdfs:range xsd:string .
|
|
28
|
+
`;
|
|
29
|
+
export function buildAskQuery(contextGraphUri) {
|
|
30
|
+
return `ASK { GRAPH <${contextGraphUri}> { <https://opentology.dev/vocab#Decision> a <http://www.w3.org/2002/07/owl#Class> } }`;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateHookScript(): string;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export function generateHookScript() {
|
|
2
|
+
return `#!/usr/bin/env node
|
|
3
|
+
// Generated by: opentology context init
|
|
4
|
+
// SessionStart hook — loads project context from OpenTology graph
|
|
5
|
+
import { existsSync } from 'node:fs';
|
|
6
|
+
import { execFileSync } from 'node:child_process';
|
|
7
|
+
import { join, resolve, dirname } from 'node:path';
|
|
8
|
+
|
|
9
|
+
const TIMEOUT = parseInt(process.env.OPENTOLOGY_HOOK_TIMEOUT || '5000', 10);
|
|
10
|
+
|
|
11
|
+
function findProjectRoot(startDir) {
|
|
12
|
+
let dir = resolve(startDir);
|
|
13
|
+
while (dir !== dirname(dir)) {
|
|
14
|
+
if (existsSync(join(dir, '.opentology.json'))) return dir;
|
|
15
|
+
dir = dirname(dir);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function findBin(projectRoot) {
|
|
21
|
+
const local = join(projectRoot, 'node_modules', '.bin', 'opentology');
|
|
22
|
+
if (existsSync(local)) return { bin: local, args: [] };
|
|
23
|
+
return { bin: 'npx', args: ['opentology'] };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function run(projectRoot, cmdArgs) {
|
|
27
|
+
const { bin, args } = findBin(projectRoot);
|
|
28
|
+
return execFileSync(bin, [...args, ...cmdArgs], {
|
|
29
|
+
cwd: projectRoot,
|
|
30
|
+
timeout: TIMEOUT,
|
|
31
|
+
encoding: 'utf-8',
|
|
32
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function formatOutput(data) {
|
|
37
|
+
const lines = [];
|
|
38
|
+
lines.push(\`## Project Context: \${data.projectId}\\n\`);
|
|
39
|
+
|
|
40
|
+
if (data.sessions && data.sessions.length > 0) {
|
|
41
|
+
lines.push('### Recent Sessions');
|
|
42
|
+
for (const s of data.sessions) {
|
|
43
|
+
lines.push(\`- [\${s.date}] \${s.title}\`);
|
|
44
|
+
if (s.nextTodo) lines.push(\` Next: \${s.nextTodo}\`);
|
|
45
|
+
}
|
|
46
|
+
lines.push('');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (data.openIssues && data.openIssues.length > 0) {
|
|
50
|
+
lines.push(\`### Open Issues (\${data.openIssues.length})\`);
|
|
51
|
+
for (const i of data.openIssues) {
|
|
52
|
+
lines.push(\`- [\${i.date}] \${i.title}\`);
|
|
53
|
+
}
|
|
54
|
+
lines.push('');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (data.recentDecisions && data.recentDecisions.length > 0) {
|
|
58
|
+
lines.push('### Recent Decisions');
|
|
59
|
+
for (const d of data.recentDecisions) {
|
|
60
|
+
lines.push(\`- [\${d.date}] \${d.title}\`);
|
|
61
|
+
}
|
|
62
|
+
lines.push('');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
lines.push('---');
|
|
66
|
+
lines.push('Dependency graph (otx:Module + otx:dependsOn) is available in the context graph.');
|
|
67
|
+
lines.push('If significant code changes occurred since last scan, consider running opentology_context_scan to update dependency triples.');
|
|
68
|
+
lines.push('Reminder: At session end, push a session summary using opentology_push to the sessions graph.');
|
|
69
|
+
|
|
70
|
+
return lines.join('\\n');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
const projectRoot = findProjectRoot(process.cwd());
|
|
75
|
+
if (!projectRoot) process.exit(0);
|
|
76
|
+
|
|
77
|
+
const raw = run(projectRoot, ['context', 'load', '--format', 'json']);
|
|
78
|
+
const data = JSON.parse(raw);
|
|
79
|
+
|
|
80
|
+
const hasData = (data.sessions?.length > 0) ||
|
|
81
|
+
(data.openIssues?.length > 0) ||
|
|
82
|
+
(data.recentDecisions?.length > 0);
|
|
83
|
+
|
|
84
|
+
if (hasData) {
|
|
85
|
+
console.log(formatOutput(data));
|
|
86
|
+
} else {
|
|
87
|
+
console.log(\`OpenTology context active for \${data.projectId}. No session data yet.\`);
|
|
88
|
+
}
|
|
89
|
+
} catch {
|
|
90
|
+
// Silent exit — do not block session start
|
|
91
|
+
process.exit(0);
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export function generateSlashCommands() {
|
|
2
|
+
return [
|
|
3
|
+
{
|
|
4
|
+
filename: 'context-init.md',
|
|
5
|
+
content: `Use the opentology_context_init MCP tool to initialize the project context graph.
|
|
6
|
+
|
|
7
|
+
After initialization:
|
|
8
|
+
1. Report what was created (graphs, hook script, CLAUDE.md, slash commands).
|
|
9
|
+
2. Show the hook JSON snippet the user needs to add to .claude/settings.json.
|
|
10
|
+
|
|
11
|
+
## Codebase Analysis
|
|
12
|
+
|
|
13
|
+
After context_init completes, call opentology_context_scan to get a codebase snapshot.
|
|
14
|
+
|
|
15
|
+
Analyze the \`codebaseSnapshot\` field from the response and create Knowledge triples to push via \`opentology_push\`.
|
|
16
|
+
|
|
17
|
+
### What to extract:
|
|
18
|
+
- **Project triple** (\`otx:Project\`): name, description, tech stack (\`otx:stack\`), status "active"
|
|
19
|
+
- **Knowledge triples** (\`otx:Knowledge\`): key architectural patterns, framework choices, build setup, project structure summary
|
|
20
|
+
|
|
21
|
+
### Push instructions:
|
|
22
|
+
- Push to the **context** graph (use graph name "context")
|
|
23
|
+
- Use Turtle format with \`otx:\` and \`xsd:\` prefixes
|
|
24
|
+
- Keep each push under 100 triples
|
|
25
|
+
- Use URIs like \`urn:project:{name}\`, \`urn:knowledge:{slug}\`
|
|
26
|
+
|
|
27
|
+
### Example triples:
|
|
28
|
+
|
|
29
|
+
\`\`\`turtle
|
|
30
|
+
@prefix otx: <https://opentology.dev/vocab#> .
|
|
31
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
32
|
+
|
|
33
|
+
<urn:project:{name}> a otx:Project ;
|
|
34
|
+
otx:title "{name}" ;
|
|
35
|
+
otx:date "{today}"^^xsd:date ;
|
|
36
|
+
otx:body "{description}" ;
|
|
37
|
+
otx:stack "{detected frameworks/languages}" ;
|
|
38
|
+
otx:status "active" .
|
|
39
|
+
|
|
40
|
+
<urn:knowledge:project-structure> a otx:Knowledge ;
|
|
41
|
+
otx:title "Project Structure" ;
|
|
42
|
+
otx:date "{today}"^^xsd:date ;
|
|
43
|
+
otx:body "Entry points: ... Key directories: ... Build system: ..." ;
|
|
44
|
+
otx:relatedTo <urn:project:{name}> .
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
### On subsequent runs (graph already populated):
|
|
48
|
+
- Query existing Knowledge triples first
|
|
49
|
+
- Update or add new triples for any changes detected
|
|
50
|
+
- Do not duplicate existing knowledge
|
|
51
|
+
`,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
filename: 'context-load.md',
|
|
55
|
+
content: `Use the opentology_context_load MCP tool to load the current project context.
|
|
56
|
+
|
|
57
|
+
Display the results in a readable format:
|
|
58
|
+
- Recent sessions with dates and next todos
|
|
59
|
+
- Open issues
|
|
60
|
+
- Recent decisions
|
|
61
|
+
|
|
62
|
+
If context is not initialized, suggest running /context-init first.
|
|
63
|
+
`,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
filename: 'context-save.md',
|
|
67
|
+
content: `Save a session summary to the OpenTology sessions graph.
|
|
68
|
+
|
|
69
|
+
Ask the user what was accomplished in this session, or summarize the conversation so far.
|
|
70
|
+
|
|
71
|
+
Then use opentology_push to insert a session record:
|
|
72
|
+
|
|
73
|
+
\`\`\`turtle
|
|
74
|
+
@prefix otx: <https://opentology.dev/vocab#> .
|
|
75
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
76
|
+
|
|
77
|
+
<urn:session:{today's date}> a otx:Session ;
|
|
78
|
+
otx:title "{session summary title}" ;
|
|
79
|
+
otx:date "{YYYY-MM-DD}"^^xsd:date ;
|
|
80
|
+
otx:body "{what was done}" ;
|
|
81
|
+
otx:nextTodo "{what to do next}" .
|
|
82
|
+
\`\`\`
|
|
83
|
+
|
|
84
|
+
Push to the sessions graph (use graph name "sessions").
|
|
85
|
+
`,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
filename: 'context-scan.md',
|
|
89
|
+
content: `Use the opentology_context_scan MCP tool to scan the current project codebase.
|
|
90
|
+
|
|
91
|
+
The tool returns a structured \`codebaseSnapshot\` containing package.json, directory tree, entry points, detected imports, and README.
|
|
92
|
+
|
|
93
|
+
Analyze the snapshot and create Knowledge triples to push via \`opentology_push\`:
|
|
94
|
+
- **Project triple** (\`otx:Project\`): name, description, tech stack, status "active"
|
|
95
|
+
- **Knowledge triples** (\`otx:Knowledge\`): architectural patterns, framework choices, build setup, project structure
|
|
96
|
+
|
|
97
|
+
Push to the **context** graph (use graph name "context"). Keep each push under 100 triples.
|
|
98
|
+
`,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
filename: 'context-status.md',
|
|
102
|
+
content: `Use the opentology_context_status MCP tool to check the project context initialization status.
|
|
103
|
+
|
|
104
|
+
Display the results clearly: whether context is initialized, graph triple counts, hook presence, and CLAUDE.md status.
|
|
105
|
+
`,
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opentology",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI-managed RDF/SPARQL infrastructure — Supabase for RDF",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"opentology": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"dev": "ts-node --esm src/index.ts",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"test:watch": "vitest",
|
|
17
|
+
"prepublishOnly": "npm run build && npm test"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"rdf",
|
|
21
|
+
"sparql",
|
|
22
|
+
"ontology",
|
|
23
|
+
"knowledge-graph",
|
|
24
|
+
"linked-data",
|
|
25
|
+
"shacl",
|
|
26
|
+
"cli",
|
|
27
|
+
"semantic-web"
|
|
28
|
+
],
|
|
29
|
+
"author": "Younkyum Jin",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/Younkyum/opentology.git"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/Younkyum/opentology#readme",
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/Younkyum/opentology/issues"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20.0.0"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
44
|
+
"commander": "^14.0.3",
|
|
45
|
+
"n3": "^2.0.3",
|
|
46
|
+
"oxigraph": "^0.5.6",
|
|
47
|
+
"picocolors": "^1.1.1",
|
|
48
|
+
"rdf-ext": "^2.6.0",
|
|
49
|
+
"shacl-engine": "^1.1.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/n3": "^1.26.1",
|
|
53
|
+
"@types/node": "^25.5.0",
|
|
54
|
+
"ts-node": "^10.9.2",
|
|
55
|
+
"typescript": "^6.0.2",
|
|
56
|
+
"vitest": "^4.1.2"
|
|
57
|
+
}
|
|
58
|
+
}
|