kibi-cli 0.11.0 → 0.11.1
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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +36 -0
- package/dist/commands/skills.d.ts +14 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +86 -0
- package/dist/public/skills/kibi-usage/SKILL.md +125 -0
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +45 -0
- package/dist/public/skills/kibi-usage/resources/relationship-directions.md +89 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +35 -0
- package/dist/public/skills.d.ts +42 -0
- package/dist/public/skills.d.ts.map +1 -0
- package/dist/public/skills.js +262 -0
- package/package.json +6 -2
- package/src/public/skills/kibi-usage/SKILL.md +125 -0
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +45 -0
- package/src/public/skills/kibi-usage/resources/relationship-directions.md +89 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +35 -0
- package/src/public/skills.ts +359 -0
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AA8CA,0EAA0E;AAC1E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/cli.js
CHANGED
|
@@ -28,6 +28,7 @@ import { initCommand } from "./commands/init.js";
|
|
|
28
28
|
import { migrateCommand } from "./commands/migrate.js";
|
|
29
29
|
import { queryCommand } from "./commands/query.js";
|
|
30
30
|
import { searchCommand } from "./commands/search.js";
|
|
31
|
+
import { skillsListCommand, skillsLoadCommand, skillsReadCommand, skillsValidateCommand, } from "./commands/skills.js";
|
|
31
32
|
import { statusCommand } from "./commands/status.js";
|
|
32
33
|
import { syncCommand } from "./commands/sync.js";
|
|
33
34
|
import { usageMetricsCommand } from "./commands/usage-metrics.js";
|
|
@@ -176,6 +177,41 @@ program
|
|
|
176
177
|
.action(withExitCode(async (options) => {
|
|
177
178
|
return usageMetricsCommand(options);
|
|
178
179
|
}));
|
|
180
|
+
const skillsProgram = program
|
|
181
|
+
.command("skills")
|
|
182
|
+
.description("Manage bundled markdown skills");
|
|
183
|
+
skillsProgram
|
|
184
|
+
.command("list")
|
|
185
|
+
.description("List bundled markdown skills")
|
|
186
|
+
.option("--format <format>", "Output format: json|table", "table")
|
|
187
|
+
.action(withExitCode(async (options) => {
|
|
188
|
+
return skillsListCommand(options);
|
|
189
|
+
}));
|
|
190
|
+
skillsProgram
|
|
191
|
+
.command("load")
|
|
192
|
+
.description("Load a bundled markdown skill")
|
|
193
|
+
.argument("<id>", "Bundled skill ID")
|
|
194
|
+
.option("--format <format>", "Output format: json|markdown", "markdown")
|
|
195
|
+
.action(withExitCode(async (id, options) => {
|
|
196
|
+
return skillsLoadCommand(id, options);
|
|
197
|
+
}));
|
|
198
|
+
skillsProgram
|
|
199
|
+
.command("read")
|
|
200
|
+
.description("Read a declared bundled skill resource")
|
|
201
|
+
.argument("<id>", "Bundled skill ID")
|
|
202
|
+
.argument("<resource>", "Declared resource path")
|
|
203
|
+
.option("--format <format>", "Output format: text|json", "text")
|
|
204
|
+
.action(withExitCode(async (id, resource, options) => {
|
|
205
|
+
return skillsReadCommand(id, resource, options);
|
|
206
|
+
}));
|
|
207
|
+
skillsProgram
|
|
208
|
+
.command("validate")
|
|
209
|
+
.description("Validate a bundled markdown skill path")
|
|
210
|
+
.argument("<path>", "Skill bundle directory or SKILL.md path")
|
|
211
|
+
.option("--format <format>", "Output format: json|table", "table")
|
|
212
|
+
.action(withExitCode(async (pathLike, options) => {
|
|
213
|
+
return skillsValidateCommand(pathLike, options);
|
|
214
|
+
}));
|
|
179
215
|
program
|
|
180
216
|
.command("branch")
|
|
181
217
|
.description("Manage branch KBs")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandResult } from "../cli.js";
|
|
2
|
+
interface FormatOptions<TFormat extends string> {
|
|
3
|
+
format?: TFormat;
|
|
4
|
+
}
|
|
5
|
+
type ListFormat = "json" | "table";
|
|
6
|
+
type LoadFormat = "json" | "markdown";
|
|
7
|
+
type ReadFormat = "text" | "json";
|
|
8
|
+
type ValidateFormat = "json" | "table";
|
|
9
|
+
export declare function skillsListCommand(options: FormatOptions<ListFormat>): Promise<CommandResult | undefined>;
|
|
10
|
+
export declare function skillsLoadCommand(id: string, options: FormatOptions<LoadFormat>): Promise<CommandResult | undefined>;
|
|
11
|
+
export declare function skillsReadCommand(id: string, resource: string, options: FormatOptions<ReadFormat>): Promise<CommandResult | undefined>;
|
|
12
|
+
export declare function skillsValidateCommand(pathLike: string, options: FormatOptions<ValidateFormat>): Promise<CommandResult | undefined>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAU/C,UAAU,aAAa,CAAC,OAAO,SAAS,MAAM;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,KAAK,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AACnC,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;AACtC,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAClC,KAAK,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAGvC,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,GACjC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAUpC;AAED,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,GACjC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAgBpC;AAED,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,GACjC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAUpC;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,GACrC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAepC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import Table from "cli-table3";
|
|
3
|
+
import { listBundledSkills, loadBundledSkill, readBundledSkillResource, validateSkillBundle, } from "kibi-cli/skills";
|
|
4
|
+
// implements REQ-003
|
|
5
|
+
export async function skillsListCommand(options) {
|
|
6
|
+
return handleSkillCommand(() => {
|
|
7
|
+
const skills = listBundledSkills();
|
|
8
|
+
if (options.format === "json") {
|
|
9
|
+
console.log(JSON.stringify(skills, null, 2));
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
console.log(renderSkillsTable(skills));
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export async function skillsLoadCommand(id, options) {
|
|
16
|
+
return handleSkillCommand(() => {
|
|
17
|
+
const bundle = loadBundledSkill(id);
|
|
18
|
+
if (options.format === "json") {
|
|
19
|
+
console.log(JSON.stringify({
|
|
20
|
+
metadata: bundle.manifest,
|
|
21
|
+
body: bundle.body,
|
|
22
|
+
resources: bundle.manifest.resources ?? [],
|
|
23
|
+
contentHash: createHash("sha256").update(bundle.body).digest("hex"),
|
|
24
|
+
sourceType: "bundled",
|
|
25
|
+
}, null, 2));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
process.stdout.write(bundle.body.endsWith("\n") ? bundle.body : `${bundle.body}\n`);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export async function skillsReadCommand(id, resource, options) {
|
|
32
|
+
return handleSkillCommand(() => {
|
|
33
|
+
const contents = readBundledSkillResource(id, resource);
|
|
34
|
+
if (options.format === "json") {
|
|
35
|
+
console.log(JSON.stringify({ id, resource, contents }, null, 2));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
process.stdout.write(contents.endsWith("\n") ? contents : `${contents}\n`);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export async function skillsValidateCommand(pathLike, options) {
|
|
42
|
+
return handleSkillCommand(() => {
|
|
43
|
+
const result = validateSkillBundle(pathLike);
|
|
44
|
+
const printable = {
|
|
45
|
+
valid: result.valid,
|
|
46
|
+
errors: result.errors.map(formatValidationError),
|
|
47
|
+
};
|
|
48
|
+
if (options.format === "json") {
|
|
49
|
+
console.log(JSON.stringify(printable, null, 2));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
console.log(renderValidationTable(printable));
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function handleSkillCommand(action) {
|
|
56
|
+
try {
|
|
57
|
+
action();
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
62
|
+
console.error(message);
|
|
63
|
+
return { exitCode: 1 };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function renderSkillsTable(skills) {
|
|
67
|
+
const table = new Table({ head: ["ID", "Name", "Version", "Description"] });
|
|
68
|
+
for (const skill of skills) {
|
|
69
|
+
table.push([skill.id, skill.name, skill.version, skill.description]);
|
|
70
|
+
}
|
|
71
|
+
return table.toString();
|
|
72
|
+
}
|
|
73
|
+
function formatValidationError(error) {
|
|
74
|
+
return { field: error.field, message: error.message };
|
|
75
|
+
}
|
|
76
|
+
function renderValidationTable(result) {
|
|
77
|
+
const table = new Table({ head: ["Valid", "Field", "Message"] });
|
|
78
|
+
if (result.errors.length === 0) {
|
|
79
|
+
table.push([String(result.valid), "", ""]);
|
|
80
|
+
return table.toString();
|
|
81
|
+
}
|
|
82
|
+
for (const error of result.errors) {
|
|
83
|
+
table.push([String(result.valid), error.field, error.message]);
|
|
84
|
+
}
|
|
85
|
+
return table.toString();
|
|
86
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: kibi-usage
|
|
3
|
+
name: Kibi Usage
|
|
4
|
+
description: Guides agents to use Kibi MCP, facts, relationships, and validation correctly
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
kibiCompatibility: ">=0.11.0"
|
|
7
|
+
tags:
|
|
8
|
+
- kibi
|
|
9
|
+
- mcp
|
|
10
|
+
- knowledge-base
|
|
11
|
+
- traceability
|
|
12
|
+
- agent-guidance
|
|
13
|
+
resources:
|
|
14
|
+
- resources/relationship-directions.md
|
|
15
|
+
- resources/fact-lanes.md
|
|
16
|
+
- resources/workflows.md
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Kibi Usage
|
|
20
|
+
|
|
21
|
+
Consult this skill before any Kibi knowledge base operation, on first interaction with a Kibi-enabled repo, after detecting stale or dirty KB status, and before performing mutations.
|
|
22
|
+
|
|
23
|
+
## MCP-Only Rules
|
|
24
|
+
|
|
25
|
+
Interact with the knowledge base exclusively through MCP tools. Do not read or edit files inside `.kb/` directly. Do not run any `kibi` CLI commands from the agent session. The MCP surface is the only sanctioned interface for agents.
|
|
26
|
+
|
|
27
|
+
## Discovery-First Workflow
|
|
28
|
+
|
|
29
|
+
Always discover before you mutate. Start with `kb_search` for exploratory discovery across metadata and markdown body text. Split broad queries into 1-3 focused probes. Review top hits for relevance before concluding the KB lacks knowledge.
|
|
30
|
+
|
|
31
|
+
Follow up with `kb_query` for exact lookups by `id`, `type`, `tags`, or `sourceFile`. Call `kb_status` to inspect branch attachment and freshness when stale context would affect decisions. Only after discovery and confirmation should you mutate.
|
|
32
|
+
|
|
33
|
+
## Relationship Directions
|
|
34
|
+
|
|
35
|
+
Relationship direction is fixed and semantic. Getting it wrong breaks traceability queries and validation.
|
|
36
|
+
|
|
37
|
+
| Relationship | Direction | Meaning |
|
|
38
|
+
|-------------|-----------|---------|
|
|
39
|
+
| `implements` | symbol -> req | Symbol owns or implements requirement behavior |
|
|
40
|
+
| `specified_by` | req -> scenario | Requirement is specified by a scenario |
|
|
41
|
+
| `verified_by` | req/scenario -> test | Requirement or scenario is verified by a test |
|
|
42
|
+
| `validates` | test -> req/scenario | Test validates a requirement or scenario |
|
|
43
|
+
| `executable_for` | symbol -> test | Symbol is executable test code for a test entity |
|
|
44
|
+
| `constrains` | req -> fact(subject) | Requirement constrains a domain fact |
|
|
45
|
+
| `requires_property` | req -> fact(property_value) | Requirement requires a property value |
|
|
46
|
+
| `supersedes` | old-req -> new-req | Old requirement is replaced by new requirement |
|
|
47
|
+
| `covered_by` | symbol -> test | Production symbol has coverage evidence from a test |
|
|
48
|
+
|
|
49
|
+
See `resources/relationship-directions.md` for detailed payload examples.
|
|
50
|
+
|
|
51
|
+
## Strict Fact Lane
|
|
52
|
+
|
|
53
|
+
Normative requirements that must participate in contradiction blocking use the strict fact lane. Create a `fact_kind: subject` fact and link it from the requirement via `constrains`. Create a `fact_kind: property_value` fact and link it via `requires_property`.
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
# Fact entity
|
|
57
|
+
id: FACT-USER-ROLE
|
|
58
|
+
title: User Role Assignment
|
|
59
|
+
status: active
|
|
60
|
+
fact_kind: subject
|
|
61
|
+
subject_key: user.role_assignment
|
|
62
|
+
|
|
63
|
+
# Requirement entity
|
|
64
|
+
id: REQ-019
|
|
65
|
+
title: Users can have up to 3 roles
|
|
66
|
+
status: open
|
|
67
|
+
relationships:
|
|
68
|
+
- type: constrains
|
|
69
|
+
from: REQ-019
|
|
70
|
+
to: FACT-USER-ROLE
|
|
71
|
+
- type: requires_property
|
|
72
|
+
from: REQ-019
|
|
73
|
+
to: FACT-LIMIT-3
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
See `resources/fact-lanes.md` for the full strict vs observation lane comparison.
|
|
77
|
+
|
|
78
|
+
## Fact vs Flag
|
|
79
|
+
|
|
80
|
+
Use `flag` for runtime or config gates only. Feature flags, kill-switches, and deferred capabilities are valid `flag` entities.
|
|
81
|
+
|
|
82
|
+
Bugs, incidents, and workarounds belong in `fact` entities with `fact_kind: observation` or `meta`. These fact kinds are excluded from contradiction inference, making them appropriate for non-blocking evidence.
|
|
83
|
+
|
|
84
|
+
Anti-example: do not create a `flag` named `BUG-123` to track a defect. Create a `fact` with `fact_kind: observation` instead.
|
|
85
|
+
|
|
86
|
+
## Create-Before-Link
|
|
87
|
+
|
|
88
|
+
Always confirm or create endpoint entities before linking them. Query target IDs with `kb_query` first. If an endpoint does not exist, create it with `kb_upsert` before creating the relationship. Creating relationships to non-existent entities produces dangling references that `kb_check` will flag.
|
|
89
|
+
|
|
90
|
+
## Sequential Upserts
|
|
91
|
+
|
|
92
|
+
Never fire `kb_upsert` calls in parallel. Execute them sequentially to avoid lock contention and ensure deterministic ordering. This is especially important when creating chains of related entities.
|
|
93
|
+
|
|
94
|
+
## Targeted and Final Checks
|
|
95
|
+
|
|
96
|
+
Run `kb_check` with specific rules during iteration for fast feedback. For example, use `rules: ["required-fields", "no-dangling-refs"]` after small changes. Run a full `kb_check` without rule filters before declaring work complete.
|
|
97
|
+
|
|
98
|
+
## Domain Contradictions and Evolution
|
|
99
|
+
|
|
100
|
+
The `domain-contradictions` rule detects conflicts between strict-lane facts linked to requirements. When a contradiction is found, the supported escape hatch is `supersedes`: create a new requirement that supersedes the old one, then link the new requirement to updated facts.
|
|
101
|
+
|
|
102
|
+
Use `kb_model_requirement` for automated strict-fact modeling. It generates the subject and property_value facts, links them via `constrains` and `requires_property`, and handles low-confidence downgrades to `observation` facts automatically.
|
|
103
|
+
|
|
104
|
+
## Stale or Dirty KB Handling
|
|
105
|
+
|
|
106
|
+
Call `kb_status` when you suspect the branch KB is stale or when switching context. Report freshness findings to the user rather than relying on outdated KB context. If `kb_status` indicates a schema migration is needed, ask the user or operator to handle it outside the agent session.
|
|
107
|
+
|
|
108
|
+
## Anti-Patterns and Remediation
|
|
109
|
+
|
|
110
|
+
| Anti-Pattern | Problem | Remediation |
|
|
111
|
+
|-------------|---------|-------------|
|
|
112
|
+
| Reversed relationship direction | Traceability queries break | Verify direction against the relationship table above |
|
|
113
|
+
| Bug-as-flag | `flag` misused for defect tracking | Use `fact` with `fact_kind: observation` or `meta` |
|
|
114
|
+
| Parallel upserts | Lock contention and nondeterminism | Execute `kb_upsert` calls sequentially |
|
|
115
|
+
| Embedded scenarios in reqs | Violates canonical traceability chain | Create separate `req`, `scen`, and `test` entities |
|
|
116
|
+
| Missing `kb_check` | Undetected dangling refs and violations | Run targeted checks during work, full check at completion |
|
|
117
|
+
| Tags as multi-ID lookup | Tags are metadata, not identifiers | Use `kb_query` with explicit `id` values |
|
|
118
|
+
| `relates_to` for strict modeling | Loses contradiction safety | Use `constrains` and `requires_property` instead |
|
|
119
|
+
|
|
120
|
+
Before/after for reversed direction:
|
|
121
|
+
|
|
122
|
+
- Wrong: `relationships: [{ type: "implements", from: "REQ-001", to: "SYM-001" }]`
|
|
123
|
+
- Right: `relationships: [{ type: "implements", from: "SYM-001", to: "REQ-001" }]`
|
|
124
|
+
|
|
125
|
+
See `resources/workflows.md` for the golden-path discovery to validation sequence.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Fact Lanes
|
|
2
|
+
|
|
3
|
+
## Strict Lane (Contradiction-Safe)
|
|
4
|
+
|
|
5
|
+
### fact_kind: subject
|
|
6
|
+
```yaml
|
|
7
|
+
id: FACT-USER-ROLE
|
|
8
|
+
title: User Role Assignment
|
|
9
|
+
status: active
|
|
10
|
+
fact_kind: subject
|
|
11
|
+
subject_key: user.role_assignment
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### fact_kind: property_value
|
|
15
|
+
```yaml
|
|
16
|
+
id: FACT-LIMIT-3
|
|
17
|
+
title: Maximum of Three Roles
|
|
18
|
+
status: active
|
|
19
|
+
fact_kind: property_value
|
|
20
|
+
subject_key: user.role_assignment
|
|
21
|
+
property_key: max_roles
|
|
22
|
+
operator: lte
|
|
23
|
+
value_type: int
|
|
24
|
+
value_int: 3
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Context Lane (Non-Blocking)
|
|
28
|
+
|
|
29
|
+
### fact_kind: observation
|
|
30
|
+
For bug records, incident notes, and observed behavior.
|
|
31
|
+
```yaml
|
|
32
|
+
id: FACT-BUG-123
|
|
33
|
+
title: Login fails on Safari 17
|
|
34
|
+
status: active
|
|
35
|
+
fact_kind: observation
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### fact_kind: meta
|
|
39
|
+
For governance notes, process commentary, and workaround documentation.
|
|
40
|
+
```yaml
|
|
41
|
+
id: FACT-WORKAROUND-456
|
|
42
|
+
title: Temporary cache bypass for v2 migration
|
|
43
|
+
status: active
|
|
44
|
+
fact_kind: meta
|
|
45
|
+
```
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Relationship Directions
|
|
2
|
+
|
|
3
|
+
## Direction Table
|
|
4
|
+
|
|
5
|
+
| Relationship | Source -> Target | Semantic Meaning |
|
|
6
|
+
|-------------|------------------|------------------|
|
|
7
|
+
| `implements` | symbol -> req | Production code symbol owns or implements requirement behavior |
|
|
8
|
+
| `specified_by` | req -> scenario | Requirement is specified by a BDD scenario |
|
|
9
|
+
| `verified_by` | req/scenario -> test | Requirement or scenario is verified by a test case |
|
|
10
|
+
| `validates` | test -> req/scenario | Test validates a requirement or scenario (inverse of verified_by) |
|
|
11
|
+
| `executable_for` | symbol -> test | Test symbol (code) is executable code for a test entity |
|
|
12
|
+
| `constrains` | req -> fact(subject) | Requirement constrains a strict-lane domain fact |
|
|
13
|
+
| `requires_property` | req -> fact(property_value) | Requirement requires a specific property value fact |
|
|
14
|
+
| `supersedes` | old-req -> new-req | Old requirement is formally replaced by a new requirement |
|
|
15
|
+
| `covered_by` | symbol -> test | Production symbol has test coverage evidence |
|
|
16
|
+
|
|
17
|
+
## Valid Payload Examples
|
|
18
|
+
|
|
19
|
+
### implements
|
|
20
|
+
```yaml
|
|
21
|
+
relationships:
|
|
22
|
+
- type: implements
|
|
23
|
+
from: SYM-001
|
|
24
|
+
to: REQ-001
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### specified_by
|
|
28
|
+
```yaml
|
|
29
|
+
relationships:
|
|
30
|
+
- type: specified_by
|
|
31
|
+
from: REQ-001
|
|
32
|
+
to: SCEN-001
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### verified_by
|
|
36
|
+
```yaml
|
|
37
|
+
relationships:
|
|
38
|
+
- type: verified_by
|
|
39
|
+
from: REQ-001
|
|
40
|
+
to: TEST-001
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### validates
|
|
44
|
+
```yaml
|
|
45
|
+
relationships:
|
|
46
|
+
- type: validates
|
|
47
|
+
from: TEST-001
|
|
48
|
+
to: SCEN-001
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### executable_for
|
|
52
|
+
```yaml
|
|
53
|
+
relationships:
|
|
54
|
+
- type: executable_for
|
|
55
|
+
from: SYM-test-login
|
|
56
|
+
to: TEST-001
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### constrains
|
|
60
|
+
```yaml
|
|
61
|
+
relationships:
|
|
62
|
+
- type: constrains
|
|
63
|
+
from: REQ-019
|
|
64
|
+
to: FACT-USER-ROLE
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### requires_property
|
|
68
|
+
```yaml
|
|
69
|
+
relationships:
|
|
70
|
+
- type: requires_property
|
|
71
|
+
from: REQ-019
|
|
72
|
+
to: FACT-LIMIT-3
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### supersedes
|
|
76
|
+
```yaml
|
|
77
|
+
relationships:
|
|
78
|
+
- type: supersedes
|
|
79
|
+
from: REQ-001
|
|
80
|
+
to: REQ-001-v2
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### covered_by
|
|
84
|
+
```yaml
|
|
85
|
+
relationships:
|
|
86
|
+
- type: covered_by
|
|
87
|
+
from: SYM-handler
|
|
88
|
+
to: TEST-005
|
|
89
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Workflows
|
|
2
|
+
|
|
3
|
+
## Discovery to Validation Sequence
|
|
4
|
+
|
|
5
|
+
The canonical workflow for any KB operation follows this pattern:
|
|
6
|
+
|
|
7
|
+
1. **Discover**: `kb_search` with focused probes
|
|
8
|
+
2. **Confirm**: `kb_query` for exact IDs and state
|
|
9
|
+
3. **Inspect**: `kb_status` when freshness matters
|
|
10
|
+
4. **Create endpoints**: `kb_upsert` for new entities (sequential)
|
|
11
|
+
5. **Link**: `kb_upsert` with relationship rows (sequential)
|
|
12
|
+
6. **Validate**: `kb_check` with targeted rules during work, full check at completion
|
|
13
|
+
|
|
14
|
+
## Creating a New Feature
|
|
15
|
+
```
|
|
16
|
+
1. kb_search to discover existing requirements and related knowledge
|
|
17
|
+
2. kb_query to confirm exact IDs and source-linked context
|
|
18
|
+
3. kb_upsert for new or updated requirements (include relationship rows)
|
|
19
|
+
4. kb_check with targeted rules
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Fixing a Traceability Gap
|
|
23
|
+
```
|
|
24
|
+
1. kb_query --sourceFile <code-file> to find linked entities
|
|
25
|
+
2. kb_find_gaps --type req --missing-rel specified_by to find orphan requirements
|
|
26
|
+
3. kb_upsert to add missing relationship rows (sequential)
|
|
27
|
+
4. kb_check with rules: ["no-dangling-refs", "symbol-traceability"]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Before Risky Work
|
|
31
|
+
```
|
|
32
|
+
1. /brief-kibi or kb_briefing_generate for citation-backed briefing
|
|
33
|
+
2. Inspect briefingState; proceed only if ready
|
|
34
|
+
3. Use constraints, regressionRisks, and cited entities from the briefing
|
|
35
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare function setBundledSkillsDir(dir: string): void;
|
|
2
|
+
export declare function resetBundledSkillsDir(): void;
|
|
3
|
+
export interface SkillManifest {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
version: string;
|
|
8
|
+
kibiCompatibility: string;
|
|
9
|
+
tags?: string[];
|
|
10
|
+
resources?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface SkillBundle {
|
|
13
|
+
manifest: SkillManifest;
|
|
14
|
+
body: string;
|
|
15
|
+
rootDir: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class SkillNotFoundError extends Error {
|
|
18
|
+
constructor(id: string);
|
|
19
|
+
}
|
|
20
|
+
export declare class SkillResourceNotFoundError extends Error {
|
|
21
|
+
constructor(id: string, resourcePath: string);
|
|
22
|
+
}
|
|
23
|
+
export declare class SkillResourceOutOfBoundsError extends Error {
|
|
24
|
+
constructor(id: string, resourcePath: string);
|
|
25
|
+
}
|
|
26
|
+
export declare class SkillValidationError extends Error {
|
|
27
|
+
readonly field: string;
|
|
28
|
+
constructor(field: string, message: string);
|
|
29
|
+
}
|
|
30
|
+
export declare class SkillOversizeError extends Error {
|
|
31
|
+
readonly maxBytes: number;
|
|
32
|
+
readonly actualBytes: number;
|
|
33
|
+
constructor(pathLike: string, maxBytes: number, actualBytes: number);
|
|
34
|
+
}
|
|
35
|
+
export declare function listBundledSkills(): SkillManifest[];
|
|
36
|
+
export declare function loadBundledSkill(id: string): SkillBundle;
|
|
37
|
+
export declare function readBundledSkillResource(id: string, resourcePath: string): string;
|
|
38
|
+
export declare function validateSkillBundle(pathLike: string): {
|
|
39
|
+
valid: boolean;
|
|
40
|
+
errors: SkillValidationError[];
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/public/skills.ts"],"names":[],"mappings":"AA0BA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAErD;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,EAAE,EAAE,MAAM;CAIvB;AAED,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAI7C;AAED,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAI7C;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAEX,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK3C;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;CAMpE;AAED,wBAAgB,iBAAiB,IAAI,aAAa,EAAE,CAWnD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,CAOxD;AAED,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,MAAM,GACnB,MAAM,CA4BR;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GACf;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,oBAAoB,EAAE,CAAA;CAAE,CAiBpD"}
|