@workerstack/repo 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/CHANGELOG.md +45 -0
- package/LICENSE +21 -0
- package/README.md +0 -3
- package/agents/global-settings/antigravity.json +3 -0
- package/agents/global-settings/claude.json +6 -0
- package/agents/global-settings/codex.toml +2 -0
- package/agents/global-settings/cursor.json +3 -0
- package/agents/global-settings/grok.toml +36 -0
- package/agents/global-settings/manifest.json +36 -0
- package/agents/grok/hooks/orchestrate-parent.json +60 -0
- package/agents/grok/hooks/rtk.json +16 -0
- package/agents/grok/hooks/rulesync.json +3 -0
- package/agents/grok/roles/scout.toml +5 -0
- package/agents/hooks.jsonc +67 -0
- package/agents/mcp-policy.jsonc +16 -0
- package/agents/rules/overview.md +21 -0
- package/agents/settings/claude.json +5 -0
- package/agents/skills/ask/SKILL.md +13 -0
- package/agents/skills/auto/SKILL.md +13 -0
- package/agents/skills/away/SKILL.md +19 -0
- package/agents/skills/blast-radius/SKILL.md +54 -0
- package/agents/skills/bro/SKILL.md +9 -0
- package/agents/skills/browser/SKILL.md +16 -0
- package/agents/skills/clasp/SKILL.md +11 -0
- package/agents/skills/commit/SKILL.md +35 -0
- package/agents/skills/commit-and-push/SKILL.md +9 -0
- package/agents/skills/commit-push/SKILL.md +59 -0
- package/agents/skills/commit-push-deploy/SKILL.md +74 -0
- package/agents/skills/commit-push-release/SKILL.md +75 -0
- package/agents/skills/correct/SKILL.md +39 -0
- package/agents/skills/do/SKILL.md +21 -0
- package/agents/skills/explain/SKILL.md +13 -0
- package/agents/skills/google-workspace/SKILL.md +12 -0
- package/agents/skills/handoff/SKILL.md +81 -0
- package/agents/skills/implement-plan/SKILL.md +29 -0
- package/agents/skills/implement-roadmap/SKILL.md +27 -0
- package/agents/skills/jev/SKILL.md +17 -0
- package/agents/skills/listen/SKILL.md +15 -0
- package/agents/skills/pickup/SKILL.md +58 -0
- package/agents/skills/principle-attack-the-premise/SKILL.md +24 -0
- package/agents/skills/principle-boundary-discipline/SKILL.md +38 -0
- package/agents/skills/principle-build-the-lever/SKILL.md +28 -0
- package/agents/skills/principle-encode-lessons-in-structure/SKILL.md +15 -0
- package/agents/skills/principle-exhaust-the-design-space/SKILL.md +12 -0
- package/agents/skills/principle-experience-first/SKILL.md +22 -0
- package/agents/skills/principle-explain-the-number/SKILL.md +21 -0
- package/agents/skills/principle-fix-root-causes/SKILL.md +24 -0
- package/agents/skills/principle-foundational-thinking/SKILL.md +25 -0
- package/agents/skills/principle-guard-the-context-window/SKILL.md +16 -0
- package/agents/skills/principle-laziness-protocol/SKILL.md +13 -0
- package/agents/skills/principle-make-operations-idempotent/SKILL.md +25 -0
- package/agents/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +18 -0
- package/agents/skills/principle-minimize-reader-load/SKILL.md +22 -0
- package/agents/skills/principle-model-the-domain/SKILL.md +26 -0
- package/agents/skills/principle-never-block-on-the-human/SKILL.md +17 -0
- package/agents/skills/principle-outcome-oriented-execution/SKILL.md +25 -0
- package/agents/skills/principle-prove-it-works/SKILL.md +25 -0
- package/agents/skills/principle-redesign-from-first-principles/SKILL.md +18 -0
- package/agents/skills/principle-separate-before-serializing-shared-state/SKILL.md +20 -0
- package/agents/skills/principle-sequence-verifiable-units/SKILL.md +22 -0
- package/agents/skills/principle-subtract-before-you-add/SKILL.md +21 -0
- package/agents/skills/principle-test-behavior-not-implementation/SKILL.md +24 -0
- package/agents/skills/principle-type-system-discipline/SKILL.md +17 -0
- package/agents/skills/review-plan/SKILL.md +28 -0
- package/agents/skills/review-roadmap/SKILL.md +28 -0
- package/agents/skills/show-me/SKILL.md +21 -0
- package/agents/skills/speak/SKILL.md +15 -0
- package/agents/skills/su/SKILL.md +11 -0
- package/agents/skills/teach/SKILL.md +25 -0
- package/agents/skills/tmp/SKILL.md +54 -0
- package/agents/skills/typescript-best-practices/SKILL.md +32 -0
- package/agents/skills/typescript-best-practices/references/patterns.md +328 -0
- package/agents/skills/unslop/SKILL.md +62 -0
- package/agents/skills/write-plan/SKILL.md +33 -0
- package/agents/skills/write-roadmap/SKILL.md +66 -0
- package/agents/subagents/implementer-deep.md +57 -0
- package/agents/subagents/implementer-fast.md +57 -0
- package/agents/subagents/orchestrator.md +43 -0
- package/agents/subagents/researcher.md +47 -0
- package/agents/subagents/scout.md +44 -0
- package/bin/repo.ts +4 -0
- package/cli/actionlint-default.test.ts +38 -0
- package/cli/actionlint-download.test.ts +162 -0
- package/cli/actionlint-real.test.ts +33 -0
- package/cli/actionlint.constants.ts +43 -0
- package/cli/actionlint.test.ts +108 -0
- package/cli/actionlint.ts +178 -0
- package/cli/bin.test.ts +54 -0
- package/cli/bin.ts +40 -0
- package/cli/check-changelog.test.ts +40 -0
- package/cli/check-changelog.ts +12 -0
- package/cli/check-comments.test.ts +157 -0
- package/cli/check-comments.ts +123 -0
- package/cli/check-env-modules.test.ts +85 -0
- package/cli/check-env-modules.ts +56 -0
- package/cli/check-magic.test.ts +139 -0
- package/cli/check-magic.ts +120 -0
- package/cli/check-manifests.constants.ts +4 -0
- package/cli/check-manifests.test.ts +210 -0
- package/cli/check-manifests.ts +71 -0
- package/cli/check-nightly.test.ts +103 -0
- package/cli/check-nightly.ts +37 -0
- package/cli/check-ratchets-missing.test.ts +46 -0
- package/cli/check-ratchets-mutation.test.ts +49 -0
- package/cli/check-ratchets.constants.ts +20 -0
- package/cli/check-ratchets.test.ts +190 -0
- package/cli/check-ratchets.ts +193 -0
- package/cli/check-rejections.test.ts +220 -0
- package/cli/check-rejections.ts +153 -0
- package/cli/check-reports.ts +37 -0
- package/cli/check-tsconfig.test.ts +507 -0
- package/cli/check-tsconfig.ts +205 -0
- package/cli/commands.test.ts +114 -0
- package/cli/commands.ts +218 -0
- package/cli/commit-changelog.ts +27 -0
- package/cli/commit-msg-changelog.test.ts +93 -0
- package/cli/commit-msg-range.test.ts +126 -0
- package/cli/commit-msg-red-proof.test.ts +147 -0
- package/cli/commit-msg-repo.test.ts +153 -0
- package/cli/commit-msg.test.ts +101 -0
- package/cli/commit-msg.ts +194 -0
- package/cli/commit-range.constants.ts +17 -0
- package/cli/commit-range.ts +57 -0
- package/cli/config-knip.test.ts +70 -0
- package/cli/config-nightly.test.ts +84 -0
- package/cli/config-tdd.test.ts +46 -0
- package/cli/config.test.ts +576 -0
- package/cli/config.ts +261 -0
- package/cli/conventional.ts +9 -0
- package/cli/coverage-config.ts +62 -0
- package/cli/coverage.constants.ts +6 -0
- package/cli/coverage.test.ts +199 -0
- package/cli/coverage.ts +127 -0
- package/cli/env.constants.ts +10 -0
- package/cli/env.test.ts +56 -0
- package/cli/env.ts +72 -0
- package/cli/fixtures/base-config.ts +13 -0
- package/cli/fixtures/gate-world.ts +48 -0
- package/cli/fixtures/knip-run.ts +38 -0
- package/cli/fixtures/mutate-fakes.ts +137 -0
- package/cli/fixtures/planted-repo.ts +50 -0
- package/cli/fixtures/publish-world.ts +71 -0
- package/cli/fixtures/red-proof-repo.ts +72 -0
- package/cli/fixtures/release-context.ts +15 -0
- package/cli/fixtures/release-world.ts +111 -0
- package/cli/fixtures/stub-bin.ts +40 -0
- package/cli/guard-diagnostics.test.ts +157 -0
- package/cli/guard-diagnostics.ts +195 -0
- package/cli/init.test.ts +487 -0
- package/cli/init.ts +275 -0
- package/cli/knip-check-ignores.test.ts +106 -0
- package/cli/knip-check-real.test.ts +65 -0
- package/cli/knip-check.constants.ts +46 -0
- package/cli/knip-check.test.ts +114 -0
- package/cli/knip-check.ts +169 -0
- package/cli/knip-schema.ts +67 -0
- package/cli/known-failures.constants.ts +22 -0
- package/cli/known-failures.test.ts +138 -0
- package/cli/known-failures.ts +131 -0
- package/cli/lint/as-needs-reason.ts +41 -0
- package/cli/lint/boundaries.ts +73 -0
- package/cli/lint/class-file.ts +39 -0
- package/cli/lint/config-file.ts +32 -0
- package/cli/lint/entry-file.ts +54 -0
- package/cli/lint/env-in-config.ts +66 -0
- package/cli/lint/filename-matches-export.ts +63 -0
- package/cli/lint/index-file.ts +22 -0
- package/cli/lint/index.ts +47 -0
- package/cli/lint/is-reason.ts +6 -0
- package/cli/lint/manifest.ts +46 -0
- package/cli/lint/names.ts +59 -0
- package/cli/lint/no-commented-out-code.ts +105 -0
- package/cli/lint/no-mock-of-subject.ts +64 -0
- package/cli/lint/no-module-side-effects.ts +94 -0
- package/cli/lint/no-module-state.ts +58 -0
- package/cli/lint/no-side-effect-import.ts +17 -0
- package/cli/lint/no-v8-ignore.ts +18 -0
- package/cli/lint/script-rules.ts +9 -0
- package/cli/lint/skip-on-platform.constants.ts +8 -0
- package/cli/lint/skip-on-platform.ts +118 -0
- package/cli/lint/todo-needs-id.ts +63 -0
- package/cli/lint/types-file.ts +28 -0
- package/cli/lint-schema.ts +32 -0
- package/cli/magic/fixtures/magic-repo.ts +64 -0
- package/cli/magic/magic-hit.ts +2 -0
- package/cli/magic/magic-nodes.ts +44 -0
- package/cli/magic/magic-numbers.test.ts +99 -0
- package/cli/magic/magic-numbers.ts +117 -0
- package/cli/magic/magic-strings.test.ts +38 -0
- package/cli/magic/magic-strings.ts +81 -0
- package/cli/main.test.ts +853 -0
- package/cli/main.ts +292 -0
- package/cli/mutate-args.ts +79 -0
- package/cli/mutate-check.test.ts +147 -0
- package/cli/mutate-deps.ts +42 -0
- package/cli/mutate-edges.test.ts +150 -0
- package/cli/mutate-files.test.ts +100 -0
- package/cli/mutate-files.ts +31 -0
- package/cli/mutate-floors.test.ts +91 -0
- package/cli/mutate-floors.ts +104 -0
- package/cli/mutate-real-deps.ts +57 -0
- package/cli/mutate-real.test.ts +96 -0
- package/cli/mutate-report.ts +96 -0
- package/cli/mutate-run.ts +128 -0
- package/cli/mutate-shards.ts +64 -0
- package/cli/mutate.constants.ts +67 -0
- package/cli/mutate.test.ts +182 -0
- package/cli/mutate.ts +64 -0
- package/cli/nested-vitest-flags.ts +8 -0
- package/cli/nightly-config.constants.ts +14 -0
- package/cli/nightly-config.ts +62 -0
- package/cli/prompt.test.ts +202 -0
- package/cli/prompt.ts +1 -0
- package/cli/red-proof-edges.test.ts +78 -0
- package/cli/red-proof-failures.test.ts +82 -0
- package/cli/red-proof-tree.test.ts +157 -0
- package/cli/red-proof-verdict.test.ts +44 -0
- package/cli/red-proof.constants.ts +14 -0
- package/cli/red-proof.ts +202 -0
- package/cli/release/changelog-parse.ts +83 -0
- package/cli/release/changelog.test.ts +141 -0
- package/cli/release/changelog.ts +106 -0
- package/cli/release/gate-refusals.test.ts +85 -0
- package/cli/release/gate.test.ts +63 -0
- package/cli/release/gate.ts +70 -0
- package/cli/release/git.ts +66 -0
- package/cli/release/github.test.ts +128 -0
- package/cli/release/github.ts +46 -0
- package/cli/release/list-dir.test.ts +11 -0
- package/cli/release/list-dir.ts +6 -0
- package/cli/release/main.test.ts +48 -0
- package/cli/release/main.ts +51 -0
- package/cli/release/manifest.test.ts +24 -0
- package/cli/release/manifest.ts +34 -0
- package/cli/release/pack.test.ts +107 -0
- package/cli/release/pack.ts +76 -0
- package/cli/release/plan.ts +127 -0
- package/cli/release/publish-run.test.ts +98 -0
- package/cli/release/publish.test.ts +127 -0
- package/cli/release/publish.ts +125 -0
- package/cli/release/refuse.ts +5 -0
- package/cli/release/release-messages.constants.ts +96 -0
- package/cli/release/release-refusals.test.ts +149 -0
- package/cli/release/release.constants.ts +128 -0
- package/cli/release/release.test.ts +199 -0
- package/cli/release/release.ts +145 -0
- package/cli/release/version.test.ts +118 -0
- package/cli/release/version.ts +69 -0
- package/cli/release/wait.test.ts +101 -0
- package/cli/release/wait.ts +95 -0
- package/cli/script-diagnostics.test.ts +76 -0
- package/cli/script-diagnostics.ts +62 -0
- package/cli/scripts/board.ts +519 -0
- package/cli/scripts/browser.ts +994 -0
- package/cli/scripts/change-set.ts +105 -0
- package/cli/scripts/check-globals.ts +199 -0
- package/cli/scripts/ci-skips.constants.ts +17 -0
- package/cli/scripts/ci-skips.ts +118 -0
- package/cli/scripts/ci-wait-run.ts +28 -0
- package/cli/scripts/ci-wait.constants.ts +44 -0
- package/cli/scripts/ci-wait.ts +175 -0
- package/cli/scripts/ci.constants.ts +15 -0
- package/cli/scripts/ci.ts +208 -0
- package/cli/scripts/clean.ts +363 -0
- package/cli/scripts/comments-step.ts +15 -0
- package/cli/scripts/doctor.ts +828 -0
- package/cli/scripts/emit-agent-shell-tools.ts +91 -0
- package/cli/scripts/emit-mcp-policy.ts +402 -0
- package/cli/scripts/folder-map.ts +353 -0
- package/cli/scripts/gate-fat-tools.ts +1095 -0
- package/cli/scripts/gitignore-guard.ts +338 -0
- package/cli/scripts/google-workspace.ts +779 -0
- package/cli/scripts/hook-command.ts +72 -0
- package/cli/scripts/hook-input.ts +178 -0
- package/cli/scripts/hook-io.constants.ts +5 -0
- package/cli/scripts/hook-io.ts +46 -0
- package/cli/scripts/hooks-union.ts +469 -0
- package/cli/scripts/interactive.ts +30 -0
- package/cli/scripts/jev.ts +420 -0
- package/cli/scripts/job.ts +934 -0
- package/cli/scripts/jsonc.ts +9 -0
- package/cli/scripts/lessons.ts +564 -0
- package/cli/scripts/lint-baseline.ts +233 -0
- package/cli/scripts/lint-main.ts +24 -0
- package/cli/scripts/lint-skips.ts +139 -0
- package/cli/scripts/lint.constants.ts +6 -0
- package/cli/scripts/lint.ts +142 -0
- package/cli/scripts/listen.ts +962 -0
- package/cli/scripts/managed-text.ts +47 -0
- package/cli/scripts/orchestrate-parent.ts +1155 -0
- package/cli/scripts/parse-need.ts +81 -0
- package/cli/scripts/persist-handoff.ts +228 -0
- package/cli/scripts/persist-implementation.ts +276 -0
- package/cli/scripts/persist-plan.ts +888 -0
- package/cli/scripts/persist-roadmap.ts +478 -0
- package/cli/scripts/persist-tmp.ts +177 -0
- package/cli/scripts/persist.ts +54 -0
- package/cli/scripts/phase-files.ts +121 -0
- package/cli/scripts/prompt.ts +38 -0
- package/cli/scripts/purge-global-mcps.ts +313 -0
- package/cli/scripts/rejections-step.ts +37 -0
- package/cli/scripts/rtk-grok.ts +102 -0
- package/cli/scripts/scrub-spawn-prompt.ts +103 -0
- package/cli/scripts/scrub-text-lib.ts +58 -0
- package/cli/scripts/session-map.ts +69 -0
- package/cli/scripts/setup.ts +862 -0
- package/cli/scripts/skill-conflicts.ts +82 -0
- package/cli/scripts/speak.ts +370 -0
- package/cli/scripts/strategy.ts +168 -0
- package/cli/scripts/sync-global-settings.ts +316 -0
- package/cli/scripts/turn-steps.ts +249 -0
- package/cli/scripts/turn.ts +157 -0
- package/cli/scripts/typecheck-step.ts +43 -0
- package/cli/scripts/vscode-tasks.ts +175 -0
- package/cli/scripts/workspace-root.ts +160 -0
- package/cli/scripts/worktree.ts +806 -0
- package/cli/spawn.test.ts +34 -0
- package/cli/spawn.ts +27 -0
- package/cli/staged-change.constants.ts +11 -0
- package/cli/staged-change.ts +79 -0
- package/cli/stryker-preload.test.ts +50 -0
- package/cli/stryker-preload.ts +9 -0
- package/cli/sync/agents/frontmatter.test.ts +197 -0
- package/cli/sync/agents/frontmatter.ts +140 -0
- package/cli/sync/agents/hooks.test.ts +517 -0
- package/cli/sync/agents/hooks.ts +401 -0
- package/cli/sync/agents/rules.test.ts +229 -0
- package/cli/sync/agents/rules.ts +84 -0
- package/cli/sync/agents/sources.test.ts +375 -0
- package/cli/sync/agents/sources.ts +244 -0
- package/cli/sync/agents/subagents.test.ts +149 -0
- package/cli/sync/agents/subagents.ts +158 -0
- package/cli/sync/agents-text.test.ts +31 -0
- package/cli/sync/agents-text.ts +36 -0
- package/cli/sync/fixtures/copied.README.md +35 -0
- package/cli/sync/fixtures/copied.tgz +0 -0
- package/cli/sync/fixtures/maps/golden/INDEX.md +22 -0
- package/cli/sync/fixtures/maps-ws.tgz +0 -0
- package/cli/sync/git-files.test.ts +340 -0
- package/cli/sync/git-files.ts +197 -0
- package/cli/sync/git-hooks.test.ts +94 -0
- package/cli/sync/golden.test.ts +15 -0
- package/cli/sync/hooks-mode.test.ts +99 -0
- package/cli/sync/hosts.ts +28 -0
- package/cli/sync/knip-config.constants.ts +4 -0
- package/cli/sync/knip-config.test.ts +147 -0
- package/cli/sync/knip-config.ts +108 -0
- package/cli/sync/manifest.test.ts +78 -0
- package/cli/sync/manifest.ts +60 -0
- package/cli/sync/maps.test.ts +304 -0
- package/cli/sync/maps.ts +297 -0
- package/cli/sync/migrate.test.ts +2000 -0
- package/cli/sync/migrate.ts +1104 -0
- package/cli/sync/nightly-jobs.test.ts +63 -0
- package/cli/sync/nightly.constants.ts +48 -0
- package/cli/sync/nightly.test.ts +100 -0
- package/cli/sync/nightly.ts +75 -0
- package/cli/sync/outputs.test.ts +351 -0
- package/cli/sync/outputs.ts +168 -0
- package/cli/sync/oxlint-config.test.ts +178 -0
- package/cli/sync/oxlint-config.ts +168 -0
- package/cli/sync/release-jobs.test.ts +29 -0
- package/cli/sync/release-reports.test.ts +31 -0
- package/cli/sync/release-workflow.constants.ts +61 -0
- package/cli/sync/release-workflow.test.ts +192 -0
- package/cli/sync/release-workflow.ts +86 -0
- package/cli/sync/release.constants.ts +93 -0
- package/cli/sync/release.test.ts +187 -0
- package/cli/sync/release.ts +112 -0
- package/cli/sync/repo-dir.test.ts +371 -0
- package/cli/sync/repo-dir.ts +205 -0
- package/cli/sync/standards.constants.ts +8 -0
- package/cli/sync/standards.test.ts +206 -0
- package/cli/sync/standards.ts +179 -0
- package/cli/sync/stock-history.json +2796 -0
- package/cli/sync/stock-history.test.ts +66 -0
- package/cli/sync/stock-history.ts +84 -0
- package/cli/sync/stock.test.ts +47 -0
- package/cli/sync/stock.ts +24 -0
- package/cli/sync/trees.test.ts +621 -0
- package/cli/sync/trees.ts +280 -0
- package/cli/sync/validate.test.ts +299 -0
- package/cli/sync/validate.ts +402 -0
- package/cli/sync/workspace.test.ts +180 -0
- package/cli/sync/workspace.ts +138 -0
- package/cli/sync/write.test.ts +341 -0
- package/cli/sync/write.ts +231 -0
- package/cli/sync.test.ts +1495 -0
- package/cli/sync.ts +360 -0
- package/cli/tdd-scope.test.ts +36 -0
- package/cli/tdd-scope.ts +41 -0
- package/cli/test-files.ts +16 -0
- package/cli/ts-program.ts +69 -0
- package/cli/tsconfig.constants.ts +8 -0
- package/cli/workerstack-config.types.ts +21 -0
- package/dist/cli/env.d.ts +10 -0
- package/dist/cli/env.js +64 -0
- package/dist/presets/temp-root-env.d.ts +10 -0
- package/dist/presets/temp-root-env.js +20 -0
- package/dist/presets/temp-root.constants.d.ts +6 -0
- package/dist/presets/temp-root.constants.js +6 -0
- package/dist/presets/temp-root.d.ts +2 -0
- package/dist/presets/temp-root.js +60 -0
- package/dist/presets/vitest.constants.d.ts +16 -0
- package/dist/presets/vitest.constants.js +16 -0
- package/dist/presets/vitest.d.ts +11 -0
- package/dist/presets/vitest.js +67 -0
- package/dist/presets/workers-plugin.d.ts +10 -0
- package/dist/presets/workers-plugin.js +54 -0
- package/package.json +141 -4
- package/references/INDEX.md +100 -0
- package/references/browser.md +66 -0
- package/references/cascade.md +15 -0
- package/references/clasp.md +21 -0
- package/references/cloudflare.md +36 -0
- package/references/google-workspace.md +79 -0
- package/references/hooks.md +103 -0
- package/references/implementation-format.md +119 -0
- package/references/jev.md +56 -0
- package/references/lessons.md +73 -0
- package/references/listen.md +80 -0
- package/references/map.md +107 -0
- package/references/output.md +47 -0
- package/references/plan-format.md +264 -0
- package/references/review-loop.md +48 -0
- package/references/roadmap-format.md +104 -0
- package/references/rtk.md +27 -0
- package/references/scope.md +76 -0
- package/references/setup.md +42 -0
- package/references/speak.md +59 -0
- package/tsconfig/base.json +28 -0
- package/tsconfig/bun.d.ts +1 -0
- package/tsconfig/bun.json +8 -0
- package/tsconfig/reset.d.ts +1 -0
- package/tsconfig/strict.json +12 -0
- package/tsconfig/web.json +7 -0
- package/tsconfig/worker.d.ts +1 -0
- package/tsconfig/worker.json +8 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tmp
|
|
3
|
+
description: Dump a one-off convo artifact under .tmp/repo/.
|
|
4
|
+
---
|
|
5
|
+
# tmp
|
|
6
|
+
|
|
7
|
+
One turn. Author from this session (email/script/note). Write once. Recap the absolute path. Stop.
|
|
8
|
+
|
|
9
|
+
## Invocation
|
|
10
|
+
|
|
11
|
+
`/tmp [what]`
|
|
12
|
+
|
|
13
|
+
Empty `$ARGUMENTS` + no already-visible dumpable blob → `need task`. Empty + visible blob (code fence / draft) → dump that.
|
|
14
|
+
|
|
15
|
+
## When
|
|
16
|
+
|
|
17
|
+
Dump a one-off convo artifact. Not `/handoff` (no pickup no Goal/State/Next). Not `.tmp/repo/plans/`. Not `.tmp/repo/implementations/`. Not product source. Not OS `/tmp`.
|
|
18
|
+
|
|
19
|
+
## Path
|
|
20
|
+
|
|
21
|
+
`.tmp/repo/{serial}-{slug}-{YYYYMMDDTHHMMSSZ}.{ext}`
|
|
22
|
+
|
|
23
|
+
- serial: unpadded int ≥ 1, next after existing tmp dumps (own counter; not plan/handoff/implementation serials)
|
|
24
|
+
- slug: lower, non `[a-z0-9]` → `-`, collapse, trim 50
|
|
25
|
+
- stamp: UTC `YYYYMMDDTHHMMSSZ`
|
|
26
|
+
- ext: `TMP_EXT` or explicit `.{ext}` in args; else `md`
|
|
27
|
+
|
|
28
|
+
## Write
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
TMP_NAME: <3-6 word name>
|
|
32
|
+
TMP_EXT: md
|
|
33
|
+
<artifact only>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`TMP_EXT` optional. Write any root filename under `.tmp/repo/` (not `plans|roadmaps|handoffs|implementations|browser|orchestrator-logs|stash|sessions`). Grok `orchestrate-parent.ts` runs `cli/scripts/persist-tmp.ts`: serial/slug/ext from `TMP_*`, strips those lines, no YAML frontmatter, rewrites path + content. Write outside that root or missing `TMP_NAME:` is denied.
|
|
37
|
+
|
|
38
|
+
Host without that hook: name the file per **Path** yourself, or pipe the body to `bun repo persist tmp --workspace {repo}` and use its `absPath`.
|
|
39
|
+
|
|
40
|
+
Never rewrite an existing dump; new serial. Artifact file content after hook = artifact only (no TMP_* lines no YAML frontmatter).
|
|
41
|
+
|
|
42
|
+
## Report
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
[tmp]: serial={int} path={abs}/.tmp/repo/{serial}-{slug}-{stamp}.{ext}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Do not dump the body.
|
|
49
|
+
|
|
50
|
+
## Rules
|
|
51
|
+
|
|
52
|
+
- One write. `/tmp` is not a mode.
|
|
53
|
+
- Secrets/tokens: refuse dump. Text artifacts only; no binary.
|
|
54
|
+
- Protocol: `node_modules/@workerstack/repo/references/cascade.md`. Do not paste it here.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typescript-best-practices
|
|
3
|
+
description: >-
|
|
4
|
+
TypeScript best practices. Use when reading or editing any .ts or .tsx file,
|
|
5
|
+
or for /typescript-best-practices.
|
|
6
|
+
---
|
|
7
|
+
# TypeScript best practices
|
|
8
|
+
|
|
9
|
+
Make illegal states unrepresentable. Brand semantic primitives. Parse external data at boundaries. Exhaust variants. Derive types from the schema that owns the shape.
|
|
10
|
+
|
|
11
|
+
Validate at the boundary (CLI, config, network, external APIs). Trust types inside. Keep business logic in pure functions.
|
|
12
|
+
|
|
13
|
+
| Rule | Summary |
|
|
14
|
+
|------|---------|
|
|
15
|
+
| Discriminated unions | Model variants with a `kind` literal discriminant so impossible states can't be represented. No optional-field bags. |
|
|
16
|
+
| Branded types | Brand primitives with `& { readonly __brand: "X" }` so they can't be mixed up. Validate once at the boundary. A brand comes from a verifying type guard (`input is AgentId`), never from `as`. |
|
|
17
|
+
| Constructive modeling | Build the shape so the illegal value can't be constructed. `[T, ...T[]]` for non-empty, `[T, T][]` for even length, `start` plus `duration` for a range. Not a runtime guard, not a wish for refinement types. |
|
|
18
|
+
| Simplest total type | Keep `T[]` while every operation on it stays total. Strengthen to `NonEmpty<T>` only where the loose type forces `!`, a cast, or a "should never happen" throw. |
|
|
19
|
+
| `unknown` over `any` | External data is `unknown`. |
|
|
20
|
+
| Schemas before guards | Before hand-writing a property-by-property type guard, use the repository's runtime schema library and infer the type from the schema, such as `z.infer`. |
|
|
21
|
+
| No `as` casts | Every `as` is a runtime crash waiting. Cast only after validation. |
|
|
22
|
+
| Narrowing hierarchy | Discriminant switch > `in` operator > `typeof`/`instanceof` > user-defined type guard > `as`. |
|
|
23
|
+
| Type guards | Must verify the claim. A lying guard is worse than `as` because the bug hides behind a name that says it's safe. Name them `isX` or `hasX`. |
|
|
24
|
+
| Exhaustiveness | Inline `const _exhaustive: never = x;` in default arms so the compiler errors when a new variant is added. |
|
|
25
|
+
| `satisfies` over `as` | Validates the value without widening literal types. |
|
|
26
|
+
| Boundary validation | Parse where data crosses in, into a named domain type. `Record<string, unknown>` (however spelled) stops at that parse. Trust types inside. |
|
|
27
|
+
| Schema-derived types | Reach for `Pick`/`Omit`/`Parameters`/`ReturnType`/`Awaited`/`typeof` before declaring a new interface. |
|
|
28
|
+
| Object args | Pass objects, not positional, so argument order is self-documenting. Skip on hot paths (per-frame render, tokenizers, parsers). |
|
|
29
|
+
| Real tests | Don't mock what you can run. Prefer the framework's real test primitives with leak/disposable checks, and verify UI in a running build. Mock only what you can't run locally. |
|
|
30
|
+
| Structured telemetry | Prefer structured logger diagnostics with enough context to debug from an id. No `console.log` in shipped code. |
|
|
31
|
+
|
|
32
|
+
Examples: `references/patterns.md` next to this skill.
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
# TypeScript patterns
|
|
2
|
+
|
|
3
|
+
Code examples for each rule in `SKILL.md`. The underlying principles are language-agnostic.
|
|
4
|
+
|
|
5
|
+
## Branded types
|
|
6
|
+
|
|
7
|
+
Brand primitives so they can't be mixed up. Validate once at the boundary. Downstream code trusts the type.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type AgentId = string & { readonly __brand: "AgentId" };
|
|
11
|
+
|
|
12
|
+
function isAgentId(input: string): input is AgentId {
|
|
13
|
+
return isUUID(input);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function parseAgentId(input: string): AgentId {
|
|
17
|
+
if (!isAgentId(input)) throw new Error(`Invalid agent id: ${input}`);
|
|
18
|
+
return input;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function focusAgent(id: AgentId): void {
|
|
22
|
+
/* input is trusted */
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Match the `readonly __brand: 'X'` shape. Don't invent a new convention.
|
|
27
|
+
|
|
28
|
+
## Discriminated unions
|
|
29
|
+
|
|
30
|
+
Model variants with a literal discriminant. Every variant shares the field name and each variant's value is unique, so impossible combos can't be represented.
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// Don't. Boolean + optionals lets contradictory states exist.
|
|
34
|
+
type DiffState = { loading: boolean; diff?: GitDiff; error?: string };
|
|
35
|
+
|
|
36
|
+
// Do. Only valid states exist.
|
|
37
|
+
type DiffState =
|
|
38
|
+
| { kind: "loading" }
|
|
39
|
+
| { kind: "ready"; diff: GitDiff }
|
|
40
|
+
| { kind: "error"; error: string };
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Pick one discriminant name (`kind`, `type`, `tag`) and stick to it.
|
|
44
|
+
|
|
45
|
+
## Constructive modeling
|
|
46
|
+
|
|
47
|
+
Build the type from parts that are all legal instead of restricting a loose type with runtime checks.
|
|
48
|
+
|
|
49
|
+
Non-empty, via a variadic tuple:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
type NonEmpty<T> = [T, ...T[]];
|
|
53
|
+
|
|
54
|
+
// Don't: T[] plus a length check every caller must repeat
|
|
55
|
+
function pickWinner(entries: string[]): string {
|
|
56
|
+
if (entries.length === 0) throw new Error("no entries");
|
|
57
|
+
return entries[Math.floor(Math.random() * entries.length)];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Do: an empty value of the type can't exist
|
|
61
|
+
function pickWinner(entries: NonEmpty<string>): string {
|
|
62
|
+
return entries[Math.floor(Math.random() * entries.length)];
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Where a plain `T[]` arrives, narrow once with a guard. The fact then travels in the type:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
const isNonEmpty = <T>(arr: T[]): arr is NonEmpty<T> => arr.length > 0;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Even length, as pairs:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
type Pairs<T> = [T, T][];
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
A time range, as start plus duration:
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
// Don't: a comment holds the invariant
|
|
82
|
+
type TimeRange = { start: Date; end: Date }; // start <= end
|
|
83
|
+
|
|
84
|
+
// Do: a negative range can't be written; derive end when needed
|
|
85
|
+
type TimeRange = { start: Date; durationMs: number };
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Keep `durationMs` a plain number. Brand it (per Branded types) only if a raw number could be passed where a duration is expected, not by reflex. Pick the representation that makes the bad state unconstructable, then expose the reading you need on top (`pairs.flat()`, a `rangeEnd()` helper).
|
|
89
|
+
|
|
90
|
+
## Simplest total type
|
|
91
|
+
|
|
92
|
+
Don't strengthen everything. Keep `T[]` when every operation on it is total:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
const sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0); // [] is 0, fine
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Strengthen when the loose type forces a lie at a use site. The tells are `!`, `arr[0] as T`, and a "should never happen" throw:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
// Don't: partiality smuggled past the compiler
|
|
102
|
+
function newestSession(sessions: Session[]): Session {
|
|
103
|
+
return sessions.at(0)!;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Do: strengthen the input; the assertion disappears
|
|
107
|
+
function newestSession(sessions: NonEmpty<Session>): Session {
|
|
108
|
+
return sessions[0];
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Weakening the result to `Session | undefined` is the other total signature.
|
|
113
|
+
|
|
114
|
+
## `unknown` over `any`
|
|
115
|
+
|
|
116
|
+
External data is always `unknown`. Narrow before use.
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
// Don't
|
|
120
|
+
function handle(input: any) {
|
|
121
|
+
return input.foo.bar;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Do
|
|
125
|
+
function handle(input: unknown) {
|
|
126
|
+
if (typeof input === "object" && input !== null && "foo" in input) {
|
|
127
|
+
// narrowed; compiler verifies access
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
External sources include RPC payloads, `JSON.parse`, `postMessage`, IPC, file contents, environment variables, database results.
|
|
133
|
+
|
|
134
|
+
## Schemas before hand-rolled guards
|
|
135
|
+
|
|
136
|
+
Before writing a property-by-property type guard for external data, look for the repository's runtime schema library and existing schemas. Let one schema own validation and derive the TypeScript type from it. Do not maintain a schema, a duplicate interface, and a guard that can drift apart.
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { z } from "zod";
|
|
140
|
+
|
|
141
|
+
const UserSchema = z.object({
|
|
142
|
+
id: z.string().uuid(),
|
|
143
|
+
role: z.enum(["admin", "member"]),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
type User = z.infer<typeof UserSchema>;
|
|
147
|
+
|
|
148
|
+
function parseUser(input: unknown): User {
|
|
149
|
+
return UserSchema.parse(input);
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Use `safeParse` when failure is an expected branch. Use the equivalent inference helper when the repository uses another schema library. Do not add a new schema dependency for one guard. This rule prefers the schema system the codebase already trusts.
|
|
154
|
+
|
|
155
|
+
## No `as` casts
|
|
156
|
+
|
|
157
|
+
Every `as` is a potential runtime crash. Cast only after the type system has verified the claim.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { z } from "zod";
|
|
161
|
+
|
|
162
|
+
// Don't
|
|
163
|
+
const user = data as User;
|
|
164
|
+
|
|
165
|
+
// Don't
|
|
166
|
+
function isUser(data: unknown): data is User {
|
|
167
|
+
return typeof data === "object" && data !== null && "id" in data;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Do
|
|
171
|
+
const userSchema = z.object({ id: z.string(), name: z.string() });
|
|
172
|
+
type User = z.infer<typeof userSchema>;
|
|
173
|
+
|
|
174
|
+
function parseUser(data: unknown): User {
|
|
175
|
+
return userSchema.parse(data);
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
When the type comes first, annotate the validator with the type it proves. The compiler then rejects a validator that proves less than the type. Remove `name` from the object below and the assignment fails to compile.
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
type User = { id: string; name: string };
|
|
183
|
+
|
|
184
|
+
const userSchema: z.ZodType<User> = z.object({ id: z.string(), name: z.string() });
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
When refactoring an `as` out of existing code, identify why TypeScript can't infer:
|
|
188
|
+
|
|
189
|
+
- Missing discriminant: add one, switch to a discriminated union.
|
|
190
|
+
- Overly wide source type (e.g. `Record<string, unknown>`): narrow it.
|
|
191
|
+
- Untyped boundary: parse with the schema that owns the shape. Add a schema only where none exists.
|
|
192
|
+
- Genuinely inexpressible: use a branded type or `satisfies`.
|
|
193
|
+
|
|
194
|
+
## Narrowing hierarchy
|
|
195
|
+
|
|
196
|
+
From best to last-resort:
|
|
197
|
+
|
|
198
|
+
1. **Discriminated union switch / if.** Compiler narrows automatically.
|
|
199
|
+
2. **`in` operator.** `"key" in obj` narrows to variants containing that key.
|
|
200
|
+
3. **`typeof` / `instanceof`.** For primitives and class instances.
|
|
201
|
+
4. **User-defined type guard.** When the above aren't enough.
|
|
202
|
+
5. **`as` cast.** Only after validation.
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
function area(s: Shape): number {
|
|
206
|
+
if ("radius" in s) return Math.PI * s.radius ** 2; // narrowed to circle
|
|
207
|
+
return s.width * s.height; // narrowed to rect
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Type guards
|
|
212
|
+
|
|
213
|
+
A guard must actually verify the claim. A lying guard is worse than `as`.
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
function isCircle(s: Shape): s is Shape & { kind: "circle" } {
|
|
217
|
+
return s.kind === "circle";
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Prefer discriminant narrowing when possible.
|
|
222
|
+
|
|
223
|
+
## Exhaustiveness
|
|
224
|
+
|
|
225
|
+
In default arms, assign the discriminant to a `never`-typed local.
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
// Value-returning switch
|
|
229
|
+
function area(s: Shape): number {
|
|
230
|
+
switch (s.kind) {
|
|
231
|
+
case "circle":
|
|
232
|
+
return Math.PI * s.radius ** 2;
|
|
233
|
+
case "rect":
|
|
234
|
+
return s.width * s.height;
|
|
235
|
+
default: {
|
|
236
|
+
const _exhaustive: never = s;
|
|
237
|
+
return _exhaustive;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Void switch
|
|
243
|
+
function handle(s: Shape): void {
|
|
244
|
+
switch (s.kind) {
|
|
245
|
+
case "circle":
|
|
246
|
+
drawCircle(s);
|
|
247
|
+
break;
|
|
248
|
+
case "rect":
|
|
249
|
+
drawRect(s);
|
|
250
|
+
break;
|
|
251
|
+
default: {
|
|
252
|
+
const _exhaustive: never = s;
|
|
253
|
+
void _exhaustive;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Return-style in value-returning switches, void-style in statement switches.
|
|
260
|
+
|
|
261
|
+
## `satisfies` over `as`
|
|
262
|
+
|
|
263
|
+
`satisfies` validates without widening literal types.
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
// Don't. Widens, loses literal types.
|
|
267
|
+
const config = { theme: "dark", cols: 3 } as Config;
|
|
268
|
+
|
|
269
|
+
// Do. Validates AND preserves literal types.
|
|
270
|
+
const config = { theme: "dark", cols: 3 } satisfies Config;
|
|
271
|
+
// config.theme is "dark" (literal), not string
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Boundary validation
|
|
275
|
+
|
|
276
|
+
Validate once where data crosses in. Trust types inside.
|
|
277
|
+
|
|
278
|
+
- **Wire formats** (proto, JSON-RPC): parse with `ignoreUnknownFields` so forward-compatible changes don't break old clients.
|
|
279
|
+
- **Persisted JSON:** versioned blob with a try/catch around the parse.
|
|
280
|
+
- **Don't re-validate** deep in call chains.
|
|
281
|
+
|
|
282
|
+
## Schema-derived types
|
|
283
|
+
|
|
284
|
+
When a `.proto`, OpenAPI spec, GraphQL schema, or database migration already defines a shape, derive from the generated types instead of duplicating them.
|
|
285
|
+
|
|
286
|
+
```ts
|
|
287
|
+
// Don't. Duplicate shape, drifts when the schema changes.
|
|
288
|
+
type CheckSummary = {
|
|
289
|
+
totalCount: number;
|
|
290
|
+
checks: { name: string; status: string }[];
|
|
291
|
+
};
|
|
292
|
+
function renderChecks(s: CheckSummary) {
|
|
293
|
+
/* ... */
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Do. Derive from the generated schema type.
|
|
297
|
+
import type { ChecksMessage } from "<generated module>";
|
|
298
|
+
function renderChecks(s: Pick<ChecksMessage, "totalCount" | "checks">) {
|
|
299
|
+
/* ... */
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Reach for `Pick`, `Omit`, `Parameters`, `ReturnType`, `Awaited`, `typeof` before writing a new interface.
|
|
304
|
+
|
|
305
|
+
## Object args
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
// Don't. Swap two args, still compiles.
|
|
309
|
+
openFile(uri, {
|
|
310
|
+
startLineNumber: 10,
|
|
311
|
+
startColumn: 1,
|
|
312
|
+
endLineNumber: 10,
|
|
313
|
+
endColumn: 1,
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// Do. Order-independent, self-documenting.
|
|
317
|
+
openFile({
|
|
318
|
+
uri,
|
|
319
|
+
selection: {
|
|
320
|
+
startLineNumber: 10,
|
|
321
|
+
startColumn: 1,
|
|
322
|
+
endLineNumber: 10,
|
|
323
|
+
endColumn: 1,
|
|
324
|
+
},
|
|
325
|
+
});
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Skip on hot paths: per-frame render, tokenizers, parsers, anything in a tight loop where the allocation cost matters.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unslop
|
|
3
|
+
description: Cut AI tells from any writing. Use for /unslop.
|
|
4
|
+
---
|
|
5
|
+
# Unslop
|
|
6
|
+
|
|
7
|
+
Edit text to remove AI patterns. Scan for the patterns below, then rewrite. Preserve meaning and match the intended tone.
|
|
8
|
+
|
|
9
|
+
Slash `/unslop` only. Not a session flag.
|
|
10
|
+
|
|
11
|
+
## Patterns to detect and fix
|
|
12
|
+
|
|
13
|
+
Rule numbers are stable ids that other skills cite. A removed rule leaves a gap.
|
|
14
|
+
|
|
15
|
+
### Content
|
|
16
|
+
|
|
17
|
+
3. **Superficial -ing phrases.** "highlighting...", "ensuring...", "reflecting...", "showcasing...", "fostering...". Delete or expand with real sources.
|
|
18
|
+
5. **Vague attributions.** "Experts believe", "Industry reports suggest", "Some critics argue". Name the source or delete.
|
|
19
|
+
|
|
20
|
+
### Language
|
|
21
|
+
|
|
22
|
+
7. **AI vocabulary.** Additionally, crucial, delve, enduring, enhance, fostering, garner, interplay, intricate, landscape (abstract), pivotal, showcase, tapestry (abstract), testament, underscore, vibrant. Replace with plain words.
|
|
23
|
+
8. **Fancy ways to say "is".** "serves as", "stands as", "boasts", "features". Say "is" or "has".
|
|
24
|
+
9. **"Not just X, but Y."** State the point directly instead.
|
|
25
|
+
10. **Rule of three.** Don't force ideas into groups of three. Use the natural number.
|
|
26
|
+
11. **Synonym cycling.** Protagonist, main character, central figure, hero all in one paragraph. Pick one, repeat it.
|
|
27
|
+
12. **False ranges.** "from X to Y" where X and Y aren't on a meaningful scale. List topics directly.
|
|
28
|
+
|
|
29
|
+
### Style
|
|
30
|
+
|
|
31
|
+
13. **Em dash overuse.** Avoid em dashes entirely. Use periods or commas only (no parentheses, no en dashes, no hyphen-as-dash substitutes). If a thought needs separation, end the sentence or use a comma.
|
|
32
|
+
14. **Colon overuse.** Colons are fine before a list or example, not as mid-sentence connectors. "If you're coming from traditional automation: instead of registering event handlers, you describe conditions" adds nothing with the colon. Rewrite to let the point stand on its own without comparison framing. "Describing when the scheduler should fire works best as plain English." Same meaning, no crutch punctuation.
|
|
33
|
+
15. **Boldface overuse.** Don't bold every proper noun or acronym.
|
|
34
|
+
16. **Inline-header lists.** The tell is a bold label and colon that restates the line: "**Performance:** Performance improved...". Convert those to prose. A bold lead-in that ends in a period, names the item, and is followed by genuinely new detail ("**Schema in TypeScript.** Tables live in one file.") is fine, not a tell.
|
|
35
|
+
17. **Title case headings.** Use sentence case.
|
|
36
|
+
18. **Decorative emojis.** Remove from headings and bullets.
|
|
37
|
+
19. **Curly quotes.** Use straight quotes.
|
|
38
|
+
|
|
39
|
+
### Communication artifacts
|
|
40
|
+
|
|
41
|
+
20. **Chatbot phrases.** "I hope this helps!", "Let me know if...", "Of course!", "Certainly!", "Found the smoking gun!" Remove.
|
|
42
|
+
22. **Sycophantic tone.** "Great question! You're absolutely right!" Respond directly.
|
|
43
|
+
|
|
44
|
+
### Filler
|
|
45
|
+
|
|
46
|
+
23. **Filler phrases.** "In order to" becomes "To". "Due to the fact that" becomes "Because". Delete "It is important to note that".
|
|
47
|
+
24. **Excessive hedging.** "could potentially possibly be argued that it might" becomes "may".
|
|
48
|
+
25. **Generic conclusions.** "The future looks bright." State specific plans or facts.
|
|
49
|
+
|
|
50
|
+
### Jargon
|
|
51
|
+
|
|
52
|
+
26. **Abstract metaphor nouns.** Substrate (base), wedge, wedge in (add), vector (way, method), locus, vantage, nexus, primitive as a noun, harness as a metaphor, surface as in "API surface", bedrock, scaffolding as a metaphor, modality, paradigm, gold-plating (more than the job needs), ratchet as a metaphor (the mechanism's real name, or a limit that only tightens), evacuate for moving code (move out), endgame (the last phase), north star, flywheel. These read as technical but usually have a plainer concrete word. Pick the concrete word.
|
|
53
|
+
|
|
54
|
+
### Plain speech
|
|
55
|
+
|
|
56
|
+
27. **Say what it does, not how it feels.** "the database stays close at hand", "SQL you can read", "types that follow your schema" name a feeling. The fix names the mechanism or a number: "`.toSQL()` returns the exact string sent to the database", "a column rename fails the build". Ask what the sentence tells the reader to do or know, then write that. If you can't restate it as a concrete instruction, fact, or number, cut it. One more check: if the sentence could appear unchanged in another project's docs, it says nothing about this one. Cut it.
|
|
57
|
+
28. **Shorten or split dense sentences.** If the reader has to backtrack to parse a sentence, break it in two or drop clauses. One idea per sentence.
|
|
58
|
+
29. **Active voice.** Prefer it. Catch "is/are/was/were + past participle" and name the actor: "queries are validated" becomes "the compiler validates queries", "the file is parsed by the loader" becomes "the loader parses the file". Passive is fine only when the actor is unknown or genuinely doesn't matter.
|
|
59
|
+
30. **Cut adverbs, or use a stronger verb.** "runs quickly" becomes "is fast" or the number, and "significantly improves" becomes the measured delta. An adverb propping up a weak verb means the verb is wrong.
|
|
60
|
+
31. **Prefer the plain word.** "utilize" and "leverage" become "use", "facilitate" becomes "help", "numerous" becomes "many", "in the event that" becomes "if". The fancier synonym is rarely clearer.
|
|
61
|
+
32. **Mannered prose.** Metaphor or flourish where a literal phrase exists: aphorisms ("wire it or delete it"), rhetorical fragments for effect, personified code ("the plan holds it"), figurative verbs ("rides along", "stands on"), stock framing phrases. "A dial worth turning" becomes "a parameter worth varying". Say what you mean. Rule 26 covers the metaphor nouns.
|
|
62
|
+
33. **Over-compression.** Dropped articles, verbless fragments, symbol-speak, and abbreviations that make the reader decode instead of read. "Parser rejects bad date → exit 2, no write" becomes "The parser rejects a bad date, exits with code 2, and writes nothing." Write whole sentences with their articles and verbs, and spell out arrows and abbreviations.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-plan
|
|
3
|
+
description: 'Write a local checklist under .tmp/repo/plans/. Then /implement-plan {n}.'
|
|
4
|
+
---
|
|
5
|
+
# write-plan
|
|
6
|
+
|
|
7
|
+
You author the plan. Persist under `.tmp/repo/plans/` via Write (hook runs `cli/scripts/persist-plan.ts`). Format: `node_modules/@workerstack/repo/references/plan-format.md`.
|
|
8
|
+
|
|
9
|
+
Empty task → ask for a task and stop.
|
|
10
|
+
|
|
11
|
+
Body's first line is `PLAN_NAME: <3-6 word name>`, then the `commit:` and `strategy:` lines, `# {slug}`, and the 5-line card (`WHAT`, `WHY`, `RISK`, `TOUCH`, `DONE`, padded to 7 columns, each line ≤120 characters) that sums up Goal and Steps for a glance. Then Goal, Usage, Context, Constraints, Watch-outs, Steps, Verify, and `## Previous mistakes` with `(none)`. Usage shows what a person or agent types and sees once the plan lands: every new or changed command, flag, output, error message, or file, in fenced blocks, with the before for each changed one; a plan with no visible change writes `No visible change:` and why. All boxes `[ ]`. Tests: new behavior or bug → failing test leaf before impl; other behavior → test leaf right after impl; docs/rename/config/generated → skip. Verify is the end gate.
|
|
12
|
+
|
|
13
|
+
After research, pick one type from `node_modules/@workerstack/repo/references/scope.md` ## Types. Context starts with `Task type: {name}` and `Named checks:`. Copy that row's checks into Steps or Verify, with a Read leaf for each named principle and for every fact in ## Facts that is true of this plan. No fact, no leaf. Each Read leaf goes first in the phase it gates, never in a phase of its own. Verify includes a Read leaf for `principle-prove-it-works`. For `cross-cut`, Context also holds architect lite: types, signatures, module map, and the rejected shape. A named check that does not apply is a Context skip with a reason.
|
|
14
|
+
|
|
15
|
+
Before you ask the user, read `principle-never-block-on-the-human`. Ask only when the user alone can answer or the action is destructive. Before a large dump or a fan-out, read `principle-guard-the-context-window` and route the bulk through `bun repo job`.
|
|
16
|
+
|
|
17
|
+
Leaves cite repo-relative paths (`cli/scripts/x.ts`): the plan's worktree `{serial}-{name}` does not exist yet, and `/implement-plan` applies the paths inside it. When adjacent phases write disjoint files, end each phase line with `(parallel: <path>, …)` listing every file its leaves write.
|
|
18
|
+
|
|
19
|
+
Before writing, run `bun repo lessons match` on the repo-relative paths the plan names. Cite each matched lesson path in Watch-outs with what this plan does about it; the save denies a plan that leaves one out. Lessons: `node_modules/@workerstack/repo/references/lessons.md`.
|
|
20
|
+
|
|
21
|
+
Author `commit: type(scope): subject` on its own line before persist (scope optional). Conventional Commits subject: imperative lowercase, no trailing period. Types: feat fix docs style refactor perf test build ci chore revert.
|
|
22
|
+
|
|
23
|
+
Author `strategy: default|review-fast|review-deep` on its own line beside `commit:`. `default` for a small or docs-only plan. `review-fast` for multi-phase code work. `review-deep` for cross-cut, hook or gate, or hard-to-undo work. A roadmap slice copies the roadmap's value unless its scope argues for another. Meanings: `node_modules/@workerstack/repo/references/plan-format.md`.
|
|
24
|
+
|
|
25
|
+
Author `mode: away` on its own line beside `strategy:` only when this session runs `/away`, and `mode: ask|auto|away` only when the person asked for that mode. Otherwise send no `mode:` line.
|
|
26
|
+
|
|
27
|
+
The plan is the proposal and caps the result (`node_modules/@workerstack/repo/references/scope.md`). A plan over 100 lines above `## Previous mistakes`, frontmatter included, is two or more slices: write a roadmap (`/write-roadmap`) instead. Before writing, research until every leaf is defensible; ask any plan-shaping question the user alone can answer, then research again on the answer. Do not default a plan-shaping choice. A minor open choice goes under Constraints as the chosen default plus "confirm".
|
|
28
|
+
|
|
29
|
+
After the save, spawn a fresh host agent whose prompt is only `/review-plan {n}` and the plan's absolute path (on Claude Code the `claude` agent type; scout is not the reviewer). Accept or reject each finding with a reason. Apply accepted ones to the same plan file and add one `- review: …` entry each to `## Previous mistakes`. One review round per write or revision. Bump frontmatter `reviews` by one in the same save that settles the round, even when it had no findings; send the full frontmatter for that save. Every Write that sends full frontmatter carries the current `reviews`: the save denies one that lowers or drops it.
|
|
30
|
+
|
|
31
|
+
On feedback, revise the same file (a Write of the saved path updates it in place) and add a `- feedback: …` entry for what the user rejected and what changed. Never edit or drop an earlier entry. When the mistake will happen again on other tasks, run `bun repo lessons match` on the files involved, then `bun repo lessons hit <slug> --evidence "plan {n}"` or write a new lesson inside the plan's worktree `{serial}-{name}` (`bun repo worktree add {serial}-{name}` if it is missing), so it lands with the plan's commit, and end the entry with `(lesson: {slug})`.
|
|
32
|
+
|
|
33
|
+
Report: serial N at the absolute path the Write returned (`/…/.tmp/repo/plans/{file}`, never repo-relative), the goal, the phase list, the top risks, and any assumption to confirm. Do not dump the plan. End with the closing line only after the review settled: `reviews` was bumped in the save after the review spawn. Before that the Stop hook blocks the line, and a `y` or `h` on an unsettled item is refused. Stop and end the reply with two lines: `Strategy: {s}, because …` in one sentence, then the closing line, `Reply "y" to run plan {n} (strategy: {s}), or "y {a}" / "y {b}", or "h" / "h fast" / "h deep" for a fresh session.` Each `{a}` and `{b}` is a strategy other than `{s}`, in the order default, review-fast, review-deep. When other reviewed plans or roadmaps from this session wait too, it stays one line: `Reply "y" to run plan {n} (strategy: {s}), then plan {m} (strategy: {s}), then roadmap {k} (strategy: {s}), or …, or "h" / "h fast" / "h deep" for a fresh session.` in run order, where each item shows the strategy in its file and the first `or` list holds every strategy that not all items hold. The Stop hook names the exact line when yours is off. Ask for approval no other way. A bare `y` approves exactly that line. `y {strategy}` approves it with that strategy, which the hook writes into each plan the line names. `h` hands the whole line to a fresh session and keeps each file's strategy; `h fast` and `h deep` write `review-fast` or `review-deep` first. The hook writes one handoff for the line; tell the person to run the `/pickup {serial}` it names in a fresh session, and do no work here. On feedback, revise this file, run `/review-plan` again, and stop again with the closing line. Run `/implement-plan {n}` in the same turn when the request said "plan and do it", or when `/implement-roadmap` is running a `locked` or `in-progress` roadmap. A plan-shaping question still stops.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-roadmap
|
|
3
|
+
description: >-
|
|
4
|
+
Write an ordered program of plans under .tmp/repo/roadmaps/. Use for
|
|
5
|
+
/write-roadmap. Stops for y, which locks and runs it.
|
|
6
|
+
---
|
|
7
|
+
# write-roadmap
|
|
8
|
+
|
|
9
|
+
You author the roadmap. First read `principle-sequence-verifiable-units` and follow it. Persist under `.tmp/repo/roadmaps/` via Write (hook runs `cli/scripts/persist-roadmap.ts`). Copy the shape below. All boxes `[ ]`. Status stays `draft` until the user replies `y`.
|
|
10
|
+
|
|
11
|
+
Author a bare `strategy: {value}` line above `ROADMAP_NAME:`. Values and the heuristic: `/write-plan`. Add a bare `mode: {value}` line beside it on the same terms as `/write-plan`: `away` when this session runs `/away`, or the mode the person asked for.
|
|
12
|
+
|
|
13
|
+
Before you ask the user, read `principle-never-block-on-the-human`. Ask only when the user alone can answer.
|
|
14
|
+
|
|
15
|
+
Two or more slices. One slice is `/write-plan`: say so and stop. Do not write a file.
|
|
16
|
+
|
|
17
|
+
Research until every slice is defensible. Ask only what changes the program. Then write the draft and stop.
|
|
18
|
+
|
|
19
|
+
After each save, spawn a fresh host agent whose prompt is only `/review-roadmap {n}` and the roadmap's absolute path (on Claude Code the `claude` agent type; scout is not the reviewer). Accept or reject each finding with a reason. Apply accepted ones to the same file and add one `- review: …` entry each to `## Previous mistakes`. Bump `reviews` by one in the save that settles the round, even with no findings: send a bare `reviews: {n}` line above `ROADMAP_NAME:`. The save denies a lower count.
|
|
20
|
+
|
|
21
|
+
On feedback, revise the same file (a Write of the saved path updates it in place), add a `- feedback: …` entry for what the user rejected and what changed, and run `/review-roadmap` again. Never edit or drop an earlier entry.
|
|
22
|
+
|
|
23
|
+
On `y`, set `status: locked` on the same file, then run `/implement-roadmap {n}`. On `h`, `h fast` or `h deep`, the hook writes the handoff: tell the person to run the `/pickup {serial}` it names in a fresh session, and do no work here. The save denies the lock while `reviews` is 0. Do not run `/write-plan` or `/implement-plan` from this skill.
|
|
24
|
+
|
|
25
|
+
Report the serial, the absolute path, the slice titles in order, the top risk, and the review findings you rejected with why. Stop and end the reply with two lines: `Strategy: {s}, because …` in one sentence, then the closing line from `/write-plan` for this roadmap, `Reply "y" to run roadmap {n} (strategy: {s}), or …, or "h" / "h fast" / "h deep" for a fresh session.`, in its queue form when other reviewed plans or roadmaps wait. Only after the review settled (`reviews` bumped since the review spawn); the Stop hook blocks it otherwise. Ask for approval no other way.
|
|
26
|
+
|
|
27
|
+
## Shape
|
|
28
|
+
|
|
29
|
+
`ROADMAP_NAME:` is 3–6 words. The hook turns it into the slug and the frontmatter. Do not invent `serial`, `created`, or `source`.
|
|
30
|
+
|
|
31
|
+
````
|
|
32
|
+
strategy: default
|
|
33
|
+
ROADMAP_NAME: auth program
|
|
34
|
+
|
|
35
|
+
# auth-program
|
|
36
|
+
|
|
37
|
+
WHAT auth ships as two slices: reserved types first, then the commit diff pass
|
|
38
|
+
WHY later slices add skills, so their names must be reserved first
|
|
39
|
+
RISK init and INDEX drift apart when a name changes
|
|
40
|
+
TOUCH init reserved names, INDEX, commit skills
|
|
41
|
+
DONE both slices done; repo init lists auth-types
|
|
42
|
+
|
|
43
|
+
## Order
|
|
44
|
+
1 [ ] auth types: Reserved names list the new skills.
|
|
45
|
+
2 [ ] commit diff pass: Commit skills strip narrating comments.
|
|
46
|
+
|
|
47
|
+
## Verify
|
|
48
|
+
3 [ ] Verify
|
|
49
|
+
3.1 [ ] both child plans have finished Verify
|
|
50
|
+
|
|
51
|
+
## Previous mistakes
|
|
52
|
+
(none)
|
|
53
|
+
````
|
|
54
|
+
|
|
55
|
+
## Row rules
|
|
56
|
+
|
|
57
|
+
- The card comes first, as in `/write-plan`: WHAT, WHY, RISK, TOUCH, DONE, text at column 8, at most 120 characters each.
|
|
58
|
+
- Headings, this order only: Order, Verify, Previous mistakes. No other `##`.
|
|
59
|
+
- Each slice is one line: `N [ ] {title, 2–6 words}: {one sentence}`. The sentence is what that slice's plan ships.
|
|
60
|
+
- Decisions, Usage, context and why a slice sits where it does go into that slice's plan, not the roadmap. `/implement-roadmap` writes each plan from its line.
|
|
61
|
+
- At most 60 lines above Previous mistakes. Past that, move detail into the slice plans.
|
|
62
|
+
- Omit `Location` on a draft. `/implement-roadmap` fills it with the absolute plan path.
|
|
63
|
+
- No Type. No Commit. Those go on the child plan.
|
|
64
|
+
- Verify is 1–5 leaves, `N.M [ ]`, same grammar as a plan.
|
|
65
|
+
- Previous mistakes is `(none)` on a new roadmap, then one `- {feedback|verify|review|premise|decision|slice}: {what was wrong} → {what changed}` line per entry (a decision is `- decision: {question} → {choice}, because {why}`), optional ` (lesson: {slug})`. Append-only.
|
|
66
|
+
- A roadmap saved in the old shape, with `## Goal`, keeps it on every revision: `node_modules/@workerstack/repo/references/roadmap-format.md`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implementer-deep
|
|
3
|
+
description: "Implements one reviewed phase. Writes product code and tests. Harder phases."
|
|
4
|
+
tier: implementer
|
|
5
|
+
exec: true
|
|
6
|
+
claudecode:
|
|
7
|
+
model: opus
|
|
8
|
+
effort: medium
|
|
9
|
+
autoCompactWindow: 350000
|
|
10
|
+
maxTurns: 100
|
|
11
|
+
permissionMode: bypassPermissions
|
|
12
|
+
omitClaudeMd: true
|
|
13
|
+
tools: [Read, Grep, Glob, Bash, Write, Edit]
|
|
14
|
+
disallowedTools: [Agent]
|
|
15
|
+
grokcli:
|
|
16
|
+
model: grok-4.7
|
|
17
|
+
maxTurns: 100
|
|
18
|
+
permission_mode: bypassPermissions
|
|
19
|
+
agents_md: false
|
|
20
|
+
mcpInheritance: none
|
|
21
|
+
tools: read_file, grep, list_dir, write, search_replace, run_terminal_command
|
|
22
|
+
codexcli:
|
|
23
|
+
model: gpt-6-luna
|
|
24
|
+
model_reasoning_effort: medium
|
|
25
|
+
sandbox_mode: danger-full-access
|
|
26
|
+
approval_policy: never
|
|
27
|
+
cursor:
|
|
28
|
+
model: inherit
|
|
29
|
+
antigravity-cli:
|
|
30
|
+
model: pro
|
|
31
|
+
subagent: true
|
|
32
|
+
mainAgent: false
|
|
33
|
+
inheritMcp: false
|
|
34
|
+
commandExecutionPolicy: eager
|
|
35
|
+
tools: [read_file, run_command, edit_file, write_file]
|
|
36
|
+
---
|
|
37
|
+
You implement one phase for a reviewer. The brief you receive is the whole task: the leaves of one phase, and any findings to fix. Do exactly that.
|
|
38
|
+
|
|
39
|
+
Write product files and tests only. Never write the plan, the journal, or anything under `.tmp/repo/plans` or `.tmp/repo/implementations`. The reviewer owns those.
|
|
40
|
+
|
|
41
|
+
Write only the files the brief lists.
|
|
42
|
+
|
|
43
|
+
Never stage and never commit. Leave every change in the working tree.
|
|
44
|
+
|
|
45
|
+
Write the failing test first when a leaf asks for one. Run it and see it fail. Then make the change. Run the phase's tests before you report.
|
|
46
|
+
|
|
47
|
+
Rules:
|
|
48
|
+
- Work only in the worktree the brief names.
|
|
49
|
+
- Run the CLI as `bun repo …`.
|
|
50
|
+
- Route big output through `bun repo job`: `--job test --query '<cmd>'` for tests, `--job exec` or `--job search` for anything else that prints a lot. Read a stash path only with offset and limit.
|
|
51
|
+
|
|
52
|
+
If a leaf cannot be done as written, stop and say why. Do not work around it.
|
|
53
|
+
|
|
54
|
+
End with exactly these three lines:
|
|
55
|
+
changed: <comma-separated repo-relative paths>
|
|
56
|
+
tests: <last test command> → exit <N>
|
|
57
|
+
status: done|partial|stuck
|