phasegate 0.160.21 → 0.162.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/CHANGELOG.md +34 -0
- package/README.md +6 -1
- package/docs/contracts/requirement-test-matrix.schema.json +1 -1
- package/docs/guide/cli-reference.md +1 -1
- package/docs/guide/configuration.md +31 -1
- package/docs/guide/skills-overview.md +2 -0
- package/docs/principles/model-routing.md +1 -0
- package/docs/templates/personal/phasegate-local-config.json +4 -1
- package/docs/templates/project/phasegate.config.json +4 -1
- package/package.json +6 -3
- package/scripts/harness/agent-integration/domain/services/bash-write-target-extractor.ts +91 -23
- package/scripts/harness/agent-integration/domain/value-objects/protected-file-list.ts +4 -0
- package/scripts/harness/agent-integration/domain/value-objects/write-target-scope.ts +54 -5
- package/scripts/harness/agent-integration/infrastructure/adapters/ci-governance-baseline-grandfather-adapter.ts +25 -2
- package/scripts/harness/agent-integration/infrastructure/adapters/phase-gate-query-adapter.ts +17 -2
- package/scripts/harness/biome-ast-engine/domain/value-objects/import-graph.ts +28 -1
- package/scripts/harness/config-foundation/application/mappers/validator-system-config-mapper.ts +6 -1
- package/scripts/harness/config-foundation/domain/harness-config.ts +10 -0
- package/scripts/harness/config-foundation/domain/services/preset-resolution-service.ts +2 -0
- package/scripts/harness/config-foundation/domain/value-objects/l3-config.ts +4 -0
- package/scripts/harness/config-foundation/domain/value-objects/layers-config.ts +1 -1
- package/scripts/harness/config-foundation/domain/value-objects/project-config.ts +20 -5
- package/scripts/harness/config-foundation/infrastructure/presets/minimal.json +2 -1
- package/scripts/harness/config-foundation/infrastructure/presets/standard.json +2 -1
- package/scripts/harness/config-foundation/infrastructure/presets/strict.json +2 -1
- package/scripts/harness/config-foundation/infrastructure/schemas/harness-config-v2.schema.json +39 -9
- package/scripts/harness/config-foundation/infrastructure/schemas/harness-config-v3.schema.json +39 -9
- package/scripts/harness/harness-api/infrastructure/adapters/phase-dependency-model-query-adapter.ts +18 -4
- package/scripts/harness/harness-api/infrastructure/adapters/validator-system-execution-adapter.ts +27 -4
- package/scripts/harness/installation/application/ports/model-delegation-port.ts +10 -0
- package/scripts/harness/installation/application/usecases/run-install.ts +67 -5
- package/scripts/harness/installation/application/usecases/run-reconcile.ts +53 -5
- package/scripts/harness/installation/composition-root.ts +4 -2
- package/scripts/harness/installation/infrastructure/adapters/skill-deployer-model-delegation-adapter.ts +16 -0
- package/scripts/harness/installation/presentation/cli/install-handler.ts +2 -1
- package/scripts/harness/main.ts +99 -13
- package/scripts/harness/nyquist-validation/application/dto/generate-matrix-output.ts +9 -7
- package/scripts/harness/nyquist-validation/domain/services/matrix-validation-service.ts +27 -2
- package/scripts/harness/nyquist-validation/domain/services/requirement-intent-coverage-service.ts +4 -4
- package/scripts/harness/nyquist-validation/domain/value-objects/intent-coverage.ts +33 -0
- package/scripts/harness/nyquist-validation/infrastructure/adapters/markdown-requirement-source-adapter.ts +3 -1
- package/scripts/harness/quick-mode/application/usecases/classify-change-category-usecase.ts +8 -3
- package/scripts/harness/quick-mode/composition-root.ts +3 -0
- package/scripts/harness/quick-mode/domain/value-objects/quick-mode-config.ts +6 -1
- package/scripts/harness/quick-mode/infrastructure/adapters/validator-system-quick-mode-execution-adapter.ts +18 -0
- package/scripts/harness/quick-mode/presentation/handlers/ci-check-quick-mode-handler.ts +51 -5
- package/scripts/harness/setup/skill-deployer.ts +47 -0
- package/scripts/harness/skill-quality/domain/services/skill-structure-validator.ts +21 -0
- package/scripts/harness/skill-quality/domain/value-objects/skill-structure.ts +2 -0
- package/scripts/harness/skill-quality/infrastructure/adapters/l1-biome-validator-adapter.ts +12 -2
- package/scripts/harness/skill-quality/infrastructure/adapters/l2-validator-system-adapter.ts +12 -2
- package/scripts/harness/traceability-model/application/usecases/apply-work-item-status-usecase.ts +6 -1
- package/scripts/harness/traceability-model/infrastructure/parsers/story-catalog-parser.ts +28 -9
- package/scripts/harness/validator-system/application/use-cases/run-l3-validators-usecase.ts +76 -25
- package/scripts/harness/validator-system/application/use-cases/run-l4-validators-usecase.ts +20 -8
- package/scripts/harness/validator-system/composition-root.ts +8 -1
- package/scripts/harness/validator-system/domain/ports/validator-config-port.ts +2 -0
- package/scripts/harness/validator-system/domain/services/validator-language-capability-service.ts +64 -0
- package/scripts/harness/validator-system/infrastructure/adapters/file-system-security-pattern-scanner-adapter.ts +16 -6
- package/scripts/harness/validator-system/infrastructure/adapters/file-system-work-item-reflection-adapter.ts +10 -1
- package/scripts/harness/validator-system/infrastructure/adapters/harness-config-validator-config-adapter.ts +7 -1
- package/scripts/harness/validator-system/infrastructure/adapters/import-graph-source-analysis-adapter.ts +35 -3
- package/scripts/harness/validator-system/infrastructure/adapters/nyquist-ac-coverage-policy-adapter.ts +86 -14
- package/scripts/harness/validator-system/infrastructure/adapters/phase-dependency-phase-gate-policy-adapter.ts +29 -3
- package/skills/cascade-updater/SKILL.md +1 -0
- package/skills/codebase-mapper/SKILL.md +1 -0
- package/skills/codex-delegator/SKILL.md +1 -0
- package/skills/consistency-checker/SKILL.md +1 -0
- package/skills/doc-freshness-checker/SKILL.md +1 -0
- package/skills/domain-designer/SKILL.md +1 -0
- package/skills/engineering-perspective/SKILL.md +1 -0
- package/skills/environment-designer/SKILL.md +1 -0
- package/skills/implementation-planner/SKILL.md +1 -0
- package/skills/implementation-readiness-checker/SKILL.md +1 -0
- package/skills/it-test-designer/SKILL.md +1 -0
- package/skills/it-test-logic-designer/SKILL.md +1 -0
- package/skills/logical-designer/SKILL.md +1 -0
- package/skills/mock-designer/SKILL.md +1 -0
- package/skills/phasegate-config-doctor/SKILL.md +1 -0
- package/skills/phasegate-toolkit-guide/SKILL.md +1 -0
- package/skills/pointer-validator/SKILL.md +1 -0
- package/skills/product-architect/SKILL.md +1 -0
- package/skills/quick-implementor/SKILL.md +1 -0
- package/skills/scenario-test-designer/SKILL.md +1 -0
- package/skills/scenario-test-logic-designer/SKILL.md +1 -0
- package/skills/skill-creator/SKILL.md +1 -0
- package/skills/story-implementor/SKILL.md +1 -0
- package/skills/story-mapper/SKILL.md +1 -0
- package/skills/story-writer/SKILL.md +1 -0
- package/skills/test-coverage-checker/SKILL.md +1 -0
- package/skills/uiux-designer/SKILL.md +1 -0
- package/skills/unit-designer/SKILL.md +1 -0
- package/skills/unit-test-designer/SKILL.md +1 -0
- package/skills/unit-test-logic-designer/SKILL.md +1 -0
- package/templates/.claude/scripts/deny-check.sh +73 -12
- package/templates/.claude/settings.json +4 -0
|
@@ -3,6 +3,7 @@ name: doc-freshness-checker
|
|
|
3
3
|
description: 設計文書の鮮度チェック(L4バリデータ拡張)。`phasegate check-freshness` CLIを使い、設計文書の最終更新日が閾値を超えていないか、コード変更と設計文書の乖離がないかを検出する。使用タイミング: 「設計文書が古くなっていないか確認して」「ドキュメントの鮮度チェックを実行して」「L4 freshness チェック」「設計とコードの乖離を調べて」など。
|
|
4
4
|
model: sonnet
|
|
5
5
|
review: opus
|
|
6
|
+
languages: [typescript]
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Doc Freshness Checker
|
|
@@ -3,6 +3,7 @@ name: implementation-planner
|
|
|
3
3
|
description: "Unit仕様とドメインモデル設計を元に実装計画を立てる。WI IDや機能名から関連Unitを特定し、API設計・レイヤー別実装方針を整理してmdファイルで出力する。使用タイミング: 実装計画を立てて、WI-XXXの実装方針を決めて、この機能の設計を整理して、など実装前の計画策定時。"
|
|
4
4
|
model: sonnet
|
|
5
5
|
review: opus
|
|
6
|
+
languages: [typescript]
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Implementation Planner
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: phasegate-config-doctor
|
|
3
3
|
description: 現在の phasegate.config.json を schema + プロジェクト検出結果と突き合わせて改善提案する診断スキル。read-only Q&A の phasegate-toolkit-guide とは異なり、設定変更を伴う相談に応える。使用タイミング:「phasegate のセットアップを最適化して」「architecture preset 入ってないけど何が適切?」「Quick Mode の relaxedGates に推奨設定教えて」「baseline 有効化しても大丈夫?」「monorepo に対して targetDirs / formatter が正しく検出されてる?」「v2 schema warning が出る、何を直せばいい?」など、現状 config の診断と改善 diff 提案を求める質問。
|
|
4
|
+
languages: [typescript]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Phasegate Config Doctor
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: phasegate-toolkit-guide
|
|
3
3
|
description: phasegate ツールキット自体に関する Q&A スキル。ユーザーが phasegate の概念 (L0-L4 レイヤーモデル / 防御プリセット / アーキプリセット / Quick Mode と Full Mode / Hook 仕様 / config 全般) について質問したとき、対応する canonical doc を読み込んでから回答する。使用タイミング:「phasegate の L1 と L2 の違いは?」「Quick Mode で許可されるカテゴリを増やしたい」「architecture.preset の使い分けは?」「phasegate の hook って何が動いている?」「phasegate.config.json の relaxedGates は何のため?」など phasegate ツールキット内部の仕様・設定を尋ねる質問。
|
|
4
|
+
languages: [typescript]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Phasegate Toolkit Guide
|
|
@@ -3,6 +3,7 @@ name: pointer-validator
|
|
|
3
3
|
description: 設計文書内のファイルポインタ(相対パス参照)の有効性を検証するスキル(L4バリデータ拡張)。`phasegate validate-pointers` CLIを使い、ドキュメント内で参照されているファイルパスが実際に存在するかチェックする。使用タイミング: 「ドキュメントのリンク切れを確認して」「ポインタ検証を実行して」「broken pointer を探して」「設計文書の参照が正しいか確認して」など。
|
|
4
4
|
model: sonnet
|
|
5
5
|
review: opus
|
|
6
|
+
languages: [typescript]
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Pointer Validator
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: quick-implementor
|
|
3
3
|
description: Quick Mode下でのad-hoc実装スキル。story-implementorの緩和版。バグ修正・ドキュメント修正・テスト追加・設定変更など軽微な変更に使用。L1全維持、L2はphase-gate緩和、L3はsecurityのみ、L4スキップ。使用タイミング: 「Quick Modeで修正して」「バグ修正して」「テスト追加して」「設定変更して」「ドキュメント修正して」など、フルハーネスが過剰な軽微変更時。除外: 新機能追加、API契約変更、新ドメインモデル追加にはstory-implementorを使用すること。
|
|
4
|
+
languages: [typescript]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Quick Implementor
|
|
@@ -4,14 +4,33 @@
|
|
|
4
4
|
# Reads JSON from stdin, exits with code 2 to block dangerous commands.
|
|
5
5
|
# Deny patterns are read from .claude/settings.json permissions.deny.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
# Debug logging is OFF by default to avoid leaking command contents to a
|
|
8
|
+
# world-readable file. Set CLAUDE_DENY_CHECK_DEBUG=1 to enable. When enabled,
|
|
9
|
+
# the log is created with restrictive (owner-only) permissions.
|
|
10
|
+
DEBUG_LOG="${CLAUDE_DENY_CHECK_DEBUG_LOG:-$HOME/.cache/claude/deny-check-debug.log}"
|
|
11
|
+
|
|
12
|
+
debug_log() {
|
|
13
|
+
if [[ "$CLAUDE_DENY_CHECK_DEBUG" == "1" ]]; then
|
|
14
|
+
local dir
|
|
15
|
+
dir=$(dirname "$DEBUG_LOG")
|
|
16
|
+
mkdir -p "$dir" 2>/dev/null || return 0
|
|
17
|
+
# Restrict permissions before writing anything sensitive.
|
|
18
|
+
( umask 077; touch "$DEBUG_LOG" 2>/dev/null ) || return 0
|
|
19
|
+
chmod 600 "$DEBUG_LOG" 2>/dev/null || true
|
|
20
|
+
printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$1" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
21
|
+
fi
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
debug_log "deny-check.sh started"
|
|
9
25
|
|
|
10
26
|
INPUT_JSON=$(cat)
|
|
11
|
-
|
|
27
|
+
debug_log "input received (${#INPUT_JSON} bytes)"
|
|
12
28
|
|
|
29
|
+
# Fail CLOSED: without jq we cannot parse the deny policy, so deny the command
|
|
30
|
+
# rather than silently allowing it.
|
|
13
31
|
if ! command -v jq &> /dev/null; then
|
|
14
|
-
|
|
32
|
+
echo "Security policy: jq is required to evaluate the deny policy but was not found; command blocked." >&2
|
|
33
|
+
exit 2
|
|
15
34
|
fi
|
|
16
35
|
|
|
17
36
|
TOOL_NAME=$(echo "$INPUT_JSON" | jq -r '.tool_name // empty')
|
|
@@ -43,13 +62,55 @@ if [[ ${#DENY_PATTERNS[@]} -eq 0 ]]; then
|
|
|
43
62
|
exit 0
|
|
44
63
|
fi
|
|
45
64
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
# Split a shell command line into individual command segments so that denied
|
|
66
|
+
# commands smuggled behind chaining/grouping/substitution operators are still
|
|
67
|
+
# inspected. Operators handled: ; && || | & newline $( ) ` { } ( )
|
|
68
|
+
# We replace each operator with a newline, then treat each line as a segment.
|
|
69
|
+
split_command_segments() {
|
|
70
|
+
local cmd="$1"
|
|
71
|
+
# Order matters: multi-char operators first.
|
|
72
|
+
cmd=${cmd//&&/$'\n'}
|
|
73
|
+
cmd=${cmd//||/$'\n'}
|
|
74
|
+
cmd=${cmd//|/$'\n'}
|
|
75
|
+
cmd=${cmd//;/$'\n'}
|
|
76
|
+
cmd=${cmd//&/$'\n'}
|
|
77
|
+
cmd=${cmd//\$(/$'\n'}
|
|
78
|
+
cmd=${cmd//\`/$'\n'}
|
|
79
|
+
cmd=${cmd//(/$'\n'}
|
|
80
|
+
cmd=${cmd//)/$'\n'}
|
|
81
|
+
cmd=${cmd//\{/$'\n'}
|
|
82
|
+
cmd=${cmd//\}/$'\n'}
|
|
83
|
+
# Trailing newline ensures the final segment is emitted as a complete line
|
|
84
|
+
# so that `while read` does not drop an unterminated last segment.
|
|
85
|
+
printf '%s\n' "$cmd"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
# Convert a settings glob pattern to an anchored regex. ALL '*' become '.*'.
|
|
89
|
+
glob_to_regex() {
|
|
90
|
+
printf '%s' "$1" | sed 's/\*/.*/g'
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
check_segment() {
|
|
94
|
+
local segment="$1"
|
|
95
|
+
# Strip leading whitespace so "^pattern" anchors match after operators.
|
|
96
|
+
segment="${segment#"${segment%%[![:space:]]*}"}"
|
|
97
|
+
[[ -z "$segment" ]] && return 0
|
|
98
|
+
for pattern in "${DENY_PATTERNS[@]}"; do
|
|
99
|
+
local regex_pattern
|
|
100
|
+
regex_pattern=$(glob_to_regex "$pattern")
|
|
101
|
+
if printf '%s' "$segment" | grep -E "^$regex_pattern" &>/dev/null; then
|
|
102
|
+
debug_log "BLOCKED segment '$segment' matches '$pattern'"
|
|
103
|
+
echo "Security policy violation: command segment '$segment' is denied by pattern '$pattern'" >&2
|
|
104
|
+
exit 2
|
|
105
|
+
fi
|
|
106
|
+
done
|
|
107
|
+
return 0
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# Inspect the whole command AND each chained/substituted segment.
|
|
111
|
+
check_segment "$COMMAND"
|
|
112
|
+
while IFS= read -r segment; do
|
|
113
|
+
check_segment "$segment"
|
|
114
|
+
done < <(split_command_segments "$COMMAND")
|
|
54
115
|
|
|
55
116
|
exit 0
|