@weavelogic/knowledge-graph-agent 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/README.md +264 -0
- package/dist/cli/bin.d.ts +8 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +20 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/claude.d.ts +11 -0
- package/dist/cli/commands/claude.d.ts.map +1 -0
- package/dist/cli/commands/claude.js +102 -0
- package/dist/cli/commands/claude.js.map +1 -0
- package/dist/cli/commands/docs.d.ts +11 -0
- package/dist/cli/commands/docs.d.ts.map +1 -0
- package/dist/cli/commands/docs.js +108 -0
- package/dist/cli/commands/docs.js.map +1 -0
- package/dist/cli/commands/graph.d.ts +11 -0
- package/dist/cli/commands/graph.d.ts.map +1 -0
- package/dist/cli/commands/graph.js +122 -0
- package/dist/cli/commands/graph.js.map +1 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +80 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/search.d.ts +11 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +80 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +11 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +84 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +11 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +76 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +45 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/database.d.ts +121 -0
- package/dist/core/database.d.ts.map +1 -0
- package/dist/core/database.js +470 -0
- package/dist/core/database.js.map +1 -0
- package/dist/core/graph.d.ts +109 -0
- package/dist/core/graph.d.ts.map +1 -0
- package/dist/core/graph.js +343 -0
- package/dist/core/graph.js.map +1 -0
- package/dist/core/security.d.ts +62 -0
- package/dist/core/security.d.ts.map +1 -0
- package/dist/core/security.js +31 -0
- package/dist/core/security.js.map +1 -0
- package/dist/core/types.d.ts +232 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +37 -0
- package/dist/core/types.js.map +1 -0
- package/dist/generators/claude-md.d.ts +33 -0
- package/dist/generators/claude-md.d.ts.map +1 -0
- package/dist/generators/claude-md.js +410 -0
- package/dist/generators/claude-md.js.map +1 -0
- package/dist/generators/docs-init.d.ts +20 -0
- package/dist/generators/docs-init.d.ts.map +1 -0
- package/dist/generators/docs-init.js +625 -0
- package/dist/generators/docs-init.js.map +1 -0
- package/dist/generators/graph-generator.d.ts +41 -0
- package/dist/generators/graph-generator.d.ts.map +1 -0
- package/dist/generators/graph-generator.js +266 -0
- package/dist/generators/graph-generator.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/claude-flow.d.ts +62 -0
- package/dist/integrations/claude-flow.d.ts.map +1 -0
- package/dist/integrations/claude-flow.js +243 -0
- package/dist/integrations/claude-flow.js.map +1 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# @weavelogic/knowledge-graph-agent
|
|
2
|
+
|
|
3
|
+
A powerful NPM library for creating and managing knowledge graphs for Claude Code. Integrates with Obsidian-style documentation and claude-flow for AI coordination.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@weavelogic/knowledge-graph-agent)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **Knowledge Graph Generation** - Automatically generate knowledge graphs from markdown documentation
|
|
11
|
+
- **Docs Initialization** - Create structured documentation directories following weave-nn methodology
|
|
12
|
+
- **CLAUDE.md Management** - Generate and update CLAUDE.md configuration files
|
|
13
|
+
- **Claude-Flow Integration** - Sync knowledge graphs with claude-flow memory for cross-session persistence
|
|
14
|
+
- **Full-Text Search** - SQLite-backed search across all documentation
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @weavelogic/knowledge-graph-agent
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or use directly with npx:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @weavelogic/knowledge-graph-agent init
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
### 1. Initialize Knowledge Graph
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Initialize in current project
|
|
34
|
+
kg init
|
|
35
|
+
|
|
36
|
+
# Initialize with custom paths
|
|
37
|
+
kg init --path /path/to/project --docs documentation
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Initialize Documentation Directory
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Create docs with weave-nn structure
|
|
44
|
+
kg docs init
|
|
45
|
+
|
|
46
|
+
# Create minimal docs
|
|
47
|
+
kg docs init --no-examples
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. Generate Knowledge Graph
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Full generation
|
|
54
|
+
kg graph
|
|
55
|
+
|
|
56
|
+
# Incremental update
|
|
57
|
+
kg graph --update
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 4. Update CLAUDE.md
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Generate CLAUDE.md with knowledge graph integration
|
|
64
|
+
kg claude update
|
|
65
|
+
|
|
66
|
+
# Use full template with all sections
|
|
67
|
+
kg claude update --template full
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 5. Sync with Claude-Flow
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Sync to claude-flow memory
|
|
74
|
+
kg sync
|
|
75
|
+
|
|
76
|
+
# Show MCP commands for manual sync
|
|
77
|
+
kg sync --show-commands
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## CLI Commands
|
|
81
|
+
|
|
82
|
+
| Command | Description |
|
|
83
|
+
|---------|-------------|
|
|
84
|
+
| `kg init` | Initialize knowledge graph in project |
|
|
85
|
+
| `kg graph` | Generate/update knowledge graph |
|
|
86
|
+
| `kg docs init` | Initialize docs directory |
|
|
87
|
+
| `kg docs status` | Show documentation status |
|
|
88
|
+
| `kg claude update` | Update CLAUDE.md |
|
|
89
|
+
| `kg claude preview` | Preview CLAUDE.md content |
|
|
90
|
+
| `kg sync` | Sync with claude-flow memory |
|
|
91
|
+
| `kg stats` | Display graph statistics |
|
|
92
|
+
| `kg search <query>` | Search the knowledge graph |
|
|
93
|
+
|
|
94
|
+
## Programmatic Usage
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import {
|
|
98
|
+
createKnowledgeGraph,
|
|
99
|
+
createDatabase,
|
|
100
|
+
initDocs,
|
|
101
|
+
generateClaudeMd,
|
|
102
|
+
quickInit,
|
|
103
|
+
} from '@weavelogic/knowledge-graph-agent';
|
|
104
|
+
|
|
105
|
+
// Quick initialization
|
|
106
|
+
const result = await quickInit({
|
|
107
|
+
projectRoot: '/path/to/project',
|
|
108
|
+
docsPath: 'docs',
|
|
109
|
+
generateGraph: true,
|
|
110
|
+
updateClaudeMd: true,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Or use individual components
|
|
114
|
+
const db = createDatabase('.kg/knowledge.db');
|
|
115
|
+
const graph = createKnowledgeGraph('my-project', '/project/root');
|
|
116
|
+
|
|
117
|
+
// Generate docs
|
|
118
|
+
await initDocs({
|
|
119
|
+
projectRoot: '/project/root',
|
|
120
|
+
docsPath: 'docs',
|
|
121
|
+
includeExamples: true,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Generate CLAUDE.md
|
|
125
|
+
const claudeContent = generateClaudeMd({
|
|
126
|
+
projectRoot: '/project/root',
|
|
127
|
+
includeKnowledgeGraph: true,
|
|
128
|
+
includeClaudeFlow: true,
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Documentation Structure
|
|
133
|
+
|
|
134
|
+
The generated docs directory follows the weave-nn methodology:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
docs/
|
|
138
|
+
├── README.md # Documentation home
|
|
139
|
+
├── PRIMITIVES.md # Technology primitives
|
|
140
|
+
├── MOC.md # Map of Content
|
|
141
|
+
├── concepts/ # Abstract concepts
|
|
142
|
+
│ ├── architecture/
|
|
143
|
+
│ └── patterns/
|
|
144
|
+
├── components/ # Reusable components
|
|
145
|
+
│ ├── ui/
|
|
146
|
+
│ └── utilities/
|
|
147
|
+
├── services/ # Backend services
|
|
148
|
+
│ ├── api/
|
|
149
|
+
│ └── workers/
|
|
150
|
+
├── features/ # Product features
|
|
151
|
+
│ ├── core/
|
|
152
|
+
│ └── advanced/
|
|
153
|
+
├── integrations/ # External integrations
|
|
154
|
+
│ ├── databases/
|
|
155
|
+
│ ├── auth-providers/
|
|
156
|
+
│ └── storage/
|
|
157
|
+
├── standards/ # Coding standards
|
|
158
|
+
│ ├── coding-standards/
|
|
159
|
+
│ └── build-tools/
|
|
160
|
+
├── guides/ # How-to guides
|
|
161
|
+
│ ├── getting-started/
|
|
162
|
+
│ └── testing/
|
|
163
|
+
└── references/ # API references
|
|
164
|
+
├── api/
|
|
165
|
+
└── cli/
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Knowledge Graph Schema
|
|
169
|
+
|
|
170
|
+
### Node Types
|
|
171
|
+
|
|
172
|
+
| Type | Description |
|
|
173
|
+
|------|-------------|
|
|
174
|
+
| `concept` | Abstract concepts and ideas |
|
|
175
|
+
| `technical` | Technical components and implementations |
|
|
176
|
+
| `feature` | Product features and capabilities |
|
|
177
|
+
| `primitive` | Base technology primitives |
|
|
178
|
+
| `service` | Backend services and APIs |
|
|
179
|
+
| `guide` | How-to guides and tutorials |
|
|
180
|
+
| `standard` | Coding standards and conventions |
|
|
181
|
+
| `integration` | External integrations |
|
|
182
|
+
|
|
183
|
+
### Node Frontmatter
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
---
|
|
187
|
+
title: My Document
|
|
188
|
+
type: concept
|
|
189
|
+
status: active
|
|
190
|
+
tags: [concept, architecture]
|
|
191
|
+
created: 2025-01-01
|
|
192
|
+
updated: 2025-01-01
|
|
193
|
+
aliases: [Alternative Name]
|
|
194
|
+
related: [other-document]
|
|
195
|
+
---
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Claude-Flow Integration
|
|
199
|
+
|
|
200
|
+
The knowledge graph integrates with claude-flow for:
|
|
201
|
+
|
|
202
|
+
- **Memory Persistence**: Store graph data in claude-flow memory
|
|
203
|
+
- **Cross-Session Context**: Access knowledge across Claude sessions
|
|
204
|
+
- **Agent Coordination**: Share knowledge between swarm agents
|
|
205
|
+
|
|
206
|
+
### MCP Commands
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
// Store node in memory
|
|
210
|
+
mcp__claude-flow__memory_usage {
|
|
211
|
+
action: "store",
|
|
212
|
+
key: "node/<id>",
|
|
213
|
+
namespace: "knowledge-graph",
|
|
214
|
+
value: { ... }
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Retrieve node
|
|
218
|
+
mcp__claude-flow__memory_usage {
|
|
219
|
+
action: "retrieve",
|
|
220
|
+
key: "node/<id>",
|
|
221
|
+
namespace: "knowledge-graph"
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Search nodes
|
|
225
|
+
mcp__claude-flow__memory_search {
|
|
226
|
+
pattern: "node/*",
|
|
227
|
+
namespace: "knowledge-graph"
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Configuration
|
|
232
|
+
|
|
233
|
+
Create `.kg/config.json` to customize behavior:
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"projectRoot": ".",
|
|
238
|
+
"docsRoot": "docs",
|
|
239
|
+
"graph": {
|
|
240
|
+
"includePatterns": ["**/*.md"],
|
|
241
|
+
"excludePatterns": ["node_modules/**", "dist/**"]
|
|
242
|
+
},
|
|
243
|
+
"database": {
|
|
244
|
+
"path": ".kg/knowledge.db"
|
|
245
|
+
},
|
|
246
|
+
"claudeFlow": {
|
|
247
|
+
"enabled": true,
|
|
248
|
+
"namespace": "knowledge-graph",
|
|
249
|
+
"syncOnChange": true
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## API Reference
|
|
255
|
+
|
|
256
|
+
See [docs/API.md](./docs/API.md) for detailed API documentation.
|
|
257
|
+
|
|
258
|
+
## Contributing
|
|
259
|
+
|
|
260
|
+
Contributions are welcome! Please read our [Contributing Guide](./docs/CONTRIBUTING.md).
|
|
261
|
+
|
|
262
|
+
## License
|
|
263
|
+
|
|
264
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":";AACA;;;;GAIG"}
|
package/dist/cli/bin.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { createCLI } from "./index.js";
|
|
4
|
+
async function main() {
|
|
5
|
+
const program = createCLI();
|
|
6
|
+
try {
|
|
7
|
+
await program.parseAsync(process.argv);
|
|
8
|
+
} catch (error) {
|
|
9
|
+
if (error instanceof Error) {
|
|
10
|
+
console.error(chalk.red("Error:"), error.message);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
main().catch((error) => {
|
|
17
|
+
console.error(chalk.red("Fatal error:"), error);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=bin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sources":["../../src/cli/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Knowledge Graph Agent CLI\n *\n * Command-line interface for knowledge graph operations.\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { createCLI } from './index.js';\n\nasync function main(): Promise<void> {\n const program = createCLI();\n\n try {\n await program.parseAsync(process.argv);\n } catch (error) {\n if (error instanceof Error) {\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n throw error;\n }\n}\n\nmain().catch((error) => {\n console.error(chalk.red('Fatal error:'), error);\n process.exit(1);\n});\n"],"names":[],"mappings":";;;AAWA,eAAe,OAAsB;AACnC,QAAM,UAAU,UAAA;AAEhB,MAAI;AACF,UAAM,QAAQ,WAAW,QAAQ,IAAI;AAAA,EACvC,SAAS,OAAO;AACd,QAAI,iBAAiB,OAAO;AAC1B,cAAQ,MAAM,MAAM,IAAI,QAAQ,GAAG,MAAM,OAAO;AAChD,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,UAAM;AAAA,EACR;AACF;AAEA,OAAO,MAAM,CAAC,UAAU;AACtB,UAAQ,MAAM,MAAM,IAAI,cAAc,GAAG,KAAK;AAC9C,UAAQ,KAAK,CAAC;AAChB,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/claude.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CA+I7C"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import ora from "ora";
|
|
4
|
+
import { existsSync } from "fs";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
import { updateClaudeMd, generateClaudeMd, getSectionTemplate, listSectionTemplates, addSection } from "../../generators/claude-md.js";
|
|
7
|
+
import { validateProjectRoot, validatePath } from "../../core/security.js";
|
|
8
|
+
function createClaudeCommand() {
|
|
9
|
+
const command = new Command("claude");
|
|
10
|
+
command.description("CLAUDE.md management commands");
|
|
11
|
+
command.command("update").description("Generate or update CLAUDE.md file").option("-p, --path <path>", "Project root path", ".").option("-o, --output <path>", "Output path for CLAUDE.md").option("-t, --template <template>", "Template to use (default, minimal, full)").option("--no-kg", "Skip knowledge graph section").option("--no-cf", "Skip claude-flow section").option("-f, --force", "Overwrite existing file").action(async (options) => {
|
|
12
|
+
const spinner = ora("Updating CLAUDE.md...").start();
|
|
13
|
+
try {
|
|
14
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
15
|
+
const claudeMdPath = options.output ? validatePath(projectRoot, options.output) : join(projectRoot, "CLAUDE.md");
|
|
16
|
+
if (existsSync(claudeMdPath) && !options.force) {
|
|
17
|
+
spinner.warn("CLAUDE.md already exists. Use --force to overwrite.");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const result = await updateClaudeMd({
|
|
21
|
+
projectRoot,
|
|
22
|
+
outputPath: claudeMdPath,
|
|
23
|
+
template: options.template,
|
|
24
|
+
includeKnowledgeGraph: options.kg !== false,
|
|
25
|
+
includeClaudeFlow: options.cf !== false
|
|
26
|
+
});
|
|
27
|
+
if (result.created) {
|
|
28
|
+
spinner.succeed("CLAUDE.md created!");
|
|
29
|
+
} else {
|
|
30
|
+
spinner.succeed("CLAUDE.md updated!");
|
|
31
|
+
}
|
|
32
|
+
console.log();
|
|
33
|
+
console.log(chalk.gray(" Path:"), chalk.white(result.path));
|
|
34
|
+
console.log(chalk.gray(" Size:"), chalk.white(`${result.content.length} bytes`));
|
|
35
|
+
console.log();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
spinner.fail("Failed to update CLAUDE.md");
|
|
38
|
+
console.error(chalk.red(String(error)));
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
command.command("preview").description("Preview CLAUDE.md without writing").option("-p, --path <path>", "Project root path", ".").option("-t, --template <template>", "Template to use").action(async (options) => {
|
|
43
|
+
try {
|
|
44
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
45
|
+
const content = generateClaudeMd({
|
|
46
|
+
projectRoot,
|
|
47
|
+
template: options.template,
|
|
48
|
+
includeKnowledgeGraph: true,
|
|
49
|
+
includeClaudeFlow: true
|
|
50
|
+
});
|
|
51
|
+
console.log(chalk.cyan("\n--- CLAUDE.md Preview ---\n"));
|
|
52
|
+
console.log(content);
|
|
53
|
+
console.log(chalk.cyan("\n--- End Preview ---\n"));
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error(chalk.red("Failed to generate preview:"), String(error));
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
command.command("add-section <name>").description("Add a section to existing CLAUDE.md").option("-p, --path <path>", "Project root path", ".").action(async (name, options) => {
|
|
60
|
+
try {
|
|
61
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
62
|
+
const template = getSectionTemplate(name);
|
|
63
|
+
if (!template) {
|
|
64
|
+
console.log(chalk.yellow(`Unknown section template: ${name}`));
|
|
65
|
+
console.log();
|
|
66
|
+
console.log(chalk.white("Available templates:"));
|
|
67
|
+
listSectionTemplates().forEach((t) => {
|
|
68
|
+
console.log(chalk.gray(` - ${t}`));
|
|
69
|
+
});
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const added = addSection(projectRoot, template);
|
|
73
|
+
if (added) {
|
|
74
|
+
console.log(chalk.green(`✓ Added section: ${template.title}`));
|
|
75
|
+
} else {
|
|
76
|
+
console.log(chalk.yellow(`Section "${template.title}" already exists or CLAUDE.md not found`));
|
|
77
|
+
}
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error(chalk.red("Failed to add section:"), String(error));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
command.command("templates").description("List available section templates").action(() => {
|
|
84
|
+
console.log(chalk.white("\n Available Section Templates\n"));
|
|
85
|
+
const templates = listSectionTemplates();
|
|
86
|
+
templates.forEach((name) => {
|
|
87
|
+
const template = getSectionTemplate(name);
|
|
88
|
+
if (template) {
|
|
89
|
+
console.log(chalk.cyan(` ${name}`));
|
|
90
|
+
console.log(chalk.gray(` ${template.title}`));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
console.log();
|
|
94
|
+
console.log(chalk.gray(" Add with: ") + chalk.white("kg claude add-section <name>"));
|
|
95
|
+
console.log();
|
|
96
|
+
});
|
|
97
|
+
return command;
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
createClaudeCommand
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=claude.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.js","sources":["../../../src/cli/commands/claude.ts"],"sourcesContent":["/**\n * Claude Command\n *\n * Manage CLAUDE.md configuration file.\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\nimport {\n generateClaudeMd,\n updateClaudeMd,\n addSection,\n getSectionTemplate,\n listSectionTemplates,\n} from '../../generators/claude-md.js';\nimport { validateProjectRoot, validatePath } from '../../core/security.js';\n\n/**\n * Create claude command\n */\nexport function createClaudeCommand(): Command {\n const command = new Command('claude');\n\n command\n .description('CLAUDE.md management commands');\n\n // Update/generate subcommand\n command\n .command('update')\n .description('Generate or update CLAUDE.md file')\n .option('-p, --path <path>', 'Project root path', '.')\n .option('-o, --output <path>', 'Output path for CLAUDE.md')\n .option('-t, --template <template>', 'Template to use (default, minimal, full)')\n .option('--no-kg', 'Skip knowledge graph section')\n .option('--no-cf', 'Skip claude-flow section')\n .option('-f, --force', 'Overwrite existing file')\n .action(async (options) => {\n const spinner = ora('Updating CLAUDE.md...').start();\n\n try {\n // Validate paths to prevent traversal attacks\n const projectRoot = validateProjectRoot(options.path);\n const claudeMdPath = options.output\n ? validatePath(projectRoot, options.output)\n : join(projectRoot, 'CLAUDE.md');\n\n // Check if file exists\n if (existsSync(claudeMdPath) && !options.force) {\n spinner.warn('CLAUDE.md already exists. Use --force to overwrite.');\n return;\n }\n\n const result = await updateClaudeMd({\n projectRoot,\n outputPath: claudeMdPath,\n template: options.template,\n includeKnowledgeGraph: options.kg !== false,\n includeClaudeFlow: options.cf !== false,\n });\n\n if (result.created) {\n spinner.succeed('CLAUDE.md created!');\n } else {\n spinner.succeed('CLAUDE.md updated!');\n }\n\n console.log();\n console.log(chalk.gray(' Path:'), chalk.white(result.path));\n console.log(chalk.gray(' Size:'), chalk.white(`${result.content.length} bytes`));\n console.log();\n\n } catch (error) {\n spinner.fail('Failed to update CLAUDE.md');\n console.error(chalk.red(String(error)));\n process.exit(1);\n }\n });\n\n // Preview subcommand\n command\n .command('preview')\n .description('Preview CLAUDE.md without writing')\n .option('-p, --path <path>', 'Project root path', '.')\n .option('-t, --template <template>', 'Template to use')\n .action(async (options) => {\n try {\n const projectRoot = validateProjectRoot(options.path);\n\n const content = generateClaudeMd({\n projectRoot,\n template: options.template,\n includeKnowledgeGraph: true,\n includeClaudeFlow: true,\n });\n\n console.log(chalk.cyan('\\n--- CLAUDE.md Preview ---\\n'));\n console.log(content);\n console.log(chalk.cyan('\\n--- End Preview ---\\n'));\n\n } catch (error) {\n console.error(chalk.red('Failed to generate preview:'), String(error));\n process.exit(1);\n }\n });\n\n // Add section subcommand\n command\n .command('add-section <name>')\n .description('Add a section to existing CLAUDE.md')\n .option('-p, --path <path>', 'Project root path', '.')\n .action(async (name, options) => {\n try {\n const projectRoot = validateProjectRoot(options.path);\n\n // Check for built-in section template\n const template = getSectionTemplate(name);\n\n if (!template) {\n console.log(chalk.yellow(`Unknown section template: ${name}`));\n console.log();\n console.log(chalk.white('Available templates:'));\n listSectionTemplates().forEach(t => {\n console.log(chalk.gray(` - ${t}`));\n });\n return;\n }\n\n const added = addSection(projectRoot, template);\n\n if (added) {\n console.log(chalk.green(`✓ Added section: ${template.title}`));\n } else {\n console.log(chalk.yellow(`Section \"${template.title}\" already exists or CLAUDE.md not found`));\n }\n\n } catch (error) {\n console.error(chalk.red('Failed to add section:'), String(error));\n process.exit(1);\n }\n });\n\n // List templates subcommand\n command\n .command('templates')\n .description('List available section templates')\n .action(() => {\n console.log(chalk.white('\\n Available Section Templates\\n'));\n\n const templates = listSectionTemplates();\n templates.forEach(name => {\n const template = getSectionTemplate(name);\n if (template) {\n console.log(chalk.cyan(` ${name}`));\n console.log(chalk.gray(` ${template.title}`));\n }\n });\n\n console.log();\n console.log(chalk.gray(' Add with: ') + chalk.white('kg claude add-section <name>'));\n console.log();\n });\n\n return command;\n}\n"],"names":[],"mappings":";;;;;;;AAuBO,SAAS,sBAA+B;AAC7C,QAAM,UAAU,IAAI,QAAQ,QAAQ;AAEpC,UACG,YAAY,+BAA+B;AAG9C,UACG,QAAQ,QAAQ,EAChB,YAAY,mCAAmC,EAC/C,OAAO,qBAAqB,qBAAqB,GAAG,EACpD,OAAO,uBAAuB,2BAA2B,EACzD,OAAO,6BAA6B,0CAA0C,EAC9E,OAAO,WAAW,8BAA8B,EAChD,OAAO,WAAW,0BAA0B,EAC5C,OAAO,eAAe,yBAAyB,EAC/C,OAAO,OAAO,YAAY;AACzB,UAAM,UAAU,IAAI,uBAAuB,EAAE,MAAA;AAE7C,QAAI;AAEF,YAAM,cAAc,oBAAoB,QAAQ,IAAI;AACpD,YAAM,eAAe,QAAQ,SACzB,aAAa,aAAa,QAAQ,MAAM,IACxC,KAAK,aAAa,WAAW;AAGjC,UAAI,WAAW,YAAY,KAAK,CAAC,QAAQ,OAAO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;AAED,YAAQ,IAAA;AACR,YAAQ,IAAI,MAAM,KAAK,cAAc,IAAI,MAAM,MAAM,8BAA8B,CAAC;AACpF,YAAQ,IAAA;AAAA,EACV,CAAC;AAEH,SAAO;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CA6I3C"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import ora from "ora";
|
|
4
|
+
import { docsExist, initDocs, getDocsPath } from "../../generators/docs-init.js";
|
|
5
|
+
import { validateProjectRoot, validateDocsPath } from "../../core/security.js";
|
|
6
|
+
function createDocsCommand() {
|
|
7
|
+
const command = new Command("docs");
|
|
8
|
+
command.description("Documentation management commands");
|
|
9
|
+
command.command("init").description("Initialize documentation directory with weave-nn structure").option("-p, --path <path>", "Project root path", ".").option("-d, --docs <path>", "Docs directory path", "docs").option("-t, --template <template>", "Template to use (default, minimal)").option("--no-examples", "Skip example files").option("--no-detect", "Skip framework detection").option("-f, --force", "Overwrite existing files").action(async (options) => {
|
|
10
|
+
const spinner = ora("Initializing documentation...").start();
|
|
11
|
+
try {
|
|
12
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
13
|
+
const docsPath = options.docs;
|
|
14
|
+
validateDocsPath(projectRoot, docsPath);
|
|
15
|
+
if (docsExist(projectRoot, docsPath) && !options.force) {
|
|
16
|
+
spinner.warn(`Documentation already exists at ${docsPath}`);
|
|
17
|
+
console.log(chalk.gray(" Use --force to reinitialize"));
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const result = await initDocs({
|
|
21
|
+
projectRoot,
|
|
22
|
+
docsPath,
|
|
23
|
+
includeExamples: options.examples !== false,
|
|
24
|
+
detectFramework: options.detect !== false
|
|
25
|
+
});
|
|
26
|
+
if (result.success) {
|
|
27
|
+
spinner.succeed("Documentation initialized!");
|
|
28
|
+
} else {
|
|
29
|
+
spinner.warn("Documentation initialized with errors");
|
|
30
|
+
}
|
|
31
|
+
console.log();
|
|
32
|
+
console.log(chalk.white(" Created:"));
|
|
33
|
+
console.log(chalk.gray(` Path: ${result.docsPath}`));
|
|
34
|
+
console.log(chalk.green(` Files: ${result.filesCreated.length}`));
|
|
35
|
+
if (result.errors.length > 0) {
|
|
36
|
+
console.log();
|
|
37
|
+
console.log(chalk.yellow(" Errors:"));
|
|
38
|
+
result.errors.forEach((err) => {
|
|
39
|
+
console.log(chalk.gray(` - ${err}`));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
console.log();
|
|
43
|
+
console.log(chalk.cyan("Structure created:"));
|
|
44
|
+
console.log(chalk.gray(`
|
|
45
|
+
${docsPath}/
|
|
46
|
+
├── README.md # Documentation home
|
|
47
|
+
├── PRIMITIVES.md # Technology primitives
|
|
48
|
+
├── MOC.md # Map of Content
|
|
49
|
+
├── concepts/ # Abstract concepts
|
|
50
|
+
├── components/ # Reusable components
|
|
51
|
+
├── services/ # Backend services
|
|
52
|
+
├── features/ # Product features
|
|
53
|
+
├── integrations/ # External integrations
|
|
54
|
+
├── standards/ # Coding standards
|
|
55
|
+
├── guides/ # How-to guides
|
|
56
|
+
└── references/ # API references
|
|
57
|
+
`));
|
|
58
|
+
console.log(chalk.cyan("Next: ") + chalk.white("kg graph") + chalk.gray(" to generate knowledge graph"));
|
|
59
|
+
console.log();
|
|
60
|
+
} catch (error) {
|
|
61
|
+
spinner.fail("Failed to initialize documentation");
|
|
62
|
+
console.error(chalk.red(String(error)));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
command.command("status").description("Show documentation status").option("-p, --path <path>", "Project root path", ".").action(async (options) => {
|
|
67
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
68
|
+
const docsPath = getDocsPath(projectRoot);
|
|
69
|
+
if (!docsPath) {
|
|
70
|
+
console.log(chalk.yellow(" No documentation directory found"));
|
|
71
|
+
console.log(chalk.gray(" Run ") + chalk.cyan("kg docs init") + chalk.gray(" to create one"));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
console.log(chalk.white("\n Documentation Status\n"));
|
|
75
|
+
console.log(chalk.gray(" Path:"), chalk.white(docsPath));
|
|
76
|
+
console.log();
|
|
77
|
+
const fg = await import("fast-glob");
|
|
78
|
+
const files = await fg.default("**/*.md", {
|
|
79
|
+
cwd: docsPath,
|
|
80
|
+
ignore: ["node_modules/**", ".git/**"]
|
|
81
|
+
});
|
|
82
|
+
console.log(chalk.gray(" Markdown files:"), chalk.white(files.length));
|
|
83
|
+
const keyFiles = ["README.md", "PRIMITIVES.md", "MOC.md"];
|
|
84
|
+
const fs = await import("fs");
|
|
85
|
+
const path = await import("path");
|
|
86
|
+
console.log();
|
|
87
|
+
console.log(chalk.white(" Key Files:"));
|
|
88
|
+
keyFiles.forEach((file) => {
|
|
89
|
+
const exists = fs.existsSync(path.join(docsPath, file));
|
|
90
|
+
const icon = exists ? chalk.green("✓") : chalk.red("✗");
|
|
91
|
+
console.log(` ${icon} ${file}`);
|
|
92
|
+
});
|
|
93
|
+
const dirs = ["concepts", "components", "services", "features", "guides"];
|
|
94
|
+
console.log();
|
|
95
|
+
console.log(chalk.white(" Directories:"));
|
|
96
|
+
dirs.forEach((dir) => {
|
|
97
|
+
const exists = fs.existsSync(path.join(docsPath, dir));
|
|
98
|
+
const icon = exists ? chalk.green("✓") : chalk.gray("○");
|
|
99
|
+
console.log(` ${icon} ${dir}/`);
|
|
100
|
+
});
|
|
101
|
+
console.log();
|
|
102
|
+
});
|
|
103
|
+
return command;
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
createDocsCommand
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.js","sources":["../../../src/cli/commands/docs.ts"],"sourcesContent":["/**\n * Docs Command\n *\n * Initialize and manage documentation directory.\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { initDocs, docsExist, getDocsPath } from '../../generators/docs-init.js';\nimport { validateProjectRoot, validateDocsPath } from '../../core/security.js';\n\n/**\n * Create docs command\n */\nexport function createDocsCommand(): Command {\n const command = new Command('docs');\n\n command\n .description('Documentation management commands');\n\n // Init subcommand\n command\n .command('init')\n .description('Initialize documentation directory with weave-nn structure')\n .option('-p, --path <path>', 'Project root path', '.')\n .option('-d, --docs <path>', 'Docs directory path', 'docs')\n .option('-t, --template <template>', 'Template to use (default, minimal)')\n .option('--no-examples', 'Skip example files')\n .option('--no-detect', 'Skip framework detection')\n .option('-f, --force', 'Overwrite existing files')\n .action(async (options) => {\n const spinner = ora('Initializing documentation...').start();\n\n try {\n // Validate paths to prevent traversal attacks\n const projectRoot = validateProjectRoot(options.path);\n const docsPath = options.docs;\n validateDocsPath(projectRoot, docsPath); // Ensure docs stays within project\n\n // Check if docs already exist\n if (docsExist(projectRoot, docsPath) && !options.force) {\n spinner.warn(`Documentation already exists at ${docsPath}`);\n console.log(chalk.gray(' Use --force to reinitialize'));\n return;\n }\n\n const result = await initDocs({\n projectRoot,\n docsPath,\n includeExamples: options.examples !== false,\n detectFramework: options.detect !== false,\n });\n\n if (result.success) {\n spinner.succeed('Documentation initialized!');\n } else {\n spinner.warn('Documentation initialized with errors');\n }\n\n console.log();\n console.log(chalk.white(' Created:'));\n console.log(chalk.gray(` Path: ${result.docsPath}`));\n console.log(chalk.green(` Files: ${result.filesCreated.length}`));\n\n if (result.errors.length > 0) {\n console.log();\n console.log(chalk.yellow(' Errors:'));\n result.errors.forEach(err => {\n console.log(chalk.gray(` - ${err}`));\n });\n }\n\n console.log();\n console.log(chalk.cyan('Structure created:'));\n console.log(chalk.gray(`\n ${docsPath}/\n ├── README.md # Documentation home\n ├── PRIMITIVES.md # Technology primitives\n ├── MOC.md # Map of Content\n ├── concepts/ # Abstract concepts\n ├── components/ # Reusable components\n ├── services/ # Backend services\n ├── features/ # Product features\n ├── integrations/ # External integrations\n ├── standards/ # Coding standards\n ├── guides/ # How-to guides\n └── references/ # API references\n `));\n\n console.log(chalk.cyan('Next: ') + chalk.white('kg graph') + chalk.gray(' to generate knowledge graph'));\n console.log();\n\n } catch (error) {\n spinner.fail('Failed to initialize documentation');\n console.error(chalk.red(String(error)));\n process.exit(1);\n }\n });\n\n // Status subcommand\n command\n .command('status')\n .description('Show documentation status')\n .option('-p, --path <path>', 'Project root path', '.')\n .action(async (options) => {\n // Validate path to prevent traversal\n const projectRoot = validateProjectRoot(options.path);\n const docsPath = getDocsPath(projectRoot);\n\n if (!docsPath) {\n console.log(chalk.yellow(' No documentation directory found'));\n console.log(chalk.gray(' Run ') + chalk.cyan('kg docs init') + chalk.gray(' to create one'));\n return;\n }\n\n console.log(chalk.white('\\n Documentation Status\\n'));\n console.log(chalk.gray(' Path:'), chalk.white(docsPath));\n console.log();\n\n // Count files\n const fg = await import('fast-glob');\n const files = await fg.default('**/*.md', {\n cwd: docsPath,\n ignore: ['node_modules/**', '.git/**'],\n });\n\n console.log(chalk.gray(' Markdown files:'), chalk.white(files.length));\n\n // Check for key files\n const keyFiles = ['README.md', 'PRIMITIVES.md', 'MOC.md'];\n const fs = await import('fs');\n const path = await import('path');\n\n console.log();\n console.log(chalk.white(' Key Files:'));\n keyFiles.forEach(file => {\n const exists = fs.existsSync(path.join(docsPath, file));\n const icon = exists ? chalk.green('✓') : chalk.red('✗');\n console.log(` ${icon} ${file}`);\n });\n\n // Check directories\n const dirs = ['concepts', 'components', 'services', 'features', 'guides'];\n console.log();\n console.log(chalk.white(' Directories:'));\n dirs.forEach(dir => {\n const exists = fs.existsSync(path.join(docsPath, dir));\n const icon = exists ? chalk.green('✓') : chalk.gray('○');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ACL,QAAQ,CAAC,mBAAmB,SAAS;AAAA,IAAA,CACtC;AAED,YAAQ,IAAI,MAAM,KAAK,mBAAmB,GAAG,MAAM,MAAM,MAAM,MAAM,CAAC;AAGtE,UAAM,WAAW,CAAC,aAAa,iBAAiB,QAAQ;AACxD,UAAM,KAAK,MAAM,OAAO,IAAI;AAC5B,UAAM,OAAO,MAAM,OAAO,MAAM;AAEhC,YAAQ,IAAA;AACR,YAAQ,IAAI,MAAM,MAAM,cAAc,CAAC;AACvC,aAAS,QAAQ,CAAA,SAAQ;AACvB,YAAM,SAAS,GAAG,WAAW,KAAK,KAAK,UAAU,IAAI,CAAC;AACtD,YAAM,OAAO,SAAS,MAAM,MAAM,GAAG,IAAI,MAAM,IAAI,GAAG;AACtD,cAAQ,IAAI,OAAO,IAAI,IAAI,IAAI,EAAE;AAAA,IACnC,CAAC;AAGD,UAAM,OAAO,CAAC,YAAY,cAAc,YAAY,YAAY,QAAQ;AACxE,YAAQ,IAAA;AACR,YAAQ,IAAI,MAAM,MAAM,gBAAgB,CAAC;AACzC,SAAK,QAAQ,CAAA,QAAO;AAClB,YAAM,SAAS,GAAG,WAAW,KAAK,KAAK,UAAU,GAAG,CAAC;AACrD,YAAM,OAAO,SAAS,MAAM,MAAM,GAAG,IAAI,MAAM,KAAK,GAAG;AACvD,cAAQ,IAAI,OAAO,IAAI,IAAI,GAAG,GAAG;AAAA,IACnC,CAAC;AAED,YAAQ,IAAA;AAAA,EACV,CAAC;AAEH,SAAO;AACT;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph Command
|
|
3
|
+
*
|
|
4
|
+
* Generate and update knowledge graph from documentation.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
/**
|
|
8
|
+
* Create graph command
|
|
9
|
+
*/
|
|
10
|
+
export declare function createGraphCommand(): Command;
|
|
11
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/graph.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CA6J5C"}
|