ai-execution-protocol 0.1.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/AGENTS.md +90 -0
- package/LICENSE +21 -0
- package/README.md +159 -0
- package/dist/minimal/.aiignore +8 -0
- package/dist/minimal/AGENTS.md +61 -0
- package/dist/minimal/README.md +60 -0
- package/dist/minimal/protocol/README.yaml +35 -0
- package/dist/minimal/protocol/context-compiler.yaml +110 -0
- package/dist/minimal/protocol/context-rules.yaml +71 -0
- package/dist/minimal/protocol/execution-rules.yaml +56 -0
- package/dist/minimal/protocol/fast-path.yaml +33 -0
- package/dist/minimal/protocol/formatting-rules.yaml +75 -0
- package/dist/minimal/protocol/mapping-checklists.yaml +42 -0
- package/dist/minimal/protocol/modes.yaml +42 -0
- package/dist/minimal/protocol/prompt-economy.yaml +96 -0
- package/dist/minimal/protocol/risk-levels.yaml +87 -0
- package/dist/minimal/protocol/router.yaml +100 -0
- package/dist/minimal/protocol/spec-driven.yaml +53 -0
- package/dist/minimal/protocol/validation-checklist.yaml +59 -0
- package/install.ps1 +16 -0
- package/package.json +46 -0
- package/protocol/README.yaml +35 -0
- package/protocol/context-compiler.yaml +110 -0
- package/protocol/context-rules.yaml +71 -0
- package/protocol/execution-rules.yaml +56 -0
- package/protocol/fast-path.yaml +33 -0
- package/protocol/formatting-rules.yaml +75 -0
- package/protocol/mapping-checklists.yaml +42 -0
- package/protocol/modes.yaml +42 -0
- package/protocol/prompt-economy.yaml +96 -0
- package/protocol/risk-levels.yaml +87 -0
- package/protocol/router.yaml +100 -0
- package/protocol/spec-driven.yaml +53 -0
- package/protocol/validation-checklist.yaml +59 -0
- package/scripts/README.md +222 -0
- package/scripts/build_dist.py +191 -0
- package/scripts/install_protocol.py +28 -0
- package/scripts/npm_install_protocol.js +278 -0
- package/scripts/verify_install.py +92 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
id: fast_path
|
|
2
|
+
type: agent_entrypoint
|
|
3
|
+
version: 0.1
|
|
4
|
+
purpose: minimum_rules_to_start_any_task
|
|
5
|
+
read_next:
|
|
6
|
+
- router.yaml
|
|
7
|
+
- modes.yaml
|
|
8
|
+
core_rules:
|
|
9
|
+
- classify_risk_before_action
|
|
10
|
+
- use_minimum_sufficient_context
|
|
11
|
+
- read_only_files_required_by_router
|
|
12
|
+
- do_not_edit_unmapped_file
|
|
13
|
+
- raise_level_when_risk_appears
|
|
14
|
+
- confirm_before_level_3_sensitive_action
|
|
15
|
+
- deliver_changed_validated_not_validated_residual_risk
|
|
16
|
+
- use_balanced_mode_by_default
|
|
17
|
+
- show_original_and_improved_prompt_in_delivery
|
|
18
|
+
- improve_prompt_proportional_to_tokens_and_risk
|
|
19
|
+
- include_test_list_when_break_risk_exists
|
|
20
|
+
- explain_in_plain_language_for_non_experts
|
|
21
|
+
- use_context_compiler_when_context_or_history_is_large
|
|
22
|
+
risk_short:
|
|
23
|
+
level_0: answer_only
|
|
24
|
+
level_1: small_clear_reversible_isolated_change
|
|
25
|
+
level_2: user_flow_ambiguity_multiple_files_or_regression_risk
|
|
26
|
+
level_3: data_security_auth_database_deploy_production_secret_or_destructive
|
|
27
|
+
file_policy:
|
|
28
|
+
max_lines: 400
|
|
29
|
+
split_when_near_limit: true
|
|
30
|
+
prefer_snippets_over_full_files: true
|
|
31
|
+
stop_reading_when:
|
|
32
|
+
- enough_context_to_act_safely
|
|
33
|
+
- validation_plan_is_clear
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
id: formatting_rules
|
|
2
|
+
type: ai_readability_rules
|
|
3
|
+
version: 0.1
|
|
4
|
+
priority:
|
|
5
|
+
first: ai_readability
|
|
6
|
+
second: human_readability
|
|
7
|
+
principles:
|
|
8
|
+
- one_main_subject_per_file
|
|
9
|
+
- stable_keys
|
|
10
|
+
- direct_names
|
|
11
|
+
- short_lists
|
|
12
|
+
- plain_language_for_final_delivery
|
|
13
|
+
- technical_terms_explained_when_needed
|
|
14
|
+
- rules_before_examples
|
|
15
|
+
- separate_docs_from_protocol
|
|
16
|
+
- separate_criteria_templates_examples
|
|
17
|
+
- no_decorative_text
|
|
18
|
+
final_delivery:
|
|
19
|
+
default: micro_when_low_risk
|
|
20
|
+
compact_labels:
|
|
21
|
+
prompt_original: PO
|
|
22
|
+
prompt_melhorado_da_ia: PM
|
|
23
|
+
low_risk_summary: OK
|
|
24
|
+
what_was_done: Feito
|
|
25
|
+
validation: Validado
|
|
26
|
+
what_to_test_when_needed: Testar
|
|
27
|
+
limits_and_residual_risk: Risco
|
|
28
|
+
micro_format:
|
|
29
|
+
use_when:
|
|
30
|
+
- level_0
|
|
31
|
+
- level_1
|
|
32
|
+
lines:
|
|
33
|
+
- PO
|
|
34
|
+
- PM
|
|
35
|
+
- OK
|
|
36
|
+
ok_block:
|
|
37
|
+
- Feito
|
|
38
|
+
- Validado
|
|
39
|
+
- Risco
|
|
40
|
+
avoid:
|
|
41
|
+
- semicolon_only_ok_line
|
|
42
|
+
- one_line_micro_response
|
|
43
|
+
required_sections:
|
|
44
|
+
- prompt_original
|
|
45
|
+
- prompt_melhorado_da_ia
|
|
46
|
+
- what_was_done
|
|
47
|
+
- validation
|
|
48
|
+
- limits_and_residual_risk
|
|
49
|
+
conditional_sections:
|
|
50
|
+
- what_to_test_when_needed
|
|
51
|
+
clarity:
|
|
52
|
+
- use_simple_sentences
|
|
53
|
+
- explain_impact_for_user
|
|
54
|
+
- avoid_internal_jargon_without_context
|
|
55
|
+
- keep_each_section_to_one_line_when_possible
|
|
56
|
+
- keep_micro_format_with_readable_line_breaks
|
|
57
|
+
yaml_style:
|
|
58
|
+
prefer:
|
|
59
|
+
- ids
|
|
60
|
+
- type
|
|
61
|
+
- when
|
|
62
|
+
- do
|
|
63
|
+
- avoid
|
|
64
|
+
- deliver
|
|
65
|
+
- validation
|
|
66
|
+
avoid:
|
|
67
|
+
- long_paragraphs
|
|
68
|
+
- hidden_criteria
|
|
69
|
+
- synonyms_for_same_operational_concept
|
|
70
|
+
- oversized_files
|
|
71
|
+
maintenance:
|
|
72
|
+
max_lines_per_file: 400
|
|
73
|
+
if_near_limit:
|
|
74
|
+
- split_by_theme
|
|
75
|
+
- update_readme
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
id: mapping_checklists
|
|
2
|
+
type: checklist
|
|
3
|
+
version: 0.1
|
|
4
|
+
minimal_map:
|
|
5
|
+
use_for:
|
|
6
|
+
- level_1
|
|
7
|
+
fields:
|
|
8
|
+
- objective
|
|
9
|
+
- affected_area
|
|
10
|
+
- candidate_files
|
|
11
|
+
- risk
|
|
12
|
+
- plan
|
|
13
|
+
- validation
|
|
14
|
+
impact_map:
|
|
15
|
+
use_for:
|
|
16
|
+
- level_2
|
|
17
|
+
fields:
|
|
18
|
+
- real_objective
|
|
19
|
+
- affected_flow
|
|
20
|
+
- candidate_files
|
|
21
|
+
- risks_and_side_effects
|
|
22
|
+
- out_of_scope
|
|
23
|
+
- change_plan
|
|
24
|
+
- rollback_mental
|
|
25
|
+
- expected_validation
|
|
26
|
+
critical_map:
|
|
27
|
+
use_for:
|
|
28
|
+
- level_3
|
|
29
|
+
fields:
|
|
30
|
+
- affected_data_or_environment
|
|
31
|
+
- permissions
|
|
32
|
+
- security_surface
|
|
33
|
+
- critical_risks
|
|
34
|
+
- safe_plan
|
|
35
|
+
- required_confirmation
|
|
36
|
+
- rollback_or_mitigation
|
|
37
|
+
rules:
|
|
38
|
+
- id: MAP_001
|
|
39
|
+
do_not_edit_file_unless: identified_as_candidate
|
|
40
|
+
- id: MAP_002
|
|
41
|
+
if_new_file_needed: update_map_before_editing
|
|
42
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
id: modes
|
|
2
|
+
type: operational_modes
|
|
3
|
+
version: 0.1
|
|
4
|
+
default: balanced
|
|
5
|
+
modes:
|
|
6
|
+
fast:
|
|
7
|
+
purpose: minimum_context_and_fast_execution
|
|
8
|
+
use_when:
|
|
9
|
+
- low_risk
|
|
10
|
+
- clear_task
|
|
11
|
+
- reversible_change
|
|
12
|
+
behavior:
|
|
13
|
+
- read_fast_path_and_route_only
|
|
14
|
+
- show_compact_original_and_improved_prompt
|
|
15
|
+
- validate_minimum_required
|
|
16
|
+
balanced:
|
|
17
|
+
purpose: default_safe_execution
|
|
18
|
+
use_when:
|
|
19
|
+
- normal_task
|
|
20
|
+
- moderate_risk
|
|
21
|
+
behavior:
|
|
22
|
+
- classify_risk
|
|
23
|
+
- use_router
|
|
24
|
+
- map_when_level_2_or_3
|
|
25
|
+
- use_light_spec_when_scope_is_unclear_or_multi_step
|
|
26
|
+
- validate_and_report_limits
|
|
27
|
+
- show_original_and_improved_prompt
|
|
28
|
+
strict:
|
|
29
|
+
purpose: maximum_safety_and_auditability
|
|
30
|
+
use_when:
|
|
31
|
+
- level_3
|
|
32
|
+
- unclear_high_impact_task
|
|
33
|
+
- production_or_sensitive_data
|
|
34
|
+
behavior:
|
|
35
|
+
- show_compact_interpretation
|
|
36
|
+
- require_critical_map
|
|
37
|
+
- use_full_spec_for_level_3_or_multi_module_changes
|
|
38
|
+
- ask_confirmation_before_sensitive_action
|
|
39
|
+
- report_validation_and_residual_risk
|
|
40
|
+
- show_original_and_improved_prompt
|
|
41
|
+
- provide_test_list_when_break_risk_exists
|
|
42
|
+
- prefer_more_validation_over_speed
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
id: prompt_economy
|
|
2
|
+
type: operational_rules
|
|
3
|
+
version: 0.1
|
|
4
|
+
purpose: improve_user_prompt_without_token_bloat
|
|
5
|
+
principle: always_improve_prompt_only_as_much_as_needed_for_safe_execution
|
|
6
|
+
rules:
|
|
7
|
+
- id: PROMPT_001
|
|
8
|
+
name: keep_improved_prompt_short
|
|
9
|
+
do:
|
|
10
|
+
- preserve_user_intent
|
|
11
|
+
- add_missing_technical_constraints_only_when_needed
|
|
12
|
+
- avoid_rewriting_into_long_spec
|
|
13
|
+
- id: PROMPT_002
|
|
14
|
+
name: proportional_prompt_expansion
|
|
15
|
+
by_level:
|
|
16
|
+
level_0: micro_prompt_comparison
|
|
17
|
+
level_1: micro_prompt_comparison
|
|
18
|
+
level_2: compact_objective_scope_validation
|
|
19
|
+
level_3: compact_critical_intent_risk_confirmation
|
|
20
|
+
- id: PROMPT_003
|
|
21
|
+
name: no_prompt_bloat
|
|
22
|
+
avoid:
|
|
23
|
+
- repeating_full_context
|
|
24
|
+
- adding_unrequested_features
|
|
25
|
+
- creating_long_checklists_for_simple_tasks
|
|
26
|
+
- copying_protocol_text_into_user_prompt
|
|
27
|
+
- id: PROMPT_004
|
|
28
|
+
name: economical_improved_prompt_shape
|
|
29
|
+
format:
|
|
30
|
+
- original_prompt
|
|
31
|
+
- objective
|
|
32
|
+
- scope
|
|
33
|
+
- risk_level
|
|
34
|
+
- validation
|
|
35
|
+
- confirmation_if_needed
|
|
36
|
+
- id: PROMPT_005
|
|
37
|
+
name: always_show_prompt_comparison
|
|
38
|
+
do:
|
|
39
|
+
- include_user_original_prompt
|
|
40
|
+
- include_ai_improved_prompt
|
|
41
|
+
- keep_comparison_to_minimum_viable_words
|
|
42
|
+
- preserve_user_language_when_possible
|
|
43
|
+
avoid:
|
|
44
|
+
- hiding_interpretation_from_user
|
|
45
|
+
- expanding_simple_requests_into_large_specs
|
|
46
|
+
limits:
|
|
47
|
+
level_0:
|
|
48
|
+
max_lines: 5
|
|
49
|
+
max_expansion_ratio: 1.5
|
|
50
|
+
max_tokens_est: 80
|
|
51
|
+
level_1:
|
|
52
|
+
max_lines: 5
|
|
53
|
+
max_expansion_ratio: 2.0
|
|
54
|
+
max_tokens_est: 110
|
|
55
|
+
level_2:
|
|
56
|
+
max_lines: 5
|
|
57
|
+
max_expansion_ratio: 4.0
|
|
58
|
+
max_tokens_est: 160
|
|
59
|
+
level_3:
|
|
60
|
+
max_lines: 7
|
|
61
|
+
max_expansion_ratio: 6.0
|
|
62
|
+
max_tokens_est: 260
|
|
63
|
+
delivery_rule:
|
|
64
|
+
default_format: micro_when_low_risk
|
|
65
|
+
micro_template:
|
|
66
|
+
- "PO: <original in one short line>"
|
|
67
|
+
- "PM: <improved in one short line>"
|
|
68
|
+
- "OK:"
|
|
69
|
+
- " Feito: <done>"
|
|
70
|
+
- " Validado: <evidence or not run>"
|
|
71
|
+
- " Risco: <residual risk or none>"
|
|
72
|
+
ultra_compact_template:
|
|
73
|
+
- "PO: <original in one short line>"
|
|
74
|
+
- "PM: <improved in one short line>"
|
|
75
|
+
- "Feito: <what changed or answer>"
|
|
76
|
+
- "Validado: <evidence or not run>"
|
|
77
|
+
- "Risco: <residual risk or none>"
|
|
78
|
+
always_show:
|
|
79
|
+
- prompt_original
|
|
80
|
+
- prompt_melhorado_da_ia
|
|
81
|
+
comparison:
|
|
82
|
+
- original_prompt_must_keep_user_words_when_reasonable
|
|
83
|
+
- improved_prompt_must_state_objective_scope_risk_validation
|
|
84
|
+
- improved_prompt_must_fit_risk_level_limits
|
|
85
|
+
token_policy:
|
|
86
|
+
- use_abbreviated_labels_po_pm_when_user_did_not_request_full_form
|
|
87
|
+
- level_0_and_1_use_micro_template
|
|
88
|
+
- level_2_use_compact_objective_scope_validation
|
|
89
|
+
- level_3_include_risk_confirmation_without_long_spec
|
|
90
|
+
- omit_tests_line_when_no_break_risk_exists
|
|
91
|
+
- omit_not_validated_line_when_every_relevant_validation_is_reported
|
|
92
|
+
readability_policy:
|
|
93
|
+
- micro_template_must_keep_line_breaks
|
|
94
|
+
- ok_block_order_is_done_validated_risk
|
|
95
|
+
- do_not_merge_po_pm_ok_into_one_line
|
|
96
|
+
- do_not_separate_done_validated_risk_only_with_semicolons
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
id: risk_levels
|
|
2
|
+
type: risk_matrix
|
|
3
|
+
version: 0.1
|
|
4
|
+
levels:
|
|
5
|
+
level_0:
|
|
6
|
+
name: simple_answer
|
|
7
|
+
requires_mapping: false
|
|
8
|
+
requires_confirmation: false
|
|
9
|
+
when:
|
|
10
|
+
all:
|
|
11
|
+
- no_file_change
|
|
12
|
+
- no_sensitive_action
|
|
13
|
+
do:
|
|
14
|
+
- answer_directly
|
|
15
|
+
level_1:
|
|
16
|
+
name: fast_path
|
|
17
|
+
requires_mapping: minimal
|
|
18
|
+
requires_confirmation: false
|
|
19
|
+
when:
|
|
20
|
+
all:
|
|
21
|
+
- clear_task
|
|
22
|
+
- small_change
|
|
23
|
+
- reversible
|
|
24
|
+
- isolated
|
|
25
|
+
- direct_validation
|
|
26
|
+
do:
|
|
27
|
+
- read_focused_context
|
|
28
|
+
- change_minimum_needed
|
|
29
|
+
- validate_simple
|
|
30
|
+
level_2:
|
|
31
|
+
name: impact_map
|
|
32
|
+
requires_mapping: true
|
|
33
|
+
requires_confirmation: false
|
|
34
|
+
when:
|
|
35
|
+
any:
|
|
36
|
+
- user_visible_impact
|
|
37
|
+
- ambiguity
|
|
38
|
+
- multiple_files
|
|
39
|
+
- regression_risk
|
|
40
|
+
- relevant_behavior_change
|
|
41
|
+
do:
|
|
42
|
+
- map_objective_area_files_risks_plan_validation
|
|
43
|
+
- execute_smallest_safe_change
|
|
44
|
+
- validate_main_flow
|
|
45
|
+
level_3:
|
|
46
|
+
name: critical_map
|
|
47
|
+
requires_mapping: critical
|
|
48
|
+
requires_confirmation: true
|
|
49
|
+
when:
|
|
50
|
+
any:
|
|
51
|
+
- real_data
|
|
52
|
+
- database
|
|
53
|
+
- authentication
|
|
54
|
+
- authorization
|
|
55
|
+
- security
|
|
56
|
+
- secrets
|
|
57
|
+
- deploy
|
|
58
|
+
- production
|
|
59
|
+
- critical_integration
|
|
60
|
+
- destructive_command
|
|
61
|
+
do:
|
|
62
|
+
- map_critical_risk
|
|
63
|
+
- ask_confirmation_before_sensitive_action
|
|
64
|
+
- validate_before_and_after
|
|
65
|
+
escalation:
|
|
66
|
+
rule: raise_level_when_new_risk_evidence_appears
|
|
67
|
+
never: lower_level_by_ignoring_known_risk
|
|
68
|
+
blocked_critical_scope:
|
|
69
|
+
principle: do_not_lower_original_risk_because_sensitive_action_is_blocked
|
|
70
|
+
when:
|
|
71
|
+
all:
|
|
72
|
+
- level_3_was_identified
|
|
73
|
+
- critical_action_cannot_be_executed
|
|
74
|
+
do:
|
|
75
|
+
- keep_original_task_marked_level_3
|
|
76
|
+
- mark_critical_action_as_blocked_or_pending
|
|
77
|
+
- split_safe_subtasks_when_useful
|
|
78
|
+
- classify_each_safe_subtask_by_its_own_scope
|
|
79
|
+
- read_only_context_needed_for_the_executable_subtask
|
|
80
|
+
- report_blocked_level_3_part_in_delivery
|
|
81
|
+
allow_lower_scope_only_when:
|
|
82
|
+
- critical_action_is_explicitly_removed_from_scope
|
|
83
|
+
- new_evidence_proves_critical_risk_does_not_apply
|
|
84
|
+
avoid:
|
|
85
|
+
- lowering_risk_to_save_tokens
|
|
86
|
+
- treating_blocked_action_as_completed
|
|
87
|
+
- hiding_residual_critical_risk
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
id: protocol_router
|
|
2
|
+
type: read_router
|
|
3
|
+
version: 0.1
|
|
4
|
+
purpose: choose_minimum_protocol_files_by_task
|
|
5
|
+
default_read:
|
|
6
|
+
- fast-path.yaml
|
|
7
|
+
- modes.yaml
|
|
8
|
+
routes:
|
|
9
|
+
simple_answer:
|
|
10
|
+
risk: 0
|
|
11
|
+
read:
|
|
12
|
+
- fast-path.yaml
|
|
13
|
+
small_fix:
|
|
14
|
+
risk: 1
|
|
15
|
+
read:
|
|
16
|
+
- fast-path.yaml
|
|
17
|
+
- validation-checklist.yaml
|
|
18
|
+
user_flow_bug:
|
|
19
|
+
risk: 2
|
|
20
|
+
read:
|
|
21
|
+
- fast-path.yaml
|
|
22
|
+
- context-compiler.yaml
|
|
23
|
+
- risk-levels.yaml
|
|
24
|
+
- mapping-checklists.yaml
|
|
25
|
+
- validation-checklist.yaml
|
|
26
|
+
refactor:
|
|
27
|
+
risk: 2
|
|
28
|
+
read:
|
|
29
|
+
- fast-path.yaml
|
|
30
|
+
- context-compiler.yaml
|
|
31
|
+
- mapping-checklists.yaml
|
|
32
|
+
- validation-checklist.yaml
|
|
33
|
+
- spec-driven.yaml
|
|
34
|
+
feature_or_spec:
|
|
35
|
+
risk: 2
|
|
36
|
+
read:
|
|
37
|
+
- fast-path.yaml
|
|
38
|
+
- context-compiler.yaml
|
|
39
|
+
- risk-levels.yaml
|
|
40
|
+
- mapping-checklists.yaml
|
|
41
|
+
- validation-checklist.yaml
|
|
42
|
+
- spec-driven.yaml
|
|
43
|
+
docs_update:
|
|
44
|
+
risk: 1
|
|
45
|
+
read:
|
|
46
|
+
- fast-path.yaml
|
|
47
|
+
- context-rules.yaml
|
|
48
|
+
- formatting-rules.yaml
|
|
49
|
+
database_or_data:
|
|
50
|
+
risk: 3
|
|
51
|
+
read:
|
|
52
|
+
- fast-path.yaml
|
|
53
|
+
- context-compiler.yaml
|
|
54
|
+
- risk-levels.yaml
|
|
55
|
+
- mapping-checklists.yaml
|
|
56
|
+
- validation-checklist.yaml
|
|
57
|
+
- spec-driven.yaml
|
|
58
|
+
auth_security_secret:
|
|
59
|
+
risk: 3
|
|
60
|
+
read:
|
|
61
|
+
- fast-path.yaml
|
|
62
|
+
- context-compiler.yaml
|
|
63
|
+
- risk-levels.yaml
|
|
64
|
+
- mapping-checklists.yaml
|
|
65
|
+
- validation-checklist.yaml
|
|
66
|
+
- spec-driven.yaml
|
|
67
|
+
deploy_or_production:
|
|
68
|
+
risk: 3
|
|
69
|
+
read:
|
|
70
|
+
- fast-path.yaml
|
|
71
|
+
- context-compiler.yaml
|
|
72
|
+
- risk-levels.yaml
|
|
73
|
+
- validation-checklist.yaml
|
|
74
|
+
- context-rules.yaml
|
|
75
|
+
- spec-driven.yaml
|
|
76
|
+
evaluate_response:
|
|
77
|
+
read:
|
|
78
|
+
- fast-path.yaml
|
|
79
|
+
- ../eval/rubric.yaml
|
|
80
|
+
- ../schema/evaluated-response.schema.json
|
|
81
|
+
create_or_edit_yaml:
|
|
82
|
+
read:
|
|
83
|
+
- fast-path.yaml
|
|
84
|
+
- formatting-rules.yaml
|
|
85
|
+
- ../schema/protocol-rule.schema.yaml
|
|
86
|
+
prompt_improvement:
|
|
87
|
+
read:
|
|
88
|
+
- fast-path.yaml
|
|
89
|
+
- prompt-economy.yaml
|
|
90
|
+
context_optimization:
|
|
91
|
+
read:
|
|
92
|
+
- fast-path.yaml
|
|
93
|
+
- context-rules.yaml
|
|
94
|
+
- context-compiler.yaml
|
|
95
|
+
rules:
|
|
96
|
+
- start_with_default_read
|
|
97
|
+
- choose_one_route_if_task_type_is_clear
|
|
98
|
+
- if_route_unclear_read_risk_levels_then_choose_route
|
|
99
|
+
- do_not_read_docs_unless_protocol_is_insufficient
|
|
100
|
+
- do_not_read_cases_unless_testing_or_comparing_behavior
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
id: spec_driven
|
|
2
|
+
type: operational_rules
|
|
3
|
+
version: 0.1
|
|
4
|
+
purpose: use_spec_driven_only_when_it_improves_safety_or_clarity
|
|
5
|
+
principle: protocol_is_base_spec_is_tool
|
|
6
|
+
when_to_use:
|
|
7
|
+
- feature_with_multiple_steps
|
|
8
|
+
- unclear_scope_with_real_implementation
|
|
9
|
+
- level_2_change_with_cross_file_impact
|
|
10
|
+
- level_3_change_before_sensitive_action
|
|
11
|
+
- user_requests_spec_or_roadmap
|
|
12
|
+
when_not_to_use:
|
|
13
|
+
- simple_answer
|
|
14
|
+
- tiny_reversible_fix
|
|
15
|
+
- clear_low_risk_change
|
|
16
|
+
- user_only_wants_quick_explanation
|
|
17
|
+
spec_levels:
|
|
18
|
+
light_spec:
|
|
19
|
+
use_when:
|
|
20
|
+
- level_1_or_2
|
|
21
|
+
- small_feature_or_bug
|
|
22
|
+
max_lines: 12
|
|
23
|
+
fields:
|
|
24
|
+
- objective
|
|
25
|
+
- scope
|
|
26
|
+
- affected_area
|
|
27
|
+
- validation
|
|
28
|
+
full_spec:
|
|
29
|
+
use_when:
|
|
30
|
+
- level_2_large
|
|
31
|
+
- level_3
|
|
32
|
+
- multi_module_change
|
|
33
|
+
max_lines: 40
|
|
34
|
+
fields:
|
|
35
|
+
- objective
|
|
36
|
+
- non_goals
|
|
37
|
+
- assumptions
|
|
38
|
+
- affected_area
|
|
39
|
+
- risk
|
|
40
|
+
- implementation_steps
|
|
41
|
+
- validation
|
|
42
|
+
- rollback_or_recovery
|
|
43
|
+
rules:
|
|
44
|
+
- keep_spec_shorter_than_context_it_saves
|
|
45
|
+
- do_not_create_spec_for_low_value_tasks
|
|
46
|
+
- use_spec_to_reduce_ambiguity_not_to_delay_execution
|
|
47
|
+
- after_spec_execute_with_fast_path_router_and_validation
|
|
48
|
+
- update_spec_only_when_scope_changes
|
|
49
|
+
delivery:
|
|
50
|
+
include:
|
|
51
|
+
- spec_used_or_skipped
|
|
52
|
+
- reason
|
|
53
|
+
- validation_result
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
id: validation_checklist
|
|
2
|
+
type: checklist
|
|
3
|
+
version: 0.1
|
|
4
|
+
automatic_validation:
|
|
5
|
+
- unit_tests
|
|
6
|
+
- integration_tests
|
|
7
|
+
- typecheck
|
|
8
|
+
- build
|
|
9
|
+
- lint
|
|
10
|
+
- link_check
|
|
11
|
+
- diff_check
|
|
12
|
+
manual_validation:
|
|
13
|
+
fields:
|
|
14
|
+
- where_to_test
|
|
15
|
+
- steps
|
|
16
|
+
- expected_result
|
|
17
|
+
- regression_signals
|
|
18
|
+
required_when:
|
|
19
|
+
- user_visible_impact
|
|
20
|
+
- regression_risk
|
|
21
|
+
- could_break_existing_flow
|
|
22
|
+
- validation_not_fully_automated
|
|
23
|
+
delivery:
|
|
24
|
+
default_style: micro_when_low_risk
|
|
25
|
+
required_fields:
|
|
26
|
+
- prompt_original
|
|
27
|
+
- prompt_melhorado_da_ia
|
|
28
|
+
- changed
|
|
29
|
+
- validated
|
|
30
|
+
- residual_risk
|
|
31
|
+
- plain_language_summary
|
|
32
|
+
conditional_fields:
|
|
33
|
+
- not_validated_when_any_expected_validation_was_not_run
|
|
34
|
+
- tests_to_run_when_break_risk_exists
|
|
35
|
+
optional_fields:
|
|
36
|
+
- next_step
|
|
37
|
+
rules:
|
|
38
|
+
- id: VAL_001
|
|
39
|
+
never: claim_tested_if_not_tested
|
|
40
|
+
- id: VAL_002
|
|
41
|
+
if_validation_not_possible:
|
|
42
|
+
- record_reason
|
|
43
|
+
- indicate_expected_test
|
|
44
|
+
- id: VAL_003
|
|
45
|
+
when:
|
|
46
|
+
any:
|
|
47
|
+
- could_break_existing_flow
|
|
48
|
+
- regression_risk
|
|
49
|
+
- user_visible_impact
|
|
50
|
+
do:
|
|
51
|
+
- provide_manual_test_list
|
|
52
|
+
- include_where_to_test_steps_expected_result
|
|
53
|
+
- id: VAL_004
|
|
54
|
+
always:
|
|
55
|
+
- explain_changes_in_plain_language
|
|
56
|
+
- avoid_unexplained_jargon
|
|
57
|
+
- make_limits_and_residual_risk_understandable
|
|
58
|
+
- prefer_one_line_per_delivery_field
|
|
59
|
+
- use_micro_format_only_when_readable
|
package/install.ps1
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[string]$Target = ".",
|
|
3
|
+
[switch]$Force
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
$ErrorActionPreference = "Stop"
|
|
7
|
+
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
8
|
+
|
|
9
|
+
python "$root\scripts\build_dist.py"
|
|
10
|
+
|
|
11
|
+
$argsList = @("$root\scripts\install_protocol.py", "--target", $Target)
|
|
12
|
+
if ($Force) {
|
|
13
|
+
$argsList += "--force"
|
|
14
|
+
}
|
|
15
|
+
python @argsList
|
|
16
|
+
python "$root\scripts\verify_install.py" --target $Target
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ai-execution-protocol",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Experimental AI execution protocol for safer agent workflows, minimal context, risk classification, validation, and evidence-based delivery.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "AI Execution Protocol",
|
|
8
|
+
"homepage": "https://github.com/rodneigk2/ai-execution-protocol#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/rodneigk2/ai-execution-protocol.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/rodneigk2/ai-execution-protocol/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai",
|
|
18
|
+
"agent",
|
|
19
|
+
"codex",
|
|
20
|
+
"protocol",
|
|
21
|
+
"risk",
|
|
22
|
+
"validation",
|
|
23
|
+
"prompt"
|
|
24
|
+
],
|
|
25
|
+
"bin": {
|
|
26
|
+
"ai-protocol": "scripts/npm_install_protocol.js"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"AGENTS.md",
|
|
30
|
+
"README.md",
|
|
31
|
+
"install.ps1",
|
|
32
|
+
"scripts/build_dist.py",
|
|
33
|
+
"scripts/install_protocol.py",
|
|
34
|
+
"scripts/npm_install_protocol.js",
|
|
35
|
+
"scripts/verify_install.py",
|
|
36
|
+
"protocol/",
|
|
37
|
+
"dist/minimal/"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"prepack": "python scripts/build_dist.py",
|
|
41
|
+
"init-protocol": "node scripts/npm_install_protocol.js init",
|
|
42
|
+
"install-protocol": "node scripts/npm_install_protocol.js install",
|
|
43
|
+
"dry-run-protocol": "node scripts/npm_install_protocol.js install --dry-run",
|
|
44
|
+
"verify-protocol": "node scripts/npm_install_protocol.js verify"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
id: protocol_index
|
|
2
|
+
type: index
|
|
3
|
+
format: yaml
|
|
4
|
+
protocol_version: 0.1.0
|
|
5
|
+
purpose: ai_operational_rules
|
|
6
|
+
source_docs: ../docs
|
|
7
|
+
constraints:
|
|
8
|
+
max_lines_per_file: 400
|
|
9
|
+
ai_first_readability: true
|
|
10
|
+
compact_rules: true
|
|
11
|
+
files:
|
|
12
|
+
- path: fast-path.yaml
|
|
13
|
+
purpose: minimum_rules_to_start_any_task
|
|
14
|
+
- path: router.yaml
|
|
15
|
+
purpose: choose_minimum_files_to_read_by_task
|
|
16
|
+
- path: modes.yaml
|
|
17
|
+
purpose: choose_fast_balanced_or_strict_behavior
|
|
18
|
+
- path: execution-rules.yaml
|
|
19
|
+
purpose: execution_flow_and_core_behavior
|
|
20
|
+
- path: risk-levels.yaml
|
|
21
|
+
purpose: risk_classification_and_confirmation
|
|
22
|
+
- path: mapping-checklists.yaml
|
|
23
|
+
purpose: pre_change_maps_by_risk
|
|
24
|
+
- path: validation-checklist.yaml
|
|
25
|
+
purpose: validation_and_final_delivery
|
|
26
|
+
- path: context-rules.yaml
|
|
27
|
+
purpose: context_window_file_size_memory
|
|
28
|
+
- path: context-compiler.yaml
|
|
29
|
+
purpose: compile_minimum_context_package_and_canonical_state
|
|
30
|
+
- path: formatting-rules.yaml
|
|
31
|
+
purpose: ai_readable_file_format
|
|
32
|
+
- path: prompt-economy.yaml
|
|
33
|
+
purpose: improve_prompts_without_token_bloat
|
|
34
|
+
- path: spec-driven.yaml
|
|
35
|
+
purpose: use_light_or_full_specs_only_when_they_reduce_risk
|