@pennyfarthing/core 9.0.0 → 9.1.2
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 +16 -7
- package/package.json +1 -1
- package/packages/core/dist/cli/commands/doctor.d.ts +5 -2
- package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
- package/packages/core/dist/cli/commands/doctor.js +327 -17
- package/packages/core/dist/cli/commands/doctor.js.map +1 -1
- package/packages/core/dist/cli/commands/init.d.ts.map +1 -1
- package/packages/core/dist/cli/commands/init.js +3 -246
- package/packages/core/dist/cli/commands/init.js.map +1 -1
- package/packages/core/dist/cli/commands/update.d.ts.map +1 -1
- package/packages/core/dist/cli/commands/update.js +4 -140
- package/packages/core/dist/cli/commands/update.js.map +1 -1
- package/packages/core/dist/cli/utils/constants.d.ts +7 -1
- package/packages/core/dist/cli/utils/constants.d.ts.map +1 -1
- package/packages/core/dist/cli/utils/constants.js +2 -0
- package/packages/core/dist/cli/utils/constants.js.map +1 -1
- package/packages/core/dist/cli/utils/settings.d.ts +22 -0
- package/packages/core/dist/cli/utils/settings.d.ts.map +1 -0
- package/packages/core/dist/cli/utils/settings.js +300 -0
- package/packages/core/dist/cli/utils/settings.js.map +1 -0
- package/pennyfarthing-dist/commands/chore.md +18 -17
- package/pennyfarthing-dist/commands/continue-session.md +41 -7
- package/pennyfarthing-dist/commands/fix-blocker.md +22 -0
- package/pennyfarthing-dist/commands/git-cleanup.md +25 -19
- package/pennyfarthing-dist/commands/patch.md +210 -0
- package/pennyfarthing-dist/commands/setup.md +65 -0
- package/pennyfarthing-dist/guides/session-schema.md +346 -0
- package/pennyfarthing-dist/guides/skill-schema.md +412 -0
- package/pennyfarthing-dist/guides/workflow-step-schema.md +512 -0
- package/pennyfarthing-dist/guides/xml-tags.md +292 -0
- package/pennyfarthing-dist/scripts/hooks/__pycache__/question_reflector_check.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/scripts/hooks/context-circuit-breaker.sh +43 -8
- package/pennyfarthing-dist/scripts/hooks/schema-validation.sh +30 -0
- package/pennyfarthing-dist/scripts/hooks/sprint-yaml-validation.sh +78 -0
- package/pennyfarthing-dist/scripts/lib/find-root.sh +32 -7
- package/pennyfarthing-dist/scripts/misc/generate-skill-docs.sh +13 -2
- package/pennyfarthing-dist/scripts/sprint/validate-sprint-yaml.sh +139 -0
- package/pennyfarthing-dist/skills/agentic-patterns/SKILL.md +4 -0
- package/pennyfarthing-dist/skills/changelog/SKILL.md +18 -0
- package/pennyfarthing-dist/skills/code-review/SKILL.md +5 -1
- package/pennyfarthing-dist/skills/context-engineering/SKILL.md +3 -0
- package/pennyfarthing-dist/skills/cyclist/SKILL.md +2 -2
- package/pennyfarthing-dist/skills/dev-patterns/SKILL.md +24 -0
- package/pennyfarthing-dist/skills/finalize-run/SKILL.md +3 -0
- package/pennyfarthing-dist/skills/judge/SKILL.md +8 -0
- package/pennyfarthing-dist/skills/just/SKILL.md +11 -0
- package/pennyfarthing-dist/skills/mermaid/SKILL.md +16 -0
- package/pennyfarthing-dist/skills/otel/skill.md +4 -0
- package/pennyfarthing-dist/skills/permissions/skill.md +3 -0
- package/pennyfarthing-dist/skills/persona-benchmark/SKILL.md +9 -0
- package/pennyfarthing-dist/skills/story/skill.md +16 -16
- package/pennyfarthing-dist/skills/systematic-debugging/SKILL.md +56 -0
- package/pennyfarthing-dist/skills/testing/SKILL.md +22 -0
- package/pennyfarthing-dist/skills/theme/skill.md +12 -0
- package/pennyfarthing-dist/skills/theme-creation/SKILL.md +4 -0
- package/pennyfarthing-dist/skills/workflow/skill.md +22 -14
- package/pennyfarthing-dist/skills/yq/SKILL.md +8 -0
- package/pennyfarthing-dist/templates/settings.local.json.template +9 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-01-initialize.md +12 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-01b-continue.md +12 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-02-context.md +12 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-03-patterns.md +12 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-04-components.md +12 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-05-interfaces.md +12 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-06-risks.md +12 -0
- package/pennyfarthing-dist/workflows/architecture/steps/step-07-document.md +12 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-01-validate-prerequisites.md +25 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-02-design-epics.md +23 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-03-create-stories.md +26 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-04-final-validation.md +24 -0
- package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-05-import-to-future.md +23 -0
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-01-analyze.md +43 -41
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-02-categorize.md +50 -19
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-03-execute.md +102 -111
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-04-verify.md +48 -39
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-05-complete.md +30 -31
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-01-document-discovery.md +21 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-02-prd-analysis.md +21 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-03-epic-coverage-validation.md +23 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-04-ux-alignment.md +23 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-05-epic-quality-review.md +28 -0
- package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-06-final-assessment.md +25 -0
- package/pennyfarthing-dist/workflows/interactive-debug/steps/step-01-connect.md +257 -0
- package/pennyfarthing-dist/workflows/interactive-debug/steps/step-02-explore.md +107 -0
- package/pennyfarthing-dist/workflows/interactive-debug/steps/step-03-fix.md +127 -0
- package/pennyfarthing-dist/workflows/interactive-debug/steps/step-04-commit.md +122 -0
- package/pennyfarthing-dist/workflows/interactive-debug/workflow.yaml +51 -0
- package/pennyfarthing-dist/workflows/patch.yaml +2 -3
- package/pennyfarthing-dist/workflows/prd/steps-c/step-01-init.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-01b-continue.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-02-discovery.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-03-success.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-04-journeys.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-05-domain.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-06-innovation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-07-project-type.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-08-scoping.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-09-functional.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-10-nonfunctional.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-11-polish.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-c/step-12-complete.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-01-discovery.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-01b-legacy-conversion.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-02-review.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-03-edit.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-e/step-e-04-complete.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-01-discovery.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-02-format-detection.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-02b-parity-check.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-03-density-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-04-brief-coverage-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-05-measurability-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-06-traceability-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-07-implementation-leakage-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-08-domain-compliance-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-09-project-type-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-10-smart-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-11-holistic-quality-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-12-completeness-validation.md +6 -0
- package/pennyfarthing-dist/workflows/prd/steps-v/step-v-13-report-complete.md +6 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-01-init.md +18 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-01b-continue.md +19 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-02-vision.md +22 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-03-users.md +22 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-04-metrics.md +23 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-05-scope.md +24 -0
- package/pennyfarthing-dist/workflows/product-brief/steps/step-06-complete.md +22 -0
- package/pennyfarthing-dist/workflows/project-context/steps/step-01-discover.md +22 -0
- package/pennyfarthing-dist/workflows/project-context/steps/step-02-generate.md +31 -0
- package/pennyfarthing-dist/workflows/project-context/steps/step-03-complete.md +28 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-01-discover.md +157 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-02-clone-repos.md +217 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-03-repos-yaml.md +159 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-04-claude-md.md +186 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-05-shared-context.md +185 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-06-task-runner.md +279 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-07-theme.md +200 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-08-cyclist.md +245 -0
- package/pennyfarthing-dist/workflows/project-setup/steps/step-09-complete.md +203 -0
- package/pennyfarthing-dist/workflows/project-setup/workflow.yaml +41 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-01-mode-detection.md +21 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-02-context-gathering.md +23 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-03-execute.md +25 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-04-self-check.md +22 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-05-adversarial-review.md +23 -0
- package/pennyfarthing-dist/workflows/quick-dev/steps/step-06-resolve-findings.md +23 -0
- package/pennyfarthing-dist/workflows/quick-spec/steps/step-01-understand.md +12 -0
- package/pennyfarthing-dist/workflows/quick-spec/steps/step-02-investigate.md +12 -0
- package/pennyfarthing-dist/workflows/quick-spec/steps/step-03-generate.md +12 -0
- package/pennyfarthing-dist/workflows/quick-spec/steps/step-04-review.md +12 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-01-init.md +22 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-02-domain-analysis.md +24 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-03-competitive-landscape.md +25 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-04-regulatory-focus.md +26 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-05-technical-trends.md +26 -0
- package/pennyfarthing-dist/workflows/research/steps-domain/step-06-research-synthesis.md +34 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-01-init.md +23 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-02-customer-behavior.md +25 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-02-customer-insights.md +27 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-03-customer-pain-points.md +26 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-04-customer-decisions.md +27 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-05-competitive-analysis.md +26 -0
- package/pennyfarthing-dist/workflows/research/steps-market/step-06-research-completion.md +35 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-01-init.md +22 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-02-technical-overview.md +25 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-03-integration-patterns.md +26 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-04-architectural-patterns.md +26 -0
- package/pennyfarthing-dist/workflows/research/steps-technical/step-05-implementation-research.md +29 -1
- package/pennyfarthing-dist/workflows/research/steps-technical/step-06-research-synthesis.md +37 -1
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-01-parse-epic-files.md +15 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-02-build-sprint-status.md +17 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-03-status-detection.md +16 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-04-generate-status-file.md +17 -0
- package/pennyfarthing-dist/workflows/sprint-planning/steps/step-05-validate-and-report.md +22 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-01-init.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-01b-continue.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-02-discovery.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-03-core-experience.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-04-emotional-response.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-05-inspiration.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-06-design-system.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-07-defining-experience.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-08-visual-foundation.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-09-design-directions.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-10-user-journeys.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-11-component-strategy.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-12-ux-patterns.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-13-responsive-accessibility.md +6 -0
- package/pennyfarthing-dist/workflows/ux-design/steps/step-14-complete.md +6 -0
- package/pennyfarthing_scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/hooks.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_bidirectional_sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_epic_creation.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_sync_story.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/patch_mode.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/schema_validation_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/sprint.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/workflow.cpython-311.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/discover.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/create_branches.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/status_all.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/bidirectional.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/claim.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/client.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/compat.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/mappings.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/story.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__init__.py +39 -0
- package/pennyfarthing_scripts/migration/__main__.py +10 -0
- package/pennyfarthing_scripts/migration/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/session.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/skill.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/step.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/validate.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/cli.py +304 -0
- package/pennyfarthing_scripts/migration/session.py +384 -0
- package/pennyfarthing_scripts/migration/skill.py +188 -0
- package/pennyfarthing_scripts/migration/step.py +229 -0
- package/pennyfarthing_scripts/migration/validate.py +282 -0
- package/pennyfarthing_scripts/preflight/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/finish.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/persona.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/session.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/tiers.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/schema_validation_hook.py +306 -0
- package/pennyfarthing_scripts/sprint/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/archive.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/archive_epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/status.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/validator.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/work.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/archive_epic.py +399 -0
- package/pennyfarthing_scripts/sprint/cli.py +100 -0
- package/pennyfarthing_scripts/sprint/import_epic.py +431 -0
- package/pennyfarthing_scripts/story/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/create.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/size.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/template.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_brownfield.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_cli_modules.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_common.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_git_utils.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_jira_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_package_structure.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_patch_mode.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_prime.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_validator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_story_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_tiers.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_token_counting.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_workflow_check.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_workflow_cli.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing-dist/scripts/sprint/import-epic-to-future.sh +0 -10
- package/pennyfarthing-dist/scripts/sprint/import_epic_to_future.py +0 -270
|
@@ -325,6 +325,298 @@ Assume the code is broken until you prove otherwise.
|
|
|
325
325
|
| `<persona>` | Agent files (top) |
|
|
326
326
|
| `<role>` | Agent files (after persona) |
|
|
327
327
|
|
|
328
|
+
## Session Tags
|
|
329
|
+
|
|
330
|
+
Tags used in session files (`.session/{story-id}-session.md`) for workflow state tracking.
|
|
331
|
+
|
|
332
|
+
### `<session>`
|
|
333
|
+
|
|
334
|
+
**Purpose:** Root container for all session data.
|
|
335
|
+
|
|
336
|
+
**Usage:** Wraps entire session file content.
|
|
337
|
+
|
|
338
|
+
```markdown
|
|
339
|
+
<session story="MSSCI-12345" workflow="tdd">
|
|
340
|
+
<!-- session content -->
|
|
341
|
+
</session>
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Attributes:**
|
|
345
|
+
- `story` - Story identifier (Jira key or local ID)
|
|
346
|
+
- `workflow` - Workflow type: `tdd`, `trivial`, `bdd`, `agent-docs`
|
|
347
|
+
|
|
348
|
+
### `<meta>`
|
|
349
|
+
|
|
350
|
+
**Purpose:** Story metadata that doesn't change during the session.
|
|
351
|
+
|
|
352
|
+
**Usage:** Inside `<session>`, contains static story info.
|
|
353
|
+
|
|
354
|
+
```markdown
|
|
355
|
+
<meta>
|
|
356
|
+
<jira>MSSCI-12345</jira>
|
|
357
|
+
<epic>MSSCI-12300</epic>
|
|
358
|
+
<points>3</points>
|
|
359
|
+
<started>2026-02-03</started>
|
|
360
|
+
</meta>
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### `<status>`
|
|
364
|
+
|
|
365
|
+
**Purpose:** Machine-readable workflow state for agent navigation.
|
|
366
|
+
|
|
367
|
+
**Usage:** Self-closing element updated at phase transitions.
|
|
368
|
+
|
|
369
|
+
```markdown
|
|
370
|
+
<status phase="green" next-agent="reviewer" handoff-ready="true"/>
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Attributes:**
|
|
374
|
+
- `phase` - Current workflow phase (`setup`, `red`, `green`, `review`, `finish`)
|
|
375
|
+
- `next-agent` - Agent to handle next (`sm`, `tea`, `dev`, `reviewer`)
|
|
376
|
+
- `handoff-ready` - Whether current work is complete (`true`/`false`)
|
|
377
|
+
|
|
378
|
+
### `<acceptance-criteria>`
|
|
379
|
+
|
|
380
|
+
**Purpose:** Track AC completion status in machine-parseable format.
|
|
381
|
+
|
|
382
|
+
**Usage:** Contains `<ac>` child elements.
|
|
383
|
+
|
|
384
|
+
```markdown
|
|
385
|
+
<acceptance-criteria>
|
|
386
|
+
<ac id="1" status="done">User can create account</ac>
|
|
387
|
+
<ac id="2" status="pending">Email validation works</ac>
|
|
388
|
+
</acceptance-criteria>
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### `<ac>`
|
|
392
|
+
|
|
393
|
+
**Purpose:** Individual acceptance criterion.
|
|
394
|
+
|
|
395
|
+
**Attributes:**
|
|
396
|
+
- `id` - Numeric identifier (1, 2, 3...)
|
|
397
|
+
- `status` - `pending`, `in-progress`, `done`, `blocked`
|
|
398
|
+
|
|
399
|
+
### `<work-log>`
|
|
400
|
+
|
|
401
|
+
**Purpose:** Container for chronological agent contributions.
|
|
402
|
+
|
|
403
|
+
**Usage:** Contains `<entry>` and `<assessment>` elements.
|
|
404
|
+
|
|
405
|
+
### `<entry>`
|
|
406
|
+
|
|
407
|
+
**Purpose:** Standard work log entry from any agent.
|
|
408
|
+
|
|
409
|
+
**Attributes:**
|
|
410
|
+
- `agent` - Agent identifier (`sm`, `tea`, `dev`, `reviewer`)
|
|
411
|
+
- `date` - Entry date (YYYY-MM-DD)
|
|
412
|
+
- `phase` - Optional TDD phase (`red`, `green`, `refactor`)
|
|
413
|
+
|
|
414
|
+
```markdown
|
|
415
|
+
<entry agent="tea" date="2026-02-03" phase="red">
|
|
416
|
+
Wrote failing tests for all ACs.
|
|
417
|
+
</entry>
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### `<assessment>`
|
|
421
|
+
|
|
422
|
+
**Purpose:** Formal verdict from Reviewer agent.
|
|
423
|
+
|
|
424
|
+
**Attributes:**
|
|
425
|
+
- `agent` - Must be `reviewer`
|
|
426
|
+
- `verdict` - `approved`, `rejected`, `needs-work`
|
|
427
|
+
|
|
428
|
+
```markdown
|
|
429
|
+
<assessment agent="reviewer" verdict="approved">
|
|
430
|
+
All ACs verified, code follows patterns.
|
|
431
|
+
</assessment>
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**See also:** `guides/session-schema.md` for complete session file schema.
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## Skill Tags
|
|
439
|
+
|
|
440
|
+
Tags used in skill files (`skills/{name}/SKILL.md`) for command documentation.
|
|
441
|
+
|
|
442
|
+
### `<run>`
|
|
443
|
+
|
|
444
|
+
**Purpose:** The exact command to execute for a skill command.
|
|
445
|
+
|
|
446
|
+
**Usage:** One per command, contains shell command.
|
|
447
|
+
|
|
448
|
+
```markdown
|
|
449
|
+
<run>
|
|
450
|
+
.pennyfarthing/scripts/sprint/sprint-status.sh [filter]
|
|
451
|
+
</run>
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### `<args>`
|
|
455
|
+
|
|
456
|
+
**Purpose:** Document command arguments in table format.
|
|
457
|
+
|
|
458
|
+
**Usage:** Follows `<run>`, contains markdown table.
|
|
459
|
+
|
|
460
|
+
```markdown
|
|
461
|
+
<args>
|
|
462
|
+
| Arg | Required | Description |
|
|
463
|
+
|-----|----------|-------------|
|
|
464
|
+
| `filter` | No | Filter by status: `todo`, `done` |
|
|
465
|
+
</args>
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### `<example>`
|
|
469
|
+
|
|
470
|
+
**Purpose:** Show command usage with expected output.
|
|
471
|
+
|
|
472
|
+
**Usage:** Realistic invocation followed by commented output.
|
|
473
|
+
|
|
474
|
+
```markdown
|
|
475
|
+
<example>
|
|
476
|
+
.pennyfarthing/scripts/sprint/check-story.sh MSSCI-12038
|
|
477
|
+
# Returns: {"type": "story", "available": true}
|
|
478
|
+
</example>
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### `<when>`
|
|
482
|
+
|
|
483
|
+
**Purpose:** Document conditions for using a command and next steps.
|
|
484
|
+
|
|
485
|
+
**Usage:** Trigger conditions or follow-up actions.
|
|
486
|
+
|
|
487
|
+
```markdown
|
|
488
|
+
<when>
|
|
489
|
+
- Starting new development work
|
|
490
|
+
- After promote, create Jira epic with `/jira create epic`
|
|
491
|
+
</when>
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### `<agent-activation>`
|
|
495
|
+
|
|
496
|
+
**Purpose:** Command to load agent persona before using skill.
|
|
497
|
+
|
|
498
|
+
**Usage:** Shell command for agent activation.
|
|
499
|
+
|
|
500
|
+
```markdown
|
|
501
|
+
<agent-activation>
|
|
502
|
+
Load SM persona first:
|
|
503
|
+
```bash
|
|
504
|
+
d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/agent-session.sh" start "sm"
|
|
505
|
+
```
|
|
506
|
+
</agent-activation>
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
**See also:** `guides/skill-schema.md` for complete skill file schema.
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## Workflow Step Tags
|
|
514
|
+
|
|
515
|
+
Tags used in workflow step files (`workflows/{name}/steps/step-*.md`) for BikeLane navigation.
|
|
516
|
+
|
|
517
|
+
### `<step-meta>`
|
|
518
|
+
|
|
519
|
+
**Purpose:** Machine-readable step metadata for workflow navigation.
|
|
520
|
+
|
|
521
|
+
**Usage:** Required at top of every step file.
|
|
522
|
+
|
|
523
|
+
```markdown
|
|
524
|
+
<step-meta>
|
|
525
|
+
number: 1
|
|
526
|
+
name: initialize
|
|
527
|
+
gate: false
|
|
528
|
+
next: step-02-context
|
|
529
|
+
</step-meta>
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
**Fields:**
|
|
533
|
+
- `number` - Step number (integer)
|
|
534
|
+
- `name` - Step identifier (kebab-case)
|
|
535
|
+
- `gate` - Whether step has checkpoint (boolean)
|
|
536
|
+
- `next` - Next step filename (optional)
|
|
537
|
+
|
|
538
|
+
### `<purpose>`
|
|
539
|
+
|
|
540
|
+
**Purpose:** Explain what the step accomplishes.
|
|
541
|
+
|
|
542
|
+
**Usage:** Clear, concise goal statement.
|
|
543
|
+
|
|
544
|
+
```markdown
|
|
545
|
+
<purpose>
|
|
546
|
+
Set up the architecture session by gathering inputs and establishing context.
|
|
547
|
+
</purpose>
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
### `<prerequisites>`
|
|
551
|
+
|
|
552
|
+
**Purpose:** What must be true before starting this step.
|
|
553
|
+
|
|
554
|
+
**Usage:** Bullet list of requirements.
|
|
555
|
+
|
|
556
|
+
```markdown
|
|
557
|
+
<prerequisites>
|
|
558
|
+
- PRD document exists
|
|
559
|
+
- Previous step completed
|
|
560
|
+
</prerequisites>
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
### `<instructions>`
|
|
564
|
+
|
|
565
|
+
**Purpose:** Step-by-step execution guide.
|
|
566
|
+
|
|
567
|
+
**Usage:** Numbered list of actions.
|
|
568
|
+
|
|
569
|
+
```markdown
|
|
570
|
+
<instructions>
|
|
571
|
+
1. Read the PRD document
|
|
572
|
+
2. Identify architectural concerns
|
|
573
|
+
3. Document recommendation
|
|
574
|
+
</instructions>
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
### `<actions>`
|
|
578
|
+
|
|
579
|
+
**Purpose:** Specific file and script operations.
|
|
580
|
+
|
|
581
|
+
**Usage:** Prefixed bullet list (Check:, Read:, Write:, Run:).
|
|
582
|
+
|
|
583
|
+
```markdown
|
|
584
|
+
<actions>
|
|
585
|
+
- Read: `{planning_artifacts}/*prd*.md`
|
|
586
|
+
- Write: `{output_file}` with session content
|
|
587
|
+
</actions>
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
### `<collaboration-menu>`
|
|
591
|
+
|
|
592
|
+
**Purpose:** Present user options after step completion.
|
|
593
|
+
|
|
594
|
+
**Usage:** Standard menu with keyboard shortcuts.
|
|
595
|
+
|
|
596
|
+
```markdown
|
|
597
|
+
<collaboration-menu>
|
|
598
|
+
- **[C] Continue** - Proceed to next step
|
|
599
|
+
- **[R] Revise** - Make changes
|
|
600
|
+
- **[H] Help** - Get guidance
|
|
601
|
+
</collaboration-menu>
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
### `<next-step>`
|
|
605
|
+
|
|
606
|
+
**Purpose:** Explicit navigation to the next step.
|
|
607
|
+
|
|
608
|
+
**Usage:** Instruction on which file to load.
|
|
609
|
+
|
|
610
|
+
```markdown
|
|
611
|
+
<next-step>
|
|
612
|
+
After gate passes, proceed to step-02-context.md
|
|
613
|
+
</next-step>
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
**See also:** `guides/workflow-step-schema.md` for complete workflow step schema.
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
328
620
|
## Adding New Tags
|
|
329
621
|
|
|
330
622
|
Before adding a new tag type:
|
|
Binary file
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
# Context circuit breaker hook: Block tool execution at 85% context usage
|
|
3
3
|
# Called by Claude Code before tool calls (PreToolUse)
|
|
4
4
|
#
|
|
5
|
-
# Input: JSON via stdin with tool_name, tool_input
|
|
5
|
+
# Input: JSON via stdin with tool_name, tool_input, session_id
|
|
6
6
|
# Output: Exit 0 to allow, Exit 2 to block (stderr shown to Claude)
|
|
7
7
|
#
|
|
8
8
|
# This hook provides a hard stop when context is critically high,
|
|
9
9
|
# unlike context-warning.sh which only warns.
|
|
10
|
+
#
|
|
11
|
+
# When triggered, automatically saves the active agent to a checkpoint
|
|
12
|
+
# so /continue-session can restore it with FULL tier.
|
|
10
13
|
|
|
11
|
-
# Read
|
|
12
|
-
cat
|
|
14
|
+
# Read stdin to get session_id (required by hook protocol)
|
|
15
|
+
INPUT=$(cat)
|
|
13
16
|
|
|
14
17
|
# Script location for sibling script references
|
|
15
18
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
@@ -34,6 +37,28 @@ CRITICAL_THRESHOLD="${CRITICAL_THRESHOLD:-80}"
|
|
|
34
37
|
|
|
35
38
|
# Check if at or above critical threshold
|
|
36
39
|
if [[ "$CONTEXT_PERCENT" -ge "$CRITICAL_THRESHOLD" ]] 2>/dev/null; then
|
|
40
|
+
# Auto-save active agent to checkpoint before blocking
|
|
41
|
+
# This allows /continue-session to restore with FULL tier
|
|
42
|
+
source "$SCRIPT_DIR/../lib/checkpoint.sh" 2>/dev/null || true
|
|
43
|
+
|
|
44
|
+
# Get session_id from input JSON
|
|
45
|
+
SESSION_ID=""
|
|
46
|
+
if command -v jq &>/dev/null && [[ -n "$INPUT" ]]; then
|
|
47
|
+
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // empty' 2>/dev/null)
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# Look up active agent for this session
|
|
51
|
+
ACTIVE_AGENT=""
|
|
52
|
+
AGENT_FILE="${CLAUDE_PROJECT_DIR:-.}/.session/agents/${SESSION_ID}"
|
|
53
|
+
if [[ -n "$SESSION_ID" && -f "$AGENT_FILE" ]]; then
|
|
54
|
+
ACTIVE_AGENT=$(cat "$AGENT_FILE" 2>/dev/null)
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# Save agent checkpoint if we found one
|
|
58
|
+
if [[ -n "$ACTIVE_AGENT" ]]; then
|
|
59
|
+
checkpoint_save "circuit_breaker_agent" "$ACTIVE_AGENT" 2>/dev/null || true
|
|
60
|
+
fi
|
|
61
|
+
|
|
37
62
|
# Send error message to stderr (Claude will see this)
|
|
38
63
|
cat >&2 << EOF
|
|
39
64
|
CONTEXT CIRCUIT BREAKER TRIGGERED
|
|
@@ -41,16 +66,26 @@ CONTEXT CIRCUIT BREAKER TRIGGERED
|
|
|
41
66
|
Context usage: ${CONTEXT_PERCENT}% - CRITICAL (threshold: ${CRITICAL_THRESHOLD}%)
|
|
42
67
|
|
|
43
68
|
Tool execution BLOCKED. You must stop and hand off.
|
|
69
|
+
EOF
|
|
70
|
+
|
|
71
|
+
# Include agent info if available
|
|
72
|
+
if [[ -n "$ACTIVE_AGENT" ]]; then
|
|
73
|
+
cat >&2 << EOF
|
|
74
|
+
|
|
75
|
+
Active agent saved: ${ACTIVE_AGENT}
|
|
76
|
+
The agent will be restored with FULL context when you run /continue-session.
|
|
77
|
+
EOF
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
cat >&2 << EOF
|
|
44
81
|
|
|
45
82
|
Required actions:
|
|
46
|
-
1.
|
|
47
|
-
2.
|
|
48
|
-
3. Commit any pending changes
|
|
49
|
-
4. Hand off to next agent OR tell user to start fresh session
|
|
83
|
+
1. Commit any pending changes
|
|
84
|
+
2. Tell user to start fresh session with /continue-session
|
|
50
85
|
|
|
51
86
|
DO NOT attempt further tool calls. This is a hard stop.
|
|
52
87
|
|
|
53
|
-
To resume later: /continue-session
|
|
88
|
+
To resume later: /continue-session
|
|
54
89
|
EOF
|
|
55
90
|
# Exit 2 blocks the tool execution
|
|
56
91
|
exit 2
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env zsh
|
|
2
|
+
# Schema Validation Hook
|
|
3
|
+
# Validates XML schema for session, skill, and workflow step files on Write operations
|
|
4
|
+
# Called by Claude Code PreToolUse hook
|
|
5
|
+
#
|
|
6
|
+
# Input: JSON via stdin with tool_name, tool_input
|
|
7
|
+
# Output: JSON with decision (allow/deny)
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
# Find script directory (zsh compatible)
|
|
12
|
+
SCRIPT_DIR="${0:A:h}"
|
|
13
|
+
source "$SCRIPT_DIR/../lib/find-root.sh"
|
|
14
|
+
|
|
15
|
+
# Set PYTHONPATH for pennyfarthing_scripts
|
|
16
|
+
PENNYFARTHING_SCRIPTS=""
|
|
17
|
+
if [[ -d "$PROJECT_ROOT/pennyfarthing" ]]; then
|
|
18
|
+
# Dogfooding: framework inlined in orchestrator
|
|
19
|
+
PENNYFARTHING_SCRIPTS="$PROJECT_ROOT/pennyfarthing"
|
|
20
|
+
elif [[ -d "$PROJECT_ROOT/node_modules/@pennyfarthing/core" ]]; then
|
|
21
|
+
# Normal install
|
|
22
|
+
PENNYFARTHING_SCRIPTS="$PROJECT_ROOT/node_modules/@pennyfarthing/core"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
if [[ -n "$PENNYFARTHING_SCRIPTS" ]]; then
|
|
26
|
+
export PYTHONPATH="$PENNYFARTHING_SCRIPTS:${PYTHONPATH:-}"
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Run Python validation hook
|
|
30
|
+
python3 -m pennyfarthing_scripts.schema_validation_hook
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Sprint YAML Validation Hook (PostToolUse)
|
|
4
|
+
#
|
|
5
|
+
# Validates sprint YAML files after Edit/Write operations to ensure
|
|
6
|
+
# compatibility with the yaml npm package used by Cyclist's SprintPanel.
|
|
7
|
+
#
|
|
8
|
+
# The yaml npm package follows YAML 1.2 strictly and rejects:
|
|
9
|
+
# - Single-quoted strings with blank lines
|
|
10
|
+
# - Invalid multiline string formats
|
|
11
|
+
#
|
|
12
|
+
# When validation fails, returns additionalContext with an error message
|
|
13
|
+
# prompting the agent to fix the YAML format.
|
|
14
|
+
#
|
|
15
|
+
# Input: JSON via stdin with tool_name, tool_input
|
|
16
|
+
# Output: JSON with additionalContext on validation failure
|
|
17
|
+
#
|
|
18
|
+
# See also: .pennyfarthing/scripts/validation/validate-sprint-yaml.sh
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
# Read hook input from stdin
|
|
23
|
+
INPUT=$(cat)
|
|
24
|
+
|
|
25
|
+
# Extract tool name and file path from input
|
|
26
|
+
TOOL_NAME=$(echo "$INPUT" | grep -o '"tool_name"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*"tool_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/' || echo "")
|
|
27
|
+
FILE_PATH=$(echo "$INPUT" | grep -o '"file_path"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*"file_path"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/' || echo "")
|
|
28
|
+
|
|
29
|
+
# Only process Edit and Write operations on sprint YAML files
|
|
30
|
+
if [[ "$TOOL_NAME" != "Edit" && "$TOOL_NAME" != "Write" ]]; then
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Check if it's a sprint YAML file
|
|
35
|
+
if [[ ! "$FILE_PATH" =~ sprint/.*\.(yaml|yml)$ ]]; then
|
|
36
|
+
exit 0
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Check if the file exists
|
|
40
|
+
if [[ ! -f "$FILE_PATH" ]]; then
|
|
41
|
+
exit 0
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Validate using Node.js yaml package (same parser Cyclist uses)
|
|
45
|
+
VALIDATION_ERROR=$(node --input-type=module -e "
|
|
46
|
+
import { parse } from 'yaml';
|
|
47
|
+
import { readFileSync } from 'fs';
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
const content = readFileSync('$FILE_PATH', 'utf-8');
|
|
51
|
+
parse(content);
|
|
52
|
+
process.exit(0);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
console.error(e.message);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
" 2>&1) && VALID=true || VALID=false
|
|
58
|
+
|
|
59
|
+
if [[ "$VALID" == "true" ]]; then
|
|
60
|
+
# Valid YAML - exit silently
|
|
61
|
+
exit 0
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
# Validation failed - return error context to agent
|
|
65
|
+
# Escape special characters for JSON
|
|
66
|
+
ESCAPED_ERROR=$(echo "$VALIDATION_ERROR" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | tr '\n' ' ')
|
|
67
|
+
ESCAPED_PATH=$(echo "$FILE_PATH" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')
|
|
68
|
+
|
|
69
|
+
cat << EOF
|
|
70
|
+
{
|
|
71
|
+
"hookSpecificOutput": {
|
|
72
|
+
"hookEventName": "PostToolUse",
|
|
73
|
+
"additionalContext": "⚠️ SPRINT YAML VALIDATION FAILED\n\nFile: $ESCAPED_PATH\nError: $ESCAPED_ERROR\n\nThe sprint YAML file has invalid syntax that will break the Cyclist SprintPanel.\n\nCommon fix: Single-quoted strings cannot contain blank lines in YAML 1.2.\nUse literal block scalars (|) for multiline strings instead.\n\nTo auto-fix, run: yq eval -o=json '$ESCAPED_PATH' > /tmp/sprint.json && yq eval -P /tmp/sprint.json > '$ESCAPED_PATH'"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
EOF
|
|
77
|
+
|
|
78
|
+
exit 0
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Shared utility: Find project root
|
|
2
|
+
# Shared utility: Find project root
|
|
3
3
|
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
4
|
+
# Resolution order:
|
|
5
|
+
# 1. Honor explicit PROJECT_ROOT override (from Claude Code or user)
|
|
6
|
+
# 2. BASH_SOURCE derivation (auto-detect caller's location)
|
|
7
|
+
# 3. PWD walk looking for .pennyfarthing/ (fallback)
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
# source /
|
|
9
|
+
# Usage:
|
|
10
|
+
# source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
|
|
10
11
|
# # PROJECT_ROOT is now set
|
|
11
12
|
|
|
12
13
|
# Allow explicit override
|
|
@@ -15,7 +16,31 @@ if [[ -n "${PROJECT_ROOT:-}" ]]; then
|
|
|
15
16
|
return 0 2>/dev/null || exit 0
|
|
16
17
|
fi
|
|
17
18
|
|
|
18
|
-
#
|
|
19
|
+
# BASH_SOURCE approach: derive from caller's location
|
|
20
|
+
# BASH_SOURCE[1] is the script that sourced us, BASH_SOURCE[0] is this file
|
|
21
|
+
_caller_script="${BASH_SOURCE[1]:-}"
|
|
22
|
+
if [[ -n "$_caller_script" ]]; then
|
|
23
|
+
_real_dir="$(cd "$(dirname "$_caller_script")" && pwd -P)"
|
|
24
|
+
if [[ "$_real_dir" == */pennyfarthing-dist/scripts/* ]] || \
|
|
25
|
+
[[ "$_real_dir" == */.pennyfarthing/scripts/* ]]; then
|
|
26
|
+
# Extract package root from path
|
|
27
|
+
_pkg="${_real_dir%/scripts/*}"
|
|
28
|
+
_pkg="${_pkg%/pennyfarthing-dist}"
|
|
29
|
+
_pkg="${_pkg%/.pennyfarthing}"
|
|
30
|
+
if [[ "$_pkg" == */node_modules/* ]]; then
|
|
31
|
+
PROJECT_ROOT="${_pkg%/node_modules/*}"
|
|
32
|
+
else
|
|
33
|
+
PROJECT_ROOT="$_pkg"
|
|
34
|
+
fi
|
|
35
|
+
unset _real_dir _pkg _caller_script
|
|
36
|
+
export PROJECT_ROOT
|
|
37
|
+
return 0 2>/dev/null || exit 0
|
|
38
|
+
fi
|
|
39
|
+
unset _real_dir
|
|
40
|
+
fi
|
|
41
|
+
unset _caller_script
|
|
42
|
+
|
|
43
|
+
# Fallback: walk up from PWD looking for .pennyfarthing/
|
|
19
44
|
_d="$PWD"
|
|
20
45
|
while [[ ! -d "$_d/.pennyfarthing" ]] && [[ "$_d" != "/" ]]; do
|
|
21
46
|
_d="$(dirname "$_d")"
|
|
@@ -19,8 +19,19 @@ set -euo pipefail
|
|
|
19
19
|
|
|
20
20
|
# Self-locate: derive PROJECT_ROOT from this script's position
|
|
21
21
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
22
|
-
|
|
23
|
-
#
|
|
22
|
+
|
|
23
|
+
# Detect if we're in framework development or a consumer project
|
|
24
|
+
# In framework dev: scripts/misc/generate-skill-docs.sh is in pennyfarthing/pennyfarthing-dist/scripts/misc/
|
|
25
|
+
# In consumer: this is symlinked from .pennyfarthing/scripts/misc/
|
|
26
|
+
if [[ "$SCRIPT_DIR" == */pennyfarthing/pennyfarthing-dist/scripts/* ]]; then
|
|
27
|
+
# Framework development context - derive from script location
|
|
28
|
+
PROJECT_ROOT="${SCRIPT_DIR%/pennyfarthing-dist/scripts/*}"
|
|
29
|
+
export PROJECT_ROOT
|
|
30
|
+
else
|
|
31
|
+
# Consumer project context - use find-root.sh
|
|
32
|
+
source "$SCRIPT_DIR/../lib/find-root.sh"
|
|
33
|
+
# PROJECT_ROOT is now set
|
|
34
|
+
fi
|
|
24
35
|
|
|
25
36
|
# Default paths
|
|
26
37
|
REGISTRY_PATH="${PROJECT_ROOT}/pennyfarthing-dist/skills/skill-registry.yaml"
|