@entelligentsia/forgecli 0.7.10 → 0.8.4
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/CHANGELOG.md +74 -0
- package/dist/CHANGELOG-forge-plugin.md +70 -0
- package/dist/CHANGELOG-pi.md +63 -0
- package/dist/bin/argv.d.ts +2 -2
- package/dist/bin/argv.js +10 -0
- package/dist/bin/argv.js.map +1 -1
- package/dist/bin/env-defaults.d.ts +1 -0
- package/dist/bin/env-defaults.js +13 -0
- package/dist/bin/env-defaults.js.map +1 -0
- package/dist/bin/forge.js +9 -0
- package/dist/bin/forge.js.map +1 -1
- package/dist/bin/update-cli.d.ts +9 -0
- package/dist/bin/update-cli.js +120 -0
- package/dist/bin/update-cli.js.map +1 -0
- package/dist/extensions/forgecli/index.js +3 -3
- package/dist/extensions/forgecli/index.js.map +1 -1
- package/dist/extensions/forgecli/update-check.js +1 -1
- package/dist/extensions/forgecli/update-check.js.map +1 -1
- package/dist/extensions/forgecli/whats-new-widget.d.ts +5 -5
- package/dist/extensions/forgecli/whats-new-widget.js +11 -11
- package/dist/extensions/forgecli/whats-new-widget.js.map +1 -1
- package/dist/extensions/forgecli/whats-new.js +6 -5
- package/dist/extensions/forgecli/whats-new.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +27 -98
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +62 -132
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +25 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +8 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +63 -0
- package/node_modules/@earendil-works/pi-coding-agent/README.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js +6 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +12 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +30 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +23 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +58 -38
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +3 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.d.ts +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js +60 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +1 -3
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/index.d.ts +7 -7
- package/node_modules/@protobufjs/fetch/index.js +4 -7
- package/node_modules/@protobufjs/fetch/package.json +7 -5
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +150 -8
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/index.d.ts +1 -0
- package/node_modules/@protobufjs/inquire/index.js +1 -0
- package/node_modules/@protobufjs/inquire/package.json +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +187 -153
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +14 -5
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +207 -173
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +6 -3
- package/node_modules/protobufjs/src/util/fs.js +11 -0
- package/node_modules/protobufjs/src/util/minimal.js +10 -2
- package/node_modules/protobufjs/src/util.js +1 -1
- package/node_modules/undici/README.md +14 -5
- package/node_modules/undici/docs/docs/api/Client.md +4 -2
- package/node_modules/undici/docs/docs/api/Dispatcher.md +62 -27
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +7 -5
- package/node_modules/undici/docs/docs/api/H2CClient.md +1 -1
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +14 -9
- package/node_modules/undici/docs/docs/api/RetryAgent.md +0 -1
- package/node_modules/undici/docs/docs/api/RetryHandler.md +12 -14
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +23 -0
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +231 -0
- package/node_modules/undici/index.js +4 -2
- package/node_modules/undici/lib/api/api-connect.js +13 -11
- package/node_modules/undici/lib/api/api-pipeline.js +26 -13
- package/node_modules/undici/lib/api/api-request.js +45 -21
- package/node_modules/undici/lib/api/api-stream.js +81 -20
- package/node_modules/undici/lib/api/api-upgrade.js +21 -11
- package/node_modules/undici/lib/api/readable.js +3 -2
- package/node_modules/undici/lib/cache/memory-cache-store.js +1 -1
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +6 -4
- package/node_modules/undici/lib/core/connect.js +17 -1
- package/node_modules/undici/lib/core/constants.js +1 -24
- package/node_modules/undici/lib/core/errors.js +2 -2
- package/node_modules/undici/lib/core/request.js +115 -18
- package/node_modules/undici/lib/core/socks5-client.js +24 -9
- package/node_modules/undici/lib/core/socks5-utils.js +32 -23
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/core/util.js +70 -43
- package/node_modules/undici/lib/dispatcher/agent.js +47 -33
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +21 -26
- package/node_modules/undici/lib/dispatcher/client-h1.js +98 -39
- package/node_modules/undici/lib/dispatcher/client-h2.js +603 -272
- package/node_modules/undici/lib/dispatcher/client.js +12 -5
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +24 -5
- package/node_modules/undici/lib/dispatcher/dispatcher.js +0 -4
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +107 -0
- package/node_modules/undici/lib/dispatcher/h2c-client.js +5 -5
- package/node_modules/undici/lib/dispatcher/pool-base.js +28 -10
- package/node_modules/undici/lib/dispatcher/pool.js +31 -6
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +38 -13
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +31 -9
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +95 -80
- package/node_modules/undici/lib/global.js +13 -1
- package/node_modules/undici/lib/handler/cache-handler.js +16 -8
- package/node_modules/undici/lib/handler/decorator-handler.js +1 -2
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -51
- package/node_modules/undici/lib/handler/retry-handler.js +15 -2
- package/node_modules/undici/lib/interceptor/cache.js +30 -17
- package/node_modules/undici/lib/interceptor/decompress.js +28 -2
- package/node_modules/undici/lib/interceptor/dns.js +1 -1
- package/node_modules/undici/lib/interceptor/redirect.js +3 -3
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +1 -1
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +1 -1
- package/node_modules/undici/lib/mock/mock-agent.js +8 -8
- package/node_modules/undici/lib/mock/mock-call-history.js +15 -15
- package/node_modules/undici/lib/mock/mock-utils.js +37 -22
- package/node_modules/undici/lib/mock/snapshot-agent.js +16 -6
- package/node_modules/undici/lib/mock/snapshot-recorder.js +38 -3
- package/node_modules/undici/lib/util/cache.js +8 -7
- package/node_modules/undici/lib/util/runtime-features.js +3 -34
- package/node_modules/undici/lib/web/cache/cache.js +6 -8
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/fetch/body.js +3 -9
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +17 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +21 -2
- package/node_modules/undici/lib/web/fetch/index.js +214 -221
- package/node_modules/undici/lib/web/webidl/index.js +7 -9
- package/node_modules/undici/lib/web/websocket/frame.js +1 -7
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +13 -31
- package/node_modules/undici/lib/web/websocket/receiver.js +62 -22
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +11 -17
- package/node_modules/undici/lib/web/websocket/websocket.js +6 -1
- package/node_modules/undici/package.json +9 -9
- package/node_modules/undici/types/agent.d.ts +0 -2
- package/node_modules/undici/types/client.d.ts +25 -19
- package/node_modules/undici/types/dispatcher.d.ts +7 -27
- package/node_modules/undici/types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici/types/formdata.d.ts +0 -6
- package/node_modules/undici/types/h2c-client.d.ts +6 -6
- package/node_modules/undici/types/header.d.ts +5 -0
- package/node_modules/undici/types/index.d.ts +3 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/pool.d.ts +0 -2
- package/node_modules/undici/types/proxy-agent.d.ts +2 -2
- package/node_modules/undici/types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici/types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici/types/webidl.d.ts +0 -1
- package/package.json +7 -8
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +0 -92
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +0 -31
- package/node_modules/undici/lib/handler/unwrap-handler.js +0 -100
- package/node_modules/undici/lib/handler/wrap-handler.js +0 -105
- package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/undici/lib/util/promise.js +0 -28
- package/skills/refresh-kb-links/SKILL.md +0 -217
- package/skills/store-custodian/SKILL.md +0 -163
- package/skills/store-query-grammar/SKILL.md +0 -145
- package/skills/store-query-nlp/SKILL.md +0 -110
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refresh-kb-links
|
|
3
|
-
description: Refresh Forge KB and workflow links in agent instruction files (CLAUDE.md, AGENTS.md, etc.)
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# forge:refresh-kb-links
|
|
7
|
-
|
|
8
|
-
Scan every coding-agent instruction file in the project and ensure each has
|
|
9
|
-
up-to-date links to the Forge knowledge base and generated workflow entry points.
|
|
10
|
-
This skill is invoked by `/forge:refresh-kb-links` or conversationally via `/forge:ask`.
|
|
11
|
-
|
|
12
|
-
## Setup
|
|
13
|
-
|
|
14
|
-
Read the Forge config to determine the KB root path:
|
|
15
|
-
|
|
16
|
-
```sh
|
|
17
|
-
KB_PATH: !`node -e "try{console.log(require('./.forge/config.json').paths.engineering)}catch{console.log('engineering')}"`
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Known Agent Instruction Files
|
|
21
|
-
|
|
22
|
-
Detect which of these files exist in the project root:
|
|
23
|
-
|
|
24
|
-
| File | Coding tool |
|
|
25
|
-
|------|------------|
|
|
26
|
-
| `CLAUDE.md` | Claude Code |
|
|
27
|
-
| `AGENTS.md` | OpenAI Codex / generic |
|
|
28
|
-
| `AGENT.md` | generic |
|
|
29
|
-
| `.github/copilot-instructions.md` | GitHub Copilot |
|
|
30
|
-
| `.cursorrules` | Cursor (legacy) |
|
|
31
|
-
| `.cursor/rules/*.mdc` | Cursor (current) |
|
|
32
|
-
| `GEMINI.md` | Google Gemini |
|
|
33
|
-
|
|
34
|
-
For each file found, check whether it already contains managed Forge sections.
|
|
35
|
-
|
|
36
|
-
## Managed Section Markers
|
|
37
|
-
|
|
38
|
-
Each file may have two independent managed sections:
|
|
39
|
-
|
|
40
|
-
### KB links section
|
|
41
|
-
|
|
42
|
-
Open marker (prefix match — tolerates minor text variations):
|
|
43
|
-
```
|
|
44
|
-
<!-- forge-kb-links
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Close marker (exact):
|
|
48
|
-
```
|
|
49
|
-
<!-- /forge-kb-links -->
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Workflow links section
|
|
53
|
-
|
|
54
|
-
Open marker (prefix match):
|
|
55
|
-
```
|
|
56
|
-
<!-- forge-workflow-links
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Close marker (exact):
|
|
60
|
-
```
|
|
61
|
-
<!-- /forge-workflow-links -->
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Content Rules
|
|
65
|
-
|
|
66
|
-
### KB section content
|
|
67
|
-
|
|
68
|
-
Only include rows for files that actually exist on disk:
|
|
69
|
-
|
|
70
|
-
- `{KB_PATH}/MASTER_INDEX.md` → "All sprints, tasks, bugs, and features"
|
|
71
|
-
- `{KB_PATH}/architecture/INDEX.md` → "Stack, processes, database, routing, deployment"
|
|
72
|
-
- `{KB_PATH}/business-domain/INDEX.md` → "Entity model and domain concepts"
|
|
73
|
-
|
|
74
|
-
```markdown
|
|
75
|
-
<!-- forge-kb-links: managed by Forge — do not edit manually -->
|
|
76
|
-
## Forge Knowledge Base
|
|
77
|
-
|
|
78
|
-
| Index | Contents |
|
|
79
|
-
|-------|----------|
|
|
80
|
-
| [MASTER_INDEX]({KB_PATH}/MASTER_INDEX.md) | All sprints, tasks, bugs, and features |
|
|
81
|
-
| [Architecture]({KB_PATH}/architecture/INDEX.md) | Stack, processes, database, routing, deployment |
|
|
82
|
-
| [Business Domain]({KB_PATH}/business-domain/INDEX.md) | Entity model and domain concepts |
|
|
83
|
-
|
|
84
|
-
Personas live in `.forge/personas/`.
|
|
85
|
-
<!-- /forge-kb-links -->
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Workflow section content
|
|
89
|
-
|
|
90
|
-
Only include rows for workflow files that actually exist on disk. Check each:
|
|
91
|
-
|
|
92
|
-
- `.forge/workflows/plan_task.md` → "Research codebase → implementation plan"
|
|
93
|
-
- `.forge/workflows/implement_plan.md` → "Execute approved plan → code changes"
|
|
94
|
-
- `.forge/workflows/fix_bug.md` → "Triage → fix → verify"
|
|
95
|
-
- `.forge/workflows/orchestrate_task.md` → "Full task pipeline (plan → implement → review → commit)"
|
|
96
|
-
- `.forge/workflows/run_sprint.md` → "Full sprint orchestration"
|
|
97
|
-
- `.forge/workflows/architect_sprint_plan.md` → "Sprint planning and task decomposition"
|
|
98
|
-
- `.forge/workflows/architect_sprint_intake.md` → "Sprint intake and requirements elicitation"
|
|
99
|
-
|
|
100
|
-
```markdown
|
|
101
|
-
<!-- forge-workflow-links: managed by Forge — do not edit manually -->
|
|
102
|
-
## Forge Workflows
|
|
103
|
-
|
|
104
|
-
| Workflow | Purpose |
|
|
105
|
-
|----------|---------|
|
|
106
|
-
| [Plan](.forge/workflows/plan_task.md) | Research codebase → implementation plan |
|
|
107
|
-
| [Implement](.forge/workflows/implement_plan.md) | Execute approved plan → code changes |
|
|
108
|
-
| [Fix bug](.forge/workflows/fix_bug.md) | Triage → fix → verify |
|
|
109
|
-
| [Run task](.forge/workflows/orchestrate_task.md) | Full task pipeline (plan → implement → review → commit) |
|
|
110
|
-
| [Run sprint](.forge/workflows/run_sprint.md) | Full sprint orchestration |
|
|
111
|
-
<!-- /forge-workflow-links -->
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
(Only include rows where the referenced `.forge/workflows/` file exists on disk.)
|
|
115
|
-
|
|
116
|
-
## KB Integrity Check
|
|
117
|
-
|
|
118
|
-
Before scanning agent instruction files, verify that the knowledge graph itself is complete.
|
|
119
|
-
The collate tool generates INDEX.md files at every node of the graph; if they are missing,
|
|
120
|
-
links in MASTER_INDEX.md are broken and agents navigate to dead ends.
|
|
121
|
-
|
|
122
|
-
Check the following, using `KB_PATH` as the root:
|
|
123
|
-
|
|
124
|
-
1. **Sprint INDEX files** — for every directory under `{KB_PATH}/sprints/`, check that
|
|
125
|
-
`{KB_PATH}/sprints/{sprint-dir}/INDEX.md` exists.
|
|
126
|
-
|
|
127
|
-
2. **Task INDEX files** — for every subdirectory under `{KB_PATH}/sprints/{sprint-dir}/`
|
|
128
|
-
that looks like a task folder (contains at least one `.md` file), check that its
|
|
129
|
-
`INDEX.md` exists.
|
|
130
|
-
|
|
131
|
-
3. **Bug INDEX files** — for every directory under `{KB_PATH}/bugs/`, check that
|
|
132
|
-
`{KB_PATH}/bugs/{bug-dir}/INDEX.md` exists.
|
|
133
|
-
|
|
134
|
-
If any INDEX files are missing, prepend this warning to the output (before the agent-file
|
|
135
|
-
approval prompt):
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
⚠️ KB knowledge graph has broken links — INDEX.md files are missing:
|
|
139
|
-
|
|
140
|
-
△ {KB_PATH}/sprints/PROJ-S01/INDEX.md — missing
|
|
141
|
-
△ {KB_PATH}/sprints/PROJ-S01/PROJ-S01-T01/INDEX.md — missing
|
|
142
|
-
△ {KB_PATH}/bugs/PROJ-B01-some-bug/INDEX.md — missing
|
|
143
|
-
|
|
144
|
-
Run collate to regenerate them:
|
|
145
|
-
node "$FORGE_ROOT/tools/collate.cjs"
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
If all INDEX files are present (or there are no sprint/task/bug folders yet), skip this
|
|
149
|
-
block entirely. Do not warn when the KB is intact.
|
|
150
|
-
|
|
151
|
-
## Staleness Check
|
|
152
|
-
|
|
153
|
-
For each detected agent instruction file, check both sections:
|
|
154
|
-
|
|
155
|
-
1. If the section marker is absent → section is **missing**
|
|
156
|
-
2. If the section markers are present → extract the current content between them.
|
|
157
|
-
Compare current content vs. the content you would write (with current KB_PATH
|
|
158
|
-
and only existing files). If they differ → section is **stale**. If identical → **current**.
|
|
159
|
-
|
|
160
|
-
## Approval Prompt
|
|
161
|
-
|
|
162
|
-
After scanning all files, present a single consolidated approval prompt:
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
🏮 forge:refresh-kb-links — KB & Workflow Visibility
|
|
166
|
-
|
|
167
|
-
Forge has generated a knowledge base and SDLC workflows for this project. Without links
|
|
168
|
-
to these in your agent instruction files, every new conversation starts blind — no KB
|
|
169
|
-
context, no workflow playbook.
|
|
170
|
-
|
|
171
|
-
Found agent instruction files:
|
|
172
|
-
〇 CLAUDE.md — no Forge KB links, no workflow links
|
|
173
|
-
〇 AGENTS.md — no Forge KB links, no workflow links
|
|
174
|
-
|
|
175
|
-
Add ## Forge Knowledge Base and ## Forge Workflows sections to each? [Y/n]
|
|
176
|
-
(or choose individually: [c])
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Adapt the status lines to reflect the actual state:
|
|
180
|
-
- `〇 {filename} — no Forge KB links, no workflow links` (both missing)
|
|
181
|
-
- `〇 {filename} — KB links stale` (KB section present but stale)
|
|
182
|
-
- `〇 {filename} — workflow links stale` (workflow section present but stale)
|
|
183
|
-
- `〇 {filename} — KB links stale, workflow links stale` (both stale)
|
|
184
|
-
- `〇 {filename} — links current, no changes needed` (both present and current — skip)
|
|
185
|
-
|
|
186
|
-
**If all detected files already have current links:** output:
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
🏮 forge:refresh-kb-links — all KB and workflow links are current. No changes needed.
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
And return without prompting.
|
|
193
|
-
|
|
194
|
-
## Writing Sections
|
|
195
|
-
|
|
196
|
-
On approval ([Y] or per-file confirm):
|
|
197
|
-
|
|
198
|
-
- **Missing section:** append the section to the end of the file.
|
|
199
|
-
- **Stale section:** replace content between the open and close markers with fresh content.
|
|
200
|
-
Preserve everything outside the markers exactly.
|
|
201
|
-
|
|
202
|
-
Write the `{KB_PATH}` substitution with the actual resolved path value (not the literal
|
|
203
|
-
string `{KB_PATH}`). The resulting markdown should have real paths like `engineering/MASTER_INDEX.md`
|
|
204
|
-
or `ai-docs/MASTER_INDEX.md`.
|
|
205
|
-
|
|
206
|
-
## Idempotency
|
|
207
|
-
|
|
208
|
-
On a second run where all links are already current, output the "all links current" message
|
|
209
|
-
and return immediately. Do not re-write unchanged sections.
|
|
210
|
-
|
|
211
|
-
## Rename Instructions
|
|
212
|
-
|
|
213
|
-
If the user later renames the KB folder:
|
|
214
|
-
|
|
215
|
-
1. Rename the folder on disk.
|
|
216
|
-
2. Run: `node "$FORGE_ROOT/tools/manage-config.cjs" set paths.engineering <new-name>`
|
|
217
|
-
3. Re-run `forge:refresh-kb-links` to refresh the links in all agent instruction files.
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: store-custodian
|
|
3
|
-
description: "Sole authorized gateway for reading and writing the Forge JSON store (.forge/store/). Use whenever a workflow needs to write sprints, tasks, bugs, features, or events — or read/list/validate/transition them. All store mutations MUST go through store-cli.cjs, never by writing files directly."
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# forge:store-custodian
|
|
9
|
-
|
|
10
|
-
The Store Custodian is the **sole authorized gateway** for the probabilistic
|
|
11
|
-
layer (LLM-driven workflows and commands) to read and modify the JSON store at
|
|
12
|
-
`.forge/store/`. All store mutations must go through `store-cli.cjs`.
|
|
13
|
-
|
|
14
|
-
**Hard rule: never fall back to writing store files directly.** If the CLI
|
|
15
|
-
fails, read the error, fix the data, and retry. If it persists after retries,
|
|
16
|
-
report the error to the user and stop.
|
|
17
|
-
|
|
18
|
-
## FORGE_ROOT Resolution
|
|
19
|
-
|
|
20
|
-
Before invoking any store-cli command, resolve the plugin root path:
|
|
21
|
-
|
|
22
|
-
```sh
|
|
23
|
-
FORGE_ROOT=$(node -e "console.log(require('./.forge/config.json').paths.forgeRoot)")
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
This reads the `paths.forgeRoot` field from the project config, which is set
|
|
27
|
-
during `/forge:init` and refreshed by `/forge:update`. Do NOT hardcode the
|
|
28
|
-
plugin install path.
|
|
29
|
-
|
|
30
|
-
## Invocation
|
|
31
|
-
|
|
32
|
-
All commands follow this pattern:
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
node "$FORGE_ROOT/tools/store-cli.cjs" <command> <args>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Exit codes: **0** on success, **1** on failure (validation error, illegal
|
|
39
|
-
transition, entity not found, etc.).
|
|
40
|
-
|
|
41
|
-
## Invocation Patterns
|
|
42
|
-
|
|
43
|
-
### Write / Read / Mutate
|
|
44
|
-
|
|
45
|
-
| Intent | Command |
|
|
46
|
-
|--------|---------|
|
|
47
|
-
| Write a sprint | `node "$FORGE_ROOT/tools/store-cli.cjs" write sprint '{...}'` |
|
|
48
|
-
| Write a task | `node "$FORGE_ROOT/tools/store-cli.cjs" write task '{...}'` |
|
|
49
|
-
| Write a bug | `node "$FORGE_ROOT/tools/store-cli.cjs" write bug '{...}'` |
|
|
50
|
-
| Write a feature | `node "$FORGE_ROOT/tools/store-cli.cjs" write feature '{...}'` |
|
|
51
|
-
| Read a task | `node "$FORGE_ROOT/tools/store-cli.cjs" read task FORGE-S01-T01` |
|
|
52
|
-
| Read a task (raw JSON) | `node "$FORGE_ROOT/tools/store-cli.cjs" read task FORGE-S01-T01 --json` |
|
|
53
|
-
| Update task status | `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task FORGE-S01-T01 status implemented` |
|
|
54
|
-
| Update bug status | `node "$FORGE_ROOT/tools/store-cli.cjs" update-status bug BUG-001 status triaged` |
|
|
55
|
-
| Emit an event | `node "$FORGE_ROOT/tools/store-cli.cjs" emit FORGE-S01 '{...event-json...}'` |
|
|
56
|
-
| Write a sidecar | `node "$FORGE_ROOT/tools/store-cli.cjs" emit FORGE-S01 '{...sidecar-json...}' --sidecar` |
|
|
57
|
-
| Merge a sidecar | `node "$FORGE_ROOT/tools/store-cli.cjs" merge-sidecar FORGE-S01 20260415T141523Z_T01_plan_plan-task` |
|
|
58
|
-
| Validate before write | `node "$FORGE_ROOT/tools/store-cli.cjs" validate task '{...}'` |
|
|
59
|
-
| List entities | `node "$FORGE_ROOT/tools/store-cli.cjs" list task status=planned` |
|
|
60
|
-
| List all sprints | `node "$FORGE_ROOT/tools/store-cli.cjs" list sprint` |
|
|
61
|
-
| Delete an entity | `node "$FORGE_ROOT/tools/store-cli.cjs" delete task FORGE-S01-T01` |
|
|
62
|
-
| Purge sprint events | `node "$FORGE_ROOT/tools/store-cli.cjs" purge-events FORGE-S01` |
|
|
63
|
-
| Write collation state | `node "$FORGE_ROOT/tools/store-cli.cjs" write-collation-state '{...}'` |
|
|
64
|
-
| Force a transition | `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task T01 status committed --force` |
|
|
65
|
-
|
|
66
|
-
### Query
|
|
67
|
-
|
|
68
|
-
Use the query engine to find entities by intent, sprint, or keyword — without manual KB navigation.
|
|
69
|
-
|
|
70
|
-
| Intent | Command |
|
|
71
|
-
|--------|---------|
|
|
72
|
-
| Query by natural language | `node "$FORGE_ROOT/tools/store-cli.cjs" nlp "open bugs in S12"` |
|
|
73
|
-
| Query sprint tasks/bugs | `node "$FORGE_ROOT/tools/store-cli.cjs" query --sprint S12` |
|
|
74
|
-
| Query specific bug | `node "$FORGE_ROOT/tools/store-cli.cjs" query --bug {PREFIX}-BUG-047` |
|
|
75
|
-
| Query specific task | `node "$FORGE_ROOT/tools/store-cli.cjs" query --task {PREFIX}-S12-T03` |
|
|
76
|
-
| Keyword search | `node "$FORGE_ROOT/tools/store-cli.cjs" query --keyword auth` |
|
|
77
|
-
| Project schema / grammar | `node "$FORGE_ROOT/tools/store-cli.cjs" schema` |
|
|
78
|
-
| Query (strict mode, no NLP) | `node "$FORGE_ROOT/tools/store-cli.cjs" query --mode strict --sprint S12` |
|
|
79
|
-
|
|
80
|
-
Query returns structured JSON: entity IDs, titles, statuses, relationships, fileRefs, INDEX.md excerpts.
|
|
81
|
-
See `forge:store-query-nlp` for full output schema and confidence signals.
|
|
82
|
-
See `forge:store-query-grammar` for NLP token vocabulary.
|
|
83
|
-
|
|
84
|
-
## Entity Types
|
|
85
|
-
|
|
86
|
-
| Entity | ID Field | Directory |
|
|
87
|
-
|--------|----------|-----------|
|
|
88
|
-
| sprint | `sprintId` | `.forge/store/sprints/` |
|
|
89
|
-
| task | `taskId` | `.forge/store/tasks/` |
|
|
90
|
-
| bug | `bugId` | `.forge/store/bugs/` |
|
|
91
|
-
| event | `eventId` | `.forge/store/events/{sprintId}/` |
|
|
92
|
-
| feature | `id` | `.forge/store/features/` |
|
|
93
|
-
|
|
94
|
-
## Error Handling
|
|
95
|
-
|
|
96
|
-
On exit code 1:
|
|
97
|
-
1. Read stderr for the validation error message.
|
|
98
|
-
2. Fix the data that caused the error (missing required fields, illegal
|
|
99
|
-
transition, invalid JSON, etc.).
|
|
100
|
-
3. Retry the command (max 2 retries).
|
|
101
|
-
4. If the command still fails after retries, report the validation error to
|
|
102
|
-
the user and stop. Do NOT fall back to writing store files directly.
|
|
103
|
-
|
|
104
|
-
## Commands Reference
|
|
105
|
-
|
|
106
|
-
### `write <entity> '<json>'`
|
|
107
|
-
|
|
108
|
-
Write a full entity record. Validates against the schema before writing.
|
|
109
|
-
Rejects on validation error (exit 1 + per-field stderr messages). No partial
|
|
110
|
-
write on failure.
|
|
111
|
-
|
|
112
|
-
### `read <entity> <id> [--json]`
|
|
113
|
-
|
|
114
|
-
Read an entity record. Pretty-printed by default. `--json` outputs raw JSON for
|
|
115
|
-
parsing.
|
|
116
|
-
|
|
117
|
-
### `list <entity> [key=value ...]`
|
|
118
|
-
|
|
119
|
-
List entities with optional key=value filter pairs. Numeric values are
|
|
120
|
-
auto-parsed. Outputs JSON array.
|
|
121
|
-
|
|
122
|
-
### `delete <entity> <id>`
|
|
123
|
-
|
|
124
|
-
Delete an entity record. No validation needed.
|
|
125
|
-
|
|
126
|
-
### `update-status <entity> <id> <field> <value> [--force]`
|
|
127
|
-
|
|
128
|
-
Atomic status/enum field update with transition check. Reads the current
|
|
129
|
-
record, verifies the transition is legal, applies the update, and writes back.
|
|
130
|
-
Use `--force` to bypass the transition check (emits a warning on stderr).
|
|
131
|
-
|
|
132
|
-
### `emit <sprintId> '<json>' [--sidecar]`
|
|
133
|
-
|
|
134
|
-
Write an event record. With `--sidecar`, writes a `_{eventId}_usage.json`
|
|
135
|
-
ephemeral sidecar file instead of a canonical event. Sidecars require only an
|
|
136
|
-
`eventId` field; they are merged into the canonical event later.
|
|
137
|
-
|
|
138
|
-
### `merge-sidecar <sprintId> <eventId>`
|
|
139
|
-
|
|
140
|
-
Merge sidecar token fields into the canonical event, then delete the sidecar.
|
|
141
|
-
Fails if either file is missing.
|
|
142
|
-
|
|
143
|
-
### `purge-events <sprintId>`
|
|
144
|
-
|
|
145
|
-
Delete all event files for a sprint.
|
|
146
|
-
|
|
147
|
-
### `write-collation-state '<json>'`
|
|
148
|
-
|
|
149
|
-
Write COLLATION_STATE.json to the store root. Delegates to the store facade.
|
|
150
|
-
|
|
151
|
-
### `validate <entity> '<json>'`
|
|
152
|
-
|
|
153
|
-
Validate a record against the schema without writing. Reports errors on
|
|
154
|
-
stderr, exits 1 on failure, exits 0 on success with `{"ok":true,"valid":true}`.
|
|
155
|
-
|
|
156
|
-
## Flags
|
|
157
|
-
|
|
158
|
-
| Flag | Applies to | Effect |
|
|
159
|
-
|------|-----------|--------|
|
|
160
|
-
| `--dry-run` | All write commands | Validate and preview without writing |
|
|
161
|
-
| `--force` | `update-status` | Bypass transition check (warns on stderr) |
|
|
162
|
-
| `--json` | `read` | Output raw JSON (no pretty-print) |
|
|
163
|
-
| `--sidecar` | `emit` | Write as sidecar file (ephemeral, `_-prefixed`) |
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: store-query-grammar
|
|
3
|
-
description: "Reference for the Forge NLP query grammar — entity synonyms, status synonyms, ordering tokens, FK phrases, and ID patterns. Use when constructing or debugging store-query-nlp queries, or to understand why a query returned unexpected results."
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# forge:store-query-grammar
|
|
9
|
-
|
|
10
|
-
NLP grammar reference for the Forge store query engine.
|
|
11
|
-
|
|
12
|
-
The query engine (`store-cli.cjs nlp`) uses a 5-stage deterministic rule-based
|
|
13
|
-
parser — no LLM, no network. This skill documents the token vocabulary so you
|
|
14
|
-
can construct precise queries and debug unexpected parse results.
|
|
15
|
-
|
|
16
|
-
## Setup
|
|
17
|
-
|
|
18
|
-
Dump the live grammar for the current project (includes project-specific ID patterns):
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
FORGE_ROOT=$(node -e "console.log(require('./.forge/config.json').paths.forgeRoot)")
|
|
22
|
-
node "$FORGE_ROOT/tools/store-cli.cjs" schema
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The `schema` command returns entity schemas, status enums, and the full grammar
|
|
26
|
-
reference for the installed project prefix.
|
|
27
|
-
|
|
28
|
-
## Parser Stages
|
|
29
|
-
|
|
30
|
-
### Stage 1 — ID Patterns (highest priority)
|
|
31
|
-
|
|
32
|
-
Matched first; consumed tokens are excluded from later stages.
|
|
33
|
-
|
|
34
|
-
| Pattern | Example | Resolves to |
|
|
35
|
-
|---------|---------|------------|
|
|
36
|
-
| `{PREFIX}-S##-T##` | `WI-S12-T03` | task filter |
|
|
37
|
-
| `{PREFIX}-BUG-###` | `WI-BUG-047` | bug filter |
|
|
38
|
-
| `FEAT-###` | `FEAT-003` | feature filter |
|
|
39
|
-
| `S##` | `S12` | sprint filter |
|
|
40
|
-
| `sprint N` | `sprint 12` | sprint filter → `S12` |
|
|
41
|
-
|
|
42
|
-
### Stage 2 — Entity Detection
|
|
43
|
-
|
|
44
|
-
The parser identifies the primary entity type from synonyms. First match wins.
|
|
45
|
-
|
|
46
|
-
| Entity | Synonyms |
|
|
47
|
-
|--------|---------|
|
|
48
|
-
| sprints | sprint, sprints, release, releases, iteration, iterations |
|
|
49
|
-
| tasks | task, tasks, item, items, work item, work items, todo, todos |
|
|
50
|
-
| bugs | bug, bugs, defect, defects, issue, issues, problem, problems |
|
|
51
|
-
| features | feature, features, epic, epics, capability, capabilities |
|
|
52
|
-
|
|
53
|
-
Bigrams are matched before unigrams (e.g. `work item` → tasks).
|
|
54
|
-
|
|
55
|
-
### Stage 3 — Status / Severity Filters
|
|
56
|
-
|
|
57
|
-
Maps natural-language status phrases to schema enum values per entity type.
|
|
58
|
-
|
|
59
|
-
| Input phrase | tasks | bugs | sprints | features |
|
|
60
|
-
|-------------|-------|------|---------|---------|
|
|
61
|
-
| open / active / in progress | implementing | in-progress | active | active |
|
|
62
|
-
| completed / done | committed | fixed | completed | shipped |
|
|
63
|
-
| fixed | — | fixed | — | — |
|
|
64
|
-
| planned / planning | planned | — | planning | — |
|
|
65
|
-
| implementing | implementing | — | — | — |
|
|
66
|
-
| implemented | implemented | — | — | — |
|
|
67
|
-
| committed | committed | — | — | — |
|
|
68
|
-
| draft | draft | — | — | draft |
|
|
69
|
-
| abandoned | abandoned | — | abandoned | — |
|
|
70
|
-
| retired | — | — | — | retired |
|
|
71
|
-
| shipped | — | — | — | shipped |
|
|
72
|
-
| triaged | — | triaged | — | — |
|
|
73
|
-
| reported | — | reported | — | — |
|
|
74
|
-
| blocked | blocked | — | — | — |
|
|
75
|
-
|
|
76
|
-
Severity (bugs only, sets `severity` field not `status`):
|
|
77
|
-
|
|
78
|
-
| Input | Severity |
|
|
79
|
-
|-------|---------|
|
|
80
|
-
| critical | critical |
|
|
81
|
-
| major | major |
|
|
82
|
-
| minor | minor |
|
|
83
|
-
|
|
84
|
-
### Stage 4 — FK Follow Phrases
|
|
85
|
-
|
|
86
|
-
Trigger FK traversal in the result set.
|
|
87
|
-
|
|
88
|
-
| Phrase | FK followed |
|
|
89
|
-
|--------|-----------|
|
|
90
|
-
| with sprint / sprint for / which sprint | `sprintId` |
|
|
91
|
-
| with feature / feature for | `featureId` |
|
|
92
|
-
| block / blocking / blocked | `blocksTask` (for bugs) or `blockedBy` (for tasks) |
|
|
93
|
-
|
|
94
|
-
### Stage 4b — Ordering and Limit Tokens
|
|
95
|
-
|
|
96
|
-
| Token(s) | Effect |
|
|
97
|
-
|----------|--------|
|
|
98
|
-
| latest / newest / recent / most recent | sort desc, limit 1 |
|
|
99
|
-
| oldest / earliest / first | sort asc, limit 1 |
|
|
100
|
-
| last | sort desc, limit 1 |
|
|
101
|
-
| top N / first N | sort desc/asc, limit N |
|
|
102
|
-
| last N | sort desc, limit N |
|
|
103
|
-
| how many / count of / number of / count | count mode (returns `{count: N}`) |
|
|
104
|
-
|
|
105
|
-
### Stage 5 — Keyword Extraction
|
|
106
|
-
|
|
107
|
-
Remaining tokens (not consumed by stages 1–4, not in stop words, length > 1)
|
|
108
|
-
become keyword match terms on the `title` field (word-boundary match).
|
|
109
|
-
|
|
110
|
-
Stop words include all entity synonyms plus: list, all, the, show, find, what,
|
|
111
|
-
which, are, in, for, about, related, to, of, and, with, details, status, how,
|
|
112
|
-
many, there, a, an, is, that, this, on, by, me, give, get, tell, please, can,
|
|
113
|
-
do, does, did, was, were, been, being, have, has, had, will, would, could,
|
|
114
|
-
should, may, might, blocking, blocked, block, severity, titles, title.
|
|
115
|
-
|
|
116
|
-
## Debugging Queries
|
|
117
|
-
|
|
118
|
-
If a query returns unexpected results, use `traversalTrace` in the output:
|
|
119
|
-
|
|
120
|
-
```json
|
|
121
|
-
"traversalTrace": [
|
|
122
|
-
"intent parsed via NLP rules",
|
|
123
|
-
"listed tasks with filter {\"status\":\"implementing\"}: 7 results",
|
|
124
|
-
"sorted tasks desc",
|
|
125
|
-
"limited to 3 (of 7)",
|
|
126
|
-
"plan confidence: high"
|
|
127
|
-
]
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Common debug patterns:
|
|
131
|
-
|
|
132
|
-
| Symptom | Likely cause |
|
|
133
|
-
|---------|-------------|
|
|
134
|
-
| 0 results, retried | Status phrase didn't map to a valid enum for the detected entity type |
|
|
135
|
-
| confidence: low | Filter value stripped — check the status mapping table above |
|
|
136
|
-
| Wrong entity type | Entity synonym matched a stop word before the intended synonym |
|
|
137
|
-
| Keyword matching too broadly | Term is short (≤1 char) or in stop words; try a more specific term |
|
|
138
|
-
| Missing FK traversal | FK phrase not in stage 4 vocabulary; use `--with-sprint` / `--with-feature` flags instead |
|
|
139
|
-
|
|
140
|
-
## Query Composition Tips
|
|
141
|
-
|
|
142
|
-
- Put entity type first: `"bugs in S12"` not `"S12 bugs"` — entity is detected in order
|
|
143
|
-
- Use exact ID when known: `"WI-BUG-047"` is faster and more precise than `"bug about auth"`
|
|
144
|
-
- Count before listing: `"how many open bugs"` before `"open bugs"` for large stores
|
|
145
|
-
- Combine stages naturally: `"critical open bugs in S12 blocking tasks"` uses stages 1, 2, 3, 4 together
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: store-query-nlp
|
|
3
|
-
description: "Query the Forge store using natural language. Use when you need to find tasks, bugs, sprints, or features by intent — e.g. 'open bugs in S12', 'blocked tasks', 'tasks implementing the auth feature', 'how many bugs are critical'. Returns structured JSON with entity IDs, titles, statuses, relationships, file refs, and INDEX.md excerpts."
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# forge:store-query-nlp
|
|
9
|
-
|
|
10
|
-
Translate natural language intent into a structured Forge store query.
|
|
11
|
-
Returns filtered, FK-resolved results with excerpts — replacing manual KB navigation.
|
|
12
|
-
|
|
13
|
-
**When to use:** anytime you need to find entities without knowing exact IDs, or
|
|
14
|
-
want filtered/sorted results from a sprint/feature/status. Replaces reading
|
|
15
|
-
MASTER_INDEX.md manually when a focused query is sufficient.
|
|
16
|
-
|
|
17
|
-
## Setup
|
|
18
|
-
|
|
19
|
-
Resolve the plugin root path before any invocation:
|
|
20
|
-
|
|
21
|
-
```sh
|
|
22
|
-
FORGE_ROOT=$(node -e "console.log(require('./.forge/config.json').paths.forgeRoot)")
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Invocation
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
node "$FORGE_ROOT/tools/store-cli.cjs" nlp "<natural language query>"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Returns JSON to stdout. Exit 0 on success, 1 on error.
|
|
32
|
-
|
|
33
|
-
## Example Queries
|
|
34
|
-
|
|
35
|
-
| Intent | Example |
|
|
36
|
-
|--------|---------|
|
|
37
|
-
| Bugs in a sprint | `"open bugs in S12"` |
|
|
38
|
-
| Blocked tasks | `"blocked tasks"` |
|
|
39
|
-
| Tasks by status | `"implementing tasks in S14"` |
|
|
40
|
-
| Critical bugs | `"critical bugs"` |
|
|
41
|
-
| Tasks for a feature | `"tasks for FEAT-003"` |
|
|
42
|
-
| Sprint overview | `"sprint S12"` |
|
|
43
|
-
| Specific bug | `"WI-BUG-047"` |
|
|
44
|
-
| Specific task | `"WI-S12-T03"` |
|
|
45
|
-
| Latest sprint | `"latest sprint"` |
|
|
46
|
-
| Count query | `"how many open bugs"` |
|
|
47
|
-
| Blocking chain | `"bugs blocking tasks in S12"` |
|
|
48
|
-
|
|
49
|
-
## Output Structure
|
|
50
|
-
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"query": "open bugs in S12",
|
|
54
|
-
"path": "intent-nlp",
|
|
55
|
-
"traversalTrace": ["..."],
|
|
56
|
-
"results": [
|
|
57
|
-
{
|
|
58
|
-
"id": "WI-BUG-047",
|
|
59
|
-
"title": "...",
|
|
60
|
-
"status": "in-progress",
|
|
61
|
-
"type": "bug",
|
|
62
|
-
"relationships": { "sprintId": "S12", "blocksTask": ["WI-S12-T03"] },
|
|
63
|
-
"fileRefs": { "json": ".forge/store/bugs/WI-BUG-047.json", "md": "engineering/bugs/..." },
|
|
64
|
-
"excerpt": "First few sentences from INDEX.md..."
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
"relatedFileRefs": ["..."],
|
|
68
|
-
"meta": { "mode": "auto", "engineVersion": "1.0.0", "totalTimeMs": 42 }
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Interpreting Results
|
|
73
|
-
|
|
74
|
-
- `traversalTrace` — explains the NLP parse path (entity detected, filters applied, FKs followed, confidence level)
|
|
75
|
-
- `fileRefs.md` — path to the INDEX.md for this entity; read it for full context
|
|
76
|
-
- `fileRefs.json` — path to the store JSON record; use with `store-cli read` for full data
|
|
77
|
-
- `excerpt` — first 4 sentences from the INDEX.md; often sufficient without a Read() call
|
|
78
|
-
- `relatedFileRefs` — flat list of all referenced files, ready for batch Read()
|
|
79
|
-
- `meta.totalTimeMs` — wall-clock query time; typical range 5–80ms
|
|
80
|
-
|
|
81
|
-
## Confidence Signals
|
|
82
|
-
|
|
83
|
-
Check `traversalTrace` for confidence:
|
|
84
|
-
|
|
85
|
-
- `plan confidence: high` — all filters validated against schema enums/patterns
|
|
86
|
-
- `plan confidence: low` — one or more filters were stripped as invalid; results may be broader than expected
|
|
87
|
-
- `overall confidence: low (required retry)` — primary query returned 0 results; retried as keyword-only search
|
|
88
|
-
|
|
89
|
-
When confidence is low, verify results or fall back to reading MASTER_INDEX.md.
|
|
90
|
-
|
|
91
|
-
## Mode Control
|
|
92
|
-
|
|
93
|
-
```sh
|
|
94
|
-
# Explicit NLP mode (default for nlp subcommand)
|
|
95
|
-
node "$FORGE_ROOT/tools/store-cli.cjs" nlp "open bugs in S12"
|
|
96
|
-
|
|
97
|
-
# Strict mode — exact flags only, no NLP (baseline comparison)
|
|
98
|
-
node "$FORGE_ROOT/tools/store-cli.cjs" query --mode strict --sprint S12 --status in-progress
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Fallback
|
|
102
|
-
|
|
103
|
-
If the query returns 0 results or low confidence, fall back to:
|
|
104
|
-
|
|
105
|
-
```sh
|
|
106
|
-
node "$FORGE_ROOT/tools/store-cli.cjs" list bug
|
|
107
|
-
# Then scan titles manually
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Or read `engineering/MASTER_INDEX.md` directly.
|