@yandy-r/ycc-opencode 0.0.0-bootstrap.0 → 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 +42 -0
- 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 +33 -7
- 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,343 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# report-bundle-drift.sh — wrap generate_*.py --check entry points and emit a
|
|
3
|
+
# per-target drift report.
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# report-bundle-drift.sh [--target=all|cursor|codex|opencode|inventory]
|
|
7
|
+
# [--format=human|json]
|
|
8
|
+
# [--json-out=PATH]
|
|
9
|
+
# [--repo-root=PATH]
|
|
10
|
+
# [PATH]
|
|
11
|
+
# [--help]
|
|
12
|
+
#
|
|
13
|
+
# Requires a ycc/ystack SOURCE CHECKOUT: a directory containing
|
|
14
|
+
# ycc/skills and scripts/generate_*.py. Installed native and file-copy
|
|
15
|
+
# bundles do not contain those generator sources, so discovery never accepts
|
|
16
|
+
# them (no marketplace or plugin manifest is required or consulted).
|
|
17
|
+
#
|
|
18
|
+
# Root resolution order:
|
|
19
|
+
# 1. explicit --repo-root=PATH or positional PATH (searched with its
|
|
20
|
+
# ancestors; if nothing qualifies, fail — never fall through to PWD or
|
|
21
|
+
# the script location)
|
|
22
|
+
# 2. PWD and its ancestors
|
|
23
|
+
# 3. the script's own directory and its ancestors
|
|
24
|
+
#
|
|
25
|
+
# Exit codes:
|
|
26
|
+
# 0 every sub-check passed (no drift)
|
|
27
|
+
# 1 at least one sub-check reported drift
|
|
28
|
+
# 2 usage error (bad flag, unknown target, repo root not found, missing
|
|
29
|
+
# generator entrypoint)
|
|
30
|
+
|
|
31
|
+
set -euo pipefail
|
|
32
|
+
|
|
33
|
+
# ---------------------------------------------------------------------------
|
|
34
|
+
# Usage
|
|
35
|
+
# ---------------------------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
usage() {
|
|
38
|
+
cat <<'EOF'
|
|
39
|
+
Usage: report-bundle-drift.sh [--target=all|cursor|codex|opencode|inventory] [--format=human|json] [--json-out=PATH] [--repo-root=PATH|PATH] [--help]
|
|
40
|
+
|
|
41
|
+
Wraps the generate_*.py --check entry points and emits a per-target drift
|
|
42
|
+
report. Exit 0 iff every target is clean. Exit 1 on drift. Exit 2 on
|
|
43
|
+
usage error.
|
|
44
|
+
|
|
45
|
+
Requires a ycc/ystack source checkout with ycc/skills and
|
|
46
|
+
scripts/generate_*.py. Installed native/file-copy bundles omit these sources.
|
|
47
|
+
Pass --repo-root=PATH (or positional PATH) to search it and its ancestors;
|
|
48
|
+
explicit input is authoritative. Otherwise searches PWD, then script ancestors.
|
|
49
|
+
EOF
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# ---------------------------------------------------------------------------
|
|
53
|
+
# Argument parsing (long-form)
|
|
54
|
+
# ---------------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
TARGET="all"
|
|
57
|
+
FORMAT="human"
|
|
58
|
+
JSON_OUT=""
|
|
59
|
+
REPO_ROOT_INPUT=""
|
|
60
|
+
|
|
61
|
+
for arg in "$@"; do
|
|
62
|
+
case "$arg" in
|
|
63
|
+
--target=*) TARGET="${arg#--target=}" ;;
|
|
64
|
+
--format=*) FORMAT="${arg#--format=}" ;;
|
|
65
|
+
--json-out=*) JSON_OUT="${arg#--json-out=}" ;;
|
|
66
|
+
--repo-root=*) REPO_ROOT_INPUT="${arg#--repo-root=}" ;;
|
|
67
|
+
--help|-h) usage; exit 0 ;;
|
|
68
|
+
-*)
|
|
69
|
+
echo "report-bundle-drift.sh: unknown flag: $arg" >&2
|
|
70
|
+
usage >&2
|
|
71
|
+
exit 2
|
|
72
|
+
;;
|
|
73
|
+
*)
|
|
74
|
+
if [[ -n "$REPO_ROOT_INPUT" ]]; then
|
|
75
|
+
echo "report-bundle-drift.sh: multiple repo roots provided: $REPO_ROOT_INPUT and $arg" >&2
|
|
76
|
+
usage >&2
|
|
77
|
+
exit 2
|
|
78
|
+
fi
|
|
79
|
+
REPO_ROOT_INPUT="$arg"
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
done
|
|
83
|
+
|
|
84
|
+
case "$TARGET" in
|
|
85
|
+
all|cursor|codex|opencode|inventory) ;;
|
|
86
|
+
*) echo "report-bundle-drift.sh: unknown --target value: $TARGET" >&2; usage >&2; exit 2 ;;
|
|
87
|
+
esac
|
|
88
|
+
|
|
89
|
+
case "$FORMAT" in
|
|
90
|
+
human|json) ;;
|
|
91
|
+
*) echo "report-bundle-drift.sh: unknown --format value: $FORMAT" >&2; usage >&2; exit 2 ;;
|
|
92
|
+
esac
|
|
93
|
+
|
|
94
|
+
# ---------------------------------------------------------------------------
|
|
95
|
+
# Resolve the ycc source-checkout root: explicit input (authoritative), then
|
|
96
|
+
# PWD ancestors, then script-dir ancestors. A qualifying root has the ycc
|
|
97
|
+
# skill sources and the repo generator entrypoints — never a marketplace
|
|
98
|
+
# manifest, which installed bundles fake but cannot back with generators.
|
|
99
|
+
# ---------------------------------------------------------------------------
|
|
100
|
+
|
|
101
|
+
echo "report-bundle-drift.sh: resolving repo root..." >&2
|
|
102
|
+
|
|
103
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
104
|
+
REPO_ROOT=""
|
|
105
|
+
|
|
106
|
+
is_source_root() {
|
|
107
|
+
local dir="$1"
|
|
108
|
+
[[ -d "${dir}/ycc/skills" && -f "${dir}/scripts/generate_inventory.py" ]]
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
resolve_repo_root_from() {
|
|
112
|
+
local candidate="$1"
|
|
113
|
+
while [[ "$candidate" != "/" ]]; do
|
|
114
|
+
if is_source_root "$candidate"; then
|
|
115
|
+
REPO_ROOT="$candidate"
|
|
116
|
+
return 0
|
|
117
|
+
fi
|
|
118
|
+
candidate="$(dirname "$candidate")"
|
|
119
|
+
done
|
|
120
|
+
is_source_root "/" && REPO_ROOT="/"
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
die_no_source_root() {
|
|
124
|
+
echo "report-bundle-drift.sh: no ycc/ystack source checkout found${1:+ (searched from $1)}." >&2
|
|
125
|
+
echo "This helper needs a source checkout containing ycc/skills and scripts/generate_*.py;" >&2
|
|
126
|
+
echo "installed native and file-copy bundles do not contain them. Run it from the source" >&2
|
|
127
|
+
echo "checkout or pass --repo-root=/path/to/checkout." >&2
|
|
128
|
+
exit 2
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if [[ -n "$REPO_ROOT_INPUT" ]]; then
|
|
132
|
+
if [[ ! -d "$REPO_ROOT_INPUT" ]]; then
|
|
133
|
+
echo "report-bundle-drift.sh: --repo-root/positional path is not a directory: $REPO_ROOT_INPUT" >&2
|
|
134
|
+
exit 2
|
|
135
|
+
fi
|
|
136
|
+
# Explicit input is authoritative: no fallthrough to PWD or SCRIPT_DIR.
|
|
137
|
+
resolve_repo_root_from "$(cd "$REPO_ROOT_INPUT" && pwd)" || die_no_source_root "$REPO_ROOT_INPUT"
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
if [[ -z "$REPO_ROOT" ]]; then
|
|
141
|
+
resolve_repo_root_from "$PWD" || true
|
|
142
|
+
fi
|
|
143
|
+
|
|
144
|
+
if [[ -z "$REPO_ROOT" ]]; then
|
|
145
|
+
resolve_repo_root_from "$SCRIPT_DIR" || true
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
if [[ -z "$REPO_ROOT" ]]; then
|
|
149
|
+
die_no_source_root "$PWD"
|
|
150
|
+
fi
|
|
151
|
+
|
|
152
|
+
echo "report-bundle-drift.sh: repo root is $REPO_ROOT" >&2
|
|
153
|
+
SCRIPTS_DIR="${REPO_ROOT}/scripts"
|
|
154
|
+
|
|
155
|
+
# ---------------------------------------------------------------------------
|
|
156
|
+
# Verify the selected target's generator entrypoints exist before running:
|
|
157
|
+
# a missing generator is a broken checkout (exit 2), not drift (exit 1).
|
|
158
|
+
# ---------------------------------------------------------------------------
|
|
159
|
+
|
|
160
|
+
require_generators() {
|
|
161
|
+
local g
|
|
162
|
+
for g in "$@"; do
|
|
163
|
+
if [[ ! -f "${SCRIPTS_DIR}/${g}" ]]; then
|
|
164
|
+
echo "report-bundle-drift.sh: generator entrypoint missing: ${SCRIPTS_DIR}/${g}" >&2
|
|
165
|
+
echo "The selected root is not a usable source checkout. Run from a complete checkout or" >&2
|
|
166
|
+
echo "pass --repo-root=/path/to/checkout." >&2
|
|
167
|
+
exit 2
|
|
168
|
+
fi
|
|
169
|
+
done
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
case "$TARGET" in
|
|
173
|
+
inventory) require_generators generate_inventory.py ;;
|
|
174
|
+
cursor) require_generators generate_cursor_skills.py generate_cursor_agents.py generate_cursor_rules.py ;;
|
|
175
|
+
codex) require_generators generate_codex_skills.py generate_codex_agents.py generate_codex_plugin.py ;;
|
|
176
|
+
opencode) require_generators generate_opencode_skills.py generate_opencode_agents.py generate_opencode_commands.py generate_opencode_plugin.py ;;
|
|
177
|
+
all) require_generators generate_inventory.py generate_cursor_skills.py generate_cursor_agents.py generate_cursor_rules.py generate_codex_skills.py generate_codex_agents.py generate_codex_plugin.py generate_opencode_skills.py generate_opencode_agents.py generate_opencode_commands.py generate_opencode_plugin.py ;;
|
|
178
|
+
esac
|
|
179
|
+
# ---------------------------------------------------------------------------
|
|
180
|
+
# Sub-check runner — appends to three parallel arrays
|
|
181
|
+
# ---------------------------------------------------------------------------
|
|
182
|
+
|
|
183
|
+
NAMES=(); EXITS=(); COMBINED=() # combined = stdout + stderr merged
|
|
184
|
+
|
|
185
|
+
run_check() {
|
|
186
|
+
local name="$1"; shift
|
|
187
|
+
echo "report-bundle-drift.sh: running ${name}..." >&2
|
|
188
|
+
|
|
189
|
+
local out rc
|
|
190
|
+
set +e
|
|
191
|
+
out="$(cd "$REPO_ROOT" && "$@" 2>&1)"
|
|
192
|
+
rc=$?
|
|
193
|
+
set -e
|
|
194
|
+
|
|
195
|
+
NAMES+=("$name")
|
|
196
|
+
EXITS+=("$rc")
|
|
197
|
+
COMBINED+=("$out")
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
# ---------------------------------------------------------------------------
|
|
201
|
+
# Target dispatch
|
|
202
|
+
# ---------------------------------------------------------------------------
|
|
203
|
+
|
|
204
|
+
[[ "$TARGET" == "inventory" || "$TARGET" == "all" ]] && \
|
|
205
|
+
run_check "inventory" python3 "${SCRIPTS_DIR}/generate_inventory.py" --check
|
|
206
|
+
|
|
207
|
+
if [[ "$TARGET" == "cursor" || "$TARGET" == "all" ]]; then
|
|
208
|
+
run_check "cursor:skills" python3 "${SCRIPTS_DIR}/generate_cursor_skills.py" --check
|
|
209
|
+
run_check "cursor:agents" python3 "${SCRIPTS_DIR}/generate_cursor_agents.py" --check
|
|
210
|
+
run_check "cursor:rules" python3 "${SCRIPTS_DIR}/generate_cursor_rules.py" --check
|
|
211
|
+
fi
|
|
212
|
+
|
|
213
|
+
if [[ "$TARGET" == "codex" || "$TARGET" == "all" ]]; then
|
|
214
|
+
run_check "codex:skills" python3 "${SCRIPTS_DIR}/generate_codex_skills.py" --check
|
|
215
|
+
run_check "codex:agents" python3 "${SCRIPTS_DIR}/generate_codex_agents.py" --check
|
|
216
|
+
run_check "codex:plugin" python3 "${SCRIPTS_DIR}/generate_codex_plugin.py" --check
|
|
217
|
+
fi
|
|
218
|
+
|
|
219
|
+
if [[ "$TARGET" == "opencode" || "$TARGET" == "all" ]]; then
|
|
220
|
+
run_check "opencode:skills" python3 "${SCRIPTS_DIR}/generate_opencode_skills.py" --check
|
|
221
|
+
run_check "opencode:agents" python3 "${SCRIPTS_DIR}/generate_opencode_agents.py" --check
|
|
222
|
+
run_check "opencode:commands" python3 "${SCRIPTS_DIR}/generate_opencode_commands.py" --check
|
|
223
|
+
run_check "opencode:plugin" python3 "${SCRIPTS_DIR}/generate_opencode_plugin.py" --check
|
|
224
|
+
fi
|
|
225
|
+
|
|
226
|
+
# ---------------------------------------------------------------------------
|
|
227
|
+
# Overall exit code
|
|
228
|
+
# ---------------------------------------------------------------------------
|
|
229
|
+
|
|
230
|
+
OVERALL_RC=0
|
|
231
|
+
for rc in "${EXITS[@]}"; do
|
|
232
|
+
[[ "$rc" -ne 0 ]] && { OVERALL_RC=1; break; }
|
|
233
|
+
done
|
|
234
|
+
|
|
235
|
+
# ---------------------------------------------------------------------------
|
|
236
|
+
# Human output
|
|
237
|
+
# ---------------------------------------------------------------------------
|
|
238
|
+
|
|
239
|
+
print_human_section() {
|
|
240
|
+
local label="$1" prefix="$2"
|
|
241
|
+
echo ""
|
|
242
|
+
echo "## ${label}"
|
|
243
|
+
local i=0
|
|
244
|
+
while [[ $i -lt ${#NAMES[@]} ]]; do
|
|
245
|
+
local name="${NAMES[$i]}"
|
|
246
|
+
if [[ "$name" == "$prefix" || "$name" == "${prefix}:"* ]]; then
|
|
247
|
+
if [[ "${EXITS[$i]}" -eq 0 ]]; then
|
|
248
|
+
echo "- ${name}: PASS"
|
|
249
|
+
else
|
|
250
|
+
echo "- ${name}: FAIL"
|
|
251
|
+
if [[ -n "${COMBINED[$i]}" ]]; then
|
|
252
|
+
while IFS= read -r line; do printf ' %s\n' "$line"; done < <(printf '%s\n' "${COMBINED[$i]}" | head -3)
|
|
253
|
+
echo " ---"
|
|
254
|
+
while IFS= read -r line; do printf ' %s\n' "$line"; done <<< "${COMBINED[$i]}"
|
|
255
|
+
fi
|
|
256
|
+
fi
|
|
257
|
+
fi
|
|
258
|
+
i=$((i + 1))
|
|
259
|
+
done
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
# ---------------------------------------------------------------------------
|
|
263
|
+
# JSON output — delegate serialization entirely to Python
|
|
264
|
+
# ---------------------------------------------------------------------------
|
|
265
|
+
|
|
266
|
+
build_json() {
|
|
267
|
+
# Pass data via stdin as a newline-delimited payload; Python reads it safely.
|
|
268
|
+
local tmpdir
|
|
269
|
+
tmpdir="$(mktemp -d)"
|
|
270
|
+
local i=0
|
|
271
|
+
while [[ $i -lt ${#NAMES[@]} ]]; do
|
|
272
|
+
printf '%s' "${NAMES[$i]}" > "${tmpdir}/name_${i}"
|
|
273
|
+
printf '%s' "${EXITS[$i]}" > "${tmpdir}/exit_${i}"
|
|
274
|
+
printf '%s' "${COMBINED[$i]}" > "${tmpdir}/out_${i}"
|
|
275
|
+
i=$((i + 1))
|
|
276
|
+
done
|
|
277
|
+
|
|
278
|
+
python3 - "${#NAMES[@]}" "$tmpdir" "$TARGET" <<'PYEOF'
|
|
279
|
+
import json, sys
|
|
280
|
+
from datetime import datetime, timezone
|
|
281
|
+
|
|
282
|
+
n, tmpdir, target = int(sys.argv[1]), sys.argv[2], sys.argv[3]
|
|
283
|
+
|
|
284
|
+
def rd(p):
|
|
285
|
+
try:
|
|
286
|
+
return open(p).read()
|
|
287
|
+
except FileNotFoundError:
|
|
288
|
+
return ""
|
|
289
|
+
|
|
290
|
+
names = [rd(f"{tmpdir}/name_{i}") for i in range(n)]
|
|
291
|
+
exits = [int(rd(f"{tmpdir}/exit_{i}") or "0") for i in range(n)]
|
|
292
|
+
outs = [rd(f"{tmpdir}/out_{i}") for i in range(n)]
|
|
293
|
+
|
|
294
|
+
def tgt(prefix):
|
|
295
|
+
details = [{"name": names[i], "exit": exits[i], "stdout": outs[i], "stderr": ""}
|
|
296
|
+
for i in range(n)
|
|
297
|
+
if names[i] == prefix or names[i].startswith(prefix + ":")]
|
|
298
|
+
return {"drift": any(d["exit"] != 0 for d in details), "details": details}
|
|
299
|
+
|
|
300
|
+
shown = (["inventory", "cursor", "codex", "opencode"] if target == "all" else [target])
|
|
301
|
+
targets_out = {t: tgt(t) for t in shown}
|
|
302
|
+
print(json.dumps({
|
|
303
|
+
"as_of": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
|
304
|
+
"targets": targets_out,
|
|
305
|
+
"ok": all(not v["drift"] for v in targets_out.values()),
|
|
306
|
+
}, indent=2))
|
|
307
|
+
PYEOF
|
|
308
|
+
rm -rf "$tmpdir"
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
# ---------------------------------------------------------------------------
|
|
312
|
+
# Emit report
|
|
313
|
+
# ---------------------------------------------------------------------------
|
|
314
|
+
|
|
315
|
+
if [[ "$FORMAT" == "human" ]]; then
|
|
316
|
+
case "$TARGET" in
|
|
317
|
+
inventory) print_human_section "inventory" "inventory" ;;
|
|
318
|
+
cursor) print_human_section "cursor" "cursor" ;;
|
|
319
|
+
codex) print_human_section "codex" "codex" ;;
|
|
320
|
+
opencode) print_human_section "opencode" "opencode" ;;
|
|
321
|
+
all)
|
|
322
|
+
print_human_section "inventory" "inventory"
|
|
323
|
+
print_human_section "cursor" "cursor"
|
|
324
|
+
print_human_section "codex" "codex"
|
|
325
|
+
print_human_section "opencode" "opencode"
|
|
326
|
+
;;
|
|
327
|
+
esac
|
|
328
|
+
echo ""
|
|
329
|
+
if [[ $OVERALL_RC -eq 0 ]]; then
|
|
330
|
+
echo "All checks passed. No drift detected."
|
|
331
|
+
else
|
|
332
|
+
echo "Drift detected. See FAIL entries above."
|
|
333
|
+
fi
|
|
334
|
+
else
|
|
335
|
+
json_output="$(build_json)"
|
|
336
|
+
echo "$json_output"
|
|
337
|
+
if [[ -n "$JSON_OUT" ]]; then
|
|
338
|
+
printf '%s\n' "$json_output" > "$JSON_OUT"
|
|
339
|
+
echo "report-bundle-drift.sh: JSON report written to $JSON_OUT" >&2
|
|
340
|
+
fi
|
|
341
|
+
fi
|
|
342
|
+
|
|
343
|
+
exit $OVERALL_RC
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# require-python.sh — sourced guard: fail loudly when python3 is below the ycc
|
|
3
|
+
# minimum (3.11: tomllib + datetime.UTC). Source it before any python3 usage so
|
|
4
|
+
# unsupported interpreters abort with a readable message and no partial output.
|
|
5
|
+
# Prints nothing on success. Safe under `set -euo pipefail`, bash 3.2+.
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
_require_python_found="$(python3 -V 2>/dev/null || true)"
|
|
8
|
+
if [[ -z "$_require_python_found" ]]; then
|
|
9
|
+
echo "require-python: python3 not found on PATH (ycc needs python3 3.11+)" >&2
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
if ! python3 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else 1)' >/dev/null 2>&1; then
|
|
13
|
+
echo "require-python: python3 3.11+ required, found: ${_require_python_found}" >&2
|
|
14
|
+
echo "require-python: install a newer python3 (or point 'python3' at one) and retry" >&2
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
unset _require_python_found
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Resolve the plans directory for the current project
|
|
3
|
+
# Usage: source resolve-plans-dir.sh && echo "$PLANS_DIR"
|
|
4
|
+
#
|
|
5
|
+
# This script resolves where plan documents should be stored by:
|
|
6
|
+
# 1. Looking for a .plans-config file walking up the directory tree
|
|
7
|
+
# 2. Falling back to git root detection
|
|
8
|
+
# 3. Defaulting to current directory if neither found
|
|
9
|
+
#
|
|
10
|
+
# Configuration file format (.plans-config):
|
|
11
|
+
# plans_dir: docs/plans # Relative path from config file location
|
|
12
|
+
# scope: local # Optional: 'local' means use this directory as base
|
|
13
|
+
# # Without scope, continues searching up for root config
|
|
14
|
+
#
|
|
15
|
+
# Exports:
|
|
16
|
+
# PLANS_DIR - Absolute path to the plans directory (e.g., /path/to/repo/docs/plans)
|
|
17
|
+
# PLANS_ROOT - Absolute path to the project root (where .plans-config or .git is)
|
|
18
|
+
|
|
19
|
+
set -uo pipefail
|
|
20
|
+
|
|
21
|
+
# Colors for output (only if stderr is a terminal)
|
|
22
|
+
if [[ -t 2 ]]; then
|
|
23
|
+
RED='\033[0;31m'
|
|
24
|
+
YELLOW='\033[0;33m'
|
|
25
|
+
GREEN='\033[0;32m'
|
|
26
|
+
BLUE='\033[0;34m'
|
|
27
|
+
NC='\033[0m'
|
|
28
|
+
else
|
|
29
|
+
RED=''
|
|
30
|
+
YELLOW=''
|
|
31
|
+
GREEN=''
|
|
32
|
+
BLUE=''
|
|
33
|
+
NC=''
|
|
34
|
+
fi
|
|
35
|
+
# Sourcing scripts (validate-*.sh, check-*.sh) rely on these for their own output.
|
|
36
|
+
export RED YELLOW GREEN BLUE NC
|
|
37
|
+
|
|
38
|
+
_debug() {
|
|
39
|
+
if [[ "${PLANS_DEBUG:-}" == "1" ]]; then
|
|
40
|
+
echo -e "${BLUE}[resolve-plans-dir]${NC} $1" >&2
|
|
41
|
+
fi
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_warn() {
|
|
45
|
+
echo -e "${YELLOW}WARNING${NC}: $1" >&2
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_error() {
|
|
49
|
+
echo -e "${RED}ERROR${NC}: $1" >&2
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# Parse a simple YAML-like config file
|
|
53
|
+
# Usage: _parse_config "key" "/path/to/.plans-config"
|
|
54
|
+
_parse_config() {
|
|
55
|
+
local key="$1"
|
|
56
|
+
local config_file="$2"
|
|
57
|
+
|
|
58
|
+
if [[ ! -f "$config_file" ]]; then
|
|
59
|
+
return 1
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
# Simple parsing: look for "key: value" or "key=value"
|
|
63
|
+
local value
|
|
64
|
+
value=$(grep -E "^${key}[[:space:]]*[:=][[:space:]]*" "$config_file" 2>/dev/null | head -1 | sed -E 's/^[^:=]+[:=][[:space:]]*//' | sed 's/#.*//' | xargs)
|
|
65
|
+
|
|
66
|
+
if [[ -n "$value" ]]; then
|
|
67
|
+
echo "$value"
|
|
68
|
+
return 0
|
|
69
|
+
fi
|
|
70
|
+
return 1
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# Find .plans-config walking up the directory tree
|
|
74
|
+
# Returns the absolute path to the config file, or empty string if not found
|
|
75
|
+
_find_plans_config() {
|
|
76
|
+
local dir="$1"
|
|
77
|
+
local max_depth="${2:-50}" # Safety limit
|
|
78
|
+
local depth=0
|
|
79
|
+
|
|
80
|
+
while [[ "$dir" != "/" && $depth -lt $max_depth ]]; do
|
|
81
|
+
if [[ -f "${dir}/.plans-config" ]]; then
|
|
82
|
+
echo "${dir}/.plans-config"
|
|
83
|
+
return 0
|
|
84
|
+
fi
|
|
85
|
+
dir=$(dirname "$dir")
|
|
86
|
+
((depth++))
|
|
87
|
+
done
|
|
88
|
+
|
|
89
|
+
return 1
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# Find git root walking up the directory tree
|
|
93
|
+
_find_git_root() {
|
|
94
|
+
local dir="$1"
|
|
95
|
+
local max_depth="${2:-50}"
|
|
96
|
+
local depth=0
|
|
97
|
+
|
|
98
|
+
while [[ "$dir" != "/" && $depth -lt $max_depth ]]; do
|
|
99
|
+
if [[ -d "${dir}/.git" ]] || [[ -f "${dir}/.git" ]]; then
|
|
100
|
+
echo "$dir"
|
|
101
|
+
return 0
|
|
102
|
+
fi
|
|
103
|
+
dir=$(dirname "$dir")
|
|
104
|
+
((depth++))
|
|
105
|
+
done
|
|
106
|
+
|
|
107
|
+
return 1
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# Main resolution logic
|
|
111
|
+
resolve_plans_dir() {
|
|
112
|
+
local start_dir="${1:-$(pwd)}"
|
|
113
|
+
start_dir=$(cd "$start_dir" 2>/dev/null && pwd) # Get absolute path
|
|
114
|
+
|
|
115
|
+
_debug "Starting resolution from: $start_dir"
|
|
116
|
+
|
|
117
|
+
local plans_dir=""
|
|
118
|
+
local plans_root=""
|
|
119
|
+
local config_file=""
|
|
120
|
+
|
|
121
|
+
# Step 1: Look for .plans-config
|
|
122
|
+
config_file=$(_find_plans_config "$start_dir") || config_file=""
|
|
123
|
+
|
|
124
|
+
if [[ -n "$config_file" ]]; then
|
|
125
|
+
_debug "Found config: $config_file"
|
|
126
|
+
local config_dir
|
|
127
|
+
config_dir=$(dirname "$config_file")
|
|
128
|
+
|
|
129
|
+
# Read configuration
|
|
130
|
+
local configured_path
|
|
131
|
+
configured_path=$(_parse_config "plans_dir" "$config_file") || configured_path=""
|
|
132
|
+
|
|
133
|
+
local scope
|
|
134
|
+
scope=$(_parse_config "scope" "$config_file") || scope=""
|
|
135
|
+
|
|
136
|
+
if [[ -z "$configured_path" ]]; then
|
|
137
|
+
configured_path="docs/plans" # Default
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
_debug "Configured path: $configured_path"
|
|
141
|
+
_debug "Scope: ${scope:-global}"
|
|
142
|
+
|
|
143
|
+
if [[ "$scope" == "local" ]]; then
|
|
144
|
+
# Use this config file's directory as the base
|
|
145
|
+
plans_root="$config_dir"
|
|
146
|
+
plans_dir="${config_dir}/${configured_path}"
|
|
147
|
+
_debug "Using local scope: $plans_dir"
|
|
148
|
+
else
|
|
149
|
+
# Continue to root (find topmost .plans-config or git root)
|
|
150
|
+
local root_config
|
|
151
|
+
root_config=$(_find_plans_config "$(dirname "$config_dir")") || root_config=""
|
|
152
|
+
|
|
153
|
+
if [[ -n "$root_config" ]]; then
|
|
154
|
+
# Found a higher-level config, use it
|
|
155
|
+
_debug "Found higher-level config: $root_config"
|
|
156
|
+
local root_dir
|
|
157
|
+
root_dir=$(dirname "$root_config")
|
|
158
|
+
local root_path
|
|
159
|
+
root_path=$(_parse_config "plans_dir" "$root_config") || root_path=""
|
|
160
|
+
|
|
161
|
+
if [[ -z "$root_path" ]]; then
|
|
162
|
+
root_path="docs/plans"
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
plans_root="$root_dir"
|
|
166
|
+
plans_dir="${root_dir}/${root_path}"
|
|
167
|
+
else
|
|
168
|
+
# This is the topmost config
|
|
169
|
+
plans_root="$config_dir"
|
|
170
|
+
plans_dir="${config_dir}/${configured_path}"
|
|
171
|
+
fi
|
|
172
|
+
fi
|
|
173
|
+
else
|
|
174
|
+
_debug "No .plans-config found, trying git root"
|
|
175
|
+
|
|
176
|
+
# Step 2: Fall back to git root
|
|
177
|
+
local git_root
|
|
178
|
+
git_root=$(_find_git_root "$start_dir") || git_root=""
|
|
179
|
+
|
|
180
|
+
if [[ -n "$git_root" ]]; then
|
|
181
|
+
_debug "Found git root: $git_root"
|
|
182
|
+
plans_root="$git_root"
|
|
183
|
+
plans_dir="${git_root}/docs/plans"
|
|
184
|
+
else
|
|
185
|
+
_debug "No git root found, using current directory"
|
|
186
|
+
_warn "Could not find .plans-config or .git directory. Using current directory."
|
|
187
|
+
plans_root="$start_dir"
|
|
188
|
+
plans_dir="${start_dir}/docs/plans"
|
|
189
|
+
fi
|
|
190
|
+
fi
|
|
191
|
+
|
|
192
|
+
# Normalize paths (remove trailing slashes, resolve ..)
|
|
193
|
+
plans_dir=$(cd "$(dirname "$plans_dir")" 2>/dev/null && echo "$(pwd)/$(basename "$plans_dir")" || echo "$plans_dir")
|
|
194
|
+
plans_root=$(cd "$plans_root" 2>/dev/null && pwd || echo "$plans_root")
|
|
195
|
+
|
|
196
|
+
# Export variables
|
|
197
|
+
export PLANS_DIR="$plans_dir"
|
|
198
|
+
export PLANS_ROOT="$plans_root"
|
|
199
|
+
|
|
200
|
+
_debug "Resolved PLANS_DIR: $PLANS_DIR"
|
|
201
|
+
_debug "Resolved PLANS_ROOT: $PLANS_ROOT"
|
|
202
|
+
|
|
203
|
+
return 0
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
# Helper function to get the full path for a feature
|
|
207
|
+
# Usage: get_feature_plan_dir "feature-name"
|
|
208
|
+
get_feature_plan_dir() {
|
|
209
|
+
local feature_name="$1"
|
|
210
|
+
|
|
211
|
+
if [[ -z "$feature_name" ]]; then
|
|
212
|
+
_error "Feature name required"
|
|
213
|
+
return 1
|
|
214
|
+
fi
|
|
215
|
+
|
|
216
|
+
# Ensure PLANS_DIR is set
|
|
217
|
+
if [[ -z "${PLANS_DIR:-}" ]]; then
|
|
218
|
+
resolve_plans_dir
|
|
219
|
+
fi
|
|
220
|
+
|
|
221
|
+
echo "${PLANS_DIR}/${feature_name}"
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
# If script is executed directly (not sourced), run resolution and print result
|
|
225
|
+
if [[ "${BASH_SOURCE[0]:-}" == "${0:-}" ]]; then
|
|
226
|
+
# Running as script
|
|
227
|
+
case "${1:-}" in
|
|
228
|
+
--help|-h)
|
|
229
|
+
echo "Usage: resolve-plans-dir.sh [start-dir]"
|
|
230
|
+
echo ""
|
|
231
|
+
echo "Resolves the plans directory for the current project."
|
|
232
|
+
echo ""
|
|
233
|
+
echo "Options:"
|
|
234
|
+
echo " --help, -h Show this help message"
|
|
235
|
+
echo " --debug Enable debug output"
|
|
236
|
+
echo ""
|
|
237
|
+
echo "Environment:"
|
|
238
|
+
echo " PLANS_DEBUG=1 Enable debug output"
|
|
239
|
+
echo ""
|
|
240
|
+
echo "Output:"
|
|
241
|
+
echo " Prints the resolved plans directory path"
|
|
242
|
+
echo ""
|
|
243
|
+
echo "Configuration (.plans-config):"
|
|
244
|
+
echo " plans_dir: docs/plans # Relative path for plans"
|
|
245
|
+
echo " scope: local # Use this directory as base"
|
|
246
|
+
exit 0
|
|
247
|
+
;;
|
|
248
|
+
--debug)
|
|
249
|
+
export PLANS_DEBUG=1
|
|
250
|
+
shift
|
|
251
|
+
resolve_plans_dir "${1:-}"
|
|
252
|
+
echo "$PLANS_DIR"
|
|
253
|
+
;;
|
|
254
|
+
*)
|
|
255
|
+
resolve_plans_dir "${1:-}"
|
|
256
|
+
echo "$PLANS_DIR"
|
|
257
|
+
;;
|
|
258
|
+
esac
|
|
259
|
+
else
|
|
260
|
+
# Being sourced - automatically resolve
|
|
261
|
+
resolve_plans_dir
|
|
262
|
+
fi
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# rules-pointer.sh — canonical AGENTS.md/CLAUDE.md detection and shim pointer.
|
|
3
|
+
# Single source of truth for which rules file is canonical and how the
|
|
4
|
+
# CLAUDE.md -> AGENTS.md shim looks. Used by init (profile/migrate/render) and
|
|
5
|
+
# release-model (pointer-targets.sh delegates here); release-model only reads —
|
|
6
|
+
# it never auto-migrates and never creates missing rules files.
|
|
7
|
+
#
|
|
8
|
+
# Usage:
|
|
9
|
+
# rules-pointer.sh imports-agents --repo DIR print imports_agents=true|false
|
|
10
|
+
# rules-pointer.sh targets --repo DIR print existing pointer files
|
|
11
|
+
# rules-pointer.sh claude-md-shim [--notes T|-] print the canonical CLAUDE.md shim
|
|
12
|
+
#
|
|
13
|
+
# Requires python3 3.11+ (guarded first, readable error, no partial output).
|
|
14
|
+
# Exit codes: 0 ok, 1 usage error or dangling @AGENTS.md import.
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
17
|
+
# shellcheck source=require-python.sh
|
|
18
|
+
. "${SCRIPT_DIR}/require-python.sh"
|
|
19
|
+
export PYTHONDONTWRITEBYTECODE=1
|
|
20
|
+
exec python3 "${SCRIPT_DIR}/rules_pointer.py" "$@"
|