kibi-cursor 0.2.2 → 0.5.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/.cursor-plugin/plugin.json +1 -1
- package/CHANGELOG.md +71 -0
- package/README.md +7 -5
- package/dist/.cursor-plugin/plugin.json +1 -1
- package/dist/guidance.d.ts +10 -2
- package/dist/guidance.js +27 -17
- package/dist/hook-runner.d.ts +1 -0
- package/dist/hook-runner.js +41 -11
- package/dist/hook-state-storage.d.ts +11 -0
- package/dist/hook-state-storage.js +187 -0
- package/dist/hook-state.d.ts +9 -5
- package/dist/hook-state.js +14 -196
- package/dist/kb-mcp-tools.d.ts +9 -0
- package/dist/kb-mcp-tools.js +94 -0
- package/dist/messages.d.ts +4 -2
- package/dist/messages.js +33 -3
- package/dist/path-policy.d.ts +1 -0
- package/dist/path-policy.js +18 -0
- package/dist/rules/kibi-traceability.mdc +2 -0
- package/dist/rules/kibi-workflow.mdc +3 -3
- package/dist/skills/.canon-hash.json +10 -0
- package/dist/skills/init-kibi/SKILL.md +50 -11
- package/dist/skills/kibi-freshness/SKILL.md +32 -10
- package/dist/skills/kibi-traceability/SKILL.md +41 -9
- package/dist/skills/kibi-usage/SKILL.md +123 -95
- package/dist/skills/kibi-usage/resources/fact-lanes.md +225 -0
- package/dist/skills/kibi-usage/resources/operation-access.md +44 -0
- package/dist/skills/kibi-usage/resources/relationship-directions.md +119 -0
- package/dist/skills/kibi-usage/resources/workflows.md +65 -0
- package/package.json +2 -2
- package/rules/kibi-traceability.mdc +2 -0
- package/rules/kibi-workflow.mdc +3 -3
- package/skills/.canon-hash.json +10 -0
- package/skills/init-kibi/SKILL.md +50 -11
- package/skills/kibi-freshness/SKILL.md +32 -10
- package/skills/kibi-traceability/SKILL.md +41 -9
- package/skills/kibi-usage/SKILL.md +123 -95
- package/skills/kibi-usage/resources/fact-lanes.md +225 -0
- package/skills/kibi-usage/resources/operation-access.md +44 -0
- package/skills/kibi-usage/resources/relationship-directions.md +119 -0
- package/skills/kibi-usage/resources/workflows.md +65 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Kibi Operation Access Catalog
|
|
2
|
+
|
|
3
|
+
This table is the machine-readable interface map for Kibi's shared operation catalog. Every CLI route shown is dedicated; there is no generic operation runner. `--input JSON or flags` means the route supports exact MCP-shaped JSON from a file or stdin as well as its established human flags. `--input JSON` means the dedicated parity route is JSON-only.
|
|
4
|
+
|
|
5
|
+
| MCP tool name | CLI route | Input mode | Mutability | Requires Prolog | Effects | Capability preference |
|
|
6
|
+
|---|---|---|---|---|---|---|
|
|
7
|
+
| `kb_skills_list` | `skills-list` | `--input JSON` | read | no | `local-read` | MCP-first; CLI-fallback |
|
|
8
|
+
| `kb_skills_load` | `skills-load` | `--input JSON` | read | no | `local-read` | MCP-first; CLI-fallback |
|
|
9
|
+
| `kb_skills_read` | `skills-read` | `--input JSON` | read | no | `local-read` | MCP-first; CLI-fallback |
|
|
10
|
+
| `kb_query` | `query` | `--input JSON or flags` | read | yes | `kb-read` | MCP-first; CLI-fallback |
|
|
11
|
+
| `kb_search` | `search` | `--input JSON or flags` | read | yes | `kb-read` | MCP-first; CLI-fallback |
|
|
12
|
+
| `kb_status` | `status` | `--input JSON or flags` | read | yes | `kb-read, workspace-read` | MCP-first; CLI-fallback |
|
|
13
|
+
| `kb_find_gaps` | `find-gaps` | `--input JSON or flags` | read | yes | `kb-read` | MCP-first; CLI-fallback |
|
|
14
|
+
| `kb_coverage` | `coverage` | `--input JSON or flags` | read | yes | `kb-read` | MCP-first; CLI-fallback |
|
|
15
|
+
| `kb_graph` | `graph` | `--input JSON or flags` | read | yes | `kb-read` | MCP-first; CLI-fallback |
|
|
16
|
+
| `kb_semantic_advisor` | `semantic-advisor` | `--input JSON` | read | no | `local-read` | MCP-first; CLI-fallback |
|
|
17
|
+
| `kb_model_requirement` | `model-requirement` | `--input JSON` | read | yes | `kb-read` | MCP-first; CLI-fallback |
|
|
18
|
+
| `kb_suggest_predicates` | `suggest-predicates` | `--input JSON` | read | yes | `kb-read` | MCP-first; CLI-fallback |
|
|
19
|
+
| `kb_autopilot_generate` | `autopilot-generate` | `--input JSON` | read | no | `workspace-read` | MCP-first; CLI-fallback |
|
|
20
|
+
| `kb_validate_upsert` | `validate-upsert` | `--input JSON` | read | yes | `kb-read` | MCP-first; CLI-fallback |
|
|
21
|
+
| `kb_upsert` | `upsert` | `--input JSON` | write | yes | `kb-write, workspace-write` | MCP-first; CLI-fallback |
|
|
22
|
+
| `kb_delete` | `delete` | `--input JSON` | write | yes | `kb-write, workspace-write` | MCP-first; CLI-fallback |
|
|
23
|
+
| `kb_check` | `check` | `--input JSON or flags` | read | yes | `kb-read, workspace-read` | MCP-first; CLI-fallback |
|
|
24
|
+
| `kb_sparql_remote` | `sparql-remote` | `--input JSON` | read | no | `network-read` | MCP-first; CLI-fallback |
|
|
25
|
+
|
|
26
|
+
## JSON execution recipes
|
|
27
|
+
|
|
28
|
+
Use the project-local, non-installing runner from a trusted workspace. Stdin must contain exactly one UTF-8 JSON object.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
echo '{"query":"authentication","type":"req","limit":10}' | npx --no-install kibi search --input -
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
echo '{"type":"req","id":"REQ-001","properties":{"title":"Test","status":"open"}}' | npx --no-install kibi upsert --input -
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
echo '{"rules":["required-fields","no-dangling-refs"]}' | bunx --no-install kibi check --input -
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Telemetry handling
|
|
43
|
+
|
|
44
|
+
`_diagnostic_telemetry` is adapter metadata, not business input. In CLI JSON mode the adapter may validate and extract it for CLI usage logging before shared execution. In MCP diagnostic mode the adapter enforces its configured telemetry requirement and strips the field before shared execution. Never copy telemetry into entity properties or operation business input.
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
```
|
|
90
|
+
|
|
91
|
+
## Invalid Test-Fact Shortcuts
|
|
92
|
+
|
|
93
|
+
Do not model small behavior fixes as direct test-fact pairs. Facts describe invariants; requirements or scenarios are verified by tests.
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
# WRONG: fact -> test is not a valid verified_by shape
|
|
97
|
+
relationships:
|
|
98
|
+
- type: verified_by
|
|
99
|
+
from: FACT-HEADER-AVATAR-INITIAL-UPPERCASE
|
|
100
|
+
to: TEST-AVATAR-HEADER-FALLBACK
|
|
101
|
+
|
|
102
|
+
# WRONG: test -> fact is not a valid validates shape
|
|
103
|
+
relationships:
|
|
104
|
+
- type: validates
|
|
105
|
+
from: TEST-AVATAR-HEADER-FALLBACK
|
|
106
|
+
to: FACT-HEADER-AVATAR-INITIAL-UPPERCASE
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Use a requirement as the verification target/source, then link that requirement to strict facts:
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
relationships:
|
|
113
|
+
- type: verified_by
|
|
114
|
+
from: REQ-HEADER-AVATAR-INITIAL-UPPERCASE
|
|
115
|
+
to: TEST-AVATAR-HEADER-FALLBACK
|
|
116
|
+
- type: requires_property
|
|
117
|
+
from: REQ-HEADER-AVATAR-INITIAL-UPPERCASE
|
|
118
|
+
to: FACT-HEADER-AVATAR-INITIAL-UPPERCASE
|
|
119
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
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. **Decompose**: `kb_semantic_advisor` on the complete normative prose; verify or supply every atomic clause
|
|
11
|
+
5. **Choose per-clause lanes**: `kb_suggest_predicates` for relational clauses; `kb_model_requirement` for strict scalar clauses; observation review for ambiguity, false positives, and ontology gaps
|
|
12
|
+
6. **Preflight**: `kb_validate_upsert` for every intended entity or relationship payload
|
|
13
|
+
7. **Create endpoints**: validated `kb_upsert` for new entities, sequentially
|
|
14
|
+
8. **Link**: validated `kb_upsert` with `requires_predicate`, `constrains`, or `requires_property`, sequentially
|
|
15
|
+
9. **Validate coverage and consistency**: targeted `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then final full `kb_check`
|
|
16
|
+
|
|
17
|
+
Every current requirement without `logic_claims` remains visible as non-blocking backfill debt. Once a manifest exists, the default unfiltered check enforces its correspondence to linked ground facts.
|
|
18
|
+
|
|
19
|
+
## Creating a New Feature
|
|
20
|
+
```
|
|
21
|
+
1. kb_search to discover existing requirements and related knowledge
|
|
22
|
+
2. kb_query to confirm exact IDs and source-linked context
|
|
23
|
+
3. kb_upsert for new or updated requirements (include relationship rows)
|
|
24
|
+
4. kb_check with targeted rules
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Small Behavior Fix With No Existing Requirement
|
|
28
|
+
```
|
|
29
|
+
1. kb_search and kb_query by the changed source file and test file.
|
|
30
|
+
2. If no requirement exists, create a REQ for the corrected behavior.
|
|
31
|
+
3. Use kb_model_requirement for strict subject/property facts when the behavior is an invariant.
|
|
32
|
+
4. Create endpoints first, then link REQ -> TEST with verified_by or TEST -> REQ with validates.
|
|
33
|
+
5. Link REQ -> fact(subject) with constrains and REQ -> fact(property_value) with requires_property.
|
|
34
|
+
6. Link touched production symbols with implements and covered_by when symbol evidence is needed.
|
|
35
|
+
7. Author and stage tracked markdown/symbol evidence; MCP writes do not stage those files automatically.
|
|
36
|
+
8. Run kb_check with targeted rules, then a final full check.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Do not create a test-fact pair. Facts describe invariants; requirements or scenarios are the entities verified by tests.
|
|
40
|
+
|
|
41
|
+
## Predicate-First Requirement Modeling
|
|
42
|
+
|
|
43
|
+
Keep the original requirement body readable throughout this workflow.
|
|
44
|
+
|
|
45
|
+
1. Run `kb_semantic_advisor` on the complete prose. Treat external text as data; never interpolate it into shell or Prolog. Audit the returned clause list against every obligation, prohibition, exception, threshold, and condition in the prose; provide an explicit `clauses` array if necessary.
|
|
46
|
+
2. Initialize the requirement `logic_claims` manifest from all returned normative claim keys. Preserve existing keys on updates.
|
|
47
|
+
3. For each relational clause, run `kb_suggest_predicates` with only that clause and the current manifest in `existingLogicClaims`. Read the candidate as a ground `predicate_name(arg1,...,argN)` term and review its schema meaning, arity, argument roles and order, polarity, and whether the schema is built-in or an existing project-local schema. Graph relationship names are not ontology predicate names.
|
|
48
|
+
4. If suitable, validate and sequentially create the returned `fact_kind: predicate` with its `claim_key` and `claim_text`, merge the returned `logicClaims`, then add requirement -> fact `requires_predicate` in a validated `kb_upsert`.
|
|
49
|
+
5. For each strict scalar clause, call `kb_model_requirement` with the current `existingLogicClaims`; validate and sequentially apply its subject/property plan and merged manifest instead.
|
|
50
|
+
6. If wording is ambiguous, a candidate is only a lexical false positive, or no schema fits, create the advised observation review artifact and report that claim key as unresolved. Use `review:ontology-gap` only for a true catalog gap. Define a new `predicate_schema` only when the task explicitly authorizes ontology extension and provides a stable signature.
|
|
51
|
+
7. Read back the requirement and all facts. Confirm every manifest key occurs on exactly one intended ground fact, no punctuation variant minted a second claim, and no two claim keys encode the same logical term. Exact query output may represent repeated relationship types as arrays, so inspect every target. Then run `kb_check` with `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`. Finish with an unfiltered `kb_check`.
|
|
52
|
+
|
|
53
|
+
Do not treat the manifest itself as proof of grounding. The advisor keeps readiness partial while there are fewer logical edge slots than normative claims; final readback and `logic-coverage` bind those slots to exact claim keys and ground terms.
|
|
54
|
+
|
|
55
|
+
Examples: built-in permission and deny claims use the suggested `permission_rule`; a project-local `commit_action` is valid only after its schema exists; session timeout is strict scalar; “better support” is ambiguous; `publishes_event` for publishing an article is a false positive; annotation anchoring without a fitting schema is an ontology gap. The authoritative payloads are in `resources/fact-lanes.md`.
|
|
56
|
+
|
|
57
|
+
On resume after interruption, repeat `kb_query` for exact endpoints and apply only missing validated writes. Keep `kb_upsert` concurrency at one.
|
|
58
|
+
|
|
59
|
+
## Fixing a Traceability Gap
|
|
60
|
+
```
|
|
61
|
+
1. kb_query --sourceFile <code-file> to find linked entities
|
|
62
|
+
2. kb_find_gaps --type req --missing-rel specified_by to find orphan requirements
|
|
63
|
+
3. kb_upsert to add missing relationship rows (sequential)
|
|
64
|
+
4. kb_check with rules: ["no-dangling-refs", "symbol-traceability"]
|
|
65
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-cursor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Kibi Cursor plugin - thin adapter for Cursor MCP integration and editor hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "tsc -p tsconfig.json && bun run scripts/copy-plugin-assets.ts",
|
|
37
|
+
"build": "tsc -p tsconfig.json && bun run scripts/copy-plugin-assets.ts && bun run ../../scripts/sync-agent-skills.ts --write --target cursor",
|
|
38
38
|
"dev": "tsc -p tsconfig.json --watch",
|
|
39
39
|
"clean": "rm -rf dist",
|
|
40
40
|
"prepack": "npm run build"
|
|
@@ -7,6 +7,8 @@ alwaysApply: false
|
|
|
7
7
|
|
|
8
8
|
Before changing production code, discover linked requirements with `kb_search` and `kb_query(sourceFile=...)`.
|
|
9
9
|
|
|
10
|
+
After meaningful source edits, run `kb_check({sourceFiles:[...], includeImpactDiagnostics:true, includeWorkingTreeDiff:true})` while the edit context is fresh. Review symbol granularity and whether linked requirements, scenarios, and tests still cover the changed behavior or UI copy.
|
|
11
|
+
|
|
10
12
|
Preserve the canonical chain `REQ-* -> SCEN-* -> TEST-*` when modeling behavior.
|
|
11
13
|
|
|
12
14
|
Prefer symbol manifest + `executable_for` for test/e2e code. Inline `// implements REQ-xxx` remains acceptable for quick code-only changes.
|
package/rules/kibi-workflow.mdc
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Kibi
|
|
2
|
+
description: Kibi capability-based discovery-first workflow and KB mutation discipline
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Use Kibi via MCP tools
|
|
6
|
+
Use Kibi via MCP tools when available, or via CLI JSON routes when MCP is unavailable. If MCP tools are visible, use MCP. If MCP availability is unknown and a trusted project-local CLI is available, use `kibi <route> --input <file|->`. If neither interface is available, stop and tell the operator. Do not infer MCP availability from config file existence. Do not read or edit `.kb/` files directly.
|
|
7
7
|
|
|
8
8
|
Discovery workflow:
|
|
9
9
|
- Start with `kb_search` for broad discovery.
|
|
@@ -13,7 +13,7 @@ Discovery workflow:
|
|
|
13
13
|
Mutation workflow:
|
|
14
14
|
- Query before mutate.
|
|
15
15
|
- Create relationship endpoints before linking.
|
|
16
|
-
- Use `kb_upsert` sequentially
|
|
16
|
+
- Use `kb_upsert` sequentially. Run `kb_check` before completion.
|
|
17
17
|
- Use `kb_delete` only for intentional removals with dependency awareness.
|
|
18
18
|
|
|
19
19
|
Completion must state KB freshness outcome: updated, no-impact with rationale, or deferred/failed.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"init-kibi/SKILL.md": "4e936774cd31cf366e9e17452e9030fdaeabab345bce5ee163656e0fe5dc73d7",
|
|
3
|
+
"kibi-freshness/SKILL.md": "68345a514233503f8f78d53e7d602d8a5fc566e1ec118388c7393716c9f7490d",
|
|
4
|
+
"kibi-traceability/SKILL.md": "a621553397c1f8813f05fd9552fc30a5e8ed118442e019add35804de7d43a0b1",
|
|
5
|
+
"kibi-usage/SKILL.md": "f4a713d8c95d9c9a254e2f23b27013293f0caacb4009409409e56c7deeccc8a5",
|
|
6
|
+
"kibi-usage/resources/fact-lanes.md": "8b2f835775e57427db980c5412d6e58840a53e71e8e508ae39f14ebfa693e4b8",
|
|
7
|
+
"kibi-usage/resources/operation-access.md": "d8653b544305d4c00734c737b1156110208a9a82fbec6b04726d25b973f2b840",
|
|
8
|
+
"kibi-usage/resources/relationship-directions.md": "aecbde048bb84e210318e4aca98e07f8370168c640c3a9d65696d2195c8598ec",
|
|
9
|
+
"kibi-usage/resources/workflows.md": "36e50fe83fc7ac6bc68fcf51d2c2175e09c68815b6bbebed8cfa1d5611617913"
|
|
10
|
+
}
|
|
@@ -1,23 +1,62 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: init-kibi
|
|
2
3
|
name: init-kibi
|
|
3
4
|
description: Bootstrap and model knowledge safely using approved Kibi MCP initialization and mutation workflow.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
kibiCompatibility: "*"
|
|
7
|
+
tags:
|
|
8
|
+
- kibi
|
|
9
|
+
- mcp
|
|
10
|
+
- bootstrap
|
|
11
|
+
- agent-guidance
|
|
4
12
|
---
|
|
5
|
-
|
|
6
13
|
## Goal
|
|
7
14
|
|
|
8
|
-
Set up or refresh Kibi knowledge for the current branch
|
|
15
|
+
Set up or refresh Kibi knowledge for the current branch through approved Kibi interfaces only. Maintain source-file traceability for every repository-backed claim, and require explicit operator approval before any mutation.
|
|
16
|
+
|
|
17
|
+
## Interface Selection
|
|
18
|
+
|
|
19
|
+
1. If approved Kibi MCP tools are visible, use the MCP route.
|
|
20
|
+
2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback: `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
|
|
21
|
+
3. If neither approved MCP tools nor the project-local CLI are available, stop and tell the operator to enable or install Kibi for this workspace.
|
|
22
|
+
4. Never use a global fallback, an installing runner, or any route outside the approved Kibi interface.
|
|
23
|
+
|
|
24
|
+
Use `kibi-usage/resources/operation-access.md` for the exact operation-to-route mapping. The CLI preview route accepts the same JSON object as `kb_autopilot_generate`:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
echo '{"maxCandidates":25,"minConfidence":0.8}' | npx --no-install kibi autopilot-generate --input -
|
|
28
|
+
```
|
|
9
29
|
|
|
10
|
-
##
|
|
30
|
+
## Capability Workflow
|
|
11
31
|
|
|
12
|
-
-
|
|
13
|
-
- Show the generated preview and
|
|
14
|
-
-
|
|
15
|
-
- If cleanup is needed, use `kb_delete` only after checking dependencies.
|
|
16
|
-
- Finish with `kb_check` to validate the branch snapshot.
|
|
32
|
+
- Generate a read-only bootstrap preview with `kb_autopilot_generate`, or the dedicated CLI route `autopilot-generate --input`.
|
|
33
|
+
- Show the generated preview and obtain explicit approval before writes.
|
|
34
|
+
- Apply reviewed entity creation or updates with `kb_upsert`, or `upsert --input`.
|
|
35
|
+
- If cleanup is needed, use `kb_delete`, or `delete --input`, only after checking dependencies and obtaining approval for the specific removal.
|
|
36
|
+
- Finish with `kb_check`, or `check --input`, to validate the branch snapshot.
|
|
17
37
|
|
|
18
38
|
## Guidance
|
|
19
39
|
|
|
20
|
-
- Keep mutation requests explicit and
|
|
21
|
-
-
|
|
22
|
-
-
|
|
40
|
+
- Keep mutation requests explicit, small, and sequential.
|
|
41
|
+
- Prefer source-linked entities so future `kb_query` lookups can verify repository context against source files.
|
|
42
|
+
- Preserve traceability by linking facts, claims, scenarios, and tests to concrete project files whenever repository evidence supports it.
|
|
43
|
+
- Do not read or edit files inside `.kb` directly; all changes go through the selected Kibi interface.
|
|
23
44
|
- Ask at most four bounded context questions, and only when repository evidence is insufficient.
|
|
45
|
+
- Stop at the documented operator repair boundary if the setup appears partial, inconsistent, or unsupported by the approved interface.
|
|
46
|
+
|
|
47
|
+
## Public Training Trajectories
|
|
48
|
+
|
|
49
|
+
- `init-kibi-bootstrap-analysis-train-1`: Analyze the cold-start repository and produce a read-only bootstrap preview using only the public Kibi MCP surface.
|
|
50
|
+
- `init-kibi-bootstrap-analysis-train-2`: Analyze the cold-start repository and produce a read-only bootstrap preview using only the public Kibi MCP surface.
|
|
51
|
+
- `init-kibi-bounded-context-questions-train-1`: Ask only the bounded context questions needed before bootstrap synthesis using only the public Kibi MCP surface.
|
|
52
|
+
- `init-kibi-bounded-context-questions-train-2`: Ask only the bounded context questions needed before bootstrap synthesis using only the public Kibi MCP surface.
|
|
53
|
+
- `init-kibi-approval-sequential-writes-train-1`: Apply the approved bootstrap plan sequentially and finish with validation using only the public Kibi MCP surface.
|
|
54
|
+
- `init-kibi-approval-sequential-writes-train-2`: Apply the approved bootstrap plan sequentially and finish with validation using only the public Kibi MCP surface.
|
|
55
|
+
- `init-kibi-repair-escalation-train-1`: Identify the partial setup and stop at the documented operator repair boundary using only the public Kibi MCP surface.
|
|
56
|
+
- `init-kibi-repair-escalation-train-2`: Identify the partial setup and stop at the documented operator repair boundary using only the public Kibi MCP surface.
|
|
57
|
+
|
|
58
|
+
## Training Data
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
[{"taskId":"init-kibi-bootstrap-analysis-train-1","family":"bootstrap-analysis","reflection":"Analyze the cold-start repository and produce a read-only bootstrap preview. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bootstrap-analysis-train-2","family":"bootstrap-analysis","reflection":"Analyze the cold-start repository and produce a read-only bootstrap preview. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bounded-context-questions-train-1","family":"bounded-context-questions","reflection":"Ask only the bounded context questions needed before bootstrap synthesis. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bounded-context-questions-train-2","family":"bounded-context-questions","reflection":"Ask only the bounded context questions needed before bootstrap synthesis. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-approval-sequential-writes-train-1","family":"approval-sequential-writes","reflection":"Apply the approved bootstrap plan sequentially and finish with validation. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-approval-sequential-writes-train-2","family":"approval-sequential-writes","reflection":"Apply the approved bootstrap plan sequentially and finish with validation. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-repair-escalation-train-1","family":"repair-escalation","reflection":"Identify the partial setup and stop at the documented operator repair boundary. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-repair-escalation-train-2","family":"repair-escalation","reflection":"Identify the partial setup and stop at the documented operator repair boundary. This is train case 2; use only the public Kibi MCP surface."}]
|
|
62
|
+
```
|
|
@@ -1,22 +1,44 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: kibi-freshness
|
|
2
3
|
name: kibi-freshness
|
|
3
4
|
description: Check branch freshness and source linkage quality before decisions or risky writes.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
kibiCompatibility: "*"
|
|
7
|
+
tags:
|
|
8
|
+
- kibi
|
|
9
|
+
- mcp
|
|
10
|
+
- freshness
|
|
11
|
+
- agent-guidance
|
|
4
12
|
---
|
|
5
|
-
|
|
6
13
|
## Goal
|
|
7
14
|
|
|
8
|
-
Help agents decide whether
|
|
15
|
+
Help agents decide whether Kibi knowledge is current enough to support safe changes while preserving source-file traceability and approved interface boundaries.
|
|
16
|
+
|
|
17
|
+
## Interface Selection
|
|
18
|
+
|
|
19
|
+
1. If Kibi MCP tools are visible and approved for the workspace, use the MCP surface only.
|
|
20
|
+
2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback through `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
|
|
21
|
+
3. If the project-local CLI is unavailable or too old, stop and tell the operator to enable or install Kibi.
|
|
22
|
+
4. Never use a global fallback or an installing runner.
|
|
23
|
+
|
|
24
|
+
Use `kibi-usage/resources/operation-access.md` for exact dedicated routes. A project-local CLI freshness check is executable as:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
echo '{}' | npx --no-install kibi status --input -
|
|
28
|
+
```
|
|
9
29
|
|
|
10
|
-
##
|
|
30
|
+
## Capability Workflow
|
|
11
31
|
|
|
12
|
-
- Use `kb_status` first to confirm branch attachment and
|
|
13
|
-
- Use `kb_query` with `sourceFile
|
|
14
|
-
- Re-run `kb_search` after sync gaps are detected.
|
|
15
|
-
- If knowledge must change,
|
|
32
|
+
- Use `kb_status`, or `status --input`, first to confirm branch attachment, freshness state, dirty-worktree evidence, and whether the knowledge snapshot is safe to rely on.
|
|
33
|
+
- Use `kb_query`, or `query --input`, with `sourceFile` and text references for source-linked discovery.
|
|
34
|
+
- Re-run `kb_search`, or `search --input`, after sync gaps or stale context are detected.
|
|
35
|
+
- If knowledge must change, use the selected interface's `kb_upsert`/`upsert` or `kb_delete`/`delete` operation sequentially, then finish with `kb_check`/`check`.
|
|
16
36
|
|
|
17
37
|
## Guidance
|
|
18
38
|
|
|
39
|
+
- Prefer the public Kibi MCP surface whenever it is available and approved.
|
|
19
40
|
- Never proceed with broad changes when freshness is stale and unresolved.
|
|
20
|
-
- If entities look stale,
|
|
21
|
-
-
|
|
22
|
-
-
|
|
41
|
+
- If entities look stale, refresh context through an approved Kibi capability and then re-query.
|
|
42
|
+
- Preserve source-file traceability by carrying `sourceFile`, text references, and validation evidence through discovery, mutation, and completion.
|
|
43
|
+
- Do not read or edit files inside `.kb` directly; use the selected Kibi interface instead.
|
|
44
|
+
- Completion must state one freshness outcome: KB updated, no KB impact with rationale, or deferred/failed.
|
|
@@ -1,22 +1,54 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: kibi-traceability
|
|
2
3
|
name: kibi-traceability
|
|
3
4
|
description: Maintain requirement, scenario, and test traceability through Kibi MCP tools.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
kibiCompatibility: "*"
|
|
7
|
+
tags:
|
|
8
|
+
- kibi
|
|
9
|
+
- mcp
|
|
10
|
+
- traceability
|
|
11
|
+
- agent-guidance
|
|
4
12
|
---
|
|
5
|
-
|
|
6
13
|
## Goal
|
|
7
14
|
|
|
8
|
-
Validate and strengthen traceability before and after code changes.
|
|
15
|
+
Validate and strengthen requirement, scenario, test, behavioral-symbol, and source-file traceability before and after code changes.
|
|
16
|
+
|
|
17
|
+
## Interface Selection
|
|
18
|
+
|
|
19
|
+
1. If Kibi MCP tools are visible and approved, use the MCP surface as the primary authority.
|
|
20
|
+
2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback through `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
|
|
21
|
+
3. If neither approved MCP tools nor the project-local CLI are available, or if the CLI is unavailable or too old, stop and tell the operator to enable or install Kibi.
|
|
22
|
+
4. Never use a global fallback or an installing runner.
|
|
23
|
+
|
|
24
|
+
Use MCP routes for modeling, querying, checking, validation, and cleanup. Use the project-local CLI only as the fallback interface, passing JSON input through stdin. Example:
|
|
9
25
|
|
|
10
|
-
|
|
26
|
+
```bash
|
|
27
|
+
echo '{"sourceFiles":["src/auth/login.ts"],"includeImpactDiagnostics":true,"includeWorkingTreeDiff":true}' | npx --no-install kibi check --input -
|
|
28
|
+
```
|
|
11
29
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
30
|
+
## Capability Workflow
|
|
31
|
+
|
|
32
|
+
- Locate requirements through `kb_search` or `search --input`, then inspect exact records through `kb_query` or `query --input`.
|
|
33
|
+
- Before meaningful edits, identify linked requirements, scenarios, tests, facts, source files, and behavioral symbols relevant to the planned change.
|
|
34
|
+
- After meaningful source edits, run `kb_check({sourceFiles:[...], includeImpactDiagnostics:true, includeWorkingTreeDiff:true})` or the equivalent `check --input` JSON recipe before deciding whether traceability is current.
|
|
35
|
+
- Apply traceability updates sequentially through `kb_upsert` or `upsert --input` for requirements, scenarios, tests, facts, behavioral symbols, and source-linked relationships.
|
|
36
|
+
- Validate constraints and consistency through `kb_check` or `check --input` after updates.
|
|
37
|
+
- Use `kb_delete` or `delete --input` only for explicit cleanup of obsolete records or relationships.
|
|
15
38
|
|
|
16
39
|
## Guidance
|
|
17
40
|
|
|
18
|
-
- Prefer source-linked relationships so symbols and files can be traced
|
|
19
|
-
-
|
|
20
|
-
- Never directly edit `.kb/**`; all modeling and cleanup goes through MCP tools.
|
|
41
|
+
- Prefer source-linked relationships so requirements, scenarios, tests, symbols, and files can be traced cleanly.
|
|
42
|
+
- Preserve source-file traceability whenever adding or changing requirements, scenarios, tests, facts, behavioral symbols, or implementation links.
|
|
21
43
|
- Preserve the canonical chain `REQ-* -> SCEN-* -> TEST-*` when adding or changing requirements.
|
|
22
44
|
- Production symbols should implement requirements; test symbols should remain executable evidence for tests.
|
|
45
|
+
- Resolve impact at behavioral-symbol granularity when Kibi reports symbol-level diagnostics; avoid treating a whole file as impacted when the report identifies narrower linked behavior.
|
|
46
|
+
- Treat `symbol_semantic_review_needed` as a prompt to inspect linked requirements and tests; Kibi reports graph links but does not prove prose semantics.
|
|
47
|
+
- Do not read or edit files inside `.kb` directly; all modeling and cleanup goes through the selected Kibi interface.
|
|
48
|
+
- Keep approval boundaries intact: only use Kibi MCP tools that are visible and approved, and only use the project-local CLI fallback in a trusted workspace.
|
|
49
|
+
|
|
50
|
+
Public training trajectories:
|
|
51
|
+
[{"taskId":"kibi-traceability-requirement-discovery-train-1","family":"requirement-discovery","reflection":"Discover the requirement linked to the supplied source symbol. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-requirement-discovery-train-2","family":"requirement-discovery","reflection":"Discover the requirement linked to the supplied source symbol. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-symbol-impact-granularity-train-1","family":"symbol-impact-granularity","reflection":"Resolve impact at behavioral symbol granularity rather than file granularity. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-symbol-impact-granularity-train-2","family":"symbol-impact-granularity","reflection":"Resolve impact at behavioral symbol granularity rather than file granularity. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-relationship-chain-train-1","family":"relationship-chain","reflection":"Trace the requirement, scenario, and test relationship chain. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-relationship-chain-train-2","family":"relationship-chain","reflection":"Trace the requirement, scenario, and test relationship chain. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-executable-coverage-train-1","family":"executable-coverage","reflection":"Establish executable test identity and behavioral coverage links. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-executable-coverage-train-2","family":"executable-coverage","reflection":"Establish executable test identity and behavioral coverage links. This is train case 2; use only the public Kibi MCP surface."}]
|
|
52
|
+
|
|
53
|
+
Previous development gate:
|
|
54
|
+
{"mean":0,"hardPasses":0,"worstFamilyMean":0}
|