golang-refactoring
Refactor Go Code with Tests and Human Review
Large Go refactors can break callers, hide behavior changes, and create conflicting pull requests. This skill guides tool-driven changes with targeted tests and staged human review.
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "golang-refactoring" from https://skillstore.io/skills/samber-golang-refactoring.md and its manifest at https://skillstore.io/api/skills/samber-golang-refactoring/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「golang-refactoring」。 Plan extracting validation from a long order-processing function with limited tests.
預期結果:
- Assessment: affected validation paths need characterization tests before extraction.
- Plan: capture current success and failure results, then extract only the validation responsibility.
- Verification: review the extraction diff and run build, vet, and targeted tests.
- Checkpoint: obtain approval before editing; keep behavior changes outside this refactor.
正在使用「golang-refactoring」。 Plan moving a public invoice type into a billing package without breaking callers.
預期結果:
- Assessment: inspect callers, package dependencies, exported methods, and reflection-sensitive uses.
- Stage one: introduce the type in the destination and preserve the old name through a compatibility alias.
- Stage two: migrate callers incrementally in reviewed pull requests.
- Stage three: remove the deprecated alias only after reference checks and the required compatibility review.
安全審計
安全All 52 static findings are false positives involving Markdown formatting, documentation links, Go examples, or legitimate refactoring tools. No evidence found of malicious prompt injection, credential theft, or unauthorized data transfer in the six reviewed files. Tool installation, repository edits, test execution, and pull request creation remain operational actions requiring appropriate permissions and review.
風險因素
⚡ 包含腳本 (1)
⚙️ 外部命令 (31)
🌐 網路存取 (2)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/samber-golang-refactoring/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/samber-golang-refactoring?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/samber-golang-refactoring?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/samber-golang-refactoring/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/samber-golang-refactoring.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
samber. (2026). golang-refactoring security audit report (audit version 1) [Author version 1.1.1]. Skillstore. https://skillstore.io/skills/samber-golang-refactoring/audits/1BibTeX 引用
@techreport{samber-samber-golang-refactoring-2026,
author = {samber},
title = {golang-refactoring security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/samber-golang-refactoring/audits/1},
note = {Author version 1.1.1}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "golang-refactoring security audit report (audit version 1)"
version: "1.1.1"
type: report
authors:
- name: "samber"
date-released: "2026-10-18"
url: "https://skillstore.io/skills/samber-golang-refactoring/audits/1"
identifiers:
- type: other
value: "skillstore:samber-golang-refactoring:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore 評分
評分依據 證據置信度: 中你可以打造什麼
Split an Overgrown Function
Assess affected code, add missing tests, and extract a focused helper without combining the change with a feature.
Migrate a Shared Package
Plan compatibility aliases, caller migration, dependency ordering, and staged reviews for a type moved between packages.
Coordinate a Multi-Step Refactor
Build a change inventory, isolate worktrees, and schedule independent pull requests without parallelizing overlapping symbol edits.
試試這些提示
Inspect [symbol] and propose a safe rename to [new name]. Identify references, reflection risks, and verification steps. Wait for approval before editing.
Plan extracting [responsibility] from [function]. Measure affected coverage, propose missing tests, and choose a gopls action. Present the plan before changing code.
Plan moving [type] from [old package] to [new package]. Include aliases, import-cycle checks, external caller risks, and incremental migration checkpoints.
Create an inventory for [refactoring goal]. Classify risk and structural versus behavioral changes. Order dependencies, identify parallel work, and define tests and approval gates.
最佳實務
- Approve a refactoring inventory before editing and request new approval when the scope or risk changes.
- Measure coverage on affected paths and add characterization tests before restructuring poorly tested code.
- Keep each change atomic, inspect tool-generated diffs, and verify build, tests, reflection-sensitive references, and relevant benchmarks.
避免
- Mixing a rename or package move with a bug fix or feature in the same pull request.
- Running a workspace-wide rename concurrently with other changes that could touch the same symbols.
- Treating passing tests or a mechanical rewrite as proof that reflection, external consumers, and security behavior remain unchanged.
常見問題
Which AI tools can use this skill?
What dependencies are required?
Can it refactor code without tests?
Does gopls guarantee every change is safe?
How does it handle public type moves?
Does the workflow merge changes automatically?
開發者詳細資訊
作者
samber授權
MIT
作者版本
v1.1.1
Skillstore 修訂
r1
引用
cfb259a07b8f54bbd5254a63daaa42c5bab0ff20
維護新鮮度
2026/10/18
使用量
0 次下載 · 0 次瀏覽
檔案結構