@pennyfarthing/core 6.6.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/README.md +293 -0
- package/package.json +58 -0
- package/packages/core/bin/pennyfarthing.js +14 -0
- package/packages/core/dist/bmad/context-reader.d.ts +71 -0
- package/packages/core/dist/bmad/context-reader.d.ts.map +1 -0
- package/packages/core/dist/bmad/context-reader.js +369 -0
- package/packages/core/dist/bmad/context-reader.js.map +1 -0
- package/packages/core/dist/bmad/context-reader.test.d.ts +71 -0
- package/packages/core/dist/bmad/context-reader.test.d.ts.map +1 -0
- package/packages/core/dist/bmad/context-reader.test.js +878 -0
- package/packages/core/dist/bmad/context-reader.test.js.map +1 -0
- package/packages/core/dist/bmad/epics-parser.d.ts +61 -0
- package/packages/core/dist/bmad/epics-parser.d.ts.map +1 -0
- package/packages/core/dist/bmad/epics-parser.js +331 -0
- package/packages/core/dist/bmad/epics-parser.js.map +1 -0
- package/packages/core/dist/bmad/epics-parser.test.d.ts +7 -0
- package/packages/core/dist/bmad/epics-parser.test.d.ts.map +1 -0
- package/packages/core/dist/bmad/epics-parser.test.js +449 -0
- package/packages/core/dist/bmad/epics-parser.test.js.map +1 -0
- package/packages/core/dist/bmad/index.d.ts +11 -0
- package/packages/core/dist/bmad/index.d.ts.map +1 -0
- package/packages/core/dist/bmad/index.js +24 -0
- package/packages/core/dist/bmad/index.js.map +1 -0
- package/packages/core/dist/bmad/status-sync.d.ts +173 -0
- package/packages/core/dist/bmad/status-sync.d.ts.map +1 -0
- package/packages/core/dist/bmad/status-sync.js +463 -0
- package/packages/core/dist/bmad/status-sync.js.map +1 -0
- package/packages/core/dist/bmad/status-sync.test.d.ts +7 -0
- package/packages/core/dist/bmad/status-sync.test.d.ts.map +1 -0
- package/packages/core/dist/bmad/status-sync.test.js +702 -0
- package/packages/core/dist/bmad/status-sync.test.js.map +1 -0
- package/packages/core/dist/bmad/story-exporter.d.ts +55 -0
- package/packages/core/dist/bmad/story-exporter.d.ts.map +1 -0
- package/packages/core/dist/bmad/story-exporter.js +170 -0
- package/packages/core/dist/bmad/story-exporter.js.map +1 -0
- package/packages/core/dist/bmad/story-exporter.test.d.ts +51 -0
- package/packages/core/dist/bmad/story-exporter.test.d.ts.map +1 -0
- package/packages/core/dist/bmad/story-exporter.test.js +603 -0
- package/packages/core/dist/bmad/story-exporter.test.js.map +1 -0
- package/packages/core/dist/bmad/story-parser.d.ts +44 -0
- package/packages/core/dist/bmad/story-parser.d.ts.map +1 -0
- package/packages/core/dist/bmad/story-parser.js +307 -0
- package/packages/core/dist/bmad/story-parser.js.map +1 -0
- package/packages/core/dist/bmad/story-parser.test.d.ts +44 -0
- package/packages/core/dist/bmad/story-parser.test.d.ts.map +1 -0
- package/packages/core/dist/bmad/story-parser.test.js +693 -0
- package/packages/core/dist/bmad/story-parser.test.js.map +1 -0
- package/packages/core/dist/cli/commands/command.d.ts +28 -0
- package/packages/core/dist/cli/commands/command.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/command.js +399 -0
- package/packages/core/dist/cli/commands/command.js.map +1 -0
- package/packages/core/dist/cli/commands/cyclist.d.ts +46 -0
- package/packages/core/dist/cli/commands/cyclist.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/cyclist.js +191 -0
- package/packages/core/dist/cli/commands/cyclist.js.map +1 -0
- package/packages/core/dist/cli/commands/cyclist.test.d.ts +13 -0
- package/packages/core/dist/cli/commands/cyclist.test.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/cyclist.test.js +243 -0
- package/packages/core/dist/cli/commands/cyclist.test.js.map +1 -0
- package/packages/core/dist/cli/commands/doctor.d.ts +9 -0
- package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/doctor.js +652 -0
- package/packages/core/dist/cli/commands/doctor.js.map +1 -0
- package/packages/core/dist/cli/commands/init.d.ts +8 -0
- package/packages/core/dist/cli/commands/init.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/init.js +524 -0
- package/packages/core/dist/cli/commands/init.js.map +1 -0
- package/packages/core/dist/cli/commands/skill.d.ts +28 -0
- package/packages/core/dist/cli/commands/skill.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/skill.js +416 -0
- package/packages/core/dist/cli/commands/skill.js.map +1 -0
- package/packages/core/dist/cli/commands/theme.d.ts +21 -0
- package/packages/core/dist/cli/commands/theme.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/theme.js +201 -0
- package/packages/core/dist/cli/commands/theme.js.map +1 -0
- package/packages/core/dist/cli/commands/uninstall.d.ts +8 -0
- package/packages/core/dist/cli/commands/uninstall.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/uninstall.js +237 -0
- package/packages/core/dist/cli/commands/uninstall.js.map +1 -0
- package/packages/core/dist/cli/commands/update.d.ts +9 -0
- package/packages/core/dist/cli/commands/update.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/update.js +545 -0
- package/packages/core/dist/cli/commands/update.js.map +1 -0
- package/packages/core/dist/cli/commands/version.d.ts +2 -0
- package/packages/core/dist/cli/commands/version.d.ts.map +1 -0
- package/packages/core/dist/cli/commands/version.js +28 -0
- package/packages/core/dist/cli/commands/version.js.map +1 -0
- package/packages/core/dist/cli/customization.test.d.ts +12 -0
- package/packages/core/dist/cli/customization.test.d.ts.map +1 -0
- package/packages/core/dist/cli/customization.test.js +84 -0
- package/packages/core/dist/cli/customization.test.js.map +1 -0
- package/packages/core/dist/cli/cyclist-migration.test.d.ts +16 -0
- package/packages/core/dist/cli/cyclist-migration.test.d.ts.map +1 -0
- package/packages/core/dist/cli/cyclist-migration.test.js +224 -0
- package/packages/core/dist/cli/cyclist-migration.test.js.map +1 -0
- package/packages/core/dist/cli/index.d.ts +3 -0
- package/packages/core/dist/cli/index.d.ts.map +1 -0
- package/packages/core/dist/cli/index.js +174 -0
- package/packages/core/dist/cli/index.js.map +1 -0
- package/packages/core/dist/cli/ocean-profiles.test.d.ts +13 -0
- package/packages/core/dist/cli/ocean-profiles.test.d.ts.map +1 -0
- package/packages/core/dist/cli/ocean-profiles.test.js +134 -0
- package/packages/core/dist/cli/ocean-profiles.test.js.map +1 -0
- package/packages/core/dist/cli/theme-maker.test.d.ts +11 -0
- package/packages/core/dist/cli/theme-maker.test.d.ts.map +1 -0
- package/packages/core/dist/cli/theme-maker.test.js +356 -0
- package/packages/core/dist/cli/theme-maker.test.js.map +1 -0
- package/packages/core/dist/cli/utils/constants.d.ts +60 -0
- package/packages/core/dist/cli/utils/constants.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/constants.js +52 -0
- package/packages/core/dist/cli/utils/constants.js.map +1 -0
- package/packages/core/dist/cli/utils/files.d.ts +71 -0
- package/packages/core/dist/cli/utils/files.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/files.js +162 -0
- package/packages/core/dist/cli/utils/files.js.map +1 -0
- package/packages/core/dist/cli/utils/logger.d.ts +26 -0
- package/packages/core/dist/cli/utils/logger.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/logger.js +88 -0
- package/packages/core/dist/cli/utils/logger.js.map +1 -0
- package/packages/core/dist/cli/utils/manifest.d.ts +47 -0
- package/packages/core/dist/cli/utils/manifest.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/manifest.js +90 -0
- package/packages/core/dist/cli/utils/manifest.js.map +1 -0
- package/packages/core/dist/cli/utils/node-modules.d.ts +6 -0
- package/packages/core/dist/cli/utils/node-modules.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/node-modules.js +22 -0
- package/packages/core/dist/cli/utils/node-modules.js.map +1 -0
- package/packages/core/dist/cli/utils/prompts.d.ts +34 -0
- package/packages/core/dist/cli/utils/prompts.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/prompts.js +93 -0
- package/packages/core/dist/cli/utils/prompts.js.map +1 -0
- package/packages/core/dist/cli/utils/symlinks.d.ts +29 -0
- package/packages/core/dist/cli/utils/symlinks.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/symlinks.js +181 -0
- package/packages/core/dist/cli/utils/symlinks.js.map +1 -0
- package/packages/core/dist/cli/utils/themes.d.ts +104 -0
- package/packages/core/dist/cli/utils/themes.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/themes.js +393 -0
- package/packages/core/dist/cli/utils/themes.js.map +1 -0
- package/packages/core/dist/cli/utils/themes.test.d.ts +12 -0
- package/packages/core/dist/cli/utils/themes.test.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/themes.test.js +144 -0
- package/packages/core/dist/cli/utils/themes.test.js.map +1 -0
- package/packages/core/dist/cli/utils/version.d.ts +10 -0
- package/packages/core/dist/cli/utils/version.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/version.js +63 -0
- package/packages/core/dist/cli/utils/version.js.map +1 -0
- package/packages/core/dist/cli/workspace.test.d.ts +8 -0
- package/packages/core/dist/cli/workspace.test.d.ts.map +1 -0
- package/packages/core/dist/cli/workspace.test.js +154 -0
- package/packages/core/dist/cli/workspace.test.js.map +1 -0
- package/packages/core/dist/index.d.ts +6 -0
- package/packages/core/dist/index.d.ts.map +1 -0
- package/packages/core/dist/index.js +10 -0
- package/packages/core/dist/index.js.map +1 -0
- package/packages/core/dist/permissions/index.d.ts +9 -0
- package/packages/core/dist/permissions/index.d.ts.map +1 -0
- package/packages/core/dist/permissions/index.js +13 -0
- package/packages/core/dist/permissions/index.js.map +1 -0
- package/packages/core/dist/permissions/permission-schema.d.ts +89 -0
- package/packages/core/dist/permissions/permission-schema.d.ts.map +1 -0
- package/packages/core/dist/permissions/permission-schema.js +120 -0
- package/packages/core/dist/permissions/permission-schema.js.map +1 -0
- package/packages/core/dist/permissions/permission-schema.test.d.ts +40 -0
- package/packages/core/dist/permissions/permission-schema.test.d.ts.map +1 -0
- package/packages/core/dist/permissions/permission-schema.test.js +367 -0
- package/packages/core/dist/permissions/permission-schema.test.js.map +1 -0
- package/packages/core/dist/scripts/add-ocean-profiles.d.ts +9 -0
- package/packages/core/dist/scripts/add-ocean-profiles.d.ts.map +1 -0
- package/packages/core/dist/scripts/add-ocean-profiles.js +695 -0
- package/packages/core/dist/scripts/add-ocean-profiles.js.map +1 -0
- package/packages/core/dist/scripts/benchmark-integration.d.ts +182 -0
- package/packages/core/dist/scripts/benchmark-integration.d.ts.map +1 -0
- package/packages/core/dist/scripts/benchmark-integration.js +691 -0
- package/packages/core/dist/scripts/benchmark-integration.js.map +1 -0
- package/packages/core/dist/scripts/benchmark-integration.test.d.ts +13 -0
- package/packages/core/dist/scripts/benchmark-integration.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/benchmark-integration.test.js +680 -0
- package/packages/core/dist/scripts/benchmark-integration.test.js.map +1 -0
- package/packages/core/dist/scripts/debugging-scenarios.test.d.ts +18 -0
- package/packages/core/dist/scripts/debugging-scenarios.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/debugging-scenarios.test.js +317 -0
- package/packages/core/dist/scripts/debugging-scenarios.test.js.map +1 -0
- package/packages/core/dist/scripts/generate-all-faces.d.ts +10 -0
- package/packages/core/dist/scripts/generate-all-faces.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-all-faces.js +256 -0
- package/packages/core/dist/scripts/generate-all-faces.js.map +1 -0
- package/packages/core/dist/scripts/generate-all-faces.test.d.ts +17 -0
- package/packages/core/dist/scripts/generate-all-faces.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-all-faces.test.js +372 -0
- package/packages/core/dist/scripts/generate-all-faces.test.js.map +1 -0
- package/packages/core/dist/scripts/generate-all-spiders.d.ts +10 -0
- package/packages/core/dist/scripts/generate-all-spiders.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-all-spiders.js +306 -0
- package/packages/core/dist/scripts/generate-all-spiders.js.map +1 -0
- package/packages/core/dist/scripts/generate-ascii-face.d.ts +52 -0
- package/packages/core/dist/scripts/generate-ascii-face.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-ascii-face.js +155 -0
- package/packages/core/dist/scripts/generate-ascii-face.js.map +1 -0
- package/packages/core/dist/scripts/generate-face.d.ts +52 -0
- package/packages/core/dist/scripts/generate-face.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-face.js +199 -0
- package/packages/core/dist/scripts/generate-face.js.map +1 -0
- package/packages/core/dist/scripts/generate-face.test.d.ts +13 -0
- package/packages/core/dist/scripts/generate-face.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-face.test.js +301 -0
- package/packages/core/dist/scripts/generate-face.test.js.map +1 -0
- package/packages/core/dist/scripts/generate-report.d.ts +65 -0
- package/packages/core/dist/scripts/generate-report.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-report.js +378 -0
- package/packages/core/dist/scripts/generate-report.js.map +1 -0
- package/packages/core/dist/scripts/generate-report.test.d.ts +13 -0
- package/packages/core/dist/scripts/generate-report.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-report.test.js +363 -0
- package/packages/core/dist/scripts/generate-report.test.js.map +1 -0
- package/packages/core/dist/scripts/generate-spider-report.d.ts +65 -0
- package/packages/core/dist/scripts/generate-spider-report.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-spider-report.js +366 -0
- package/packages/core/dist/scripts/generate-spider-report.js.map +1 -0
- package/packages/core/dist/scripts/generate-spider-report.test.d.ts +13 -0
- package/packages/core/dist/scripts/generate-spider-report.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-spider-report.test.js +367 -0
- package/packages/core/dist/scripts/generate-spider-report.test.js.map +1 -0
- package/packages/core/dist/scripts/generate-spider.d.ts +37 -0
- package/packages/core/dist/scripts/generate-spider.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-spider.js +315 -0
- package/packages/core/dist/scripts/generate-spider.js.map +1 -0
- package/packages/core/dist/scripts/generate-spider.test.d.ts +14 -0
- package/packages/core/dist/scripts/generate-spider.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/generate-spider.test.js +269 -0
- package/packages/core/dist/scripts/generate-spider.test.js.map +1 -0
- package/packages/core/dist/scripts/job-fair-aggregator.d.ts +150 -0
- package/packages/core/dist/scripts/job-fair-aggregator.d.ts.map +1 -0
- package/packages/core/dist/scripts/job-fair-aggregator.js +547 -0
- package/packages/core/dist/scripts/job-fair-aggregator.js.map +1 -0
- package/packages/core/dist/scripts/job-fair-aggregator.test.d.ts +14 -0
- package/packages/core/dist/scripts/job-fair-aggregator.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/job-fair-aggregator.test.js +616 -0
- package/packages/core/dist/scripts/job-fair-aggregator.test.js.map +1 -0
- package/packages/core/dist/scripts/run-ci.test.d.ts +20 -0
- package/packages/core/dist/scripts/run-ci.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/run-ci.test.js +127 -0
- package/packages/core/dist/scripts/run-ci.test.js.map +1 -0
- package/packages/core/dist/scripts/theme-detail.test.d.ts +10 -0
- package/packages/core/dist/scripts/theme-detail.test.d.ts.map +1 -0
- package/packages/core/dist/scripts/theme-detail.test.js +199 -0
- package/packages/core/dist/scripts/theme-detail.test.js.map +1 -0
- package/packages/core/dist/scripts/validate-ocean-profiles.d.ts +9 -0
- package/packages/core/dist/scripts/validate-ocean-profiles.d.ts.map +1 -0
- package/packages/core/dist/scripts/validate-ocean-profiles.js +130 -0
- package/packages/core/dist/scripts/validate-ocean-profiles.js.map +1 -0
- package/packages/core/dist/workflow/generic-handoff.d.ts +235 -0
- package/packages/core/dist/workflow/generic-handoff.d.ts.map +1 -0
- package/packages/core/dist/workflow/generic-handoff.js +358 -0
- package/packages/core/dist/workflow/generic-handoff.js.map +1 -0
- package/packages/core/dist/workflow/generic-handoff.test.d.ts +21 -0
- package/packages/core/dist/workflow/generic-handoff.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/generic-handoff.test.js +499 -0
- package/packages/core/dist/workflow/generic-handoff.test.js.map +1 -0
- package/packages/core/dist/workflow/generic-sm-finish.d.ts +89 -0
- package/packages/core/dist/workflow/generic-sm-finish.d.ts.map +1 -0
- package/packages/core/dist/workflow/generic-sm-finish.js +157 -0
- package/packages/core/dist/workflow/generic-sm-finish.js.map +1 -0
- package/packages/core/dist/workflow/generic-sm-setup.d.ts +138 -0
- package/packages/core/dist/workflow/generic-sm-setup.d.ts.map +1 -0
- package/packages/core/dist/workflow/generic-sm-setup.js +382 -0
- package/packages/core/dist/workflow/generic-sm-setup.js.map +1 -0
- package/packages/core/dist/workflow/sm-subagents.test.d.ts +23 -0
- package/packages/core/dist/workflow/sm-subagents.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/sm-subagents.test.js +727 -0
- package/packages/core/dist/workflow/sm-subagents.test.js.map +1 -0
- package/packages/core/dist/workflow/story-workflow-routing.test.d.ts +17 -0
- package/packages/core/dist/workflow/story-workflow-routing.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/story-workflow-routing.test.js +559 -0
- package/packages/core/dist/workflow/story-workflow-routing.test.js.map +1 -0
- package/packages/core/dist/workflow/test-cache.d.ts +131 -0
- package/packages/core/dist/workflow/test-cache.d.ts.map +1 -0
- package/packages/core/dist/workflow/test-cache.js +226 -0
- package/packages/core/dist/workflow/test-cache.js.map +1 -0
- package/packages/core/dist/workflow/test-cache.test.d.ts +17 -0
- package/packages/core/dist/workflow/test-cache.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/test-cache.test.js +438 -0
- package/packages/core/dist/workflow/test-cache.test.js.map +1 -0
- package/packages/core/dist/workflow/workflow-loader.d.ts +76 -0
- package/packages/core/dist/workflow/workflow-loader.d.ts.map +1 -0
- package/packages/core/dist/workflow/workflow-loader.js +133 -0
- package/packages/core/dist/workflow/workflow-loader.js.map +1 -0
- package/packages/core/dist/workflow/workflow-loader.test.d.ts +15 -0
- package/packages/core/dist/workflow/workflow-loader.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/workflow-loader.test.js +354 -0
- package/packages/core/dist/workflow/workflow-loader.test.js.map +1 -0
- package/packages/core/dist/workflow/workflow-migration.test.d.ts +17 -0
- package/packages/core/dist/workflow/workflow-migration.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/workflow-migration.test.js +372 -0
- package/packages/core/dist/workflow/workflow-migration.test.js.map +1 -0
- package/packages/core/dist/workflow/workflow-router.d.ts +55 -0
- package/packages/core/dist/workflow/workflow-router.d.ts.map +1 -0
- package/packages/core/dist/workflow/workflow-router.js +245 -0
- package/packages/core/dist/workflow/workflow-router.js.map +1 -0
- package/packages/core/dist/workflow/workflow-router.test.d.ts +20 -0
- package/packages/core/dist/workflow/workflow-router.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/workflow-router.test.js +607 -0
- package/packages/core/dist/workflow/workflow-router.test.js.map +1 -0
- package/packages/core/dist/workflow/workflow-schema.d.ts +98 -0
- package/packages/core/dist/workflow/workflow-schema.d.ts.map +1 -0
- package/packages/core/dist/workflow/workflow-schema.js +230 -0
- package/packages/core/dist/workflow/workflow-schema.js.map +1 -0
- package/packages/core/dist/workflow/workflow-schema.test.d.ts +45 -0
- package/packages/core/dist/workflow/workflow-schema.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/workflow-schema.test.js +512 -0
- package/packages/core/dist/workflow/workflow-schema.test.js.map +1 -0
- package/pennyfarthing-dist/agents/README.md +397 -0
- package/pennyfarthing-dist/agents/architect.md +171 -0
- package/pennyfarthing-dist/agents/dev.md +225 -0
- package/pennyfarthing-dist/agents/devops.md +183 -0
- package/pennyfarthing-dist/agents/generic-handoff.md +451 -0
- package/pennyfarthing-dist/agents/generic-sm-finish.md +261 -0
- package/pennyfarthing-dist/agents/generic-sm-setup.md +214 -0
- package/pennyfarthing-dist/agents/orchestrator.md +316 -0
- package/pennyfarthing-dist/agents/pm.md +153 -0
- package/pennyfarthing-dist/agents/reviewer-preflight.md +224 -0
- package/pennyfarthing-dist/agents/reviewer.md +315 -0
- package/pennyfarthing-dist/agents/sm-file-summary.md +109 -0
- package/pennyfarthing-dist/agents/sm-handoff.md +97 -0
- package/pennyfarthing-dist/agents/sm.md +480 -0
- package/pennyfarthing-dist/agents/tea.md +191 -0
- package/pennyfarthing-dist/agents/tech-writer.md +148 -0
- package/pennyfarthing-dist/agents/testing-runner.md +420 -0
- package/pennyfarthing-dist/agents/ux-designer.md +158 -0
- package/pennyfarthing-dist/agents/workflow-status-check.md +332 -0
- package/pennyfarthing-dist/commands/architect.md +62 -0
- package/pennyfarthing-dist/commands/benchmark-control.md +69 -0
- package/pennyfarthing-dist/commands/benchmark.md +467 -0
- package/pennyfarthing-dist/commands/brainstorm.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 +136 -0
- package/pennyfarthing-dist/commands/continue-session.md +184 -0
- package/pennyfarthing-dist/commands/create-branches-from-story.md +374 -0
- package/pennyfarthing-dist/commands/create-theme.md +29 -0
- package/pennyfarthing-dist/commands/dev.md +60 -0
- package/pennyfarthing-dist/commands/devops.md +59 -0
- package/pennyfarthing-dist/commands/git-cleanup.md +340 -0
- package/pennyfarthing-dist/commands/health-check.md +108 -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 +17 -0
- package/pennyfarthing-dist/commands/new-work.md +127 -0
- package/pennyfarthing-dist/commands/orchestrator.md +56 -0
- package/pennyfarthing-dist/commands/parallel-work.md +71 -0
- package/pennyfarthing-dist/commands/party-mode.md +67 -0
- package/pennyfarthing-dist/commands/permissions.md +193 -0
- package/pennyfarthing-dist/commands/pm.md +60 -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 +64 -0
- package/pennyfarthing-dist/commands/run-ci.md +116 -0
- package/pennyfarthing-dist/commands/set-theme.md +52 -0
- package/pennyfarthing-dist/commands/show-theme.md +21 -0
- package/pennyfarthing-dist/commands/sm.md +70 -0
- package/pennyfarthing-dist/commands/solo.md +411 -0
- package/pennyfarthing-dist/commands/sprint-planning.md +109 -0
- package/pennyfarthing-dist/commands/start-epic.md +156 -0
- package/pennyfarthing-dist/commands/sync-epic-to-jira.md +184 -0
- package/pennyfarthing-dist/commands/sync-work-with-sprint.md +376 -0
- package/pennyfarthing-dist/commands/tea.md +63 -0
- package/pennyfarthing-dist/commands/tech-writer.md +53 -0
- package/pennyfarthing-dist/commands/theme-maker.md +671 -0
- package/pennyfarthing-dist/commands/update-domain-docs.md +83 -0
- package/pennyfarthing-dist/commands/ux-designer.md +62 -0
- package/pennyfarthing-dist/commands/work.md +111 -0
- package/pennyfarthing-dist/guides/AGENT-COORDINATION.md +480 -0
- package/pennyfarthing-dist/guides/AGENT-SCOPES.md +201 -0
- package/pennyfarthing-dist/guides/HOOKS.md +230 -0
- package/pennyfarthing-dist/guides/PROMPT-PATTERNS.md +338 -0
- package/pennyfarthing-dist/guides/SESSION-ARTIFACTS.md +193 -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/patterns/approval-gates-pattern.md +746 -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/persona-system.md +294 -0
- package/pennyfarthing-dist/guides/shared-agent-behavior.md +388 -0
- package/pennyfarthing-dist/guides/shared-context.md +147 -0
- package/pennyfarthing-dist/guides/strategic-agent-behavior.md +348 -0
- package/pennyfarthing-dist/guides/tactical-agent-behavior.md +1041 -0
- package/pennyfarthing-dist/guides/workflow-schema.md +195 -0
- package/pennyfarthing-dist/guides/worktree-mode.md +113 -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/themes/1984.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/a-team.yaml +207 -0
- package/pennyfarthing-dist/personas/themes/agatha-christie.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/alice-in-wonderland.yaml +330 -0
- package/pennyfarthing-dist/personas/themes/all-stars.yaml +332 -0
- package/pennyfarthing-dist/personas/themes/ancient-philosophers.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/ancient-strategists.yaml +306 -0
- package/pennyfarthing-dist/personas/themes/arcane.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/arthurian-mythos.yaml +331 -0
- package/pennyfarthing-dist/personas/themes/avatar-the-last-airbender.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/babylon-5.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/battlestar-galactica.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/better-call-saul.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/big-lebowski.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/black-sails.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/blade-runner.yaml +295 -0
- package/pennyfarthing-dist/personas/themes/bobiverse.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/breaking-bad.yaml +327 -0
- package/pennyfarthing-dist/personas/themes/catch-22.yaml +316 -0
- package/pennyfarthing-dist/personas/themes/classical-composers.yaml +310 -0
- package/pennyfarthing-dist/personas/themes/control.yaml +197 -0
- package/pennyfarthing-dist/personas/themes/count-of-monte-cristo.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/cowboy-bebop.yaml +323 -0
- package/pennyfarthing-dist/personas/themes/deadwood.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/dickens.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/discworld.yaml +332 -0
- package/pennyfarthing-dist/personas/themes/doctor-who.yaml +290 -0
- package/pennyfarthing-dist/personas/themes/don-quixote.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/dune.yaml +307 -0
- package/pennyfarthing-dist/personas/themes/enlightenment-thinkers.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/expeditionary-force.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/fargo.yaml +330 -0
- package/pennyfarthing-dist/personas/themes/film-auteurs.yaml +312 -0
- package/pennyfarthing-dist/personas/themes/firefly.yaml +328 -0
- package/pennyfarthing-dist/personas/themes/foundation.yaml +290 -0
- package/pennyfarthing-dist/personas/themes/futurama.yaml +321 -0
- package/pennyfarthing-dist/personas/themes/game-of-thrones.yaml +290 -0
- package/pennyfarthing-dist/personas/themes/gilligans-island.yaml +243 -0
- package/pennyfarthing-dist/personas/themes/gothic-literature.yaml +308 -0
- package/pennyfarthing-dist/personas/themes/great-gatsby.yaml +308 -0
- package/pennyfarthing-dist/personas/themes/greek-mythology.yaml +330 -0
- package/pennyfarthing-dist/personas/themes/hannibal.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/harry-potter.yaml +324 -0
- package/pennyfarthing-dist/personas/themes/his-dark-materials.yaml +291 -0
- package/pennyfarthing-dist/personas/themes/historical-figures.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/hitchhikers-guide.yaml +331 -0
- package/pennyfarthing-dist/personas/themes/house-md.yaml +321 -0
- package/pennyfarthing-dist/personas/themes/imperial-radch.yaml +289 -0
- package/pennyfarthing-dist/personas/themes/inspector-morse.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/jane-austen.yaml +287 -0
- package/pennyfarthing-dist/personas/themes/jazz-legends.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/justified.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/legion-of-doom.yaml +219 -0
- package/pennyfarthing-dist/personas/themes/les-miserables.yaml +299 -0
- package/pennyfarthing-dist/personas/themes/lord-of-the-rings.yaml +334 -0
- package/pennyfarthing-dist/personas/themes/lovecraft-mythos.yaml +334 -0
- package/pennyfarthing-dist/personas/themes/mad-max.yaml +355 -0
- package/pennyfarthing-dist/personas/themes/mad-men.yaml +289 -0
- package/pennyfarthing-dist/personas/themes/marvel-mcu.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/mash.yaml +334 -0
- package/pennyfarthing-dist/personas/themes/mass-effect.yaml +289 -0
- package/pennyfarthing-dist/personas/themes/military-commanders.yaml +306 -0
- package/pennyfarthing-dist/personas/themes/moby-dick.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/monty-python.yaml +303 -0
- package/pennyfarthing-dist/personas/themes/neuromancer.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/norse-mythology.yaml +329 -0
- package/pennyfarthing-dist/personas/themes/parks-and-rec.yaml +242 -0
- package/pennyfarthing-dist/personas/themes/peaky-blinders.yaml +298 -0
- package/pennyfarthing-dist/personas/themes/princess-bride.yaml +220 -0
- package/pennyfarthing-dist/personas/themes/renaissance-masters.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/rome.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/russian-masters.yaml +318 -0
- package/pennyfarthing-dist/personas/themes/sandman.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/scientific-revolutionaries.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/shakespeare.yaml +301 -0
- package/pennyfarthing-dist/personas/themes/sherlock-holmes.yaml +289 -0
- package/pennyfarthing-dist/personas/themes/snow-crash.yaml +288 -0
- package/pennyfarthing-dist/personas/themes/software-pioneers.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/star-trek-tng.yaml +230 -0
- package/pennyfarthing-dist/personas/themes/star-trek-tos.yaml +210 -0
- package/pennyfarthing-dist/personas/themes/star-wars.yaml +303 -0
- package/pennyfarthing-dist/personas/themes/succession.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/superfriends.yaml +208 -0
- package/pennyfarthing-dist/personas/themes/ted-lasso.yaml +236 -0
- package/pennyfarthing-dist/personas/themes/the-americans.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/the-crown.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/the-expanse.yaml +213 -0
- package/pennyfarthing-dist/personas/themes/the-good-place.yaml +322 -0
- package/pennyfarthing-dist/personas/themes/the-matrix.yaml +353 -0
- package/pennyfarthing-dist/personas/themes/the-odyssey.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/the-office.yaml +330 -0
- package/pennyfarthing-dist/personas/themes/the-simpsons.yaml +308 -0
- package/pennyfarthing-dist/personas/themes/the-sopranos.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/the-wire.yaml +311 -0
- package/pennyfarthing-dist/personas/themes/the-witcher.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/twin-peaks.yaml +302 -0
- package/pennyfarthing-dist/personas/themes/vorkosigan-saga.yaml +300 -0
- package/pennyfarthing-dist/personas/themes/watchmen.yaml +291 -0
- package/pennyfarthing-dist/personas/themes/west-wing.yaml +291 -0
- package/pennyfarthing-dist/personas/themes/world-explorers.yaml +320 -0
- package/pennyfarthing-dist/personas/themes/wwii-leaders.yaml +307 -0
- package/pennyfarthing-dist/personas/themes/x-files.yaml +302 -0
- package/pennyfarthing-dist/scripts/add-short-names.mjs +264 -0
- package/pennyfarthing-dist/scripts/agent-session.sh +367 -0
- package/pennyfarthing-dist/scripts/check-context.sh +187 -0
- package/pennyfarthing-dist/scripts/check.sh +497 -0
- package/pennyfarthing-dist/scripts/deploy.sh +284 -0
- package/pennyfarthing-dist/scripts/doctor-dogfood.sh +360 -0
- package/pennyfarthing-dist/scripts/hooks/context-circuit-breaker.sh +61 -0
- package/pennyfarthing-dist/scripts/hooks/context-warning.sh +66 -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 +50 -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/session-start.sh +98 -0
- package/pennyfarthing-dist/scripts/hooks/session-stop.sh +59 -0
- package/pennyfarthing-dist/scripts/install-git-hooks.sh +91 -0
- package/pennyfarthing-dist/scripts/prime.sh +161 -0
- package/pennyfarthing-dist/scripts/release.sh +198 -0
- package/pennyfarthing-dist/scripts/repo-utils.sh +778 -0
- package/pennyfarthing-dist/scripts/run-ci.sh +219 -0
- package/pennyfarthing-dist/scripts/run.sh +65 -0
- package/pennyfarthing-dist/scripts/statusline.sh +264 -0
- package/pennyfarthing-dist/scripts/tests/check.test.sh +582 -0
- package/pennyfarthing-dist/scripts/tests/test-character-voice.sh +107 -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/uninstall.sh +271 -0
- package/pennyfarthing-dist/scripts/utils/background-tasks.sh +177 -0
- package/pennyfarthing-dist/scripts/utils/check-status.sh +251 -0
- package/pennyfarthing-dist/scripts/utils/checkpoint.sh +136 -0
- package/pennyfarthing-dist/scripts/utils/common.sh +157 -0
- package/pennyfarthing-dist/scripts/utils/create-feature-branches.sh +230 -0
- package/pennyfarthing-dist/scripts/utils/file-lock.sh +269 -0
- package/pennyfarthing-dist/scripts/utils/find-related-work.sh +231 -0
- package/pennyfarthing-dist/scripts/utils/find-root.sh +33 -0
- package/pennyfarthing-dist/scripts/utils/generate-skill-docs.sh +110 -0
- package/pennyfarthing-dist/scripts/utils/git-status-all.sh +127 -0
- package/pennyfarthing-dist/scripts/utils/ground-truth-judge.py +289 -0
- package/pennyfarthing-dist/scripts/utils/jira/jira-lib.mjs +443 -0
- package/pennyfarthing-dist/scripts/utils/jira/jira-sync-story.mjs +208 -0
- package/pennyfarthing-dist/scripts/utils/jira/jira-sync.mjs +198 -0
- package/pennyfarthing-dist/scripts/utils/jira-claim-story.sh +162 -0
- package/pennyfarthing-dist/scripts/utils/jira-lib.sh +463 -0
- package/pennyfarthing-dist/scripts/utils/jira-sync-story.sh +8 -0
- package/pennyfarthing-dist/scripts/utils/jira-sync.sh +8 -0
- package/pennyfarthing-dist/scripts/utils/log-skill-usage.sh +74 -0
- package/pennyfarthing-dist/scripts/utils/logging.sh +186 -0
- package/pennyfarthing-dist/scripts/utils/repo-scan.sh +141 -0
- package/pennyfarthing-dist/scripts/utils/retry.sh +76 -0
- package/pennyfarthing-dist/scripts/utils/run-timestamp.sh +7 -0
- package/pennyfarthing-dist/scripts/utils/session-cleanup.sh +319 -0
- package/pennyfarthing-dist/scripts/utils/skill-usage-report.sh +193 -0
- package/pennyfarthing-dist/scripts/utils/sprint-common.sh +286 -0
- package/pennyfarthing-dist/scripts/utils/sprint-metrics.sh +241 -0
- package/pennyfarthing-dist/scripts/utils/swebench-judge.py +400 -0
- package/pennyfarthing-dist/scripts/utils/sync-epic-to-jira.sh +16 -0
- package/pennyfarthing-dist/scripts/utils/test-setup.sh +337 -0
- package/pennyfarthing-dist/scripts/utils/validate-subagent-frontmatter.sh +160 -0
- package/pennyfarthing-dist/scripts/worktree-manager.sh +498 -0
- package/pennyfarthing-dist/skills/agentic-patterns/SKILL.md +236 -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 +268 -0
- package/pennyfarthing-dist/skills/cyclist/SKILL.md +117 -0
- package/pennyfarthing-dist/skills/dev-patterns/SKILL.md +421 -0
- package/pennyfarthing-dist/skills/finalize-run/SKILL.md +258 -0
- package/pennyfarthing-dist/skills/jira/SKILL.md +281 -0
- package/pennyfarthing-dist/skills/judge/SKILL.md +524 -0
- package/pennyfarthing-dist/skills/just/SKILL.md +160 -0
- package/pennyfarthing-dist/skills/mermaid/SKILL.md +240 -0
- package/pennyfarthing-dist/skills/otel/skill.md +222 -0
- package/pennyfarthing-dist/skills/permissions/skill.md +172 -0
- package/pennyfarthing-dist/skills/persona-benchmark/SKILL.md +173 -0
- package/pennyfarthing-dist/skills/skill-registry.schema.json +102 -0
- package/pennyfarthing-dist/skills/skill-registry.yaml +335 -0
- package/pennyfarthing-dist/skills/sprint-context/SKILL.md +120 -0
- package/pennyfarthing-dist/skills/story-management/SKILL.md +208 -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 +169 -0
- package/pennyfarthing-dist/skills/workflow/SKILL.md +160 -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 +90 -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/bdd.yaml +58 -0
- package/pennyfarthing-dist/workflows/tdd.yaml +50 -0
- package/pennyfarthing-dist/workflows/trivial.yaml +40 -0
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* jira-lib.mjs - Shared Jira functions for Pennyfarthing
|
|
4
|
+
*
|
|
5
|
+
* Provides utilities for interacting with Jira using the jira CLI
|
|
6
|
+
* and REST API for operations the CLI doesn't support well.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { execSync, spawnSync } from 'child_process';
|
|
10
|
+
import { readFileSync, existsSync } from 'fs';
|
|
11
|
+
import { dirname, join } from 'path';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
13
|
+
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = dirname(__filename);
|
|
16
|
+
|
|
17
|
+
// Configuration
|
|
18
|
+
export const JIRA_PROJECT = process.env.JIRA_PROJECT || 'MSSCI';
|
|
19
|
+
export const JIRA_URL = process.env.JIRA_URL || 'https://1898andco.atlassian.net';
|
|
20
|
+
|
|
21
|
+
// ANSI colors
|
|
22
|
+
const colors = {
|
|
23
|
+
red: '\x1b[31m',
|
|
24
|
+
green: '\x1b[32m',
|
|
25
|
+
yellow: '\x1b[33m',
|
|
26
|
+
blue: '\x1b[34m',
|
|
27
|
+
reset: '\x1b[0m'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Output helpers
|
|
32
|
+
*/
|
|
33
|
+
export function success(msg) {
|
|
34
|
+
console.error(`${colors.green}[OK]${colors.reset} ${msg}`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function info(msg) {
|
|
38
|
+
console.error(`${colors.blue}[INFO]${colors.reset} ${msg}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function warn(msg) {
|
|
42
|
+
console.error(`${colors.yellow}[WARN]${colors.reset} ${msg}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function error(msg) {
|
|
46
|
+
console.error(`${colors.red}[ERROR]${colors.reset} ${msg}`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Find project root by looking for .claude directory
|
|
51
|
+
*/
|
|
52
|
+
export function findProjectRoot(startDir = process.cwd()) {
|
|
53
|
+
let dir = startDir;
|
|
54
|
+
while (dir !== '/') {
|
|
55
|
+
if (existsSync(join(dir, '.claude'))) {
|
|
56
|
+
return dir;
|
|
57
|
+
}
|
|
58
|
+
dir = dirname(dir);
|
|
59
|
+
}
|
|
60
|
+
throw new Error('Could not find project root (no .claude/ directory found)');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Check if jira CLI and dependencies are available
|
|
65
|
+
*/
|
|
66
|
+
export function checkDependencies(options = {}) {
|
|
67
|
+
const { quiet = false } = options;
|
|
68
|
+
const missing = [];
|
|
69
|
+
|
|
70
|
+
// Check for jira CLI
|
|
71
|
+
try {
|
|
72
|
+
execSync('which jira', { stdio: 'pipe' });
|
|
73
|
+
if (!quiet) success('jira installed');
|
|
74
|
+
} catch {
|
|
75
|
+
missing.push('jira');
|
|
76
|
+
error('jira not found');
|
|
77
|
+
console.error(' Install with: brew install ankitpokhrel/jira-cli/jira-cli');
|
|
78
|
+
console.error(' Then run: jira init');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Check for JIRA_API_TOKEN
|
|
82
|
+
if (!process.env.JIRA_API_TOKEN) {
|
|
83
|
+
missing.push('JIRA_API_TOKEN');
|
|
84
|
+
error('JIRA_API_TOKEN not set');
|
|
85
|
+
console.error(' Create token at: https://id.atlassian.com/manage-profile/security/api-tokens');
|
|
86
|
+
console.error(' Then: export JIRA_API_TOKEN="your-token"');
|
|
87
|
+
} else if (!quiet) {
|
|
88
|
+
success('JIRA_API_TOKEN set');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Check jira config
|
|
92
|
+
const configPath = join(process.env.HOME, '.config/.jira/.config.yml');
|
|
93
|
+
if (existsSync(configPath)) {
|
|
94
|
+
if (!quiet) success('jira configured');
|
|
95
|
+
} else if (missing.indexOf('jira') === -1) {
|
|
96
|
+
missing.push('jira-config');
|
|
97
|
+
error('jira not configured');
|
|
98
|
+
console.error(' Run: jira init');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (missing.length > 0) {
|
|
102
|
+
console.error('');
|
|
103
|
+
error(`Missing: ${missing.join(', ')}`);
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
console.error('');
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Execute jira CLI command and return output
|
|
113
|
+
*/
|
|
114
|
+
export function jiraExec(args, options = {}) {
|
|
115
|
+
const { silent = false, allowFailure = false } = options;
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
const result = spawnSync('jira', args, {
|
|
119
|
+
encoding: 'utf-8',
|
|
120
|
+
stdio: silent ? 'pipe' : ['pipe', 'pipe', 'pipe']
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
if (result.status !== 0 && !allowFailure) {
|
|
124
|
+
throw new Error(result.stderr || `jira command failed with exit code ${result.status}`);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
stdout: result.stdout || '',
|
|
129
|
+
stderr: result.stderr || '',
|
|
130
|
+
status: result.status
|
|
131
|
+
};
|
|
132
|
+
} catch (err) {
|
|
133
|
+
if (allowFailure) {
|
|
134
|
+
return { stdout: '', stderr: err.message, status: 1 };
|
|
135
|
+
}
|
|
136
|
+
throw err;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Get issue as JSON from Jira
|
|
142
|
+
*/
|
|
143
|
+
export function getIssueJson(issueKey) {
|
|
144
|
+
try {
|
|
145
|
+
const result = jiraExec(['issue', 'view', issueKey, '--raw'], { silent: true, allowFailure: true });
|
|
146
|
+
if (result.status !== 0 || !result.stdout) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return JSON.parse(result.stdout);
|
|
150
|
+
} catch {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Extract field from Jira issue JSON
|
|
157
|
+
*/
|
|
158
|
+
export function getJiraField(issueJson, fieldPath, defaultValue = null) {
|
|
159
|
+
if (!issueJson) return defaultValue;
|
|
160
|
+
|
|
161
|
+
const parts = fieldPath.replace(/^\./, '').split('.');
|
|
162
|
+
let value = issueJson;
|
|
163
|
+
|
|
164
|
+
for (const part of parts) {
|
|
165
|
+
if (value === null || value === undefined) return defaultValue;
|
|
166
|
+
value = value[part];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return value ?? defaultValue;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Status mapping: Conductor -> Jira
|
|
174
|
+
*/
|
|
175
|
+
export function mapStatusToJira(conductorStatus) {
|
|
176
|
+
const mapping = {
|
|
177
|
+
'backlog': 'To Do',
|
|
178
|
+
'todo': 'To Do',
|
|
179
|
+
'in-progress': 'In Progress',
|
|
180
|
+
'in_progress': 'In Progress',
|
|
181
|
+
'active': 'In Progress',
|
|
182
|
+
'review': 'In Review',
|
|
183
|
+
'in-review': 'In Review',
|
|
184
|
+
'in_review': 'In Review',
|
|
185
|
+
'done': 'Done',
|
|
186
|
+
'completed': 'Done',
|
|
187
|
+
'closed': 'Done',
|
|
188
|
+
'blocked': 'Blocked'
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
return mapping[conductorStatus?.toLowerCase()] || 'To Do';
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Status mapping: Jira -> Conductor
|
|
196
|
+
*/
|
|
197
|
+
export function mapJiraToStatus(jiraStatus) {
|
|
198
|
+
const mapping = {
|
|
199
|
+
'To Do': 'backlog',
|
|
200
|
+
'Open': 'backlog',
|
|
201
|
+
'Backlog': 'backlog',
|
|
202
|
+
'In Progress': 'in-progress',
|
|
203
|
+
'Active': 'in-progress',
|
|
204
|
+
'In Review': 'review',
|
|
205
|
+
'Review': 'review',
|
|
206
|
+
'Done': 'done',
|
|
207
|
+
'Closed': 'done',
|
|
208
|
+
'Resolved': 'done',
|
|
209
|
+
'Blocked': 'blocked'
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
return mapping[jiraStatus] || 'backlog';
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Extract Jira key from URL or return as-is
|
|
217
|
+
*/
|
|
218
|
+
export function extractJiraKey(input) {
|
|
219
|
+
if (!input) return null;
|
|
220
|
+
|
|
221
|
+
// Already in key format
|
|
222
|
+
const keyPattern = new RegExp(`^${JIRA_PROJECT}-\\d+$`);
|
|
223
|
+
if (keyPattern.test(input)) {
|
|
224
|
+
return input;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Extract from URL
|
|
228
|
+
const urlPattern = new RegExp(`(${JIRA_PROJECT}-\\d+)`);
|
|
229
|
+
const match = input.match(urlPattern);
|
|
230
|
+
return match ? match[1] : input;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Load sprint YAML file using yq CLI
|
|
235
|
+
*/
|
|
236
|
+
export function loadSprintFile(projectRoot) {
|
|
237
|
+
const sprintPath = join(projectRoot, 'sprint', 'current-sprint.yaml');
|
|
238
|
+
if (!existsSync(sprintPath)) {
|
|
239
|
+
throw new Error(`Sprint file not found: ${sprintPath}`);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Use yq to convert YAML to JSON, then parse
|
|
243
|
+
try {
|
|
244
|
+
const json = execSync(`yq -o json '.' "${sprintPath}"`, { encoding: 'utf-8' });
|
|
245
|
+
return JSON.parse(json);
|
|
246
|
+
} catch (err) {
|
|
247
|
+
throw new Error(`Failed to parse sprint file: ${err.message}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Find epic in sprint data (handles "24" and "epic-24" formats)
|
|
253
|
+
*/
|
|
254
|
+
export function findEpic(sprintData, epicNum) {
|
|
255
|
+
if (!sprintData?.epics) return null;
|
|
256
|
+
|
|
257
|
+
return sprintData.epics.find(e =>
|
|
258
|
+
e.id === epicNum ||
|
|
259
|
+
e.id === `epic-${epicNum}` ||
|
|
260
|
+
e.id === epicNum.replace(/^epic-/, '')
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Find story in epic
|
|
266
|
+
*/
|
|
267
|
+
export function findStory(epic, storyId) {
|
|
268
|
+
if (!epic?.stories) return null;
|
|
269
|
+
return epic.stories.find(s => s.id === storyId);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Get story field from sprint YAML
|
|
274
|
+
*/
|
|
275
|
+
export function getStoryField(sprintData, storyKey, fieldName) {
|
|
276
|
+
// Extract epic number from story key (e.g., "24-1" -> "24")
|
|
277
|
+
const epicNum = storyKey.split('-')[0];
|
|
278
|
+
|
|
279
|
+
const epic = findEpic(sprintData, epicNum);
|
|
280
|
+
if (!epic) return null;
|
|
281
|
+
|
|
282
|
+
const story = findStory(epic, storyKey);
|
|
283
|
+
if (!story) return null;
|
|
284
|
+
|
|
285
|
+
return story[fieldName] ?? null;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Transition issue to new status
|
|
290
|
+
*/
|
|
291
|
+
export function moveIssue(issueKey, targetStatus, options = {}) {
|
|
292
|
+
const { dryRun = false } = options;
|
|
293
|
+
|
|
294
|
+
if (dryRun) {
|
|
295
|
+
warn(`[DRY-RUN] Would move ${issueKey} to: ${targetStatus}`);
|
|
296
|
+
return { success: true, dryRun: true };
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Check current status first
|
|
300
|
+
const issueJson = getIssueJson(issueKey);
|
|
301
|
+
if (issueJson) {
|
|
302
|
+
const currentStatus = getJiraField(issueJson, 'fields.status.name');
|
|
303
|
+
if (currentStatus?.toLowerCase() === targetStatus.toLowerCase()) {
|
|
304
|
+
return { success: true, alreadyAtStatus: true };
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const result = jiraExec(['issue', 'move', issueKey, targetStatus], { allowFailure: true });
|
|
309
|
+
return {
|
|
310
|
+
success: result.status === 0,
|
|
311
|
+
output: result.stdout + result.stderr
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Get story points from issue
|
|
317
|
+
*/
|
|
318
|
+
export function getStoryPoints(issueKey, issueJson = null) {
|
|
319
|
+
if (!issueJson) {
|
|
320
|
+
issueJson = getIssueJson(issueKey);
|
|
321
|
+
}
|
|
322
|
+
if (!issueJson) return null;
|
|
323
|
+
|
|
324
|
+
// customfield_10031 is Story Points for 1898andco Jira
|
|
325
|
+
return getJiraField(issueJson, 'fields.customfield_10031', null);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Sync story points via REST API (jira CLI doesn't handle custom fields well)
|
|
330
|
+
*/
|
|
331
|
+
export async function syncStoryPoints(issueKey, conductorPoints, options = {}) {
|
|
332
|
+
const { dryRun = false, currentJiraPoints = null } = options;
|
|
333
|
+
|
|
334
|
+
if (!conductorPoints || conductorPoints === 'null') {
|
|
335
|
+
return { success: false, reason: 'No points in Conductor' };
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Compare current points
|
|
339
|
+
const jiraPoints = currentJiraPoints ?? getStoryPoints(issueKey);
|
|
340
|
+
const jiraPointsInt = jiraPoints ? Math.floor(Number(jiraPoints)) : null;
|
|
341
|
+
|
|
342
|
+
if (jiraPointsInt === Number(conductorPoints)) {
|
|
343
|
+
return { success: true, alreadySynced: true };
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (dryRun) {
|
|
347
|
+
warn(`[DRY-RUN] Would sync points for ${issueKey}: ${jiraPoints} -> ${conductorPoints}`);
|
|
348
|
+
return { success: true, dryRun: true };
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Use REST API to update custom field
|
|
352
|
+
const jiraUser = process.env.JIRA_USER || 'keith.avery@1898andco.io';
|
|
353
|
+
const apiUrl = `${JIRA_URL}/rest/api/3/issue/${issueKey}`;
|
|
354
|
+
|
|
355
|
+
try {
|
|
356
|
+
const response = await fetch(apiUrl, {
|
|
357
|
+
method: 'PUT',
|
|
358
|
+
headers: {
|
|
359
|
+
'Authorization': `Basic ${Buffer.from(`${jiraUser}:${process.env.JIRA_API_TOKEN}`).toString('base64')}`,
|
|
360
|
+
'Content-Type': 'application/json'
|
|
361
|
+
},
|
|
362
|
+
body: JSON.stringify({
|
|
363
|
+
fields: {
|
|
364
|
+
customfield_10031: Number(conductorPoints)
|
|
365
|
+
}
|
|
366
|
+
})
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
if (response.ok || response.status === 204) {
|
|
370
|
+
return { success: true };
|
|
371
|
+
} else {
|
|
372
|
+
return { success: false, reason: `HTTP ${response.status}` };
|
|
373
|
+
}
|
|
374
|
+
} catch (err) {
|
|
375
|
+
return { success: false, reason: err.message };
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Add comment to issue
|
|
381
|
+
*/
|
|
382
|
+
export function addComment(issueKey, comment, options = {}) {
|
|
383
|
+
const { dryRun = false } = options;
|
|
384
|
+
|
|
385
|
+
if (dryRun) {
|
|
386
|
+
warn(`[DRY-RUN] Would add comment to ${issueKey}`);
|
|
387
|
+
return { success: true, dryRun: true };
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const result = jiraExec(['issue', 'comment', 'add', issueKey, comment], { allowFailure: true });
|
|
391
|
+
return {
|
|
392
|
+
success: result.status === 0,
|
|
393
|
+
output: result.stdout + result.stderr
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* GitHub username to Jira email mapping
|
|
399
|
+
*/
|
|
400
|
+
export function mapGithubToJira(githubUser) {
|
|
401
|
+
const mapping = {
|
|
402
|
+
'slabgorb': 'keith.avery@1898andco.io',
|
|
403
|
+
'arcaven': 'michael.pursifull@1898andco.io',
|
|
404
|
+
'RoseSecurity': 'michael.rosenfeld@1898andco.io',
|
|
405
|
+
'Zious11': 'jared.richards@1898andco.io',
|
|
406
|
+
'drbothen': 'joshua.magady@1898andco.io'
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
return mapping[githubUser] || `${githubUser}@1898andco.io`;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Parse command line arguments
|
|
414
|
+
*/
|
|
415
|
+
export function parseArgs(argv, spec) {
|
|
416
|
+
const args = { _positional: [] };
|
|
417
|
+
|
|
418
|
+
for (let i = 2; i < argv.length; i++) {
|
|
419
|
+
const arg = argv[i];
|
|
420
|
+
|
|
421
|
+
if (arg.startsWith('--')) {
|
|
422
|
+
const key = arg.slice(2);
|
|
423
|
+
const specEntry = spec[key];
|
|
424
|
+
|
|
425
|
+
if (specEntry?.type === 'boolean') {
|
|
426
|
+
args[key] = true;
|
|
427
|
+
} else if (specEntry?.type === 'string') {
|
|
428
|
+
args[key] = argv[++i];
|
|
429
|
+
} else {
|
|
430
|
+
// Unknown flag, treat as boolean
|
|
431
|
+
args[key] = true;
|
|
432
|
+
}
|
|
433
|
+
} else if (arg.startsWith('-')) {
|
|
434
|
+
// Short flags
|
|
435
|
+
const key = arg.slice(1);
|
|
436
|
+
args[key] = true;
|
|
437
|
+
} else {
|
|
438
|
+
args._positional.push(arg);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return args;
|
|
443
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* jira-sync-story.mjs - Sync a single story to Jira
|
|
4
|
+
*
|
|
5
|
+
* Usage: node jira-sync-story.mjs <story_key> [--transition] [--points] [--comment "message"]
|
|
6
|
+
*
|
|
7
|
+
* Options:
|
|
8
|
+
* --transition Transition story to match Conductor status
|
|
9
|
+
* --points Sync story points from Conductor to Jira
|
|
10
|
+
* --comment Add a comment to the story
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
checkDependencies,
|
|
15
|
+
findProjectRoot,
|
|
16
|
+
loadSprintFile,
|
|
17
|
+
findEpic,
|
|
18
|
+
findStory,
|
|
19
|
+
extractJiraKey,
|
|
20
|
+
mapStatusToJira,
|
|
21
|
+
getIssueJson,
|
|
22
|
+
getJiraField,
|
|
23
|
+
moveIssue,
|
|
24
|
+
getStoryPoints,
|
|
25
|
+
syncStoryPoints,
|
|
26
|
+
addComment,
|
|
27
|
+
parseArgs,
|
|
28
|
+
success,
|
|
29
|
+
info,
|
|
30
|
+
warn,
|
|
31
|
+
error,
|
|
32
|
+
JIRA_URL
|
|
33
|
+
} from './jira-lib.mjs';
|
|
34
|
+
|
|
35
|
+
// Parse arguments
|
|
36
|
+
const args = parseArgs(process.argv, {
|
|
37
|
+
'transition': { type: 'boolean' },
|
|
38
|
+
'points': { type: 'boolean' },
|
|
39
|
+
'comment': { type: 'string' }
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const storyKey = args._positional[0];
|
|
43
|
+
const doTransition = args.transition || false;
|
|
44
|
+
const doSyncPoints = args.points || false;
|
|
45
|
+
const commentText = args.comment || null;
|
|
46
|
+
|
|
47
|
+
// Show usage if no story key provided
|
|
48
|
+
if (!storyKey) {
|
|
49
|
+
error('Story key required');
|
|
50
|
+
console.log(`
|
|
51
|
+
Usage: jira-sync-story.mjs <story_key> [--transition] [--points] [--comment "message"]
|
|
52
|
+
|
|
53
|
+
Examples:
|
|
54
|
+
jira-sync-story.mjs 24-1 # Show story status
|
|
55
|
+
jira-sync-story.mjs 24-1 --transition # Sync status to Jira
|
|
56
|
+
jira-sync-story.mjs 24-1 --points # Sync story points
|
|
57
|
+
jira-sync-story.mjs 24-1 --transition --points
|
|
58
|
+
jira-sync-story.mjs 24-1 --comment "Started development"
|
|
59
|
+
`);
|
|
60
|
+
process.exit(2);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Check dependencies (quiet mode - we'll show story info instead)
|
|
64
|
+
if (!checkDependencies({ quiet: false })) {
|
|
65
|
+
process.exit(2);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Find project root and load sprint data
|
|
69
|
+
let projectRoot;
|
|
70
|
+
let sprintData;
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
projectRoot = findProjectRoot();
|
|
74
|
+
sprintData = loadSprintFile(projectRoot);
|
|
75
|
+
} catch (err) {
|
|
76
|
+
error(err.message);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Extract epic number from story key (e.g., "24-1" -> "24")
|
|
81
|
+
const epicNum = storyKey.split('-')[0];
|
|
82
|
+
|
|
83
|
+
// Find epic and story
|
|
84
|
+
const epic = findEpic(sprintData, epicNum);
|
|
85
|
+
if (!epic) {
|
|
86
|
+
error(`Epic ${epicNum} not found in sprint file`);
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const story = findStory(epic, storyKey);
|
|
91
|
+
if (!story) {
|
|
92
|
+
error(`Story ${storyKey} not found in epic ${epicNum}`);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Get story details from Conductor
|
|
97
|
+
const conductorStatus = story.status || 'backlog';
|
|
98
|
+
const storyJira = story.jira;
|
|
99
|
+
const storyBranch = story.branch;
|
|
100
|
+
const storyPr = story.pr;
|
|
101
|
+
const storyPoints = story.points;
|
|
102
|
+
|
|
103
|
+
// Check if synced to Jira
|
|
104
|
+
if (!storyJira || storyJira === 'null') {
|
|
105
|
+
warn(`Story ${storyKey} not synced to Jira yet`);
|
|
106
|
+
console.log('');
|
|
107
|
+
console.log('To create this story in Jira, use:');
|
|
108
|
+
console.log(` jira issue create -tStory -s"Story ${storyKey}" -yHigh`);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const jiraKey = extractJiraKey(storyJira);
|
|
113
|
+
|
|
114
|
+
info(`Story: ${storyKey}`);
|
|
115
|
+
info(`Jira: ${jiraKey}`);
|
|
116
|
+
console.log('');
|
|
117
|
+
|
|
118
|
+
// Fetch current Jira state
|
|
119
|
+
const issueJson = getIssueJson(jiraKey);
|
|
120
|
+
if (!issueJson) {
|
|
121
|
+
error(`Could not fetch issue ${jiraKey}`);
|
|
122
|
+
process.exit(2);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const jiraStatus = getJiraField(issueJson, 'fields.status.name', 'Unknown');
|
|
126
|
+
const jiraAssignee = getJiraField(issueJson, 'fields.assignee.displayName', 'Unassigned');
|
|
127
|
+
const jiraSummary = getJiraField(issueJson, 'fields.summary', 'No summary');
|
|
128
|
+
const jiraPoints = getStoryPoints(jiraKey, issueJson);
|
|
129
|
+
|
|
130
|
+
// Display current state
|
|
131
|
+
console.log(` Summary: ${jiraSummary}`);
|
|
132
|
+
console.log(` Jira Status: ${jiraStatus}`);
|
|
133
|
+
console.log(` Assignee: ${jiraAssignee}`);
|
|
134
|
+
console.log(` Conductor Status: ${conductorStatus}`);
|
|
135
|
+
if (storyPoints) console.log(` Conductor Points: ${storyPoints}`);
|
|
136
|
+
if (jiraPoints) console.log(` Jira Points: ${jiraPoints}`);
|
|
137
|
+
if (storyBranch) console.log(` Branch: ${storyBranch}`);
|
|
138
|
+
if (storyPr) console.log(` PR: ${storyPr}`);
|
|
139
|
+
console.log('');
|
|
140
|
+
|
|
141
|
+
// Map Conductor status to target Jira status
|
|
142
|
+
const targetJiraStatus = mapStatusToJira(conductorStatus);
|
|
143
|
+
|
|
144
|
+
// Transition if requested
|
|
145
|
+
if (doTransition) {
|
|
146
|
+
if (jiraStatus === targetJiraStatus) {
|
|
147
|
+
success(`Already at correct status: ${jiraStatus}`);
|
|
148
|
+
} else {
|
|
149
|
+
info(`Transitioning: ${jiraStatus} -> ${targetJiraStatus}`);
|
|
150
|
+
const result = moveIssue(jiraKey, targetJiraStatus);
|
|
151
|
+
if (result.success) {
|
|
152
|
+
success(`Transitioned to ${targetJiraStatus}`);
|
|
153
|
+
} else {
|
|
154
|
+
warn('Could not transition (status may not be available from current state)');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Sync story points if requested
|
|
160
|
+
if (doSyncPoints) {
|
|
161
|
+
info(`Syncing story points: ${jiraPoints || 'unset'} -> ${storyPoints || 'unset'}`);
|
|
162
|
+
const result = await syncStoryPoints(jiraKey, storyPoints, { currentJiraPoints: jiraPoints });
|
|
163
|
+
if (result.success) {
|
|
164
|
+
if (result.alreadySynced) {
|
|
165
|
+
success(`Story points already synced: ${storyPoints}`);
|
|
166
|
+
} else {
|
|
167
|
+
success(`Story points synced: ${storyPoints}`);
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
warn(`Could not sync story points: ${result.reason}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Add comment if provided
|
|
175
|
+
if (commentText) {
|
|
176
|
+
info('Adding comment...');
|
|
177
|
+
const result = addComment(jiraKey, commentText);
|
|
178
|
+
if (result.success) {
|
|
179
|
+
success('Comment added');
|
|
180
|
+
} else {
|
|
181
|
+
warn('Could not add comment');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Auto-comment for transitions (if no manual comment provided)
|
|
186
|
+
if (doTransition && !commentText) {
|
|
187
|
+
let autoComment = null;
|
|
188
|
+
|
|
189
|
+
if (conductorStatus === 'in-progress' && storyBranch) {
|
|
190
|
+
autoComment = `**Development Started**\n\nBranch: \`${storyBranch}\`\n\nSynced from Conductor`;
|
|
191
|
+
} else if (conductorStatus === 'review' && storyPr) {
|
|
192
|
+
autoComment = `**Ready for Review**\n\nPR: ${storyPr}\n\nSynced from Conductor`;
|
|
193
|
+
} else if (conductorStatus === 'done') {
|
|
194
|
+
const today = new Date().toISOString().split('T')[0];
|
|
195
|
+
autoComment = `**Completed**\n\nSynced from Conductor on ${today}`;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (autoComment) {
|
|
199
|
+
info('Adding sync comment...');
|
|
200
|
+
const result = addComment(jiraKey, autoComment);
|
|
201
|
+
if (result.success) {
|
|
202
|
+
success('Sync comment added');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
console.log('');
|
|
208
|
+
success(`${JIRA_URL}/browse/${jiraKey}`);
|