ai-developer-skill-os 10.1.0 → 10.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.
Files changed (98) hide show
  1. package/.agents/AGENTS.md +13 -0
  2. package/.agents/LICENSE +21 -21
  3. package/.agents/docs/ARCHITECTURE.md +56 -120
  4. package/.agents/docs/GOVERNANCE.md +3 -3
  5. package/.agents/docs/SPEC.md +137 -60
  6. package/.agents/docs/VERSIONING.md +25 -57
  7. package/.agents/docs/adr/0005-v10-platform-consolidation.md +50 -0
  8. package/.agents/docs/schemas/learning.schema.yml +22 -57
  9. package/.agents/docs/schemas/skill.schema.yml +116 -161
  10. package/.agents/docs/schemas/workflow.schema.yml +51 -26
  11. package/.agents/docs/skill-classification.md +1 -1
  12. package/.agents/registry/graph.json +171 -77
  13. package/.agents/registry/index.yaml +68 -35
  14. package/.agents/rules/coding.md +1 -1
  15. package/.agents/rules/command-safety.md +1 -1
  16. package/.agents/rules/global.md +1 -1
  17. package/.agents/rules/prompt-compiler.md +1 -1
  18. package/.agents/rules/safety.md +1 -1
  19. package/.agents/rules/security.md +1 -1
  20. package/.agents/rules/skill-quality.md +18 -3
  21. package/.agents/skills/_template/SKILL.md +238 -88
  22. package/.agents/skills/qk-api-data-discovery/SKILL.md +176 -190
  23. package/.agents/skills/qk-api-data-discovery/references/bronze-record-format.md +47 -0
  24. package/.agents/skills/qk-api-data-discovery/references/data-contract-yaml.md +72 -0
  25. package/.agents/skills/qk-api-data-discovery/references/discovery-report-template.md +110 -0
  26. package/.agents/skills/qk-backend-data/SKILL.md +150 -1
  27. package/.agents/skills/qk-bug-resolution/SKILL.md +153 -1
  28. package/.agents/skills/qk-bug-resolution/evals/scorecard.yaml +1 -1
  29. package/.agents/skills/qk-code-cleaner/SKILL.md +150 -1
  30. package/.agents/skills/qk-code-review/SKILL.md +195 -1
  31. package/.agents/skills/qk-code-review/evals/scorecard.yaml +1 -1
  32. package/.agents/skills/qk-code-review/references/ai/{v8-schema-validation.md → schema-validation.md} +2 -2
  33. package/.agents/skills/qk-code-review/references/cross-cutting/async-concurrency-patterns.md +515 -515
  34. package/.agents/skills/qk-code-review/references/cross-cutting/error-handling-principles.md +492 -492
  35. package/.agents/skills/qk-code-review/references/cross-cutting/n-plus-one-queries.md +309 -309
  36. package/.agents/skills/qk-code-review/references/cross-cutting/sql-injection-prevention.md +307 -307
  37. package/.agents/skills/qk-code-review/references/cross-cutting/xss-prevention.md +263 -263
  38. package/.agents/skills/qk-code-review/references/languages/angular.md +768 -768
  39. package/.agents/skills/qk-code-review/references/languages/c.md +890 -890
  40. package/.agents/skills/qk-code-review/references/languages/cpp.md +893 -893
  41. package/.agents/skills/qk-code-review/references/languages/css-less-sass.md +661 -661
  42. package/.agents/skills/qk-code-review/references/languages/django.md +985 -985
  43. package/.agents/skills/qk-code-review/references/languages/fastapi.md +580 -580
  44. package/.agents/skills/qk-code-review/references/languages/go.md +993 -993
  45. package/.agents/skills/qk-code-review/references/languages/java.md +409 -409
  46. package/.agents/skills/qk-code-review/references/languages/java8.md +586 -586
  47. package/.agents/skills/qk-code-review/references/languages/kotlin.md +1018 -1018
  48. package/.agents/skills/qk-code-review/references/languages/nestjs.md +593 -593
  49. package/.agents/skills/qk-code-review/references/languages/php.md +684 -684
  50. package/.agents/skills/qk-code-review/references/languages/python.md +1073 -1073
  51. package/.agents/skills/qk-code-review/references/languages/qt.md +757 -757
  52. package/.agents/skills/qk-code-review/references/languages/react.md +871 -871
  53. package/.agents/skills/qk-code-review/references/languages/ruby.md +964 -964
  54. package/.agents/skills/qk-code-review/references/languages/rust.md +846 -846
  55. package/.agents/skills/qk-code-review/references/languages/svelte.md +1064 -1064
  56. package/.agents/skills/qk-code-review/references/languages/swift.md +936 -936
  57. package/.agents/skills/qk-code-review/references/languages/typescript.md +1016 -1016
  58. package/.agents/skills/qk-code-review/references/languages/vue.md +924 -924
  59. package/.agents/skills/qk-code-review/references/languages/zig.md +440 -440
  60. package/.agents/skills/qk-devops-release/SKILL.md +150 -1
  61. package/.agents/skills/qk-feature-delivery/SKILL.md +153 -1
  62. package/.agents/skills/qk-feature-delivery/evals/scorecard.yaml +1 -1
  63. package/.agents/skills/qk-orchestrator/SKILL.md +187 -2
  64. package/.agents/skills/qk-orchestrator/evals/scorecard.yaml +1 -1
  65. package/.agents/skills/qk-orchestrator/references/routing-table.md +1 -1
  66. package/.agents/skills/qk-product-spec/SKILL.md +150 -1
  67. package/.agents/skills/qk-prompt-compiler/SKILL.md +188 -65
  68. package/.agents/skills/qk-ui-engineer/SKILL.md +150 -1
  69. package/.agents/workflows/_schema.yml +146 -146
  70. package/.agents/workflows/bug-resolution.yml +155 -121
  71. package/.agents/workflows/code-review.yml +127 -93
  72. package/.agents/workflows/context-discovery.yml +128 -94
  73. package/.agents/workflows/documentation.yml +124 -90
  74. package/.agents/workflows/feature-delivery.yml +158 -124
  75. package/.agents/workflows/production-release.yml +207 -173
  76. package/.agents/workflows/prompt-compilation.yml +126 -0
  77. package/.agents/workflows/refactor.yml +136 -102
  78. package/.agents/workflows/security-audit.yml +149 -115
  79. package/.agents/workflows/shared/quality-gate.yml +3 -1
  80. package/.agents/workflows/skin-governance.yml +149 -115
  81. package/.agents/workflows/spec-driven-development.yml +78 -71
  82. package/CHANGELOG.md +61 -0
  83. package/README.md +3 -3
  84. package/bin/install.js +38 -51
  85. package/package.json +68 -74
  86. package/tooling/build-registry.js +226 -208
  87. package/tooling/run-aar.js +55 -126
  88. package/tooling/sync-versions.js +2 -2
  89. package/tooling/validate-graph.js +100 -87
  90. package/tooling/validate-skills.js +32 -14
  91. package/.agents/docs/decisions/ADR-001-v8-migration.md +0 -58
  92. package/.agents/docs/decisions/ADR-002-workflow-separation.md +0 -50
  93. package/.agents/docs/decisions/ADR-003-registry-generated.md +0 -54
  94. package/.agents/docs/decisions/ADR-008-skill-boundary-review.md +0 -27
  95. package/.agents/registry/capability-graph.yml +0 -390
  96. package/.agents/registry/skills-index.yml +0 -305
  97. package/.agents/skills/_template/capability.yaml +0 -34
  98. package/.agents/skills/_template/evals/scorecard.yaml +0 -19
@@ -1,146 +1,146 @@
1
- # Workflow Schema — V8 Standard
2
- # Every workflow YAML file MUST conform to this schema.
3
- # Version: 8.3.0
4
-
5
- schema_version: 8.3.0
6
-
7
- # ── Required top-level fields ──────────────────────────────
8
- required:
9
- - name # string: workflow identifier (kebab-case)
10
- - version # semver: 8.x.x
11
- - description # string: one sentence
12
- - owner # object: {type, maintained_by} — who owns this workflow
13
- - steps # array: minimum 2 steps
14
- - escalation # object: retry + on_failure
15
-
16
- # ── Optional top-level fields ───────────────────────────────
17
- optional:
18
- - verification_profile # string: key into verification_profiles table below
19
- - triggers # array: keywords to auto-select workflow
20
- - ide_binding # object: {slash_command, aliases} — maps workflow to an IDE command
21
-
22
- # ── IDE binding field structure ─────────────────────────────
23
- ide_binding_fields:
24
- slash_command: # string: e.g. "/fix-bug" — primary command to invoke this workflow
25
- aliases: # array: alternate strings that also trigger it
26
-
27
- # ── Owner field structure ───────────────────────────────────
28
- owner_fields:
29
- type: # string: engineering | security | ux | data | devops
30
- maintained_by: # string: team or person identifier
31
-
32
- # ── Required fields per step ────────────────────────────────
33
- step_required:
34
- - id # string: unique within workflow (snake_case)
35
- - name # string: human-readable step name
36
- - purpose # string: WHAT the step achieves (not HOW)
37
- - inputs # array: what this step needs to start
38
- - outputs # array: what this step produces when done
39
- - required # bool: true = cannot be skipped
40
-
41
- # ── Optional fields per step ────────────────────────────────
42
- step_optional:
43
- - skip_if # string: condition under which step can be skipped
44
- - exit_on_fail # enum: BLOCKED | PARTIAL | FAILED
45
- - min_confidence # enum: HIGH | MEDIUM (default: HIGH)
46
- - actions # array: hints for HOW to achieve the purpose
47
- - human_checkpoint # object: {condition, message} — pause and wait for human approval before proceeding past this step
48
- - context_budget # int: max lines of code that should be read in this step (prevent token overflow)
49
-
50
- # ── Human checkpoint field structure ────────────────────────
51
- human_checkpoint_fields:
52
- condition: # string: when this checkpoint triggers, e.g. "any CRITICAL finding present"
53
- message: # string: what to show the human when asking for approval
54
-
55
- # ── Complexity definitions ──────────────────────────────────
56
- complexity_levels:
57
- low:
58
- files_affected: "1"
59
- has_behavior_change: false
60
- has_external_dependency: false
61
- has_breaking_change: false
62
- examples: ["fix typo", "rename variable", "add comment"]
63
-
64
- medium:
65
- files_affected: "2-5"
66
- has_behavior_change: true
67
- has_external_dependency: false
68
- has_breaking_change: false
69
- examples: ["fix bug", "add feature to existing module", "refactor function"]
70
-
71
- high:
72
- files_affected: "5+"
73
- has_behavior_change: true
74
- has_external_dependency: true
75
- has_breaking_change: false
76
- examples: ["add new API endpoint", "database migration", "new component with state"]
77
-
78
- critical:
79
- files_affected: "many"
80
- has_behavior_change: true
81
- has_external_dependency: true
82
- has_breaking_change: true
83
- examples: ["architecture change", "breaking API change", "auth system overhaul"]
84
-
85
- # ── Verification profiles ────────────────────────────────────
86
- verification_profiles:
87
- bug-fix:
88
- - regression_check # Does the fix break anything else?
89
- - root_cause_fixed # Is the real cause addressed (not patched)?
90
- - lint_clean # No lint errors introduced
91
- - test_if_available # Run related tests if they exist
92
- - security_boundary_check # Ensure R-SEC-04 is respected
93
-
94
- refactor:
95
- - behavior_unchanged # External behavior identical before/after
96
- - test_pass # All existing tests still pass
97
- - lint_clean
98
- - no_new_complexity # Cyclomatic complexity not increased
99
- - anti_slop_compliance # Meets R-C-09 zero-slop standard
100
-
101
- feature:
102
- - acceptance_criteria # Does it meet the stated requirements?
103
- - test_coverage # New logic has tests
104
- - integration_check # Works with existing system
105
- - lint_clean
106
- - anti_slop_compliance # Meets R-C-09 zero-slop standard
107
- - security_boundary_check # Enforces R-SEC-04
108
-
109
- documentation:
110
- - accuracy # Content matches actual code behavior
111
- - completeness # All required sections present
112
- - no_broken_links # References are valid
113
-
114
- review:
115
- - findings_have_evidence # Each finding has file+line+quote
116
- - severity_justified # Severity level is appropriate
117
- - actionable_suggestions # Each finding has a fix suggestion
118
-
119
- security-audit:
120
- - no_unverified_critical # No CRITICAL risk left without a recommendation
121
- - secret_scan_complete # Secret scan actually ran, not skipped
122
- - fix_confirmed # Reported vulnerabilities re-checked after remediation
123
-
124
- skill-evolution:
125
- - improvement_schema_valid # Proposal passes validate-skills.js
126
- - regression_free # Success rate not lower than baseline
127
- - change_justified # Each change traces to a failure_pattern
128
-
129
- spec-driven:
130
- - spec_matches_code # Implementation matches technical_spec
131
- - edge_cases_covered # Edge cases from spec are handled
132
- - acceptance_criteria # Verify step confirms criteria met
133
-
134
- # ── Escalation schema ────────────────────────────────────────
135
- escalation_required: true
136
- escalation_fields:
137
- required:
138
- - max_retries # int: max retry attempts (recommended: 2)
139
- - on_failure # string: what to do when all retries exhausted
140
-
141
- # ── Exit codes ───────────────────────────────────────────────
142
- exit_codes:
143
- SUCCESS: "Task completed and verified"
144
- BLOCKED: "Precondition not met — waiting for input"
145
- FAILED: "Execution failed after max_retries"
146
- PARTIAL: "Partially completed — output + reason provided"
1
+ # Workflow Schema — V8 Standard
2
+ # Every workflow YAML file MUST conform to this schema.
3
+ # Version: 10.2.0
4
+
5
+ schema_version: 10.2.0
6
+
7
+ # ── Required top-level fields ──────────────────────────────
8
+ required:
9
+ - name # string: workflow identifier (kebab-case)
10
+ - version # semver: 8.x.x
11
+ - description # string: one sentence
12
+ - owner # object: {type, maintained_by} — who owns this workflow
13
+ - steps # array: minimum 2 steps
14
+ - escalation # object: retry + on_failure
15
+
16
+ # ── Optional top-level fields ───────────────────────────────
17
+ optional:
18
+ - verification_profile # string: key into verification_profiles table below
19
+ - triggers # array: keywords to auto-select workflow
20
+ - ide_binding # object: {slash_command, aliases} — maps workflow to an IDE command
21
+
22
+ # ── IDE binding field structure ─────────────────────────────
23
+ ide_binding_fields:
24
+ slash_command: # string: e.g. "/fix-bug" — primary command to invoke this workflow
25
+ aliases: # array: alternate strings that also trigger it
26
+
27
+ # ── Owner field structure ───────────────────────────────────
28
+ owner_fields:
29
+ type: # string: engineering | security | ux | data | devops
30
+ maintained_by: # string: team or person identifier
31
+
32
+ # ── Required fields per step ────────────────────────────────
33
+ step_required:
34
+ - id # string: unique within workflow (snake_case)
35
+ - name # string: human-readable step name
36
+ - purpose # string: WHAT the step achieves (not HOW)
37
+ - inputs # array: what this step needs to start
38
+ - outputs # array: what this step produces when done
39
+ - required # bool: true = cannot be skipped
40
+
41
+ # ── Optional fields per step ────────────────────────────────
42
+ step_optional:
43
+ - skip_if # string: condition under which step can be skipped
44
+ - exit_on_fail # enum: BLOCKED | PARTIAL | FAILED
45
+ - min_confidence # enum: HIGH | MEDIUM (default: HIGH)
46
+ - actions # array: hints for HOW to achieve the purpose
47
+ - human_checkpoint # object: {condition, message} — pause and wait for human approval before proceeding past this step
48
+ - context_budget # int: max lines of code that should be read in this step (prevent token overflow)
49
+
50
+ # ── Human checkpoint field structure ────────────────────────
51
+ human_checkpoint_fields:
52
+ condition: # string: when this checkpoint triggers, e.g. "any CRITICAL finding present"
53
+ message: # string: what to show the human when asking for approval
54
+
55
+ # ── Complexity definitions ──────────────────────────────────
56
+ complexity_levels:
57
+ low:
58
+ files_affected: "1"
59
+ has_behavior_change: false
60
+ has_external_dependency: false
61
+ has_breaking_change: false
62
+ examples: ["fix typo", "rename variable", "add comment"]
63
+
64
+ medium:
65
+ files_affected: "2-5"
66
+ has_behavior_change: true
67
+ has_external_dependency: false
68
+ has_breaking_change: false
69
+ examples: ["fix bug", "add feature to existing module", "refactor function"]
70
+
71
+ high:
72
+ files_affected: "5+"
73
+ has_behavior_change: true
74
+ has_external_dependency: true
75
+ has_breaking_change: false
76
+ examples: ["add new API endpoint", "database migration", "new component with state"]
77
+
78
+ critical:
79
+ files_affected: "many"
80
+ has_behavior_change: true
81
+ has_external_dependency: true
82
+ has_breaking_change: true
83
+ examples: ["architecture change", "breaking API change", "auth system overhaul"]
84
+
85
+ # ── Verification profiles ────────────────────────────────────
86
+ verification_profiles:
87
+ bug-fix:
88
+ - regression_check # Does the fix break anything else?
89
+ - root_cause_fixed # Is the real cause addressed (not patched)?
90
+ - lint_clean # No lint errors introduced
91
+ - test_if_available # Run related tests if they exist
92
+ - security_boundary_check # Ensure R-SEC-04 is respected
93
+
94
+ refactor:
95
+ - behavior_unchanged # External behavior identical before/after
96
+ - test_pass # All existing tests still pass
97
+ - lint_clean
98
+ - no_new_complexity # Cyclomatic complexity not increased
99
+ - anti_slop_compliance # Meets R-C-09 zero-slop standard
100
+
101
+ feature:
102
+ - acceptance_criteria # Does it meet the stated requirements?
103
+ - test_coverage # New logic has tests
104
+ - integration_check # Works with existing system
105
+ - lint_clean
106
+ - anti_slop_compliance # Meets R-C-09 zero-slop standard
107
+ - security_boundary_check # Enforces R-SEC-04
108
+
109
+ documentation:
110
+ - accuracy # Content matches actual code behavior
111
+ - completeness # All required sections present
112
+ - no_broken_links # References are valid
113
+
114
+ review:
115
+ - findings_have_evidence # Each finding has file+line+quote
116
+ - severity_justified # Severity level is appropriate
117
+ - actionable_suggestions # Each finding has a fix suggestion
118
+
119
+ security-audit:
120
+ - no_unverified_critical # No CRITICAL risk left without a recommendation
121
+ - secret_scan_complete # Secret scan actually ran, not skipped
122
+ - fix_confirmed # Reported vulnerabilities re-checked after remediation
123
+
124
+ skill-evolution:
125
+ - improvement_schema_valid # Proposal passes validate-skills.js
126
+ - regression_free # Success rate not lower than baseline
127
+ - change_justified # Each change traces to a failure_pattern
128
+
129
+ spec-driven:
130
+ - spec_matches_code # Implementation matches technical_spec
131
+ - edge_cases_covered # Edge cases from spec are handled
132
+ - acceptance_criteria # Verify step confirms criteria met
133
+
134
+ # ── Escalation schema ────────────────────────────────────────
135
+ escalation_required: true
136
+ escalation_fields:
137
+ required:
138
+ - max_retries # int: max retry attempts (recommended: 2)
139
+ - on_failure # string: what to do when all retries exhausted
140
+
141
+ # ── Exit codes ───────────────────────────────────────────────
142
+ exit_codes:
143
+ SUCCESS: "Task completed and verified"
144
+ BLOCKED: "Precondition not met — waiting for input"
145
+ FAILED: "Execution failed after max_retries"
146
+ PARTIAL: "Partially completed — output + reason provided"
@@ -1,121 +1,155 @@
1
- name: bug-resolution
2
- version: 8.0.0
3
- description: "Pipeline chuẩn để diagnose và fix bugs theo chu trình: Observe → Hypothesize → Evidence → Patch → Verify."
4
-
5
- owner:
6
- type: engineering
7
- maintained_by: qk-team
8
-
9
- verification_profile: bug-fix
10
-
11
- triggers:
12
- - "fix bug"
13
- - "sửa lỗi"
14
- - "error"
15
- - "exception"
16
- - "crash"
17
- - "stack trace"
18
- - "not working"
19
- - "bị lỗi"
20
-
21
- ide_binding:
22
- slash_command: "/fix-bug"
23
- aliases: ["/bug", "/debug"]
24
-
25
- steps:
26
- - id: observe
27
- name: "Thu thập triệu chứng"
28
- purpose: "Xác định chính xác bug xảy ra ở đâu và biểu hiện thế nào"
29
- required: true
30
- skip_if: "Stack trace + affected file đã được cung cấp đầy đủ"
31
- inputs:
32
- - error_message
33
- - stack_trace
34
- - user_description
35
- outputs:
36
- - affected_file
37
- - affected_line_range
38
- - error_signature
39
- actions:
40
- - "Đọc error message và stack trace"
41
- - "Xác định file và line range bị ảnh hưởng"
42
- - "Mô tả triệu chứng bằng ngôn ngữ kỹ thuật"
43
- exit_on_fail: BLOCKED
44
-
45
- - id: hypothesize
46
- name: "Đặt giả thuyết nguyên nhân"
47
- purpose: "Xác định top 3 nguyên nhân có thể, xếp theo xác suất"
48
- required: true
49
- skip_if: null
50
- inputs:
51
- - error_signature
52
- - affected_file
53
- outputs:
54
- - hypothesis_list # Ordered list: [H1 (most likely), H2, H3]
55
- - selected_hypothesis # H1 unless evidence suggests otherwise
56
- min_confidence: HIGH
57
- actions:
58
- - "List 3 nguyên nhân có thể gây ra triệu chứng này"
59
- - "Xếp hạng theo xác suất dựa trên stack trace"
60
- - "Chọn H1 để kiểm chứng trước"
61
-
62
- - id: evidence
63
- name: "Tìm bằng chứng xác nhận"
64
- purpose: "Xác nhận hoặc loại bỏ hypothesis bằng code thực tế"
65
- required: true
66
- skip_if: null
67
- inputs:
68
- - selected_hypothesis
69
- - affected_file
70
- outputs:
71
- - confirmed_root_cause # File + line + quoted code
72
- - evidence_quote # Exact code causing the bug
73
- min_confidence: HIGH
74
- context_budget: 150
75
- actions:
76
- - "Dùng grep_search để tìm pattern liên quan"
77
- - "Dùng view_file[StartLine:EndLine] để đọc section cụ thể"
78
- - "Quote chính xác đoạn code gây bug"
79
- exit_on_fail: PARTIAL
80
-
81
- - id: patch
82
- name: "Áp dụng fix"
83
- purpose: "Sửa root cause, không chỉ patch triệu chứng"
84
- required: true
85
- skip_if: null
86
- inputs:
87
- - confirmed_root_cause
88
- - evidence_quote
89
- outputs:
90
- - patched_files # List of files modified
91
- - diff_summary # What changed and why
92
- actions:
93
- - "Edit source file trực tiếp với replace_file_content hoặc multi_replace_file_content"
94
- - "Không tạo wrapper script"
95
- - "Không dùng ?. hoặc ! để silence lỗi"
96
- - "Fix root cause, không patch bề mặt"
97
- human_checkpoint:
98
- condition: "file thuộc vùng auth/payment/permission/migration"
99
- message: "Patch này chạm vào code nhạy cảm. Xác nhận an toàn trước khi thay đổi."
100
- - id: verify
101
- name: "Xác minh fix + quality gate"
102
- purpose: "Xác nhận bug đã được fix, không có regression, code đạt quality threshold"
103
- required: true
104
- skip_if: null
105
- inputs:
106
- - patched_files
107
- outputs:
108
- - verification_result # PASS | FAIL | PARTIAL
109
- - evidence_of_fix
110
- - quality_gate_result # PASS | FAIL
111
- actions:
112
- - "Re-read patched code section"
113
- - "Chạy test liên quan nếu có"
114
- - "Áp dụng shared quality gate → xem: .agents/workflows/shared/quality-gate.yml"
115
- - " Checklist: universal_checks + bug-resolution specific checks"
116
- - "Ghi log execution trace vào evals/traces/"
117
- exit_on_fail: FAILED
118
-
119
- escalation:
120
- max_retries: 2
121
- on_failure: "Report với full evidence chain (observe→hypothesis→evidence), escalate to human với gợi ý bước tiếp theo"
1
+ name: bug-resolution
2
+ version: 10.2.0
3
+ platforms: [antigravity, claude, opencode]
4
+ runtime_version: 1
5
+ description: "Pipeline chuẩn để diagnose và fix bugs theo chu trình: Observe → Hypothesize → Evidence → Patch → Verify."
6
+
7
+ owner:
8
+ type: engineering
9
+ maintained_by: qk-team
10
+
11
+ verification_profile: bug-fix
12
+
13
+ triggers:
14
+ - "fix bug"
15
+ - "sửa lỗi"
16
+ - "error"
17
+ - "exception"
18
+ - "crash"
19
+ - "stack trace"
20
+ - "not working"
21
+ - "bị lỗi"
22
+
23
+ ide_binding:
24
+ slash_command: "/fix-bug"
25
+ aliases: ["/bug", "/debug"]
26
+
27
+ steps:
28
+ - id: observe
29
+ name: "Thu thập triệu chứng"
30
+ purpose: "Xác định chính xác bug xảy ra ở đâu và biểu hiện thế nào"
31
+ required: true
32
+ skip_if: "Stack trace + affected file đã được cung cấp đầy đủ"
33
+ inputs:
34
+ - error_message
35
+ - stack_trace
36
+ - user_description
37
+ outputs:
38
+ - affected_file
39
+ - affected_line_range
40
+ - error_signature
41
+ actions:
42
+ - "Đọc error message và stack trace"
43
+ - "Xác định file và line range bị ảnh hưởng"
44
+ - "Mô tả triệu chứng bằng ngôn ngữ kỹ thuật"
45
+ exit_on_fail: BLOCKED
46
+
47
+ - id: hypothesize
48
+ name: "Đặt giả thuyết nguyên nhân"
49
+ purpose: "Xác định top 3 nguyên nhân có thể, xếp theo xác suất"
50
+ required: true
51
+ skip_if: null
52
+ inputs:
53
+ - error_signature
54
+ - affected_file
55
+ outputs:
56
+ - hypothesis_list # Ordered list: [H1 (most likely), H2, H3]
57
+ - selected_hypothesis # H1 unless evidence suggests otherwise
58
+ min_confidence: HIGH
59
+ actions:
60
+ - "List 3 nguyên nhân có thể gây ra triệu chứng này"
61
+ - "Xếp hạng theo xác suất dựa trên stack trace"
62
+ - "Chọn H1 để kiểm chứng trước"
63
+
64
+ - id: evidence
65
+ name: "Tìm bằng chứng xác nhận"
66
+ purpose: "Xác nhận hoặc loại bỏ hypothesis bằng code thực tế"
67
+ required: true
68
+ skip_if: null
69
+ inputs:
70
+ - selected_hypothesis
71
+ - affected_file
72
+ outputs:
73
+ - confirmed_root_cause # File + line + quoted code
74
+ - evidence_quote # Exact code causing the bug
75
+ min_confidence: HIGH
76
+ context_budget: 150
77
+ actions:
78
+ - "Dùng grep_search để tìm pattern liên quan"
79
+ - "Dùng view_file[StartLine:EndLine] để đọc section cụ thể"
80
+ - "Quote chính xác đoạn code gây bug"
81
+ exit_on_fail: PARTIAL
82
+
83
+ - id: patch
84
+ name: "Áp dụng fix"
85
+ purpose: "Sửa root cause, không chỉ patch triệu chứng"
86
+ required: true
87
+ skip_if: null
88
+ inputs:
89
+ - confirmed_root_cause
90
+ - evidence_quote
91
+ outputs:
92
+ - patched_files # List of files modified
93
+ - diff_summary # What changed and why
94
+ actions:
95
+ - "Edit source file trực tiếp với replace_file_content hoặc multi_replace_file_content"
96
+ - "Không tạo wrapper script"
97
+ - "Không dùng ?. hoặc ! để silence lỗi"
98
+ - "Fix root cause, không patch bề mặt"
99
+ human_checkpoint:
100
+ condition: "file thuộc vùng auth/payment/permission/migration"
101
+ message: "Patch này chạm vào code nhạy cảm. Xác nhận an toàn trước khi thay đổi."
102
+ - id: verify
103
+ name: "Xác minh fix + quality gate"
104
+ purpose: "Xác nhận bug đã được fix, không có regression, code đạt quality threshold"
105
+ required: true
106
+ skip_if: null
107
+ inputs:
108
+ - patched_files
109
+ outputs:
110
+ - verification_result # PASS | FAIL | PARTIAL
111
+ - evidence_of_fix
112
+ - quality_gate_result # PASS | FAIL
113
+ actions:
114
+ - "Re-read patched code section"
115
+ - "Chạy test liên quan nếu có"
116
+ - "Áp dụng shared quality gate → xem: .agents/workflows/shared/quality-gate.yml"
117
+ - " Checklist: universal_checks + bug-resolution specific checks"
118
+ - "Ghi log execution trace vào evals/traces/"
119
+ exit_on_fail: FAILED
120
+
121
+ escalation:
122
+ max_retries: 2
123
+ on_failure: "Report với full evidence chain (observe→hypothesis→evidence), escalate to human với gợi ý bước tiếp theo"
124
+
125
+ # ── V10.2 Additions ──────────────────────────────
126
+ # Confidence Model
127
+ # | Level | Condition | Action |
128
+ # |--------|------------------------|--------------|
129
+ # | HIGH | Step inputs provided | Proceed |
130
+ # | MEDIUM | Some assumptions needed | Note assumptions |
131
+ # | LOW | Insufficient evidence | EXIT: BLOCKED|
132
+ #
133
+ # Exit Codes
134
+ # | Code | Meaning | When |
135
+ # |---------|-------------------------------|-------------------------|
136
+ # | SUCCESS | Step completed and verified | All criteria met |
137
+ # | PARTIAL | Step done with minor gaps | Some checks skipped |
138
+ # | BLOCKED | Missing precondition | Ask user |
139
+ # | FAILED | Step failed after max retries | Report error |
140
+ #
141
+ # Evidence Format:
142
+ # [SEVERITY] step_id: [step-name]
143
+ # Reason: [why this matters]
144
+ # Confidence: [HIGH|MEDIUM|LOW]
145
+ # Fix: [suggestion]
146
+ #
147
+ # Compliance:
148
+ # Runtime Standard: 11/11
149
+ # Frontmatter Complete: yes
150
+ # References Valid: yes
151
+ # Decision Trees: PASS
152
+ # Thresholds Defined: PASS
153
+ # schema_version: 10.2.0
154
+ # runtime_version: 1
155
+ # platforms: [antigravity, claude, opencode]