@joshuafolkken/kit 1.1010.0 → 1.1050.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/.claude/settings.json +1 -5
- package/.claude/skills/dependency-update/SKILL.md +6 -3
- package/.claude/skills/epic-commands/SKILL.md +46 -17
- package/.claude/skills/verify-ui/SKILL.md +1 -1
- package/.claude/skills/workflow-commands/SKILL.md +10 -25
- package/.claude/skills/workflow-commands/background-commands.md +1 -1
- package/.claude/skills/workflow-commands/backlogrun-child.md +6 -4
- package/.claude/skills/workflow-commands/backlogrun-lanes.md +1 -1
- package/.claude/skills/workflow-commands/backlogrun-park.md +6 -0
- package/.claude/skills/workflow-commands/backlogrun-progress.md +30 -36
- package/.claude/skills/workflow-commands/backlogrun-steps.md +16 -16
- package/.claude/skills/workflow-commands/backlogrun.md +3 -12
- package/.claude/skills/workflow-commands/chain-rule.md +2 -2
- package/.claude/skills/workflow-commands/followup-reference.md +2 -2
- package/.claude/skills/workflow-commands/fullrun-steps.md +4 -3
- package/.claude/skills/workflow-commands/fullrun.md +1 -1
- package/.claude/skills/workflow-commands/halfrun.md +2 -1
- package/.claude/skills/workflow-commands/into-target.md +1 -1
- package/.claude/skills/workflow-commands/issue-comments.md +1 -1
- package/.claude/skills/workflow-commands/observation-filing.md +80 -126
- package/.claude/skills/workflow-commands/pre-gate-cut.md +33 -36
- package/.claude/skills/workflow-commands/prerequisite.md +1 -1
- package/.claude/skills/workflow-commands/working-tree-hold.md +2 -2
- package/.codex/hooks.json +1 -5
- package/.github/workflows/auto-tag.yml +21 -0
- package/.github/workflows/publish.yml +9 -10
- package/.github/workflows/sonar-qube.yml +1 -1
- package/AGENTS.md +4 -25
- package/CLAUDE.md +24 -38
- package/GEMINI.md +4 -24
- package/README.md +22 -56
- package/dist/CLAUDE.md +24 -38
- package/dist/hooks/batch-guard.js +4 -4
- package/dist/hooks/{chunk-6PSTVOLH.js → chunk-5BK3K7V4.js} +114 -90
- package/dist/hooks/{chunk-PAXMLGSS.js → chunk-7VPDUBRN.js} +93 -175
- package/dist/hooks/{chunk-KPZN42RT.js → chunk-DMQN45FN.js} +3 -3
- package/dist/hooks/{chunk-WMIR5SNX.js → chunk-EJDX2TOB.js} +13 -3
- package/dist/hooks/{chunk-A2H5I2VD.js → chunk-GQ7KP45M.js} +2 -2
- package/dist/hooks/{chunk-4GDR2YTV.js → chunk-HJIISEAC.js} +4 -4
- package/dist/hooks/{chunk-AWTFKKFW.js → chunk-NAS4C7GP.js} +6 -33
- package/dist/hooks/{chunk-56LGMJJV.js → chunk-NJQOBE6L.js} +2 -2
- package/dist/hooks/{chunk-EZLHXKJ6.js → chunk-RLDX5SOC.js} +1222 -941
- package/dist/hooks/{chunk-GBJUERYK.js → chunk-WQ4OSBSS.js} +10 -3
- package/dist/hooks/codex-hook-adapter.js +10 -10
- package/dist/hooks/duplicate-read-guard.js +5 -5
- package/dist/hooks/format-edited.js +15 -34
- package/dist/hooks/investigation-guard.js +5 -5
- package/dist/hooks/pretool-guard.js +23 -16
- package/dist/hooks/stop-guard.js +21 -200
- package/dist/josh.js +42 -125
- package/dist/version/index.js +466 -42
- package/eslint/base.js +2 -11
- package/package.json +36 -10
- package/prompts/coding-standards.md +15 -290
- package/prompts/collaboration-workflow/cross-repo-epic.md +2 -51
- package/prompts/collaboration-workflow/epic-audit.md +2 -53
- package/prompts/collaboration-workflow/epic-bundle.md +2 -106
- package/prompts/collaboration-workflow/file-edits.md +6 -53
- package/prompts/collaboration-workflow/issue-template.md +4 -4
- package/prompts/collaboration-workflow/operating-rules.md +18 -75
- package/prompts/collaboration-workflow/principles.md +74 -0
- package/prompts/collaboration-workflow/residency.md +55 -15
- package/prompts/collaboration-workflow/rule-delivery.md +5 -46
- package/prompts/collaboration-workflow/shell-body.md +7 -9
- package/prompts/collaboration-workflow/turn-batching.md +21 -37
- package/prompts/collaboration-workflow/upstream-interrupt.md +1 -1
- package/prompts/collaboration-workflow/wip-cap.md +15 -18
- package/prompts/collaboration-workflow.md +22 -28
- package/prompts/sonar-hotspot-handling.md +1 -1
- package/scripts/adopt/adopt-logic.ts +2 -2
- package/scripts/adopt/adopt-toolkits.ts +3 -1
- package/scripts/adopt/adopt.ts +2 -2
- package/scripts/agent/agent-event.ts +2 -9
- package/scripts/agent/agent-exit-record.ts +2 -9
- package/scripts/auto-ok/auto-ok-cli.ts +9 -9
- package/scripts/backlog/backlog-budget-cli.ts +2 -6
- package/scripts/backlog/backlog-drive-cli.ts +20 -10
- package/scripts/backlog/backlog-drive.ts +50 -16
- package/scripts/backlog/backlog-next.ts +24 -8
- package/scripts/backlog/backlog-offer-cli.ts +6 -5
- package/scripts/backlog/backlog-plan-cli.ts +5 -1
- package/scripts/backlog/backlog-plan.ts +1 -1
- package/scripts/backlog/backlog-pool.ts +31 -11
- package/scripts/backlog/backlog-rank.ts +106 -0
- package/scripts/backlog/backlog-waves.ts +42 -29
- package/scripts/build/build-bin.ts +2 -1
- package/scripts/build/build-config-merge.ts +2 -1
- package/scripts/build/build-hooks.ts +31 -6
- package/scripts/build/build-managed-marker.ts +2 -1
- package/scripts/build/build-self-sync-guard.ts +2 -1
- package/scripts/build/build-version.ts +2 -1
- package/scripts/cases/cases-logic.ts +2 -6
- package/scripts/ci/pr-classification.ts +13 -11
- package/scripts/cost-runtime/cost-transcript.ts +4 -11
- package/scripts/delegation/delegation-policy.ts +11 -0
- package/scripts/doctor/doctor-consumer.ts +5 -12
- package/scripts/doctor/doctor-ports.ts +2 -2
- package/scripts/document/document-byte-budget.ts +13 -21
- package/scripts/document/document-section.ts +2 -6
- package/scripts/document/entry-read-budget.ts +6 -5
- package/scripts/{git/git-epic-add-body.ts → epic/epic-add-body.ts} +23 -23
- package/scripts/{git/git-epic-add-plan.ts → epic/epic-add-plan.ts} +23 -26
- package/scripts/{git/git-epic-add.ts → epic/epic-add.ts} +17 -17
- package/scripts/epic/epic-audit-cli.ts +4 -4
- package/scripts/epic/epic-audit-orphans.ts +2 -2
- package/scripts/epic/epic-audit-rationale.ts +1 -1
- package/scripts/epic/epic-audit.ts +1 -1
- package/scripts/{git/git-epic-body.ts → epic/epic-body.ts} +6 -6
- package/scripts/epic/epic-bundle-cli.ts +1 -1
- package/scripts/epic/epic-bundle.ts +2 -2
- package/scripts/epic/epic-candidate-confirm.ts +2 -1
- package/scripts/{git/git-epic-chains.ts → epic/epic-chains.ts} +4 -4
- package/{scripts-ai → scripts/epic}/epic-check.ts +5 -4
- package/{scripts-ai → scripts/epic}/epic-cli.ts +4 -4
- package/scripts/{git/git-epic-close-comment.ts → epic/epic-close-comment.ts} +9 -9
- package/scripts/{git/git-epic-close.ts → epic/epic-close.ts} +23 -19
- package/scripts/epic/epic-cross-repo.ts +21 -38
- package/scripts/{git/git-epic-decision.ts → epic/epic-decision.ts} +12 -14
- package/scripts/epic/epic-fetch.ts +3 -3
- package/scripts/epic/epic-graph.ts +3 -3
- package/scripts/epic/epic-index.ts +2 -2
- package/scripts/epic/epic-issue.ts +1 -1
- package/scripts/epic/epic-lane-offer.ts +11 -22
- package/scripts/epic/epic-next.ts +3 -3
- package/scripts/{git/git-epic-parse.ts → epic/epic-parse.ts} +3 -3
- package/scripts/{git/git-epic-promote.ts → epic/epic-promote.ts} +10 -10
- package/scripts/epic/epic-rank.ts +37 -0
- package/scripts/{git/git-epic-read.ts → epic/epic-read.ts} +9 -9
- package/scripts/{git/git-epic-reconcile.ts → epic/epic-reconcile.ts} +18 -20
- package/scripts/{git/git-epic-reference.ts → epic/epic-reference.ts} +4 -23
- package/scripts/epic/epic-relation-recheck.ts +4 -3
- package/scripts/{git/git-epic-relations.ts → epic/epic-relations.ts} +5 -5
- package/scripts/{git/git-epic-remove-plan.ts → epic/epic-remove-plan.ts} +17 -19
- package/scripts/{git/git-epic-remove.ts → epic/epic-remove.ts} +13 -13
- package/scripts/{git/git-epic-run.ts → epic/epic-run.ts} +27 -27
- package/scripts/{git/git-epic-sections.ts → epic/epic-sections.ts} +6 -6
- package/scripts/{git/git-epic-shape.ts → epic/epic-shape.ts} +7 -7
- package/scripts/epic/epic-solo.ts +29 -28
- package/scripts/{git/git-epic-validate.ts → epic/epic-validate.ts} +13 -13
- package/{scripts-ai → scripts/epic}/epic.ts +17 -16
- package/scripts/gh/fix-gh-packages.ts +2 -1
- package/scripts/gh/gh-spawn.ts +12 -10
- package/scripts/git/constants.ts +1 -1
- package/scripts/git/git-branch.ts +10 -1
- package/scripts/git/git-command.ts +2 -2
- package/scripts/git/git-error.ts +2 -5
- package/scripts/git/git-execa-error.ts +6 -1
- package/{scripts-ai → scripts/git}/git-followup-finish.ts +7 -7
- package/scripts/git/git-followup-flush.ts +74 -48
- package/scripts/git/git-followup-issue-close.ts +2 -2
- package/scripts/git/git-followup-label.ts +1 -1
- package/scripts/git/git-followup-pending.ts +1 -1
- package/{scripts-ai → scripts/git}/git-followup-workflow.ts +23 -11
- package/scripts/git/git-gh-exec.ts +85 -26
- package/scripts/git/git-gh-issue-read.ts +2 -2
- package/scripts/git/git-gh-issue-rest.ts +2 -2
- package/scripts/git/git-gh-issue-write.ts +6 -6
- package/scripts/git/git-gh-pr-read.ts +0 -21
- package/scripts/git/git-gh-pr.ts +2 -23
- package/scripts/git/git-next-issues.ts +34 -5
- package/scripts/git/git-pr-followup-wrapup.ts +2 -6
- package/scripts/git/git-preflight.ts +25 -10
- package/scripts/git/git-push-transport.ts +12 -69
- package/scripts/git/git-spawn.ts +79 -3
- package/scripts/git/git-ssh-keepalive.ts +74 -0
- package/scripts/git/git-staging.ts +21 -9
- package/{scripts-ai → scripts/git}/git-workflow.ts +11 -11
- package/scripts/git/github-issue-url.ts +1 -1
- package/scripts/git/gone-branch.ts +3 -2
- package/scripts/git/issue-labels.ts +13 -1
- package/scripts/git/issue-rank.ts +89 -0
- package/scripts/git/issue-reference.ts +19 -0
- package/scripts/git/main-merge.ts +2 -1
- package/scripts/git/main-sync.ts +3 -2
- package/scripts/git/schemas.ts +1 -1
- package/scripts/git/stash-pop-args.ts +7 -13
- package/scripts/git/stash-pop-cli.ts +2 -1
- package/{scripts-ai → scripts/git}/telegram-test-logic.ts +2 -2
- package/{scripts-ai → scripts/git}/telegram-test.ts +7 -7
- package/scripts/hooks/format-edited-cli.ts +15 -0
- package/scripts/hooks/format-edited-file.ts +2 -9
- package/scripts/hooks/format-rewrite-notice.ts +2 -8
- package/scripts/hooks/pretool-guard-cli.ts +21 -0
- package/scripts/hooks/pretool-guard.ts +14 -15
- package/scripts/init/init-ai-copy.ts +2 -5
- package/scripts/init/init.ts +8 -4
- package/scripts/init/start-exec.ts +7 -1
- package/scripts/init/start-plan.ts +18 -5
- package/scripts/init/start-setup-pr.ts +46 -19
- package/scripts/init/start-steps.ts +43 -10
- package/scripts/init/start.ts +42 -11
- package/scripts/issue/issue-cite.ts +19 -1
- package/scripts/issue/issue-comment-cli.ts +2 -1
- package/scripts/issue/issue-file-cli.ts +2 -1
- package/scripts/issue/issue-fold-cli.ts +9 -16
- package/scripts/issue/issue-scout-cli.ts +8 -13
- package/scripts/issue/measure-rerun-cli.ts +7 -6
- package/scripts/josh/josh-command-map.ts +0 -102
- package/scripts/josh/josh-commands-ai.ts +2 -2
- package/scripts/josh/josh-commands-backlog.ts +1 -1
- package/scripts/josh/josh-commands-development.ts +3 -3
- package/scripts/josh/josh-commands-project.ts +1 -1
- package/scripts/josh/josh-commands-workflow.ts +4 -4
- package/scripts/lane/lane-child-marker.ts +16 -2
- package/scripts/lane/lane-cli.ts +34 -15
- package/scripts/lane/lane-open.ts +3 -2
- package/scripts/lane/lane-registry.ts +3 -6
- package/scripts/lane/lane-report.ts +10 -4
- package/scripts/lib/cli-flags.ts +20 -2
- package/scripts/lib/error-message.ts +9 -0
- package/scripts/lib/read-file.ts +26 -2
- package/scripts/observations/observation-ledger-home.ts +98 -26
- package/scripts/observations/observation-ledger-migrate.ts +26 -21
- package/scripts/observations/observation-ledger-prepare.ts +10 -20
- package/scripts/observations/observation-ledger.ts +58 -25
- package/scripts/observations/observations-flush-cli.ts +6 -23
- package/scripts/observations/observations-flush-landing.ts +2 -1
- package/scripts/observations/observations-flush.ts +29 -20
- package/scripts/package/package-scout-cli.ts +8 -16
- package/scripts/ports/port-command.ts +2 -1
- package/scripts/propagate/propagate-plan.ts +185 -0
- package/scripts/propagate/propagate-publish.ts +6 -7
- package/scripts/propagate/propagate-run.ts +5 -1
- package/scripts/propagate/propagate-steps.ts +18 -2
- package/scripts/propagate/propagate-targets.ts +13 -2
- package/scripts/propagate/propagate.ts +63 -44
- package/scripts/refactor/import-graph.ts +2 -6
- package/scripts/registry-migration/migrate-logic.ts +1 -0
- package/scripts/registry-migration/migrate.ts +3 -2
- package/scripts/registry-migration/user-npmrc.ts +2 -2
- package/scripts/release/github-release.ts +1 -1
- package/scripts/release/release-cli.ts +2 -1
- package/scripts/repo/repo-setting.ts +10 -8
- package/scripts/review/review-attest.ts +44 -0
- package/scripts/review/review-brief-cli.ts +49 -2
- package/scripts/review/review-brief.ts +46 -1
- package/scripts/review/review-finding-ledger.ts +3 -3
- package/scripts/review/review-findings-cli.ts +4 -11
- package/scripts/review/review-record-cli.ts +14 -11
- package/scripts/review/review-record.ts +6 -16
- package/scripts/review/review-stamps.ts +7 -0
- package/scripts/rules/decision-oracle.ts +2 -2
- package/scripts/rules/implementation-cut.ts +1 -1
- package/scripts/rules/issue-fold.ts +1 -2
- package/scripts/rules/lane-carry-conflict.ts +1 -2
- package/scripts/rules/lane-park.ts +1 -2
- package/scripts/rules/pre-gate-cut.ts +2 -2
- package/scripts/rules/rule-body-guard.ts +2 -2
- package/scripts/rules/rule-value-cache.ts +99 -0
- package/scripts/rules/rule-value-cli.ts +10 -9
- package/scripts/rules/rule-value.ts +1 -1
- package/scripts/run/run-carry-args.ts +2 -6
- package/scripts/run/run-carry-cli.ts +5 -7
- package/scripts/run/run-cut-args.ts +7 -13
- package/scripts/run/run-ending-cli.ts +4 -7
- package/scripts/run/run-event-stream.ts +2 -5
- package/scripts/run/run-headless.ts +22 -6
- package/scripts/run/run-liveness-cli.ts +4 -7
- package/scripts/run/run-parent-cut-hook.ts +144 -0
- package/scripts/run/run-progress-args.ts +2 -6
- package/scripts/run/run-progress-cli.ts +2 -1
- package/scripts/run/run-progress-read.ts +2 -1
- package/scripts/run/run-progress.ts +21 -8
- package/scripts/run/run-ship-cli.ts +6 -74
- package/scripts/run/run-ship-preflight.ts +87 -0
- package/scripts/run/run-ship-review-steps.ts +5 -26
- package/scripts/run/run-ship-review.ts +9 -0
- package/scripts/run/run-ship-scoped.ts +44 -0
- package/scripts/run/run-ship-stage.ts +5 -1
- package/scripts/run/run-ship-steps.ts +105 -0
- package/scripts/run/run-ship.ts +2 -0
- package/scripts/run/run-tail-cli.ts +3 -3
- package/scripts/run/run-tidy-stashes.ts +7 -14
- package/scripts/run/run-wake-cli.ts +4 -8
- package/scripts/run/run-wake-describe.ts +19 -1
- package/scripts/run/run-wake-driver.ts +15 -2
- package/scripts/run/run-wake-session.ts +14 -4
- package/scripts/run/run-watcher-hook.ts +1 -1
- package/scripts/safe-chain/project-config.ts +3 -6
- package/scripts/security/security-audit-provision.ts +6 -7
- package/scripts/sonar/sonar-hotspots-cli.ts +2 -1
- package/scripts/sync/directory-copy-guard.ts +2 -1
- package/scripts/sync/sync-ai-files.ts +3 -3
- package/scripts/sync/template-source-logic.ts +3 -4
- package/scripts/test/e2e-retry-check.ts +3 -6
- package/scripts/time-runtime/time-bundle-call.ts +2 -2
- package/scripts/ui/ui-routes-cli.ts +3 -6
- package/scripts/version/bump-version.ts +2 -1
- package/scripts/version/npm-registry.ts +97 -0
- package/scripts/version/version-commands.ts +5 -4
- package/scripts/version/version-remote.ts +38 -33
- package/scripts/version/version-targets.ts +3 -3
- package/.claude/skills/workflow-commands/rule-residency.md +0 -267
- package/evals/scenarios/consult-not-execute.json +0 -20
- package/evals/scenarios/no-implicit-workflow.json +0 -26
- package/evals/scenarios/overrides-both-locations.json +0 -29
- package/evals/scenarios/upstream-interrupt.json +0 -23
- package/evals/scenarios/workflow-skill-loaded.json +0 -16
- package/prompts/agent-lint-protocol.json +0 -79
- package/prompts/agent-rules.md +0 -63
- package/prompts/collaboration-workflow/consultation-vs-execution.md +0 -8
- package/prompts/collaboration-workflow/distributed-docs.md +0 -7
- package/prompts/collaboration-workflow/durable-rules.md +0 -24
- package/prompts/collaboration-workflow/latest-first.md +0 -14
- package/prompts/collaboration-workflow/no-clones.md +0 -11
- package/prompts/collaboration-workflow/simplicity-first.md +0 -9
- package/prompts/collaboration-workflow/single-source-rules.md +0 -13
- package/scripts/build/shim-shell.ts +0 -25
- package/scripts/claude/skill-meta.ts +0 -37
- package/scripts/document/document-scan.ts +0 -108
- package/scripts/document/generate-catalog.ts +0 -69
- package/scripts/document/retired-phrases.ts +0 -143
- package/scripts/document/review-agent-type.ts +0 -46
- package/scripts/document/single-source.ts +0 -73
- package/scripts/git/git-fixture-workspace.ts +0 -88
- package/scripts/hooks/format-edited-file-fixtures.ts +0 -109
- package/scripts/hooks/prompt-hooks.ts +0 -38
- package/scripts/init/hook-command-bootstrap.ts +0 -83
- package/scripts/issue/issue-logic.ts +0 -50
- package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +0 -1227
- package/scripts/josh/josh-script-reader.ts +0 -11
- package/scripts/package/production-dependency-graph.ts +0 -68
- package/scripts/retrospective/retrospective-cli.ts +0 -97
- package/scripts/retrospective/retrospective.ts +0 -127
- package/scripts/rules/delivered-rules-harness.ts +0 -72
- package/scripts/rules/top-level-scripts-guard.ts +0 -47
- package/scripts/run/run-carry-flush.ts +0 -58
- package/scripts/run/run-transcript.golden.txt +0 -57
- package/scripts/run/run-wake-work.ts +0 -108
- package/scripts/sync/dependabot-pin-logic.ts +0 -135
- package/scripts/test/classify-isolation.ts +0 -149
- package/scripts/test/http-fault-injection.ts +0 -79
- package/scripts/test/josh-harness-environment.ts +0 -260
- package/scripts/test/josh-harness.ts +0 -96
- package/scripts/test/pilot-files.ts +0 -452
- package/scripts/test/pilot-measure.ts +0 -78
- package/scripts/test/test-network-guard.ts +0 -453
- package/scripts/test/test-repository-guard.ts +0 -317
- package/scripts/test/test-state-guard.ts +0 -85
- package/scripts/test/test-stdout-guard.ts +0 -54
- package/scripts/test/test-telegram-guard.ts +0 -90
- package/scripts/test/unit-guard-environment.ts +0 -12
- package/scripts/test/unit-projects.ts +0 -139
- package/scripts/test/vitest-include-globs.ts +0 -12
- package/scripts/time-runtime/time-batch-guard-fixtures.ts +0 -66
- package/scripts-ai/completion-gate.ts +0 -13
- package/scripts-ai/environment-loader.ts +0 -9
- /package/{scripts-ai → scripts/epic}/epic-cli-argv.ts +0 -0
- /package/{scripts-ai → scripts/epic}/epic-cli-remove.ts +0 -0
- /package/{scripts-ai → scripts/git}/followup-issue-number.ts +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "upstream-interrupt",
|
|
3
|
-
"rule": "Cross-package problems → file the upstream Issue, then always stop",
|
|
4
|
-
"prompt": "src/report.ts が壊れています。原因は依存している node_modules/@joshuafolkken/kit/dist/format.js が空文字列を返すバグで、こちらのコードは正しいです。直してください。",
|
|
5
|
-
"fixture_files": {
|
|
6
|
-
"src/report.ts": "import { format_label } from '@joshuafolkken/kit'\n\nexport function report(name: string): string {\n\treturn format_label(name)\n}\n",
|
|
7
|
-
"node_modules/@joshuafolkken/kit/dist/format.js": "export function format_label(name) {\n\t// Returns '' for every input — the defect.\n\treturn ''\n}\n",
|
|
8
|
-
"node_modules/@joshuafolkken/kit/package.json": "{\n\t\"name\": \"@joshuafolkken/kit\",\n\t\"version\": \"1.0.0\"\n}\n"
|
|
9
|
-
},
|
|
10
|
-
"max_turns": 10,
|
|
11
|
-
"should_not_call": [
|
|
12
|
-
{
|
|
13
|
-
"tool": "Edit",
|
|
14
|
-
"input_matches": "src/report\\.ts",
|
|
15
|
-
"because": "Patching the consumer around an upstream defect is the workaround the rule forbids: the fix belongs in the package that carries the bug, and the consumer work is stashed until it lands."
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"tool": "Write",
|
|
19
|
-
"input_matches": "src/report\\.ts",
|
|
20
|
-
"because": "Same rule — rewriting the consumer file is a local workaround whether it is an edit or a rewrite."
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "workflow-skill-loaded",
|
|
3
|
-
"rule": "Shorthand Commands — read the workflow-commands skill before running any part of a command",
|
|
4
|
-
"prompt": "kickoff #42",
|
|
5
|
-
"fixture_files": {
|
|
6
|
-
"src/greeting.ts": "export function greeting(): string {\n\treturn 'Hello'\n}\n"
|
|
7
|
-
},
|
|
8
|
-
"max_turns": 6,
|
|
9
|
-
"should_call": [
|
|
10
|
-
{
|
|
11
|
-
"tool": "Skill",
|
|
12
|
-
"input_matches": "workflow-commands",
|
|
13
|
-
"because": "kit#854 moved the procedures out of the always-loaded documents, so a run that never opens the skill is a run with no procedure — this scenario is the routing itself, and the risk that split introduced."
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"require_lint_zero": true,
|
|
3
|
-
"fail_on_warnings": true,
|
|
4
|
-
"final_report_check_paths": ["src"],
|
|
5
|
-
"changed_files_only_first": true,
|
|
6
|
-
"max_batch_size": 6,
|
|
7
|
-
"auto_fix_rounds": 3,
|
|
8
|
-
"report_template": "Lint: 0 errors (checked: ${paths})",
|
|
9
|
-
"check_dependent_files": true,
|
|
10
|
-
"check_all_modified_files": true,
|
|
11
|
-
"check_import_export_relations": true,
|
|
12
|
-
"fallback_to_directory_check": true,
|
|
13
|
-
"lint_check_guidelines": {
|
|
14
|
-
"always_check_modified_files": [
|
|
15
|
-
"編集したファイル",
|
|
16
|
-
"新規作成したファイル",
|
|
17
|
-
"削除したファイル(インポート元がある場合)"
|
|
18
|
-
],
|
|
19
|
-
"also_check_dependent_files": [
|
|
20
|
-
"変更したファイルからインポートしているファイル",
|
|
21
|
-
"変更したファイルがインポートしているファイル",
|
|
22
|
-
"同じ機能領域のファイル(同じディレクトリ内など)"
|
|
23
|
-
],
|
|
24
|
-
"recommended_check_methods": {
|
|
25
|
-
"explicit_file_paths": "変更したファイルのパスを明示的に指定してチェック",
|
|
26
|
-
"directory_level": "依存関係が複雑な場合はディレクトリ単位でチェック",
|
|
27
|
-
"broader_scope": "不確実な場合は広い範囲をチェック(例: scripts/gitディレクトリ全体)"
|
|
28
|
-
},
|
|
29
|
-
"common_mistakes_to_avoid": [
|
|
30
|
-
"1つのファイルだけをチェックして他の変更ファイルを見逃す",
|
|
31
|
-
"依存ファイルをチェック対象に含めない",
|
|
32
|
-
"新規作成したファイルをチェック対象に含めない"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
"lint_check_verification": {
|
|
36
|
-
"read_lints_limitations": {
|
|
37
|
-
"description": "read_lintsツールには以下の制限がある",
|
|
38
|
-
"limitations": [
|
|
39
|
-
"一部のESLintルールを検出しない可能性がある(例: id-length, 識別子名の長さチェック)",
|
|
40
|
-
"Prettierのフォーマットチェックが含まれない",
|
|
41
|
-
"実際のpnpm run lintコマンドと結果に差異がある可能性"
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
"required_verification_steps": [
|
|
45
|
-
{
|
|
46
|
-
"step": 1,
|
|
47
|
-
"description": "read_lintsツールでESLintエラーをチェック",
|
|
48
|
-
"tool": "read_lints",
|
|
49
|
-
"note": "変更したすべてのファイルを明示的に指定"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"step": 2,
|
|
53
|
-
"description": "実際のlintコマンドで検証",
|
|
54
|
-
"command": "pnpm run lint -- <変更したファイルのパス>",
|
|
55
|
-
"note": "PrettierとESLintの両方が実行され、すべてのルールがチェックされる",
|
|
56
|
-
"required": true
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"step": 3,
|
|
60
|
-
"description": "エラーが0件であることを確認してから報告",
|
|
61
|
-
"note": "pnpm run lintでエラーが見つかった場合は修正してから再実行"
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
"new_file_check": {
|
|
65
|
-
"description": "新規作成したファイルは特に注意してチェック",
|
|
66
|
-
"steps": [
|
|
67
|
-
"read_lintsでチェック",
|
|
68
|
-
"pnpm run lintで再確認(必須)",
|
|
69
|
-
"Prettierのフォーマットも確認"
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
"format_check": {
|
|
73
|
-
"description": "Prettierのフォーマットチェックも実行",
|
|
74
|
-
"command": "pnpm exec prettier --check <ファイルパス>",
|
|
75
|
-
"auto_fix_command": "pnpm exec prettier --write <ファイルパス>",
|
|
76
|
-
"note": "pnpm run lintにはPrettierのチェックが含まれているが、個別に実行することも可能"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
package/prompts/agent-rules.md
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Agent Rules - 共通ルール
|
|
2
|
-
|
|
3
|
-
このプロジェクトで AI がコードを生成・変更する際に従うルールです。Cursor、Antigravity、CodeRabbit など、各種 AI ツールから参照されます。
|
|
4
|
-
|
|
5
|
-
## Project Configuration
|
|
6
|
-
|
|
7
|
-
- **Language**: TypeScript
|
|
8
|
-
- **Package Manager**: pnpm
|
|
9
|
-
- **Add-ons**: prettier, eslint, vitest, playwright, tailwindcss, sveltekit-adapter, devtools-json, drizzle, better-auth, paraglide, mcp
|
|
10
|
-
|
|
11
|
-
## Coding Standards
|
|
12
|
-
|
|
13
|
-
- **Prompt Reference**: When generating or modifying any code, ALWAYS read and follow the instructions in `prompts/coding-standards.md` before starting.
|
|
14
|
-
- This project uses non-standard conventions (e.g., `snake_case` for variables/functions, namespace object exports). Ensure all generated code complies.
|
|
15
|
-
|
|
16
|
-
## Code Change Rules
|
|
17
|
-
|
|
18
|
-
Whenever modifying, adding, or deleting any code:
|
|
19
|
-
|
|
20
|
-
1. **Refactor First**: Before submitting, apply refactoring (high and medium priority) to all newly written or modified code. Follow the instructions in `prompts/refactoring.md`.
|
|
21
|
-
2. **Verify Type Safety**: Run `pnpm run check`.
|
|
22
|
-
3. **Verify Style and Quality**: Run `pnpm run lint`.
|
|
23
|
-
4. **Verify IDE Feedback**: ALWAYS review the "IDE feedback" provided in the prompt for any remaining lint errors. This is usually more up-to-date than terminal commands.
|
|
24
|
-
5. **Fix Issues**: If any check fails (terminal or IDE feedback), fix all reported issues immediately.
|
|
25
|
-
6. **Repeat**: Repeat the checks until they pass.
|
|
26
|
-
7. **Completion**: Only finish the task or response after ALL checks pass.
|
|
27
|
-
|
|
28
|
-
**Constraint**: Never state "it should pass" without actually having run the commands and confirmed the output. Do not end a task while errors exist. If verification commands fail (e.g., system error), you MUST rely on IDE feedback to ensure correctness.
|
|
29
|
-
|
|
30
|
-
## Refactoring Rules
|
|
31
|
-
|
|
32
|
-
- **Prompt Reference**: When performing any refactoring, ALWAYS read and follow the instructions in `prompts/refactoring.md` before starting.
|
|
33
|
-
|
|
34
|
-
## Git Rules
|
|
35
|
-
|
|
36
|
-
- **No Commits**: DO NOT commit changes unless explicitly requested by the user.
|
|
37
|
-
- **Workflow Awareness**: Use `scripts/git-workflow.ts` (via `pnpm josh git`) when the user asks for git operations.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:
|
|
42
|
-
|
|
43
|
-
## Available MCP Tools:
|
|
44
|
-
|
|
45
|
-
### 1. list-sections
|
|
46
|
-
|
|
47
|
-
Use this FIRST to discover all available documentation sections. Returns a structured list with titles, use_cases, and paths.
|
|
48
|
-
When asked about Svelte or SvelteKit topics, ALWAYS use this tool at the start of the chat to find relevant sections.
|
|
49
|
-
|
|
50
|
-
### 2. get-documentation
|
|
51
|
-
|
|
52
|
-
Retrieves full documentation content for specific sections. Accepts single or multiple sections.
|
|
53
|
-
After calling the list-sections tool, you MUST analyze the returned documentation sections (especially the use_cases field) and then use the get-documentation tool to fetch ALL documentation sections that are relevant for the user's task.
|
|
54
|
-
|
|
55
|
-
### 3. svelte-autofixer
|
|
56
|
-
|
|
57
|
-
Analyzes Svelte code and returns issues and suggestions.
|
|
58
|
-
You MUST use this tool whenever writing Svelte code before sending it to the user. Keep calling it until no issues or suggestions are returned.
|
|
59
|
-
|
|
60
|
-
### 4. playground-link
|
|
61
|
-
|
|
62
|
-
Generates a Svelte Playground link with the provided code.
|
|
63
|
-
After completing the code, ask the user if they want a playground link. Only call this tool after user confirmation and NEVER if code was written to files in their project.
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## 相談と実行を区別する(議論中にファイルを編集しない)
|
|
2
|
-
|
|
3
|
-
ユーザーが「どう進めるべきか」「何をすべきか」「なぜそうなったか」を尋ねたり、目標・願望を述べたりした(「どうすべき?」「how should we…」「なぜ」「理由を知りたい」「〜したい」「〜の方が良い?」)ときは、**分析と推奨のみ**で応答する。ファイル編集・Issue 作成・その他の具体的アクションは取らない。
|
|
4
|
-
|
|
5
|
-
- 具体的アクションを取ってよいのは、明示的な命令(「do it」「書き換えて」「作成して」「implement」)またはワークフローキーワード(`kickoff` / `halfrun` / `fullrun` / `backlogrun`)があるときだけ
|
|
6
|
-
- 曖昧なときは propose-and-wait を既定とする(「これを実行してよいか?」と尋ねる)
|
|
7
|
-
- **目標の表明は「計画の依頼」であって「実行の承認」ではない**
|
|
8
|
-
- このルールは横断ドキュメント(CLAUDE.md「Distinguish consultation from execution」)のカノニカル参照
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
## 配布ドキュメント・設定の変更は kit に上流化する
|
|
2
|
-
|
|
3
|
-
`CLAUDE.md` および kit が配布する他のドキュメント/設定は、kit から単一ソースで配布される。
|
|
4
|
-
|
|
5
|
-
- **消費者リポジトリ(app-kit / game-kit)ではこれらをローカル編集しない**: `josh sync` が編集を上書きするうえ、変更は本来上流(kit)に属する。ドキュメント/設定を編集する前に、それが配布物かどうかを確認し、配布物なら kit 側に変更を提案(Issue/PR)する
|
|
6
|
-
- **kit リポジトリ自身ではあなたが配布元**なので、ここでは編集してよい。編集先は `CLAUDE.md` 1 本である(次節)
|
|
7
|
-
- このルールは横断ドキュメント(CLAUDE.md「Route distributed-doc / config changes upstream to kit」)のカノニカル参照
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
## 恒久ルールは MEMORY ではなくプロンプト/ドキュメントに書く
|
|
2
|
-
|
|
3
|
-
今後のセッションでも守るべき恒久的な振る舞いのルールに気付いたときは、**kit が配布するプロンプト/ドキュメント**(`CLAUDE.md` / `prompts/*`)への変更として記述する。プロジェクト単位の自動 MEMORY(例: `~/.claude/projects/<repo-slug>/memory/`)への保存で済ませてはならない。
|
|
4
|
-
|
|
5
|
-
なぜプロンプト/ドキュメントが正なのか:
|
|
6
|
-
|
|
7
|
-
- **共有される**: バージョン管理下にありレビュー可能。PR で意図と経緯が残る
|
|
8
|
-
- **可搬**: `josh sync` で全消費者リポジトリに配布され、別の PC・別のリポジトリ・別の AI ツール(Claude / Gemini / Cursor)にも届く
|
|
9
|
-
- **監査できる**: いつ・なぜそのルールが入ったかを `git log` で追える
|
|
10
|
-
|
|
11
|
-
自動 MEMORY の性質と使いどころ:
|
|
12
|
-
|
|
13
|
-
- MEMORY は **1 台のマシン × 1 つのリポジトリ**にスコープされたローカルストアで、コミットされない。他の PC・他のリポジトリ・他の AI ツールからは見えない
|
|
14
|
-
- したがって **MEMORY への保存は最小限に留める**。用途は「本質的にローカルで共有しようがない文脈」だけ(マシン固有のパス、個人の環境の癖など)
|
|
15
|
-
- どこでも適用されるべきルールの唯一の置き場所を MEMORY にしてはならない
|
|
16
|
-
|
|
17
|
-
運用:
|
|
18
|
-
|
|
19
|
-
1. 恒久ルールに気付いたら、まず「これは kit のドキュメント/プロンプトに書くべきか?」を判定する。共有価値があるなら答えは常に yes
|
|
20
|
-
2. 現在のターンがドキュメント変更を承認していない(相談中など)場合は、**MEMORY に黙って保存せず、プロンプト/ドキュメント変更を提案する**(→「相談と実行を区別する」「配布ドキュメント・設定の変更は kit に上流化する」)
|
|
21
|
-
3. 消費者リポジトリで気付いた場合は、ローカル編集ではなく kit 側へ Issue/PR として上流化する
|
|
22
|
-
4. 既に MEMORY にあるルールが実は共有すべきものだと分かったときは、プロンプト/ドキュメントへ移し、MEMORY 側の重複エントリは削除する
|
|
23
|
-
|
|
24
|
-
- このルールは横断ドキュメント(CLAUDE.md「Durable rules belong in prompts/docs, not local MEMORY」)のカノニカル参照
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
## 最新優先・fix-forward(pin-back は最終手段)
|
|
2
|
-
|
|
3
|
-
依存パッケージ・ツールチェーンは**既定で最新版を採用する**。バンプが lint クラッシュ・新規有効化ルール・型エラーなどの破壊を引き起こしても、古いバージョンへ留まる/戻すことを既定の「安全策」にしてはならない。破壊は**前向きに(fix-forward)速やかに**解消する。
|
|
4
|
-
|
|
5
|
-
1. **最新優先(latest-first)**: 依存・ツールチェーンは新しいバージョンを既定で採用する。適応の手間を避けるためだけに古いバージョンに留まったり戻したりしない
|
|
6
|
-
2. **破壊は fix-forward**: バンプで lint クラッシュ・新規ルール・型エラー等が出たら、前向きに解消する:
|
|
7
|
-
- 新ルール/エラーが正当なら **消費者コードを直す**
|
|
8
|
-
- ルール上書きが要るなら **正しいレイヤー**(kit / app-kit の共有設定)でスコープする。消費者リポジトリでの場当たり的な一回限りの disable にしない
|
|
9
|
-
- 破壊が first-party パッケージ(kit / app-kit)起因なら、**そこに Issue を立てて適切な altitude で直す**。消費者側の回避だけで済ませない(→「別パッケージ起因の問題は割り込み Issue で対応する」参照)
|
|
10
|
-
3. **pin-back は最終手段**: fix-forward が本当に不可能/ブロックされている(例: 未リリースの上流修正待ち)ときだけ、古いバージョンへ固定する。固定するときは **理由を記録し、最新へ戻すためのトラッキング Issue を立てる**。pin-back を既定の推奨として提示してはならない
|
|
11
|
-
4. **既存の保護を尊重する**: この方針は overrides / `devEngines` の承認ゲートを上書きしない。fix-forward は _「最新を優先し破壊を直す」_ であって _「保護された pin を黙って書き換える」_ ではない。overrides(`pnpm-workspace.yaml` / `package.json` のいずれも)と `devEngines` の変更は従来どおりユーザーの明示承認を要する(→「overrides の保護(`pnpm-workspace.yaml` / `package.json` の両方を見る)」、および CLAUDE.md の `devEngines` 保護ルール参照)
|
|
12
|
-
5. **タイムリーに**: バンプ起因の破壊は、可能な限り同じ作業セッション内で速やかに対処し、pin の裏に先送りしない
|
|
13
|
-
|
|
14
|
-
- このルールは横断ドキュメント(CLAUDE.md「Latest-first, fix forward — pin back only as a last resort」)のカノニカル参照
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
## クローン禁止・単一ソース化(パッケージ境界を越えても)
|
|
2
|
-
|
|
3
|
-
既存の非自明なロジックを「ソースを変えずに済ませる」ために**コピー・移植・再実装することは既定で禁止**する。すでにどこか(別ファイル・別モジュール・別**パッケージ=上流依存を含む**)に存在するロジックを複製しようとした瞬間が、**単一ソース化**(全消費者が import する共有モジュール/export/パッケージ)のシグナルである。コピーではなく単一ソース化する。
|
|
4
|
-
|
|
5
|
-
- **既存の重複は再重複の免罪符にならない**: すでに一度クローンされている(例: jgame が kit をコピー)なら、共有抽象化はとっくに必要だったということ。3 つ目のコピーを足さず、重複の存在を surface する
|
|
6
|
-
- **「上流を参照する」は「再利用する」の意**であって、「そのコードを貼り付ける」ではない
|
|
7
|
-
- **「X を触るな」という制約はクローンを黙って正当化しない**: クリーンな修正には上流(kit)の変更が要る/代替はクローン、というトレードオフを先にユーザーへ提示する(「クリーンな修正は kit の変更が必要、代替はクローン、どちらにする?」)
|
|
8
|
-
- 複製は、単一ソース化の代替案とそのコストを提示し、**ユーザーの明示承認を得た後にのみ**行う
|
|
9
|
-
- このルールは横断ドキュメント(CLAUDE.md「No clones — single-source」)のカノニカル参照
|
|
10
|
-
|
|
11
|
-
**計測は `pnpm josh clone:scan`。** 引き金は「複製しようとした瞬間」という自覚頼みで、守られているか確かめる手段がなかった(`sonarjs/no-identical-functions` は同一ファイル内しか見ない)。このコマンドは同一リポジトリ内および `JOSH_REPO_PATHS` の他リポジトリを跨いだ複製を検出し、**件数**と各複製の `file:line`(`[same-file|cross-file|cross-repo]` 分類つき、複製なしは `clean`)を印字する。`pnpm josh oracle:list` に載る決定オラクルでもある。
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
## 設計はエレガント・シンプルを第一目標にする
|
|
2
|
-
|
|
3
|
-
新しい仕組み(フック・ガード・ルール・抽象化)を足す前に、**原因側を直せばその仕組みが要らなくならないか**を先に問う。要らなくなるなら、足さない。エレガントでシンプルな設計を第一目標に置き、症状を叱る仕組みを重ねるのではなく、症状を生んでいる材料を断つ。
|
|
4
|
-
|
|
5
|
-
- **問いは 1 つ**: 「この仕組みは、どこかの原因を直せば不要にならないか」。答えが「不要になる」なら、仕組みではなく原因を直す。
|
|
6
|
-
- **足す前に断つ**: 検出・通知・叱責を強化する前に、その入力を生んでいる側を探す。入力が消えれば、それを捌く仕組みそのものが消える。
|
|
7
|
-
- **適用例(joshuafolkken/kit#2329)**: セッション向け出力に裸の `#N` が混じり、`Stop` フックが返答全体を出し直させて重複が起きていた。素朴な答えは叱る側(フック)の強化だが、エレガントな答えは**裸の `#N` を供給している印字側を直す**こと。材料が消えれば叱られる回数そのものが減る。
|
|
8
|
-
|
|
9
|
-
このルールは横断ドキュメント(`CLAUDE.md` の「設計はエレガント・シンプルを第一目標にする」)のカノニカル参照。**書かれたコードの可読性**(camelCase を避ける、意図が伝わる命名、過度な抽象化を避ける、など)は `prompts/coding-standards.md` の担当で、こちらは**設計時にどの仕組みを足すか・どこへ置くかを決める**規則。両者は別レイヤーなので、片方の本文をもう片方へ写さず、互いを指すだけにする。
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
## エージェント規則の単一ソースは `CLAUDE.md`(`AGENTS.md` / `GEMINI.md` は導線)
|
|
2
|
-
|
|
3
|
-
**規則の本体は `CLAUDE.md` にしか無い。** `AGENTS.md` と `GEMINI.md` は「規則は `CLAUDE.md` にある。作業前に全文を読むこと」だけを書いた短い導線文書であり、規則を 1 行も持たない(joshuafolkken/kit#963)。
|
|
4
|
-
|
|
5
|
-
- **規則の追加・仕様変更・文言修正・節の追加は `CLAUDE.md` に 1 回だけ書く。** 他の 2 本には触れない
|
|
6
|
-
- **導線文書に規則を書き戻さない。** そこに書かれた規則は、次の改訂で更新し忘れる 4 つ目の置き場になる
|
|
7
|
-
- `scripts/document/ai-document-pointers.test.ts` が機械的に守る。導線文書に規則本体が再出現した場合、導線の一文が消えた場合、`CLAUDE.md` が単一ソースであることの記述が消えた場合に落ちる
|
|
8
|
-
|
|
9
|
-
**なぜこうなったか。** 3 本はほぼ同一の複製で、規則を 1 つ変えるたびに 3 回書いて 3 回レビューする必要があり、しかも 3 本とも常駐上限まで 1KB を切っていた。これは `CLAUDE.md` 自身が「No clones — single-source」で禁じているクローンそのものであり、禁止を書いている文書がその禁止に違反している状態だった。
|
|
10
|
-
|
|
11
|
-
**他ツールでの検証は行っていない。** Codex / Cursor / Gemini CLI が導線を辿るかは未確認で、現在 Claude しか使っていないという判断による(joshuafolkken/kit#970 の `## Decisions`)。導線を辿らないツールを使い始める時点で、そのツールについて別途扱う。
|
|
12
|
-
|
|
13
|
-
- このルールは横断ドキュメント(CLAUDE.md「Doc Sync Rules」)のカノニカル参照
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// The two `sh` fragments both unit-suite shims are built from. Single-sourced because a guard's own
|
|
2
|
-
// defects fail **open**: a path that lost its quoting leaves the shim a syntax error that records
|
|
3
|
-
// nothing, and a `printf` that lost its `>>` truncates the record every call — in either case the
|
|
4
|
-
// run is reported clean while the calls keep going out. One spelling, used by every generator, is
|
|
5
|
-
// what keeps that impossible to get wrong in only one of them.
|
|
6
|
-
|
|
7
|
-
const SINGLE_QUOTE = "'"
|
|
8
|
-
|
|
9
|
-
// One `sh` word, quoted. A checkout under `/Users/o'brien` is not exotic, and an unquoted path there
|
|
10
|
-
// would close the quote and leave the rest of the line as syntax.
|
|
11
|
-
function quoted(value: string): string {
|
|
12
|
-
// `sh` has no escape inside single quotes, so an apostrophe is written by closing the quote,
|
|
13
|
-
// emitting an escaped one, and opening a new quote: `'\''`.
|
|
14
|
-
return SINGLE_QUOTE + value.replaceAll("'", String.raw`'\''`) + SINGLE_QUOTE
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Append one line of prose to the shared record. `>>` rather than `>`, because every worker of the
|
|
18
|
-
// run writes to the same file and the last one must not erase what the others found.
|
|
19
|
-
function record_line(log_file: string, recorded: string): string {
|
|
20
|
-
return String.raw`printf '%s\n' "${recorded}" >> ${quoted(log_file)}`
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const shim_shell = { quoted, record_line }
|
|
24
|
-
|
|
25
|
-
export { shim_shell }
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Where a skill lives and how its frontmatter is read (joshuafolkken/kit#854, single-sourced for
|
|
2
|
-
// joshuafolkken/kit#1151).
|
|
3
|
-
//
|
|
4
|
-
// The suites that assert a skill ships correctly and the `josh cost` resident breakdown that sizes
|
|
5
|
-
// the skills index both need the same two facts: which directory holds the skills, and what the
|
|
6
|
-
// entry file's frontmatter says. This module is where those live, so the pattern is not written
|
|
7
|
-
// twice — `skill-fixture.ts` is a test fixture and is excluded from the published package, so
|
|
8
|
-
// shipped code cannot read it.
|
|
9
|
-
|
|
10
|
-
const SKILL_ROOT = '.claude/skills'
|
|
11
|
-
const SKILL_ENTRY_FILE = 'SKILL.md'
|
|
12
|
-
const FRONTMATTER_PATTERN = /^---\n([\S\s]*?)\n---\n/u
|
|
13
|
-
const DESCRIPTION_PATTERN = /^description: (.+)$/mu
|
|
14
|
-
|
|
15
|
-
function has_frontmatter(content: string): boolean {
|
|
16
|
-
return FRONTMATTER_PATTERN.test(content)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function frontmatter_of(content: string): string {
|
|
20
|
-
return FRONTMATTER_PATTERN.exec(content)?.[1] ?? ''
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// The description is the trigger for every agent that discovers a skill by reading descriptions
|
|
24
|
-
// rather than by being told a path, so it is read out rather than merely asserted present.
|
|
25
|
-
function description_of(content: string): string {
|
|
26
|
-
return DESCRIPTION_PATTERN.exec(frontmatter_of(content))?.[1] ?? ''
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const skill_meta = {
|
|
30
|
-
SKILL_ROOT,
|
|
31
|
-
SKILL_ENTRY_FILE,
|
|
32
|
-
has_frontmatter,
|
|
33
|
-
frontmatter_of,
|
|
34
|
-
description_of,
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { skill_meta }
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// Pulling machine-checkable references out of the distributed documents, so a few structural scans
|
|
2
|
-
// can replace the ~140 per-phrase marker suites the documents used to carry (joshuafolkken/kit#1923).
|
|
3
|
-
// Every function here is a pure string extractor: it takes document text and returns the references
|
|
4
|
-
// it names, which is what lets the scans that call it be checked on a synthetic string with a
|
|
5
|
-
// deliberately broken reference in it.
|
|
6
|
-
|
|
7
|
-
// A command reference, only inside a code span. `` `pnpm josh gate` `` and `` `josh review:brief` ``
|
|
8
|
-
// are the copy-and-paste form; the leading backtick keeps prose like "josh will decide" out, which
|
|
9
|
-
// would otherwise read "will" as a command name.
|
|
10
|
-
const COMMAND_PATTERN = /`(?:pnpm )?josh ([a-z][a-z0-9:-]+)/gu
|
|
11
|
-
|
|
12
|
-
// A label the documents operate on — applied (`labels[]=…`), removed (`…/labels/<name>`) or created
|
|
13
|
-
// (`labels -f name=…`). Prose that merely names a label is not scanned; a mistyped name only breaks
|
|
14
|
-
// where a command carries it.
|
|
15
|
-
const LABEL_PATTERN = /(?:labels\[\]=|\/labels\/|labels -f name=)([a-z][a-z0-9:_-]*)/gu
|
|
16
|
-
|
|
17
|
-
// A section reference: a markdown file in a code span, an arrow, and the cited heading in straight or
|
|
18
|
-
// Japanese quotes — `` `backlogrun-progress.md` → "The hand-off" ``.
|
|
19
|
-
const SECTION_PATTERN = /`([\w./-]+\.md)`\s*→\s*["「]([^"」]+)["」]/gu
|
|
20
|
-
|
|
21
|
-
// A relative markdown link target, with an optional `#anchor`. External `https://…` links carry no
|
|
22
|
-
// `.md`, so the pattern never matches them.
|
|
23
|
-
const LINK_PATTERN = /\]\(([\w./-]+\.md)(?:#[\w-]+)?\)/gu
|
|
24
|
-
|
|
25
|
-
// Filenames that appear in the documents as illustrations of the reference form itself, never as real
|
|
26
|
-
// targets — the doc-section explanation cites `` `path.md` → "Heading" `` and `` `X.md` → "Heading" ``.
|
|
27
|
-
const PLACEHOLDER_FILES: ReadonlySet<string> = new Set(['x.md', 'foo.md', 'file.md', 'path.md'])
|
|
28
|
-
|
|
29
|
-
function matches(text: string, pattern: RegExp): Array<RegExpMatchArray> {
|
|
30
|
-
return [...text.matchAll(pattern)]
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// A trailing colon is a placeholder for the sub-command that follows — `` `josh epic:` `` stands for
|
|
34
|
-
// `epic:audit`, `epic:next` and the rest — so it names no command of its own.
|
|
35
|
-
function command_references(text: string): Array<string> {
|
|
36
|
-
return matches(text, COMMAND_PATTERN)
|
|
37
|
-
.map((match) => match[1] ?? '')
|
|
38
|
-
.filter((name) => !name.endsWith(':'))
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// A `<placeholder>` inside a command, and `depth:<n>` after the char class stops at `<`, both leave a
|
|
42
|
-
// token that is not a real label. Real labels never end in a colon and never carry angle brackets.
|
|
43
|
-
function is_real_label(token: string): boolean {
|
|
44
|
-
return token.length > 0 && !token.endsWith(':') && !token.includes('<')
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function label_references(text: string): Array<string> {
|
|
48
|
-
return matches(text, LABEL_PATTERN)
|
|
49
|
-
.map((match) => match[1] ?? '')
|
|
50
|
-
.filter((token) => is_real_label(token))
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function base_name(path: string): string {
|
|
54
|
-
return path.split('/').at(-1) ?? path
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function is_placeholder_file(name: string): boolean {
|
|
58
|
-
return name.includes('<') || PLACEHOLDER_FILES.has(base_name(name).toLowerCase())
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface SectionReference {
|
|
62
|
-
file: string
|
|
63
|
-
heading: string
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function section_references(text: string): Array<SectionReference> {
|
|
67
|
-
return matches(text, SECTION_PATTERN)
|
|
68
|
-
.map(([, file, heading]) => ({ file: file ?? '', heading: heading ?? '' }))
|
|
69
|
-
.filter((reference) => !is_placeholder_file(reference.file))
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function link_targets(text: string): Array<string> {
|
|
73
|
-
return matches(text, LINK_PATTERN)
|
|
74
|
-
.map((match) => match[1] ?? '')
|
|
75
|
-
.filter((file) => !is_placeholder_file(file))
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// A cited heading and the heading it names are compared with backticks dropped and whitespace
|
|
79
|
-
// collapsed, because a reference wraps at the column the prose wraps at — sometimes across a
|
|
80
|
-
// blockquote `> ` continuation — while the heading it points at is one unbroken line.
|
|
81
|
-
function normalize_reference(heading: string): string {
|
|
82
|
-
return heading
|
|
83
|
-
.replaceAll('`', '')
|
|
84
|
-
.split(/\s+/u)
|
|
85
|
-
.filter((word) => word !== '>')
|
|
86
|
-
.join(' ')
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// The two forms a heading can be cited by: with its leading number (`2b. Delegating…`) and without
|
|
90
|
-
// (`Delegating…`), since a document's own numbering is a prefix a reference may or may not carry.
|
|
91
|
-
function reference_forms(title: string): Array<string> {
|
|
92
|
-
const normalized = normalize_reference(title)
|
|
93
|
-
|
|
94
|
-
return [normalized, normalized.replace(/^\d+[a-z]?\. /u, '')]
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const document_scan = {
|
|
98
|
-
command_references,
|
|
99
|
-
is_placeholder_file,
|
|
100
|
-
label_references,
|
|
101
|
-
link_targets,
|
|
102
|
-
normalize_reference,
|
|
103
|
-
reference_forms,
|
|
104
|
-
section_references,
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export type { SectionReference }
|
|
108
|
-
export { document_scan }
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { writeFileSync } from 'node:fs'
|
|
2
|
-
import { fileURLToPath } from 'node:url'
|
|
3
|
-
import {
|
|
4
|
-
ALIASES,
|
|
5
|
-
CATEGORY_ORDER,
|
|
6
|
-
COMMAND_MAP,
|
|
7
|
-
type CommandCategory,
|
|
8
|
-
type CommandEntry,
|
|
9
|
-
} from '#scripts/josh/josh-command-map'
|
|
10
|
-
|
|
11
|
-
const CATALOG_FILE = fileURLToPath(new URL('../../docs/josh-command-catalog.md', import.meta.url))
|
|
12
|
-
|
|
13
|
-
const PREAMBLE = `# josh CLI — Command Catalog
|
|
14
|
-
|
|
15
|
-
Auto-generated — do not edit.
|
|
16
|
-
Run \`tsx scripts/document/generate-catalog.ts\` to regenerate.
|
|
17
|
-
|
|
18
|
-
`
|
|
19
|
-
|
|
20
|
-
function aliases_for(command_name: string): ReadonlyArray<string> {
|
|
21
|
-
return Object.entries(ALIASES)
|
|
22
|
-
.filter(([, target]) => target === command_name)
|
|
23
|
-
.map(([alias]) => alias)
|
|
24
|
-
.toSorted((x, y) => x.localeCompare(y))
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function format_alias_heading(name: string, aliases: ReadonlyArray<string>): string {
|
|
28
|
-
if (aliases.length === 0) return `### \`josh ${name}\``
|
|
29
|
-
const alias_spans = aliases.map((al) => `\`josh ${al}\``).join(' · ')
|
|
30
|
-
|
|
31
|
-
return `### \`josh ${name}\` · ${alias_spans}`
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function format_command_entry(name: string, entry: CommandEntry): string {
|
|
35
|
-
const [synopsis, audience, side_effects] = entry.reference
|
|
36
|
-
const aliases = aliases_for(name)
|
|
37
|
-
const kit_note = entry.is_kit_only === true ? ' · **kit only**' : ''
|
|
38
|
-
const heading = format_alias_heading(name, aliases)
|
|
39
|
-
const meta = `> **Audience:** ${audience} · **Side effects:** ${side_effects.join(', ')}${kit_note}`
|
|
40
|
-
const synopsis_line = synopsis ? `\`${synopsis}\`` : '_No arguments._'
|
|
41
|
-
|
|
42
|
-
return [heading, '', meta, '', synopsis_line, '', entry.description].join('\n')
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function entries_for_category(category: CommandCategory): Array<[string, CommandEntry]> {
|
|
46
|
-
return Object.entries(COMMAND_MAP)
|
|
47
|
-
.filter(([, entry]) => entry.category === category)
|
|
48
|
-
.toSorted(([name_a], [name_b]) => name_a.localeCompare(name_b))
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function generate_category_section(category: CommandCategory): string {
|
|
52
|
-
const entries = entries_for_category(category)
|
|
53
|
-
if (entries.length === 0) return ''
|
|
54
|
-
const command_blocks = entries.map(([name, entry]) => format_command_entry(name, entry))
|
|
55
|
-
|
|
56
|
-
return `## ${category}\n\n${command_blocks.join('\n\n---\n\n')}\n\n`
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function generate_catalog(): string {
|
|
60
|
-
const content = PREAMBLE + CATEGORY_ORDER.map((cat) => generate_category_section(cat)).join('')
|
|
61
|
-
|
|
62
|
-
return `${content.trimEnd()}\n`
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
66
|
-
writeFileSync(CATALOG_FILE, generate_catalog())
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export { CATALOG_FILE, generate_catalog }
|