@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,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-encode-lessons-in-structure
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when you catch yourself writing the same instruction a second time, or
|
|
5
|
+
notice a recurring correction. Encode the rule as a lint, metadata flag,
|
|
6
|
+
runtime check, or script instead of more text. Use for
|
|
7
|
+
/principle-encode-lessons-in-structure.
|
|
8
|
+
---
|
|
9
|
+
# Encode Lessons in Structure
|
|
10
|
+
|
|
11
|
+
If the lesson needs judgment and cannot be encoded, make the instruction more prominent and add an example of the failure mode.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-encode-lessons-in-structure` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
**Corollary:** If the fix is structural, only use the structural fix. The instruction is the symptom.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-exhaust-the-design-space
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when facing a novel UI interaction or architectural decision with no
|
|
5
|
+
precedent in the codebase. Build 2-3 competing prototypes and compare side by
|
|
6
|
+
side before committing. Use for /principle-exhaust-the-design-space.
|
|
7
|
+
---
|
|
8
|
+
# Exhaust the Design Space
|
|
9
|
+
|
|
10
|
+
It also applies to product design decisions where user experience depends on feel, not logic.
|
|
11
|
+
|
|
12
|
+
Slash `/principle-exhaust-the-design-space` only. Not a session flag.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-experience-first
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when product, UX, or feature-scope tradeoffs come up. Choose user
|
|
5
|
+
delight over implementation convenience; ship fewer polished features over
|
|
6
|
+
more rough ones. Use for /principle-experience-first.
|
|
7
|
+
---
|
|
8
|
+
# Experience First
|
|
9
|
+
|
|
10
|
+
When implementation convenience conflicts with user delight, choose delight.
|
|
11
|
+
|
|
12
|
+
Slash `/principle-experience-first` only. Not a session flag.
|
|
13
|
+
|
|
14
|
+
- Every feature, control, and option must be justified
|
|
15
|
+
- Ship less, ship better (polished experience with three features beats rough one with ten)
|
|
16
|
+
- Prototype before committing (design decisions are cheaper in throwaway HTML than production code)
|
|
17
|
+
- Get the details right (transitions, alignment, spacing, feedback, error states)
|
|
18
|
+
- Tighten the core loop (every feature should serve the central workflow or get out of the way)
|
|
19
|
+
|
|
20
|
+
The user is whoever consumes the work. For a UI that is the end user. For a library or an internal API it is the colleague who imports it. The engineer who maintains the code next is a user too. Weigh their experience the same way, and explain impact from their perspective.
|
|
21
|
+
|
|
22
|
+
Foundations should serve the experience. Foundational thinking governs the *sequence* of work. This principle governs the *target*.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-explain-the-number
|
|
3
|
+
description: >-
|
|
4
|
+
Apply before you trust, report, or act on a number you measured: a speedup, a
|
|
5
|
+
regression, a throughput, a latency, or an eval result. Find what limits it,
|
|
6
|
+
and rule out that it measured something other than the work you think. Use for
|
|
7
|
+
/principle-explain-the-number.
|
|
8
|
+
---
|
|
9
|
+
# Explain the Number
|
|
10
|
+
|
|
11
|
+
- **Ask "why not double?"** Name the resource or code path that bounds the result, such as a core, a lock, the disk, the network, or the load generator itself. Get it from a profile or from system counters taken during a run, then map it to source. A guess from reading the code is not a limiter. If you cannot say why the number is not twice as good, you do not know what you measured.
|
|
12
|
+
- **List what else the number could be measuring, and rule out each one with evidence.** The usual suspects are errors, skipped or cached work, code that never ran, an untuned side (one left on default settings), noise, and a piece too small to matter end to end.
|
|
13
|
+
- **Keep the evidence with the number.** Put the run count, the spread, and the limiter in the notes or a linked artifact.
|
|
14
|
+
|
|
15
|
+
Slash `/principle-explain-the-number` only. Not a session flag.
|
|
16
|
+
|
|
17
|
+
For a performance number, run a full measured procedure: name the limiter, check tuning, count errors, repeat, check end-to-end relevance, and confirm the work happened. For an eval result, ask the same of the trials: did every run do the task, does the gap hold across trials and models, and does the scenario matter.
|
|
18
|
+
|
|
19
|
+
You skipped this when the evidence behind a number has no run count, no spread, or no named limiter, or when the time saved is larger than the time the changed piece took.
|
|
20
|
+
|
|
21
|
+
Distinct from `/principle-prove-it-works`, which checks that an output is real.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-fix-root-causes
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when debugging. Trace each symptom back to the first place the system
|
|
5
|
+
went wrong and fix it there. A guard is a fix only when the state it handles
|
|
6
|
+
is legitimate. Use for /principle-fix-root-causes.
|
|
7
|
+
---
|
|
8
|
+
# Fix Root Causes
|
|
9
|
+
|
|
10
|
+
When debugging, fix the fault, not the place where it surfaced. The symptom is where a wrong state became visible. The root cause is the first place the system did something it should not do, or failed to handle a state it should handle.
|
|
11
|
+
|
|
12
|
+
Slash `/principle-fix-root-causes` only. Not a session flag.
|
|
13
|
+
|
|
14
|
+
**Why:** A symptom fix hides the evidence and leaves the fault free to surface somewhere else. Each one makes the system harder to reason about, because the code now carries a workaround for a bug that nobody named.
|
|
15
|
+
|
|
16
|
+
**Pattern:**
|
|
17
|
+
- Reproduce first.
|
|
18
|
+
- Ask "why" at each step until the answer is a wrong decision in the code, not a consequence of an earlier one.
|
|
19
|
+
- When stuck, instrument. Read the actual error and the actual state. Do not guess.
|
|
20
|
+
- Ask whether the state that triggered the symptom is legitimate. If the system may be in that state, the code that broke on it is the root cause, and handling the state there is the fix. If the state should never exist, a check where it broke hides the bug. Find what produced the state. Guards, retries, swallowed errors, clamped values, and discarded state are the usual ways to hide a bug.
|
|
21
|
+
- When something fails only after a restart, suspect persisted state first: config files, caches, lock files, serialized state.
|
|
22
|
+
- Check for the pattern, not just the instance. Find every place with the same fault and fix them all.
|
|
23
|
+
- If a workaround needs a paragraph-long comment to justify it, the code is wrong. Fix the code, not the comment.
|
|
24
|
+
- If the deciding fact took a deep dig to find, propose the cheap, always-on signal that would have shown it at first look.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-foundational-thinking
|
|
3
|
+
description: >-
|
|
4
|
+
Apply before writing logic: choosing core types and data structures,
|
|
5
|
+
sequencing scaffold-vs-feature work, asking what concurrent actors share. Get
|
|
6
|
+
the data structures right so downstream code becomes obvious. Use for
|
|
7
|
+
/principle-foundational-thinking.
|
|
8
|
+
---
|
|
9
|
+
# Foundational Thinking
|
|
10
|
+
|
|
11
|
+
**Structural decisions** protect option value. **Code-level decisions** protect simplicity.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-foundational-thinking` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
**Data structures first.** Get the data shape right before writing logic. Define core types early, trace every access pattern, and choose structures that match the dominant paths.
|
|
16
|
+
|
|
17
|
+
At code level, DRY the structure, not every line. Types and data models should converge. Three similar statements still beat a premature abstraction. Prefer explicit over clever. Test behavior and edge cases, not line counts.
|
|
18
|
+
|
|
19
|
+
**Concurrency corollary.** Before sharing state between actors, ask "what happens if another actor modifies this concurrently?" If not "nothing", isolate.
|
|
20
|
+
|
|
21
|
+
**Scaffold first.** If something helps every later phase, do it first. Ask "does every subsequent phase benefit from this existing?" CI, linting, test infrastructure, and shared types are scaffold. Sequence for option value: setup before features, tests before fixes. Keep commits small and single-purpose.
|
|
22
|
+
|
|
23
|
+
Each increment should land a coherent abstraction or deepen one that exists. Do not spread a new capability across callers as special-case coordination.
|
|
24
|
+
|
|
25
|
+
Subtraction comes before scaffolding. Remove dead code first, then lay foundations.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-guard-the-context-window
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when context is filling up: large outputs, long files, repeated reads,
|
|
5
|
+
fan-out planning. Route bulk to job and `.tmp/repo/` scratch; keep
|
|
6
|
+
summaries in the session, not raw payloads. Use for
|
|
7
|
+
/principle-guard-the-context-window.
|
|
8
|
+
---
|
|
9
|
+
# Guard the Context Window
|
|
10
|
+
|
|
11
|
+
**Why:** Context overflow degrades reasoning quality, creates compression artifacts, and halts progress.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-guard-the-context-window` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
**Pattern:**
|
|
16
|
+
- **Size phases and cap scope.** Limit files per phase, set turn budgets, account for mechanism costs.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-laziness-protocol
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when refactoring, evaluating diff size, or tempted to add abstractions,
|
|
5
|
+
layers, or signal threading. Bias toward deletion and the smallest change that
|
|
6
|
+
solves the problem. Use for /principle-laziness-protocol.
|
|
7
|
+
---
|
|
8
|
+
# Laziness Protocol
|
|
9
|
+
|
|
10
|
+
- **Consolidate decisions.** Do not repeat the same choice in several places. Put it behind one source of truth and pass the result as a simple flag.
|
|
11
|
+
- **Minimize the diff.** Make the smallest change that solves the problem. Fewer lines beat "elegant" boilerplate.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-laziness-protocol` only. Not a session flag.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-make-operations-idempotent
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when designing commands, lifecycle steps, or processing loops that run
|
|
5
|
+
amid crashes, restarts, and retries. Converge to the same end state regardless
|
|
6
|
+
of partial prior runs. Use for /principle-make-operations-idempotent.
|
|
7
|
+
---
|
|
8
|
+
# Make Operations Idempotent
|
|
9
|
+
|
|
10
|
+
Design operations so they converge to the correct state regardless of how many times they run or where the previous run stopped. Every state-mutating operation should answer: "What happens if this runs twice? What happens if the previous run crashed halfway?"
|
|
11
|
+
|
|
12
|
+
Slash `/principle-make-operations-idempotent` only. Not a session flag.
|
|
13
|
+
|
|
14
|
+
**Why:** Commands, lifecycle operations, and processing loops run where crashes, restarts, and retries are normal. If partial state changes the next run's outcome, every restart becomes a debugging session.
|
|
15
|
+
|
|
16
|
+
**The idea:** derive each step from the state that exists, not from what the previous run meant to do. Read the current state, compare it to the goal, and apply only the difference. A step written this way is safe to repeat, because a repeat finds nothing left to do.
|
|
17
|
+
|
|
18
|
+
Anything a run leaves behind, such as a lock, a temporary file, a half-written record, or a claimed job, must be recognizable as stale by the next run. Judge staleness by evidence that stays true wherever the previous run could have stopped, not only in the common case. A marker that the next run cannot judge turns every crash into manual cleanup. For example, write to a temporary path and rename it into place, or compare artifacts by content instead of by creation order.
|
|
19
|
+
|
|
20
|
+
**The test:**
|
|
21
|
+
1. What happens if this runs twice in a row?
|
|
22
|
+
2. What happens if the previous run crashed at every possible point?
|
|
23
|
+
3. Does re-execution converge to the same end state?
|
|
24
|
+
|
|
25
|
+
If any answer is "it depends on what state was left behind," the operation needs a reconciliation step.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-migrate-callers-then-delete-legacy-apis
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when introducing a new internal API while old callers still exist.
|
|
5
|
+
Migrate callers and delete the old API in the same wave instead of preserving
|
|
6
|
+
compatibility layers. Use for
|
|
7
|
+
/principle-migrate-callers-then-delete-legacy-apis.
|
|
8
|
+
---
|
|
9
|
+
# Migrate Callers Then Delete Legacy APIs
|
|
10
|
+
|
|
11
|
+
- Update tests to assert the new contract, and delete tests that only protect pre-refactor implementation details
|
|
12
|
+
|
|
13
|
+
Slash `/principle-migrate-callers-then-delete-legacy-apis` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
**When this applies:**
|
|
16
|
+
- No external users depend on backward compatibility
|
|
17
|
+
- The project can absorb coordinated breaking changes
|
|
18
|
+
- The new API is part of a simplification or refactor initiative
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-minimize-reader-load
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when reviewing or shaping code that's hard to trace. Count layers
|
|
5
|
+
between question and answer, and hidden state in the reader's head; collapse
|
|
6
|
+
one-caller wrappers and shrink mutable scope. Use for
|
|
7
|
+
/principle-minimize-reader-load.
|
|
8
|
+
---
|
|
9
|
+
# Minimize Reader Load
|
|
10
|
+
|
|
11
|
+
Maintainability is the work a reader must do to understand code. Track two axes: **layers to trace** (indirections between the question and the answer) and **state to hold** (hidden or mutable context the reader must keep in their head). LOC, cyclomatic complexity, and "clean architecture" are proxies. Reader load is the thing that matters. The two axes are independent. A flat file with 50 globals can be as hard to reason about as a 6-layer adapter stack. Guard both. This is the human analog of `/principle-guard-the-context-window`. Working memory is finite for readers too.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-minimize-reader-load` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
- **Collapse layers** that cost more than they save: wrappers with one caller, adapters with no second implementation, speculative indirection that was never needed. Inline them.
|
|
16
|
+
- **Make adjacent layers change the abstraction.** A layer that repeats the same methods and arguments adds reader load without compression. Collapse pass-through layers.
|
|
17
|
+
- **Demand interface compression.** A broad interface that hides little complexity makes readers learn both the surface and the implementation. Prefer boundaries that hide meaningful decisions.
|
|
18
|
+
- **Shrink state scope:** prefer pure functions (returns over mutations), locals over fields, fields over module state, and module state over globals. Derive instead of sync.
|
|
19
|
+
- **Name the invariant at the boundary,** not in every consumer, so the reader learns it once.
|
|
20
|
+
- Before adding a layer or a piece of state, ask: does it reduce reader load elsewhere by at least as much?
|
|
21
|
+
|
|
22
|
+
**The test:** can a new reader answer "where does X come from?" and "what can change X?" in under 30 seconds? If not, cut layers or cut state.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-model-the-domain
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when writing stateful logic, or when code branches a lot or repeats a
|
|
5
|
+
shape assumption across files. Use for /principle-model-the-domain.
|
|
6
|
+
---
|
|
7
|
+
# Model the Domain
|
|
8
|
+
|
|
9
|
+
Encode the real domain in a data structure instead of scattering it across conditionals. A structure that matches the domain makes invalid states unrepresentable and deletes branches. Choosing it at write time is cheap. Recovering it later reads as a refactor and gets deferred.
|
|
10
|
+
|
|
11
|
+
Slash `/principle-model-the-domain` only. Not a session flag.
|
|
12
|
+
|
|
13
|
+
Reach for:
|
|
14
|
+
|
|
15
|
+
- A state machine instead of scattered booleans, phases, or lifecycle checks.
|
|
16
|
+
- A typed model instead of loose parameters or repeated shape assumptions.
|
|
17
|
+
- A map, registry, lookup table, or discriminated union instead of branching spread across files.
|
|
18
|
+
- A reducer or command/event model instead of ad hoc state mutations.
|
|
19
|
+
- A module organized around one body of domain knowledge instead of a sequence such as load, validate, transform, and save. Execution order is not ownership.
|
|
20
|
+
- A small module boundary that gathers repeated behavior, ownership, or invariants.
|
|
21
|
+
- A queue, cache, index, graph, tree, or normalized collection where the access pattern calls for it.
|
|
22
|
+
- Any other structure that fits. When none fits, work out what the code must never allow and how the data gets read, then find the structure that encodes exactly that.
|
|
23
|
+
|
|
24
|
+
Do not force an abstraction. Prefer boring code if the current shape is already clear, local, and unlikely to grow. Be skeptical of an abstraction that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk.
|
|
25
|
+
|
|
26
|
+
The sign that you skipped this is a new feature that grows an existing if/else chain by one more branch, or a second boolean that must stay in sync with the first. Temporal decomposition is another sign. Phase-named modules repeat the same domain rules across steps.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-never-block-on-the-human
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when tempted to ask 'should I do X?' on reversible work. Use for
|
|
5
|
+
/principle-never-block-on-the-human.
|
|
6
|
+
---
|
|
7
|
+
# Never Block on the Human
|
|
8
|
+
|
|
9
|
+
Don't ask preference on reversible execution. Make a reasonable call, do the work, and show the result. Stop for plan approval (scope.md), real blockers, and irreversible actions (force-push, delete production data, send external messages). A `locked` or `in-progress` roadmap that `/implement-roadmap` is running is already that approval.
|
|
10
|
+
|
|
11
|
+
Slash `/principle-never-block-on-the-human` only. Not a session flag.
|
|
12
|
+
|
|
13
|
+
- Proceed, then present. Do the work, show the result. Don't ask "should I do X?" Do X, explain why.
|
|
14
|
+
- Make the system self-healing. When you notice a problem, log it and fix it in the next round.
|
|
15
|
+
- Irreversible actions (force-push, delete production data, send external messages) still require confirmation.
|
|
16
|
+
- Reversible actions (write code, edit notes, split tasks) should proceed without blocking.
|
|
17
|
+
- Product direction comes from the human. Execution should not block.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-outcome-oriented-execution
|
|
3
|
+
description: >-
|
|
4
|
+
Apply during planned rewrites and migrations with explicit phase boundaries.
|
|
5
|
+
Converge on the target architecture; don't preserve smooth intermediate states
|
|
6
|
+
with throwaway compatibility code. Use for
|
|
7
|
+
/principle-outcome-oriented-execution.
|
|
8
|
+
---
|
|
9
|
+
# Outcome-Oriented Execution
|
|
10
|
+
|
|
11
|
+
Optimize for the intended, verifiable end state rather than preserving smooth intermediate states.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-outcome-oriented-execution` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
**Why:** Keeping every intermediate step fully stable often creates temporary compatibility code that becomes long-lived debt. Converge on the target architecture and prove correctness at explicit verification boundaries.
|
|
16
|
+
|
|
17
|
+
**Core rule:**
|
|
18
|
+
- Prioritize end-state integrity over transitional stability
|
|
19
|
+
- Intermediate breakage is acceptable when it is planned, scoped, and reversible
|
|
20
|
+
|
|
21
|
+
**Guardrails:**
|
|
22
|
+
- Use this for planned rewrites and migrations with explicit phase boundaries
|
|
23
|
+
- Declare where temporary breakage is acceptable
|
|
24
|
+
- Keep high-signal checks for actively touched areas while migrating
|
|
25
|
+
- Require full static and runtime verification at plan completion
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-prove-it-works
|
|
3
|
+
description: >-
|
|
4
|
+
Apply after completing a task, before declaring done. Verify against the real
|
|
5
|
+
artifact (run the feature, read the actual value, inspect the diff), not a
|
|
6
|
+
proxy, self-report, or 'it compiles.'. Use for /principle-prove-it-works.
|
|
7
|
+
---
|
|
8
|
+
# Prove It Works
|
|
9
|
+
|
|
10
|
+
Verify every task output by checking the real thing directly. Do not infer from proxies, self-reports, or "it compiles."
|
|
11
|
+
|
|
12
|
+
Slash `/principle-prove-it-works` only. Not a session flag.
|
|
13
|
+
|
|
14
|
+
**Why:** Unverified work has unknown correctness. Indirect verification (file mtimes, output freshness, agent self-reports, cached screenshots) feels cheaper than direct observation. Acting on a wrong inference costs far more than checking the source.
|
|
15
|
+
|
|
16
|
+
Check the real thing, not a proxy:
|
|
17
|
+
- Check process liveness directly, not indirectly through derived state
|
|
18
|
+
- Read the actual value, not a cached or derived representation
|
|
19
|
+
- When verification fails, suspect the observation method before suspecting the system
|
|
20
|
+
|
|
21
|
+
## Script the check when you can
|
|
22
|
+
|
|
23
|
+
The strongest proof is a deterministic script that re-runs the same comparison, not a one-time eyeball. Write the script, run it, and keep its output as an artifact a reviewer can re-run instead of trusting your word.
|
|
24
|
+
|
|
25
|
+
Keep the artifact visible for the human. Commit it only for large or complex work where the trail has to be auditable later, like a big port or migration.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-redesign-from-first-principles
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when integrating a new requirement into an existing design. Use for
|
|
5
|
+
/principle-redesign-from-first-principles.
|
|
6
|
+
---
|
|
7
|
+
# Redesign From First Principles
|
|
8
|
+
|
|
9
|
+
When integrating a change, don't bolt it onto the existing design. Redesign as if the requirement had been a foundational assumption from the start.
|
|
10
|
+
|
|
11
|
+
Slash `/principle-redesign-from-first-principles` only. Not a session flag.
|
|
12
|
+
|
|
13
|
+
- Read all affected files and understand the current design
|
|
14
|
+
- Ask: "if we were writing this from scratch with this new requirement, what would we build?"
|
|
15
|
+
- Propagate the change through every reference: types, docs, examples, rationale sections
|
|
16
|
+
- Think about the whole redesign, then deliver it incrementally
|
|
17
|
+
|
|
18
|
+
This is the method for preserving option value when integrating changes into an existing design.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-separate-before-serializing-shared-state
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when concurrent actors might write to the same file, branch, key, or
|
|
5
|
+
state object. Eliminate the sharing first; serialize structurally only when
|
|
6
|
+
one shared writer is a real invariant. Use for
|
|
7
|
+
/principle-separate-before-serializing-shared-state.
|
|
8
|
+
---
|
|
9
|
+
# Separate Before Serializing Shared State
|
|
10
|
+
|
|
11
|
+
When concurrent actors might share mutable state, first ask whether they need the same mutable object. If not, eliminate the sharing. When sharing is real, enforce serialization structurally: lockfiles, sequential phases, exclusive ownership. Instructions and conventions are not concurrency control.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-separate-before-serializing-shared-state` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
**Why:** Concurrent writes to shared state create race conditions that are intermittent, hard to reproduce, and expensive to debug.
|
|
16
|
+
|
|
17
|
+
**Pattern:**
|
|
18
|
+
1. **Identify shared mutable state** (files both read and write, branches both push to, APIs both define and consume).
|
|
19
|
+
2. **Default: eliminate the shared write target.** Ask: do these actors need one canonical object, or are they publishing independent facts? Give each actor its own owned file, key, branch, or state directory, and merge only at the read/reporting boundary. Two workers writing their own `lastX` field into one `state.json` is still shared mutation. `indexer-state.json` + `metrics-state.json` is not.
|
|
20
|
+
3. **Only when one shared write target is a real invariant, serialize access structurally** (lockfiles, sequential phases, single-writer actor, or atomic compare-and-swap). Treat "we need a lock" as a design smell to check, not as the default answer.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-sequence-verifiable-units
|
|
3
|
+
description: >-
|
|
4
|
+
Apply to multi-step work (sweeps, migrations, runs of similar edits) and to
|
|
5
|
+
how you stack commits and PRs. Break work into small units that each end in a
|
|
6
|
+
verifiable state, check each before the next, and order delivery so the
|
|
7
|
+
sequence proves itself to a reviewer. Use for
|
|
8
|
+
/principle-sequence-verifiable-units.
|
|
9
|
+
---
|
|
10
|
+
# Sequence work into verifiable units
|
|
11
|
+
|
|
12
|
+
Order work as a sequence of small units, each ending in a state you can check, and don't advance until the current one is green.
|
|
13
|
+
|
|
14
|
+
Slash `/principle-sequence-verifiable-units` only. Not a session flag.
|
|
15
|
+
|
|
16
|
+
**Why:** A break caught at the unit that caused it is cheap to localize. A break caught after a batch is buried, and you have already built further on a broken base. Sequencing those same units into a delivery a reviewer can replay turns "trust me" into "watch it go red, then green."
|
|
17
|
+
|
|
18
|
+
**Execution.** In a sweep, migration, or any run of similar edits, verify each change before starting the next. Each unit is a before/after bracket: known-good state, one change, run the check, then proceed. Rebase onto clean trunk first so every check measures against the real baseline. When a lever does the edits, the per-unit check is nearly free. Run it anyway.
|
|
19
|
+
|
|
20
|
+
**Delivery.** Stack commits and PRs in the order that proves the work. The canonical shape is the failing test first, then the fix on top. A plan with one `commit:` is one unit: its failing test and the fix land in that commit. A roadmap slice is that plan. Other story orders are a subtraction before the reshape, a baseline capture before the treatment, the scaffold before the feature. Each commit lands on its own and the sequence reads as an argument.
|
|
21
|
+
|
|
22
|
+
The sequencing complement to `/principle-prove-it-works`, which keeps each check real, and `/principle-build-the-lever`, which makes the per-unit check cheap.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-subtract-before-you-add
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when sequencing an addition, refactor, or rewrite. Remove dead code,
|
|
5
|
+
redundant validators, and stub references first, then build on the simpler
|
|
6
|
+
base. Use for /principle-subtract-before-you-add.
|
|
7
|
+
---
|
|
8
|
+
# Subtract Before You Add
|
|
9
|
+
|
|
10
|
+
When evolving a system, remove complexity first, then build. Default to subtraction.
|
|
11
|
+
|
|
12
|
+
Slash `/principle-subtract-before-you-add` only. Not a session flag.
|
|
13
|
+
|
|
14
|
+
Make simplification a continual investment. Leave the design slightly simpler and more capable behind the same or smaller surface than you found it.
|
|
15
|
+
|
|
16
|
+
- Sequence removal before construction
|
|
17
|
+
- Cut before you polish (get to the minimum before investing in quality)
|
|
18
|
+
- Design for observed usage, not speculative edge cases
|
|
19
|
+
- No speculative validators, parsers, or guards beyond what the spec demands
|
|
20
|
+
- Simplify prompts (remove redundant instructions, excessive templates)
|
|
21
|
+
- When a reference has no novel content, delete it rather than leaving a stub
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-test-behavior-not-implementation
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when you write, change, or keep a test. Assert what the code's users can
|
|
5
|
+
observe, so that the test fails when that behavior breaks and keeps passing
|
|
6
|
+
when only the internals change. Use for
|
|
7
|
+
/principle-test-behavior-not-implementation.
|
|
8
|
+
---
|
|
9
|
+
# Test Behavior, Not Implementation
|
|
10
|
+
|
|
11
|
+
A test is a claim about what the code does for its users: a caller, an end user, or another service. Behavior is what those users can observe through the interface they use. That includes return values, errors, state they can read back, and effects on systems outside the code, such as a request sent, a row written, or a message emitted. Implementation is what they cannot observe: private helpers, internal call order, intermediate data, and which internal collaborator did the work.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-test-behavior-not-implementation` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
Judge each test against two imagined edits:
|
|
16
|
+
|
|
17
|
+
- **Break the behavior.** Make the code return a wrong value, skip an effect, or do the effect twice. If the test still passes, it proves nothing. The usual causes are an assertion looser than the contract, an expected value computed by the code under test, a restated constant or prompt string that never runs the code that reads it, and an assertion on data that the test built itself.
|
|
18
|
+
- **Change the internals.** Keep every observable result the same and restructure the code underneath. If the test now fails, it is pinned to the implementation. It will need a rewrite on every refactor and still catches no bug.
|
|
19
|
+
|
|
20
|
+
Keep a test that catches the first edit and survives the second. Rewrite or delete the rest. To write a test that does both, drive the code through its users' interface with a concrete input. Derive the expected value from the requirement, not from a run of the code. Assert what the contract promises, no less and no more.
|
|
21
|
+
|
|
22
|
+
The contract decides, not the shape of the assertion. When "an empty cart never charges" is the promise, an assertion that the payment client got no call is behavior. Pair it with a case where the charge happens, so that the test shows it can see a call. The payload that a mocked external service receives is behavior, because that service observes it. A call to an internal helper is implementation, because no user can see it. An empty list is the exact answer when no record matches, and a hollow check when the test only needs some result. An exact error message pins wording that no caller reads. The error type that callers branch on is the contract.
|
|
23
|
+
|
|
24
|
+
A test can pin an invariant instead of a call, such as a key that must exist in two tables or a compile-time type check. The invariant is the behavior.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-type-system-discipline
|
|
3
|
+
description: >-
|
|
4
|
+
Apply when designing types, reviewing a function signature, or writing code in
|
|
5
|
+
any statically-typed language. Make illegal states unrepresentable, brand
|
|
6
|
+
semantic primitives, parse external data at boundaries, exhaust variants,
|
|
7
|
+
derive from authoritative schemas. Use for /principle-type-system-discipline.
|
|
8
|
+
---
|
|
9
|
+
# Type System Discipline
|
|
10
|
+
|
|
11
|
+
Make the compiler reject impossible states, mismatched primitives, and unhandled variants. Prefer defining errors and special cases out of existence over proliferating handlers. For TypeScript syntax, see `/typescript-best-practices`.
|
|
12
|
+
|
|
13
|
+
Slash `/principle-type-system-discipline` only. Not a session flag.
|
|
14
|
+
|
|
15
|
+
- **Brand semantic primitives.** `UserId` and `OrderId` are strings underneath but should not be interchangeable. Give each its own type, such as a branded intersection in TypeScript or a newtype elsewhere. Validate once at creation, trust the type downstream. If two arguments share a primitive type but mean different things, brand them.
|
|
16
|
+
- **External data is untyped until parsed.** RPC payloads, JSON, IPC messages, CLI args, config files, environment variables, database rows. Have a parse function at every boundary that turns unstructured input into the typed model. `/principle-boundary-discipline` says where to put validation.
|
|
17
|
+
- **Derive types from authoritative schemas.** When a protocol buffer, OpenAPI spec, GraphQL schema, database migration, design-token file, or another file owns a shape, derive from it instead of hand-rolling a parallel type. See `/principle-encode-lessons-in-structure`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-plan
|
|
3
|
+
description: Review a plan in a fresh agent before approval. Use for /review-plan.
|
|
4
|
+
---
|
|
5
|
+
# review-plan
|
|
6
|
+
|
|
7
|
+
You review one plan under `.tmp/repo/plans/` that someone else wrote. You start with no context from the writing session, and that is the point: judge the file, not the reasoning behind it. Format: `node_modules/@workerstack/repo/references/plan-format.md`. Lessons: `node_modules/@workerstack/repo/references/lessons.md`.
|
|
8
|
+
|
|
9
|
+
Slash `/review-plan {n|path}` only. Not a session flag. `/write-plan` runs it in a fresh agent after every write or revision. Run it yourself on any plan.
|
|
10
|
+
|
|
11
|
+
Read-only. Write nothing: not the plan, not a lesson, not a journal. The writer applies what it accepts and bumps the plan's `reviews` count in that save.
|
|
12
|
+
|
|
13
|
+
Rounds repeat: the first runs after `/write-plan`, another after each revision, and anyone can run one by hand. The count proves a round ran and was settled, not that it was good. A plan cannot move to `in-progress` until `reviews` is at least 1.
|
|
14
|
+
|
|
15
|
+
Scripts already enforce the format, the card's shape, the 100-line cap, reads-only phases, disjoint `parallel:` lists, the append-only `## Previous mistakes`, and the lesson citations. Do not re-check those. Check what a script cannot:
|
|
16
|
+
|
|
17
|
+
1. Read the plan in full.
|
|
18
|
+
2. Read its `## Previous mistakes`. Flag any leaf that brings a recorded mistake back.
|
|
19
|
+
3. Run `bun repo lessons match` on the paths the plan names (repo-relative or absolute; `match` is read-only and runs from the root). Read each matched lesson. Flag a lesson cited in Watch-outs that no leaf acts on.
|
|
20
|
+
4. Read each principle skill the plan names. Flag a leaf that goes against it.
|
|
21
|
+
5. Check the type row in `node_modules/@workerstack/repo/references/scope.md` ## Types and its ## Facts: a missing failing-test leaf, a named principle with no Read leaf, a Read leaf outside the phase it gates, or a named check dropped without a reason.
|
|
22
|
+
6. Flag a leaf that needs more planning before someone can do it: an open choice, a vague target, or a path that does not exist.
|
|
23
|
+
7. Flag a file the Steps must change that no leaf or allowlist names, and a caller or consumer the change can break that no leaf covers.
|
|
24
|
+
8. Compare `## Usage` with Steps. Flag each new or changed command, flag, output, error message, or file a person or agent touches that Usage does not show, a changed one shown without its before, and a `No visible change:` line on a plan that changes one.
|
|
25
|
+
9. Compare the card with Goal and Steps. Flag a `WHAT` or `DONE` that Goal and Verify do not back, a `TOUCH` that misses a file the Steps change, and a `RISK` no leaf or Watch-out covers.
|
|
26
|
+
10. For each `(parallel: …)` phase, flag a path its leaves name that is not in its list.
|
|
27
|
+
|
|
28
|
+
Reply with at most 10 findings, most severe first, one line each: `{leaf id or section}: {problem}; {fix}`. With nothing to flag, reply `no findings`. No praise and no summary.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-roadmap
|
|
3
|
+
description: Review a roadmap in a fresh agent before lock. Use for /review-roadmap.
|
|
4
|
+
---
|
|
5
|
+
# review-roadmap
|
|
6
|
+
|
|
7
|
+
You review one roadmap under `.tmp/repo/roadmaps/` that someone else wrote. You start with no context from the writing session, and that is the point: judge the file, not the reasoning behind it. Format: `node_modules/@workerstack/repo/references/roadmap-format.md`. Lessons: `node_modules/@workerstack/repo/references/lessons.md`.
|
|
8
|
+
|
|
9
|
+
Slash `/review-roadmap {n|path}` only. Not a session flag. `/write-roadmap` runs it in a fresh agent after every write or revision. Run it yourself on any roadmap.
|
|
10
|
+
|
|
11
|
+
Read-only. Write nothing: not the roadmap, not a plan, not a lesson. The writer applies what it accepts and bumps the roadmap's `reviews` count in that save.
|
|
12
|
+
|
|
13
|
+
Rounds repeat: the first runs after `/write-roadmap`, another after each revision, and anyone can run one by hand. The count proves a round ran and was settled, not that it was good. A roadmap cannot move to `locked` until `reviews` is at least 1.
|
|
14
|
+
|
|
15
|
+
Scripts already enforce the format and the append-only `## Previous mistakes`. Do not re-check those. Check what a script cannot:
|
|
16
|
+
|
|
17
|
+
1. Read the roadmap in full.
|
|
18
|
+
2. Read its `## Previous mistakes`. Flag a slice that brings a recorded mistake back.
|
|
19
|
+
3. Run `bun repo lessons match` on the paths the roadmap names (repo-relative or absolute; `match` is read-only and runs from the root). Read each matched lesson. Flag a slice that walks into one and no slice plan can avoid it.
|
|
20
|
+
4. Read `principle-sequence-verifiable-units`. Flag a slice that cannot be verified on its own, or that needs something a later slice ships.
|
|
21
|
+
5. Flag a slice that is really two plans, or half of one that should merge with its neighbor.
|
|
22
|
+
6. Flag a slice sentence too vague to write a plan from: an open choice, a vague target, or a path that does not exist.
|
|
23
|
+
7. Compare the card with the slices: flag a WHAT or DONE no slice ships, a RISK no slice handles, and a TOUCH that misses what the slices change.
|
|
24
|
+
8. Flag a Verify gate no one can run, and a DONE no Verify gate proves.
|
|
25
|
+
|
|
26
|
+
A roadmap saved in the old shape (with `## Goal`) keeps the old checks as well: flag a Decision with no rejected alternative, a slice Goal or Why that contradicts a Decision, a slice that walks into a matched lesson with no Watch-out, a program Goal no Verify gate proves, and compare `## Usage` with the slices: each new or changed command, flag, output, error message, or file it does not show, a changed one shown without its before, and a `No visible change:` line on a roadmap that changes one.
|
|
27
|
+
|
|
28
|
+
Reply with at most 10 findings, most severe first, one line each: `{slice number or section}: {problem}; {fix}`. With nothing to flag, reply `no findings`. No praise and no summary.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: show-me
|
|
3
|
+
description: 'Restate the current proposal as a concrete before and after: commands, output, errors, files.'
|
|
4
|
+
---
|
|
5
|
+
This reply only: restate the current proposal (the plan, roadmap, or change under discussion) as a concrete before and after. Not a mode switch or session flag. After this reply, revert to output.md.
|
|
6
|
+
|
|
7
|
+
Show what the person sees, not how it works:
|
|
8
|
+
- Before and after, side by side or one under the other, in fenced blocks.
|
|
9
|
+
- The exact commands they type, the output and errors they get back, and the files that change.
|
|
10
|
+
- No abstractions and no internal names they did not use.
|
|
11
|
+
- When the plan has a Usage section, take it from there. Do not invent what it does not show.
|
|
12
|
+
|
|
13
|
+
Example Usage line:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Before: `notes export --json` → error: unknown flag After: prints [{"id":1,…}] Files: src/cli.ts, src/export.ts
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
When a reviewed plan or roadmap waits for approval, end with the exact closing line `/write-plan` defines, ending ` or "h" / "h fast" / "h deep" for a fresh session.` Otherwise add nothing extra.
|
|
20
|
+
|
|
21
|
+
Slash `/show-me` only.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speak
|
|
3
|
+
description: >-
|
|
4
|
+
Text-to-speech via bun repo speak (ElevenLabs or OpenAI).
|
|
5
|
+
Output only.
|
|
6
|
+
---
|
|
7
|
+
# speak
|
|
8
|
+
|
|
9
|
+
When the user wants spoken audio, run `bun repo speak`. Spec: `node_modules/@workerstack/repo/references/speak.md`. Output only (text → mp3). Do not record a mic. Do not transcribe.
|
|
10
|
+
|
|
11
|
+
`whoami` · `voices` · `say --text T [--provider elevenlabs|openai] [--voice ID] [--out path] [--play]`.
|
|
12
|
+
|
|
13
|
+
Auth: `ELEVENLABS_API_KEY` or `OPENAI_API_KEY` or `~/.workerstack/speak.json`. Do not commit the key. Default voices: ElevenLabs George (`JBFqnCBsd6RMkjVDRZzb`), OpenAI `coral`.
|
|
14
|
+
|
|
15
|
+
If the CLI exits non-zero, print its message. Lines with `setup:` are for the user — show that command. Tell them to run `bun repo setup speak` (or `bun repo setup`) in their terminal. Do not dump JSON. Do not invent a key. Spec: `node_modules/@workerstack/repo/references/speak.md` `node_modules/@workerstack/repo/references/setup.md`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: su
|
|
3
|
+
description: 'Short status update: done, next, and blockers or on-track ETA.'
|
|
4
|
+
---
|
|
5
|
+
This reply only: a status update in two to four short lines. No process narration.
|
|
6
|
+
|
|
7
|
+
- Done: what is finished. Flag anything unverified.
|
|
8
|
+
- Next: the immediate next step.
|
|
9
|
+
- Health: if stuck, blocked, broken, or slipping, say so plainly. Otherwise "On track" with a rough ETA (minutes, ~1h, end of session).
|
|
10
|
+
|
|
11
|
+
Never soften bad news or claim progress not made.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teach
|
|
3
|
+
description: >-
|
|
4
|
+
Explain a body of work plainly so a person actually understands it. Dig into
|
|
5
|
+
how it works and why it is that way, then weave that into one clear
|
|
6
|
+
explanation. Use for /teach, 'teach me this', 'help me really understand X',
|
|
7
|
+
'explain this change or subsystem to me'.
|
|
8
|
+
---
|
|
9
|
+
# Teach
|
|
10
|
+
|
|
11
|
+
**You explain what a thing is, how it works, and why it's built that way, in one plain account at the person's pace. The goal is that they understand it, not that you change anything.**
|
|
12
|
+
|
|
13
|
+
Slash `/teach` only. Not a session flag. Not `/explain` (that is a longer recap of this session's work).
|
|
14
|
+
|
|
15
|
+
Get your bearings on what the work is and what it touches, then find how it works and why it's that way. Those are real reads of the code and of the history, not a restatement of the question. Blend what they find into one plain explanation, lead with what matters to the person, and go deeper when they ask. Reword freely for teaching, with one exception. Keep confidence language from the history intact (its hedges are findings, not style).
|
|
16
|
+
|
|
17
|
+
1. Decide the few things they should walk away understanding. Choose them from why they're asking (about to change it, reviewing it, debugging it, new to it) and what they already know, both read from the conversation, not quizzed out of them. Skip what they plainly already know. Put the depth where their question is.
|
|
18
|
+
2. Dig, don't invent. Read the code yourself to get oriented, then work out how it works (runtime path, where things live, gotchas) and why it is that way (`git log` / `git blame`, `gh pr view` when a PR number is in the history, tickets when they exist). Do both in parallel when the question is a subsystem. Match the size to the question. One side may be enough for a small change. Keep the history sweep narrow by default. Put the narrowing in the ask itself (a scoped question, git plus a source or two) and record what you skipped, and widen it only when the reasons are the point.
|
|
19
|
+
3. Start with a plain definition. Name the thing and say what it is in general terms, the way a senior engineer would say it out loud, with its common name if it has one. Then tie it to the case in front of you ("in X, we use this to ...") and build from there: how it works, the deeper reasons, the edge cases. For each part, explain the idea so it clicks: the problem it solves and how it actually works. Walk through what happens as the person does the thing (opens a long chat, scrolls up) when that is what makes it land. Listing functions and constants is reference, not teaching. Don't print framing labels ("the one idea to hold onto", "the thing to walk away with", "the key insight", "at its core", "TL;DR"). Give the smallest complete answer first, a sentence or two, not a dense paragraph, then stop. Add layers when they ask. Never a wall of text.
|
|
20
|
+
4. Keep it a conversation, not a lecture or a performance. Offer to go deeper or move on, and follow their lead. No quizzes. No pacing theater. Don't print "Pause", don't ask them to say it back, don't announce "the sentence to nail", and don't flag a part as important or hard ("here is the part worth slowing down on", "this is the tricky part", "here is where it gets interesting"). Just say it. When you would pause, stop and let them respond. Running one-shot with no live human, deliver it cleanly and put any offer to go deeper at the end.
|
|
21
|
+
5. Show, don't only tell, and build the picture up diagram by diagram. Open the diff, the code, or the debugger when that is the fastest way to land it. Draw when a picture lands faster than words. For anything with three or more moving parts, do not draw one diagram with all of them at once. Draw a short series instead, where each diagram redraws the last and adds a single part, so the reader watches the system assemble. A single all-at-once diagram, especially one saved for the end, is a reference, not teaching. Concretely, to teach a flow from A to B to C, draw it three times. First A to B. Then redraw and add C. Then redraw and add the return edge or the next piece. Match the medium to the idea, and use both kinds when both help. A mermaid diagram fits a flow or structure where the labels carry the meaning. When the idea is spatial, like layout, overlap, scroll position, or a before and after, and the harness has an image-generation tool, draw it marker-on-whiteboard style with a few short labels, since image models garble long text. Generate that picture, don't settle for describing it in words. The build-up rule holds for generated images too. A single simple point needs no figure.
|
|
22
|
+
|
|
23
|
+
Write every response through `/unslop`, in plain spoken English, the way you'd explain it to a colleague. Be tight, not terse. Cut filler and hedging, keep the part that makes it click. State the concrete mechanism, not a metaphor, a framing, or a preview of what is coming. This is the target density: "Virtualization runs in two parts, one for rendering and one for loading from disk. When an item scrolls out past the buffer, both its DOM node and its in-memory data are evicted." Normal sentence case, not all-lowercase. No em dashes. Prefer periods over commas. Keep each sentence to one or two commas. If clauses pile up, split them into separate sentences. Give each concept one name and keep it. Avoid mirror sentences ("A without B, or B without A") and tidy closers ("the rest follows", "it all falls out"). The words in these steps are directions to you, not labels to print. Don't echo the structure as headers or stock phrases.
|
|
24
|
+
|
|
25
|
+
**Reply:** the explanation itself, never a report about what you did or delivered. Lead with the main point, then the plain account of what it is, how it works, and why, and the threads worth chasing next.
|