dsh-pstack 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +158 -2
- package/assets/agents/comment-sicko.md +32 -0
- package/assets/agents/poteto-agent.md +8 -0
- package/assets/docs/guide/01-setup.md +64 -0
- package/assets/docs/guide/02-poteto-mode.md +139 -0
- package/assets/docs/guide/03-understand.md +79 -0
- package/assets/docs/guide/04-design.md +133 -0
- package/assets/docs/guide/05-build-and-clean.md +83 -0
- package/assets/docs/guide/06-verify-and-ship.md +152 -0
- package/assets/docs/guide/07-overnight.md +122 -0
- package/assets/docs/guide/08-principles.md +72 -0
- package/assets/docs/guide/09-make-it-yours.md +100 -0
- package/assets/docs/guide/10-recipes-and-pitfalls.md +180 -0
- package/assets/docs/guide/README.md +38 -0
- package/assets/docs/harness/dsh.md +65 -0
- package/assets/docs/pstack-models.example.md +23 -0
- package/assets/skills/architect/SKILL.md +81 -0
- package/assets/skills/architect/references/design-red-flags.md +57 -0
- package/assets/skills/architect/references/rationale-template.md +35 -0
- package/assets/skills/architect/references/runner-prompt.md +20 -0
- package/assets/skills/arena/SKILL.md +50 -0
- package/assets/skills/automate-me/SKILL.md +105 -0
- package/assets/skills/benchmark-checklist/SKILL.md +41 -0
- package/assets/skills/blast-radius/SKILL.md +52 -0
- package/assets/skills/bro/SKILL.md +9 -0
- package/assets/skills/correct/SKILL.md +34 -0
- package/assets/skills/create-formal-verification-skill/SKILL.md +43 -0
- package/assets/skills/create-verification-skill/SKILL.md +46 -0
- package/assets/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/assets/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/assets/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/assets/skills/figure-it-out/SKILL.md +54 -0
- package/assets/skills/how/SKILL.md +38 -0
- package/assets/skills/how/references/explainer-prompt.md +55 -0
- package/assets/skills/how/references/explorer-prompt.md +35 -0
- package/assets/skills/in-your-own-words/SKILL.md +9 -0
- package/assets/skills/interrogate/SKILL.md +69 -0
- package/assets/skills/interrogate/references/code-quality-review.md +47 -0
- package/assets/skills/interrogate/references/lead-judgment.md +39 -0
- package/assets/skills/interrogate/references/reviewer-prompt.md +62 -0
- package/assets/skills/interrogate/references/rubric.md +77 -0
- package/assets/skills/ketchup/SKILL.md +45 -0
- package/assets/skills/maintain-formal-verification-skill/SKILL.md +60 -0
- package/assets/skills/maintain-verification-skill/SKILL.md +41 -0
- package/assets/skills/no-comments/SKILL.md +26 -0
- package/assets/skills/poteto-help/SKILL.md +161 -0
- package/assets/skills/poteto-help/references/prompting.md +51 -0
- package/assets/skills/poteto-help/references/recipes.md +51 -0
- package/assets/skills/poteto-mode/SKILL.md +153 -0
- package/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/assets/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/assets/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
- package/assets/skills/poteto-mode/playbooks/autopilot-stack.md +12 -0
- package/assets/skills/poteto-mode/playbooks/babysit.md +23 -0
- package/assets/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/assets/skills/poteto-mode/playbooks/eval.md +25 -0
- package/assets/skills/poteto-mode/playbooks/feature.md +21 -0
- package/assets/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/assets/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/assets/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
- package/assets/skills/poteto-mode/playbooks/opening-a-pr.md +34 -0
- package/assets/skills/poteto-mode/playbooks/orchestrate.md +112 -0
- package/assets/skills/poteto-mode/playbooks/pause-safely.md +10 -0
- package/assets/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/assets/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/assets/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/assets/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/assets/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/assets/skills/poteto-mode/playbooks/shipping.md +12 -0
- package/assets/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/assets/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
- package/assets/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/assets/skills/poteto-mode/scripts/bootstrap.ts +62 -0
- package/assets/skills/poteto-mode/scripts/bun.lock +67 -0
- package/assets/skills/poteto-mode/scripts/check-plan.mjs +205 -0
- package/assets/skills/poteto-mode/scripts/check-plan.test.ts +96 -0
- package/assets/skills/poteto-mode/scripts/orch/orch.test.ts +761 -0
- package/assets/skills/poteto-mode/scripts/orch/orch.ts +590 -0
- package/assets/skills/poteto-mode/scripts/orch/store.ts +1677 -0
- package/assets/skills/poteto-mode/scripts/package.json +16 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +129 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/github.test.ts +436 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/github.ts +718 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/policy.ts +836 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/types.ts +413 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
- package/assets/skills/poteto-mode/scripts/worktree-audit.sh +127 -0
- package/assets/skills/principle-attack-the-premise/SKILL.md +23 -0
- package/assets/skills/principle-boundary-discipline/SKILL.md +36 -0
- package/assets/skills/principle-build-the-lever/SKILL.md +26 -0
- package/assets/skills/principle-encode-lessons-in-structure/SKILL.md +13 -0
- package/assets/skills/principle-exhaust-the-design-space/SKILL.md +11 -0
- package/assets/skills/principle-experience-first/SKILL.md +21 -0
- package/assets/skills/principle-explain-the-number/SKILL.md +19 -0
- package/assets/skills/principle-fix-root-causes/SKILL.md +23 -0
- package/assets/skills/principle-foundational-thinking/SKILL.md +23 -0
- package/assets/skills/principle-guard-the-context-window/SKILL.md +14 -0
- package/assets/skills/principle-laziness-protocol/SKILL.md +12 -0
- package/assets/skills/principle-make-operations-idempotent/SKILL.md +24 -0
- package/assets/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +16 -0
- package/assets/skills/principle-minimize-reader-load/SKILL.md +20 -0
- package/assets/skills/principle-model-the-domain/SKILL.md +26 -0
- package/assets/skills/principle-never-block-on-the-human/SKILL.md +17 -0
- package/assets/skills/principle-outcome-oriented-execution/SKILL.md +23 -0
- package/assets/skills/principle-prove-it-works/SKILL.md +24 -0
- package/assets/skills/principle-redesign-from-first-principles/SKILL.md +18 -0
- package/assets/skills/principle-separate-before-serializing-shared-state/SKILL.md +18 -0
- package/assets/skills/principle-sequence-verifiable-units/SKILL.md +19 -0
- package/assets/skills/principle-subtract-before-you-add/SKILL.md +20 -0
- package/assets/skills/principle-test-behavior-not-implementation/SKILL.md +22 -0
- package/assets/skills/principle-type-system-discipline/SKILL.md +15 -0
- package/assets/skills/recall/SKILL.md +37 -0
- package/assets/skills/reflect/SKILL.md +70 -0
- package/assets/skills/reflect/references/divergent-reviewer.md +38 -0
- package/assets/skills/reflect/references/judgment-reviewer.md +37 -0
- package/assets/skills/reflect/references/synthesizer.md +56 -0
- package/assets/skills/reflect/references/tooling-reviewer.md +48 -0
- package/assets/skills/setup-pstack/SKILL.md +76 -0
- package/assets/skills/sharpen/SKILL.md +18 -0
- package/assets/skills/show-me-your-work/SKILL.md +84 -0
- package/assets/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/assets/skills/show-me-your-work/scripts/log.sh +42 -0
- package/assets/skills/swarm/SKILL.md +41 -0
- package/assets/skills/tdd/SKILL.md +44 -0
- package/assets/skills/teach/SKILL.md +23 -0
- package/assets/skills/technical-writing/SKILL.md +108 -0
- package/assets/skills/typescript-best-practices/SKILL.md +32 -0
- package/assets/skills/typescript-best-practices/references/patterns.md +328 -0
- package/assets/skills/unslop/SKILL.md +64 -0
- package/assets/skills/why/SKILL.md +100 -0
- package/assets/skills/why/references/epistemics.md +71 -0
- package/assets/skills/why/references/investigator-prompt.md +84 -0
- package/assets/skills/why/references/source-playbook.md +17 -0
- package/assets/skills/why/references/sources/code-archaeology.md +51 -0
- package/assets/skills/why/references/sources/databricks.md +70 -0
- package/assets/skills/why/references/sources/datadog.md +97 -0
- package/assets/skills/why/references/sources/incident-postmortem.md +5 -0
- package/assets/skills/why/references/sources/linear.md +48 -0
- package/assets/skills/why/references/sources/notion.md +55 -0
- package/assets/skills/why/references/sources/sentry.md +66 -0
- package/assets/skills/why/references/sources/slack.md +17 -0
- package/assets/skills/why/references/synthesizer-prompt.md +129 -0
- package/cordis.patch.yml +20 -0
- package/dist/LICENSE +22 -0
- package/dist/README.md +159 -0
- package/dist/assets/agents/comment-sicko.md +32 -0
- package/dist/assets/agents/poteto-agent.md +8 -0
- package/dist/assets/docs/guide/01-setup.md +64 -0
- package/dist/assets/docs/guide/02-poteto-mode.md +139 -0
- package/dist/assets/docs/guide/03-understand.md +79 -0
- package/dist/assets/docs/guide/04-design.md +133 -0
- package/dist/assets/docs/guide/05-build-and-clean.md +83 -0
- package/dist/assets/docs/guide/06-verify-and-ship.md +152 -0
- package/dist/assets/docs/guide/07-overnight.md +122 -0
- package/dist/assets/docs/guide/08-principles.md +72 -0
- package/dist/assets/docs/guide/09-make-it-yours.md +100 -0
- package/dist/assets/docs/guide/10-recipes-and-pitfalls.md +180 -0
- package/dist/assets/docs/guide/README.md +38 -0
- package/dist/assets/docs/harness/dsh.md +65 -0
- package/dist/assets/docs/pstack-models.example.md +23 -0
- package/dist/assets/skills/architect/SKILL.md +81 -0
- package/dist/assets/skills/architect/references/design-red-flags.md +57 -0
- package/dist/assets/skills/architect/references/rationale-template.md +35 -0
- package/dist/assets/skills/architect/references/runner-prompt.md +20 -0
- package/dist/assets/skills/arena/SKILL.md +50 -0
- package/dist/assets/skills/automate-me/SKILL.md +105 -0
- package/dist/assets/skills/benchmark-checklist/SKILL.md +41 -0
- package/dist/assets/skills/blast-radius/SKILL.md +52 -0
- package/dist/assets/skills/bro/SKILL.md +9 -0
- package/dist/assets/skills/correct/SKILL.md +34 -0
- package/dist/assets/skills/create-formal-verification-skill/SKILL.md +43 -0
- package/dist/assets/skills/create-verification-skill/SKILL.md +46 -0
- package/dist/assets/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/dist/assets/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/dist/assets/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/dist/assets/skills/figure-it-out/SKILL.md +54 -0
- package/dist/assets/skills/how/SKILL.md +38 -0
- package/dist/assets/skills/how/references/explainer-prompt.md +55 -0
- package/dist/assets/skills/how/references/explorer-prompt.md +35 -0
- package/dist/assets/skills/in-your-own-words/SKILL.md +9 -0
- package/dist/assets/skills/interrogate/SKILL.md +69 -0
- package/dist/assets/skills/interrogate/references/code-quality-review.md +47 -0
- package/dist/assets/skills/interrogate/references/lead-judgment.md +39 -0
- package/dist/assets/skills/interrogate/references/reviewer-prompt.md +62 -0
- package/dist/assets/skills/interrogate/references/rubric.md +77 -0
- package/dist/assets/skills/ketchup/SKILL.md +45 -0
- package/dist/assets/skills/maintain-formal-verification-skill/SKILL.md +60 -0
- package/dist/assets/skills/maintain-verification-skill/SKILL.md +41 -0
- package/dist/assets/skills/no-comments/SKILL.md +26 -0
- package/dist/assets/skills/poteto-help/SKILL.md +161 -0
- package/dist/assets/skills/poteto-help/references/prompting.md +51 -0
- package/dist/assets/skills/poteto-help/references/recipes.md +51 -0
- package/dist/assets/skills/poteto-mode/SKILL.md +153 -0
- package/dist/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/dist/assets/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/dist/assets/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
- package/dist/assets/skills/poteto-mode/playbooks/autopilot-stack.md +12 -0
- package/dist/assets/skills/poteto-mode/playbooks/babysit.md +23 -0
- package/dist/assets/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/dist/assets/skills/poteto-mode/playbooks/eval.md +25 -0
- package/dist/assets/skills/poteto-mode/playbooks/feature.md +21 -0
- package/dist/assets/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/dist/assets/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/dist/assets/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
- package/dist/assets/skills/poteto-mode/playbooks/opening-a-pr.md +34 -0
- package/dist/assets/skills/poteto-mode/playbooks/orchestrate.md +112 -0
- package/dist/assets/skills/poteto-mode/playbooks/pause-safely.md +10 -0
- package/dist/assets/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/dist/assets/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/dist/assets/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/dist/assets/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/dist/assets/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/dist/assets/skills/poteto-mode/playbooks/shipping.md +12 -0
- package/dist/assets/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/dist/assets/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/dist/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
- package/dist/assets/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/dist/assets/skills/poteto-mode/scripts/bootstrap.ts +62 -0
- package/dist/assets/skills/poteto-mode/scripts/bun.lock +67 -0
- package/dist/assets/skills/poteto-mode/scripts/check-plan.mjs +205 -0
- package/dist/assets/skills/poteto-mode/scripts/check-plan.test.ts +96 -0
- package/dist/assets/skills/poteto-mode/scripts/orch/orch.test.ts +761 -0
- package/dist/assets/skills/poteto-mode/scripts/orch/orch.ts +590 -0
- package/dist/assets/skills/poteto-mode/scripts/orch/store.ts +1677 -0
- package/dist/assets/skills/poteto-mode/scripts/package.json +16 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +129 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/github.test.ts +436 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/github.ts +718 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/policy.ts +836 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/types.ts +413 -0
- package/dist/assets/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
- package/dist/assets/skills/poteto-mode/scripts/worktree-audit.sh +127 -0
- package/dist/assets/skills/principle-attack-the-premise/SKILL.md +23 -0
- package/dist/assets/skills/principle-boundary-discipline/SKILL.md +36 -0
- package/dist/assets/skills/principle-build-the-lever/SKILL.md +26 -0
- package/dist/assets/skills/principle-encode-lessons-in-structure/SKILL.md +13 -0
- package/dist/assets/skills/principle-exhaust-the-design-space/SKILL.md +11 -0
- package/dist/assets/skills/principle-experience-first/SKILL.md +21 -0
- package/dist/assets/skills/principle-explain-the-number/SKILL.md +19 -0
- package/dist/assets/skills/principle-fix-root-causes/SKILL.md +23 -0
- package/dist/assets/skills/principle-foundational-thinking/SKILL.md +23 -0
- package/dist/assets/skills/principle-guard-the-context-window/SKILL.md +14 -0
- package/dist/assets/skills/principle-laziness-protocol/SKILL.md +12 -0
- package/dist/assets/skills/principle-make-operations-idempotent/SKILL.md +24 -0
- package/dist/assets/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +16 -0
- package/dist/assets/skills/principle-minimize-reader-load/SKILL.md +20 -0
- package/dist/assets/skills/principle-model-the-domain/SKILL.md +26 -0
- package/dist/assets/skills/principle-never-block-on-the-human/SKILL.md +17 -0
- package/dist/assets/skills/principle-outcome-oriented-execution/SKILL.md +23 -0
- package/dist/assets/skills/principle-prove-it-works/SKILL.md +24 -0
- package/dist/assets/skills/principle-redesign-from-first-principles/SKILL.md +18 -0
- package/dist/assets/skills/principle-separate-before-serializing-shared-state/SKILL.md +18 -0
- package/dist/assets/skills/principle-sequence-verifiable-units/SKILL.md +19 -0
- package/dist/assets/skills/principle-subtract-before-you-add/SKILL.md +20 -0
- package/dist/assets/skills/principle-test-behavior-not-implementation/SKILL.md +22 -0
- package/dist/assets/skills/principle-type-system-discipline/SKILL.md +15 -0
- package/dist/assets/skills/recall/SKILL.md +37 -0
- package/dist/assets/skills/reflect/SKILL.md +70 -0
- package/dist/assets/skills/reflect/references/divergent-reviewer.md +38 -0
- package/dist/assets/skills/reflect/references/judgment-reviewer.md +37 -0
- package/dist/assets/skills/reflect/references/synthesizer.md +56 -0
- package/dist/assets/skills/reflect/references/tooling-reviewer.md +48 -0
- package/dist/assets/skills/setup-pstack/SKILL.md +76 -0
- package/dist/assets/skills/sharpen/SKILL.md +18 -0
- package/dist/assets/skills/show-me-your-work/SKILL.md +84 -0
- package/dist/assets/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/dist/assets/skills/show-me-your-work/scripts/log.sh +42 -0
- package/dist/assets/skills/swarm/SKILL.md +41 -0
- package/dist/assets/skills/tdd/SKILL.md +44 -0
- package/dist/assets/skills/teach/SKILL.md +23 -0
- package/dist/assets/skills/technical-writing/SKILL.md +108 -0
- package/dist/assets/skills/typescript-best-practices/SKILL.md +32 -0
- package/dist/assets/skills/typescript-best-practices/references/patterns.md +328 -0
- package/dist/assets/skills/unslop/SKILL.md +64 -0
- package/dist/assets/skills/why/SKILL.md +100 -0
- package/dist/assets/skills/why/references/epistemics.md +71 -0
- package/dist/assets/skills/why/references/investigator-prompt.md +84 -0
- package/dist/assets/skills/why/references/source-playbook.md +17 -0
- package/dist/assets/skills/why/references/sources/code-archaeology.md +51 -0
- package/dist/assets/skills/why/references/sources/databricks.md +70 -0
- package/dist/assets/skills/why/references/sources/datadog.md +97 -0
- package/dist/assets/skills/why/references/sources/incident-postmortem.md +5 -0
- package/dist/assets/skills/why/references/sources/linear.md +48 -0
- package/dist/assets/skills/why/references/sources/notion.md +55 -0
- package/dist/assets/skills/why/references/sources/sentry.md +66 -0
- package/dist/assets/skills/why/references/sources/slack.md +17 -0
- package/dist/assets/skills/why/references/synthesizer-prompt.md +129 -0
- package/dist/cordis.patch.yml +20 -0
- package/dist/index.d.mts +16 -0
- package/dist/index.mjs +172 -0
- package/dist/index.mjs.map +1 -0
- package/dist/paths-Bbai4CaT.mjs +16 -0
- package/dist/paths-Bbai4CaT.mjs.map +1 -0
- package/dist/subagent.d.mts +130 -0
- package/dist/subagent.mjs +436 -0
- package/dist/subagent.mjs.map +1 -0
- package/package.json +92 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Sentry Error History
|
|
2
|
+
|
|
3
|
+
## How to search it
|
|
4
|
+
|
|
5
|
+
Use the Sentry MCP.
|
|
6
|
+
|
|
7
|
+
1. **Orient.** If you don't know the project slug and organization:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
find_organizations
|
|
11
|
+
find_projects
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
2. **Search for issues related to the target.**
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
search_issues (natural language, e.g., "errors in PaymentService timeout", "unhandled exceptions in uploadFile")
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Build queries from the exception class names the target handles, its function or class name, the error message strings it checks for, and its file path.
|
|
21
|
+
|
|
22
|
+
3. **Narrow by release and time window.**
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
search_issue_events (filter by release, time, environment, trace ID, tags)
|
|
26
|
+
get_issue_tag_values (for an issue, see distribution across versions, users, environments)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For a suspected issue, check **first seen** and **last seen** (does the stop line up with the target's ship date?), the **affected releases** (which saw it, and which was the fix?), and the **frequency trajectory** (did it spike, then get resolved?).
|
|
30
|
+
|
|
31
|
+
4. **Pull the full event for context.**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
get_sentry_resource (pass a Sentry URL or type+ID)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Does the stack trace pass through the target code? Do the tags and breadcrumbs match the conditions the target defends against?
|
|
38
|
+
|
|
39
|
+
5. **Check releases that landed near the target.**
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
find_releases (around the commit date of the target)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Cross-reference release version with the PR's merge date.
|
|
46
|
+
|
|
47
|
+
6. **Use Seer sparingly.**
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
analyze_issue_with_seer
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Seer's AI root-cause analyses are a hypothesis generator. Treat them as inference, not authoritative. The actual events and stack traces are the primary evidence.
|
|
54
|
+
|
|
55
|
+
## What to return
|
|
56
|
+
|
|
57
|
+
For each relevant issue:
|
|
58
|
+
- Issue ID and title
|
|
59
|
+
- Project and organization
|
|
60
|
+
- First seen / last seen timestamps
|
|
61
|
+
- Event count (and sampling rate if known)
|
|
62
|
+
- Affected releases
|
|
63
|
+
- A representative stack trace snippet showing relevance to the target (verbatim excerpt, not summary)
|
|
64
|
+
- First/last-seen correlation with the target's ship date
|
|
65
|
+
- Link to the issue
|
|
66
|
+
- Any author comments or resolution notes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Slack Conversations
|
|
2
|
+
|
|
3
|
+
## How to search it
|
|
4
|
+
|
|
5
|
+
Slack MCP tools vary. Check which Slack MCP is available and inspect its tool schema first. It may require `mcp_auth`. If authentication fails, stop and report the gap.
|
|
6
|
+
|
|
7
|
+
1. **Author-bounded search.** Messages from the PR author around the PR merge date. Limits scope dramatically and often hits gold.
|
|
8
|
+
3. **PR URL search.** Slack often links PRs when they're reviewed or discussed. Search for the PR URL (or just `/pull/<number>`).
|
|
9
|
+
4. **Error string search.** If the code handles a specific error, search for the error string. Incident threads often surface.
|
|
10
|
+
|
|
11
|
+
## Common pitfalls
|
|
12
|
+
|
|
13
|
+
- **Channel archaeology limits.** Very old messages may be gone due to retention policies. If you can't find anything before a certain date, note the retention cliff.
|
|
14
|
+
- **Unsearched DMs.** Many decisions happen in DMs that aren't searchable. You'll miss them. That's a known limitation.
|
|
15
|
+
- **Speculative jokes as "decisions."** Slack is casual. "Lol just do the thing" isn't a decision, even if it preceded the commit. Look for considered discussion.
|
|
16
|
+
- **Context collapse in single messages.** Without the thread, a single message often reads differently than in context. Always fetch threads.
|
|
17
|
+
- **Auth failures.** If the MCP isn't authenticated, stop. Don't make up findings. Report that Slack wasn't searchable.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Synthesizer Prompt Template
|
|
2
|
+
|
|
3
|
+
Fill in the placeholders.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are answering a "why" question about a piece of code by synthesizing findings from investigators who searched different historical sources (source control, issue / ticket tracker, long-form documents, real-time team chat, infrastructure observability, error / exception tracking, product analytics warehouse, and code comments). Produce a confidence-weighted, evidence-cited narrative that says honestly what the evidence supports, and just as honestly what it doesn't.
|
|
8
|
+
|
|
9
|
+
## The Question
|
|
10
|
+
|
|
11
|
+
> {QUESTION}
|
|
12
|
+
|
|
13
|
+
## The Code Anchor
|
|
14
|
+
|
|
15
|
+
**Target files:** {FILES_WITH_LINE_RANGES}
|
|
16
|
+
|
|
17
|
+
**Key symbols:** {SYMBOLS}
|
|
18
|
+
|
|
19
|
+
## Investigator Findings
|
|
20
|
+
|
|
21
|
+
{ALL_INVESTIGATOR_FINDINGS}
|
|
22
|
+
|
|
23
|
+
## Sources That Weren't Searched
|
|
24
|
+
|
|
25
|
+
{SKIPPED_SOURCES_WITH_REASONS}
|
|
26
|
+
|
|
27
|
+
## Epistemics Framework
|
|
28
|
+
|
|
29
|
+
You MUST follow `references/epistemics.md`. Read it in full before writing. The key rules:
|
|
30
|
+
|
|
31
|
+
1. Every claim must sit in one tier: **Direct**, **Supported**, **Inferred**, **Speculative**, **Unknown**. The tier sets its section and its phrasing.
|
|
32
|
+
2. Every Direct/Supported claim must have a citation (PR #, ticket ID, doc URL, chat permalink, commit hash, or file:line).
|
|
33
|
+
3. Inferred and Speculative claims must use hedged language ("appears to", "likely", "suggests", "one possibility is").
|
|
34
|
+
4. Never cite code as evidence for its own intent.
|
|
35
|
+
5. Document gaps. Don't fill them with plausible-sounding guesses.
|
|
36
|
+
6. Treat a hypothesis embedded in the user's question as a candidate, not a conclusion. Check it independently.
|
|
37
|
+
|
|
38
|
+
## Instructions
|
|
39
|
+
|
|
40
|
+
1. **Read all investigator findings** and weigh the evidence yourself. Investigators gathered raw evidence, not conclusions.
|
|
41
|
+
2. **Merge overlaps.** When several investigators cite the same PR, ticket, or doc, give it one authoritative reference.
|
|
42
|
+
3. **Surface contradictions.** When two items disagree, show both. Don't pick one.
|
|
43
|
+
4. **Calibrate each claim.** Find its evidence and tier. Direct: cite it and state it plainly. Inferred: hedge it and show the inference. Speculative: mark it. No evidence: put it in the gaps.
|
|
44
|
+
5. **Verify citations by spot-checking.** If you're uncertain a cited item exists or says what the investigator claims, check it by reading the codebase or calling MCP tools. Don't propagate errors. Do not write files, commit, or modify external state.
|
|
45
|
+
6. **Don't overreach.** The user will act on this. Leave an open question open rather than fill it with a confident guess.
|
|
46
|
+
|
|
47
|
+
## Output Format
|
|
48
|
+
|
|
49
|
+
Write for the user, in this exact structure:
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### The Question
|
|
54
|
+
|
|
55
|
+
Restate the user's question in one or two sentences.
|
|
56
|
+
|
|
57
|
+
### The Code in Question
|
|
58
|
+
|
|
59
|
+
File paths, line ranges, key symbols. Two or three lines to orient a cold reader.
|
|
60
|
+
|
|
61
|
+
### What We Found
|
|
62
|
+
|
|
63
|
+
Claims with textual evidence, each quoted or paraphrased and cited precisely:
|
|
64
|
+
|
|
65
|
+
- **[Direct]** {Claim}. Source: [PR #123](url) / ticket ID / file:line. {Brief quote or paraphrase.}
|
|
66
|
+
- **[Supported]** {Claim}. Evidence: {list of items and what each contributes}.
|
|
67
|
+
|
|
68
|
+
`[Direct]` is single-source, explicit evidence. `[Supported]` is multiple indirect items converging on a conclusion.
|
|
69
|
+
|
|
70
|
+
### What We Can Reasonably Infer
|
|
71
|
+
|
|
72
|
+
Claims stated nowhere but well-supported by indirect evidence. Each bullet must make the inference chain visible ("Given A and B, it's likely that C") and must use hedged language ("appears to", "likely", "suggests", "is consistent with"):
|
|
73
|
+
|
|
74
|
+
- **[Inferred]** {Hedged claim}. Reasoning: {the specific evidence and the inference step}.
|
|
75
|
+
|
|
76
|
+
Skip this section if there's nothing to infer.
|
|
77
|
+
|
|
78
|
+
### Competing Hypotheses
|
|
79
|
+
|
|
80
|
+
If the evidence fits multiple stories, present each. Don't force a winner the record doesn't support. For each hypothesis:
|
|
81
|
+
|
|
82
|
+
- **Hypothesis:** {one-sentence statement}
|
|
83
|
+
- **Evidence for:** {specific items}
|
|
84
|
+
- **Evidence against or missing:** {what would need to be true but isn't, or what counter-signals exist}
|
|
85
|
+
|
|
86
|
+
Skip this section if there's a single clear answer.
|
|
87
|
+
|
|
88
|
+
### What We Don't Know
|
|
89
|
+
|
|
90
|
+
Specific gaps: "We searched the issue tracker for [query1], [query2], [query3] and found no issue discussing the rate-limit threshold", not "We don't know why." Include:
|
|
91
|
+
|
|
92
|
+
- Questions that went unanswered
|
|
93
|
+
- Searches that returned nothing
|
|
94
|
+
- Sources that were unavailable, and why (such as a missing real-time team chat MCP)
|
|
95
|
+
- People who would likely know but whom you can't ask
|
|
96
|
+
|
|
97
|
+
### Sources Consulted
|
|
98
|
+
|
|
99
|
+
What was actually searched, so the user can judge coverage and redirect:
|
|
100
|
+
|
|
101
|
+
- **Source control history**: {file paths}, {number of commits reviewed}, PRs #{numbers}, and code comments searched. Or "Not searched. This should not happen because git and `gh` are always expected."
|
|
102
|
+
- **Issue / ticket tracker**: {ticket IDs and keyword searches}. Or "Not searched. No matching MCP available in this environment."
|
|
103
|
+
- **Long-form documents**: {page titles and search queries}. Or "Not searched. No matching MCP available in this environment."
|
|
104
|
+
- **Real-time team chat**: {channels searched, date ranges, queries}. Or "Not searched. No matching MCP available in this environment."
|
|
105
|
+
- **Infrastructure observability**: {dashboards, monitors, metrics, logs, traces, or incidents searched}. Or "Not searched. No matching MCP available in this environment."
|
|
106
|
+
- **Error / exception tracking**: {issues, events, or releases searched}. Or "Not searched. No matching MCP available in this environment."
|
|
107
|
+
- **Product analytics warehouse**: {fully-qualified tables queried, the time windows, and the numeric summaries (counts, percentiles, first/last-seen timestamps) that bore on the question}. Or "Not searched. No matching MCP available in this environment."
|
|
108
|
+
|
|
109
|
+
### Confidence Summary
|
|
110
|
+
|
|
111
|
+
One or two sentences on overall confidence, e.g.:
|
|
112
|
+
|
|
113
|
+
> "The core rationale (A) is well-supported by direct PR and ticket evidence. The specific threshold value (100) is inferred from the surrounding context but not explicitly documented. The question of whether this was driven by a customer request could not be answered. No relevant issue tracker or long-form doc content surfaced, and real-time team chat search was unavailable."
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Quality Check Before Returning
|
|
118
|
+
|
|
119
|
+
Revise if any item fails:
|
|
120
|
+
|
|
121
|
+
1. Does every claim in "What We Found" have a citation? If not, add one or move it to "Inferred" or "Hypotheses."
|
|
122
|
+
2. Is the phrasing tier-appropriate? (Direct claims can use "because". Inferred claims cannot.)
|
|
123
|
+
3. Did you surface every contradiction you noticed, or quietly pick one?
|
|
124
|
+
4. Does "What We Don't Know" name specific gaps? If it's empty or missing, be suspicious. Historical investigations almost always have gaps.
|
|
125
|
+
5. Did you check any hypothesis embedded in the question against the evidence rather than rubber-stamp it?
|
|
126
|
+
6. Did you cite code as evidence for its own intent? Remove it. Code is mechanics, not motivation.
|
|
127
|
+
7. Is the tone calibrated? A confident-sounding answer on weak evidence is the exact failure this skill exists to prevent.
|
|
128
|
+
|
|
129
|
+
The value of this output is its honesty, not its authority. A reader who takes it to the original author, an engineering lead, or a product manager should know what's known, what's inferred, and what's missing, so they can ask the right follow-up questions. Optimize for being useful, not for looking decisive.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# dsh-pstack bundle patch.
|
|
2
|
+
#
|
|
3
|
+
# Two rows, both installed by this package:
|
|
4
|
+
# - `pstack` mounts the bundled skill provider. Every pstack skill becomes a
|
|
5
|
+
# normal DSH skill: model-invocable skills reach the catalog, user-invocable
|
|
6
|
+
# skills reach the `/` menu.
|
|
7
|
+
# - `pstack-subagent` mounts the `pstack_subagent` tool, the DSH replacement
|
|
8
|
+
# for Cursor's `Task` tool. It resolves pstack role lines from
|
|
9
|
+
# `~/.dsh/pstack-models.md` and delegates through `ctx.subagents`.
|
|
10
|
+
#
|
|
11
|
+
# The `pstack` row requires `ctx.skills`, which `@deepseek-ai/dsh-base` provides.
|
|
12
|
+
# The `pstack-subagent` row requires `ctx.tools` and `ctx.subagents`, also in
|
|
13
|
+
# base-backed profiles. Installing this bundle into a profile that lacks them
|
|
14
|
+
# leaves the rows pending, exactly like any other dependency-driven plugin.
|
|
15
|
+
- insert:
|
|
16
|
+
- id: pstack
|
|
17
|
+
name: "dsh-pstack"
|
|
18
|
+
|
|
19
|
+
- id: pstack-subagent
|
|
20
|
+
name: "dsh-pstack/subagent"
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "@deepseek-ai/dsh-skill";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
//#region src/provider.d.ts
|
|
4
|
+
export declare const name = "pstack";
|
|
5
|
+
interface Config {
|
|
6
|
+
/** Extra skill directories to serve in addition to the bundled set. */
|
|
7
|
+
readonly extraSkillDirectories?: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare const inject: string[];
|
|
10
|
+
export declare function apply(ctx: Context, config?: Config): void;
|
|
11
|
+
/** Absolute root of the generated skill tree, exported for doctor checks. */
|
|
12
|
+
export declare const skillsRoot: string;
|
|
13
|
+
export declare const skillsRootUrl: import("node:url").URL;
|
|
14
|
+
//#endregion
|
|
15
|
+
export type { Config };
|
|
16
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { n as SKILLS_ROOT, r as SKILLS_ROOT_URL } from "./paths-Bbai4CaT.mjs";
|
|
2
|
+
import { readFileSync, readdirSync } from "node:fs";
|
|
3
|
+
import { BUNDLED_SKILL_RANK } from "@deepseek-ai/dsh-skill";
|
|
4
|
+
//#region src/frontmatter.ts
|
|
5
|
+
const DELIMITER = "---";
|
|
6
|
+
function unquote(value) {
|
|
7
|
+
const trimmed = value.trim();
|
|
8
|
+
if (trimmed.length >= 2) {
|
|
9
|
+
const first = trimmed[0];
|
|
10
|
+
const last = trimmed[trimmed.length - 1];
|
|
11
|
+
if (first === "\"" && last === "\"" || first === "'" && last === "'") {
|
|
12
|
+
const inner = trimmed.slice(1, -1);
|
|
13
|
+
return first === "\"" ? inner.replace(/\\"/g, "\"").replace(/\\n/g, "\n").replace(/\\\\/g, "\\") : inner.replace(/''/g, "'");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return trimmed;
|
|
17
|
+
}
|
|
18
|
+
function parseFrontmatter(source) {
|
|
19
|
+
const normalized = source.replace(/\r\n/g, "\n");
|
|
20
|
+
const lines = normalized.split("\n");
|
|
21
|
+
if (lines[0]?.trim() !== DELIMITER) return {
|
|
22
|
+
data: {},
|
|
23
|
+
body: normalized
|
|
24
|
+
};
|
|
25
|
+
let end = -1;
|
|
26
|
+
for (let index = 1; index < lines.length; index += 1) if (lines[index]?.trim() === DELIMITER) {
|
|
27
|
+
end = index;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
if (end === -1) return {
|
|
31
|
+
data: {},
|
|
32
|
+
body: normalized
|
|
33
|
+
};
|
|
34
|
+
const data = {};
|
|
35
|
+
let index = 1;
|
|
36
|
+
while (index < end) {
|
|
37
|
+
const line = lines[index] ?? "";
|
|
38
|
+
const match = /^([A-Za-z0-9_-]+):\s*(.*)$/.exec(line);
|
|
39
|
+
if (!match) {
|
|
40
|
+
index += 1;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const key = match[1];
|
|
44
|
+
const rawValue = match[2] ?? "";
|
|
45
|
+
index += 1;
|
|
46
|
+
if (rawValue === ">" || rawValue === ">-" || rawValue === "|" || rawValue === "|-") {
|
|
47
|
+
const folded = rawValue.startsWith(">");
|
|
48
|
+
const collected = [];
|
|
49
|
+
while (index < end) {
|
|
50
|
+
const next = lines[index] ?? "";
|
|
51
|
+
if (next.trim() !== "" && !/^\s/.test(next)) break;
|
|
52
|
+
collected.push(next.replace(/^\s{1,4}/, ""));
|
|
53
|
+
index += 1;
|
|
54
|
+
}
|
|
55
|
+
data[key] = folded ? collected.join(" ").replace(/\s+/g, " ").trim() : collected.join("\n").replace(/\n+$/, "");
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (rawValue === "") {
|
|
59
|
+
const collected = [];
|
|
60
|
+
while (index < end) {
|
|
61
|
+
const next = lines[index] ?? "";
|
|
62
|
+
if (next.trim() !== "" && !/^\s/.test(next)) break;
|
|
63
|
+
collected.push(next.trim());
|
|
64
|
+
index += 1;
|
|
65
|
+
}
|
|
66
|
+
data[key] = collected.join(" ").trim();
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
data[key] = unquote(rawValue);
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
data,
|
|
73
|
+
body: lines.slice(end + 1).join("\n").replace(/^\n+/, "")
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/provider.ts
|
|
78
|
+
/**
|
|
79
|
+
* Bundled pstack skill provider.
|
|
80
|
+
*
|
|
81
|
+
* One provider hosts every pstack skill so the catalog stays one entry per
|
|
82
|
+
* skill and the package ships as a single installable bundle. The provider is
|
|
83
|
+
* immutable: `assets/skills/` is generated at build time, so discovery always
|
|
84
|
+
* completes with the same list.
|
|
85
|
+
*/
|
|
86
|
+
const PROVIDER_NAME = "pstack";
|
|
87
|
+
function text(value) {
|
|
88
|
+
return (value ?? "").trim();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Parse one generated SKILL.md into the catalog entry the provider serves.
|
|
92
|
+
* Generated files always carry `name` and `description`; a hand-edit that
|
|
93
|
+
* removes them fails loudly instead of silently dropping the skill.
|
|
94
|
+
*/
|
|
95
|
+
function toEntry(directory, source) {
|
|
96
|
+
const { data } = parseFrontmatter(source);
|
|
97
|
+
if (!text(data.name) || !text(data.description)) throw new Error(`pstack skill "${directory}" is missing name or description frontmatter`);
|
|
98
|
+
return {
|
|
99
|
+
name: text(data.name),
|
|
100
|
+
description: text(data.description),
|
|
101
|
+
modelInvocable: data["disable-model-invocation"] !== "true",
|
|
102
|
+
userInvocable: data["user-invocable"] !== "false",
|
|
103
|
+
directory
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function resourceBase(directory) {
|
|
107
|
+
return {
|
|
108
|
+
kind: "directory",
|
|
109
|
+
path: `${SKILLS_ROOT}${directory}/`
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function toCandidate(entry) {
|
|
113
|
+
return {
|
|
114
|
+
name: entry.name,
|
|
115
|
+
description: entry.description,
|
|
116
|
+
invocation: {
|
|
117
|
+
modelInvocable: entry.modelInvocable,
|
|
118
|
+
userInvocable: entry.userInvocable
|
|
119
|
+
},
|
|
120
|
+
provider: PROVIDER_NAME,
|
|
121
|
+
source: "bundled",
|
|
122
|
+
rank: BUNDLED_SKILL_RANK,
|
|
123
|
+
resourceBase: resourceBase(entry.directory),
|
|
124
|
+
locator: entry.directory,
|
|
125
|
+
path: `${SKILLS_ROOT}${entry.directory}/SKILL.md`
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function createProvider(options) {
|
|
129
|
+
const read = options.read ?? ((directory) => readFileSync(`${SKILLS_ROOT}${directory}/SKILL.md`, "utf8"));
|
|
130
|
+
const entries = options.directories.map((directory) => toEntry(directory, read(directory)));
|
|
131
|
+
const byName = new Map(entries.map((entry) => [entry.name, entry]));
|
|
132
|
+
const load = (entry) => {
|
|
133
|
+
const { body } = parseFrontmatter(read(entry.directory));
|
|
134
|
+
return {
|
|
135
|
+
name: entry.name,
|
|
136
|
+
description: entry.description,
|
|
137
|
+
invocation: {
|
|
138
|
+
modelInvocable: entry.modelInvocable,
|
|
139
|
+
userInvocable: entry.userInvocable
|
|
140
|
+
},
|
|
141
|
+
provider: PROVIDER_NAME,
|
|
142
|
+
source: "bundled",
|
|
143
|
+
resourceBase: resourceBase(entry.directory),
|
|
144
|
+
path: `${SKILLS_ROOT}${entry.directory}/SKILL.md`,
|
|
145
|
+
content: body
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
return {
|
|
149
|
+
name: PROVIDER_NAME,
|
|
150
|
+
list: async () => entries.map(toCandidate),
|
|
151
|
+
get: async (candidate) => {
|
|
152
|
+
const entry = byName.get(candidate.name);
|
|
153
|
+
return entry ? load(entry) : void 0;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
const name = "pstack";
|
|
158
|
+
const inject = ["skills"];
|
|
159
|
+
function listBundledSkillDirectories() {
|
|
160
|
+
return readdirSync(SKILLS_ROOT, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort();
|
|
161
|
+
}
|
|
162
|
+
function apply(ctx, config = {}) {
|
|
163
|
+
const directories = [.../* @__PURE__ */ new Set([...listBundledSkillDirectories(), ...config.extraSkillDirectories ?? []])];
|
|
164
|
+
ctx.skills.registerProvider(() => createProvider({ directories }));
|
|
165
|
+
}
|
|
166
|
+
/** Absolute root of the generated skill tree, exported for doctor checks. */
|
|
167
|
+
const skillsRoot = SKILLS_ROOT;
|
|
168
|
+
const skillsRootUrl = SKILLS_ROOT_URL;
|
|
169
|
+
//#endregion
|
|
170
|
+
export { apply, inject, name, skillsRoot, skillsRootUrl };
|
|
171
|
+
|
|
172
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/frontmatter.ts","../src/provider.ts"],"sourcesContent":["/**\n * The pstack SKILL.md frontmatter subset: plain scalars, quoted scalars, and\n * folded or literal block scalars. Kept dependency-free so the plugin can be\n * imported at boot before any optional parser is available.\n */\n\nexport interface Frontmatter {\n data: Record<string, string>;\n body: string;\n}\n\nconst DELIMITER = \"---\";\n\nfunction unquote(value: string): string {\n const trimmed = value.trim();\n if (trimmed.length >= 2) {\n const first = trimmed[0];\n const last = trimmed[trimmed.length - 1];\n if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\")) {\n const inner = trimmed.slice(1, -1);\n return first === '\"'\n ? inner.replace(/\\\\\"/g, '\"').replace(/\\\\n/g, \"\\n\").replace(/\\\\\\\\/g, \"\\\\\")\n : inner.replace(/''/g, \"'\");\n }\n }\n return trimmed;\n}\n\nexport function parseFrontmatter(source: string): Frontmatter {\n const normalized = source.replace(/\\r\\n/g, \"\\n\");\n const lines = normalized.split(\"\\n\");\n if (lines[0]?.trim() !== DELIMITER) return { data: {}, body: normalized };\n\n let end = -1;\n for (let index = 1; index < lines.length; index += 1) {\n if (lines[index]?.trim() === DELIMITER) {\n end = index;\n break;\n }\n }\n if (end === -1) return { data: {}, body: normalized };\n\n const data: Record<string, string> = {};\n let index = 1;\n while (index < end) {\n const line = lines[index] ?? \"\";\n const match = /^([A-Za-z0-9_-]+):\\s*(.*)$/.exec(line);\n if (!match) {\n index += 1;\n continue;\n }\n const key = match[1]!;\n const rawValue = match[2] ?? \"\";\n index += 1;\n\n if (rawValue === \">\" || rawValue === \">-\" || rawValue === \"|\" || rawValue === \"|-\") {\n const folded = rawValue.startsWith(\">\");\n const collected: string[] = [];\n while (index < end) {\n const next = lines[index] ?? \"\";\n if (next.trim() !== \"\" && !/^\\s/.test(next)) break;\n collected.push(next.replace(/^\\s{1,4}/, \"\"));\n index += 1;\n }\n data[key] = folded\n ? collected.join(\" \").replace(/\\s+/g, \" \").trim()\n : collected.join(\"\\n\").replace(/\\n+$/, \"\");\n continue;\n }\n\n if (rawValue === \"\") {\n const collected: string[] = [];\n while (index < end) {\n const next = lines[index] ?? \"\";\n if (next.trim() !== \"\" && !/^\\s/.test(next)) break;\n collected.push(next.trim());\n index += 1;\n }\n data[key] = collected.join(\" \").trim();\n continue;\n }\n\n data[key] = unquote(rawValue);\n }\n\n return {\n data,\n body: lines\n .slice(end + 1)\n .join(\"\\n\")\n .replace(/^\\n+/, \"\"),\n };\n}\n","/**\n * Bundled pstack skill provider.\n *\n * One provider hosts every pstack skill so the catalog stays one entry per\n * skill and the package ships as a single installable bundle. The provider is\n * immutable: `assets/skills/` is generated at build time, so discovery always\n * completes with the same list.\n */\nimport { readdirSync, readFileSync } from \"node:fs\";\nimport type { Context } from \"@deepseek-ai/cordis\";\nimport {\n BUNDLED_SKILL_RANK,\n type SkillCandidate,\n type SkillDefinition,\n type SkillProvider,\n} from \"@deepseek-ai/dsh-skill\";\nimport { parseFrontmatter } from \"./frontmatter.ts\";\nimport { SKILLS_ROOT, SKILLS_ROOT_URL } from \"./paths.ts\";\n\nexport interface PstackSkillEntry {\n readonly name: string;\n readonly description: string;\n readonly modelInvocable: boolean;\n readonly userInvocable: boolean;\n readonly directory: string;\n}\n\nexport const PROVIDER_NAME = \"pstack\";\n\nfunction text(value: string | undefined): string {\n return (value ?? \"\").trim();\n}\n\n/**\n * Parse one generated SKILL.md into the catalog entry the provider serves.\n * Generated files always carry `name` and `description`; a hand-edit that\n * removes them fails loudly instead of silently dropping the skill.\n */\nexport function toEntry(directory: string, source: string): PstackSkillEntry {\n const { data } = parseFrontmatter(source);\n if (!text(data.name) || !text(data.description)) {\n throw new Error(`pstack skill \"${directory}\" is missing name or description frontmatter`);\n }\n return {\n name: text(data.name),\n description: text(data.description),\n modelInvocable: data[\"disable-model-invocation\"] !== \"true\",\n userInvocable: data[\"user-invocable\"] !== \"false\",\n directory,\n };\n}\n\nfunction resourceBase(directory: string) {\n return { kind: \"directory\" as const, path: `${SKILLS_ROOT}${directory}/` };\n}\n\nexport function toCandidate(entry: PstackSkillEntry): SkillCandidate {\n return {\n name: entry.name,\n description: entry.description,\n invocation: { modelInvocable: entry.modelInvocable, userInvocable: entry.userInvocable },\n provider: PROVIDER_NAME,\n source: \"bundled\",\n rank: BUNDLED_SKILL_RANK,\n resourceBase: resourceBase(entry.directory),\n locator: entry.directory,\n path: `${SKILLS_ROOT}${entry.directory}/SKILL.md`,\n };\n}\n\nexport interface PstackProviderOptions {\n /** Directory names to serve. The build passes the generated list. */\n readonly directories: readonly string[];\n /** Reads one skill body. Tests override it to avoid touching the package. */\n readonly read?: (directory: string) => string;\n}\n\nexport function createProvider(options: PstackProviderOptions): SkillProvider {\n const read =\n options.read ??\n ((directory: string) => readFileSync(`${SKILLS_ROOT}${directory}/SKILL.md`, \"utf8\"));\n const entries = options.directories.map((directory) => toEntry(directory, read(directory)));\n const byName = new Map(entries.map((entry) => [entry.name, entry]));\n\n const load = (entry: PstackSkillEntry): SkillDefinition => {\n const { body } = parseFrontmatter(read(entry.directory));\n return {\n name: entry.name,\n description: entry.description,\n invocation: { modelInvocable: entry.modelInvocable, userInvocable: entry.userInvocable },\n provider: PROVIDER_NAME,\n source: \"bundled\",\n resourceBase: resourceBase(entry.directory),\n path: `${SKILLS_ROOT}${entry.directory}/SKILL.md`,\n content: body,\n };\n };\n\n return {\n name: PROVIDER_NAME,\n list: async () => entries.map(toCandidate),\n get: async (candidate) => {\n const entry = byName.get(candidate.name);\n return entry ? load(entry) : undefined;\n },\n };\n}\n\nexport const name = \"pstack\";\n\nexport interface Config {\n /** Extra skill directories to serve in addition to the bundled set. */\n readonly extraSkillDirectories?: string[];\n}\n\nexport const inject = [\"skills\"];\n\nexport function listBundledSkillDirectories(): string[] {\n return readdirSync(SKILLS_ROOT, { withFileTypes: true })\n .filter((entry) => entry.isDirectory())\n .map((entry) => entry.name)\n .sort();\n}\n\nexport function apply(ctx: Context, config: Config = {}): void {\n const directories = [\n ...new Set([...listBundledSkillDirectories(), ...(config.extraSkillDirectories ?? [])]),\n ];\n ctx.skills.registerProvider(() => createProvider({ directories }));\n}\n\n/** Absolute root of the generated skill tree, exported for doctor checks. */\nexport const skillsRoot = SKILLS_ROOT;\nexport const skillsRootUrl = SKILLS_ROOT_URL;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
//#region src/paths.ts
|
|
3
|
+
/**
|
|
4
|
+
* Locate one pstack skill directory inside this package.
|
|
5
|
+
*
|
|
6
|
+
* The provider registers candidates from an explicit file list, so this helper
|
|
7
|
+
* resolves the directory the built entry point and the tests share.
|
|
8
|
+
*/
|
|
9
|
+
const SKILLS_ROOT_URL = new URL("../assets/skills/", import.meta.url);
|
|
10
|
+
const AGENTS_ROOT_URL = new URL("../assets/agents/", import.meta.url);
|
|
11
|
+
const SKILLS_ROOT = fileURLToPath(SKILLS_ROOT_URL);
|
|
12
|
+
const AGENTS_ROOT = fileURLToPath(AGENTS_ROOT_URL);
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SKILLS_ROOT as n, SKILLS_ROOT_URL as r, AGENTS_ROOT as t };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=paths-Bbai4CaT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths-Bbai4CaT.mjs","names":[],"sources":["../src/paths.ts"],"sourcesContent":["/**\n * Locate one pstack skill directory inside this package.\n *\n * The provider registers candidates from an explicit file list, so this helper\n * resolves the directory the built entry point and the tests share.\n */\nimport { fileURLToPath } from \"node:url\";\n\nexport const SKILLS_ROOT_URL = new URL(\"../assets/skills/\", import.meta.url);\nexport const AGENTS_ROOT_URL = new URL(\"../assets/agents/\", import.meta.url);\nexport const SKILLS_ROOT = fileURLToPath(SKILLS_ROOT_URL);\nexport const AGENTS_ROOT = fileURLToPath(AGENTS_ROOT_URL);\n"],"mappings":";;;;;;;;AAQA,MAAa,kBAAkB,IAAI,IAAI,qBAAqB,YAAY,GAAG;AAC3E,MAAa,kBAAkB,IAAI,IAAI,qBAAqB,YAAY,GAAG;AAC3E,MAAa,cAAc,cAAc,eAAe;AACxD,MAAa,cAAc,cAAc,eAAe"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ContentBlock, ReasoningEffortId } from "@deepseek-ai/dsh-llm";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import { Agent } from "@deepseek-ai/dsh-agent";
|
|
4
|
+
//#region src/roles.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* pstack role resolution.
|
|
7
|
+
*
|
|
8
|
+
* `~/.dsh/pstack-models.md` holds one role per line. The tool resolves a role
|
|
9
|
+
* into a child LLM route at call time, so edits apply to the next delegation
|
|
10
|
+
* without restarting the harness.
|
|
11
|
+
*
|
|
12
|
+
* Parsing never throws. A typo in one line must not break delegation, but it
|
|
13
|
+
* must also not disappear: `parseModelConfigWithIssues` collects `issues` and
|
|
14
|
+
* the parser keeps them so a caller can report the line that is wrong.
|
|
15
|
+
*/
|
|
16
|
+
interface Route {
|
|
17
|
+
readonly provider: string;
|
|
18
|
+
readonly model: string;
|
|
19
|
+
readonly reasoningEffort?: string;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/subagent.d.ts
|
|
23
|
+
export declare const name = "pstack-subagent";
|
|
24
|
+
export declare const inject: string[];
|
|
25
|
+
declare const AGENT_KINDS: readonly ["poteto-agent", "comment-sicko", "general"];
|
|
26
|
+
export type AgentKind = (typeof AGENT_KINDS)[number];
|
|
27
|
+
export interface Config {
|
|
28
|
+
/** Tool name exposed to the model. */
|
|
29
|
+
readonly toolName?: string;
|
|
30
|
+
/** Subagent provider registered on `ctx.subagents`. */
|
|
31
|
+
readonly provider?: string;
|
|
32
|
+
/** Default agent kind when the model omits `agent`. */
|
|
33
|
+
readonly defaultAgent?: AgentKind;
|
|
34
|
+
}
|
|
35
|
+
export declare function stripFrontmatter(source: string): string;
|
|
36
|
+
export declare function readAgentInstructions(kind: AgentKind): Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Build the child prompt. A pstack delegate must read `poteto-mode` first, and
|
|
39
|
+
* the parent normally passes its absolute path. When the parent omits it, this
|
|
40
|
+
* fallback keeps the delegate from drifting into general-purpose style.
|
|
41
|
+
*/
|
|
42
|
+
export declare function composePrompt(input: {
|
|
43
|
+
readonly kind: AgentKind;
|
|
44
|
+
readonly description: string;
|
|
45
|
+
readonly prompt: string;
|
|
46
|
+
readonly agentInstructions: string;
|
|
47
|
+
readonly potetoModePath?: string;
|
|
48
|
+
}): string;
|
|
49
|
+
export interface RoleResolution {
|
|
50
|
+
readonly route: Route | undefined;
|
|
51
|
+
/** Human-readable notes to append to the tool reply: issues, near misses. */
|
|
52
|
+
readonly notes: readonly string[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolve the `role` argument against the shipped role table, explaining a miss
|
|
56
|
+
* instead of swallowing it.
|
|
57
|
+
*
|
|
58
|
+
* A missing file is normal. A configured-but-unmatched role is not: it means a
|
|
59
|
+
* skill and `~/.dsh/pstack-models.md` disagree, and the child would silently run
|
|
60
|
+
* on the parent route. The tool reply says so, so the parent can fix the file or
|
|
61
|
+
* report the miss rather than believing the route applied.
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveRoleArg(role: string | undefined): Promise<RoleResolution>;
|
|
64
|
+
export interface PstackToolDeps {
|
|
65
|
+
readonly start: (input: {
|
|
66
|
+
readonly parent: Agent;
|
|
67
|
+
readonly label: string;
|
|
68
|
+
readonly prompt: ContentBlock[];
|
|
69
|
+
readonly signal: AbortSignal;
|
|
70
|
+
readonly route: Route | undefined;
|
|
71
|
+
readonly cwd: string | undefined;
|
|
72
|
+
}) => Promise<{
|
|
73
|
+
readonly childId: string;
|
|
74
|
+
}>;
|
|
75
|
+
readonly loadAgent: (kind: AgentKind) => Promise<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Resolve the `role` argument. The notes explain a miss so the reply can name
|
|
78
|
+
* it; an empty list means the route applied as written, or there was no role.
|
|
79
|
+
*/
|
|
80
|
+
readonly loadRole: (role: string | undefined) => Promise<RoleResolution>;
|
|
81
|
+
readonly potetoModePath?: string;
|
|
82
|
+
readonly defaultAgent?: AgentKind;
|
|
83
|
+
readonly toolName?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Turn a resolved role into the `agentOptions` a child activation carries.
|
|
87
|
+
*
|
|
88
|
+
* This is the only place a `Route` becomes a provider request. Keeping it a
|
|
89
|
+
* pure function lets a test assert the exact options without starting a child,
|
|
90
|
+
* which is where a role-to-route bug would otherwise stay invisible until a
|
|
91
|
+
* live delegation picked the wrong model.
|
|
92
|
+
*/
|
|
93
|
+
export declare function routeToAgentOptions(route: Route | undefined): {
|
|
94
|
+
provider: string;
|
|
95
|
+
model: string;
|
|
96
|
+
reasoningEffort?: ReasoningEffortId;
|
|
97
|
+
} | undefined;
|
|
98
|
+
/** Tool definition over injected dependencies; `apply` supplies the runtime. */
|
|
99
|
+
export declare function createPstackTool(deps: PstackToolDeps): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
100
|
+
/**
|
|
101
|
+
* Build the provider-facing activation request for one child.
|
|
102
|
+
*
|
|
103
|
+
* A role is resolved once, at delegation time, into concrete provider options.
|
|
104
|
+
* The child inherits the parent route when the role is absent or resolves to
|
|
105
|
+
* `inherit-parent`, which is why the field is omitted rather than set to a
|
|
106
|
+
* placeholder.
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildActivationRequest(input: {
|
|
109
|
+
readonly parent: Agent;
|
|
110
|
+
readonly prompt: ContentBlock[];
|
|
111
|
+
readonly route: Route | undefined;
|
|
112
|
+
readonly cwd: string | undefined;
|
|
113
|
+
}): {
|
|
114
|
+
parent: Agent;
|
|
115
|
+
prompt: ContentBlock[];
|
|
116
|
+
cwd?: string;
|
|
117
|
+
agentOptions?: {
|
|
118
|
+
provider: string;
|
|
119
|
+
model: string;
|
|
120
|
+
reasoningEffort?: ReasoningEffortId;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Mount the tool. `ctx.subagents` owns child lifecycle; this row only supplies
|
|
125
|
+
* the pstack-specific shape (agent preambles and role routes) on top.
|
|
126
|
+
*/
|
|
127
|
+
export declare function apply(ctx: Context, config?: Config): void;
|
|
128
|
+
//#endregion
|
|
129
|
+
export {};
|
|
130
|
+
//# sourceMappingURL=subagent.d.mts.map
|