showdar-skills 0.2.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/LICENSE +9 -0
- package/README.md +322 -0
- package/bin/showdar.js +118 -0
- package/bundles/bugfix.yaml +4 -0
- package/bundles/design.yaml +4 -0
- package/bundles/feature.yaml +4 -0
- package/bundles/release.yaml +4 -0
- package/bundles/upgrade.yaml +4 -0
- package/commands/opencode/showdar/build.md +6 -0
- package/commands/opencode/showdar/debug.md +6 -0
- package/commands/opencode/showdar/design.md +6 -0
- package/commands/opencode/showdar/git.md +6 -0
- package/commands/opencode/showdar/ops.md +7 -0
- package/commands/opencode/showdar/plan.md +6 -0
- package/commands/opencode/showdar/quality.md +7 -0
- package/commands/opencode/showdar/recover.md +6 -0
- package/commands/opencode/showdar/requirements.md +7 -0
- package/commands/opencode/showdar/review.md +6 -0
- package/commands/opencode/showdar/security.md +7 -0
- package/commands/opencode/showdar/ship.md +6 -0
- package/commands/opencode/showdar/skill.md +6 -0
- package/commands/opencode/showdar/test.md +6 -0
- package/commands/opencode/showdar/understand.md +6 -0
- package/commands/opencode/showdar/upgrade.md +6 -0
- package/engine/csv.mjs +45 -0
- package/engine/detect-stack.mjs +48 -0
- package/engine/rank.mjs +40 -0
- package/engine/search.mjs +20 -0
- package/package.json +28 -0
- package/profiles/backend.json +1 -0
- package/profiles/developer.json +1 -0
- package/profiles/full.json +1 -0
- package/profiles/minimal.json +1 -0
- package/profiles/product.json +1 -0
- package/profiles/qa.json +1 -0
- package/router/conflicts.yaml +50 -0
- package/router/skill-map.yaml +54 -0
- package/router/triggers.yaml +30 -0
- package/skills/showdar-build/SKILL.md +154 -0
- package/skills/showdar-build/data/change-smells.csv +24 -0
- package/skills/showdar-build/data/index.json +14 -0
- package/skills/showdar-build/examples/change-surface.md +18 -0
- package/skills/showdar-build/references/architecture-boundaries.md +3 -0
- package/skills/showdar-build/references/error-handling.md +3 -0
- package/skills/showdar-build/references/feature-flags.md +3 -0
- package/skills/showdar-build/references/minimal-change.md +3 -0
- package/skills/showdar-build/scripts/change-surface.mjs +5 -0
- package/skills/showdar-build/stacks/dart.md +3 -0
- package/skills/showdar-build/stacks/flutter.md +3 -0
- package/skills/showdar-build/stacks/kotlin.md +3 -0
- package/skills/showdar-build/stacks/nextjs.md +3 -0
- package/skills/showdar-build/stacks/node-fastify.md +3 -0
- package/skills/showdar-build/stacks/node-nestjs.md +3 -0
- package/skills/showdar-build/stacks/react-native.md +3 -0
- package/skills/showdar-build/stacks/react.md +3 -0
- package/skills/showdar-build/stacks/rust-tauri.md +3 -0
- package/skills/showdar-build/stacks/swift.md +3 -0
- package/skills/showdar-build/stacks/typescript.md +3 -0
- package/skills/showdar-debug/SKILL.md +179 -0
- package/skills/showdar-debug/data/failure-patterns.csv +34 -0
- package/skills/showdar-debug/data/index.json +14 -0
- package/skills/showdar-debug/examples/evidence-log.md +19 -0
- package/skills/showdar-debug/references/async-races.md +3 -0
- package/skills/showdar-debug/references/build-failures.md +3 -0
- package/skills/showdar-debug/references/hypothesis-driven-debugging.md +3 -0
- package/skills/showdar-debug/references/memory.md +3 -0
- package/skills/showdar-debug/references/networking.md +3 -0
- package/skills/showdar-debug/references/performance.md +3 -0
- package/skills/showdar-debug/scripts/collect-context.mjs +8 -0
- package/skills/showdar-debug/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-debug/stacks/android.md +21 -0
- package/skills/showdar-debug/stacks/docker.md +21 -0
- package/skills/showdar-debug/stacks/flutter.md +21 -0
- package/skills/showdar-debug/stacks/ios.md +21 -0
- package/skills/showdar-debug/stacks/nextjs.md +21 -0
- package/skills/showdar-debug/stacks/node.md +21 -0
- package/skills/showdar-debug/stacks/react-native.md +21 -0
- package/skills/showdar-debug/stacks/react.md +21 -0
- package/skills/showdar-debug/stacks/tauri.md +21 -0
- package/skills/showdar-design/SKILL.md +179 -0
- package/skills/showdar-design/data/accessibility.csv +16 -0
- package/skills/showdar-design/data/colors.csv +13 -0
- package/skills/showdar-design/data/components.csv +20 -0
- package/skills/showdar-design/data/index.json +25 -0
- package/skills/showdar-design/data/motion.csv +13 -0
- package/skills/showdar-design/data/products.csv +19 -0
- package/skills/showdar-design/data/stacks/compose.csv +9 -0
- package/skills/showdar-design/data/stacks/flutter.csv +9 -0
- package/skills/showdar-design/data/stacks/html-tailwind.csv +9 -0
- package/skills/showdar-design/data/stacks/nextjs.csv +9 -0
- package/skills/showdar-design/data/stacks/nuxt.csv +9 -0
- package/skills/showdar-design/data/stacks/react-native.csv +9 -0
- package/skills/showdar-design/data/stacks/react.csv +9 -0
- package/skills/showdar-design/data/stacks/svelte.csv +9 -0
- package/skills/showdar-design/data/stacks/swiftui.csv +9 -0
- package/skills/showdar-design/data/stacks/tauri.csv +9 -0
- package/skills/showdar-design/data/stacks/vue.csv +9 -0
- package/skills/showdar-design/data/styles.csv +13 -0
- package/skills/showdar-design/data/typography.csv +13 -0
- package/skills/showdar-design/data/ui-patterns.csv +19 -0
- package/skills/showdar-design/examples/design-brief.md +19 -0
- package/skills/showdar-design/references/accessibility.md +5 -0
- package/skills/showdar-design/references/anti-ai-ui.md +5 -0
- package/skills/showdar-design/references/architecture.md +12 -0
- package/skills/showdar-design/references/interaction.md +5 -0
- package/skills/showdar-design/references/layout.md +5 -0
- package/skills/showdar-design/references/release-readiness.md +12 -0
- package/skills/showdar-design/references/responsive.md +5 -0
- package/skills/showdar-design/references/security.md +12 -0
- package/skills/showdar-design/references/visual-hierarchy.md +7 -0
- package/skills/showdar-design/scripts/lib/csv.mjs +40 -0
- package/skills/showdar-design/scripts/lib/rank.mjs +35 -0
- package/skills/showdar-design/scripts/lib/search.mjs +20 -0
- package/skills/showdar-design/scripts/search.mjs +38 -0
- package/skills/showdar-design/stacks/flutter.md +13 -0
- package/skills/showdar-design/stacks/html-tailwind.md +12 -0
- package/skills/showdar-design/stacks/jetpack-compose.md +13 -0
- package/skills/showdar-design/stacks/nextjs.md +12 -0
- package/skills/showdar-design/stacks/nuxt.md +11 -0
- package/skills/showdar-design/stacks/react-native.md +13 -0
- package/skills/showdar-design/stacks/react.md +12 -0
- package/skills/showdar-design/stacks/svelte.md +11 -0
- package/skills/showdar-design/stacks/swiftui.md +12 -0
- package/skills/showdar-design/stacks/tauri.md +12 -0
- package/skills/showdar-design/stacks/vue.md +12 -0
- package/skills/showdar-git/SKILL.md +291 -0
- package/skills/showdar-git/data/git-workflows.csv +7 -0
- package/skills/showdar-git/data/index.json +14 -0
- package/skills/showdar-git/examples/commit-task-only.md +15 -0
- package/skills/showdar-git/examples/conflict-stop.md +7 -0
- package/skills/showdar-git/examples/explicit-push.md +7 -0
- package/skills/showdar-git/examples/feature-merge-no-push.md +13 -0
- package/skills/showdar-git/references/operation-safety.md +34 -0
- package/skills/showdar-git/scripts/inspect-git-state.mjs +53 -0
- package/skills/showdar-ops/SKILL.md +160 -0
- package/skills/showdar-ops/data/index.json +14 -0
- package/skills/showdar-ops/data/ops-patterns.csv +12 -0
- package/skills/showdar-ops/examples/explicit-deployment.md +5 -0
- package/skills/showdar-ops/examples/fix-existing-ci.md +5 -0
- package/skills/showdar-ops/examples/inspect-ci-readonly.md +7 -0
- package/skills/showdar-ops/examples/rollback-plan.md +5 -0
- package/skills/showdar-ops/examples/staging-plan.md +5 -0
- package/skills/showdar-ops/references/ci-cd.md +5 -0
- package/skills/showdar-ops/references/containers.md +5 -0
- package/skills/showdar-ops/references/deployment.md +5 -0
- package/skills/showdar-ops/references/desktop-release.md +3 -0
- package/skills/showdar-ops/references/environments.md +5 -0
- package/skills/showdar-ops/references/mobile-release.md +3 -0
- package/skills/showdar-ops/references/observability.md +5 -0
- package/skills/showdar-ops/references/rollback.md +5 -0
- package/skills/showdar-ops/scripts/inspect-ops-state.mjs +54 -0
- package/skills/showdar-plan/SKILL.md +159 -0
- package/skills/showdar-plan/data/index.json +14 -0
- package/skills/showdar-plan/data/planning-checklists.csv +25 -0
- package/skills/showdar-plan/examples/feature-plan.md +19 -0
- package/skills/showdar-plan/references/architecture.md +5 -0
- package/skills/showdar-plan/references/requirements.md +5 -0
- package/skills/showdar-plan/references/risk-analysis.md +5 -0
- package/skills/showdar-plan/references/scope.md +5 -0
- package/skills/showdar-plan/references/task-decomposition.md +5 -0
- package/skills/showdar-plan/scripts/collect-planning-context.mjs +9 -0
- package/skills/showdar-plan/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-plan/stacks/backend.md +3 -0
- package/skills/showdar-plan/stacks/mobile.md +3 -0
- package/skills/showdar-plan/stacks/web.md +3 -0
- package/skills/showdar-quality/SKILL.md +166 -0
- package/skills/showdar-quality/data/index.json +14 -0
- package/skills/showdar-quality/data/quality-patterns.csv +11 -0
- package/skills/showdar-quality/references/qa-guide.md +20 -0
- package/skills/showdar-recover/SKILL.md +164 -0
- package/skills/showdar-recover/data/index.json +14 -0
- package/skills/showdar-recover/data/recovery-signals.csv +23 -0
- package/skills/showdar-recover/examples/recovery-report.md +18 -0
- package/skills/showdar-recover/references/failed-runs.md +3 -0
- package/skills/showdar-recover/references/interrupted-session.md +3 -0
- package/skills/showdar-recover/references/merge-conflicts.md +3 -0
- package/skills/showdar-recover/references/partial-implementation.md +3 -0
- package/skills/showdar-recover/scripts/inspect-state.mjs +5 -0
- package/skills/showdar-requirements/SKILL.md +172 -0
- package/skills/showdar-requirements/data/index.json +14 -0
- package/skills/showdar-requirements/data/requirements-patterns.csv +11 -0
- package/skills/showdar-requirements/references/analysis-guide.md +30 -0
- package/skills/showdar-review/SKILL.md +155 -0
- package/skills/showdar-review/data/index.json +14 -0
- package/skills/showdar-review/data/review-patterns.csv +27 -0
- package/skills/showdar-review/examples/finding.md +16 -0
- package/skills/showdar-review/references/architecture.md +3 -0
- package/skills/showdar-review/references/correctness.md +3 -0
- package/skills/showdar-review/references/maintainability.md +3 -0
- package/skills/showdar-review/references/performance.md +3 -0
- package/skills/showdar-review/references/security.md +3 -0
- package/skills/showdar-review/references/testing.md +3 -0
- package/skills/showdar-review/scripts/collect-diff.mjs +5 -0
- package/skills/showdar-review/stacks/android.md +3 -0
- package/skills/showdar-review/stacks/flutter.md +3 -0
- package/skills/showdar-review/stacks/ios.md +3 -0
- package/skills/showdar-review/stacks/nextjs.md +3 -0
- package/skills/showdar-review/stacks/node-backend.md +3 -0
- package/skills/showdar-review/stacks/react-native.md +3 -0
- package/skills/showdar-review/stacks/react.md +3 -0
- package/skills/showdar-review/stacks/swift-kotlin.md +3 -0
- package/skills/showdar-review/stacks/typescript.md +3 -0
- package/skills/showdar-security/SKILL.md +169 -0
- package/skills/showdar-security/data/index.json +14 -0
- package/skills/showdar-security/data/security-patterns.csv +13 -0
- package/skills/showdar-security/examples/api-authorization-review.md +9 -0
- package/skills/showdar-security/examples/mobile-deeplink-review.md +7 -0
- package/skills/showdar-security/examples/secret-exposure-review.md +5 -0
- package/skills/showdar-security/examples/threat-model-open-assumptions.md +11 -0
- package/skills/showdar-security/references/authz-secrets.md +7 -0
- package/skills/showdar-security/references/mobile-security.md +7 -0
- package/skills/showdar-security/references/supply-chain.md +5 -0
- package/skills/showdar-security/references/threat-modeling.md +12 -0
- package/skills/showdar-security/scripts/inspect-security-surface.mjs +47 -0
- package/skills/showdar-ship/SKILL.md +234 -0
- package/skills/showdar-ship/data/index.json +14 -0
- package/skills/showdar-ship/data/release-checks.csv +28 -0
- package/skills/showdar-ship/examples/release-report.md +25 -0
- package/skills/showdar-ship/references/migrations.md +12 -0
- package/skills/showdar-ship/references/post-deploy.md +12 -0
- package/skills/showdar-ship/references/release-readiness.md +13 -0
- package/skills/showdar-ship/references/rollback.md +12 -0
- package/skills/showdar-ship/references/secrets.md +3 -0
- package/skills/showdar-ship/scripts/detect-targets.mjs +5 -0
- package/skills/showdar-ship/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-ship/scripts/release-check.mjs +6 -0
- package/skills/showdar-ship/stacks/android.md +33 -0
- package/skills/showdar-ship/stacks/docker.md +30 -0
- package/skills/showdar-ship/stacks/electron.md +7 -0
- package/skills/showdar-ship/stacks/ios.md +34 -0
- package/skills/showdar-ship/stacks/nextjs.md +30 -0
- package/skills/showdar-ship/stacks/node-backend.md +37 -0
- package/skills/showdar-ship/stacks/orchestration.md +12 -0
- package/skills/showdar-ship/stacks/tauri.md +35 -0
- package/skills/showdar-ship/stacks/web.md +35 -0
- package/skills/showdar-test/SKILL.md +164 -0
- package/skills/showdar-test/data/index.json +14 -0
- package/skills/showdar-test/data/test-strategy.csv +22 -0
- package/skills/showdar-test/examples/regression.md +14 -0
- package/skills/showdar-test/references/e2e.md +3 -0
- package/skills/showdar-test/references/integration.md +3 -0
- package/skills/showdar-test/references/regression.md +3 -0
- package/skills/showdar-test/references/test-smells.md +3 -0
- package/skills/showdar-test/references/unit.md +3 -0
- package/skills/showdar-test/scripts/detect-test-tools.mjs +6 -0
- package/skills/showdar-test/stacks/android-testing.md +13 -0
- package/skills/showdar-test/stacks/detox.md +13 -0
- package/skills/showdar-test/stacks/flutter-test.md +13 -0
- package/skills/showdar-test/stacks/integration-test.md +13 -0
- package/skills/showdar-test/stacks/jest.md +13 -0
- package/skills/showdar-test/stacks/playwright.md +13 -0
- package/skills/showdar-test/stacks/react-native-testing.md +17 -0
- package/skills/showdar-test/stacks/react-testing-library.md +13 -0
- package/skills/showdar-test/stacks/vitest.md +13 -0
- package/skills/showdar-test/stacks/xctest.md +13 -0
- package/skills/showdar-understand/SKILL.md +159 -0
- package/skills/showdar-understand/data/architecture-signals.csv +28 -0
- package/skills/showdar-understand/data/index.json +14 -0
- package/skills/showdar-understand/examples/repository-audit.md +17 -0
- package/skills/showdar-understand/references/architecture-signals.md +25 -0
- package/skills/showdar-understand/references/dependency-analysis.md +9 -0
- package/skills/showdar-understand/references/repository-analysis.md +24 -0
- package/skills/showdar-understand/scripts/inspect-repo.mjs +16 -0
- package/skills/showdar-understand/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-understand/stacks/android.md +3 -0
- package/skills/showdar-understand/stacks/backend.md +5 -0
- package/skills/showdar-understand/stacks/electron.md +3 -0
- package/skills/showdar-understand/stacks/fastify.md +3 -0
- package/skills/showdar-understand/stacks/flutter.md +3 -0
- package/skills/showdar-understand/stacks/ios.md +3 -0
- package/skills/showdar-understand/stacks/mobile.md +5 -0
- package/skills/showdar-understand/stacks/nestjs.md +3 -0
- package/skills/showdar-understand/stacks/nextjs.md +3 -0
- package/skills/showdar-understand/stacks/node.md +3 -0
- package/skills/showdar-understand/stacks/react-native.md +3 -0
- package/skills/showdar-understand/stacks/react.md +3 -0
- package/skills/showdar-understand/stacks/tauri.md +3 -0
- package/skills/showdar-upgrade/SKILL.md +162 -0
- package/skills/showdar-upgrade/data/compatibility-checklist.csv +24 -0
- package/skills/showdar-upgrade/data/index.json +14 -0
- package/skills/showdar-upgrade/examples/upgrade-report.md +18 -0
- package/skills/showdar-upgrade/references/breaking-changes.md +3 -0
- package/skills/showdar-upgrade/references/compatibility.md +3 -0
- package/skills/showdar-upgrade/references/dependency-resolution.md +3 -0
- package/skills/showdar-upgrade/references/migration-strategy.md +3 -0
- package/skills/showdar-upgrade/references/rollback.md +3 -0
- package/skills/showdar-upgrade/scripts/inspect-dependencies.mjs +6 -0
- package/skills/showdar-upgrade/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-upgrade/stacks/android.md +15 -0
- package/skills/showdar-upgrade/stacks/cocoapods-spm.md +17 -0
- package/skills/showdar-upgrade/stacks/expo.md +17 -0
- package/skills/showdar-upgrade/stacks/flutter.md +17 -0
- package/skills/showdar-upgrade/stacks/gradle.md +13 -0
- package/skills/showdar-upgrade/stacks/ios.md +15 -0
- package/skills/showdar-upgrade/stacks/nextjs.md +17 -0
- package/skills/showdar-upgrade/stacks/node.md +17 -0
- package/skills/showdar-upgrade/stacks/react-native.md +17 -0
- package/skills/showdar-upgrade/stacks/react.md +17 -0
- package/skills/showdar-upgrade/stacks/tauri-rust.md +15 -0
- package/src/adapters.js +44 -0
- package/src/catalog.js +57 -0
- package/src/project.js +287 -0
- package/src/runtime.js +9 -0
- package/src/validate.js +310 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Design release readiness
|
|
2
|
+
|
|
3
|
+
Treat UI as release behavior when it changes navigation, forms, accessibility, loading/error states, or platform integration.
|
|
4
|
+
|
|
5
|
+
- Test the critical task at narrow and wide layouts with long real content, localization-like strings, and large text settings.
|
|
6
|
+
- Verify loading, empty, error, retry, disabled, offline, focus, keyboard, and reduced-motion states; a screenshot of the happy path is not proof.
|
|
7
|
+
- Confirm semantic roles, accessible names, focus order, contrast, touch target size, and screen-reader announcements on the affected platform.
|
|
8
|
+
- Check image/font licensing and loading behavior, metadata/social previews for web, and bundle/performance impact for large media.
|
|
9
|
+
- For native or desktop UI, test back behavior, safe areas, window resizing, permissions, and clean install/update paths as applicable.
|
|
10
|
+
- Record unverified devices, browsers, OS versions, and external design approvals instead of implying they passed.
|
|
11
|
+
|
|
12
|
+
Release readiness means the user task remains understandable and recoverable without animation or ideal content.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Responsive design
|
|
2
|
+
|
|
3
|
+
Responsive behavior is a priority decision, not proportional shrinking. Define what remains, moves, collapses, scrolls, or becomes a different pattern at narrow widths. Preserve task completion and reading order.
|
|
4
|
+
|
|
5
|
+
Test at content-driven breakpoints, long translations, browser zoom, text scaling, keyboard presence, and safe areas. Avoid device-name branching when layout constraints can express the rule.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Design security boundaries
|
|
2
|
+
|
|
3
|
+
UI is an input and disclosure boundary. Visual polish must not weaken authorization, secret handling, or safe rendering.
|
|
4
|
+
|
|
5
|
+
- Client-side visibility, disabled buttons, and route guards are UX; authoritative authorization belongs in the server, domain, or native owner.
|
|
6
|
+
- Treat user content, URLs, filenames, markdown, HTML, and rich text as untrusted. Use the repository’s safe renderer and escaping boundary.
|
|
7
|
+
- Do not display tokens, secret values, private identifiers, or debug payloads merely to make a screen easier to diagnose.
|
|
8
|
+
- Make destructive actions explicit, scoped, and recoverable. Show target, consequence, confirmation, and completion/error state.
|
|
9
|
+
- Avoid autocomplete or persistence that stores sensitive values outside the intended secure owner.
|
|
10
|
+
- For desktop IPC and mobile deep links, validate and constrain every value that crosses from the UI into privileged code.
|
|
11
|
+
|
|
12
|
+
Verify with an accessibility and security review of the changed path; a visually hidden element is not a security control.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Visual hierarchy
|
|
2
|
+
|
|
3
|
+
Hierarchy should communicate importance before decoration. Establish one dominant focal point, a clear reading order, and predictable levels for page title, section title, body, metadata, and actions. Use size, weight, spacing, position, and contrast together; do not solve hierarchy by adding more colors.
|
|
4
|
+
|
|
5
|
+
Dense tools need compact rhythm and aligned data. Editorial experiences can use larger type and whitespace. Mobile screens need fewer simultaneous hierarchy levels because viewport and attention are constrained.
|
|
6
|
+
|
|
7
|
+
Audit at 50% zoom or blurred view: the primary action, primary content, and major sections should still be obvious.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function parseCsv(text, { strict = true } = {}) {
|
|
2
|
+
const rows = [];
|
|
3
|
+
let row = [];
|
|
4
|
+
let field = '';
|
|
5
|
+
let quoted = false;
|
|
6
|
+
const pushRow = () => { row.push(field); rows.push(row); row = []; field = ''; };
|
|
7
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
8
|
+
const ch = text[i];
|
|
9
|
+
if (quoted) {
|
|
10
|
+
if (ch === '"' && text[i + 1] === '"') { field += '"'; i += 1; }
|
|
11
|
+
else if (ch === '"') quoted = false;
|
|
12
|
+
else field += ch;
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (ch === '"') quoted = true;
|
|
16
|
+
else if (ch === ',') { row.push(field); field = ''; }
|
|
17
|
+
else if (ch === '\n') pushRow();
|
|
18
|
+
else if (ch !== '\r') field += ch;
|
|
19
|
+
}
|
|
20
|
+
if (quoted && strict) throw new Error('unterminated quoted field');
|
|
21
|
+
if (field.length || row.length) pushRow();
|
|
22
|
+
const clean = rows.filter((r) => r.some((value) => value.trim() !== ''));
|
|
23
|
+
if (!clean.length) return [];
|
|
24
|
+
const headers = clean[0].map((value) => value.trim());
|
|
25
|
+
if (strict && headers.some((header) => !header)) throw new Error('blank CSV header');
|
|
26
|
+
if (strict && new Set(headers.map((header) => header.toLowerCase())).size !== headers.length) throw new Error('duplicate CSV header');
|
|
27
|
+
return clean.slice(1).map((values) => {
|
|
28
|
+
if (strict && values.length !== headers.length) throw new Error(`CSV column count ${values.length} does not match header count ${headers.length}`);
|
|
29
|
+
return Object.fromEntries(headers.map((header, index) => [header, values[index] ?? '']));
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function stringifyCsv(rows, headers = rows.length ? Object.keys(rows[0]) : []) {
|
|
34
|
+
const escape = (value) => {
|
|
35
|
+
const raw = String(value ?? '');
|
|
36
|
+
if (!/[",\n\r]/.test(raw)) return raw;
|
|
37
|
+
return `"${raw.replaceAll('"', '""')}"`;
|
|
38
|
+
};
|
|
39
|
+
return [headers.map(escape).join(','), ...rows.map((row) => headers.map((header) => escape(row[header])).join(','))].join('\n') + '\n';
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const STOP = new Set(['a','an','and','are','as','at','be','by','for','from','in','is','it','of','on','or','the','to','use','with']);
|
|
2
|
+
|
|
3
|
+
export function tokenize(value) {
|
|
4
|
+
return String(value ?? '')
|
|
5
|
+
.toLowerCase()
|
|
6
|
+
.normalize('NFKD')
|
|
7
|
+
.replace(/[^a-z0-9+#.-]+/g, ' ')
|
|
8
|
+
.split(/\s+/)
|
|
9
|
+
.map((token) => token.trim())
|
|
10
|
+
.filter((token) => token.length > 1 && !STOP.has(token));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function rankRows(rows, query, fieldsOrOptions = []) {
|
|
14
|
+
const options = Array.isArray(fieldsOrOptions) ? { fields: fieldsOrOptions } : (fieldsOrOptions ?? {});
|
|
15
|
+
const fields = options.fields ?? [];
|
|
16
|
+
const weights = options.weights ?? {};
|
|
17
|
+
const queryTokens = tokenize(query);
|
|
18
|
+
const querySet = new Set(queryTokens);
|
|
19
|
+
return rows.map((row, index) => {
|
|
20
|
+
const selected = fields.length ? fields : Object.keys(row);
|
|
21
|
+
const fieldTokens = selected.flatMap((field) => tokenize(row[field]));
|
|
22
|
+
const fieldSet = new Set(fieldTokens);
|
|
23
|
+
let score = 0;
|
|
24
|
+
const matchedTokens = [];
|
|
25
|
+
for (const token of querySet) {
|
|
26
|
+
const exactField = selected.find((field) => tokenize(row[field]).includes(token));
|
|
27
|
+
if (exactField) { score += 4 * Number(weights[exactField] ?? 1); matchedTokens.push(token); }
|
|
28
|
+
else if ([...fieldSet].some((candidate) => candidate.includes(token) || token.includes(candidate))) { score += 1; matchedTokens.push(token); }
|
|
29
|
+
}
|
|
30
|
+
const phrase = query.trim().toLowerCase();
|
|
31
|
+
const phraseField = selected.find((field) => String(row[field] ?? '').toLowerCase().includes(phrase));
|
|
32
|
+
if (phrase && phraseField) score += 8 * Number(weights[phraseField] ?? 1);
|
|
33
|
+
return { row, score, index, matchedTokens: [...new Set(matchedTokens)] };
|
|
34
|
+
}).sort((a, b) => b.score - a.score || a.index - b.index);
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { parseCsv } from './csv.mjs';
|
|
3
|
+
import { rankRows } from './rank.mjs';
|
|
4
|
+
|
|
5
|
+
export function searchRows(rows, query, { fields = [], weights = {}, filters = {}, limit = 8, includeZero = true } = {}) {
|
|
6
|
+
const matches = (actual, expected) => {
|
|
7
|
+
const actualValues = String(actual ?? '').split(/[,|;]/).map((value) => value.trim().toLowerCase()).filter(Boolean);
|
|
8
|
+
const expectedValues = (Array.isArray(expected) ? expected : [expected]).flatMap((value) => String(value).split(/[,|;]/)).map((value) => value.trim().toLowerCase()).filter(Boolean);
|
|
9
|
+
return expectedValues.length > 0 && expectedValues.every((value) => actualValues.includes(value));
|
|
10
|
+
};
|
|
11
|
+
const filtered = rows.filter((row) => Object.entries(filters).every(([key, value]) => matches(row[key], value)));
|
|
12
|
+
const ranked = rankRows(filtered, query, { fields, weights });
|
|
13
|
+
const candidates = includeZero ? ranked : ranked.filter((entry) => entry.score > 0);
|
|
14
|
+
return candidates.slice(0, Math.max(0, limit));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function searchCsv(file, query, options = {}) {
|
|
18
|
+
const rows = parseCsv(await readFile(file, 'utf8'));
|
|
19
|
+
return searchRows(rows, query, options);
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { searchCsv } from './lib/search.mjs';
|
|
6
|
+
|
|
7
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const dataRoot = path.resolve(here, '..', 'data');
|
|
9
|
+
const args = process.argv.slice(2);
|
|
10
|
+
|
|
11
|
+
function value(flag, fallback = null) {
|
|
12
|
+
const i = args.indexOf(flag);
|
|
13
|
+
return i === -1 ? fallback : args[i + 1];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const query = value('--query') ?? args.filter((arg) => !arg.startsWith('--') && !['domain','stack','limit'].includes(arg)).join(' ');
|
|
17
|
+
const domain = value('--domain', 'styles');
|
|
18
|
+
const stack = value('--stack');
|
|
19
|
+
const limit = Number(value('--limit', '8'));
|
|
20
|
+
if (!query) {
|
|
21
|
+
console.error('Usage: node scripts/search.mjs --query "..." [--domain products|styles|colors|typography|motion|accessibility|components|ui-patterns] [--stack react-native] [--limit 8]');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const index = JSON.parse(await readFile(path.join(dataRoot, 'index.json'), 'utf8'));
|
|
27
|
+
const relative = stack ? `data/stacks/${stack}.csv` : `data/${domain}.csv`;
|
|
28
|
+
const dataset = index.datasets.find((entry) => entry.file === relative);
|
|
29
|
+
if (!dataset) throw new Error(`unknown dataset ${relative}; inspect data/index.json`);
|
|
30
|
+
const weights = Object.fromEntries((dataset.searchableFields ?? []).map((field) => [field, ['id', 'tags', 'category', 'product', 'style'].includes(field) ? 2 : 1]));
|
|
31
|
+
const results = await searchCsv(path.join(path.dirname(dataRoot), dataset.file), query, {
|
|
32
|
+
fields: dataset.searchableFields, weights, filters: stack ? { stack } : {}, limit, includeZero: false,
|
|
33
|
+
});
|
|
34
|
+
console.log(JSON.stringify(results.map(({ row, score, matchedTokens }) => ({ score, matchedTokens, ...row })), null, 2));
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(`showdar-design search: ${error.message}`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Flutter design guidance
|
|
2
|
+
|
|
3
|
+
Flutter UI decisions should follow constraints and lifecycle ownership rather than device-specific screenshots.
|
|
4
|
+
|
|
5
|
+
- Keep domain state separate from ephemeral widget state and name the source of truth.
|
|
6
|
+
- Use lazy slivers or builders for collections whose size is not bounded.
|
|
7
|
+
- After an async gap, check `mounted` before using `context` or changing screen-owned UI.
|
|
8
|
+
- Let constraints and flexible layout determine size; test text scale and narrow widths.
|
|
9
|
+
- Dispose controllers, focus nodes, streams, and animation resources at their owner.
|
|
10
|
+
- Add `Semantics` only where custom visuals remove native meaning; test order and labels.
|
|
11
|
+
- Treat platform-channel calls as fallible and model unavailable capability states.
|
|
12
|
+
|
|
13
|
+
Version note: verify Dart, Flutter, plugin, and platform support from the repository lockfile and current Flutter documentation.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# HTML and Tailwind design guidance
|
|
2
|
+
|
|
3
|
+
HTML/Tailwind should use CSS and native semantics as the primary behavior engine.
|
|
4
|
+
|
|
5
|
+
- Define semantic color and spacing tokens with CSS variables before composing utilities.
|
|
6
|
+
- Use buttons, links, labels, inputs, headings, and lists for their native interaction and reading behavior.
|
|
7
|
+
- Treat breakpoints as priority/reflow decisions; test long labels, zoom, and localization.
|
|
8
|
+
- Define focus, invalid, disabled, active, and reduced-motion states explicitly.
|
|
9
|
+
- Extract a component only when behavior or a stable variant contract repeats.
|
|
10
|
+
- Keep arbitrary values rare and explain a value that is a deliberate design token exception.
|
|
11
|
+
|
|
12
|
+
Version note: validate utility names and configuration against the pinned Tailwind version.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Jetpack Compose design guidance
|
|
2
|
+
|
|
3
|
+
Compose screens should make state ownership, recomposition cost, window adaptation, and semantics explicit.
|
|
4
|
+
|
|
5
|
+
- Hoist state only to the lowest common owner; keep transient input local.
|
|
6
|
+
- Use lazy containers for unbounded content and stable domain keys for rows.
|
|
7
|
+
- Treat `LaunchedEffect` and related APIs as lifecycle boundaries; keys must describe the work identity.
|
|
8
|
+
- Use window size and insets for adaptive layouts instead of device-model branches.
|
|
9
|
+
- Give custom controls role, label, state, and testable semantics; verify TalkBack focus order.
|
|
10
|
+
- Keep expensive parsing, image work, and database reads outside composition.
|
|
11
|
+
- Verify loading, empty, error, large-font, landscape, and back-navigation states.
|
|
12
|
+
|
|
13
|
+
Version note: confirm APIs and Material guidance against the project’s pinned Compose BOM and Android documentation before implementation.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Next.js design guidance
|
|
2
|
+
|
|
3
|
+
Next.js UI must make server/client, cache, loading, error, and metadata boundaries visible.
|
|
4
|
+
|
|
5
|
+
- Keep client components narrow and use server rendering for static or data presentation when appropriate.
|
|
6
|
+
- Co-locate fetching with the owner and state freshness or invalidation explicitly.
|
|
7
|
+
- Give route segments meaningful loading and error states whose geometry matches final content.
|
|
8
|
+
- Treat URL state, metadata, social previews, and accessible route transitions as product behavior.
|
|
9
|
+
- Size responsive images and provide meaningful alt text; do not ship decorative payloads as critical content.
|
|
10
|
+
- Test a cold route, client navigation, stale data, invalid data, and narrow viewport.
|
|
11
|
+
|
|
12
|
+
Version note: check the pinned Next.js and React release notes before relying on cache or routing semantics.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Nuxt design guidance
|
|
2
|
+
|
|
3
|
+
Nuxt designs must account for SSR hydration, route middleware, server handlers, and data freshness.
|
|
4
|
+
|
|
5
|
+
- Keep browser-only APIs in client boundaries and make the first render deterministic.
|
|
6
|
+
- Key data fetching by route/resource identity and define invalidation instead of duplicate fetches.
|
|
7
|
+
- Enforce authorization in server handlers; client middleware is navigation UX, not policy.
|
|
8
|
+
- Produce route-specific metadata and verify canonical/social output.
|
|
9
|
+
- Give server and route failures actionable error states with retry or safe navigation.
|
|
10
|
+
|
|
11
|
+
Version note: verify rendering, data, and cache behavior against the pinned Nuxt/Nitro version.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# React Native design guidance
|
|
2
|
+
|
|
3
|
+
React Native design must account for JS/UI/native threads, navigation lifecycle, keyboard, safe areas, and platform semantics.
|
|
4
|
+
|
|
5
|
+
- Use virtualized lists with stable keys and measured item strategy for long content.
|
|
6
|
+
- Keep heavy parsing and synchronous work off gesture, typing, and scroll paths.
|
|
7
|
+
- Pass serializable identifiers through navigation; keep business state in its owning store or query layer.
|
|
8
|
+
- Size hit areas independently from icon artwork and set accessibility role, label, and state.
|
|
9
|
+
- Make keyboard avoidance, safe-area insets, back behavior, loading, and offline states explicit.
|
|
10
|
+
- Control image decode size and cache policy for list cells.
|
|
11
|
+
- Test both iOS and Android when navigation, permissions, native modules, or layout differ.
|
|
12
|
+
|
|
13
|
+
Version note: confirm behavior against the pinned React Native, Hermes, navigation, and platform toolchain versions.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# React design guidance
|
|
2
|
+
|
|
3
|
+
React interfaces should preserve a small state graph and semantic browser behavior.
|
|
4
|
+
|
|
5
|
+
- Keep server, URL, draft, and derived state distinct; do not mirror values through effect chains.
|
|
6
|
+
- Use semantic HTML and native controls before custom interaction primitives.
|
|
7
|
+
- Use stable keys from domain identity and profile render churn before adding memoization.
|
|
8
|
+
- Model pending, error, empty, and retry states where the boundary can recover.
|
|
9
|
+
- Keep context scopes aligned to consumers and avoid one provider for unrelated high-churn state.
|
|
10
|
+
- Test keyboard navigation, focus return, long content, and asynchronous stale-result ordering.
|
|
11
|
+
|
|
12
|
+
Version note: confirm concurrent rendering and framework integration behavior against the pinned React version.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Svelte design guidance
|
|
2
|
+
|
|
3
|
+
Svelte interfaces should make reactive ownership, lifecycle cleanup, and server/client boundaries explicit.
|
|
4
|
+
|
|
5
|
+
- Derive display values rather than mutating shared module state from unrelated components.
|
|
6
|
+
- Use effects for external synchronization and clean up timers, listeners, and subscriptions.
|
|
7
|
+
- Use keyed each blocks by domain identity and virtualize genuinely large collections.
|
|
8
|
+
- Preserve semantic HTML and verify compiler accessibility warnings with user behavior tests.
|
|
9
|
+
- Represent pending, failure, cancellation, and stale-result states instead of relying on a spinner.
|
|
10
|
+
|
|
11
|
+
Version note: check the pinned Svelte and SvelteKit version for runes, SSR, and routing behavior.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# SwiftUI design guidance
|
|
2
|
+
|
|
3
|
+
SwiftUI screens should make identity, observation, task cancellation, and Dynamic Type behavior explicit.
|
|
4
|
+
|
|
5
|
+
- Select `State`, `Binding`, or observable model ownership based on who creates the value.
|
|
6
|
+
- Use stable domain IDs in `ForEach`; never create random identity during body evaluation.
|
|
7
|
+
- Keep expensive transformations out of `body` and scope tasks to the view lifecycle.
|
|
8
|
+
- Prefer content-driven layout over fixed frames; test Dynamic Type, safe areas, and split view widths.
|
|
9
|
+
- Use native controls and explicit labels, values, hints, and focus state for accessibility.
|
|
10
|
+
- Model navigation as data when the flow benefits from restoration and deep links.
|
|
11
|
+
|
|
12
|
+
Version note: verify APIs against the pinned Swift/Xcode SDK and minimum deployment target.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Tauri design guidance
|
|
2
|
+
|
|
3
|
+
Tauri UI is a desktop client over an IPC and capability boundary, not only a web page in a window.
|
|
4
|
+
|
|
5
|
+
- Keep commands typed and validate every frontend-supplied argument in Rust.
|
|
6
|
+
- Grant the smallest window capability set and review permission changes as security-sensitive.
|
|
7
|
+
- Keep large data local or streamed; avoid moving whole documents across IPC on every interaction.
|
|
8
|
+
- Scope event listeners to window lifetime and unsubscribe them on teardown.
|
|
9
|
+
- Design keyboard shortcuts, window size, focus, and OS-specific behavior deliberately.
|
|
10
|
+
- Verify signing, updater compatibility, and clean-machine install separately from UI correctness.
|
|
11
|
+
|
|
12
|
+
Version note: confirm command, capability, and updater APIs against the pinned Tauri and Rust versions.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Vue design guidance
|
|
2
|
+
|
|
3
|
+
Vue interfaces should keep reactivity and ownership legible across components and composables.
|
|
4
|
+
|
|
5
|
+
- Use computed derivation for values that are not independent user state.
|
|
6
|
+
- Keep watchers for synchronization with external systems, not render-state calculation.
|
|
7
|
+
- Use stable keys and lazy list strategies for large collections.
|
|
8
|
+
- Preserve native semantics and manage focus after route, dialog, and validation changes.
|
|
9
|
+
- Abort or version asynchronous work so late results cannot overwrite newer state.
|
|
10
|
+
- Keep form errors associated with controls and test keyboard behavior.
|
|
11
|
+
|
|
12
|
+
Version note: check the pinned Vue and router version for reactivity, SSR, and suspense semantics.
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: showdar-git
|
|
3
|
+
description: Use when performing local Git inspection, staging, commits, branch integration, conflicts, cleanup, or explicitly requested remote Git actions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Showdar Git
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Complete local Git workflows with evidence, narrow ownership, and a verifiable handoff.
|
|
11
|
+
This skill owns repository state transitions, not source-code review or GitHub administration.
|
|
12
|
+
|
|
13
|
+
## When to use
|
|
14
|
+
|
|
15
|
+
- The user asks to inspect Git state or finish a local Git workflow.
|
|
16
|
+
- A task needs selective staging, a commit, branch switching, merging, rebasing, or cherry-picking.
|
|
17
|
+
- A merge, rebase, or cherry-pick has conflicts.
|
|
18
|
+
- The user explicitly asks to push, pull, or remove a safely merged branch.
|
|
19
|
+
- A previous Git operation was interrupted and repository state is ambiguous.
|
|
20
|
+
|
|
21
|
+
## When not to use
|
|
22
|
+
|
|
23
|
+
- Use `showdar-review` for reviewing implementation quality or a diff without a Git mutation.
|
|
24
|
+
- Use `showdar-ship` for delivery-readiness verification; Ship does not imply Git mutation.
|
|
25
|
+
- Use `showdar-recover` for an interrupted coding task when Git itself is not the recovery boundary.
|
|
26
|
+
- Use `showdar-debug` for a source defect, test failure, or runtime regression.
|
|
27
|
+
- Do not turn a local Git request into GitHub, CI/CD, deployment, or release work.
|
|
28
|
+
|
|
29
|
+
## Inputs and assumptions
|
|
30
|
+
|
|
31
|
+
- The repository path, current branch, requested operation, and target branch are known or inspectable.
|
|
32
|
+
- The working tree may contain user changes that are unrelated to the current task.
|
|
33
|
+
- Existing repository instructions and commit-message conventions are authoritative.
|
|
34
|
+
- A remote is evidence only; its presence does not authorize a remote mutation.
|
|
35
|
+
- A published/shared branch is treated as history that must not be rewritten silently.
|
|
36
|
+
|
|
37
|
+
## Non-negotiable rules
|
|
38
|
+
|
|
39
|
+
- Run `git status` before every mutation and inspect the relevant diff.
|
|
40
|
+
- Classify task-owned, unrelated, generated, and ambiguous paths before staging.
|
|
41
|
+
- Never stage unrelated work just to make the tree clean.
|
|
42
|
+
- Stage explicit paths; `git add .` and `git add -A` are unsafe defaults in a mixed tree.
|
|
43
|
+
- Inspect `git diff --cached --check` and `git diff --cached` before committing.
|
|
44
|
+
- Preserve user work; never use `git reset --hard` or `git clean -fd` as convenience cleanup.
|
|
45
|
+
- Never force-push, delete an unmerged branch, amend, squash, or rewrite published history by default.
|
|
46
|
+
- Push, tag, remote deletion, pull with mutation, GitHub operations, and release actions require explicit intent.
|
|
47
|
+
- Report exactly what changed after each Git mutation.
|
|
48
|
+
|
|
49
|
+
## Workflow
|
|
50
|
+
|
|
51
|
+
### 1. Inspect Git state
|
|
52
|
+
|
|
53
|
+
Start with:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git status --short
|
|
57
|
+
git branch -vv
|
|
58
|
+
git remote -v
|
|
59
|
+
git log -5 --oneline --decorate
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Use the read-only helper `scripts/inspect-git-state.mjs` when a deterministic JSON snapshot is useful.
|
|
63
|
+
Check for detached HEAD, upstream divergence, merge/rebase/cherry-pick state, staged paths, unstaged paths, and untracked paths.
|
|
64
|
+
|
|
65
|
+
### 2. Establish ownership
|
|
66
|
+
|
|
67
|
+
Read the task, current diff, and nearby repository instructions together.
|
|
68
|
+
Classify every changed path:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
FEATURE/TASK:
|
|
72
|
+
README.md
|
|
73
|
+
src/foo.js
|
|
74
|
+
|
|
75
|
+
EXCLUDED:
|
|
76
|
+
AGENTS.md
|
|
77
|
+
.agents/
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If ownership is ambiguous, stop and ask; do not stage, revert, clean, or overwrite that path.
|
|
81
|
+
An ignored or generated-looking path is not automatically safe to delete.
|
|
82
|
+
|
|
83
|
+
### 3. Stage safely
|
|
84
|
+
|
|
85
|
+
Stage only the confirmed task paths, including intended deletions:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git add README.md src/foo.js
|
|
89
|
+
git add -u -- profiles/old.json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then verify the index, not just the worktree:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git diff --cached --check
|
|
96
|
+
git diff --cached --stat
|
|
97
|
+
git diff --cached
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Confirm excluded paths are absent from the staged diff. Unstage a mistaken path with `git restore --staged -- <path>` without changing its worktree content.
|
|
101
|
+
|
|
102
|
+
### 4. Commit locally
|
|
103
|
+
|
|
104
|
+
Use the repository's existing message convention when discoverable.
|
|
105
|
+
The subject must describe only the staged change.
|
|
106
|
+
Do not amend an existing commit unless explicitly requested.
|
|
107
|
+
|
|
108
|
+
Before commit, verify staged paths, staged content, and cached whitespace.
|
|
109
|
+
After commit, capture `git rev-parse HEAD`, inspect `git status --short`, and verify the commit contains the intended paths.
|
|
110
|
+
|
|
111
|
+
### 5. Merge, rebase, or cherry-pick
|
|
112
|
+
|
|
113
|
+
For a requested merge, inspect source and target branches first, protect dirty work, switch to the target, and use the repository convention.
|
|
114
|
+
Preserve history unless the user explicitly chooses another strategy.
|
|
115
|
+
Use `--no-ff` only when requested or established by repository convention.
|
|
116
|
+
|
|
117
|
+
Treat rebase as history rewriting: determine whether commits are published before starting and never infer a force-push afterward.
|
|
118
|
+
For cherry-pick, verify the commit identity and intent, then inspect the resulting diff and tests.
|
|
119
|
+
|
|
120
|
+
### 6. Handle conflicts
|
|
121
|
+
|
|
122
|
+
List the conflict set with `git status` and read both sides plus the surrounding history.
|
|
123
|
+
Classify each conflict as textual, ownership, semantic, or generated.
|
|
124
|
+
Do not blindly choose ours/theirs.
|
|
125
|
+
Preserve both intents where appropriate, stage only resolved paths, and run relevant verification before continuing.
|
|
126
|
+
If intent cannot be established, stop with the conflict set and the required decision.
|
|
127
|
+
|
|
128
|
+
### 7. Pull and push safely
|
|
129
|
+
|
|
130
|
+
A pull may alter local history or files; inspect status and upstream first.
|
|
131
|
+
Use fast-forward-only when updating a branch that should not create an inferred merge.
|
|
132
|
+
Push only after the user explicitly requests it and local verification is complete.
|
|
133
|
+
Confirm branch, upstream, commit range, and whether a force update would be needed.
|
|
134
|
+
Never force-push silently, especially after rebase.
|
|
135
|
+
|
|
136
|
+
### 8. Clean up conservatively
|
|
137
|
+
|
|
138
|
+
Delete a local branch only when it is merged into the intended target and cleanup is requested or clearly part of the completed Git task.
|
|
139
|
+
Do not bulk-delete branches, delete remote branches, or remove unmerged work by inference.
|
|
140
|
+
Verify the branch and merge base before deletion, then verify the remaining refs.
|
|
141
|
+
|
|
142
|
+
## Decision points
|
|
143
|
+
|
|
144
|
+
- Dirty tree plus mixed ownership -> classify and selectively stage; do not clean.
|
|
145
|
+
- Detached HEAD -> inspect recent commits and ask where work should continue before branch mutation.
|
|
146
|
+
- Published branch plus rebase request -> explain history-rewrite consequences before proceeding.
|
|
147
|
+
- Existing conflict markers or operation metadata -> finish or abort only with explicit intent and understood recovery path.
|
|
148
|
+
- Merge target is main/default/protected -> require explicit target intent; local Git does not grant release approval.
|
|
149
|
+
- Push requested after failed verification -> report blockers and stop before remote mutation.
|
|
150
|
+
|
|
151
|
+
## Git state inspection
|
|
152
|
+
|
|
153
|
+
Inspect `HEAD`, branch, upstream, ahead/behind counts, staged/unstaged/untracked paths, and operation markers.
|
|
154
|
+
Operation markers include `MERGE_HEAD`, `CHERRY_PICK_HEAD`, `REVERT_HEAD`, `rebase-merge`, and `rebase-apply` under `.git`.
|
|
155
|
+
The helper emits these facts without changing the repository.
|
|
156
|
+
|
|
157
|
+
## Staging safety
|
|
158
|
+
|
|
159
|
+
The index is the commit boundary. A clean or partially clean worktree does not prove the staged set is correct.
|
|
160
|
+
Review renames, deletions, ignored files, submodules, symlinks, and generated files explicitly.
|
|
161
|
+
Use pathspecs and `git add -u -- <path>` for intended deletions; never use broad staging in a mixed tree.
|
|
162
|
+
|
|
163
|
+
## Commit workflow
|
|
164
|
+
|
|
165
|
+
Commit only after cached diff review, whitespace validation, and relevant checks.
|
|
166
|
+
If checks create generated files, classify them before staging.
|
|
167
|
+
Record commit SHA, subject, staged path set, verification, and remaining exclusions.
|
|
168
|
+
|
|
169
|
+
## Merge/rebase/cherry-pick guidance
|
|
170
|
+
|
|
171
|
+
Prefer a normal merge when no convention is known.
|
|
172
|
+
Preserve a merge commit with `--no-ff` when explicitly requested.
|
|
173
|
+
Rebase only with clear authorization and a known unpublished/private history.
|
|
174
|
+
Cherry-pick one verified commit at a time when its dependencies and ownership are understood.
|
|
175
|
+
|
|
176
|
+
## Conflict handling
|
|
177
|
+
|
|
178
|
+
Conflict resolution is a semantic edit, not a marker-removal exercise.
|
|
179
|
+
Read the base, current side, incoming side, task requirements, and tests.
|
|
180
|
+
Do not run `git checkout --ours`, `git checkout --theirs`, or equivalent bulk resolution without explicit, path-specific justification.
|
|
181
|
+
|
|
182
|
+
## Push/pull safety
|
|
183
|
+
|
|
184
|
+
`commit` does not imply `push`; `merge` does not imply `push`; `ship` does not imply `push`.
|
|
185
|
+
GitHub Actions, workflow files, pull requests, branch protection, CI/CD, deployment, tags, releases, and provider configuration are outside this skill's default boundary.
|
|
186
|
+
|
|
187
|
+
## Cleanup behavior
|
|
188
|
+
|
|
189
|
+
Cleanup means verified local branch housekeeping, not making unrelated files disappear.
|
|
190
|
+
Keep excluded files and unmerged branches visible in the final report.
|
|
191
|
+
When a safe cleanup cannot be proven, leave it untouched and report the evidence needed.
|
|
192
|
+
|
|
193
|
+
## Stack detection
|
|
194
|
+
|
|
195
|
+
Git operations are stack-agnostic.
|
|
196
|
+
Inspect the project stack only to choose existing local verification commands; do not invent CI or deployment commands.
|
|
197
|
+
For native/generated projects, include relevant generated-file and lockfile changes in ownership review.
|
|
198
|
+
|
|
199
|
+
## Failure modes
|
|
200
|
+
|
|
201
|
+
- Broad staging captures user or generated files.
|
|
202
|
+
- A commit is made from `git diff` while the index contains a different change set.
|
|
203
|
+
- A merge resolves text but breaks the behavior owned by one side.
|
|
204
|
+
- A rebase silently rewrites shared history.
|
|
205
|
+
- A push is inferred from “finish”, “ship”, or “merge”.
|
|
206
|
+
- Branch cleanup deletes a branch before merged-state evidence is checked.
|
|
207
|
+
- GitHub or CI configuration is changed during an ordinary local Git task.
|
|
208
|
+
|
|
209
|
+
## Stop conditions
|
|
210
|
+
|
|
211
|
+
- Ownership of any staged candidate is ambiguous.
|
|
212
|
+
- The target branch, commit range, or operation intent is unclear.
|
|
213
|
+
- A destructive command is proposed without explicit authorization and a safe target.
|
|
214
|
+
- A conflict's semantic intent cannot be inferred from task/source/history evidence.
|
|
215
|
+
- Verification fails before a requested push, merge completion, or cleanup.
|
|
216
|
+
|
|
217
|
+
## Escalation conditions
|
|
218
|
+
|
|
219
|
+
- Ask before remote mutation, force-push, tag, remote deletion, or protected/default branch changes.
|
|
220
|
+
- Ask when a rebase would rewrite published/shared history.
|
|
221
|
+
- Ask when untracked or ignored files may be user-owned or generated by another tool.
|
|
222
|
+
- Hand off source defects to `showdar-debug`, code review to `showdar-review`, and delivery readiness to `showdar-ship`.
|
|
223
|
+
|
|
224
|
+
## Verification
|
|
225
|
+
|
|
226
|
+
After local mutations, run:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
git status
|
|
230
|
+
git branch -vv
|
|
231
|
+
git diff --check
|
|
232
|
+
git log -1 --oneline --decorate
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
After staging, also run `git diff --cached --check` and inspect `git diff --cached`.
|
|
236
|
+
After merge/rebase/cherry-pick, run relevant repository tests and checks, then verify no operation remains in progress.
|
|
237
|
+
After push, verify the upstream and remote commit only when push was explicitly requested.
|
|
238
|
+
|
|
239
|
+
## Output contract
|
|
240
|
+
|
|
241
|
+
Report:
|
|
242
|
+
|
|
243
|
+
- operation requested and operation actually performed
|
|
244
|
+
- task-owned paths staged/committed and excluded paths preserved
|
|
245
|
+
- commit, merge, rebase, or cherry-pick SHA(s)
|
|
246
|
+
- branch, upstream, ahead/behind, and conflict state
|
|
247
|
+
- verification commands and results
|
|
248
|
+
- remote mutation status, explicitly stating “not performed” when not requested
|
|
249
|
+
- remaining blockers or cleanup candidates
|
|
250
|
+
|
|
251
|
+
## Anti-patterns
|
|
252
|
+
|
|
253
|
+
- `git add .` or `git add -A` in a mixed worktree
|
|
254
|
+
- reset, clean, checkout, or restore used to hide unrelated work
|
|
255
|
+
- commit before reading the cached diff
|
|
256
|
+
- automatic amend, squash, force-push, or remote deletion
|
|
257
|
+
- choosing ours/theirs without semantic review
|
|
258
|
+
- merging into main because it is convenient
|
|
259
|
+
- treating GitHub, Actions, CI/CD, deploy, or release as part of local Git
|
|
260
|
+
|
|
261
|
+
## Example
|
|
262
|
+
|
|
263
|
+
### Commit only task-owned files
|
|
264
|
+
|
|
265
|
+
```text
|
|
266
|
+
status -> README.md and src/foo.js are task-owned; AGENTS.md and .agents/ are excluded
|
|
267
|
+
stage -> git add README.md src/foo.js
|
|
268
|
+
verify -> git diff --cached --check && git diff --cached
|
|
269
|
+
commit -> commit only after the staged diff and relevant checks pass
|
|
270
|
+
report -> SHA, staged paths, exclusions, and clean/dirty final state
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Feature completion without push
|
|
274
|
+
|
|
275
|
+
```text
|
|
276
|
+
feature branch -> selective commit -> switch develop -> merge using repository convention -> verify
|
|
277
|
+
remote -> not touched because no push request was given
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Explicit push
|
|
281
|
+
|
|
282
|
+
```text
|
|
283
|
+
verify branch/upstream and checks -> confirm exact branch -> git push origin feature/name -> verify upstream
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Conflict
|
|
287
|
+
|
|
288
|
+
```text
|
|
289
|
+
merge reports conflicts -> inspect base/ours/theirs and task intent -> stop if ownership is unclear
|
|
290
|
+
do not choose ours/theirs or abort/continue by inference
|
|
291
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
id,category,summary,evidence,approach,avoid,tags,reference,stack
|
|
2
|
+
selective-staging,staging,Separate task-owned changes from unrelated work before a commit,git status and worktree diff show mixed paths,stage explicit paths and inspect the cached diff,git add . or git add -A in a mixed tree,selective staging; mixed worktree,references/operation-safety.md,*
|
|
3
|
+
local-commit,commit,Create a commit from a verified index and actual task scope,git diff --cached matches the ownership classification,run cached whitespace checks and relevant local tests before commit,commit from an unreviewed index,commit; cached diff; task scope,references/operation-safety.md,*
|
|
4
|
+
branch-merge,merge,Integrate a completed feature branch into a named local target,source and target branch state plus merge intent,protect dirty work merge with the local convention and verify history,infer push or merge into an unspecified protected branch,merge; branch; develop; local,references/operation-safety.md,*
|
|
5
|
+
conflict-resolution,conflict,Resolve merge rebase or cherry-pick conflicts from both semantic sides,conflict paths operation metadata task intent and merge base,read both sides resolve narrowly test then continue,choose ours or theirs blindly,conflict; merge base; rebase; cherry-pick,references/operation-safety.md,*
|
|
6
|
+
explicit-push,remote,Push only after explicit intent and local verification,current branch upstream commit and checks,user names the remote or branch then verify the result,infer push from commit merge or ship,remote; push; explicit intent; upstream,references/operation-safety.md,*
|
|
7
|
+
merged-branch-cleanup,cleanup,Delete only a local branch proven merged into the intended target,merge base branch refs and cleanup request,verify merged state delete one safe local branch and recheck refs,bulk delete unmerged or remote branches,cleanup; merged branch; safe deletion,references/operation-safety.md,*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"skill": "showdar-git",
|
|
4
|
+
"datasets": [
|
|
5
|
+
{
|
|
6
|
+
"file": "data/git-workflows.csv",
|
|
7
|
+
"idField": "id",
|
|
8
|
+
"requiredColumns": ["id", "category", "summary", "evidence", "approach", "avoid", "tags", "reference", "stack"],
|
|
9
|
+
"searchableFields": ["category", "summary", "evidence", "approach", "avoid", "tags"],
|
|
10
|
+
"filterFields": ["category", "stack"],
|
|
11
|
+
"reference": "references/operation-safety.md"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|