opencode-skills-collection 4.1.1 → 4.1.3
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.
Potentially problematic release.
This version of opencode-skills-collection might be problematic. Click here for more details.
- package/bundled-skills/.antigravity-install-manifest.json +133 -1
- package/bundled-skills/360-feedback-system/SKILL.md +481 -0
- package/bundled-skills/access-matrix/SKILL.md +338 -0
- package/bundled-skills/accounting-audit-system-builder/SKILL.md +302 -0
- package/bundled-skills/accounting-audit-system-builder/references/catalog.md +114 -0
- package/bundled-skills/accounting-software-selection/SKILL.md +427 -0
- package/bundled-skills/accounting-software-selection/references/build-artifacts.md +362 -0
- package/bundled-skills/accounting-software-selection/references/common-pitfalls.md +44 -0
- package/bundled-skills/accounting-software-selection/references/field-reference.md +93 -0
- package/bundled-skills/accounting-software-selection/references/select-options.md +202 -0
- package/bundled-skills/admin-access-register/SKILL.md +381 -0
- package/bundled-skills/advanced-analytics-dashboard/SKILL.md +318 -0
- package/bundled-skills/ai-image-generation-studio/SKILL.md +259 -0
- package/bundled-skills/ai-logo-maker/SKILL.md +259 -0
- package/bundled-skills/ai-multilingual-dubbing/SKILL.md +259 -0
- package/bundled-skills/ai-photo-restyler/SKILL.md +259 -0
- package/bundled-skills/ai-podcast-voiceover/SKILL.md +259 -0
- package/bundled-skills/alumni-re-hire-tracker/SKILL.md +314 -0
- package/bundled-skills/announcement-board/SKILL.md +336 -0
- package/bundled-skills/antigravity-maintainer-batch-release/SKILL.md +63 -4
- package/bundled-skills/asset-it-management/SKILL.md +407 -0
- package/bundled-skills/attendance/SKILL.md +331 -0
- package/bundled-skills/audit-log/SKILL.md +314 -0
- package/bundled-skills/audit-preparation/SKILL.md +416 -0
- package/bundled-skills/beatra/SKILL.md +260 -0
- package/bundled-skills/board-governance/SKILL.md +360 -0
- package/bundled-skills/brand-growth-system-builder/SKILL.md +360 -0
- package/bundled-skills/brand-kit-print-collateral/SKILL.md +498 -0
- package/bundled-skills/buddy-program-manager/SKILL.md +329 -0
- package/bundled-skills/budget-cash-flow/SKILL.md +352 -0
- package/bundled-skills/busabase/SKILL.md +118 -0
- package/bundled-skills/business-email-template/SKILL.md +480 -0
- package/bundled-skills/business-email-template/references/common-pitfalls.md +30 -0
- package/bundled-skills/business-website-setup/SKILL.md +489 -0
- package/bundled-skills/business-website-setup/references/common-pitfalls.md +32 -0
- package/bundled-skills/candidate-talent-pool/SKILL.md +359 -0
- package/bundled-skills/capacity-workload-planner/SKILL.md +354 -0
- package/bundled-skills/changelog-entry/SKILL.md +141 -0
- package/bundled-skills/clients-accounts/SKILL.md +398 -0
- package/bundled-skills/code-of-conduct/SKILL.md +488 -0
- package/bundled-skills/code-of-conduct/references/common-pitfalls.md +31 -0
- package/bundled-skills/company-email-accounts/SKILL.md +404 -0
- package/bundled-skills/competency-matrix/SKILL.md +335 -0
- package/bundled-skills/contract-document-renewal/SKILL.md +396 -0
- package/bundled-skills/course-upskilling-requests/SKILL.md +354 -0
- package/bundled-skills/credit-cycle-analysis/SKILL.md +303 -0
- package/bundled-skills/credit-cycle-analysis/references/best-practices.md +35 -0
- package/bundled-skills/credit-cycle-analysis/references/common-pitfalls.md +5 -0
- package/bundled-skills/credit-cycle-analysis/references/examples.md +34 -0
- package/bundled-skills/credit-cycle-analysis/references/field-reference.md +47 -0
- package/bundled-skills/credit-cycle-analysis/references/how-it-works.md +494 -0
- package/bundled-skills/credit-cycle-analysis/references/security-notes.md +16 -0
- package/bundled-skills/credit-cycle-analysis/references/select-options.md +32 -0
- package/bundled-skills/csv-manual-export/SKILL.md +499 -0
- package/bundled-skills/csv-manual-export/references/common-pitfalls.md +19 -0
- package/bundled-skills/culture-retention/SKILL.md +346 -0
- package/bundled-skills/data-export-engine/SKILL.md +308 -0
- package/bundled-skills/data-privacy-controls/SKILL.md +317 -0
- package/bundled-skills/day-book/SKILL.md +499 -0
- package/bundled-skills/day-book/references/best-practices.md +32 -0
- package/bundled-skills/day-book/references/common-pitfalls.md +58 -0
- package/bundled-skills/day-book/references/field-reference.md +45 -0
- package/bundled-skills/day-book/references/how-it-works.md +7 -0
- package/bundled-skills/day-book/references/related-skills.md +18 -0
- package/bundled-skills/day-book/references/relations.md +14 -0
- package/bundled-skills/day-book/references/reusable-prompt.md +50 -0
- package/bundled-skills/day-book/references/security-safety-notes.md +19 -0
- package/bundled-skills/day-book/references/select-options.md +38 -0
- package/bundled-skills/deep-research-framework/SKILL.md +81 -0
- package/bundled-skills/dei-dashboard/SKILL.md +307 -0
- package/bundled-skills/design-theme-guide/SKILL.md +472 -0
- package/bundled-skills/disciplinary-pip-tracker/SKILL.md +345 -0
- package/bundled-skills/document-management-system/SKILL.md +328 -0
- package/bundled-skills/ecommerce-listing-image-set/SKILL.md +259 -0
- package/bundled-skills/employee-suggestion-hub/SKILL.md +322 -0
- package/bundled-skills/esop-equity-tracker/SKILL.md +331 -0
- package/bundled-skills/events-activities/SKILL.md +355 -0
- package/bundled-skills/expense-accounting/SKILL.md +496 -0
- package/bundled-skills/expense-accounting/references/common-pitfalls.md +41 -0
- package/bundled-skills/expense-accounting/references/related-skills.md +11 -0
- package/bundled-skills/expense-accounting/references/reusable-prompt.md +36 -0
- package/bundled-skills/expense-management/SKILL.md +351 -0
- package/bundled-skills/five-axis-code-review/SKILL.md +78 -0
- package/bundled-skills/free-design-resources/SKILL.md +480 -0
- package/bundled-skills/free-design-resources/references/common-pitfalls.md +44 -0
- package/bundled-skills/free-design-resources/references/related-skills.md +24 -0
- package/bundled-skills/free-design-resources/references/reusable-prompt.md +12 -0
- package/bundled-skills/gamification-engine/SKILL.md +307 -0
- package/bundled-skills/gbp-local-seo-intent/SKILL.md +466 -0
- package/bundled-skills/gbp-local-seo-intent/references/best-practices.md +41 -0
- package/bundled-skills/gbp-local-seo-intent/references/common-pitfalls.md +40 -0
- package/bundled-skills/gbp-local-seo-intent/references/related-skills.md +17 -0
- package/bundled-skills/gbp-local-seo-intent/references/reusable-prompt.md +11 -0
- package/bundled-skills/gbp-local-seo-intent/references/security-safety-notes.md +27 -0
- package/bundled-skills/git-commit-message/SKILL.md +76 -0
- package/bundled-skills/health-wellness/SKILL.md +334 -0
- package/bundled-skills/idea-to-blueprint/LICENSE +21 -0
- package/bundled-skills/idea-to-blueprint/SKILL.md +260 -0
- package/bundled-skills/idea-to-blueprint/assets/AGENTS.md.template +38 -0
- package/bundled-skills/idea-to-blueprint/assets/CLAUDE.md.template +38 -0
- package/bundled-skills/idea-to-blueprint/assets/DECISIONS.md.template +14 -0
- package/bundled-skills/idea-to-blueprint/assets/PROGRESS.md.template +47 -0
- package/bundled-skills/idea-to-blueprint/assets/session-prompt.md +23 -0
- package/bundled-skills/idea-to-blueprint/references/architecture-decisions.md +202 -0
- package/bundled-skills/idea-to-blueprint/references/blueprint-template.md +259 -0
- package/bundled-skills/idea-to-blueprint/references/code-quality-and-review.md +216 -0
- package/bundled-skills/idea-to-blueprint/references/design-minimal.md +96 -0
- package/bundled-skills/idea-to-blueprint/references/edge-case-catalog.md +239 -0
- package/bundled-skills/idea-to-blueprint/references/intake-questions.md +105 -0
- package/bundled-skills/idea-to-blueprint/references/research-protocol.md +196 -0
- package/bundled-skills/idea-to-blueprint/references/session-protocol.md +133 -0
- package/bundled-skills/idea-to-blueprint/references/stories-ac-tests.md +194 -0
- package/bundled-skills/idea-to-blueprint/references/ux-writing-guide.md +128 -0
- package/bundled-skills/idea-to-blueprint/scripts/lint_blueprint.py +460 -0
- package/bundled-skills/intern-program/SKILL.md +354 -0
- package/bundled-skills/internal-communication/SKILL.md +318 -0
- package/bundled-skills/inventory-stock-reconciliation/SKILL.md +470 -0
- package/bundled-skills/inventory-stock-reconciliation/references/best-practices.md +18 -0
- package/bundled-skills/inventory-stock-reconciliation/references/common-pitfalls.md +42 -0
- package/bundled-skills/inventory-stock-reconciliation/references/related-skills.md +13 -0
- package/bundled-skills/inventory-stock-reconciliation/references/relations.md +8 -0
- package/bundled-skills/inventory-stock-reconciliation/references/reusable-prompt.md +31 -0
- package/bundled-skills/inventory-stock-reconciliation/references/security-safety-notes.md +17 -0
- package/bundled-skills/inventory-stock-reconciliation/references/select-options.md +45 -0
- package/bundled-skills/invoices-billing/SKILL.md +385 -0
- package/bundled-skills/issue-grievance-tracker/SKILL.md +400 -0
- package/bundled-skills/json-schema-manual/SKILL.md +309 -0
- package/bundled-skills/json-schema-manual/references/best-practices.md +9 -0
- package/bundled-skills/json-schema-manual/references/common-pitfalls.md +25 -0
- package/bundled-skills/json-schema-manual/references/input-modules.md +203 -0
- package/bundled-skills/json-schema-manual/references/related-skills.md +8 -0
- package/bundled-skills/json-schema-manual/references/reusable-prompt.md +10 -0
- package/bundled-skills/json-schema-manual/references/security-safety-notes.md +13 -0
- package/bundled-skills/knowledge-base/SKILL.md +318 -0
- package/bundled-skills/kpi-tracker/SKILL.md +345 -0
- package/bundled-skills/learning-career-development/SKILL.md +349 -0
- package/bundled-skills/leave-management/SKILL.md +341 -0
- package/bundled-skills/legal-compliance-vault/SKILL.md +324 -0
- package/bundled-skills/linktree-link-hub/SKILL.md +453 -0
- package/bundled-skills/liuguang-banlan-ui/SKILL.md +22 -18
- package/bundled-skills/liuguang-banlan-ui/assets/starter/launcher.css +2 -2
- package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/index.html +5 -4
- package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme-config.js +3 -10
- package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme.css +48 -62
- package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/index.html +5 -4
- package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme-config.js +27 -35
- package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme.css +48 -62
- package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/spectral-field.js +135 -148
- package/bundled-skills/liuguang-banlan-ui/references/style-contract.md +26 -7
- package/bundled-skills/liuguang-banlan-ui/references/verification.md +19 -7
- package/bundled-skills/liuguang-banlan-ui/scripts/measure_preview.py +78 -47
- package/bundled-skills/liuguang-banlan-ui/scripts/serve_preview.py +35 -0
- package/bundled-skills/liuguang-banlan-ui/scripts/validate_manifest.py +34 -3
- package/bundled-skills/liuguang-banlan-ui/tests/test_measure_preview.py +119 -0
- package/bundled-skills/liuguang-banlan-ui/tests/test_serve_preview.py +38 -0
- package/bundled-skills/liuguang-banlan-ui/tests/test_validate_manifest.py +73 -0
- package/bundled-skills/logo-image-design/SKILL.md +459 -0
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +12 -12
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +1 -1
- package/bundled-skills/meeting-notes/SKILL.md +80 -0
- package/bundled-skills/mentorship-program/SKILL.md +332 -0
- package/bundled-skills/mirrord/SKILL.md +90 -0
- package/bundled-skills/monthly-closing-statements/SKILL.md +488 -0
- package/bundled-skills/monthly-closing-statements/references/related-skills.md +17 -0
- package/bundled-skills/monthly-closing-statements/references/reusable-prompt.md +8 -0
- package/bundled-skills/music-generation-studio/SKILL.md +259 -0
- package/bundled-skills/notification-reminder-hub/SKILL.md +324 -0
- package/bundled-skills/notion-manual-import/SKILL.md +376 -0
- package/bundled-skills/notion-manual-import/references/best-practices.md +10 -0
- package/bundled-skills/notion-manual-import/references/common-pitfalls.md +26 -0
- package/bundled-skills/notion-manual-import/references/input-modules.md +203 -0
- package/bundled-skills/notion-manual-import/references/related-skills.md +7 -0
- package/bundled-skills/notion-manual-import/references/reusable-prompt.md +8 -0
- package/bundled-skills/notion-manual-import/references/security-safety-notes.md +15 -0
- package/bundled-skills/observability-cloud-planning/SKILL.md +487 -0
- package/bundled-skills/observability-cloud-planning/references/common-pitfalls.md +39 -0
- package/bundled-skills/observability-cloud-planning/references/related-skills.md +20 -0
- package/bundled-skills/observability-cloud-planning/references/reusable-prompt.md +12 -0
- package/bundled-skills/observability-cloud-planning/references/security-safety-notes.md +30 -0
- package/bundled-skills/offboarding-exit/SKILL.md +343 -0
- package/bundled-skills/offer-appointment/SKILL.md +351 -0
- package/bundled-skills/okr-system/SKILL.md +355 -0
- package/bundled-skills/onboarding-playbook/SKILL.md +292 -0
- package/bundled-skills/organization-design/SKILL.md +324 -0
- package/bundled-skills/party-ledger-reconciliation/SKILL.md +411 -0
- package/bundled-skills/payment-accounting/SKILL.md +421 -0
- package/bundled-skills/payments-received/SKILL.md +315 -0
- package/bundled-skills/payroll-finance/SKILL.md +351 -0
- package/bundled-skills/people-directory/SKILL.md +459 -0
- package/bundled-skills/performance-management/SKILL.md +367 -0
- package/bundled-skills/petty-cash-management/SKILL.md +448 -0
- package/bundled-skills/policy-acknowledgement/SKILL.md +314 -0
- package/bundled-skills/policy-library/SKILL.md +327 -0
- package/bundled-skills/poster-design-studio/SKILL.md +259 -0
- package/bundled-skills/pre-boarding/SKILL.md +326 -0
- package/bundled-skills/presentation-deck/SKILL.md +491 -0
- package/bundled-skills/presentation-deck/references/related-skills.md +19 -0
- package/bundled-skills/presentation-deck/references/reusable-prompt.md +11 -0
- package/bundled-skills/probation-tracker/SKILL.md +347 -0
- package/bundled-skills/product-photo-studio/SKILL.md +259 -0
- package/bundled-skills/project-based-performance/SKILL.md +323 -0
- package/bundled-skills/projects-work-management/SKILL.md +368 -0
- package/bundled-skills/promotion-upgrade-requests/SKILL.md +377 -0
- package/bundled-skills/purchase-accounting/SKILL.md +414 -0
- package/bundled-skills/receipt-accounting/SKILL.md +424 -0
- package/bundled-skills/recognition-rewards/SKILL.md +324 -0
- package/bundled-skills/recruitment-pipeline/SKILL.md +399 -0
- package/bundled-skills/remote-work-tracker/SKILL.md +306 -0
- package/bundled-skills/repo-foundation/SKILL.md +166 -0
- package/bundled-skills/repo-foundation/references/LICENSE.md +21 -0
- package/bundled-skills/repo-foundation/references/bootstrap.md +63 -0
- package/bundled-skills/repo-foundation/references/companion.md +9 -0
- package/bundled-skills/repo-foundation/references/continuity.md +50 -0
- package/bundled-skills/repo-foundation/references/evolution.md +60 -0
- package/bundled-skills/repo-foundation/references/migration-examples.md +53 -0
- package/bundled-skills/repo-foundation/references/shared-contracts.md +48 -0
- package/bundled-skills/repo-foundation/references/verification.md +50 -0
- package/bundled-skills/repo-native-refactor/SKILL.md +225 -0
- package/bundled-skills/repo-native-refactor/references/LICENSE.md +21 -0
- package/bundled-skills/repo-native-refactor/references/deterministic-tooling.md +101 -0
- package/bundled-skills/repo-native-refactor/references/error-reliability.md +117 -0
- package/bundled-skills/repo-native-refactor/references/finding-taxonomy.md +181 -0
- package/bundled-skills/repo-native-refactor/references/refactor-examples.md +77 -0
- package/bundled-skills/repo-native-refactor/references/repository-prose.md +157 -0
- package/bundled-skills/repo-native-refactor/references/repository-rehabilitation.md +94 -0
- package/bundled-skills/repo-native-refactor/references/semantic-risk.md +187 -0
- package/bundled-skills/repo-native-refactor/references/shared-contracts.md +48 -0
- package/bundled-skills/repo-native-refactor/references/testing-integrity.md +103 -0
- package/bundled-skills/reports-analytics/SKILL.md +320 -0
- package/bundled-skills/salary-benchmarking/SKILL.md +318 -0
- package/bundled-skills/salary-wage-accounting/SKILL.md +412 -0
- package/bundled-skills/sales-accounting/SKILL.md +494 -0
- package/bundled-skills/sales-accounting/references/common-pitfalls.md +28 -0
- package/bundled-skills/sales-accounting/references/related-skills.md +13 -0
- package/bundled-skills/sales-accounting/references/reusable-prompt.md +8 -0
- package/bundled-skills/seo-directory-backlinks/SKILL.md +484 -0
- package/bundled-skills/seo-directory-backlinks/references/common-pitfalls.md +36 -0
- package/bundled-skills/seo-directory-backlinks/references/related-skills.md +15 -0
- package/bundled-skills/seo-directory-backlinks/references/reusable-prompt.md +11 -0
- package/bundled-skills/skill-gap-analysis/SKILL.md +338 -0
- package/bundled-skills/social-media-setup/SKILL.md +477 -0
- package/bundled-skills/social-media-setup/references/common-pitfalls.md +34 -0
- package/bundled-skills/social-media-setup/references/related-skills.md +19 -0
- package/bundled-skills/social-media-setup/references/reusable-prompt.md +11 -0
- package/bundled-skills/social-media-setup/references/security-safety-notes.md +27 -0
- package/bundled-skills/sop-company-wiki/SKILL.md +324 -0
- package/bundled-skills/source-document-filing/SKILL.md +368 -0
- package/bundled-skills/spreadsheet-manual-build/SKILL.md +493 -0
- package/bundled-skills/spreadsheet-manual-build/references/best-practices.md +9 -0
- package/bundled-skills/spreadsheet-manual-build/references/common-pitfalls.md +22 -0
- package/bundled-skills/spreadsheet-manual-build/references/related-skills.md +8 -0
- package/bundled-skills/spreadsheet-manual-build/references/reusable-prompt.md +9 -0
- package/bundled-skills/spreadsheet-manual-build/references/security-safety-notes.md +16 -0
- package/bundled-skills/stakeholder-investor-reports/SKILL.md +303 -0
- package/bundled-skills/suno-lyrics-to-song/SKILL.md +259 -0
- package/bundled-skills/talking-avatar-video/SKILL.md +260 -0
- package/bundled-skills/tax-register/SKILL.md +363 -0
- package/bundled-skills/tds-booking-payment/SKILL.md +405 -0
- package/bundled-skills/team-calendar/SKILL.md +312 -0
- package/bundled-skills/tech-writing-proofread/SKILL.md +78 -0
- package/bundled-skills/telegram/assets/boilerplate/nodejs/package-lock.json +3 -3
- package/bundled-skills/telegram/assets/boilerplate/nodejs/package.json +1 -0
- package/bundled-skills/template-library/SKILL.md +304 -0
- package/bundled-skills/time-tracking/SKILL.md +353 -0
- package/bundled-skills/typescript-expert/scripts/ts_diagnostic.py +40 -19
- package/bundled-skills/vendor-contractor-management/SKILL.md +327 -0
- package/bundled-skills/viral-video-teardown-remake/SKILL.md +260 -0
- package/bundled-skills/voice-cloning-studio/SKILL.md +260 -0
- package/bundled-skills/voiceover-narration-studio/SKILL.md +259 -0
- package/bundled-skills/whatsapp-cloud-api/assets/boilerplate/nodejs/package-lock.json +3 -3
- package/bundled-skills/whatsapp-cloud-api/assets/boilerplate/nodejs/package.json +1 -0
- package/bundled-skills/youtube-summarizer/SKILL.md +3 -3
- package/package.json +1 -1
- package/skills_index.json +254 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Evolution: adapting architecture and contracts
|
|
2
|
+
|
|
3
|
+
Use this reference when a task alters core contracts, architectural boundaries, or domain ownership, or when working in a repository with conflicting conventions.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Intentional contract changes vs. regressions
|
|
8
|
+
|
|
9
|
+
When requirements evolve, contracts must adapt. Tell intent apart from regression: an intentional change alters public API signatures, schemas, data models, or error codes because the user explicitly asked for new behavior. A regression is an unintended break in existing functionality.
|
|
10
|
+
Accept what the user requested. Don't fight explicit requests by forcing compatibility with deprecated behavior. Foundation and refactor work both accommodate authorized changes while preserving untouched contracts.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Blast radius assessment
|
|
15
|
+
|
|
16
|
+
Before mutating shared contracts, determine the blast radius:
|
|
17
|
+
|
|
18
|
+
1. **Identify callers and consumers:** Locate all internal modules, external consumers, database schemas, message queues, or serialized data structures affected by the change.
|
|
19
|
+
2. **Boundary scope:** Confirm whether the change can be completed within the authorized scope or if it requires updating multiple subsystem boundaries.
|
|
20
|
+
3. When all callers reside within the codebase and are under the current task's scope, update the contract, callers, and tests together (the atomic update). When consumers are external, persisted data must be migrated, or callers span multiple independent services, maintain a compatibility bridge, migration script, or dual-read/write strategy as requested (the transitional migration).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 3. Controlled migration workflow
|
|
25
|
+
|
|
26
|
+
Execute architectural adjustments in logical order:
|
|
27
|
+
|
|
28
|
+
1. **Update contract definitions:** Modify the authoritative interfaces, schemas, or type definitions first.
|
|
29
|
+
2. **Migrate callers:** Update calling code, dependency injection bindings, and data transformations to use the new contract.
|
|
30
|
+
3. **Align tests:** Update existing tests that assert the old contract so they verify the new behavior. Add tests covering edge cases and error semantics of the new contract.
|
|
31
|
+
4. **Synchronize documentation:** Update repository instructions, schema definitions, and API documentation to prevent stale instructions from misleading future agents.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 4. Reconciling conflicting repository conventions
|
|
36
|
+
|
|
37
|
+
In mature repositories, different modules often reflect different architectural eras or styles:
|
|
38
|
+
|
|
39
|
+
When patterns conflict, resolve using evidence hierarchy in order:
|
|
40
|
+
1. User's explicit instruction for the current task.
|
|
41
|
+
2. Documented architecture and repository instructions.
|
|
42
|
+
3. Preserved public contracts and persisted schemas.
|
|
43
|
+
4. Healthy sibling code within the *same* owning domain and runtime boundary.
|
|
44
|
+
5. Relevant tests, schemas, callers, and dependencies.
|
|
45
|
+
6. Local module conventions.
|
|
46
|
+
Do not rewrite healthy sibling code in another module merely to match your current change. Preserve legitimate domain-specific differences unless codebase-wide unification is explicitly requested; premature homogenization helps no one.
|
|
47
|
+
If existing code contains obvious workarounds or defects, do not replicate them in new code. Follow the healthiest precedent within the domain: defects never become precedent.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 5. Multi-pressure checklist
|
|
52
|
+
|
|
53
|
+
When migration, risk, docs, and workspace pressures stack (the usual evolution mess),
|
|
54
|
+
work in this order and do not skip steps:
|
|
55
|
+
|
|
56
|
+
1. Baseline: record revision, failing checks, and uncommitted user work.
|
|
57
|
+
2. Protect user work: distinct-region edits only; stop on real collision.
|
|
58
|
+
3. Reconcile docs against code reality before mutating (code describes behavior, docs get fixed after).
|
|
59
|
+
4. Highest-risk caller first with maximum conservatism; atomic path for the rest.
|
|
60
|
+
5. Rerun affected checks on the final tree; report what remains red and why.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Migration Examples (atomic vs transitional)
|
|
2
|
+
|
|
3
|
+
Read in Evolve mode when changing a public contract or persisted schema.
|
|
4
|
+
|
|
5
|
+
## Atomic replacement (preferred for single-node file state)
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
import os
|
|
9
|
+
import tempfile
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
def replace_file(dest: Path, new_bytes: bytes) -> None:
|
|
13
|
+
tmp = None
|
|
14
|
+
try:
|
|
15
|
+
with tempfile.NamedTemporaryFile(
|
|
16
|
+
mode="wb",
|
|
17
|
+
dir=dest.parent,
|
|
18
|
+
prefix=f".{dest.name}.",
|
|
19
|
+
suffix=".tmp",
|
|
20
|
+
delete=False,
|
|
21
|
+
) as file:
|
|
22
|
+
tmp = Path(file.name)
|
|
23
|
+
file.write(new_bytes)
|
|
24
|
+
file.flush()
|
|
25
|
+
os.fsync(file.fileno())
|
|
26
|
+
|
|
27
|
+
os.replace(tmp, dest)
|
|
28
|
+
finally:
|
|
29
|
+
if tmp is not None:
|
|
30
|
+
tmp.unlink(missing_ok=True)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Invariants: validate inputs + destination ownership before mutation; retain last valid
|
|
34
|
+
state until replacement succeeds. Stage on the destination filesystem with a unique
|
|
35
|
+
temporary name; close the file before replacement and clean up the temporary file on
|
|
36
|
+
success or failure. Verify successful replacement and preservation of the old state
|
|
37
|
+
when writing, syncing, or replacement fails.
|
|
38
|
+
This example addresses ordinary I/O failures. Power-loss durability and recovery after
|
|
39
|
+
forced termination require platform-specific guarantees and separate verification.
|
|
40
|
+
|
|
41
|
+
## Transitional compatibility (multi-caller migration)
|
|
42
|
+
|
|
43
|
+
Bad: change producer to `Decimal("5.00")` while callers expect `int 5` → hidden breakage.
|
|
44
|
+
Good:
|
|
45
|
+
1. Keep old readers working (accept `int | str | Decimal`, normalize internally).
|
|
46
|
+
2. Migrate callers one by one while preserving compatibility for remaining consumers.
|
|
47
|
+
3. Add contract and caller tests covering both surfaces during transition.
|
|
48
|
+
4. Remove compat shim only after all callers + docs updated.
|
|
49
|
+
|
|
50
|
+
## Docs sync checklist
|
|
51
|
+
|
|
52
|
+
- Update `README.md` + CLI help in the same diff as the contract change.
|
|
53
|
+
- Document only behavior implemented and verified in the delivered code state.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Shared contracts
|
|
2
|
+
|
|
3
|
+
These rules apply to repository development and review.
|
|
4
|
+
|
|
5
|
+
## 1. Strict contract adherence (canonical wording)
|
|
6
|
+
|
|
7
|
+
Preserve documented or demonstrably consumed public contracts across public interfaces,
|
|
8
|
+
exported parameters, module constants, return types, errors, and serialization.
|
|
9
|
+
|
|
10
|
+
- A requested behavior change may authorize a contract change only when that consequence
|
|
11
|
+
is clear from the task or from an authorized evolution. Then update affected callers,
|
|
12
|
+
tests, and living documentation within scope.
|
|
13
|
+
- Otherwise preserve exact declared types. For example, never substitute or wrap an exposed
|
|
14
|
+
primitive `str` path contract with `pathlib.Path` or custom wrapper objects merely for
|
|
15
|
+
internal convenience or preference.
|
|
16
|
+
- Internal intermediate representations may use appropriate helpers, provided all exposed
|
|
17
|
+
public contracts and types remain exact.
|
|
18
|
+
|
|
19
|
+
## 2. Evidence hierarchy (canonical order)
|
|
20
|
+
|
|
21
|
+
Use to guide investigation, not to auto-resolve material contradictions:
|
|
22
|
+
|
|
23
|
+
1. User requirements and explicitly authorized scope.
|
|
24
|
+
2. Documented architecture and repository guidelines.
|
|
25
|
+
3. Observable public contracts and persisted schemas.
|
|
26
|
+
4. Healthy sibling code within the same domain and runtime boundary.
|
|
27
|
+
5. Relevant tests, schemas, callers, and dependencies.
|
|
28
|
+
6. Dominant local conventions.
|
|
29
|
+
7. Language and runtime idioms.
|
|
30
|
+
8. Conservative, idiomatic defaults.
|
|
31
|
+
|
|
32
|
+
Never treat a temporary workaround, buggy sibling, or accidental pattern as precedent.
|
|
33
|
+
Never rewrite history or rubber-stamp code with stale notes. Reconcile before mutating
|
|
34
|
+
the affected contract.
|
|
35
|
+
|
|
36
|
+
## 3. Verification final-state rule (canonical)
|
|
37
|
+
|
|
38
|
+
- Record baseline failures as: (1) pre-existing outside scope, (2) in-scope to fix,
|
|
39
|
+
(3) regressions from current changes, (4) environment errors.
|
|
40
|
+
- Verify the final code state. Never use pre-cleanup results to certify modified code.
|
|
41
|
+
- Never claim a check ran when it did not. Distinguish verified behavior,
|
|
42
|
+
inspection-only conclusions, and unverified assumptions.
|
|
43
|
+
|
|
44
|
+
## 4. Shared judgment tests (canonical)
|
|
45
|
+
|
|
46
|
+
Two questions that both skills use when the text alone under-determines the answer.
|
|
47
|
+
|
|
48
|
+
A pattern counts as healthy precedent only if three things hold: code outside its original author consumes it, it does not contradict docs or contracts, and you would copy it into a new domain without apology. Popularity proves nothing; a workaround with tests and docs still fails. When two domains overlap, the owner is whoever owns the failure (who gets paged, who fixes the bug, whose reason to change fires first). Consolidate toward that owner, or leave both alone.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Verification: testing in proportion to risk
|
|
2
|
+
|
|
3
|
+
Use this reference when designing checks for greenfield projects, high-risk boundaries (auth, data loss, concurrency, migrations), or weak test suites.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Baseline failures and scope
|
|
8
|
+
|
|
9
|
+
Before or during initial execution, record baseline test failures and sort them:
|
|
10
|
+
|
|
11
|
+
1. Failures outside the current task's scope count as pre-existing. You don't need them green before starting, and don't fix unrelated ones just to green the baseline.
|
|
12
|
+
2. Failures inside the task's scope are in scope, such as a bugfix that starts with a failing test or repro script, and these are yours to resolve.
|
|
13
|
+
3. Regressions are previously passing checks your changes broke. Catch and fix them before declaring completion.
|
|
14
|
+
4. When checks can't run because of missing tools, dependencies, or setup, treat them as environment and tooling failures. Report them as environment limits, not code defects.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 2. Picking checks by risk
|
|
19
|
+
|
|
20
|
+
Match checks to the contract, boundary, and failure consequences. Don't mandate unit plus integration tests for every small helper, or unrelated checks (rollback tests for an auth change):
|
|
21
|
+
|
|
22
|
+
- Mechanical or local changes include typos, formatting, localized helper refactoring, and other non-semantic edits within established boundaries. For those, run stack linters, formatters, and localized unit tests.
|
|
23
|
+
- Contract and boundary changes modify public APIs, data formats, state machines, or subsystem contracts, so run tests that directly verify the updated contract and its callers.
|
|
24
|
+
- Changes touching authorization, permission checks, data migrations, cryptographic routines, concurrency locks, transaction boundaries, or destructive persistence carry high risk even when they touch only a single line, which calls for critical boundary vigilance. Verify the specific critical behavior (e.g., testing both authorized and unauthorized paths for auth changes; testing schema validity and rollback for migration scripts).
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 3. Greenfield and acceptance checks
|
|
29
|
+
|
|
30
|
+
When building new features or starting a repository from scratch:
|
|
31
|
+
|
|
32
|
+
- Keep environment checks separate from acceptance checks:
|
|
33
|
+
- *Environment / pre-existing checks:* toolchain, package manager, and build environment must work. These pass before feature work starts.
|
|
34
|
+
- *Acceptance checks for new capabilities:* the expected observable behavior of the new feature.
|
|
35
|
+
- For pre-build test states:
|
|
36
|
+
- An acceptance check for an unbuilt feature should detect the missing behavior when run in a valid environment.
|
|
37
|
+
- Tell apart a meaningful behavioral failure (endpoint 404s, CLI says unknown command, feature returns null) from an unrunnable test (syntax error, broken import, missing binary).
|
|
38
|
+
- Do not inject bugs, syntax errors, or failing stubs into test code just to force a failure.
|
|
39
|
+
- After implementing, acceptance checks must pass cleanly on the final code state. That is the evidence of completion.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 4. Testing integrity and final state
|
|
44
|
+
|
|
45
|
+
- For defect fixes, reproduce the failure first with a minimal reproduction such as a failing test, repro script, or observed command output, because a fix verified only after the fact is a guess with good lighting. For regression tests, prove red-green by reverting the fix, watching it fail, restoring it, and watching it pass.
|
|
46
|
+
- Check the external consequence of the action to assert observable outcomes, such as HTTP status code and body, database row contents, exit code and stdout/stderr, or rendered DOM elements.
|
|
47
|
+
- Expected values must reflect business requirements to keep outcomes independent, not mirror internal implementation logic.
|
|
48
|
+
- Never weaken tests to achieve a passing run by weakening assertion thresholds, deleting valid assertions, or skipping tests.
|
|
49
|
+
- Always verify the final tree by executing verification commands on the actual code state intended for delivery. If a subsequent refactoring pass or companion skill modifies code, rerun all affected checks on the updated code.
|
|
50
|
+
- Report actual results by stating exactly which commands were run, their outcomes, and any unverified areas.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: repo-native-refactor
|
|
3
|
+
description: "Review diffs without editing, or perform evidence-based cleanup while preserving authorized behavior, public contracts, and domain ownership."
|
|
4
|
+
category: development
|
|
5
|
+
risk: critical
|
|
6
|
+
source: https://github.com/Natchannnn/repository-engineering-skills
|
|
7
|
+
source_repo: Natchannnn/repository-engineering-skills
|
|
8
|
+
source_type: community
|
|
9
|
+
date_added: "2026-09-30"
|
|
10
|
+
author: Natchannnn
|
|
11
|
+
tags: [repository-engineering, code-review, refactoring, public-contracts]
|
|
12
|
+
tools: [codex]
|
|
13
|
+
license: MIT
|
|
14
|
+
license_source: https://github.com/Natchannnn/repository-engineering-skills/blob/e55b378158d5134a77af3b8dace4a2a1b17e41e2/LICENSE
|
|
15
|
+
metadata:
|
|
16
|
+
version: "0.3.0"
|
|
17
|
+
license: "MIT"
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Repo-native refactor
|
|
21
|
+
|
|
22
|
+
## When to Use
|
|
23
|
+
|
|
24
|
+
- Use when the user asks to review a diff, branch, or PR for correctness, contract breaks, or operational risk.
|
|
25
|
+
- Use when the user authorizes bounded cleanup before opening a PR or asks to consolidate duplicated policy with shared ownership.
|
|
26
|
+
- Use for repository rehabilitation only when the user explicitly requests work across multiple domains.
|
|
27
|
+
- Establish review-only, edit, or combined authority before choosing the operating mode.
|
|
28
|
+
|
|
29
|
+
Produce the smallest coherent change that belongs naturally in the target repository.
|
|
30
|
+
|
|
31
|
+
Prioritize in order:
|
|
32
|
+
1. **Correctness and security:** prevent regressions, avoid new security vulnerabilities, handle boundary conditions.
|
|
33
|
+
2. **Semantic integrity:** preserve existing invariants, state transitions, validation, and error boundaries.
|
|
34
|
+
3. **Contracts stay as declared:** the rule lives in `references/shared-contracts.md` §1. Preserve the authorized target contract; otherwise keep exact declared types. Internal helpers are fine when exposed contracts stay exact.
|
|
35
|
+
4. **Repository conformity:** match surrounding naming, domain conventions, and architectural precedents.
|
|
36
|
+
5. **Economy and simplicity:** minimal intervention. Delete dead weight, avoid premature abstractions.
|
|
37
|
+
|
|
38
|
+
This is a post-implementation audit and small cleanup skill. It is not permission to redesign the repository. Establish a concrete consequence such as inconsistent behavior, duplicated policy that must change together, unclear ownership, avoidable resource cost, or a demonstrated maintenance obstacle. Leave healthy code unchanged when the benefit is speculative.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Minimal intervention and evidence gate
|
|
43
|
+
|
|
44
|
+
- **Evidence-based intervention:** refactor only with concrete evidence of divergence, defect, or operational risk. If greenfield code or an additive diff is already minimal, idiomatic, and passing, leave it. A pattern you recognize is a candidate finding, not a reason to change anything.
|
|
45
|
+
- **Semantic DRY (Cost-benefit consolidation):** merge duplicated logic only when the copies share an owner, an invariant, and a reason to change, and only if merging saves more than it costs. Leave similar-looking checks in separate domains alone, and keep small local duplication when merging would obscure ownership.
|
|
46
|
+
- **Contract boundary protection:** preserve public interfaces, parameter names, and return types, except where the task clearly authorizes the change. During cleanup, keep the authorized target contract; don't revert to the old one.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Operating modes
|
|
51
|
+
|
|
52
|
+
- **Review vs. Refactor Authority:** first establish the outcome: findings, edits, or both. Review-only means inspection and verification, no source edits. Authorized cleanup allows bounded corrections; don't ask approval again for routine choices.
|
|
53
|
+
- **Change-set cleanup:** for a working tree, branch, commit range, feature, or bounded checkpoint. Work diff-first; read surrounding code only to understand ownership, contracts, and precedent.
|
|
54
|
+
- **Repository rehabilitation:** only when explicitly requested across multiple domains. Read [repository rehabilitation](references/repository-rehabilitation.md), build a short profile, and work in batches you can verify independently.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Evidence hierarchy
|
|
59
|
+
|
|
60
|
+
Use the evidence hierarchy to guide investigation, not to resolve material contradictions automatically. Reconcile conflicting requirements, documentation, callers, and tests before changing the affected contract. When repository patterns conflict, resolve in order:
|
|
61
|
+
1. User requirements and explicitly authorized scope.
|
|
62
|
+
2. Documented architecture and repository guidelines.
|
|
63
|
+
3. Observable public contracts and persisted schemas.
|
|
64
|
+
4. Healthy sibling code within the same domain and runtime boundary.
|
|
65
|
+
5. Relevant tests, schemas, callers, and dependencies.
|
|
66
|
+
6. Dominant local conventions.
|
|
67
|
+
7. Language and runtime idioms.
|
|
68
|
+
8. Conservative, idiomatic defaults.
|
|
69
|
+
|
|
70
|
+
Never treat a temporary workaround, buggy sibling, or accidental pattern as precedent.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Workflow
|
|
75
|
+
|
|
76
|
+
### 1. Establish scope and baseline
|
|
77
|
+
Before mutating code, identify:
|
|
78
|
+
- Comparison base and working-tree state.
|
|
79
|
+
- In-scope files vs. untouched user modifications.
|
|
80
|
+
- Existing verification commands and their current pass/fail status.
|
|
81
|
+
|
|
82
|
+
Differentiate pre-existing failures from regressions introduced by this pass. Never claim a check ran when it did not.
|
|
83
|
+
|
|
84
|
+
### 2. Establish intent, ownership, and preservation
|
|
85
|
+
Refactoring is behavior-preserving by default. Protect:
|
|
86
|
+
- Public APIs, serializations, and database schemas.
|
|
87
|
+
- Concurrency guarantees, idempotency, timeouts, and retries.
|
|
88
|
+
- Resource lifecycles (file handles, sockets, database transactions).
|
|
89
|
+
|
|
90
|
+
If a bug requires an observable change, classify and report it as an intentional behavioral correction rather than routine cleanup.
|
|
91
|
+
|
|
92
|
+
### 3. Inventory findings before rewriting
|
|
93
|
+
Inspect the authorized scope for:
|
|
94
|
+
- Validation or control flow whose structure obscures an invariant, creates inconsistent behavior, or duplicates the same owned policy.
|
|
95
|
+
- Misplaced domain ownership or leaky abstractions.
|
|
96
|
+
- Leaked unmanaged resources or missing atomic flush/sync calls.
|
|
97
|
+
- Unnecessary boilerplate, dead code, or commentary narrating syntax.
|
|
98
|
+
|
|
99
|
+
Read [finding taxonomy](references/finding-taxonomy.md) for complex cases. Establish the smallest adequate correction before editing.
|
|
100
|
+
|
|
101
|
+
### 4. Classify risk and refactor
|
|
102
|
+
Risk bands:
|
|
103
|
+
- **R0 - Mechanical:** Established formatter or locally provable cleanup.
|
|
104
|
+
- **R1 - Low Structural:** Local residue with straightforward test verification.
|
|
105
|
+
- **R2 - Contextual Structural:** Renames, control-flow changes, extraction of shared predicates.
|
|
106
|
+
- **R3 - Semantic:** Errors, fallbacks, retries, serialization, transactions, async, or lifecycles.
|
|
107
|
+
- **R4 - Critical Boundary:** Auth, permissions, crypto, data migrations, persistence durability.
|
|
108
|
+
|
|
109
|
+
Read [semantic risk](references/semantic-risk.md) for R2+ changes. Never mass-rewrite R3 or R4 behavior without explicit instructions and verified tests.
|
|
110
|
+
|
|
111
|
+
### 5. Audit code prose
|
|
112
|
+
- When prose is in scope, treat comments, docstrings, CLI output, and error messages as distinct surfaces. Read [repository prose](references/repository-prose.md) for that work.
|
|
113
|
+
- Delete comments that merely narrate obvious syntax or execution order.
|
|
114
|
+
- Preserve and tighten comments that explain non-obvious invariants, protocol quirks, rounding, or hardware workarounds.
|
|
115
|
+
- Never invent fictitious tickets, PR references, or production incident IDs.
|
|
116
|
+
|
|
117
|
+
### 6. Verify and review
|
|
118
|
+
- Run the smallest repository-native checks that meaningfully exercise the change. For R3/R4 changes or weak test suites, read [error and reliability boundaries](references/error-reliability.md) and [testing integrity](references/testing-integrity.md).
|
|
119
|
+
- Prioritize diff reviewability and coherence over raw line minimization; do not compress code into unreadable one-liners.
|
|
120
|
+
- Distinguish intentional behavioral corrections from mechanical cleanup.
|
|
121
|
+
- Review the final diff like a skeptical maintainer. Every line needs a reason. No contract changed without permission, no test got weaker, no dependency moved for nothing.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Reference routing
|
|
126
|
+
|
|
127
|
+
Read supporting references only when the corresponding trigger occurs:
|
|
128
|
+
|
|
129
|
+
- **[references/shared-contracts.md](references/shared-contracts.md):** Canonical contract + evidence hierarchy. Read when touching any public interface or reconciling conflicts.
|
|
130
|
+
- **[references/refactor-examples.md](references/refactor-examples.md):** R0–R4 good/bad diffs. Read before rewriting a candidate finding.
|
|
131
|
+
- **[references/finding-taxonomy.md](references/finding-taxonomy.md):** Read for complex multi-smell diffs to name owner + consequence.
|
|
132
|
+
- **[references/semantic-risk.md](references/semantic-risk.md):** Read for R2+ changes, justification gate, and stop conditions.
|
|
133
|
+
- **[references/repository-prose.md](references/repository-prose.md):** Read when editing comments, docstrings, CLI output, or error messages.
|
|
134
|
+
- **[references/error-reliability.md](references/error-reliability.md) + [references/testing-integrity.md](references/testing-integrity.md):** Read for R3/R4 or weak test suites.
|
|
135
|
+
- **[references/deterministic-tooling.md](references/deterministic-tooling.md):** Read before introducing new scanners or bulk-codemod tools.
|
|
136
|
+
- **[references/repository-rehabilitation.md](references/repository-rehabilitation.md):** Read only for explicitly requested multi-domain rehabilitation, in verifiable batches.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Hard stops
|
|
141
|
+
|
|
142
|
+
Do not force a refactor where intent, ownership, public-contract consequences, migration semantics, or concurrency behavior cannot be established. Do not guess between conflicting architectural patterns without evidence.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Completion Report
|
|
147
|
+
|
|
148
|
+
Scale the completion report to the change. Omit empty sections. Format completion concisely:
|
|
149
|
+
|
|
150
|
+
### Result
|
|
151
|
+
Use one: **Verified**, **Verified with caveats**, **Needs review**, or **Failed verification**.
|
|
152
|
+
|
|
153
|
+
For review-only requests, an empty findings list is a complete result, not an
|
|
154
|
+
embarrassing one. Never manufacture findings to fill a report: each reported
|
|
155
|
+
finding needs a producer, a consumer, and an observed consequence, or it is
|
|
156
|
+
not reported.
|
|
157
|
+
|
|
158
|
+
### Changed
|
|
159
|
+
Summarize material corrections by file and function.
|
|
160
|
+
|
|
161
|
+
### Preserved intentionally
|
|
162
|
+
Note specific patterns or contracts deliberately retained to avoid breaking downstream consumers.
|
|
163
|
+
|
|
164
|
+
### Verification
|
|
165
|
+
List exact verification commands executed and their outcomes.
|
|
166
|
+
|
|
167
|
+
### Residual uncertainty
|
|
168
|
+
Document unresolved limitations or high-risk boundaries intentionally deferred.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Examples
|
|
173
|
+
|
|
174
|
+
### Review without editing
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
Use repo-native-refactor to review this branch against main for public-contract
|
|
178
|
+
breaks and retry failures. Do not edit source files. Report only findings with
|
|
179
|
+
a concrete producer, consumer, and observable consequence.
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Inspect the comparison base and relevant callers, run proportionate verification,
|
|
183
|
+
and report evidence-backed findings. An empty findings list is a valid result.
|
|
184
|
+
|
|
185
|
+
### Consolidate one owned policy
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
Use repo-native-refactor to consolidate the duplicated eligibility checks owned
|
|
189
|
+
by this billing module. Preserve the current accepted inputs, error types, and
|
|
190
|
+
return values. Leave similar checks in other domains alone and run the module's tests.
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Confirm that the copies share an owner, invariant, and reason to change before
|
|
194
|
+
extracting anything. Keep the correction bounded and verify the final behavior.
|
|
195
|
+
|
|
196
|
+
## Limitations
|
|
197
|
+
|
|
198
|
+
- Review requires an identifiable comparison base and enough repository evidence to establish contracts and ownership.
|
|
199
|
+
- Similar syntax alone does not establish shared policy or justify consolidation.
|
|
200
|
+
- The skill cannot establish migration or concurrency safety without relevant requirements and verification; unresolved material uncertainty is a hard stop.
|
|
201
|
+
- Local checks and self-review do not establish independent review or universal reliability.
|
|
202
|
+
|
|
203
|
+
## Security & Safety Notes
|
|
204
|
+
|
|
205
|
+
Review-only mode permits inspection and verification without source edits. The
|
|
206
|
+
authorized cleanup mode can modify source files, so the declared risk is `critical`
|
|
207
|
+
under this collection's state-modification classification. Keep edits within the
|
|
208
|
+
user's authorized scope, preserve unrelated user changes, and apply the R3/R4
|
|
209
|
+
verification and stop conditions before changing sensitive behavior. Cleanup
|
|
210
|
+
authority does not authorize publishing, deploying, or changing external systems.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## When NOT to Use
|
|
215
|
+
|
|
216
|
+
- **Clean greenfield code:** Do not refactor newly written code that is already minimal, idiomatic, and passing all tests.
|
|
217
|
+
- **Speculative cleanup:** If you cannot state the domain owner and the concrete maintenance consequence in a single sentence, leave the code unmodified.
|
|
218
|
+
- **Risk classification:** When uncertain between risk bands (such as R2 structural vs. R3 semantic), default conservatively to the higher risk band and require explicit justification.
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
## Source & License
|
|
222
|
+
|
|
223
|
+
Adapted from [Natchannnn/repository-engineering-skills](https://github.com/Natchannnn/repository-engineering-skills/tree/e55b378158d5134a77af3b8dace4a2a1b17e41e2).
|
|
224
|
+
The original MIT copyright notice and license are retained in [references/LICENSE.md](references/LICENSE.md).
|
|
225
|
+
Collection adaptations add metadata, explicit triggers, interaction examples, limitations, and safety notes; the core workflow and supporting reference instructions are retained.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Natchannnn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Deterministic tooling policy
|
|
2
|
+
|
|
3
|
+
Use deterministic tools for problems they can reliably establish.
|
|
4
|
+
|
|
5
|
+
Examples:
|
|
6
|
+
|
|
7
|
+
- formatter;
|
|
8
|
+
- compiler;
|
|
9
|
+
- type checker;
|
|
10
|
+
- linter;
|
|
11
|
+
- dependency graph analysis;
|
|
12
|
+
- dead-code analysis;
|
|
13
|
+
- security scanning;
|
|
14
|
+
- AST/CST structural matching.
|
|
15
|
+
|
|
16
|
+
Tool output is evidence, not architectural authority.
|
|
17
|
+
|
|
18
|
+
## Project tools first
|
|
19
|
+
|
|
20
|
+
Prefer tools already configured by the repository.
|
|
21
|
+
|
|
22
|
+
Do not install a new slop scanner or refactoring dependency merely because this skill mentions one.
|
|
23
|
+
|
|
24
|
+
Use repository configuration when available.
|
|
25
|
+
|
|
26
|
+
## Structural search and rewrite
|
|
27
|
+
|
|
28
|
+
AST/CST tools are strong for locating syntactic patterns.
|
|
29
|
+
|
|
30
|
+
They do not prove semantic equivalence.
|
|
31
|
+
|
|
32
|
+
Regex and text search may locate prose candidates such as step narration, repeated docstrings, or section banners. They cannot determine whether a comment carries a contract, historical constraint, or operational rationale. Never auto-delete or rewrite prose solely from a phrase match, comment-density target, or AI-detector score.
|
|
33
|
+
|
|
34
|
+
`ast-grep` can display or interactively apply rewrites, while `--update-all/-U` accepts every matching rewrite without confirmation. Therefore unattended bulk application is appropriate only for transformations already classified as mechanically safe.
|
|
35
|
+
|
|
36
|
+
Do not bulk-rewrite:
|
|
37
|
+
|
|
38
|
+
- exception ownership;
|
|
39
|
+
- fallback behavior;
|
|
40
|
+
- retry;
|
|
41
|
+
- authorization;
|
|
42
|
+
- transaction semantics;
|
|
43
|
+
- unresolved type mismatches;
|
|
44
|
+
- async error behavior.
|
|
45
|
+
|
|
46
|
+
## Dead-code and dependency analysis
|
|
47
|
+
|
|
48
|
+
Unused-code tools build a model of repository reachability.
|
|
49
|
+
|
|
50
|
+
A reported unused file/export/dependency may reflect:
|
|
51
|
+
|
|
52
|
+
- missing entry points;
|
|
53
|
+
- dynamic imports;
|
|
54
|
+
- plugin registration;
|
|
55
|
+
- generated files;
|
|
56
|
+
- incomplete framework integration;
|
|
57
|
+
- analyzer configuration gaps.
|
|
58
|
+
|
|
59
|
+
Knip documentation explicitly describes these situations and recommends correcting module-graph/configuration understanding rather than blindly suppressing or deleting findings.
|
|
60
|
+
|
|
61
|
+
Before deletion:
|
|
62
|
+
|
|
63
|
+
1. determine why the analyzer considers the item unreachable;
|
|
64
|
+
2. check framework/runtime discovery;
|
|
65
|
+
3. check generated references;
|
|
66
|
+
4. verify entry/plugin configuration;
|
|
67
|
+
5. delete only when semantic ownership confirms it is dead.
|
|
68
|
+
|
|
69
|
+
## Suppression policy
|
|
70
|
+
|
|
71
|
+
Do not respond to surprising findings by immediately adding ignores or suppression.
|
|
72
|
+
|
|
73
|
+
First determine whether:
|
|
74
|
+
|
|
75
|
+
- the code is actually dead;
|
|
76
|
+
- analyzer configuration is incomplete;
|
|
77
|
+
- the tool does not model the framework behavior.
|
|
78
|
+
|
|
79
|
+
Suppression should document a known limitation, not hide unexplained evidence.
|
|
80
|
+
|
|
81
|
+
## Tool confidence
|
|
82
|
+
|
|
83
|
+
Classify findings:
|
|
84
|
+
|
|
85
|
+
**Confirmed:** tool result plus repository evidence agree.
|
|
86
|
+
|
|
87
|
+
**Probable:** tool result plausible but not fully established.
|
|
88
|
+
|
|
89
|
+
**Uncertain:** analyzer limitations or runtime behavior may invalidate it.
|
|
90
|
+
|
|
91
|
+
When two repository tools disagree, the dynamic-entry check (imports, plugin
|
|
92
|
+
registration, generated references, entry configuration) wins over static
|
|
93
|
+
reachability claims. A scanner cannot declare dead what the runtime can load.
|
|
94
|
+
|
|
95
|
+
Only confirmed findings should drive destructive automated changes.
|
|
96
|
+
|
|
97
|
+
## Prose diagnostics
|
|
98
|
+
|
|
99
|
+
Use deterministic prose scans only to build an inspection queue. A useful diagnostic reports location and pattern without asserting authorship or defect status.
|
|
100
|
+
|
|
101
|
+
Do not install an AI detector or generic slop scanner merely to approve a refactor. If such a tool already exists in repository workflow, treat its output as a secondary signal and require repository evidence before mutation.
|