@pennyfarthing/core 7.9.2 → 7.9.5
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/package.json +2 -2
- package/pennyfarthing-dist/agents/README.md +348 -0
- package/pennyfarthing-dist/agents/architect.md +180 -0
- package/pennyfarthing-dist/agents/dev.md +169 -0
- package/pennyfarthing-dist/agents/devops.md +203 -0
- package/pennyfarthing-dist/agents/handoff.md +235 -0
- package/pennyfarthing-dist/agents/orchestrator.md +182 -0
- package/pennyfarthing-dist/agents/pm.md +152 -0
- package/pennyfarthing-dist/agents/reviewer-preflight.md +129 -0
- package/pennyfarthing-dist/agents/reviewer.md +180 -0
- package/pennyfarthing-dist/agents/sm-file-summary.md +79 -0
- package/pennyfarthing-dist/agents/sm-finish.md +82 -0
- package/pennyfarthing-dist/agents/sm-handoff.md +129 -0
- package/pennyfarthing-dist/agents/sm-setup.md +251 -0
- package/pennyfarthing-dist/agents/sm.md +284 -0
- package/pennyfarthing-dist/agents/tea.md +161 -0
- package/pennyfarthing-dist/agents/tech-writer.md +226 -0
- package/pennyfarthing-dist/agents/testing-runner.md +184 -0
- package/pennyfarthing-dist/agents/ux-designer.md +236 -0
- package/pennyfarthing-dist/agents/workflow-status-check.md +96 -0
- package/pennyfarthing-dist/commands/architect.md +7 -0
- package/pennyfarthing-dist/commands/benchmark-control.md +69 -0
- package/pennyfarthing-dist/commands/benchmark.md +485 -0
- package/pennyfarthing-dist/commands/brainstorming.md +91 -0
- package/pennyfarthing-dist/commands/check.md +156 -0
- package/pennyfarthing-dist/commands/chore.md +178 -0
- package/pennyfarthing-dist/commands/close-epic.md +139 -0
- package/pennyfarthing-dist/commands/continue-session.md +184 -0
- package/pennyfarthing-dist/commands/create-branches-from-story.md +358 -0
- package/pennyfarthing-dist/commands/create-theme.md +29 -0
- package/pennyfarthing-dist/commands/dev.md +7 -0
- package/pennyfarthing-dist/commands/devops.md +7 -0
- package/pennyfarthing-dist/commands/git-cleanup.md +51 -0
- package/pennyfarthing-dist/commands/health-check.md +141 -0
- package/pennyfarthing-dist/commands/help.md +264 -0
- package/pennyfarthing-dist/commands/job-fair.md +102 -0
- package/pennyfarthing-dist/commands/list-themes.md +21 -0
- package/pennyfarthing-dist/commands/orchestrator.md +7 -0
- package/pennyfarthing-dist/commands/parallel-work.md +71 -0
- package/pennyfarthing-dist/commands/party-mode.md +77 -0
- package/pennyfarthing-dist/commands/permissions.md +193 -0
- package/pennyfarthing-dist/commands/pm.md +7 -0
- package/pennyfarthing-dist/commands/prime.md +140 -0
- package/pennyfarthing-dist/commands/release.md +58 -0
- package/pennyfarthing-dist/commands/repo-status.md +49 -0
- package/pennyfarthing-dist/commands/retro.md +200 -0
- package/pennyfarthing-dist/commands/reviewer.md +7 -0
- package/pennyfarthing-dist/commands/run-ci.md +116 -0
- package/pennyfarthing-dist/commands/set-theme.md +56 -0
- package/pennyfarthing-dist/commands/show-theme.md +21 -0
- package/pennyfarthing-dist/commands/sm.md +7 -0
- package/pennyfarthing-dist/commands/solo.md +447 -0
- package/pennyfarthing-dist/commands/sprint-planning.md +109 -0
- package/pennyfarthing-dist/commands/sprint.md +133 -0
- package/pennyfarthing-dist/commands/standalone.md +194 -0
- package/pennyfarthing-dist/commands/start-epic.md +168 -0
- package/pennyfarthing-dist/commands/sync-epic-to-jira.md +184 -0
- package/pennyfarthing-dist/commands/sync-work-with-sprint.md +373 -0
- package/pennyfarthing-dist/commands/tea.md +7 -0
- package/pennyfarthing-dist/commands/tech-writer.md +7 -0
- package/pennyfarthing-dist/commands/theme-maker.md +676 -0
- package/pennyfarthing-dist/commands/update-domain-docs.md +83 -0
- package/pennyfarthing-dist/commands/ux-designer.md +7 -0
- package/pennyfarthing-dist/commands/work.md +23 -0
- package/pennyfarthing-dist/commands/workflow.md +21 -0
- package/pennyfarthing-dist/guides/agent-behavior.md +311 -0
- package/pennyfarthing-dist/guides/agent-coordination.md +480 -0
- package/pennyfarthing-dist/guides/agent-tag-taxonomy.md +432 -0
- package/pennyfarthing-dist/guides/agent-template-strategic.md +148 -0
- package/pennyfarthing-dist/guides/agent-template-tactical.md +162 -0
- package/pennyfarthing-dist/guides/hooks.md +230 -0
- package/pennyfarthing-dist/guides/measurement-framework.md +210 -0
- package/pennyfarthing-dist/guides/patterns/approval-gates-pattern.md +766 -0
- package/pennyfarthing-dist/guides/patterns/fan-out-fan-in-pattern.md +574 -0
- package/pennyfarthing-dist/guides/patterns/helper-delegation-pattern.md +488 -0
- package/pennyfarthing-dist/guides/patterns/tdd-flow-pattern.md +402 -0
- package/pennyfarthing-dist/guides/permission-protocol.md +188 -0
- package/pennyfarthing-dist/guides/persona-loading.md +46 -0
- package/pennyfarthing-dist/guides/prompt-patterns.md +338 -0
- package/pennyfarthing-dist/guides/scale-levels.md +114 -0
- package/pennyfarthing-dist/guides/session-artifacts.md +193 -0
- package/pennyfarthing-dist/guides/workflow-schema.md +257 -0
- package/pennyfarthing-dist/guides/worktree-mode.md +113 -0
- package/pennyfarthing-dist/guides/xml-tags.md +335 -0
- package/pennyfarthing-dist/output-styles/teaching.md +33 -0
- package/pennyfarthing-dist/output-styles/terse.md +20 -0
- package/pennyfarthing-dist/output-styles/verbose.md +28 -0
- package/pennyfarthing-dist/personas/BENCHMARK-METHODOLOGY.md +105 -0
- package/pennyfarthing-dist/personas/OCEAN-BENCHMARKING.md +210 -0
- package/pennyfarthing-dist/personas/TRAIL-OCEAN-MAPPING.md +168 -0
- package/pennyfarthing-dist/personas/ZEITGEIST-ANALYSIS.md +171 -0
- package/pennyfarthing-dist/personas/attributes.yaml +69 -0
- package/pennyfarthing-dist/personas/scripts/add-zeitgeist-calibrated.py +81 -0
- package/pennyfarthing-dist/personas/scripts/add-zeitgeist-scores.sh +56 -0
- package/pennyfarthing-dist/personas/themes/1984.yaml +304 -0
- package/pennyfarthing-dist/personas/themes/a-team.yaml +331 -0
- package/pennyfarthing-dist/personas/themes/agatha-christie.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/alice-in-wonderland.yaml +324 -0
- package/pennyfarthing-dist/personas/themes/all-stars.yaml +326 -0
- package/pennyfarthing-dist/personas/themes/ancient-philosophers.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/ancient-strategists.yaml +298 -0
- package/pennyfarthing-dist/personas/themes/arcane.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/arthurian-mythos.yaml +327 -0
- package/pennyfarthing-dist/personas/themes/avatar-the-last-airbender.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/babylon-5.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/battlestar-galactica.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/better-call-saul.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/big-lebowski.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/black-sails.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/blade-runner.yaml +289 -0
- package/pennyfarthing-dist/personas/themes/bobiverse.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/breaking-bad.yaml +319 -0
- package/pennyfarthing-dist/personas/themes/catch-22.yaml +304 -0
- package/pennyfarthing-dist/personas/themes/classical-composers.yaml +302 -0
- package/pennyfarthing-dist/personas/themes/control.yaml +201 -0
- package/pennyfarthing-dist/personas/themes/count-of-monte-cristo.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/cowboy-bebop.yaml +315 -0
- package/pennyfarthing-dist/personas/themes/deadwood.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/dickens.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/discworld.yaml +334 -0
- package/pennyfarthing-dist/personas/themes/doctor-who.yaml +284 -0
- package/pennyfarthing-dist/personas/themes/don-quixote.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/dune.yaml +301 -0
- package/pennyfarthing-dist/personas/themes/enlightenment-thinkers.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/expeditionary-force.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/fargo.yaml +322 -0
- package/pennyfarthing-dist/personas/themes/film-auteurs.yaml +304 -0
- package/pennyfarthing-dist/personas/themes/firefly.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/foundation.yaml +284 -0
- package/pennyfarthing-dist/personas/themes/futurama.yaml +313 -0
- package/pennyfarthing-dist/personas/themes/game-of-thrones.yaml +284 -0
- package/pennyfarthing-dist/personas/themes/gilligans-island.yaml +365 -0
- package/pennyfarthing-dist/personas/themes/gothic-literature.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/great-gatsby.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/greek-mythology.yaml +326 -0
- package/pennyfarthing-dist/personas/themes/hannibal.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/harry-potter.yaml +316 -0
- package/pennyfarthing-dist/personas/themes/his-dark-materials.yaml +285 -0
- package/pennyfarthing-dist/personas/themes/historical-figures.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/hitchhikers-guide.yaml +323 -0
- package/pennyfarthing-dist/personas/themes/house-md.yaml +313 -0
- package/pennyfarthing-dist/personas/themes/imperial-radch.yaml +283 -0
- package/pennyfarthing-dist/personas/themes/inspector-morse.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/jane-austen.yaml +281 -0
- package/pennyfarthing-dist/personas/themes/jazz-legends.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/justified.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/legion-of-doom.yaml +343 -0
- package/pennyfarthing-dist/personas/themes/les-miserables.yaml +293 -0
- package/pennyfarthing-dist/personas/themes/lord-of-the-rings.yaml +326 -0
- package/pennyfarthing-dist/personas/themes/lovecraft-mythos.yaml +325 -0
- package/pennyfarthing-dist/personas/themes/mad-max.yaml +349 -0
- package/pennyfarthing-dist/personas/themes/mad-men.yaml +283 -0
- package/pennyfarthing-dist/personas/themes/marvel-mcu.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/mash.yaml +329 -0
- package/pennyfarthing-dist/personas/themes/mass-effect.yaml +283 -0
- package/pennyfarthing-dist/personas/themes/military-commanders.yaml +298 -0
- package/pennyfarthing-dist/personas/themes/moby-dick.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/monty-python.yaml +297 -0
- package/pennyfarthing-dist/personas/themes/neuromancer.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/norse-mythology.yaml +321 -0
- package/pennyfarthing-dist/personas/themes/parks-and-rec.yaml +364 -0
- package/pennyfarthing-dist/personas/themes/peaky-blinders.yaml +292 -0
- package/pennyfarthing-dist/personas/themes/princess-bride.yaml +344 -0
- package/pennyfarthing-dist/personas/themes/renaissance-masters.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/rome.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/russian-masters.yaml +310 -0
- package/pennyfarthing-dist/personas/themes/sandman.yaml +282 -0
- package/pennyfarthing-dist/personas/themes/scientific-revolutionaries.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/shakespeare.yaml +295 -0
- package/pennyfarthing-dist/personas/themes/sherlock-holmes.yaml +283 -0
- package/pennyfarthing-dist/personas/themes/snow-crash.yaml +290 -0
- package/pennyfarthing-dist/personas/themes/software-pioneers.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/star-trek-tng.yaml +358 -0
- package/pennyfarthing-dist/personas/themes/star-trek-tos.yaml +327 -0
- package/pennyfarthing-dist/personas/themes/star-wars.yaml +297 -0
- package/pennyfarthing-dist/personas/themes/succession.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/superfriends.yaml +332 -0
- package/pennyfarthing-dist/personas/themes/ted-lasso.yaml +359 -0
- package/pennyfarthing-dist/personas/themes/the-americans.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/the-crown.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/the-expanse.yaml +337 -0
- package/pennyfarthing-dist/personas/themes/the-good-place.yaml +315 -0
- package/pennyfarthing-dist/personas/themes/the-matrix.yaml +342 -0
- package/pennyfarthing-dist/personas/themes/the-odyssey.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/the-office.yaml +323 -0
- package/pennyfarthing-dist/personas/themes/the-simpsons.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/the-sopranos.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/the-wire.yaml +303 -0
- package/pennyfarthing-dist/personas/themes/the-witcher.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/twin-peaks.yaml +296 -0
- package/pennyfarthing-dist/personas/themes/vorkosigan-saga.yaml +294 -0
- package/pennyfarthing-dist/personas/themes/watchmen.yaml +285 -0
- package/pennyfarthing-dist/personas/themes/west-wing.yaml +285 -0
- package/pennyfarthing-dist/personas/themes/world-explorers.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/wwii-leaders.yaml +299 -0
- package/pennyfarthing-dist/personas/themes/x-files.yaml +296 -0
- package/pennyfarthing-dist/personas/zeitgeist-scores.yaml +1172 -0
- package/pennyfarthing-dist/scripts/README.md +87 -0
- package/pennyfarthing-dist/scripts/core/README.md +26 -0
- package/pennyfarthing-dist/scripts/core/agent-session.sh +383 -0
- package/pennyfarthing-dist/scripts/core/check-context.sh +280 -0
- package/pennyfarthing-dist/scripts/core/handoff-marker.sh +101 -0
- package/pennyfarthing-dist/scripts/core/phase-check-start.sh +95 -0
- package/pennyfarthing-dist/scripts/core/prime.sh +30 -0
- package/pennyfarthing-dist/scripts/core/run.sh +92 -0
- package/pennyfarthing-dist/scripts/cyclist/is-cyclist.sh +21 -0
- package/pennyfarthing-dist/scripts/git/README.md +25 -0
- package/pennyfarthing-dist/scripts/git/create-feature-branches.sh +267 -0
- package/pennyfarthing-dist/scripts/git/git-status-all.sh +152 -0
- package/pennyfarthing-dist/scripts/git/install-git-hooks.sh +91 -0
- package/pennyfarthing-dist/scripts/git/release.sh +215 -0
- package/pennyfarthing-dist/scripts/git/worktree-manager.sh +494 -0
- package/pennyfarthing-dist/scripts/health/drift-detection.sh +162 -0
- package/pennyfarthing-dist/scripts/hooks/README.md +32 -0
- package/pennyfarthing-dist/scripts/hooks/bell-mode-hook.sh +106 -0
- package/pennyfarthing-dist/scripts/hooks/context-circuit-breaker.sh +60 -0
- package/pennyfarthing-dist/scripts/hooks/context-warning.sh +65 -0
- package/pennyfarthing-dist/scripts/hooks/otel-auto-config.sh +35 -0
- package/pennyfarthing-dist/scripts/hooks/post-merge.sh +166 -0
- package/pennyfarthing-dist/scripts/hooks/pre-commit.sh +107 -0
- package/pennyfarthing-dist/scripts/hooks/pre-edit-check.sh +71 -0
- package/pennyfarthing-dist/scripts/hooks/pre-push.sh +54 -0
- package/pennyfarthing-dist/scripts/hooks/question-reflector-check.sh +20 -0
- package/pennyfarthing-dist/scripts/hooks/question_reflector_check.py +499 -0
- package/pennyfarthing-dist/scripts/hooks/session-start.sh +97 -0
- package/pennyfarthing-dist/scripts/hooks/session-stop.sh +65 -0
- package/pennyfarthing-dist/scripts/hooks/welcome-hook.sh +94 -0
- package/pennyfarthing-dist/scripts/jira/README.md +36 -0
- package/pennyfarthing-dist/scripts/jira/create-jira-epic.sh +101 -0
- package/pennyfarthing-dist/scripts/jira/create-jira-story.sh +97 -0
- package/pennyfarthing-dist/scripts/jira/jira-claim-story.sh +22 -0
- package/pennyfarthing-dist/scripts/jira/jira-lib.sh +464 -0
- package/pennyfarthing-dist/scripts/jira/jira-reconcile.sh +266 -0
- package/pennyfarthing-dist/scripts/jira/jira-sync-story.sh +18 -0
- package/pennyfarthing-dist/scripts/jira/jira-sync.sh +16 -0
- package/pennyfarthing-dist/scripts/jira/sync-epic-jira.sh +16 -0
- package/pennyfarthing-dist/scripts/jira/sync-epic-to-jira.sh +16 -0
- package/pennyfarthing-dist/scripts/lib/README.md +29 -0
- package/pennyfarthing-dist/scripts/lib/background-tasks.sh +177 -0
- package/pennyfarthing-dist/scripts/lib/checkpoint.sh +136 -0
- package/pennyfarthing-dist/scripts/lib/common.sh +212 -0
- package/pennyfarthing-dist/scripts/lib/file-lock.sh +269 -0
- package/pennyfarthing-dist/scripts/lib/find-root.sh +35 -0
- package/pennyfarthing-dist/scripts/lib/logging.sh +186 -0
- package/pennyfarthing-dist/scripts/lib/retry.sh +76 -0
- package/pennyfarthing-dist/scripts/maintenance/migrate-theme-schema.mjs +102 -0
- package/pennyfarthing-dist/scripts/maintenance/sidecar-health.sh +97 -0
- package/pennyfarthing-dist/scripts/misc/README.md +44 -0
- package/pennyfarthing-dist/scripts/misc/add-short-names.sh +13 -0
- package/pennyfarthing-dist/scripts/misc/add_short_names.py +226 -0
- package/pennyfarthing-dist/scripts/misc/backlog.sh +91 -0
- package/pennyfarthing-dist/scripts/misc/check-status.sh +247 -0
- package/pennyfarthing-dist/scripts/misc/find-related-work.sh +231 -0
- package/pennyfarthing-dist/scripts/misc/generate-skill-docs.sh +122 -0
- package/pennyfarthing-dist/scripts/misc/log-skill-usage.sh +74 -0
- package/pennyfarthing-dist/scripts/misc/migrate-bmad-workflow.sh +10 -0
- package/pennyfarthing-dist/scripts/misc/migrate_bmad_workflow.py +319 -0
- package/pennyfarthing-dist/scripts/misc/repo-scan.sh +141 -0
- package/pennyfarthing-dist/scripts/misc/repo-utils.sh +778 -0
- package/pennyfarthing-dist/scripts/misc/run-ci.sh +219 -0
- package/pennyfarthing-dist/scripts/misc/run-timestamp.sh +7 -0
- package/pennyfarthing-dist/scripts/misc/session-cleanup.sh +319 -0
- package/pennyfarthing-dist/scripts/misc/skill-usage-report.sh +193 -0
- package/pennyfarthing-dist/scripts/misc/statusline.sh +259 -0
- package/pennyfarthing-dist/scripts/misc/uninstall.sh +270 -0
- package/pennyfarthing-dist/scripts/misc/validate-subagent-frontmatter.sh +160 -0
- package/pennyfarthing-dist/scripts/portraits/generate-portraits.py +400 -0
- package/pennyfarthing-dist/scripts/portraits/generate-portraits.sh +54 -0
- package/pennyfarthing-dist/scripts/sprint/README.md +29 -0
- package/pennyfarthing-dist/scripts/sprint/archive-story.sh +139 -0
- package/pennyfarthing-dist/scripts/sprint/available-stories.sh +97 -0
- package/pennyfarthing-dist/scripts/sprint/check-story.sh +164 -0
- package/pennyfarthing-dist/scripts/sprint/get-epic-field.sh +58 -0
- package/pennyfarthing-dist/scripts/sprint/get-story-field.sh +69 -0
- package/pennyfarthing-dist/scripts/sprint/import-epic-to-future.sh +10 -0
- package/pennyfarthing-dist/scripts/sprint/import_epic_to_future.py +270 -0
- package/pennyfarthing-dist/scripts/sprint/list-future.sh +151 -0
- package/pennyfarthing-dist/scripts/sprint/new-sprint.sh +116 -0
- package/pennyfarthing-dist/scripts/sprint/promote-epic.sh +154 -0
- package/pennyfarthing-dist/scripts/sprint/sprint-common.sh +421 -0
- package/pennyfarthing-dist/scripts/sprint/sprint-info.sh +39 -0
- package/pennyfarthing-dist/scripts/sprint/sprint-metrics.sh +241 -0
- package/pennyfarthing-dist/scripts/sprint/sprint-status.sh +134 -0
- package/pennyfarthing-dist/scripts/story/README.md +23 -0
- package/pennyfarthing-dist/scripts/story/create-story.sh +19 -0
- package/pennyfarthing-dist/scripts/story/size-story.sh +18 -0
- package/pennyfarthing-dist/scripts/story/story-template.sh +18 -0
- package/pennyfarthing-dist/scripts/test/README.md +23 -0
- package/pennyfarthing-dist/scripts/test/ensure-swebench-data.sh +59 -0
- package/pennyfarthing-dist/scripts/test/ground-truth-judge.py +220 -0
- package/pennyfarthing-dist/scripts/test/swebench-judge.py +374 -0
- package/pennyfarthing-dist/scripts/test/test-cache.sh +165 -0
- package/pennyfarthing-dist/scripts/test/test-setup.sh +337 -0
- package/pennyfarthing-dist/scripts/tests/check.test.sh +582 -0
- package/pennyfarthing-dist/scripts/tests/dev-story-workflow-import.test.sh +515 -0
- package/pennyfarthing-dist/scripts/tests/epics-and-stories-workflow-import.test.sh +599 -0
- package/pennyfarthing-dist/scripts/tests/handoff-phase-update.test.sh +332 -0
- package/pennyfarthing-dist/scripts/tests/implementation-readiness-workflow-import.test.sh +573 -0
- package/pennyfarthing-dist/scripts/tests/migrate-bmad-workflow.test.sh +859 -0
- package/pennyfarthing-dist/scripts/tests/prd-workflow-import.test.sh +662 -0
- package/pennyfarthing-dist/scripts/tests/project-context-workflow-import.test.sh +589 -0
- package/pennyfarthing-dist/scripts/tests/test-character-voice.sh +105 -0
- package/pennyfarthing-dist/scripts/tests/test-drift-detection.sh +597 -0
- package/pennyfarthing-dist/scripts/tests/test-post-merge-hook.sh +514 -0
- package/pennyfarthing-dist/scripts/tests/test-session-checkpoint.sh +517 -0
- package/pennyfarthing-dist/scripts/tests/test-solo-command.sh +331 -0
- package/pennyfarthing-dist/scripts/tests/ux-design-workflow-import.test.sh +647 -0
- package/pennyfarthing-dist/scripts/theme/README.md +22 -0
- package/pennyfarthing-dist/scripts/theme/compute-theme-tiers.sh +13 -0
- package/pennyfarthing-dist/scripts/theme/compute_theme_tiers.py +402 -0
- package/pennyfarthing-dist/scripts/theme/list-themes.sh +73 -0
- package/pennyfarthing-dist/scripts/theme/update-theme-tiers.sh +97 -0
- package/pennyfarthing-dist/scripts/validation/validate-agent-schema.sh +576 -0
- package/pennyfarthing-dist/scripts/workflow/README.md +28 -0
- package/pennyfarthing-dist/scripts/workflow/check.py +502 -0
- package/pennyfarthing-dist/scripts/workflow/check.sh +24 -0
- package/pennyfarthing-dist/scripts/workflow/finish-story.sh +159 -0
- package/pennyfarthing-dist/scripts/workflow/fix-session-phase.sh +228 -0
- package/pennyfarthing-dist/scripts/workflow/get-workflow-type.py +61 -0
- package/pennyfarthing-dist/scripts/workflow/get-workflow-type.sh +13 -0
- package/pennyfarthing-dist/scripts/workflow/list-workflows.sh +130 -0
- package/pennyfarthing-dist/scripts/workflow/phase-owner.sh +40 -0
- package/pennyfarthing-dist/scripts/workflow/resume-workflow.sh +163 -0
- package/pennyfarthing-dist/scripts/workflow/show-workflow.sh +138 -0
- package/pennyfarthing-dist/scripts/workflow/start-workflow.sh +256 -0
- package/pennyfarthing-dist/scripts/workflow/workflow-status.sh +167 -0
- package/pennyfarthing-dist/skills/agentic-patterns/SKILL.md +242 -0
- package/pennyfarthing-dist/skills/changelog/SKILL.md +367 -0
- package/pennyfarthing-dist/skills/code-review/SKILL.md +168 -0
- package/pennyfarthing-dist/skills/context-engineering/SKILL.md +274 -0
- package/pennyfarthing-dist/skills/cyclist/SKILL.md +88 -0
- package/pennyfarthing-dist/skills/dev-patterns/SKILL.md +437 -0
- package/pennyfarthing-dist/skills/finalize-run/SKILL.md +258 -0
- package/pennyfarthing-dist/skills/jira/SKILL.md +484 -0
- package/pennyfarthing-dist/skills/judge/SKILL.md +636 -0
- package/pennyfarthing-dist/skills/just/SKILL.md +403 -0
- package/pennyfarthing-dist/skills/mermaid/SKILL.md +240 -0
- package/pennyfarthing-dist/skills/otel/skill.md +223 -0
- package/pennyfarthing-dist/skills/permissions/skill.md +172 -0
- package/pennyfarthing-dist/skills/persona-benchmark/SKILL.md +178 -0
- package/pennyfarthing-dist/skills/skill-registry.schema.json +107 -0
- package/pennyfarthing-dist/skills/skill-registry.yaml +393 -0
- package/pennyfarthing-dist/skills/sprint/scripts/archive-story.sh +101 -0
- package/pennyfarthing-dist/skills/sprint/scripts/available-stories.sh +97 -0
- package/pennyfarthing-dist/skills/sprint/scripts/check-story.sh +164 -0
- package/pennyfarthing-dist/skills/sprint/scripts/create-jira-epic.sh +101 -0
- package/pennyfarthing-dist/skills/sprint/scripts/new-sprint.sh +116 -0
- package/pennyfarthing-dist/skills/sprint/scripts/promote-epic.sh +164 -0
- package/pennyfarthing-dist/skills/sprint/scripts/sprint-info.sh +39 -0
- package/pennyfarthing-dist/skills/sprint/scripts/sprint-status.sh +147 -0
- package/pennyfarthing-dist/skills/sprint/scripts/sync-epic-jira.sh +86 -0
- package/pennyfarthing-dist/skills/sprint/skill.md +465 -0
- package/pennyfarthing-dist/skills/story/scripts/create-story.sh +159 -0
- package/pennyfarthing-dist/skills/story/scripts/size-story.sh +198 -0
- package/pennyfarthing-dist/skills/story/scripts/story-template.sh +162 -0
- package/pennyfarthing-dist/skills/story/skill.md +219 -0
- package/pennyfarthing-dist/skills/systematic-debugging/SKILL.md +390 -0
- package/pennyfarthing-dist/skills/testing/SKILL.md +99 -0
- package/pennyfarthing-dist/skills/testing/references/troubleshooting.md +124 -0
- package/pennyfarthing-dist/skills/theme/skill.md +129 -0
- package/pennyfarthing-dist/skills/theme-creation/SKILL.md +174 -0
- package/pennyfarthing-dist/skills/workflow/scripts/list-workflows.sh +91 -0
- package/pennyfarthing-dist/skills/workflow/scripts/resume-workflow.sh +163 -0
- package/pennyfarthing-dist/skills/workflow/scripts/show-workflow.sh +138 -0
- package/pennyfarthing-dist/skills/workflow/scripts/start-workflow.sh +273 -0
- package/pennyfarthing-dist/skills/workflow/scripts/workflow-status.sh +167 -0
- package/pennyfarthing-dist/skills/workflow/skill.md +337 -0
- package/pennyfarthing-dist/skills/yq/SKILL.md +264 -0
- package/pennyfarthing-dist/templates/LEADERBOARD.schema.yaml +187 -0
- package/pennyfarthing-dist/templates/LEADERBOARD.template.md +59 -0
- package/pennyfarthing-dist/templates/agent-scopes.yaml.template +276 -0
- package/pennyfarthing-dist/templates/pennyfarthing-settings.yaml.template +61 -0
- package/pennyfarthing-dist/templates/persona-config.yaml.template +22 -0
- package/pennyfarthing-dist/templates/preferences.yaml.template +15 -0
- package/pennyfarthing-dist/templates/settings.local.json.template +101 -0
- package/pennyfarthing-dist/templates/setup-env.sh.template +18 -0
- package/pennyfarthing-dist/templates/shared-context.md.template +70 -0
- package/pennyfarthing-dist/templates/sidecar/decisions.md.template +40 -0
- package/pennyfarthing-dist/templates/sidecar/gotchas.md.template +37 -0
- package/pennyfarthing-dist/templates/sidecar/patterns.md.template +34 -0
- package/pennyfarthing-dist/workflows/agent-docs.yaml +70 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-01-initialize.md +101 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-01b-continue.md +93 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-02-context.md +115 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-03-patterns.md +133 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-04-components.md +138 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-05-interfaces.md +133 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-06-risks.md +142 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-07-document.md +160 -0
- package/pennyfarthing-dist/workflows/architecture/templates/architecture-decision.md +102 -0
- package/pennyfarthing-dist/workflows/architecture.yaml +65 -0
- package/pennyfarthing-dist/workflows/bdd.yaml +60 -0
- package/pennyfarthing-dist/workflows/brainstorming/brain-methods.csv +62 -0
- package/pennyfarthing-dist/workflows/brainstorming/checklist.md +44 -0
- package/pennyfarthing-dist/workflows/brainstorming/instructions.md +736 -0
- package/pennyfarthing-dist/workflows/brainstorming/workflow.yaml +49 -0
- package/pennyfarthing-dist/workflows/code-review/checklist.md +23 -0
- package/pennyfarthing-dist/workflows/code-review/instructions.md +234 -0
- package/pennyfarthing-dist/workflows/code-review/workflow.yaml +51 -0
- package/pennyfarthing-dist/workflows/dev-story/checklist.md +80 -0
- package/pennyfarthing-dist/workflows/dev-story/instructions.xml +410 -0
- package/pennyfarthing-dist/workflows/dev-story/workflow.yaml +50 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-01-validate-prerequisites.md +256 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-02-design-epics.md +233 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-03-create-stories.md +272 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-04-final-validation.md +153 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-05-import-to-future.md +122 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/templates/epics-template.md +57 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/workflow.yaml +28 -0
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-01-analyze.md +101 -0
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-02-categorize.md +116 -0
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-03-execute.md +224 -0
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-04-verify.md +88 -0
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-05-complete.md +79 -0
- package/pennyfarthing-dist/workflows/git-cleanup.yaml +59 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-01-document-discovery.md +190 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-02-prd-analysis.md +178 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-03-epic-coverage-validation.md +179 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-04-ux-alignment.md +139 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-05-epic-quality-review.md +252 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-06-final-assessment.md +133 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/templates/readiness-report-template.md +4 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/workflow.yaml +40 -0
- package/pennyfarthing-dist/workflows/prd/data/domain-complexity.csv +13 -0
- package/pennyfarthing-dist/workflows/prd/data/prd-purpose.md +197 -0
- package/pennyfarthing-dist/workflows/prd/data/project-types.csv +11 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-01-init.md +191 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-01b-continue.md +153 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-02-discovery.md +224 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-03-success.md +226 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-04-journeys.md +213 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-05-domain.md +207 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-06-innovation.md +226 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-07-project-type.md +237 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-08-scoping.md +228 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-09-functional.md +231 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-10-nonfunctional.md +242 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-11-polish.md +217 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-12-complete.md +180 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-01-discovery.md +247 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-01b-legacy-conversion.md +208 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-02-review.md +249 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-03-edit.md +253 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-04-complete.md +168 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-01-discovery.md +218 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-02-format-detection.md +191 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-02b-parity-check.md +209 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-03-density-validation.md +174 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-04-brief-coverage-validation.md +214 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-05-measurability-validation.md +228 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-06-traceability-validation.md +217 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-07-implementation-leakage-validation.md +205 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-08-domain-compliance-validation.md +243 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-09-project-type-validation.md +263 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-10-smart-validation.md +209 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-11-holistic-quality-validation.md +264 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-12-completeness-validation.md +242 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-13-report-complete.md +232 -0
- package/pennyfarthing-dist/workflows/prd/templates/prd-template.md +10 -0
- package/pennyfarthing-dist/workflows/prd/workflow.yaml +42 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-01-init.md +177 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-01b-continue.md +161 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-02-vision.md +199 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-03-users.md +202 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-04-metrics.md +205 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-05-scope.md +219 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-06-complete.md +194 -0
- package/pennyfarthing-dist/workflows/product-brief/templates/product-brief.template.md +10 -0
- package/pennyfarthing-dist/workflows/product-brief/workflow.yaml +31 -0
- package/pennyfarthing-dist/workflows/project-context/project-context-template.md +21 -0
- package/pennyfarthing-dist/workflows/project-context/steps/step-01-discover.md +184 -0
- package/pennyfarthing-dist/workflows/project-context/steps/step-02-generate.md +318 -0
- package/pennyfarthing-dist/workflows/project-context/steps/step-03-complete.md +278 -0
- package/pennyfarthing-dist/workflows/project-context/workflow.yaml +27 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-01-mode-detection.md +156 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-02-context-gathering.md +120 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-03-execute.md +113 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-04-self-check.md +113 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-05-adversarial-review.md +106 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-06-resolve-findings.md +140 -0
- package/pennyfarthing-dist/workflows/quick-dev/workflow.yaml +27 -0
- package/pennyfarthing-dist/workflows/quick-spec/steps/step-01-understand.md +189 -0
- package/pennyfarthing-dist/workflows/quick-spec/steps/step-02-investigate.md +144 -0
- package/pennyfarthing-dist/workflows/quick-spec/steps/step-03-generate.md +128 -0
- package/pennyfarthing-dist/workflows/quick-spec/steps/step-04-review.md +191 -0
- package/pennyfarthing-dist/workflows/quick-spec/tech-spec-template.md +74 -0
- package/pennyfarthing-dist/workflows/quick-spec/workflow.yaml +27 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-01-init.md +137 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-02-domain-analysis.md +229 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-03-competitive-landscape.md +238 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-04-regulatory-focus.md +206 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-05-technical-trends.md +234 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-06-research-synthesis.md +443 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-01-init.md +182 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-02-customer-behavior.md +237 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-02-customer-insights.md +200 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-03-customer-pain-points.md +249 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-04-customer-decisions.md +259 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-05-competitive-analysis.md +177 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-06-research-completion.md +475 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-01-init.md +137 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-02-technical-overview.md +239 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-03-integration-patterns.md +248 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-04-architectural-patterns.md +202 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-05-implementation-research.md +239 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-06-research-synthesis.md +486 -0
- package/pennyfarthing-dist/workflows/research/templates/research.template.md +29 -0
- package/pennyfarthing-dist/workflows/research/workflow.yaml +45 -0
- package/pennyfarthing-dist/workflows/retrospective/checklist.md +31 -0
- package/pennyfarthing-dist/workflows/retrospective/instructions.md +1443 -0
- package/pennyfarthing-dist/workflows/retrospective/workflow.yaml +50 -0
- package/pennyfarthing-dist/workflows/sprint-planning/checklist.md +33 -0
- package/pennyfarthing-dist/workflows/sprint-planning/sprint-status-template.yaml +55 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-01-parse-epic-files.md +54 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-02-build-sprint-status.md +44 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-03-status-detection.md +64 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-04-generate-status-file.md +73 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-05-validate-and-report.md +56 -0
- package/pennyfarthing-dist/workflows/sprint-planning/workflow.yaml +34 -0
- package/pennyfarthing-dist/workflows/tdd.yaml +50 -0
- package/pennyfarthing-dist/workflows/trivial.yaml +40 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-01-init.md +135 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-01b-continue.md +127 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-02-discovery.md +190 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-03-core-experience.md +216 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-04-emotional-response.md +219 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-05-inspiration.md +234 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-06-design-system.md +252 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-07-defining-experience.md +254 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-08-visual-foundation.md +224 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-09-design-directions.md +224 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-10-user-journeys.md +241 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-11-component-strategy.md +248 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-12-ux-patterns.md +237 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-13-responsive-accessibility.md +264 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-14-complete.md +228 -0
- package/pennyfarthing-dist/workflows/ux-design/ux-design-template.md +13 -0
- package/pennyfarthing-dist/workflows/ux-design/workflow.yaml +41 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
#!/usr/bin/env zsh
|
|
2
|
+
# Pennyfarthing Release Script
|
|
3
|
+
# Merges develop to main and pushes both branches
|
|
4
|
+
#
|
|
5
|
+
# Usage: ./scripts/release.sh [OPTIONS]
|
|
6
|
+
#
|
|
7
|
+
# Options:
|
|
8
|
+
# --bump <type> Bump version before release (major|minor|patch)
|
|
9
|
+
# --dry-run Show what would happen without executing
|
|
10
|
+
# --help Show this help message
|
|
11
|
+
#
|
|
12
|
+
# Examples:
|
|
13
|
+
# ./scripts/release.sh # Just merge and push
|
|
14
|
+
# ./scripts/release.sh --bump patch # Bump patch version, then release
|
|
15
|
+
# ./scripts/release.sh --bump minor # Bump minor version, then release
|
|
16
|
+
# ./scripts/release.sh --dry-run # Preview what would happen
|
|
17
|
+
|
|
18
|
+
set -e
|
|
19
|
+
|
|
20
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
21
|
+
|
|
22
|
+
# Use exported PROJECT_ROOT from run.sh, or detect it
|
|
23
|
+
if [[ -z "${PROJECT_ROOT:-}" ]]; then
|
|
24
|
+
_dir="$PWD"
|
|
25
|
+
while [[ ! -d "$_dir/.pennyfarthing" ]] && [[ "$_dir" != "/" ]]; do
|
|
26
|
+
_dir="$(dirname "$_dir")"
|
|
27
|
+
done
|
|
28
|
+
if [[ -d "$_dir/.pennyfarthing" ]]; then
|
|
29
|
+
PROJECT_ROOT="$_dir"
|
|
30
|
+
else
|
|
31
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
32
|
+
fi
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
cd "$PROJECT_ROOT"
|
|
36
|
+
|
|
37
|
+
# Colors for output
|
|
38
|
+
RED='\033[0;31m'
|
|
39
|
+
GREEN='\033[0;32m'
|
|
40
|
+
YELLOW='\033[1;33m'
|
|
41
|
+
NC='\033[0m' # No Color
|
|
42
|
+
|
|
43
|
+
DRY_RUN=false
|
|
44
|
+
BUMP_TYPE=""
|
|
45
|
+
|
|
46
|
+
# Parse arguments
|
|
47
|
+
while [[ $# -gt 0 ]]; do
|
|
48
|
+
case $1 in
|
|
49
|
+
--dry-run)
|
|
50
|
+
DRY_RUN=true
|
|
51
|
+
shift
|
|
52
|
+
;;
|
|
53
|
+
--bump)
|
|
54
|
+
BUMP_TYPE="$2"
|
|
55
|
+
if [[ ! "$BUMP_TYPE" =~ ^(major|minor|patch)$ ]]; then
|
|
56
|
+
echo -e "${RED}[ERROR]${NC} Invalid bump type: $BUMP_TYPE"
|
|
57
|
+
echo "Valid types: major, minor, patch"
|
|
58
|
+
exit 1
|
|
59
|
+
fi
|
|
60
|
+
shift 2
|
|
61
|
+
;;
|
|
62
|
+
--help|-h)
|
|
63
|
+
head -20 "$0" | tail -18
|
|
64
|
+
exit 0
|
|
65
|
+
;;
|
|
66
|
+
*)
|
|
67
|
+
echo -e "${RED}[ERROR]${NC} Unknown option: $1"
|
|
68
|
+
echo "Use --help for usage information"
|
|
69
|
+
exit 1
|
|
70
|
+
;;
|
|
71
|
+
esac
|
|
72
|
+
done
|
|
73
|
+
|
|
74
|
+
# Helper functions
|
|
75
|
+
info() { echo -e "${GREEN}[INFO]${NC} $1"; }
|
|
76
|
+
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
77
|
+
error() { echo -e "${RED}[ERROR]${NC} $1"; exit 1; }
|
|
78
|
+
|
|
79
|
+
run() {
|
|
80
|
+
if $DRY_RUN; then
|
|
81
|
+
echo -e "${YELLOW}[DRY-RUN]${NC} $*"
|
|
82
|
+
else
|
|
83
|
+
"$@"
|
|
84
|
+
fi
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if $DRY_RUN; then
|
|
88
|
+
echo -e "${YELLOW}DRY RUN MODE - No changes will be made${NC}"
|
|
89
|
+
echo ""
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
# If bump requested, delegate to deploy.sh (which handles everything)
|
|
93
|
+
if [[ -n "$BUMP_TYPE" ]]; then
|
|
94
|
+
info "Version bump requested: $BUMP_TYPE"
|
|
95
|
+
|
|
96
|
+
# Run deploy.sh which handles version bump + full release
|
|
97
|
+
# deploy.sh is in scripts/ (meta-only, not distributed)
|
|
98
|
+
# This only works when running from the pennyfarthing repo itself
|
|
99
|
+
#
|
|
100
|
+
# Try to find deploy.sh relative to the script location first (for pennyfarthing repo)
|
|
101
|
+
# then fall back to PROJECT_ROOT (for legacy compatibility)
|
|
102
|
+
SCRIPT_PARENT="$(dirname "$(dirname "$SCRIPT_DIR")")" # Go up from git/ to scripts/ to root
|
|
103
|
+
if [[ -f "$SCRIPT_PARENT/../scripts/deploy.sh" ]]; then
|
|
104
|
+
# We're in pennyfarthing-dist/scripts/git, so go up to repo root
|
|
105
|
+
DEPLOY_SCRIPT="$(cd "$SCRIPT_PARENT/.." && pwd)/scripts/deploy.sh"
|
|
106
|
+
elif [[ -f "$PROJECT_ROOT/scripts/deploy.sh" ]]; then
|
|
107
|
+
DEPLOY_SCRIPT="$PROJECT_ROOT/scripts/deploy.sh"
|
|
108
|
+
else
|
|
109
|
+
error "deploy.sh not found"
|
|
110
|
+
error "Version bumping requires running from the pennyfarthing repo"
|
|
111
|
+
error "Try: cd pennyfarthing && just release --bump patch"
|
|
112
|
+
exit 1
|
|
113
|
+
fi
|
|
114
|
+
if $DRY_RUN; then
|
|
115
|
+
exec "$DEPLOY_SCRIPT" --dry-run "$BUMP_TYPE"
|
|
116
|
+
else
|
|
117
|
+
exec "$DEPLOY_SCRIPT" "$BUMP_TYPE"
|
|
118
|
+
fi
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
# No version bump - just merge and push
|
|
122
|
+
info "=== Release (no version bump) ==="
|
|
123
|
+
echo ""
|
|
124
|
+
|
|
125
|
+
# Pre-flight checks
|
|
126
|
+
info "Running pre-flight checks..."
|
|
127
|
+
|
|
128
|
+
# Check we're in a git repo
|
|
129
|
+
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
|
130
|
+
error "Not in a git repository"
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Check for uncommitted changes
|
|
134
|
+
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
|
|
135
|
+
error "Uncommitted changes detected. Commit or stash before releasing."
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
# Get current branch
|
|
139
|
+
CURRENT_BRANCH=$(git branch --show-current)
|
|
140
|
+
info "Current branch: $CURRENT_BRANCH"
|
|
141
|
+
|
|
142
|
+
# Determine main branch name
|
|
143
|
+
if git show-ref --verify --quiet refs/heads/main; then
|
|
144
|
+
MAIN_BRANCH="main"
|
|
145
|
+
elif git show-ref --verify --quiet refs/heads/master; then
|
|
146
|
+
MAIN_BRANCH="master"
|
|
147
|
+
else
|
|
148
|
+
error "No main or master branch found"
|
|
149
|
+
fi
|
|
150
|
+
info "Main branch: $MAIN_BRANCH"
|
|
151
|
+
|
|
152
|
+
# Check develop exists
|
|
153
|
+
if ! git show-ref --verify --quiet refs/heads/develop; then
|
|
154
|
+
error "No develop branch found"
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
# Get version
|
|
158
|
+
VERSION=$(cat VERSION 2>/dev/null || echo "unknown")
|
|
159
|
+
info "Current version: $VERSION"
|
|
160
|
+
|
|
161
|
+
# Show what will be merged
|
|
162
|
+
COMMITS_TO_MERGE=$(git log --oneline "$MAIN_BRANCH"..develop 2>/dev/null | wc -l | tr -d ' ')
|
|
163
|
+
if [[ "$COMMITS_TO_MERGE" == "0" ]]; then
|
|
164
|
+
info "No new commits to merge. Branches are already in sync."
|
|
165
|
+
exit 0
|
|
166
|
+
fi
|
|
167
|
+
info "Commits to merge: $COMMITS_TO_MERGE"
|
|
168
|
+
|
|
169
|
+
echo ""
|
|
170
|
+
info "=== Starting Release Process ==="
|
|
171
|
+
echo ""
|
|
172
|
+
|
|
173
|
+
# Step 1: Ensure we're on develop and it's up to date
|
|
174
|
+
info "Step 1: Updating develop branch..."
|
|
175
|
+
run git checkout develop
|
|
176
|
+
run git pull origin develop 2>/dev/null || true
|
|
177
|
+
|
|
178
|
+
# Step 2: Switch to main and update
|
|
179
|
+
info "Step 2: Updating $MAIN_BRANCH branch..."
|
|
180
|
+
run git checkout "$MAIN_BRANCH"
|
|
181
|
+
run git pull origin "$MAIN_BRANCH" 2>/dev/null || true
|
|
182
|
+
|
|
183
|
+
# Step 3: Merge develop into main
|
|
184
|
+
info "Step 3: Merging develop into $MAIN_BRANCH..."
|
|
185
|
+
if $DRY_RUN; then
|
|
186
|
+
echo -e "${YELLOW}[DRY-RUN]${NC} git merge develop --no-edit"
|
|
187
|
+
else
|
|
188
|
+
git merge develop --no-edit
|
|
189
|
+
fi
|
|
190
|
+
|
|
191
|
+
# Step 4: Push main
|
|
192
|
+
info "Step 4: Pushing $MAIN_BRANCH to origin..."
|
|
193
|
+
run git push origin "$MAIN_BRANCH"
|
|
194
|
+
|
|
195
|
+
# Step 5: Switch back to develop and push
|
|
196
|
+
info "Step 5: Pushing develop to origin..."
|
|
197
|
+
run git checkout develop
|
|
198
|
+
run git push origin develop
|
|
199
|
+
|
|
200
|
+
# Step 6: Push tags (in case any were created manually)
|
|
201
|
+
info "Step 6: Pushing tags..."
|
|
202
|
+
run git push origin --tags
|
|
203
|
+
|
|
204
|
+
echo ""
|
|
205
|
+
info "=== Release Complete ==="
|
|
206
|
+
echo ""
|
|
207
|
+
info "Version $VERSION released!"
|
|
208
|
+
info " - develop and $MAIN_BRANCH are in sync"
|
|
209
|
+
info " - All changes pushed to origin"
|
|
210
|
+
|
|
211
|
+
# Return to original branch if different
|
|
212
|
+
if [[ "$CURRENT_BRANCH" != "develop" && "$CURRENT_BRANCH" != "$MAIN_BRANCH" ]]; then
|
|
213
|
+
info "Returning to original branch: $CURRENT_BRANCH"
|
|
214
|
+
run git checkout "$CURRENT_BRANCH"
|
|
215
|
+
fi
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
#!/usr/bin/env zsh
|
|
2
|
+
# Worktree management utilities for parallel development work
|
|
3
|
+
# Usage: worktree-manager.sh {create|remove|list|status|ports|cd} [args]
|
|
4
|
+
#
|
|
5
|
+
# Configuration (choose one):
|
|
6
|
+
# 1. repos.yaml: Define repos in .claude/project/repos.yaml (recommended)
|
|
7
|
+
# 2. Legacy env vars: Set API_REPO and UI_REPO in .claude/project/hooks/setup-env.sh
|
|
8
|
+
|
|
9
|
+
set -e
|
|
10
|
+
|
|
11
|
+
# Load environment
|
|
12
|
+
if [ -f "$PROJECT_ROOT/.env" ]; then
|
|
13
|
+
set -a; source "$PROJECT_ROOT/.env"; set +a
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# Source project hooks if available
|
|
17
|
+
if [ -f "$PROJECT_ROOT/.claude/project/hooks/setup-env.sh" ]; then
|
|
18
|
+
source "$PROJECT_ROOT/.claude/project/hooks/setup-env.sh"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Source repo utilities (handles repos.yaml or legacy env vars)
|
|
22
|
+
REPO_UTILS_LAZY=1 # Don't auto-load, we'll do it after validation
|
|
23
|
+
source "$PROJECT_ROOT/scripts/repo-utils.sh"
|
|
24
|
+
|
|
25
|
+
WORKTREE_ROOT="${WORKTREE_ROOT:-$PROJECT_ROOT/worktrees}"
|
|
26
|
+
WORKTREE_PORT_OFFSET="${WORKTREE_PORT_OFFSET:-100}"
|
|
27
|
+
|
|
28
|
+
# ============================================================================
|
|
29
|
+
# Services Configuration
|
|
30
|
+
# ============================================================================
|
|
31
|
+
|
|
32
|
+
# Load services configuration from pennyfarthing-settings.yaml
|
|
33
|
+
# Sets: _SERVICES_JSON, _PORT_OFFSET
|
|
34
|
+
# Returns 1 if no services configured
|
|
35
|
+
load_services_config() {
|
|
36
|
+
local config_file="${PROJECT_ROOT}/.claude/project/pennyfarthing-settings.yaml"
|
|
37
|
+
|
|
38
|
+
if [[ ! -f "$config_file" ]]; then
|
|
39
|
+
_SERVICES_JSON=""
|
|
40
|
+
_PORT_OFFSET=$WORKTREE_PORT_OFFSET
|
|
41
|
+
return 1
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Parse services config using yq (preferred) or Python fallback
|
|
45
|
+
local config
|
|
46
|
+
if command -v yq &>/dev/null; then
|
|
47
|
+
# Check if services section exists
|
|
48
|
+
local has_services
|
|
49
|
+
has_services=$(yq '.services.definitions' "$config_file" 2>/dev/null)
|
|
50
|
+
if [[ -z "$has_services" || "$has_services" == "null" ]]; then
|
|
51
|
+
_SERVICES_JSON=""
|
|
52
|
+
_PORT_OFFSET=$WORKTREE_PORT_OFFSET
|
|
53
|
+
return 1
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
local port_offset
|
|
57
|
+
port_offset=$(yq '.services.port_offset // 100' "$config_file" 2>/dev/null)
|
|
58
|
+
local definitions_json
|
|
59
|
+
definitions_json=$(yq -o=json '.services.definitions' "$config_file" 2>/dev/null)
|
|
60
|
+
|
|
61
|
+
_PORT_OFFSET=$port_offset
|
|
62
|
+
_SERVICES_JSON="$definitions_json"
|
|
63
|
+
return 0
|
|
64
|
+
elif command -v python3 &>/dev/null; then
|
|
65
|
+
config=$(python3 -c "
|
|
66
|
+
import yaml
|
|
67
|
+
import json
|
|
68
|
+
import sys
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
with open('$config_file', 'r') as f:
|
|
72
|
+
settings = yaml.safe_load(f)
|
|
73
|
+
|
|
74
|
+
if not settings or 'services' not in settings or 'definitions' not in settings['services']:
|
|
75
|
+
sys.exit(1)
|
|
76
|
+
|
|
77
|
+
svc = settings['services']
|
|
78
|
+
port_offset = svc.get('port_offset', ${WORKTREE_PORT_OFFSET})
|
|
79
|
+
definitions = svc['definitions']
|
|
80
|
+
|
|
81
|
+
# Ensure env_var is set for each service
|
|
82
|
+
for d in definitions:
|
|
83
|
+
if 'env_var' not in d:
|
|
84
|
+
d['env_var'] = d['name'].upper().replace(' ', '_').replace('-', '_') + '_PORT'
|
|
85
|
+
|
|
86
|
+
print(f'_PORT_OFFSET={port_offset}')
|
|
87
|
+
print(f\"_SERVICES_JSON='{json.dumps(definitions)}'\")
|
|
88
|
+
except Exception:
|
|
89
|
+
sys.exit(1)
|
|
90
|
+
" 2>/dev/null)
|
|
91
|
+
|
|
92
|
+
if [[ $? -eq 0 && -n "$config" ]]; then
|
|
93
|
+
eval "$config"
|
|
94
|
+
return 0
|
|
95
|
+
fi
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
_SERVICES_JSON=""
|
|
99
|
+
_PORT_OFFSET=$WORKTREE_PORT_OFFSET
|
|
100
|
+
return 1
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
# Load and validate repo configuration
|
|
104
|
+
load_repos_config
|
|
105
|
+
|
|
106
|
+
if [ "$(get_repo_count)" -eq 0 ]; then
|
|
107
|
+
echo "❌ Error: No repositories configured"
|
|
108
|
+
echo ""
|
|
109
|
+
echo "Option 1: Create .claude/project/repos.yaml (recommended for multi-repo projects)"
|
|
110
|
+
echo "Option 2: Set API_REPO and UI_REPO in .claude/project/hooks/setup-env.sh"
|
|
111
|
+
exit 1
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
# Ensure worktree root exists
|
|
115
|
+
mkdir -p "$WORKTREE_ROOT"
|
|
116
|
+
|
|
117
|
+
show_help() {
|
|
118
|
+
cat << EOF
|
|
119
|
+
Worktree Manager - Parallel Development Tool
|
|
120
|
+
|
|
121
|
+
Usage: worktree-manager.sh <command> [options]
|
|
122
|
+
|
|
123
|
+
Commands:
|
|
124
|
+
create <name> <branch> [repos] Create worktree(s) for parallel work
|
|
125
|
+
remove <name> Remove worktree and clean up
|
|
126
|
+
list List all active worktrees
|
|
127
|
+
status Show detailed worktree status
|
|
128
|
+
ports <name> Get port configuration for worktree
|
|
129
|
+
cd <name> Print path to worktree (use with: cd \$(./scripts/worktree-manager.sh cd <name>))
|
|
130
|
+
config Show current repo configuration
|
|
131
|
+
|
|
132
|
+
Examples:
|
|
133
|
+
# Create worktree for all repos
|
|
134
|
+
./scripts/worktree-manager.sh create 5-1a feat/5-1a-file-upload
|
|
135
|
+
|
|
136
|
+
# Create worktree for specific repo type
|
|
137
|
+
./scripts/worktree-manager.sh create bug-123 fix/bug-123-validation api
|
|
138
|
+
|
|
139
|
+
# Create worktree for specific repos (comma-separated)
|
|
140
|
+
./scripts/worktree-manager.sh create feat-x feat/x-feature adapter-a,adapter-b
|
|
141
|
+
|
|
142
|
+
# Get ports for running dev servers
|
|
143
|
+
eval \$(./scripts/worktree-manager.sh ports 5-1a)
|
|
144
|
+
echo "API: \$API_PORT, UI: \$UI_PORT"
|
|
145
|
+
|
|
146
|
+
# Remove worktree after merge
|
|
147
|
+
./scripts/worktree-manager.sh remove 5-1a
|
|
148
|
+
|
|
149
|
+
# Show repo configuration
|
|
150
|
+
./scripts/worktree-manager.sh config
|
|
151
|
+
|
|
152
|
+
Repos Filter (third argument):
|
|
153
|
+
all - All configured repos (default)
|
|
154
|
+
api - Only repos of type 'api'
|
|
155
|
+
ui - Only repos of type 'ui'
|
|
156
|
+
adapter - Only repos of type 'adapter'
|
|
157
|
+
service - Only repos of type 'service'
|
|
158
|
+
repo1,repo2 - Comma-separated list of specific repo names
|
|
159
|
+
|
|
160
|
+
Configuration:
|
|
161
|
+
Option 1 (recommended): Create .claude/project/repos.yaml
|
|
162
|
+
Option 2 (legacy): Set API_REPO and UI_REPO environment variables
|
|
163
|
+
|
|
164
|
+
Session Files:
|
|
165
|
+
Session files are named after story IDs: .session/{story-id}-session.md
|
|
166
|
+
Example: .session/5-1a-session.md (with worktree field inside)
|
|
167
|
+
Session files are managed by SM agent, not worktree-manager.
|
|
168
|
+
|
|
169
|
+
Environment Variables:
|
|
170
|
+
PROJECT_ROOT - Project root directory
|
|
171
|
+
WORKTREE_ROOT - Where worktrees are created (default: \$PROJECT_ROOT/worktrees)
|
|
172
|
+
WORKTREE_PORT_OFFSET - Port offset between worktrees (default: 100)
|
|
173
|
+
|
|
174
|
+
EOF
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
create_worktree() {
|
|
178
|
+
local WT_NAME="$1"
|
|
179
|
+
local BRANCH="$2"
|
|
180
|
+
local REPOS_FILTER="${3:-all}" # all, api, ui, adapter, service, or comma-separated names
|
|
181
|
+
|
|
182
|
+
if [ -z "$WT_NAME" ] || [ -z "$BRANCH" ]; then
|
|
183
|
+
echo "❌ Usage: worktree-manager.sh create <name> <branch> [repos-filter]"
|
|
184
|
+
echo " repos-filter: all, api, ui, adapter, service, or comma-separated names"
|
|
185
|
+
exit 1
|
|
186
|
+
fi
|
|
187
|
+
|
|
188
|
+
local WT_PATH="$WORKTREE_ROOT/$WT_NAME"
|
|
189
|
+
|
|
190
|
+
# Check if worktree already exists
|
|
191
|
+
if [ -d "$WT_PATH" ]; then
|
|
192
|
+
echo "❌ Worktree '$WT_NAME' already exists at $WT_PATH"
|
|
193
|
+
exit 1
|
|
194
|
+
fi
|
|
195
|
+
|
|
196
|
+
mkdir -p "$WT_PATH"
|
|
197
|
+
|
|
198
|
+
echo "🔧 Creating worktree: $WT_NAME"
|
|
199
|
+
echo " Branch: $BRANCH"
|
|
200
|
+
echo " Path: $WT_PATH"
|
|
201
|
+
echo " Repos: $REPOS_FILTER"
|
|
202
|
+
echo ""
|
|
203
|
+
|
|
204
|
+
# Get repos to create worktrees for (handle legacy 'both' as 'all')
|
|
205
|
+
local repos_filter="$REPOS_FILTER"
|
|
206
|
+
[ "$repos_filter" = "both" ] && repos_filter="all"
|
|
207
|
+
|
|
208
|
+
local repos_to_create
|
|
209
|
+
repos_to_create=$(filter_repos "$repos_filter")
|
|
210
|
+
|
|
211
|
+
local created_repos=()
|
|
212
|
+
|
|
213
|
+
while IFS= read -r repo; do
|
|
214
|
+
[ -z "$repo" ] && continue
|
|
215
|
+
|
|
216
|
+
local repo_path
|
|
217
|
+
repo_path=$(get_repo_path "$repo")
|
|
218
|
+
local full_path="$PROJECT_ROOT/$repo_path"
|
|
219
|
+
local repo_type
|
|
220
|
+
repo_type=$(get_repo_type "$repo")
|
|
221
|
+
|
|
222
|
+
if [ -d "$full_path" ]; then
|
|
223
|
+
echo "📦 Creating worktree for $repo ($repo_type)..."
|
|
224
|
+
cd "$full_path"
|
|
225
|
+
|
|
226
|
+
# Check if branch exists locally, remotely, or needs to be created
|
|
227
|
+
if git show-ref --verify --quiet "refs/heads/$BRANCH" 2>/dev/null; then
|
|
228
|
+
git worktree add "$WT_PATH/$repo" "$BRANCH"
|
|
229
|
+
elif git show-ref --verify --quiet "refs/remotes/origin/$BRANCH" 2>/dev/null; then
|
|
230
|
+
git worktree add "$WT_PATH/$repo" "$BRANCH"
|
|
231
|
+
else
|
|
232
|
+
# Create new branch from develop (or main if develop doesn't exist)
|
|
233
|
+
local base_branch="develop"
|
|
234
|
+
if ! git show-ref --verify --quiet "refs/heads/develop" 2>/dev/null; then
|
|
235
|
+
base_branch="main"
|
|
236
|
+
fi
|
|
237
|
+
git worktree add -b "$BRANCH" "$WT_PATH/$repo" "$base_branch"
|
|
238
|
+
fi
|
|
239
|
+
echo " ✅ $repo worktree created"
|
|
240
|
+
created_repos+=("$repo")
|
|
241
|
+
else
|
|
242
|
+
echo " ⚠️ Repo not found: $full_path"
|
|
243
|
+
fi
|
|
244
|
+
done <<< "$repos_to_create"
|
|
245
|
+
|
|
246
|
+
echo ""
|
|
247
|
+
echo "✅ Worktree '$WT_NAME' created successfully!"
|
|
248
|
+
echo ""
|
|
249
|
+
echo "📝 Session file: Use /sm to create .session/{story-id}-session.md"
|
|
250
|
+
echo ""
|
|
251
|
+
echo "Next steps:"
|
|
252
|
+
for repo in "${created_repos[@]}"; do
|
|
253
|
+
echo " cd $WT_PATH/$repo"
|
|
254
|
+
done
|
|
255
|
+
echo ""
|
|
256
|
+
echo "Start dev servers with custom ports:"
|
|
257
|
+
echo " eval \$(./scripts/worktree-manager.sh ports $WT_NAME)"
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
remove_worktree() {
|
|
261
|
+
local WT_NAME="$1"
|
|
262
|
+
|
|
263
|
+
if [ -z "$WT_NAME" ]; then
|
|
264
|
+
echo "❌ Usage: worktree-manager.sh remove <name>"
|
|
265
|
+
exit 1
|
|
266
|
+
fi
|
|
267
|
+
|
|
268
|
+
local WT_PATH="$WORKTREE_ROOT/$WT_NAME"
|
|
269
|
+
|
|
270
|
+
if [ ! -d "$WT_PATH" ]; then
|
|
271
|
+
echo "❌ Worktree '$WT_NAME' not found at $WT_PATH"
|
|
272
|
+
exit 1
|
|
273
|
+
fi
|
|
274
|
+
|
|
275
|
+
echo "🗑️ Removing worktree: $WT_NAME"
|
|
276
|
+
|
|
277
|
+
# Remove worktrees for all configured repos
|
|
278
|
+
for repo in $(get_repos); do
|
|
279
|
+
local repo_path
|
|
280
|
+
repo_path=$(get_repo_path "$repo")
|
|
281
|
+
|
|
282
|
+
if [ -d "$WT_PATH/$repo" ]; then
|
|
283
|
+
echo " Removing $repo worktree..."
|
|
284
|
+
cd "$PROJECT_ROOT/$repo_path"
|
|
285
|
+
git worktree remove "$WT_PATH/$repo" --force 2>/dev/null || true
|
|
286
|
+
fi
|
|
287
|
+
done
|
|
288
|
+
|
|
289
|
+
# Clean up directory
|
|
290
|
+
rm -rf "$WT_PATH"
|
|
291
|
+
|
|
292
|
+
# Note: Session files are managed by SM agent
|
|
293
|
+
# Use /sm to finish work and archive the session file
|
|
294
|
+
echo ""
|
|
295
|
+
echo " Note: Session file (if any) should be archived via /sm finish"
|
|
296
|
+
|
|
297
|
+
# Prune worktree references for all repos
|
|
298
|
+
for repo in $(get_repos); do
|
|
299
|
+
local repo_path
|
|
300
|
+
repo_path=$(get_repo_path "$repo")
|
|
301
|
+
if [ -d "$PROJECT_ROOT/$repo_path" ]; then
|
|
302
|
+
cd "$PROJECT_ROOT/$repo_path" && git worktree prune 2>/dev/null || true
|
|
303
|
+
fi
|
|
304
|
+
done
|
|
305
|
+
|
|
306
|
+
echo ""
|
|
307
|
+
echo "✅ Worktree '$WT_NAME' removed successfully!"
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
list_worktrees() {
|
|
311
|
+
echo "=== Active Worktrees ==="
|
|
312
|
+
echo ""
|
|
313
|
+
|
|
314
|
+
for repo in $(get_repos); do
|
|
315
|
+
local repo_path
|
|
316
|
+
repo_path=$(get_repo_path "$repo")
|
|
317
|
+
local repo_type
|
|
318
|
+
repo_type=$(get_repo_type "$repo")
|
|
319
|
+
|
|
320
|
+
if [ -d "$PROJECT_ROOT/$repo_path" ]; then
|
|
321
|
+
echo "📦 $repo ($repo_type):"
|
|
322
|
+
cd "$PROJECT_ROOT/$repo_path" && git worktree list
|
|
323
|
+
echo ""
|
|
324
|
+
fi
|
|
325
|
+
done
|
|
326
|
+
|
|
327
|
+
echo "📁 Worktree Directory:"
|
|
328
|
+
if [ -d "$WORKTREE_ROOT" ] && [ "$(ls -A "$WORKTREE_ROOT" 2>/dev/null)" ]; then
|
|
329
|
+
ls -la "$WORKTREE_ROOT"
|
|
330
|
+
else
|
|
331
|
+
echo " (empty)"
|
|
332
|
+
fi
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
show_status() {
|
|
336
|
+
echo "=== Worktree Status ==="
|
|
337
|
+
echo ""
|
|
338
|
+
|
|
339
|
+
if [ ! -d "$WORKTREE_ROOT" ] || [ -z "$(ls -A "$WORKTREE_ROOT" 2>/dev/null)" ]; then
|
|
340
|
+
echo "No active worktrees."
|
|
341
|
+
echo ""
|
|
342
|
+
echo "Create one with:"
|
|
343
|
+
echo " ./scripts/worktree-manager.sh create <name> <branch>"
|
|
344
|
+
return
|
|
345
|
+
fi
|
|
346
|
+
|
|
347
|
+
for wt in "$WORKTREE_ROOT"/*/; do
|
|
348
|
+
if [ -d "$wt" ]; then
|
|
349
|
+
local WT_NAME=$(basename "$wt")
|
|
350
|
+
echo "📁 $WT_NAME"
|
|
351
|
+
echo " Path: $wt"
|
|
352
|
+
|
|
353
|
+
# Show status for each configured repo
|
|
354
|
+
for repo in $(get_repos); do
|
|
355
|
+
if [ -d "$wt/$repo" ]; then
|
|
356
|
+
local repo_type
|
|
357
|
+
repo_type=$(get_repo_type "$repo")
|
|
358
|
+
local branch=$(cd "$wt/$repo" && git branch --show-current 2>/dev/null || echo "unknown")
|
|
359
|
+
local status_count=$(cd "$wt/$repo" && git status --short 2>/dev/null | wc -l | tr -d ' ')
|
|
360
|
+
echo " $repo ($repo_type): $branch ($status_count uncommitted)"
|
|
361
|
+
fi
|
|
362
|
+
done
|
|
363
|
+
|
|
364
|
+
# Check for session files that reference this worktree
|
|
365
|
+
local found_session=""
|
|
366
|
+
for sf in "$PROJECT_ROOT"/.session/*-session.md; do
|
|
367
|
+
if [ -f "$sf" ] && grep -q "worktree: $WT_NAME" "$sf" 2>/dev/null; then
|
|
368
|
+
found_session=$(basename "$sf")
|
|
369
|
+
break
|
|
370
|
+
fi
|
|
371
|
+
done
|
|
372
|
+
if [ -n "$found_session" ]; then
|
|
373
|
+
echo " Session: ✅ .session/$found_session"
|
|
374
|
+
else
|
|
375
|
+
echo " Session: ❌ (no session file references this worktree)"
|
|
376
|
+
fi
|
|
377
|
+
|
|
378
|
+
# Show ports (from services config)
|
|
379
|
+
local WT_INDEX=$(ls -1 "$WORKTREE_ROOT" 2>/dev/null | grep -n "^$WT_NAME$" | cut -d: -f1)
|
|
380
|
+
WT_INDEX=${WT_INDEX:-1}
|
|
381
|
+
if load_services_config; then
|
|
382
|
+
local OFFSET=$((_PORT_OFFSET * WT_INDEX))
|
|
383
|
+
local ports_display
|
|
384
|
+
ports_display=$(python3 -c "
|
|
385
|
+
import json
|
|
386
|
+
services = $_SERVICES_JSON
|
|
387
|
+
offset = $OFFSET
|
|
388
|
+
parts = []
|
|
389
|
+
for svc in services:
|
|
390
|
+
name = svc['name']
|
|
391
|
+
port = svc['base_port'] + offset
|
|
392
|
+
parts.append(f'{name}={port}')
|
|
393
|
+
print(', '.join(parts))
|
|
394
|
+
" 2>/dev/null)
|
|
395
|
+
echo " Ports: $ports_display"
|
|
396
|
+
else
|
|
397
|
+
echo " Ports: (no services configured)"
|
|
398
|
+
fi
|
|
399
|
+
echo ""
|
|
400
|
+
fi
|
|
401
|
+
done
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
get_ports() {
|
|
405
|
+
local WT_NAME="$1"
|
|
406
|
+
|
|
407
|
+
if [ -z "$WT_NAME" ]; then
|
|
408
|
+
echo "# Usage: worktree-manager.sh ports <name>" >&2
|
|
409
|
+
echo "# Outputs shell variables for service ports" >&2
|
|
410
|
+
exit 1
|
|
411
|
+
fi
|
|
412
|
+
|
|
413
|
+
# Load services configuration
|
|
414
|
+
if ! load_services_config; then
|
|
415
|
+
echo "# No services configured in .claude/project/pennyfarthing-settings.yaml" >&2
|
|
416
|
+
echo "# Add a 'services' section with 'definitions' array" >&2
|
|
417
|
+
exit 1
|
|
418
|
+
fi
|
|
419
|
+
|
|
420
|
+
# Calculate port offset based on worktree index
|
|
421
|
+
local WT_INDEX=$(ls -1 "$WORKTREE_ROOT" 2>/dev/null | grep -n "^$WT_NAME$" | cut -d: -f1)
|
|
422
|
+
WT_INDEX=${WT_INDEX:-1}
|
|
423
|
+
local OFFSET=$((_PORT_OFFSET * WT_INDEX))
|
|
424
|
+
|
|
425
|
+
# Output worktree info
|
|
426
|
+
echo "export WORKTREE_PATH=$WORKTREE_ROOT/$WT_NAME"
|
|
427
|
+
echo "export WORKTREE_INDEX=$WT_INDEX"
|
|
428
|
+
echo "export WORKTREE_PORT_OFFSET=$OFFSET"
|
|
429
|
+
|
|
430
|
+
# Generate exports for each configured service
|
|
431
|
+
python3 -c "
|
|
432
|
+
import json
|
|
433
|
+
|
|
434
|
+
services = $_SERVICES_JSON
|
|
435
|
+
offset = $OFFSET
|
|
436
|
+
|
|
437
|
+
for svc in services:
|
|
438
|
+
env_var = svc.get('env_var', svc['name'].upper().replace(' ', '_').replace('-', '_') + '_PORT')
|
|
439
|
+
port = svc['base_port'] + offset
|
|
440
|
+
print(f'export {env_var}={port}')
|
|
441
|
+
" 2>/dev/null
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
get_path() {
|
|
445
|
+
local WT_NAME="$1"
|
|
446
|
+
|
|
447
|
+
if [ -z "$WT_NAME" ]; then
|
|
448
|
+
echo "❌ Usage: worktree-manager.sh cd <name>"
|
|
449
|
+
exit 1
|
|
450
|
+
fi
|
|
451
|
+
|
|
452
|
+
local WT_PATH="$WORKTREE_ROOT/$WT_NAME"
|
|
453
|
+
|
|
454
|
+
if [ ! -d "$WT_PATH" ]; then
|
|
455
|
+
echo "❌ Worktree '$WT_NAME' not found" >&2
|
|
456
|
+
exit 1
|
|
457
|
+
fi
|
|
458
|
+
|
|
459
|
+
echo "$WT_PATH"
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
# Main command dispatch
|
|
463
|
+
case "${1:-help}" in
|
|
464
|
+
create)
|
|
465
|
+
create_worktree "$2" "$3" "$4"
|
|
466
|
+
;;
|
|
467
|
+
remove|rm|delete)
|
|
468
|
+
remove_worktree "$2"
|
|
469
|
+
;;
|
|
470
|
+
list|ls)
|
|
471
|
+
list_worktrees
|
|
472
|
+
;;
|
|
473
|
+
status|st)
|
|
474
|
+
show_status
|
|
475
|
+
;;
|
|
476
|
+
ports)
|
|
477
|
+
get_ports "$2"
|
|
478
|
+
;;
|
|
479
|
+
cd|path)
|
|
480
|
+
get_path "$2"
|
|
481
|
+
;;
|
|
482
|
+
config)
|
|
483
|
+
show_config
|
|
484
|
+
;;
|
|
485
|
+
help|--help|-h)
|
|
486
|
+
show_help
|
|
487
|
+
;;
|
|
488
|
+
*)
|
|
489
|
+
echo "❌ Unknown command: $1"
|
|
490
|
+
echo ""
|
|
491
|
+
show_help
|
|
492
|
+
exit 1
|
|
493
|
+
;;
|
|
494
|
+
esac
|