@yandy-r/ycc-opencode 0.0.0-stage → 6.0.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/AGENTS.md +38 -0
- package/LICENSE +21 -0
- package/README.md +41 -2
- package/agents/ansible-automation-expert.md +115 -0
- package/agents/api-docs-expert.md +146 -0
- package/agents/api-documenter.md +105 -0
- package/agents/architect.md +264 -0
- package/agents/architecture-analyst.md +99 -0
- package/agents/backport-conflict-resolver.md +134 -0
- package/agents/cloudflare-architect.md +85 -0
- package/agents/cloudflare-developer.md +196 -0
- package/agents/code-architect.md +101 -0
- package/agents/code-documenter.md +114 -0
- package/agents/code-explorer.md +99 -0
- package/agents/code-finder.md +83 -0
- package/agents/code-researcher.md +102 -0
- package/agents/code-reviewer.md +268 -0
- package/agents/code-simplifier.md +77 -0
- package/agents/codebase-advisor.md +130 -0
- package/agents/db-modifier.md +235 -0
- package/agents/docs-git-committer.md +220 -0
- package/agents/documentation-writer.md +92 -0
- package/agents/feature-researcher.md +121 -0
- package/agents/feature-writer.md +89 -0
- package/agents/frontend-ui-developer.md +98 -0
- package/agents/git-cleanup.md +173 -0
- package/agents/go-api-architect.md +172 -0
- package/agents/go-expert-architect.md +147 -0
- package/agents/implementor.md +167 -0
- package/agents/library-docs-writer.md +128 -0
- package/agents/nextjs-ux-ui-expert.md +127 -0
- package/agents/nodejs-backend-architect.md +112 -0
- package/agents/nodejs-backend-developer.md +184 -0
- package/agents/planner.md +257 -0
- package/agents/pr-comment-fixer.md +284 -0
- package/agents/practices-researcher.md +80 -0
- package/agents/project-file-cleaner.md +140 -0
- package/agents/prp-researcher.md +231 -0
- package/agents/python-developer.md +171 -0
- package/agents/python-expert-architect.md +188 -0
- package/agents/readme-generator.md +100 -0
- package/agents/release-fix-applier.md +194 -0
- package/agents/releaser.md +147 -0
- package/agents/research-specialist.md +106 -0
- package/agents/reverse-proxy-architect.md +131 -0
- package/agents/review-fixer.md +264 -0
- package/agents/root-cause-analyzer.md +105 -0
- package/agents/rust-build-resolver.md +183 -0
- package/agents/rust-expert-architect.md +149 -0
- package/agents/rust-reviewer.md +126 -0
- package/agents/sql-database-developer.md +195 -0
- package/agents/systems-engineering-expert.md +203 -0
- package/agents/terraform-architect.md +109 -0
- package/agents/terraform-developer.md +229 -0
- package/agents/test-strategy-planner.md +126 -0
- package/agents/turso-database-architect.md +139 -0
- package/agents/typescript-developer.md +170 -0
- package/agents/typescript-expert-architect.md +167 -0
- package/index.js +260 -0
- package/package.json +35 -4
- package/registration.json +4384 -0
- package/shared/references/agent-native-setup.md +121 -0
- package/shared/references/branch-prep.md +31 -0
- package/shared/references/branching-model.md +162 -0
- package/shared/references/ci-monitoring.md +445 -0
- package/shared/references/forge-detection.md +162 -0
- package/shared/references/goal-pairing.md +53 -0
- package/shared/references/pr-base-and-backport.md +143 -0
- package/shared/references/review-artifact-format.md +141 -0
- package/shared/references/review-checklist.md +161 -0
- package/shared/references/review-dispatch.md +71 -0
- package/shared/references/session-state.md +159 -0
- package/shared/references/standalone-dispatch.md +298 -0
- package/shared/references/target-capability-matrix.md +325 -0
- package/shared/references/visual-mode.md +155 -0
- package/shared/references/worktree-strategy.md +310 -0
- package/shared/scripts/backport-audit.sh +283 -0
- package/shared/scripts/ci-monitor.sh +637 -0
- package/shared/scripts/lib/backport-lib.sh +47 -0
- package/shared/scripts/lib/ci-classify.sh +103 -0
- package/shared/scripts/lib/forge.sh +264 -0
- package/shared/scripts/lib/release-state-lib.sh +300 -0
- package/shared/scripts/list-worktrees.sh +178 -0
- package/shared/scripts/merge-children.sh +82 -0
- package/shared/scripts/move-plan-to-worktree.sh +231 -0
- package/shared/scripts/pr-guard.sh +283 -0
- package/shared/scripts/prepare-feature-branch.sh +326 -0
- package/shared/scripts/release-ci-monitor.sh +671 -0
- package/shared/scripts/release-state-update.sh +216 -0
- package/shared/scripts/release-state.sh +178 -0
- package/shared/scripts/report-bundle-drift.sh +343 -0
- package/shared/scripts/require-python.sh +17 -0
- package/shared/scripts/resolve-plans-dir.sh +262 -0
- package/shared/scripts/rules-pointer.sh +20 -0
- package/shared/scripts/rules_pointer.py +267 -0
- package/shared/scripts/setup-worktree.sh +288 -0
- package/shared/scripts/validate-file-paths.sh +249 -0
- package/shared/scripts/visual-egress-guard.sh +303 -0
- package/shared/scripts/visual-recap-collect.sh +247 -0
- package/shared/scripts/worktree-paths.sh +86 -0
- package/skills/backport/SKILL.md +291 -0
- package/skills/backport/scripts/cherry-pick-pr.sh +232 -0
- package/skills/backport/scripts/find-pending.sh +199 -0
- package/skills/blueprint/SKILL.md +410 -0
- package/skills/blueprint/references/bootstrap-mapping.md +87 -0
- package/skills/bundle-author/SKILL.md +119 -0
- package/skills/bundle-author/references/surface-map.md +128 -0
- package/skills/bundle-author/references/templates/agent-template.md +21 -0
- package/skills/bundle-author/references/templates/skill-template.md +36 -0
- package/skills/bundle-author/references/when-not-to-scaffold.md +85 -0
- package/skills/bundle-author/scripts/scaffold-skill.sh +156 -0
- package/skills/bundle-release/SKILL.md +188 -0
- package/skills/bundle-release/references/release-checklist.md +196 -0
- package/skills/bundle-release/references/release-notes-template.md +48 -0
- package/skills/bundle-release/references/version-policy.md +150 -0
- package/skills/bundle-release/scripts/bump-version.sh +97 -0
- package/skills/bundle-release/scripts/draft-notes.sh +222 -0
- package/skills/bundle-release/scripts/preflight.sh +164 -0
- package/skills/bundle-release/scripts/release_versions.py +361 -0
- package/skills/clean/SKILL.md +107 -0
- package/skills/clean/references/agent-prompts.md +199 -0
- package/skills/clean/references/safety-config.md +125 -0
- package/skills/clean/scripts/detect-project-type.sh +423 -0
- package/skills/clean/scripts/generate-report.sh +245 -0
- package/skills/clean/scripts/validate-safety.sh +401 -0
- package/skills/code-report/SKILL.md +375 -0
- package/skills/code-report/scripts/check-prerequisites.sh +65 -0
- package/skills/code-report/templates/report-structure.md +202 -0
- package/skills/code-review/SKILL.md +153 -0
- package/skills/code-review/references/pr-procedure.md +311 -0
- package/skills/compatibility-audit/SKILL.md +226 -0
- package/skills/compatibility-audit/references/reading-the-report.md +159 -0
- package/skills/compatibility-audit/scripts/audit-install-assumptions.sh +372 -0
- package/skills/compatibility-audit/scripts/audit-target-features.sh +558 -0
- package/skills/deep-research/SKILL.md +251 -0
- package/skills/deep-research/references/analysis-prompts.md +702 -0
- package/skills/deep-research/references/completion-summary-template.md +66 -0
- package/skills/deep-research/references/persona-analogical.md +159 -0
- package/skills/deep-research/references/persona-archaeological.md +69 -0
- package/skills/deep-research/references/persona-contrarian.md +155 -0
- package/skills/deep-research/references/persona-futurist.md +70 -0
- package/skills/deep-research/references/persona-historical.md +142 -0
- package/skills/deep-research/references/persona-journalistic.md +69 -0
- package/skills/deep-research/references/persona-negative-space.md +70 -0
- package/skills/deep-research/references/persona-systems.md +69 -0
- package/skills/deep-research/references/synthesis-template.md +569 -0
- package/skills/deep-research/references/verification-log-template.md +32 -0
- package/skills/deep-research/scripts/check-prerequisites.sh +153 -0
- package/skills/deep-research/scripts/validate-research.sh +244 -0
- package/skills/feature-research/SKILL.md +292 -0
- package/skills/feature-research/scripts/validate-research.sh +159 -0
- package/skills/feature-research/scripts/validate-spec.sh +270 -0
- package/skills/feature-research/templates/research-agents.md +569 -0
- package/skills/feature-research/templates/spec-structure.md +437 -0
- package/skills/formatters/SKILL.md +207 -0
- package/skills/formatters/references/best-practices.md +78 -0
- package/skills/formatters/references/flag-reference.md +178 -0
- package/skills/formatters/references/stack-detection.md +119 -0
- package/skills/formatters/references/templates/husky-pre-commit.tmpl +13 -0
- package/skills/formatters/references/templates/justfile-snippet.just.tmpl +31 -0
- package/skills/formatters/references/templates/lefthook.yml.tmpl +22 -0
- package/skills/formatters/references/templates/lint-autofix.yml.tmpl +94 -0
- package/skills/formatters/references/templates/lint.yml.tmpl +85 -0
- package/skills/formatters/references/templates/makefile-snippet.mk.tmpl +34 -0
- package/skills/formatters/references/templates/package-json-scripts.json.tmpl +14 -0
- package/skills/formatters/references/templates/readme-section.md.tmpl +118 -0
- package/skills/formatters/scripts/apply-aliases.sh +245 -0
- package/skills/formatters/scripts/apply-ci.sh +136 -0
- package/skills/formatters/scripts/apply-docs.sh +187 -0
- package/skills/formatters/scripts/apply-hooks.sh +261 -0
- package/skills/formatters/scripts/bundle/format.sh +15 -0
- package/skills/formatters/scripts/bundle/go-tools.sh +119 -0
- package/skills/formatters/scripts/bundle/init-formatters.sh +517 -0
- package/skills/formatters/scripts/bundle/install-shellcheck.sh +85 -0
- package/skills/formatters/scripts/bundle/lib/excludes.sh +179 -0
- package/skills/formatters/scripts/bundle/lib/modified-files.sh +222 -0
- package/skills/formatters/scripts/bundle/lib/shellcheck-resolve.sh +81 -0
- package/skills/formatters/scripts/bundle/lib/shellcheck-version.sh +5 -0
- package/skills/formatters/scripts/bundle/lint.sh +15 -0
- package/skills/formatters/scripts/bundle/style.sh +1410 -0
- package/skills/formatters/scripts/bundle/templates/biome.json +81 -0
- package/skills/formatters/scripts/bundle/templates/clippy.toml +2 -0
- package/skills/formatters/scripts/bundle/templates/markdownlint.json +14 -0
- package/skills/formatters/scripts/bundle/templates/markdownlintignore +38 -0
- package/skills/formatters/scripts/bundle/templates/prettierignore +45 -0
- package/skills/formatters/scripts/bundle/templates/prettierrc.json +11 -0
- package/skills/formatters/scripts/bundle/templates/python-pyproject.toml +80 -0
- package/skills/formatters/scripts/bundle/templates/rustfmt.toml +41 -0
- package/skills/formatters/scripts/bundle/templates/tsconfig.json +21 -0
- package/skills/formatters/scripts/profile-style.sh +264 -0
- package/skills/frontend-design/SKILL.md +151 -0
- package/skills/frontend-patterns/SKILL.md +66 -0
- package/skills/frontend-patterns/references/animation.md +21 -0
- package/skills/frontend-patterns/references/components-and-state.md +40 -0
- package/skills/frontend-patterns/references/data-and-performance.md +34 -0
- package/skills/frontend-patterns/references/forms-errors-a11y.md +35 -0
- package/skills/git-cleanup/SKILL.md +286 -0
- package/skills/git-cleanup/references/active-code-rules.md +318 -0
- package/skills/git-cleanup/references/host-detection.md +217 -0
- package/skills/git-workflow/SKILL.md +130 -0
- package/skills/git-workflow/references/ci-monitoring-phase.md +130 -0
- package/skills/git-workflow/references/commit-phases.md +247 -0
- package/skills/git-workflow/references/examples-and-troubleshooting.md +47 -0
- package/skills/git-workflow/references/goal-pairing.md +23 -0
- package/skills/git-workflow/references/pr-creation.md +269 -0
- package/skills/git-workflow/scripts/analyze-changes.sh +266 -0
- package/skills/git-workflow/scripts/create-pr.sh +464 -0
- package/skills/git-workflow/scripts/validate-commit.sh +235 -0
- package/skills/git-workflow/templates/agent-prompts.md +518 -0
- package/skills/git-workflow/templates/commit-types.md +504 -0
- package/skills/git-workflow/templates/documentation-decision.md +509 -0
- package/skills/git-workflow/templates/pr-template.md +772 -0
- package/skills/go-patterns/SKILL.md +89 -0
- package/skills/go-patterns/references/design-and-tooling.md +336 -0
- package/skills/go-patterns/references/errors-and-concurrency.md +292 -0
- package/skills/go-testing/SKILL.md +133 -0
- package/skills/go-testing/references/advanced-testing.md +349 -0
- package/skills/go-testing/references/test-structure.md +277 -0
- package/skills/hooks-workflow/SKILL.md +232 -0
- package/skills/hooks-workflow/references/support-notes.md +134 -0
- package/skills/hooks-workflow/references/templates/claude-settings.json.tmpl +13 -0
- package/skills/hooks-workflow/references/templates/codex-config-fragment.toml.tmpl +9 -0
- package/skills/hooks-workflow/references/templates/cursor-rule-fragment.mdc.tmpl +16 -0
- package/skills/hooks-workflow/scripts/build-hook-config.sh +487 -0
- package/skills/hooks-workflow/scripts/verify-hooks.sh +257 -0
- package/skills/implement-plan/SKILL.md +221 -0
- package/skills/implement-plan/references/agent-task-prompt.md +214 -0
- package/skills/implement-plan/references/output-formats.md +150 -0
- package/skills/implement-plan/references/plan-inputs.md +126 -0
- package/skills/implement-plan/scripts/check-prerequisites.sh +78 -0
- package/skills/implement-plan/scripts/parse-dependencies.sh +206 -0
- package/skills/init/SKILL.md +272 -0
- package/skills/init/references/conventional-commits.md +114 -0
- package/skills/init/references/flag-reference.md +236 -0
- package/skills/init/references/label-taxonomy.md +115 -0
- package/skills/init/references/project-profile-heuristics.md +156 -0
- package/skills/init/references/template-library.md +129 -0
- package/skills/init/scripts/count-source-files.sh +60 -0
- package/skills/init/scripts/generate-agent-catalog.sh +193 -0
- package/skills/init/scripts/generate-mcp-catalog.sh +214 -0
- package/skills/init/scripts/migrate-rules.py +459 -0
- package/skills/init/scripts/migrate-rules.sh +26 -0
- package/skills/init/scripts/profile-project.sh +453 -0
- package/skills/init/scripts/render-template.py +226 -0
- package/skills/init/scripts/render-template.sh +25 -0
- package/skills/init/scripts/rules-report.sh +31 -0
- package/skills/init/scripts/rules_file_lib.py +41 -0
- package/skills/init/templates/AGENTS.md.tmpl +38 -0
- package/skills/init/templates/CLAUDE.md.tmpl +7 -0
- package/skills/init/templates/ai-rule.md.tmpl +3 -0
- package/skills/init/templates/cursor-rule.mdc.tmpl +7 -0
- package/skills/init/templates/git/commitlint.config.cjs.tmpl +40 -0
- package/skills/init/templates/git/gitignore.tmpl +120 -0
- package/skills/init/templates/git/gitmessage.tmpl +27 -0
- package/skills/init/templates/git/install-lefthook.sh.tmpl +131 -0
- package/skills/init/templates/git/lefthook-usage.md.tmpl +101 -0
- package/skills/init/templates/git/lefthook.yml.tmpl +64 -0
- package/skills/init/templates/github/bug_report.yml.tmpl +78 -0
- package/skills/init/templates/github/config.yml.tmpl +5 -0
- package/skills/init/templates/github/copilot-instructions.md.tmpl +24 -0
- package/skills/init/templates/github/docs_request.yml.tmpl +41 -0
- package/skills/init/templates/github/feature_request.yml.tmpl +59 -0
- package/skills/init/templates/github/labels.md.tmpl +75 -0
- package/skills/init/templates/github/pull_request_template.md.tmpl +66 -0
- package/skills/init/templates/github/workflows/pr-title-autofix.yml.tmpl +101 -0
- package/skills/init/templates/github/workflows/pr-title.yml.tmpl +55 -0
- package/skills/init/templates/workspace-report.md +83 -0
- package/skills/orchestrate/SKILL.md +165 -0
- package/skills/orchestrate/references/agent-catalog.md +601 -0
- package/skills/orchestrate/references/agent-prompts.md +495 -0
- package/skills/orchestrate/references/dispatch-playbook.md +333 -0
- package/skills/orchestrate/references/task-breakdown.md +410 -0
- package/skills/orchestrate/scripts/analyze-task.sh +139 -0
- package/skills/orchestrate/scripts/summarize-results.sh +160 -0
- package/skills/orchestrate/scripts/validate-agents.sh +92 -0
- package/skills/parallel-plan/SKILL.md +124 -0
- package/skills/plan/SKILL.md +134 -0
- package/skills/plan/references/enhanced-personas.md +131 -0
- package/skills/plan/references/personas-and-merge.md +77 -0
- package/skills/plan/references/plan-validation.md +65 -0
- package/skills/plan/references/planner-prompts.md +68 -0
- package/skills/plan/references/planning-tracks.md +73 -0
- package/skills/plan-workflow/SKILL.md +406 -0
- package/skills/plan-workflow/references/checkpoint-messages.md +370 -0
- package/skills/plan-workflow/references/plan-structure.md +238 -0
- package/skills/plan-workflow/references/planning-agents.md +511 -0
- package/skills/plan-workflow/references/research-agents-optimized.md +348 -0
- package/skills/plan-workflow/references/research-agents.md +436 -0
- package/skills/plan-workflow/references/shared-structure.md +152 -0
- package/skills/plan-workflow/references/validation-agents.md +363 -0
- package/skills/plan-workflow/scripts/check-prerequisites.sh +65 -0
- package/skills/plan-workflow/scripts/check-state.sh +190 -0
- package/skills/plan-workflow/scripts/persist-or-fail.sh +135 -0
- package/skills/plan-workflow/scripts/validate-analysis-artifacts.sh +216 -0
- package/skills/plan-workflow/scripts/validate-research-artifacts.sh +225 -0
- package/skills/plan-workflow/scripts/validate-shared.sh +229 -0
- package/skills/plan-workflow/scripts/validate-workflow-plan.sh +256 -0
- package/skills/pr-autofix/SKILL.md +307 -0
- package/skills/pr-autofix/references/ci-loop.md +64 -0
- package/skills/pr-autofix/references/comment-sources.md +197 -0
- package/skills/pr-autofix/references/data-shapes.md +87 -0
- package/skills/pr-autofix/references/goal-example.md +30 -0
- package/skills/pr-autofix/references/output-templates.md +162 -0
- package/skills/pr-autofix/references/prompt-injection-safety.md +165 -0
- package/skills/pr-autofix/references/related-skills.md +11 -0
- package/skills/pr-autofix/references/severity-mapping.md +146 -0
- package/skills/pr-autofix/scripts/fetch-pr-comments.sh +364 -0
- package/skills/pr-autofix/scripts/post-summary.sh +226 -0
- package/skills/pr-autofix/scripts/resolve-thread.sh +251 -0
- package/skills/prp-commit/SKILL.md +128 -0
- package/skills/prp-implement/SKILL.md +177 -0
- package/skills/prp-implement/references/agent-task-prompt.md +36 -0
- package/skills/prp-implement/references/detection.md +49 -0
- package/skills/prp-implement/references/dry-run.md +0 -0
- package/skills/prp-implement/references/report-output.md +204 -0
- package/skills/prp-implement/references/validation-and-failures.md +118 -0
- package/skills/prp-plan/SKILL.md +323 -0
- package/skills/prp-plan/references/enhanced-researchers.md +425 -0
- package/skills/prp-plan/references/parallel-additions.md +56 -0
- package/skills/prp-plan/references/plan-template.md +264 -0
- package/skills/prp-plan/references/synthesis-map.md +25 -0
- package/skills/prp-plan/scripts/preflight-enhanced-agents.sh +111 -0
- package/skills/prp-plan/scripts/validate-prp-plan.sh +368 -0
- package/skills/prp-pr/SKILL.md +402 -0
- package/skills/prp-prd/SKILL.md +442 -0
- package/skills/prp-spec/SKILL.md +274 -0
- package/skills/python-patterns/SKILL.md +103 -0
- package/skills/python-patterns/references/core-idioms.md +304 -0
- package/skills/python-patterns/references/design-and-tooling.md +407 -0
- package/skills/python-testing/SKILL.md +114 -0
- package/skills/python-testing/references/mocking-and-integration.md +395 -0
- package/skills/python-testing/references/pytest-core.md +366 -0
- package/skills/quick-fix/SKILL.md +246 -0
- package/skills/quick-review/SKILL.md +304 -0
- package/skills/release-model/SKILL.md +231 -0
- package/skills/release-model/references/pointer-and-labels.md +83 -0
- package/skills/release-model/references/signals-and-proposal.md +68 -0
- package/skills/release-model/references/template-placeholders.md +42 -0
- package/skills/release-model/references/upgrade-and-audit.md +131 -0
- package/skills/release-model/scripts/collect-signals.sh +459 -0
- package/skills/release-model/scripts/pointer-targets.sh +29 -0
- package/skills/release-model/templates/RELEASING.md.tmpl +151 -0
- package/skills/releaser/SKILL.md +251 -0
- package/skills/releaser/references/ci-optimization-checklist.md +149 -0
- package/skills/releaser/references/ci-templates/docker-release.yml +88 -0
- package/skills/releaser/references/ci-templates/generic-release.yml +69 -0
- package/skills/releaser/references/ci-templates/go-release.yml +50 -0
- package/skills/releaser/references/ci-templates/node-release.yml +126 -0
- package/skills/releaser/references/ci-templates/python-release.yml +95 -0
- package/skills/releaser/references/ci-templates/rust-release.yml +128 -0
- package/skills/releaser/references/ci-workflow-modes.md +42 -0
- package/skills/releaser/references/goal-pairing.md +37 -0
- package/skills/releaser/references/output-templates.md +143 -0
- package/skills/releaser/references/project-type-matrix.md +144 -0
- package/skills/releaser/references/release-branches.md +138 -0
- package/skills/releaser/references/release-ci-loop.md +249 -0
- package/skills/releaser/references/release-notes-template.md +42 -0
- package/skills/releaser/references/release-preparation.md +210 -0
- package/skills/releaser/scripts/check-release-branch.sh +235 -0
- package/skills/releaser/scripts/detect-project.sh +234 -0
- package/skills/releaser/scripts/draft-changelog.sh +387 -0
- package/skills/releaser/scripts/publish-release.sh +302 -0
- package/skills/research-to-issues/SKILL.md +285 -0
- package/skills/research-to-issues/references/label-taxonomy.md +48 -0
- package/skills/research-to-issues/references/parse-deep-research.md +86 -0
- package/skills/research-to-issues/references/parse-feature-spec.md +143 -0
- package/skills/research-to-issues/references/parse-parallel-plan.md +124 -0
- package/skills/research-to-issues/references/parse-prd.md +184 -0
- package/skills/research-to-issues/references/parse-prp-plan.md +237 -0
- package/skills/research-to-issues/references/plan-display-format.md +136 -0
- package/skills/research-to-issues/scripts/validate-prerequisites.sh +312 -0
- package/skills/research-to-issues/templates/feature-issue.md +131 -0
- package/skills/research-to-issues/templates/task-issue.md +104 -0
- package/skills/research-to-issues/templates/tracking-issue.md +126 -0
- package/skills/resume-session/SKILL.md +152 -0
- package/skills/review-fix/SKILL.md +229 -0
- package/skills/review-fix/references/fix-report.md +121 -0
- package/skills/review-fix/references/fixer-dispatch.md +79 -0
- package/skills/review-fix/references/plan.md +119 -0
- package/skills/rust-patterns/SKILL.md +85 -0
- package/skills/rust-patterns/references/concurrency-unsafe-modules.md +243 -0
- package/skills/rust-patterns/references/ownership-errors-types.md +262 -0
- package/skills/rust-testing/SKILL.md +99 -0
- package/skills/rust-testing/references/advanced-testing.md +247 -0
- package/skills/rust-testing/references/unit-and-integration.md +193 -0
- package/skills/save-session/SKILL.md +159 -0
- package/skills/shared-context/SKILL.md +101 -0
- package/skills/ts-patterns/SKILL.md +159 -0
- package/skills/ts-patterns/references/async-runtimes-tooling.md +375 -0
- package/skills/ts-patterns/references/types-errors-modules.md +336 -0
- package/skills/ts-testing/SKILL.md +151 -0
- package/skills/ts-testing/references/advanced-testing.md +350 -0
- package/skills/ts-testing/references/vitest-core.md +318 -0
- package/skills/visual-plan/SKILL.md +221 -0
- package/skills/visual-plan/references/canvas.md +132 -0
- package/skills/visual-plan/references/document-quality.md +178 -0
- package/skills/visual-plan/references/exemplar.md +120 -0
- package/skills/visual-plan/references/wireframe.md +212 -0
- package/skills/visual-plan/scripts/derive-visual-dir.sh +77 -0
- package/skills/visual-recap/SKILL.md +238 -0
- package/skills/visual-recap/references/wireframe.md +237 -0
- package/skills/write-docs/SKILL.md +354 -0
- package/skills/write-docs/scripts/audit-documentation.sh +190 -0
- package/skills/write-docs/scripts/generate-doc-index.sh +125 -0
- package/skills/write-docs/scripts/verify-links.sh +81 -0
- package/skills/write-docs/templates/docs-readme.md +34 -0
- package/skills/write-docs/templates/documentation-strategy.md +91 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# List surviving worktrees for a given repo/feature combination
|
|
3
|
+
# Usage: list-worktrees.sh <repo-name> <feature-slug>
|
|
4
|
+
#
|
|
5
|
+
# Runs `git worktree list --porcelain` and filters results to worktrees whose
|
|
6
|
+
# path contains <repo-root>/.opencode/worktrees/<repo-name>-<feature-slug>
|
|
7
|
+
# (generated bundles rewrite the root for their runtime).
|
|
8
|
+
#
|
|
9
|
+
# Output:
|
|
10
|
+
# A markdown table of matching worktrees (path, branch, status) followed by
|
|
11
|
+
# a "Cleanup commands" block with `git worktree remove <path>` for each row.
|
|
12
|
+
# If no matching worktrees are found, prints a short message and exits 0.
|
|
13
|
+
#
|
|
14
|
+
# Exit codes:
|
|
15
|
+
# 0 - Success (including zero results)
|
|
16
|
+
# 1 - Input validation error
|
|
17
|
+
|
|
18
|
+
set -euo pipefail
|
|
19
|
+
|
|
20
|
+
usage() {
|
|
21
|
+
cat >&2 <<EOF
|
|
22
|
+
Usage: list-worktrees.sh <repo-name> <feature-slug>
|
|
23
|
+
|
|
24
|
+
Arguments:
|
|
25
|
+
repo-name Name of the repository (e.g., my-repo)
|
|
26
|
+
feature-slug Feature branch slug (e.g., add-jwt-refresh)
|
|
27
|
+
|
|
28
|
+
Examples:
|
|
29
|
+
list-worktrees.sh my-repo add-jwt-refresh
|
|
30
|
+
list-worktrees.sh ystack worktree-flag
|
|
31
|
+
|
|
32
|
+
Output:
|
|
33
|
+
Markdown table of matching worktrees under <repo-root>/.opencode/worktrees/<repo>-<feature>/
|
|
34
|
+
followed by cleanup commands. Legacy roots are not migrated or deleted.
|
|
35
|
+
EOF
|
|
36
|
+
exit 1
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
40
|
+
# shellcheck source=worktree-paths.sh
|
|
41
|
+
source "${SCRIPT_DIR}/worktree-paths.sh"
|
|
42
|
+
|
|
43
|
+
# Collapse $HOME prefix back to ~ for human-readable display
|
|
44
|
+
_collapse_home() {
|
|
45
|
+
local path="$1"
|
|
46
|
+
echo "${path/#$HOME/\~}"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
main() {
|
|
50
|
+
# ── Input validation ──────────────────────────────────────────────────────
|
|
51
|
+
if [[ $# -lt 2 ]]; then
|
|
52
|
+
echo "ERROR: two positional arguments required." >&2
|
|
53
|
+
usage
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
local repo_name="$1"
|
|
57
|
+
local feature_slug="$2"
|
|
58
|
+
|
|
59
|
+
if [[ -z "$repo_name" ]]; then
|
|
60
|
+
echo "ERROR: repo-name must not be empty." >&2
|
|
61
|
+
usage
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
if [[ -z "$feature_slug" ]]; then
|
|
65
|
+
echo "ERROR: feature-slug must not be empty." >&2
|
|
66
|
+
usage
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# ── Build the prefix we are looking for ───────────────────────────────────
|
|
70
|
+
# Absolute path prefix (for matching against git output)
|
|
71
|
+
local repo_root
|
|
72
|
+
repo_root="$(ycc_repo_root)"
|
|
73
|
+
|
|
74
|
+
local abs_prefix
|
|
75
|
+
abs_prefix="$(ycc_feature_worktree_path "$repo_root" "$repo_name" "$feature_slug")"
|
|
76
|
+
|
|
77
|
+
# ── Parse `git worktree list --porcelain` ─────────────────────────────────
|
|
78
|
+
# Each stanza looks like:
|
|
79
|
+
# worktree /absolute/path
|
|
80
|
+
# HEAD <sha>
|
|
81
|
+
# branch refs/heads/<branch> ← may be "detached" instead
|
|
82
|
+
#
|
|
83
|
+
# We collect matching entries into parallel arrays.
|
|
84
|
+
local -a wt_paths=()
|
|
85
|
+
local -a wt_branches=()
|
|
86
|
+
|
|
87
|
+
local current_path=""
|
|
88
|
+
local current_branch=""
|
|
89
|
+
|
|
90
|
+
while IFS= read -r line; do
|
|
91
|
+
if [[ "$line" == worktree\ * ]]; then
|
|
92
|
+
# Start of a new stanza — save previous if it matched
|
|
93
|
+
if [[ -n "$current_path" && "$current_path" == "${abs_prefix}"* ]]; then
|
|
94
|
+
wt_paths+=("$current_path")
|
|
95
|
+
wt_branches+=("${current_branch:-detached}")
|
|
96
|
+
fi
|
|
97
|
+
current_path="${line#worktree }"
|
|
98
|
+
current_branch=""
|
|
99
|
+
elif [[ "$line" == branch\ * ]]; then
|
|
100
|
+
# refs/heads/<name> → strip the prefix
|
|
101
|
+
current_branch="${line#branch refs/heads/}"
|
|
102
|
+
fi
|
|
103
|
+
done < <(git worktree list --porcelain 2>/dev/null)
|
|
104
|
+
|
|
105
|
+
# Flush the last stanza
|
|
106
|
+
if [[ -n "$current_path" && "$current_path" == "${abs_prefix}"* ]]; then
|
|
107
|
+
wt_paths+=("$current_path")
|
|
108
|
+
wt_branches+=("${current_branch:-detached}")
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
# ── No results ────────────────────────────────────────────────────────────
|
|
112
|
+
if [[ ${#wt_paths[@]} -eq 0 ]]; then
|
|
113
|
+
echo "No active worktrees for ${repo_name}-${feature_slug}."
|
|
114
|
+
exit 0
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
# ── Determine display widths for the table ────────────────────────────────
|
|
118
|
+
local parent_abs="${abs_prefix}/"
|
|
119
|
+
# Minimum column widths matching header text
|
|
120
|
+
local max_path=4 # "Path"
|
|
121
|
+
local max_branch=6 # "Branch"
|
|
122
|
+
local max_status=6 # "Status"
|
|
123
|
+
|
|
124
|
+
local -a display_paths=()
|
|
125
|
+
local -a display_statuses=()
|
|
126
|
+
|
|
127
|
+
for i in "${!wt_paths[@]}"; do
|
|
128
|
+
local dp
|
|
129
|
+
dp="$(_collapse_home "${wt_paths[$i]}")"
|
|
130
|
+
display_paths+=("$dp")
|
|
131
|
+
|
|
132
|
+
local status
|
|
133
|
+
if [[ "${wt_paths[$i]}" == "$parent_abs" || "${wt_paths[$i]}" == "${abs_prefix}" ]]; then
|
|
134
|
+
status="parent"
|
|
135
|
+
else
|
|
136
|
+
status="child"
|
|
137
|
+
fi
|
|
138
|
+
display_statuses+=("$status")
|
|
139
|
+
|
|
140
|
+
local plen="${#dp}"
|
|
141
|
+
local blen="${#wt_branches[$i]}"
|
|
142
|
+
local slen="${#status}"
|
|
143
|
+
(( plen > max_path )) && max_path=$plen
|
|
144
|
+
(( blen > max_branch )) && max_branch=$blen
|
|
145
|
+
(( slen > max_status )) && max_status=$slen
|
|
146
|
+
done
|
|
147
|
+
|
|
148
|
+
# ── Emit the markdown table ───────────────────────────────────────────────
|
|
149
|
+
# Header row
|
|
150
|
+
printf "| %-${max_path}s | %-${max_branch}s | %-${max_status}s |\n" \
|
|
151
|
+
"Path" "Branch" "Status"
|
|
152
|
+
|
|
153
|
+
# Separator row
|
|
154
|
+
printf "| %s | %s | %s |\n" \
|
|
155
|
+
"$(printf '%0.s-' $(seq 1 "$max_path"))" \
|
|
156
|
+
"$(printf '%0.s-' $(seq 1 "$max_branch"))" \
|
|
157
|
+
"$(printf '%0.s-' $(seq 1 "$max_status"))"
|
|
158
|
+
|
|
159
|
+
# Data rows
|
|
160
|
+
for i in "${!wt_paths[@]}"; do
|
|
161
|
+
printf "| %-${max_path}s | %-${max_branch}s | %-${max_status}s |\n" \
|
|
162
|
+
"${display_paths[$i]}" \
|
|
163
|
+
"${wt_branches[$i]}" \
|
|
164
|
+
"${display_statuses[$i]}"
|
|
165
|
+
done
|
|
166
|
+
|
|
167
|
+
# ── Emit cleanup commands ────────────────────────────────────────────────
|
|
168
|
+
echo ""
|
|
169
|
+
echo "Cleanup commands:"
|
|
170
|
+
echo ""
|
|
171
|
+
echo '```bash'
|
|
172
|
+
for i in "${!wt_paths[@]}"; do
|
|
173
|
+
printf 'git worktree remove %q\n' "${wt_paths[$i]}"
|
|
174
|
+
done
|
|
175
|
+
echo '```'
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
main "$@"
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# merge-children.sh — DEPRECATED compatibility shim (issue #80, single worktree
|
|
3
|
+
# contract). Does NOT merge branches, remove worktrees, or delete branches.
|
|
4
|
+
#
|
|
5
|
+
# The historical behavior (fan-in merge from per-task child worktrees) was
|
|
6
|
+
# unsafe and is removed. Callers that still invoke this script get an explicit
|
|
7
|
+
# deprecation message on stderr, confirmation that the feature worktree exists
|
|
8
|
+
# (when it does), and exit 0 so orchestration does not break before skills are
|
|
9
|
+
# updated.
|
|
10
|
+
#
|
|
11
|
+
# Usage: merge-children.sh <repo-name> <feature-slug> <task-id>[,<task-id>,...]
|
|
12
|
+
# (task-ids are accepted for argument compatibility; they are not used)
|
|
13
|
+
#
|
|
14
|
+
# Exit codes:
|
|
15
|
+
# 0 always (shim: no fan-in, no errors from missing children)
|
|
16
|
+
|
|
17
|
+
set -euo pipefail
|
|
18
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
+
|
|
20
|
+
usage() {
|
|
21
|
+
cat >&2 <<'EOF'
|
|
22
|
+
Usage: merge-children.sh <repo-name> <feature-slug> <task-id>[,<task-id>,...]
|
|
23
|
+
|
|
24
|
+
DEPRECATED: This script is a no-op. ycc uses one feature worktree per run; there
|
|
25
|
+
is no per-task child merge. Remove calls to merge-children.sh in favor of working
|
|
26
|
+
entirely in the path printed by: setup-worktree.sh parent <repo> <feature-slug>
|
|
27
|
+
EOF
|
|
28
|
+
printf '\nSee: %s\n' "${SCRIPT_DIR}/../references/worktree-strategy.md" >&2
|
|
29
|
+
exit 1
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
feature_worktree_status() {
|
|
33
|
+
local parent_path="$1"
|
|
34
|
+
if [[ -d "${parent_path}" ]] && git -C "${parent_path}" rev-parse --git-dir >/dev/null 2>&1; then
|
|
35
|
+
echo "OK: feature worktree present at ${parent_path}" >&2
|
|
36
|
+
echo "STATUS:feature_worktree=present path=${parent_path}" >&2
|
|
37
|
+
return 0
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
echo "merge-children.sh: NOTICE: feature worktree not found or not a git checkout: ${parent_path}" >&2
|
|
41
|
+
echo "STATUS:feature_worktree=missing path=${parent_path}" >&2
|
|
42
|
+
return 1
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# shellcheck source=worktree-paths.sh
|
|
46
|
+
source "${SCRIPT_DIR}/worktree-paths.sh"
|
|
47
|
+
|
|
48
|
+
main() {
|
|
49
|
+
if [[ $# -ne 3 ]]; then
|
|
50
|
+
echo "ERROR: expected 3 arguments, got $#" >&2
|
|
51
|
+
usage
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
local repo_name="$1"
|
|
55
|
+
local feature_slug="$2"
|
|
56
|
+
local _raw_task_ids="$3"
|
|
57
|
+
|
|
58
|
+
if [[ -z "${repo_name}" || -z "${feature_slug}" || -z "${_raw_task_ids}" ]]; then
|
|
59
|
+
echo "ERROR: repo-name, feature-slug, and task-id list must be non-empty" >&2
|
|
60
|
+
usage
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
local repo_root
|
|
64
|
+
repo_root="$(ycc_repo_root)"
|
|
65
|
+
|
|
66
|
+
local parent_path
|
|
67
|
+
parent_path="$(ycc_feature_worktree_path "$repo_root" "$repo_name" "$feature_slug")"
|
|
68
|
+
|
|
69
|
+
echo "merge-children.sh: DEPRECATED: no-op (single worktree contract). Task IDs ignored: ${_raw_task_ids}" >&2
|
|
70
|
+
echo "merge-children.sh: Do not rely on child worktrees or fan-in merge. Use only: ${parent_path}" >&2
|
|
71
|
+
|
|
72
|
+
if ! feature_worktree_status "${parent_path}"; then
|
|
73
|
+
if [[ "${YCC_MERGE_CHILDREN_REQUIRE_FEATURE_WORKTREE:-0}" == "1" ]]; then
|
|
74
|
+
echo "merge-children.sh: strict mode enabled; failing because feature worktree is unavailable" >&2
|
|
75
|
+
exit 2
|
|
76
|
+
fi
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
exit 0
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
main "$@"
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# move-plan-to-worktree.sh — relocate plan artifacts from the main checkout into a
|
|
3
|
+
# pre-created feature worktree (single-worktree contract, GitHub #80).
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# move-plan-to-worktree.sh <plan-path> <wt-parent-path> [extra-path ...]
|
|
7
|
+
# move-plan-to-worktree.sh --help
|
|
8
|
+
#
|
|
9
|
+
# Arguments:
|
|
10
|
+
# plan-path Path to the primary plan file. May be absolute or relative
|
|
11
|
+
# to the current repo root. Its new path inside the worktree
|
|
12
|
+
# is echoed to stdout.
|
|
13
|
+
# wt-parent-path Absolute path to the feature worktree, as returned by
|
|
14
|
+
# setup-worktree.sh parent.
|
|
15
|
+
# extra-path ... Optional companion artifacts (e.g. shared.md, research
|
|
16
|
+
# notes) that should follow the plan into the worktree. Their
|
|
17
|
+
# new locations are reported on stderr only.
|
|
18
|
+
#
|
|
19
|
+
# Contract:
|
|
20
|
+
# Plan artifacts are pre-commit and live in main when the implementor starts.
|
|
21
|
+
# This helper MOVES them into the worktree exactly once. It NEVER copies and
|
|
22
|
+
# NEVER syncs. After this script runs, the main checkout is clean (no
|
|
23
|
+
# untracked plan files) and the worktree owns the canonical copy.
|
|
24
|
+
#
|
|
25
|
+
# Behavior:
|
|
26
|
+
# - If the source path does not exist, the helper treats it as an idempotent
|
|
27
|
+
# no-op and (for the primary plan) still echoes the expected destination
|
|
28
|
+
# path. This makes re-runs safe.
|
|
29
|
+
# - If the source already resolves to a path inside <wt-parent-path>, no move
|
|
30
|
+
# occurs and the existing in-worktree path is echoed.
|
|
31
|
+
# - Otherwise: mkdir -p the destination's parent inside the worktree, then mv
|
|
32
|
+
# the file in. Plain mv is used (cross-worktree git mv is not supported).
|
|
33
|
+
#
|
|
34
|
+
# Exit codes:
|
|
35
|
+
# 0 success
|
|
36
|
+
# 1 invalid arguments or move failure (message on stderr)
|
|
37
|
+
|
|
38
|
+
set -euo pipefail
|
|
39
|
+
|
|
40
|
+
# ---------------------------------------------------------------------------
|
|
41
|
+
# Usage
|
|
42
|
+
# ---------------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
usage() {
|
|
45
|
+
cat >&2 <<'EOF'
|
|
46
|
+
Usage:
|
|
47
|
+
move-plan-to-worktree.sh <plan-path> <wt-parent-path> [extra-path ...]
|
|
48
|
+
|
|
49
|
+
Arguments:
|
|
50
|
+
plan-path Primary plan file (absolute or relative to repo root).
|
|
51
|
+
Its destination inside the worktree is echoed to stdout.
|
|
52
|
+
wt-parent-path Feature worktree path, as returned by setup-worktree.sh.
|
|
53
|
+
extra-path ... Optional companion artifacts to relocate alongside the plan.
|
|
54
|
+
Their destinations are reported on stderr only.
|
|
55
|
+
|
|
56
|
+
Contract:
|
|
57
|
+
Plan artifacts MOVE into the worktree exactly once. Never copy, never sync.
|
|
58
|
+
EOF
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
_error() {
|
|
62
|
+
echo "move-plan-to-worktree.sh: error: $*" >&2
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
_debug() {
|
|
66
|
+
echo "move-plan-to-worktree.sh: $*" >&2
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
# ---------------------------------------------------------------------------
|
|
70
|
+
# Path helpers
|
|
71
|
+
# ---------------------------------------------------------------------------
|
|
72
|
+
|
|
73
|
+
# Resolve to an absolute path. Tolerates non-existent paths (for idempotency).
|
|
74
|
+
_abs_path() {
|
|
75
|
+
local p="$1"
|
|
76
|
+
if [[ "$p" = /* ]]; then
|
|
77
|
+
printf '%s\n' "$p"
|
|
78
|
+
return 0
|
|
79
|
+
fi
|
|
80
|
+
printf '%s/%s\n' "$(pwd -P)" "$p"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
# Locate the repo root for a path. Falls back to the current working directory
|
|
84
|
+
# if `git rev-parse` is unavailable for the given path.
|
|
85
|
+
_repo_root_for() {
|
|
86
|
+
local p="$1"
|
|
87
|
+
local search_dir
|
|
88
|
+
if [[ -d "$p" ]]; then
|
|
89
|
+
search_dir="$p"
|
|
90
|
+
else
|
|
91
|
+
search_dir="$(dirname -- "$p")"
|
|
92
|
+
fi
|
|
93
|
+
while [[ ! -d "$search_dir" && "$search_dir" != "/" ]]; do
|
|
94
|
+
search_dir="$(dirname -- "$search_dir")"
|
|
95
|
+
done
|
|
96
|
+
(cd -- "$search_dir" 2>/dev/null && git rev-parse --show-toplevel 2>/dev/null) \
|
|
97
|
+
|| pwd -P
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
# Strip a leading prefix from a path, if it matches. Echoes the remainder
|
|
101
|
+
# (without a leading '/') on success.
|
|
102
|
+
_strip_prefix() {
|
|
103
|
+
local prefix="${1%/}"
|
|
104
|
+
local path="$2"
|
|
105
|
+
if [[ "$path" == "$prefix" ]]; then
|
|
106
|
+
printf '\n'
|
|
107
|
+
return 0
|
|
108
|
+
fi
|
|
109
|
+
if [[ "$path" == "$prefix"/* ]]; then
|
|
110
|
+
printf '%s\n' "${path#"$prefix"/}"
|
|
111
|
+
return 0
|
|
112
|
+
fi
|
|
113
|
+
return 1
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
# Move one artifact. Echoes the destination on stdout when echo_dest=1.
|
|
117
|
+
# Returns 0 on success or skip; non-zero only on a real failure.
|
|
118
|
+
_move_one() {
|
|
119
|
+
local src_input="$1"
|
|
120
|
+
local wt_parent="$2"
|
|
121
|
+
local echo_dest="$3"
|
|
122
|
+
|
|
123
|
+
local src_abs
|
|
124
|
+
src_abs="$(_abs_path "$src_input")"
|
|
125
|
+
|
|
126
|
+
# If the input is already inside the worktree, no work to do.
|
|
127
|
+
if rel="$(_strip_prefix "$wt_parent" "$src_abs")"; then
|
|
128
|
+
_debug "source already inside worktree: $src_abs"
|
|
129
|
+
if [[ "$echo_dest" = "1" ]]; then
|
|
130
|
+
printf '%s\n' "$src_abs"
|
|
131
|
+
fi
|
|
132
|
+
return 0
|
|
133
|
+
fi
|
|
134
|
+
|
|
135
|
+
local repo_root
|
|
136
|
+
repo_root="$(_repo_root_for "$src_abs")"
|
|
137
|
+
|
|
138
|
+
local rel
|
|
139
|
+
if ! rel="$(_strip_prefix "$repo_root" "$src_abs")"; then
|
|
140
|
+
_error "source path '$src_input' is not under repo root '$repo_root'"
|
|
141
|
+
return 1
|
|
142
|
+
fi
|
|
143
|
+
if [[ -z "$rel" ]]; then
|
|
144
|
+
_error "source path resolves to repo root itself: '$src_input'"
|
|
145
|
+
return 1
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
local dst="${wt_parent%/}/$rel"
|
|
149
|
+
|
|
150
|
+
# Idempotent: destination already populated.
|
|
151
|
+
if [[ -e "$dst" ]]; then
|
|
152
|
+
_debug "destination already exists, skipping move: $dst"
|
|
153
|
+
if [[ ! -e "$src_abs" ]]; then
|
|
154
|
+
:
|
|
155
|
+
elif [[ "$src_abs" -ef "$dst" ]]; then
|
|
156
|
+
:
|
|
157
|
+
else
|
|
158
|
+
_debug " note: source still present at '$src_abs' (manual cleanup may be needed)"
|
|
159
|
+
fi
|
|
160
|
+
if [[ "$echo_dest" = "1" ]]; then
|
|
161
|
+
printf '%s\n' "$dst"
|
|
162
|
+
fi
|
|
163
|
+
return 0
|
|
164
|
+
fi
|
|
165
|
+
|
|
166
|
+
# Idempotent: source missing → previously moved or never existed.
|
|
167
|
+
if [[ ! -e "$src_abs" ]]; then
|
|
168
|
+
_debug "source not found, treating as already moved: $src_abs"
|
|
169
|
+
if [[ "$echo_dest" = "1" ]]; then
|
|
170
|
+
printf '%s\n' "$dst"
|
|
171
|
+
fi
|
|
172
|
+
return 0
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
mkdir -p -- "$(dirname -- "$dst")"
|
|
176
|
+
|
|
177
|
+
if ! mv -- "$src_abs" "$dst"; then
|
|
178
|
+
_error "failed to move '$src_abs' → '$dst'"
|
|
179
|
+
return 1
|
|
180
|
+
fi
|
|
181
|
+
|
|
182
|
+
_debug "moved: $rel → $dst"
|
|
183
|
+
if [[ "$echo_dest" = "1" ]]; then
|
|
184
|
+
printf '%s\n' "$dst"
|
|
185
|
+
fi
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
# ---------------------------------------------------------------------------
|
|
189
|
+
# Entry point
|
|
190
|
+
# ---------------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
main() {
|
|
193
|
+
if [[ $# -ge 1 && ( "$1" = "--help" || "$1" = "-h" ) ]]; then
|
|
194
|
+
usage
|
|
195
|
+
exit 0
|
|
196
|
+
fi
|
|
197
|
+
|
|
198
|
+
if [[ $# -lt 2 ]]; then
|
|
199
|
+
_error "expected at least 2 arguments: <plan-path> <wt-parent-path> [extra-path ...]"
|
|
200
|
+
usage
|
|
201
|
+
exit 1
|
|
202
|
+
fi
|
|
203
|
+
|
|
204
|
+
local plan_path="$1"
|
|
205
|
+
local wt_parent="$2"
|
|
206
|
+
shift 2
|
|
207
|
+
|
|
208
|
+
if [[ -z "$plan_path" || -z "$wt_parent" ]]; then
|
|
209
|
+
_error "plan-path and wt-parent-path must not be empty"
|
|
210
|
+
exit 1
|
|
211
|
+
fi
|
|
212
|
+
|
|
213
|
+
if [[ ! -d "$wt_parent" ]]; then
|
|
214
|
+
_error "wt-parent-path '$wt_parent' does not exist or is not a directory"
|
|
215
|
+
exit 1
|
|
216
|
+
fi
|
|
217
|
+
|
|
218
|
+
# Normalise the worktree path to its absolute form so prefix checks work.
|
|
219
|
+
local wt_parent_abs
|
|
220
|
+
wt_parent_abs="$(cd -- "$wt_parent" && pwd -P)"
|
|
221
|
+
|
|
222
|
+
_move_one "$plan_path" "$wt_parent_abs" 1
|
|
223
|
+
|
|
224
|
+
local extra
|
|
225
|
+
for extra in "$@"; do
|
|
226
|
+
[[ -z "$extra" ]] && continue
|
|
227
|
+
_move_one "$extra" "$wt_parent_abs" 0
|
|
228
|
+
done
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
main "$@"
|