@homericintelligence/athena-opencode 0.4.4 → 0.5.1
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/README.md +30 -17
- package/package.json +2 -2
- package/plugin.js +20 -5
- package/skills/TECHNICAL_ENGLISH.md +78 -0
- package/skills/_cli.py +26 -18
- package/skills/_support/docs/dependency-resolution.md +192 -0
- package/skills/_support/docs/policies/development.md +117 -0
- package/skills/_support/docs/policies/evidence-integrity.md +40 -0
- package/skills/_support/docs/principles/README.md +542 -0
- package/skills/_support/docs/principles/details/p001-kiss.md +114 -0
- package/skills/_support/docs/principles/details/p002-yagni.md +109 -0
- package/skills/_support/docs/principles/details/p003-dry.md +126 -0
- package/skills/_support/docs/principles/details/p004-solid.md +165 -0
- package/skills/_support/docs/principles/details/p005-modularity.md +123 -0
- package/skills/_support/docs/principles/details/p006-principle-of-least-astonishment.md +115 -0
- package/skills/_support/docs/principles/details/p007-subtraction-over-addition.md +113 -0
- package/skills/_support/docs/principles/details/p008-understand-before-subtracting.md +115 -0
- package/skills/_support/docs/principles/details/p009-general-mechanisms-over-special-cases.md +108 -0
- package/skills/_support/docs/principles/details/p010-scope-fidelity.md +117 -0
- package/skills/_support/docs/principles/details/p011-minimal-coherent-change.md +128 -0
- package/skills/_support/docs/principles/details/p012-evidence-before-modification.md +115 -0
- package/skills/_support/docs/principles/details/p013-avoid-hasty-abstractions.md +112 -0
- package/skills/_support/docs/principles/details/p014-preserve-unrequested-behavior.md +110 -0
- package/skills/_support/docs/principles/details/p015-architecture-conformance.md +124 -0
- package/skills/_support/docs/principles/details/p016-separation-of-concerns.md +125 -0
- package/skills/_support/docs/principles/details/p017-high-cohesion-low-coupling.md +130 -0
- package/skills/_support/docs/principles/details/p018-information-hiding.md +128 -0
- package/skills/_support/docs/principles/details/p019-explicit-contracts.md +134 -0
- package/skills/_support/docs/principles/details/p020-executable-architecture.md +130 -0
- package/skills/_support/docs/principles/details/p021-evolutionary-and-reversible-design.md +126 -0
- package/skills/_support/docs/principles/details/p022-test-behavior-not-implementation.md +129 -0
- package/skills/_support/docs/principles/details/p023-parameterized-table-driven-testing.md +129 -0
- package/skills/_support/docs/principles/details/p024-boundary-value-testing.md +128 -0
- package/skills/_support/docs/principles/details/p025-property-based-testing-for-invariants.md +133 -0
- package/skills/_support/docs/principles/details/p026-regression-before-repair.md +134 -0
- package/skills/_support/docs/principles/details/p027-deterministic-and-hermetic-tests.md +128 -0
- package/skills/_support/docs/principles/details/p028-test-failure-paths.md +133 -0
- package/skills/_support/docs/principles/details/p029-generalize-error-policy-preserve-specific-cause.md +131 -0
- package/skills/_support/docs/principles/details/p030-nearest-responsible-error-boundary.md +133 -0
- package/skills/_support/docs/principles/details/p031-propagate-rather-than-swallow.md +131 -0
- package/skills/_support/docs/principles/details/p032-handle-once-preserve-causality.md +137 -0
- package/skills/_support/docs/principles/details/p033-state-safe-failure-semantics.md +140 -0
- package/skills/_support/docs/principles/details/p034-fail-fast.md +132 -0
- package/skills/_support/docs/principles/details/p035-fail-secure-fail-closed.md +137 -0
- package/skills/_support/docs/principles/details/p036-graceful-degradation.md +137 -0
- package/skills/_support/docs/principles/details/p037-idempotency-before-retry.md +139 -0
- package/skills/_support/docs/principles/details/p038-bounded-retry.md +145 -0
- package/skills/_support/docs/principles/details/p039-bounded-waiting.md +151 -0
- package/skills/_support/docs/principles/details/p040-bounded-resources.md +138 -0
- package/skills/_support/docs/principles/details/p041-backpressure-and-load-shedding.md +141 -0
- package/skills/_support/docs/principles/details/p042-fault-isolation-bulkheads.md +140 -0
- package/skills/_support/docs/principles/details/p043-circuit-breakers.md +148 -0
- package/skills/_support/docs/principles/details/p044-atomicity-where-possible.md +141 -0
- package/skills/_support/docs/principles/details/p045-compensation-where-atomicity-is-impossible.md +163 -0
- package/skills/_support/docs/principles/details/p046-resumability.md +138 -0
- package/skills/_support/docs/principles/details/p047-observability-is-part-of-correctness.md +134 -0
- package/skills/_support/docs/principles/details/p048-secure-by-design.md +132 -0
- package/skills/_support/docs/principles/details/p049-secure-by-default.md +126 -0
- package/skills/_support/docs/principles/details/p050-least-privilege.md +123 -0
- package/skills/_support/docs/principles/details/p051-complete-mediation.md +124 -0
- package/skills/_support/docs/principles/details/p052-separation-of-duties.md +129 -0
- package/skills/_support/docs/principles/details/p053-validate-at-trust-boundaries.md +126 -0
- package/skills/_support/docs/principles/details/p054-defense-in-depth.md +135 -0
- package/skills/_support/docs/principles/details/p055-minimize-attack-surface.md +133 -0
- package/skills/_support/docs/principles/details/p056-secrets-stay-out-of-code-and-context.md +137 -0
- package/skills/_support/docs/principles/details/p057-supply-chain-integrity.md +135 -0
- package/skills/_support/docs/principles/details/p058-bounded-agent-authority.md +137 -0
- package/skills/_support/docs/principles/details/p059-data-is-not-instruction.md +130 -0
- package/skills/_support/docs/principles/details/p060-constrain-sub-agents.md +136 -0
- package/skills/_support/docs/principles/details/p061-separate-decision-from-high-impact-execution.md +131 -0
- package/skills/_support/docs/principles/details/p062-human-approval-for-irreversible-or-high-risk-actions.md +129 -0
- package/skills/_support/docs/principles/details/p063-requirement-to-code-traceability.md +116 -0
- package/skills/_support/docs/principles/details/p064-requirement-to-test-traceability.md +116 -0
- package/skills/_support/docs/principles/details/p065-verify-before-claiming-completion.md +129 -0
- package/skills/_support/docs/principles/details/p066-preserve-existing-work.md +114 -0
- package/skills/_support/docs/principles/details/p067-no-test-cheating.md +126 -0
- package/skills/_support/docs/principles/details/p068-no-validation-bypass.md +119 -0
- package/skills/_support/docs/principles/details/p069-independent-review-for-high-risk-changes.md +129 -0
- package/skills/_support/docs/principles/details/p070-code-health-must-not-regress.md +116 -0
- package/skills/_support/docs/principles/details/p071-consistency-over-personal-preference.md +117 -0
- package/skills/_support/docs/principles/details/p072-technical-evidence-over-preference.md +122 -0
- package/skills/_support/docs/principles/details/p073-optimize-only-with-evidence.md +123 -0
- package/skills/_support/docs/principles/details/p074-prefer-existing-mechanisms.md +121 -0
- package/skills/_support/docs/principles/details/p075-make-invalid-states-hard-to-represent.md +128 -0
- package/skills/_support/docs/principles/details/p076-parse-then-validate-then-operate.md +133 -0
- package/skills/_support/docs/principles/details/p077-separate-policy-from-mechanism.md +112 -0
- package/skills/_support/docs/principles/details/p078-single-source-of-truth.md +131 -0
- package/skills/_support/docs/principles/details/p079-explicit-ownership-and-lifetimes.md +124 -0
- package/skills/_support/docs/principles/details/p080-make-concurrency-deliberate.md +122 -0
- package/skills/_support/docs/principles/details/p081-forward-progress-with-safety.md +125 -0
- package/skills/_support/docs/principles/details/p082-design-for-cancellation.md +133 -0
- package/skills/_support/docs/principles/details/p083-irreversible-actions-last.md +124 -0
- package/skills/_support/docs/principles/details/p084-prefer-local-reasoning.md +131 -0
- package/skills/_support/docs/principles/details/p085-explicit-is-better-than-implicit.md +123 -0
- package/skills/_support/docs/principles/details/p086-readability-counts.md +113 -0
- package/skills/_support/docs/principles/details/p087-comments-explain-why-code-explains-what.md +120 -0
- package/skills/_support/docs/principles/details/p088-delete-dead-code.md +125 -0
- package/skills/_support/docs/principles/details/p089-delete-obsolete-configuration-and-dependencies.md +125 -0
- package/skills/_support/docs/principles/details/p090-prefer-negative-code.md +134 -0
- package/skills/_support/docs/principles/details/p091-test-driven-development.md +149 -0
- package/skills/_support/docs/review/README.md +59 -0
- package/skills/_support/docs/review/behavior-first-testing.md +73 -0
- package/skills/_support/docs/review/common.md +365 -0
- package/skills/_support/docs/review/design-docs.md +74 -0
- package/skills/_support/docs/review/issue-planning.md +220 -0
- package/skills/_support/docs/review/language-routing.md +141 -0
- package/skills/_support/docs/review/repository-scorecard.md +170 -0
- package/skills/advise/SKILL.md +102 -40
- package/skills/advise/scripts/list_retrievable_skills.py +3 -3
- package/skills/brainstorm/SKILL.md +167 -76
- package/skills/change-review/SKILL.md +99 -43
- package/skills/change-review/references/scope-resolution.md +70 -41
- package/skills/change-review/scripts/resolve_scope.py +119 -73
- package/skills/finalize-plan/SKILL.md +208 -100
- package/skills/git-worktrees/SKILL.md +108 -59
- package/skills/git-worktrees/scripts/prepare_worktree.py +16 -10
- package/skills/issue-review/SKILL.md +143 -47
- package/skills/learn/SKILL.md +284 -162
- package/skills/myrmidon-swarm/SKILL.md +136 -61
- package/skills/plan-issue/SKILL.md +129 -47
- package/skills/pr-review/SKILL.md +170 -71
- package/skills/pr-review/references/criteria.md +61 -14
- package/skills/pr-review/references/delivery.md +159 -80
- package/skills/pr-review/references/evidence.md +268 -139
- package/skills/pr-review/references/prevalidated.md +91 -48
- package/skills/pr-review/scripts/collect_evidence.py +211 -140
- package/skills/pr-review/scripts/diff_context.py +6 -4
- package/skills/pr-review/scripts/materialize_snapshot.py +112 -120
- package/skills/pr-review/scripts/pr_identity.py +27 -15
- package/skills/pr-review/scripts/resolve_pr.py +53 -31
- package/skills/repo-review/SKILL.md +209 -87
- package/skills/systematic-debugging/SKILL.md +195 -131
- package/skills/systematic-debugging/scripts/repository_evidence.py +9 -4
- package/skills/test-driven-development/SKILL.md +134 -53
- package/skills/tidy/SKILL.md +97 -33
- package/skills/tidy/scripts/run_tidy.py +3 -3
|
@@ -1,129 +1,237 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: finalize-plan
|
|
3
3
|
license: BSD-3-Clause
|
|
4
|
-
description:
|
|
4
|
+
description: Create an issue body after `plan-issue` and `issue-review` approve one exact actor-owned epoch with `GO`. `--draft` is read-only. Stop if an input is missing, foreign, stale, ambiguous, or not verifiable.
|
|
5
5
|
argument-hint: "[--draft] ISSUE_NUMBER_OR_URL"
|
|
6
6
|
allowed-tools: [Read, Bash, Grep, Glob]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Finalize an approved issue plan
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[
|
|
18
|
-
[
|
|
11
|
+
Purpose: Make the approved plan the implementation entry point. Do not convert review history,
|
|
12
|
+
suggestions, or generated text into requirements.
|
|
13
|
+
|
|
14
|
+
Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to all
|
|
15
|
+
prose that it produces.
|
|
16
|
+
|
|
17
|
+
Use the shared [issue-planning contract](../_support/docs/review/issue-planning.md),
|
|
18
|
+
[review contract](../_support/docs/review/common.md),
|
|
19
|
+
[design-document structure](../_support/docs/review/design-docs.md),
|
|
20
|
+
[language routing](../_support/docs/review/language-routing.md), and
|
|
21
|
+
[behavior-first testing](../_support/docs/review/behavior-first-testing.md).
|
|
22
|
+
|
|
23
|
+
## Engineering principles
|
|
24
|
+
|
|
25
|
+
Use the canonical [engineering-principles catalog](../_support/docs/principles/README.md) to make these
|
|
26
|
+
finalization decisions:
|
|
27
|
+
|
|
28
|
+
- [P010 Scope Fidelity](../_support/docs/principles/README.md#p010): Change only the issue body and the two
|
|
29
|
+
sealed, actor-owned comments for the verified epoch.
|
|
30
|
+
- [P061 Separate Decision from High-Impact Execution](../_support/docs/principles/README.md#p061): Before a
|
|
31
|
+
write, make sure that the epoch and authority agree with this skill's delivery contract.
|
|
32
|
+
- [P062 Human Approval for Irreversible or High-Risk Actions](../_support/docs/principles/README.md#p062):
|
|
33
|
+
If the delivery contract gives authority for the write, continue without a second approval.
|
|
34
|
+
- [P063 Requirement-to-Code Traceability](../_support/docs/principles/README.md#p063): Map each source
|
|
35
|
+
requirement to the issue body without information loss.
|
|
36
|
+
- [P065 Verify Before Claiming Completion](../_support/docs/principles/README.md#p065): Before you report
|
|
37
|
+
that finalization is completed, read the issue body. Make sure that it is the same as the approved
|
|
38
|
+
body.
|
|
39
|
+
- [P044 Atomicity Where Possible](../_support/docs/principles/README.md#p044): Use one body update for the
|
|
40
|
+
replacement.
|
|
41
|
+
- [P083 Irreversible Actions Last](../_support/docs/principles/README.md#p083): Do not remove an applicable
|
|
42
|
+
comment before you verify the body update.
|
|
43
|
+
- [P031 Propagate Rather Than Swallow](../_support/docs/principles/README.md#p031): Report each partial or
|
|
44
|
+
unknown outcome. Do not report a different outcome. Do not automatically retry the update.
|
|
19
45
|
|
|
20
46
|
## Scope and delivery
|
|
21
47
|
|
|
22
|
-
`--draft` is read-only.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
`--draft` is read-only. If you do not use `--draft`, first revalidate the authority and target under
|
|
49
|
+
[P061 Separate Decision from High-Impact Execution](../_support/docs/principles/README.md#p061). This skill
|
|
50
|
+
can then replace the resolved issue body one time. Only after an exact body readback, it can delete
|
|
51
|
+
the two sealed, actor-owned plan and review comments. Do not update these items:
|
|
52
|
+
|
|
53
|
+
- title;
|
|
54
|
+
- labels;
|
|
55
|
+
- assignment;
|
|
56
|
+
- milestone;
|
|
57
|
+
- project fields;
|
|
58
|
+
- state;
|
|
59
|
+
- branches;
|
|
60
|
+
- pull requests; or
|
|
61
|
+
- repository files.
|
|
62
|
+
|
|
63
|
+
After the skill removes the intermediate comments, the finalized body must retain the required
|
|
64
|
+
provenance.
|
|
65
|
+
|
|
66
|
+
Use the forge's native issue-body mechanism. The host must have these capabilities:
|
|
67
|
+
|
|
68
|
+
- authenticate the actor;
|
|
69
|
+
- enumerate exact comments;
|
|
70
|
+
- delete exact comments;
|
|
71
|
+
- read the issue body;
|
|
72
|
+
- compare identities;
|
|
73
|
+
- make one exact body update; and
|
|
74
|
+
- read back that body update.
|
|
75
|
+
|
|
76
|
+
If one capability is not available, return a ready-to-publish draft. Identify the capability gap.
|
|
77
|
+
Do not create plan or review comments to make finalization possible. Do not adopt plan or review
|
|
78
|
+
comments for this purpose. Do not edit plan or review comments for this purpose. Do not replace plan
|
|
79
|
+
or review comments for this purpose.
|
|
34
80
|
|
|
35
81
|
## Finalized planning epoch
|
|
36
82
|
|
|
37
|
-
|
|
83
|
+
A planning epoch is one set of these sealed source identities:
|
|
38
84
|
|
|
39
|
-
- `R
|
|
40
|
-
title, body, and acceptance criteria before finalization
|
|
41
|
-
- `P
|
|
42
|
-
|
|
43
|
-
- `V
|
|
44
|
-
|
|
85
|
+
- `R` is the canonical digest of the original issue requirements. It contains the exact issue ID,
|
|
86
|
+
title, body, and acceptance criteria before finalization.
|
|
87
|
+
- `P` identifies one actor-owned `<!-- athena:plan-issue -->` comment ID and its canonical plan-content
|
|
88
|
+
digest.
|
|
89
|
+
- `V` identifies one actor-owned `<!-- athena:issue-review -->` comment ID and its review-content
|
|
90
|
+
digest.
|
|
45
91
|
|
|
46
|
-
The review must
|
|
47
|
-
|
|
48
|
-
`major`, or other `required` finding.
|
|
49
|
-
foreign, duplicated, absent, or
|
|
92
|
+
The review must contain the same issue, `R`, plan-comment ID, and `P`. These values must match
|
|
93
|
+
exactly. The review must have the exact `GO` disposition. It must not have an unresolved `critical`,
|
|
94
|
+
`major`, or other `required` finding. Do not write if an artifact is conditional, partial,
|
|
95
|
+
malformed, stale, foreign, duplicated, absent, or not verifiable.
|
|
50
96
|
|
|
51
|
-
|
|
52
|
-
`<!-- athena:finalize-plan R=<R> P=<P> V=<V> F=<F> -->`.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
97
|
+
Record exactly one marker in the rendered body:
|
|
98
|
+
`<!-- athena:finalize-plan R=<R> P=<P> V=<V> F=<F> -->`. Before you calculate `F`, use the literal
|
|
99
|
+
`<F>` placeholder as the marker's `F` value. Calculate `F` from the final body. Do not calculate a
|
|
100
|
+
digest from a marker that contains its own digest. The marker identifies the sealed source
|
|
101
|
+
identities separately from the generated body. It also permits later readback verification without
|
|
102
|
+
recursion.
|
|
57
103
|
|
|
58
104
|
## Finalize
|
|
59
105
|
|
|
60
|
-
1. Resolve one exact issue
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
1. Resolve one exact issue with its node or URL, title, body, state, and authenticated actor.
|
|
107
|
+
2. Before you interpret a marker, enumerate each current comment.
|
|
108
|
+
3. Resolve exactly one actor-owned plan marker.
|
|
109
|
+
4. Resolve exactly one actor-owned review marker.
|
|
110
|
+
5. Calculate `R/P/V`.
|
|
111
|
+
6. Verify the review bindings and the clean `GO` result.
|
|
112
|
+
7. If ownership, multiplicity, binding, disposition, or required-finding verification fails, do not
|
|
113
|
+
write.
|
|
114
|
+
8. Build a compact and lossless final body.
|
|
115
|
+
9. Apply [P001 KISS — Keep It Simple, Stupid](../_support/docs/principles/README.md#p001) only to the
|
|
116
|
+
sealed content.
|
|
117
|
+
10. Make the presentation simple.
|
|
118
|
+
11. Do not remove a requirement.
|
|
119
|
+
12. Do not change the meaning of the approved architecture.
|
|
120
|
+
13. Start the final body with **Why**.
|
|
121
|
+
14. Preserve the original problem, outcome, and requirements that cannot change.
|
|
122
|
+
15. If a system diagram makes at least three relationships, boundaries, or state transitions
|
|
123
|
+
clearer, include it.
|
|
124
|
+
16. Include the architecture description, implementation plan, operations, and provenance.
|
|
125
|
+
17. Preserve all items in this list:
|
|
126
|
+
|
|
127
|
+
- acceptance criteria;
|
|
128
|
+
- implementation boundaries;
|
|
129
|
+
- validation;
|
|
130
|
+
- migration or cutover steps;
|
|
131
|
+
- rollback conditions;
|
|
132
|
+
- dependencies;
|
|
133
|
+
- residual risks; and
|
|
134
|
+
- out-of-scope decisions.
|
|
135
|
+
|
|
136
|
+
18. Unless the reviewed canonical plan adopted a review suggestion, record the suggestion as optional
|
|
137
|
+
residual context.
|
|
138
|
+
19. Do not invent files, commands, requirements, architecture, implementation results, or validation
|
|
139
|
+
evidence.
|
|
140
|
+
20. If a smaller lossless result is sufficient, do not copy historical revision transcripts.
|
|
141
|
+
21. If a smaller lossless result is sufficient, do not duplicate the plan and review verbatim.
|
|
142
|
+
22. Add the finalized marker.
|
|
143
|
+
23. Calculate `F` from its canonical representation that does not contain its own value.
|
|
144
|
+
24. If the user selects `--draft`, return the complete body, `R`, `P`, `V`, `F`, and source links.
|
|
145
|
+
25. For `--draft`, return all reasons for withheld writes.
|
|
146
|
+
26. For `--draft`, do not make a forge write.
|
|
147
|
+
27. Immediately before publication, apply
|
|
148
|
+
[P061 Separate Decision from High-Impact Execution](../_support/docs/principles/README.md#p061).
|
|
149
|
+
28. For this check, resolve the issue, actor, each comment and marker, `R`, `P`, `V`, review
|
|
150
|
+
disposition, and target body again.
|
|
151
|
+
29. If an input changed, return the ready-to-publish body with the `stale` status.
|
|
152
|
+
30. After an input changes, do not write.
|
|
153
|
+
31. Under [P044 Atomicity Where Possible](../_support/docs/principles/README.md#p044), publish exactly one
|
|
154
|
+
issue-body replacement.
|
|
155
|
+
32. Immediately read the issue again.
|
|
156
|
+
33. Under [P065 Verify Before Claiming Completion](../_support/docs/principles/README.md#p065), verify the
|
|
157
|
+
exact body, marker, `R`, `P`, `V`, and `F`.
|
|
158
|
+
34. If a timeout, indeterminate response, or readback mismatch occurs, report `unknown-outcome`.
|
|
159
|
+
35. After a timeout, indeterminate response, or readback mismatch, do not retry.
|
|
160
|
+
36. After a timeout, indeterminate response, or readback mismatch, do not make another mutation.
|
|
161
|
+
37. Only after a successful body readback, use
|
|
162
|
+
[P083 Irreversible Actions Last](../_support/docs/principles/README.md#p083) to read each sealed comment
|
|
163
|
+
again.
|
|
164
|
+
38. Verify the exact ID, actor, marker, and digest of each sealed comment.
|
|
165
|
+
39. Delete the plan comment only after its exact verification.
|
|
166
|
+
40. Delete the review comment only after its exact verification.
|
|
167
|
+
41. Do not delete a foreign, replacement, or changed comment.
|
|
168
|
+
42. If deletion fails, times out, or has an indeterminate result, report `partial-cleanup`.
|
|
169
|
+
43. State that an indeterminate deletion result is unknown.
|
|
170
|
+
44. After a deletion failure, timeout, or indeterminate result, do not retry.
|
|
171
|
+
45. After a deletion failure, timeout, or indeterminate result, do not compensate.
|
|
172
|
+
46. After a deletion failure, timeout, or indeterminate result, do not remove the finalized body.
|
|
173
|
+
47. After a deletion failure, timeout, or indeterminate result, report the identities of the comments
|
|
174
|
+
that remain.
|
|
175
|
+
|
|
176
|
+
If the final material contains architecture, test, error, or security decisions, preserve the
|
|
177
|
+
reviewed use of these principles:
|
|
178
|
+
|
|
179
|
+
- [P015 Architecture Conformance](../_support/docs/principles/README.md#p015);
|
|
180
|
+
- [P022 Test Behavior, Not Implementation](../_support/docs/principles/README.md#p022);
|
|
181
|
+
- [P029 Generalize Error Policy; Preserve Specific Cause](../_support/docs/principles/README.md#p029); and
|
|
182
|
+
- [P048 Secure by Design](../_support/docs/principles/README.md#p048).
|
|
183
|
+
|
|
184
|
+
Finalization does not reopen these decisions. Do not make new decisions.
|
|
185
|
+
|
|
186
|
+
## Finalize again or restart
|
|
187
|
+
|
|
188
|
+
If the live body verifies its finalized marker exactly and both sealed comments are absent, a second
|
|
189
|
+
run returns a documented `no-change` result. If a sealed comment remains, report
|
|
190
|
+
`partial-cleanup`. Its presence does not authorize another deletion attempt. If the marker is absent,
|
|
191
|
+
malformed, foreign, or has a canonical `F` mismatch, do not use the epoch as evidence. A later
|
|
192
|
+
substantive edit by a person creates a new requirements state. Before another finalization, this new
|
|
193
|
+
state must pass a new `plan-issue` and `issue-review` cycle. Do not treat generated plan text or
|
|
194
|
+
provenance fields as new requirements from a person.
|
|
105
195
|
|
|
106
196
|
## Behavior-first verification
|
|
107
197
|
|
|
108
|
-
Use controlled issue, comment, actor, and forge fixtures to demonstrate:
|
|
198
|
+
Use controlled issue, comment, actor, and forge fixtures to demonstrate these behaviors:
|
|
199
|
+
|
|
200
|
+
- A clean `GO` plan and review epoch preserves requirements and operational details.
|
|
201
|
+
- `--draft` returns the body without a forge mutation.
|
|
202
|
+
- Publication makes one body update. It verifies the exact readback. Then it deletes only the two
|
|
203
|
+
sealed actor-owned comments.
|
|
204
|
+
- A sealed epoch that did not change is idempotent.
|
|
205
|
+
- Each absent, foreign, duplicate, mismatched, stale, `NO-GO`, required-finding, drift,
|
|
206
|
+
unsupported-write, timeout, readback-mismatch, or deletion-uncertainty case stops before an unsafe
|
|
207
|
+
mutation or retry.
|
|
208
|
+
|
|
209
|
+
Verify the identities and order classes. Verify content preservation and the number and scope of
|
|
210
|
+
mutations. Verify that failures occur before a write. Do not make tests depend on editorial wording,
|
|
211
|
+
headings, paragraph counts, or an example issue body.
|
|
109
212
|
|
|
110
|
-
|
|
111
|
-
- `--draft` returns the body without a forge mutation;
|
|
112
|
-
- publish performs one body update, verifies its exact readback, then deletes
|
|
113
|
-
only the two sealed actor-owned comments;
|
|
114
|
-
- an unchanged sealed epoch is idempotent; and
|
|
115
|
-
- every absent, foreign, duplicate, mismatched, stale, NO-GO, required-finding,
|
|
116
|
-
drift, unsupported-write, timeout, readback-mismatch, or deletion-uncertainty
|
|
117
|
-
case fails before an unsafe mutation or retry.
|
|
213
|
+
## Failed approaches
|
|
118
214
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
215
|
+
- Do not finalize an epoch again without a new request or a new requirements state.
|
|
216
|
+
- Do not treat generated plan text or sealed provenance fields as new executable requirements from
|
|
217
|
+
a person.
|
|
218
|
+
- Do not replace behavior-first verification with wording checks. Do not invent files, commands, or
|
|
219
|
+
validation evidence during synthesis.
|
|
220
|
+
- After a timeout or readback mismatch, do not retry. Report `unknown-outcome`.
|
|
221
|
+
- After an indeterminate deletion, do not retry. Report `partial-cleanup`. State that the deletion
|
|
222
|
+
result is unknown.
|
|
122
223
|
|
|
123
224
|
## Result
|
|
124
225
|
|
|
125
|
-
Return
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
226
|
+
Return these items:
|
|
227
|
+
|
|
228
|
+
- issue and actor identities;
|
|
229
|
+
- `R/P/V/F`;
|
|
230
|
+
- the `GO` decision and finding summary;
|
|
231
|
+
- the requirement-preservation map;
|
|
232
|
+
- the exact `draft`, `no-change`, `published`, `stale`, `partial-cleanup`, or `unknown-outcome`
|
|
233
|
+
status;
|
|
234
|
+
- the body-update receipt;
|
|
235
|
+
- readback evidence;
|
|
236
|
+
- deleted-comment receipts, if present; and
|
|
237
|
+
- each unresolved capability or residual risk.
|
|
@@ -1,112 +1,161 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: git-worktrees
|
|
3
3
|
license: BSD-3-Clause
|
|
4
|
-
description: Use
|
|
4
|
+
description: Use for feature work that needs an isolated Git worktree. If Git does not ignore a project-local directory, use the verified temporary-directory fallback. If repository guidance requires the local directory, report the problem. In that case, stop before creation. If the helper cannot verify a clean base commit, report the problem. In that case, stop before creation. Do not delete anything.
|
|
5
5
|
argument-hint: <branch-name or feature description>
|
|
6
6
|
allowed-tools: [Bash, Read]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# Use Git worktrees
|
|
10
10
|
|
|
11
11
|
## Overview
|
|
12
12
|
|
|
13
|
-
Git worktrees
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
Git worktrees are isolated workspaces that share one repository. You can work on multiple branches
|
|
14
|
+
at the same time. You do not have to switch the active branch.
|
|
15
|
+
|
|
16
|
+
Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to all
|
|
17
|
+
prose that it produces.
|
|
18
|
+
|
|
19
|
+
**Rule:** Select the directory systematically. Then complete the safety checks. These actions give
|
|
20
|
+
reliable isolation.
|
|
21
|
+
|
|
22
|
+
**Do not use this skill for `myrmidon-swarm` worktrees.** That skill creates worktrees for its
|
|
23
|
+
background subagents. Use this skill for manual development work.
|
|
24
|
+
|
|
25
|
+
## Engineering principles
|
|
26
|
+
|
|
27
|
+
Use the [canonical engineering-principles catalog](../_support/docs/principles/README.md) for these
|
|
28
|
+
workflow-specific rules:
|
|
29
|
+
|
|
30
|
+
- [P010 — Scope Fidelity](../_support/docs/principles/README.md#p010): Make only the requested isolated
|
|
31
|
+
branch and worktree. Delegate cleanup and unrelated changes to the applicable workflows.
|
|
32
|
+
- [P012 — Evidence Before Modification](../_support/docs/principles/README.md#p012): Before creation,
|
|
33
|
+
examine repository guidance, the selected base revision, directory state, ignore rules, and
|
|
34
|
+
baseline checks.
|
|
35
|
+
- [P021 — Evolutionary and Reversible Design](../_support/docs/principles/README.md#p021): Put feature work
|
|
36
|
+
in an isolated worktree at the selected base commit. Only if you have user authority and can use
|
|
37
|
+
the cleanup workflow, remove the worktree.
|
|
38
|
+
- [P033 — State-Safe Failure Semantics](../_support/docs/principles/README.md#p033): If validation is not
|
|
39
|
+
satisfactory, stop before creation. If setup or a test after creation is not satisfactory, keep
|
|
40
|
+
the worktree.
|
|
41
|
+
- [P053 — Validate at Trust Boundaries](../_support/docs/principles/README.md#p053): Use the tested helper
|
|
42
|
+
to validate branch, base, path, and path-root values. Do not use these values in a Git command
|
|
43
|
+
without the helper.
|
|
44
|
+
- [P058 — Bounded Agent Authority](../_support/docs/principles/README.md#p058): Make only the named branch
|
|
45
|
+
and worktree for the requested feature. Use the selected start commit and validated destination.
|
|
46
|
+
- [P065 — Verify Before Claiming Completion](../_support/docs/principles/README.md#p065): Before you report
|
|
47
|
+
that you prepared the worktree, do the repository checks for a clean baseline. Report the path
|
|
48
|
+
and start commit.
|
|
49
|
+
- [P083 — Irreversible Actions Last](../_support/docs/principles/README.md#p083): Before creation, complete
|
|
50
|
+
the dry-run. Before creation, complete the safety validation. Use `tidy` for removal.
|
|
51
|
+
|
|
52
|
+
## Select the directory
|
|
21
53
|
|
|
22
54
|
Follow this priority order:
|
|
23
55
|
|
|
24
|
-
### 1. Check
|
|
56
|
+
### 1. Check existing directories
|
|
25
57
|
|
|
26
58
|
The tested `scripts/prepare_worktree.py` helper checks `.worktrees` and then `worktrees`. If both
|
|
27
|
-
exist, `.worktrees
|
|
59
|
+
directories exist, the helper selects `.worktrees`.
|
|
28
60
|
|
|
29
61
|
### 2. Check repository guidance
|
|
30
62
|
|
|
31
|
-
Read `AGENTS.md` and its referenced repository guidance. If
|
|
32
|
-
the helper with `--directory DIRECTORY`.
|
|
63
|
+
Read `AGENTS.md` and its referenced repository guidance. If repository guidance specifies a
|
|
64
|
+
preference, pass it to the helper with `--directory DIRECTORY`.
|
|
33
65
|
|
|
34
66
|
### 3. Portable default
|
|
35
67
|
|
|
36
|
-
|
|
37
|
-
`tempfile.gettempdir()` with `<project>-<branch>`.
|
|
38
|
-
|
|
68
|
+
If the repository does not specify a location, use the host temporary directory from
|
|
69
|
+
`tempfile.gettempdir()` with `<project>-<branch>`. On Unix-like hosts, this directory is usually
|
|
70
|
+
`/tmp`. This location keeps the worktree outside the project directory.
|
|
39
71
|
|
|
40
72
|
The helper computes the project name from the repository root.
|
|
41
73
|
|
|
42
|
-
##
|
|
74
|
+
## Verify safety
|
|
43
75
|
|
|
44
|
-
### For
|
|
76
|
+
### For project-local directories
|
|
45
77
|
|
|
46
|
-
|
|
47
|
-
|
|
78
|
+
Before you create a project-local worktree, verify that Git ignores its directory. If Git does not
|
|
79
|
+
ignore the directory, the helper stops before it makes a change.
|
|
48
80
|
|
|
49
|
-
|
|
81
|
+
#### If Git does not ignore the directory
|
|
50
82
|
|
|
51
|
-
1.
|
|
52
|
-
2.
|
|
53
|
-
3.
|
|
83
|
+
1. Do not edit `.gitignore`.
|
|
84
|
+
2. Do not commit `.gitignore`.
|
|
85
|
+
3. Do not create the project-local worktree.
|
|
86
|
+
4. If repository guidance requires the project-local directory, report the ignore-policy
|
|
87
|
+
prerequisite.
|
|
88
|
+
5. If repository guidance requires the project-local directory, stop.
|
|
89
|
+
6. Change `.gitignore` only in a separate authorized change.
|
|
90
|
+
7. After that change is validated and committed, prepare the worktree again.
|
|
91
|
+
8. If repository guidance does not require the project-local directory, get `<temporary-root>` from
|
|
92
|
+
the host.
|
|
93
|
+
9. Give preference to a safe temporary destination.
|
|
94
|
+
10. Pass `--path <temporary-root>/<project>-<branch>` and `--path-root <temporary-root>` to the helper.
|
|
95
|
+
11. Report the fallback path.
|
|
54
96
|
|
|
55
|
-
|
|
97
|
+
This check prevents Git from tracking the worktree contents.
|
|
56
98
|
|
|
57
|
-
### For
|
|
99
|
+
### For `/tmp` locations
|
|
58
100
|
|
|
59
|
-
|
|
101
|
+
You do not have to verify `.gitignore` for a path under `/tmp`. This path is outside the project.
|
|
60
102
|
|
|
61
|
-
##
|
|
103
|
+
## Create the worktree
|
|
62
104
|
|
|
63
|
-
1. Resolve
|
|
64
|
-
2.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
105
|
+
1. Resolve the intended base commit SHA.
|
|
106
|
+
2. Record the intended base commit SHA.
|
|
107
|
+
3. Keep the target repository as the current working directory.
|
|
108
|
+
4. Resolve `scripts/prepare_worktree.py` from this installed skill directory.
|
|
109
|
+
5. Prepare `BRANCH_NAME --start-point BASE_SHA --dry-run` as the helper arguments.
|
|
110
|
+
6. If the contract requires a distinct branch and path, add exact `--path` and `--path-root` values.
|
|
111
|
+
7. If repository guidance specifies a directory, add it through `--directory`.
|
|
112
|
+
8. If an unignored local directory requires the temporary fallback, retain the exact `--path` and
|
|
113
|
+
`--path-root` values.
|
|
114
|
+
9. For this fallback, use those values for both helper calls.
|
|
115
|
+
10. Invoke the helper by its absolute path with the prepared dry-run arguments.
|
|
116
|
+
11. Create the worktree with the same arguments without `--dry-run`.
|
|
117
|
+
12. Do not replace the recorded SHA with the current `HEAD`.
|
|
118
|
+
13. Change to the returned path.
|
|
119
|
+
14. If the repository defines a bootstrap, run it.
|
|
120
|
+
15. Use the repository tests to verify a clean baseline.
|
|
121
|
+
16. Report the path, start SHA, and result.
|
|
72
122
|
|
|
73
|
-
**If tests fail:** Report failures
|
|
123
|
+
**If the tests fail:** Report the failures. Ask whether to continue or investigate.
|
|
74
124
|
|
|
75
|
-
**If tests pass:** Report ready.
|
|
125
|
+
**If the tests pass:** Report that the worktree is ready.
|
|
76
126
|
|
|
77
|
-
##
|
|
127
|
+
## Clean up
|
|
78
128
|
|
|
79
|
-
When work is
|
|
80
|
-
Hephaestus dependency
|
|
81
|
-
discovery, preservation rules, deletion prompts, rebases, and cleanup safeguards. Do not
|
|
82
|
-
that policy
|
|
129
|
+
When the work is complete, invoke `tidy` for branch and worktree cleanup. `tidy` prepares the trusted
|
|
130
|
+
Hephaestus dependency. It delegates the work directly to `hephaestus-tidy`. The interactive workflow
|
|
131
|
+
controls discovery, preservation rules, deletion prompts, rebases, and cleanup safeguards. Do not
|
|
132
|
+
duplicate that policy. Do not write deletion commands in this skill.
|
|
83
133
|
|
|
84
134
|
Preserve the worktree by default. Delivery, merge, abandonment, or a general cleanup request does
|
|
85
|
-
not
|
|
86
|
-
|
|
135
|
+
not authorize this skill to remove the worktree. Use `tidy` for each cleanup. The Hephaestus
|
|
136
|
+
workflow and the user's answers to its prompts control the removal decision.
|
|
87
137
|
|
|
88
138
|
## Quick Reference
|
|
89
139
|
|
|
90
140
|
| Situation | Action |
|
|
91
141
|
| ----------- | -------- |
|
|
92
|
-
| `.worktrees/` exists
|
|
142
|
+
| `.worktrees/` exists and is ignored | Use it. |
|
|
93
143
|
| Neither exists | Use the host temporary directory with `<project>-<branch>` |
|
|
94
|
-
| Directory not ignored |
|
|
95
|
-
| Tests fail at baseline | Report failures
|
|
96
|
-
|
|
97
|
-
## Common Mistakes
|
|
144
|
+
| Directory is not ignored | Use an explicit temporary path. Report the path. If the repository requires a local path, stop. |
|
|
145
|
+
| Tests fail at baseline | Report the failures. Ask before you continue. |
|
|
98
146
|
|
|
99
|
-
|
|
100
|
-
- **Proceeding with failing baseline** → can't distinguish new bugs from pre-existing
|
|
101
|
-
- **Not cleaning up** → stale worktrees accumulate
|
|
147
|
+
## Failed approaches
|
|
102
148
|
|
|
103
|
-
|
|
149
|
+
- Do not skip ignore verification for a project-local worktree. Git can track the worktree contents.
|
|
150
|
+
- If the baseline tests fail, do not continue unless the user explicitly tells you to continue. You
|
|
151
|
+
cannot separate new defects from existing defects.
|
|
152
|
+
- When cleanup is authorized, use `tidy`. Do not leave stale worktrees.
|
|
104
153
|
|
|
105
|
-
|
|
154
|
+
## Related workflow
|
|
106
155
|
|
|
107
156
|
- Invoke `tidy` for dependency-locked delegation to Hephaestus branch and worktree cleanup.
|
|
108
|
-
-
|
|
109
|
-
|
|
157
|
+
- Before you report completion or start cleanup, get fresh runnable evidence. Follow the
|
|
158
|
+
evidence-integrity policy.
|
|
110
159
|
|
|
111
160
|
---
|
|
112
161
|
|