Skip to content

feat(guardrails): アンチパターン10件のガードを実装 - #285

Merged
terisuke merged 12 commits into
devfrom
anti-pattern-guards
Aug 3, 2026
Merged

feat(guardrails): アンチパターン10件のガードを実装#285
terisuke merged 12 commits into
devfrom
anti-pattern-guards

Conversation

@terisuke

@terisuke terisuke commented Aug 3, 2026

Copy link
Copy Markdown

Summary

  • Issue feat(guardrails): implement 8 anti-pattern guards in profile (plugin/command/permission/skill) #284 / ADR specs/ai-guardrails-anti-patterns.md に基づき、パターン A〜J を packages/guardrails/profile/ の仕組み(plugin / permission / command / skill)と CI 層化で実装
  • upstream/dev を取り込み済み(workflows は fork 側を維持しつつ paths 層化を追加)
  • 各ガードに 反証OPENCODE_*_GUARD=off で危険操作が通る)と 過剰制限しない陰性テスト(読み取り git / high ワード非発火 / 権限対称)を同梱

実装対応

パターン 手段
A removal-guard.tsgit rm / git add -A の逆被参照ブロック
B / I opencode.json + implement の読み取り git allow / force-push deny、対称性テスト
C / G /plan-light + lean-pipeline skill
D /env-check
E hygiene-warning.ts + /repo-hygiene
F / H falsifiable-change / self-check skills
A (skill) impact-analysis
J test/typecheck/nix-eval の docs skip + docs-lint.yml + ci-change-scope.ts

Test plan

  • cd packages/opencode && bun test test/plugin/anti-pattern-guards.test.ts(19 pass)
  • 既存 guardrail*.test.ts green
  • bun run local:deploy / bun run local:check green
  • ライブ反証: ガード ON で参照付き git rm ブロック、OPENCODE_REMOVAL_GUARD=off で通過
  • CI: 本 PR(guardrails 変更)はフル CI、docs-only は docs-lint のみになることを確認

Closes #284

Made with Cursor

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

The following comment was made by an LLM, it may be inaccurate:

@terisuke
terisuke merged commit 47e1442 into dev Aug 3, 2026
9 checks passed
@terisuke
terisuke deleted the anti-pattern-guards branch August 3, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(guardrails): implement 8 anti-pattern guards in profile (plugin/command/permission/skill)

6 participants