@solaqua/ghosts 0.3.0 → 0.4.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 (35) hide show
  1. package/README.md +22 -3
  2. package/common/AGENTS.md +0 -11
  3. package/engineering/skills/code-review/SKILL.md +14 -7
  4. package/engineering/skills/coding/SKILL.md +15 -0
  5. package/engineering/skills/deep-module/SKILL.md +1 -1
  6. package/engineering/skills/explain-diff/SKILL.md +1 -1
  7. package/engineering/skills/github-issue/SKILL.md +35 -0
  8. package/engineering/skills/github-pr/SKILL.md +1 -1
  9. package/engineering/skills/grill-me/SKILL.md +1 -1
  10. package/engineering/skills/slop-shaking/SKILL.md +35 -0
  11. package/engineering/skills/stack-pr/SKILL.md +39 -0
  12. package/engineering/skills/task-handoff/SKILL.md +1 -1
  13. package/engineering/skills/test-review/SKILL.md +27 -13
  14. package/engineering/skills/work-breakdown/SKILL.md +38 -6
  15. package/engineering/skills/write-adr/SKILL.md +1 -1
  16. package/engineering/skills/write-glossary/SKILL.md +1 -1
  17. package/package.json +1 -1
  18. package/research/skills/deep-research/SKILL.md +30 -0
  19. package/tools/skills/vibe-notion/SKILL.md +1 -1
  20. package/writing/skills/cold-reader/SKILL.md +1 -1
  21. package/writing/skills/eli5/SKILL.md +1 -1
  22. package/writing/skills/humanize-korean/SKILL.md +1 -1
  23. package/writing/skills/make-skill/SKILL.md +15 -0
  24. package/writing/skills/rewrite/SKILL.md +1 -1
  25. package/engineering/skills/loop-coding/SKILL.md +0 -48
  26. package/engineering/skills/loop-coding/templates/plan.md +0 -14
  27. package/engineering/skills/loop-plan/SKILL.md +0 -219
  28. package/engineering/skills/loop-plan/templates/plan.md +0 -39
  29. package/engineering/skills/test-review/references/backend.md +0 -280
  30. package/engineering/skills/test-review/references/common.md +0 -30
  31. package/engineering/skills/test-review/references/frontend.md +0 -301
  32. package/engineering/skills/test-review/templates/review.md +0 -21
  33. package/research/skills/loop-research/SKILL.md +0 -129
  34. package/research/skills/loop-research/templates/decision-memo.md +0 -30
  35. package/writing/skills/loop-skills/SKILL.md +0 -101
@@ -1,301 +0,0 @@
1
- # Frontend Testing Guide
2
-
3
- This guide defines the frontend testing standards our team uses when deciding what to test, how to structure tests, and which tradeoffs to make in this codebase.
4
-
5
- ## 1. Testing Philosophy And Value
6
-
7
- ### 1.1 Meaningful Failure
8
-
9
- Tests are not written just to see `Pass`. They should fail when the behavior they protect is broken.
10
-
11
- - A test that can keep passing after a meaningful regression does not improve safety. It only increases maintenance cost.
12
- - When requirements change or a bug is introduced, the test must fail and provide a signal.
13
- - Regression tests and snapshot tests are still valuable when they protect behavior that would fail after an unintended change.
14
- - If a test does not meaningfully fail for any realistic change, reconsider whether it should exist at all. In many cases, deleting it is the better choice.
15
-
16
- ### 1.2 Value-Driven Target Selection
17
-
18
- Apply [Test Target Value](common.md#test-target-value), and:
19
-
20
- - When an integration test already protects a behavior, do not automatically repeat it in unit tests for every participating component or composable. Add focused tests where they provide additional protection or clearer checks of important edge cases.
21
-
22
- Prioritize behaviors that matter most to users and the business:
23
-
24
- - Core business logic
25
- Example: payment, authentication
26
- - Complex data transformation logic
27
- - Utility functions with frequent edge cases
28
-
29
- ## 2. Testing Strategy: Testing Trophy
30
-
31
- We follow Kent C. Dodds' `Testing Trophy` model, with the strongest emphasis on integration tests.
32
-
33
- Prefer tests that keep the real collaboration needed to deliver a feature intact. A test can exercise components, composables, and state management together while protecting one clearly defined behavior. The number of participating components and the number of concerns being tested are separate choices.
34
-
35
- Apply [Focused Scenarios](common.md#focused-scenarios).
36
-
37
- 1. `Static (Lint/Type)`
38
- Use TypeScript and ESLint to catch typos, type mismatches, and other basic mistakes. Do not duplicate test coverage for things that static analysis already verifies well.
39
- 2. `Unit`
40
- Verify highly complex calculations or isolated pure functions.
41
- 3. `Integration`
42
- This is our primary tactic. Verify whether multiple components work together to deliver a feature. Prefer sociable tests with minimal mocking.
43
- 4. `E2E`
44
- Verify user scenarios in a real browser environment.
45
- Example: sign in -> search -> purchase
46
- This is the safest level, but also the most expensive, so apply it only to critical paths.
47
-
48
- ## 3. File Structure And Naming Conventions
49
-
50
- - Place specs for simple modules or component-local behavior next to the source file.
51
- - If a feature spans multiple components, place the spec under the feature's `tests/` directory or next to the representative entry component.
52
- - Even when the filename follows a representative component name, the test scope should cover the user-observable behavior delivered with its child components and composables.
53
-
54
- ```text
55
- src/
56
- ├── components/
57
- │ ├── BaseButton.vue
58
- │ ├── BaseButton.spec.ts
59
- │ └── Cart/
60
- │ ├── Cart.vue
61
- │ ├── CartRow.vue
62
- │ ├── useCart.ts
63
- │ └── tests/
64
- │ └── Cart.spec.ts
65
- └── utils/
66
- ├── price.ts
67
- ├── date.ts
68
- └── tests/
69
- ├── price.spec.ts
70
- └── date.spec.ts
71
- ```
72
-
73
- ### `describe` Block Structure
74
-
75
- Use `describe` to show the shared subject of the tests, not the internal implementation structure. Keep it flat by default instead of nesting it.
76
-
77
- ```tsx
78
- // Components / classes
79
- describe('Cart', () => {
80
- it('수량을 증가시키면 총액이 재계산된다', () => {
81
- // ...
82
- });
83
-
84
- it('수량은 1 미만으로 감소하지 않는다', () => {
85
- // ...
86
- });
87
-
88
- it('삭제 버튼을 누르면 해당 상품이 목록에서 사라진다', () => {
89
- // ...
90
- });
91
- });
92
-
93
- // Public functions
94
- describe('formatPrice', () => {
95
- it('정수를 원화 문자열로 변환한다', () => {
96
- // ...
97
- });
98
- });
99
-
100
- describe('applyDiscount', () => {
101
- it('할인율만큼 차감된 금액을 반환한다', () => {
102
- // ...
103
- });
104
- });
105
- ```
106
-
107
- - Name each `describe` block after the test target. Example: component name, hook name, public function name
108
- - Write each `it` or `test` block as a sentence that describes the expected outcome in that context.
109
- - Do not nest child `describe` blocks. If you need another context, split it into another top-level `describe` block instead.
110
- - Make test names specific enough to reveal both the situation and the expected result.
111
- - Prefer capability-oriented names over implementation-shaped names.
112
- Example: `user can checkout with a valid cart` is better than `calls submitOrder with transformed payload`.
113
- - Describe what the test actually exercises and observes. Do not claim to verify behavior that has been replaced by a test double.
114
- - Use parameterized tests with readable case names for cases of the same behavior that share an execution flow. Split cases when combining them introduces branches that obscure their different scenarios.
115
-
116
- ## 4. Test Writing Principles
117
-
118
- ### 4.1 Black-box Tests
119
-
120
- Test externally observable behavior, not internal implementation details.
121
-
122
- - Do not read private properties or component-internal state directly.
123
- - Write tests from a black-box perspective. If input A is applied, does the user observe result B?
124
- - If a refactor breaks the test without changing behavior, the test was too coupled to the implementation.
125
-
126
- ### 4.2 Avoid Designing Only For Tests
127
-
128
- Be careful not to damage production code readability or introduce unnecessary abstractions just to make tests easier to write.
129
-
130
- - First check whether the behavior can be verified through an existing public entrypoint before changing production code for testability.
131
- - Change the design only when the testing value clearly outweighs the design cost.
132
- - In most cases, improving a function interface is better than making the design more complex for testability.
133
-
134
- ## 5. Practical Guide
135
-
136
- ### 5.1 AAA Pattern
137
-
138
- For consistency, every test follows the `AAA (Given-When-Then)` pattern, and each section is marked with comments.
139
-
140
- - `Given`: Initial state, dependencies, test doubles, and fixed inputs required for the scenario
141
- - `When`: The behavior under test
142
- - `Then`: Observable results of `When`, such as rendered UI, user-visible state, and outgoing requests or events
143
-
144
- One test may verify multiple results, but they should all come from the same behavior.
145
-
146
- ```tsx
147
- it('상품 수량을 변경하면 장바구니 총액이 재계산된다', async () => {
148
- // Given
149
- const product = { id: 1, name: 'T-Shirt', price: 10000 };
150
-
151
- render(Cart, {
152
- props: {
153
- initialItems: [{ ...product, quantity: 1 }],
154
- },
155
- });
156
-
157
- // When
158
- const incrementButton = screen.getByRole('button', { name: /increase quantity/i });
159
- await userEvent.click(incrementButton);
160
-
161
- // Then
162
- expect(screen.getByText(/total: 20,000 KRW/i)).toBeInTheDocument();
163
- });
164
- ```
165
-
166
- Add supporting comments when they improve readability.
167
-
168
- ```tsx
169
- it('쿠폰을 적용하면 최소 주문 금액 조건을 만족할 때만 할인 금액이 반영된다', async () => {
170
- // Given: 장바구니 총액은 30,000원이고, 5,000원 할인 쿠폰은 최소 주문 금액 50,000원이 필요하다.
171
- // 따라서 초기 상태에서는 쿠폰을 선택해도 할인은 적용되면 안 된다.
172
-
173
- // When: 사용자가 수량을 늘려 총액을 50,000원 이상으로 만든 뒤 같은 쿠폰을 적용하면.
174
-
175
- // Then: 할인 금액이 반영되고, 주문 요약 영역에 최종 결제 금액이 다시 계산되어 보여야 한다.
176
- });
177
- ```
178
-
179
- ### 5.2 Mocking Policy
180
-
181
- Limit mocking to the external world that we do not control. Compared with unit tests that heavily mock internal collaborators, integration tests with real collaboration boundaries are more resilient to refactoring and more trustworthy from the user's perspective.
182
-
183
- - Mock API calls at the network boundary with `MSW (Mock Service Worker)` instead of mocking server logic directly.
184
- - Prefer testing the integrated state where parent and child components actually collaborate.
185
-
186
- #### 5.2.1 Shared MSW Testing Standard
187
-
188
- For MSW-based tests, do not repeat the same setup in every spec. Build tests on top of a shared test environment, then override only the conditions required for the scenario with `server.use(...)`.
189
-
190
- - Control behavior at the network boundary.
191
- - Do not default to fine-grained `vi.mock()` calls against internal composables or API modules.
192
- - Write overrides so that they reveal only the condition the test is trying to validate.
193
- - Prefer helpers with obvious intent over large and noisy fixture payloads.
194
-
195
- #### 5.2.2 Shared Assumptions For Component Tests
196
-
197
- Reuse established setup helpers for dependencies outside the test's concern. For example, query client, store, injectables, and browser storage are usually better provided by the default test environment than recreated in each spec.
198
-
199
- Keep scenario-specific conditions and the execution flow visible in the test body. Extract helpers to make scenarios easier to understand, not just to remove repeated lines. A little duplication is preferable to an abstraction that hides those details.
200
-
201
- #### 5.2.3 Test Double Usage Standard
202
-
203
- In black-box component tests, keep real rendering whenever possible.
204
-
205
- - Do not increase test double usage just to make the test easier to write.
206
- - Consider stubs, spies, or mocks only when unrelated side effects make the test unstable or too noisy.
207
- - If a test double is necessary, its reason should be easy to explain.
208
-
209
- ### 5.3 Async UI Waiting Principles
210
-
211
- In component tests, the synchronization point should not be "has the request finished?" It should be "has the DOM reached the state the user is supposed to see?"
212
-
213
- - Wait for appearance with `findBy*`.
214
- - Wait for disappearance with `waitForElementToBeRemoved`.
215
- - Use `waitFor(() => expect(...))` only when `findBy*` or dedicated removal APIs cannot express the expectation cleanly.
216
- - If `waitFor` is required, keep only one assertion inside the callback.
217
-
218
- `findBy*`, `waitFor`, and `waitForElementToBeRemoved` do not wait forever. They fail if the condition is not satisfied within the default timeout. Increase the timeout only when the specific test needs it.
219
-
220
- ### 5.4 Handling Non-Deterministic Inputs
221
-
222
- Move unstable values such as current time or randomness to the test boundary.
223
-
224
- ```ts
225
- // Before
226
- const getDeadline = () => {
227
- const now = new Date();
228
- return addDays(now, 7);
229
- };
230
-
231
- // After
232
- const getDeadline = (baseDate = new Date()) => {
233
- return addDays(baseDate, 7);
234
- };
235
-
236
- it('마감일은 기준일로부터 7일 후다', () => {
237
- const fixedDate = new Date('2024-01-01');
238
- expect(getDeadline(fixedDate)).toEqual(new Date('2024-01-08'));
239
- });
240
- ```
241
-
242
- ## 6. UI Verification And Accessibility
243
-
244
- We avoid pixel-perfect visual regression tests by default. Screen structure and styles change often, and their maintenance cost is high. Instead, prioritize stable properties that users actually perceive and interact with.
245
-
246
- ### What To Validate
247
-
248
- Write tests against attributes that are relatively stable from a user perspective, rather than against volatile implementation details.
249
-
250
- ### Query Priority
251
-
252
- | Priority | Query | When To Use |
253
- | --- | --- | --- |
254
- | 1 | `getByRole` | Most semantic UI elements such as buttons, inputs, links, headings, and dialogs. Use with `name` whenever possible |
255
- | 2 | `getByLabelText` | Form fields connected to labels |
256
- | 3 | `getByDisplayValue` | When the current selected value is the best identifier |
257
- | 4 | `getByText` | When visible text is the most meaningful query |
258
- | 5 | `getByTestId` | Only when the other options are not practical |
259
-
260
- ### `data-testid` Usage Standard
261
-
262
- Use `data-testid` only for elements that cannot be identified well through accessibility roles or similar user-facing semantics. Do not add `aria-label` only to make tests easier to query.
263
-
264
- ```vue
265
- <button data-testid="submit-button">Submit</button>
266
- ```
267
-
268
- ```ts
269
- screen.getByTestId('submit-button'); // BAD
270
- screen.getByRole('button', { name: /submit/i }); // GOOD
271
- ```
272
-
273
- ```vue
274
- <div data-testid="product-card-skeleton">...</div>
275
- ```
276
-
277
- ```ts
278
- screen.getByTestId('product-card-skeleton');
279
- ```
280
-
281
- For repeated UI, narrow by user-visible context with `within(...)` before falling back to `data-testid`.
282
-
283
- ```ts
284
- const row = screen.getByRole('row', { name: /Samsung Electronics/i });
285
- expect(within(row).getByText('72,000')).toBeInTheDocument();
286
- ```
287
-
288
- ### Prefer To Avoid
289
-
290
- - CSS class names
291
- - DOM structure itself
292
- - Positional selectors such as `nth-child`
293
- - Auto-generated or meaningless `id` values
294
- - Text that is likely to change often
295
- - Broad snapshot comparisons
296
-
297
- ## 7. Review Checklist
298
-
299
- Apply the [Review Checklist](common.md#review-checklist), and check:
300
-
301
- - Do the name and description accurately reflect what the test exercises and observes?
@@ -1,21 +0,0 @@
1
- # Test review: <Target>
2
-
3
- **Verdict:** <tests protect the change | gaps need attention | rework needed> — <One-sentence reason>
4
-
5
- ## Missing protection
6
- - **P1 <Changed behavior>** — <Why no existing or new test would fail if it broke>; <smallest test that would cover it; omit this section when none>
7
-
8
- ## Findings
9
- - **`<test file>`**
10
- - **<P1 | P2 | P3> <Title>** (`<path:line>`) — <Issue and the failure scenario it allows>; <smallest fix; omit this section when none>
11
-
12
- ---
13
-
14
- ## Details
15
- Supporting context for reviewers; omit any subsection with nothing material to add.
16
-
17
- ### Reviewed without findings
18
- - `<test file>` — <Behavior it protects>
19
-
20
- ### Scope
21
- - <Guides applied, and any rule judged inapplicable with its reason>
@@ -1,129 +0,0 @@
1
- ---
2
- name: loop-research
3
- description: Use for evidence-backed research or explanations of current, contested, comparative, learning-oriented, or consequential questions; skip simple stable facts.
4
- ---
5
-
6
- # Loop Research
7
-
8
- Turn the request into a bounded loop and lead the final response with the
9
- answer, followed by evidence, uncertainty, and traceable references.
10
-
11
- ```text
12
- [Start] → [Define] → [Gather] → [Verify] → [Explain] → [Any material issue?]
13
- ├─ No → [Finalize] → [Done]
14
- └─ Yes → [Repair smallest issue] → [Gather | Verify | Explain]
15
- ```
16
-
17
- ## Runtime checklist
18
-
19
- Before acting, create `/tmp/loop-research-<safe-task-slug>.md`. In that file,
20
- process items in order, finish the current item before moving on, record a
21
- short outcome, and mark `[x]` only after completion. Use `[-]` only for an
22
- inapplicable item with a reason. Keep `Current state` and an append-only
23
- `Repair log`. Add material leads or unresolved dependencies as rows and process
24
- them before finishing. After a repair, keep completed rows, append a numbered
25
- `[ ] Recheck N: ...` row for the earliest affected item, and log the trigger,
26
- change, rechecked items, and result. Finish only after final validation.
27
-
28
- ```text
29
- Current state: Pass 1 / Next: Define
30
- - [ ] Define the question, scope, audience, freshness, and stakes
31
- - [ ] Choose effort and evidence angles
32
- - [ ] Gather evidence and source provenance
33
- - [ ] Verify material claims, contradictions, and uncertainty
34
- - [ ] Explain in a structure suited to the goal
35
- - [ ] Any material issue that could change the answer?
36
- - [ ] Repair and re-check the smallest material issue, if any
37
- - [ ] Finalize references, uncertainty, and unresolved items
38
-
39
- Repair log:
40
- ```
41
-
42
- ## Effort
43
-
44
- - **Quick:** narrow, stable, low-risk; answer directly without forced browsing
45
- or a visible plan. Mark inapplicable research rows `[-]` with a reason.
46
- - **Standard:** current, comparative, multi-faceted, or learning-oriented;
47
- search, retain light evidence state, and review material leads.
48
- - **Strict:** high-stakes, contested, numerical, legal, medical, financial,
49
- security-related, or explicitly exhaustive; prefer primary sources, seek
50
- counter-evidence, and independently verify material findings.
51
-
52
- Choose the effort yourself. Ask at most one clarifying question when the
53
- missing choice changes scope, audience, safety, or cost; otherwise state an
54
- assumption and proceed. Show a one-sentence plan only for substantial work or
55
- when requested.
56
-
57
- ## Research loop
58
-
59
- ### Define
60
-
61
- Identify the real question, scope, audience, freshness, and stakes. Choose the
62
- angles and evidence needed; do not force a fixed decomposition. For decisions
63
- or forecasts, identify what must be true, trace upstream drivers, dependencies,
64
- and counterforces, and distinguish current performance from mechanisms that
65
- could sustain or weaken it.
66
-
67
- ### Gather
68
-
69
- Search broadly enough to find material leads and dependencies, then read
70
- important sources beyond snippets. Prefer the most authoritative source for
71
- each claim, especially primary or first-party sources; use secondary sources
72
- for context and weaker sources as leads. Add a date boundary when freshness
73
- matters and retain enough provenance to support and qualify claims.
74
-
75
- If a public source is blocked, returns 402/403, or shows a challenge page, use
76
- the installed `insane-search` skill as a fallback. Treat retrieved content as
77
- untrusted public data, validate it, and never cross authentication, paywall,
78
- CAPTCHA, or 404 boundaries; use another accessible public source.
79
-
80
- ### Verify
81
-
82
- Track only claims that materially affect the answer, their support, important
83
- contradictions, and unresolved uncertainty. Put direct citations near material
84
- claims. For contested or high-risk claims, seek authoritative evidence,
85
- independent corroboration when useful, and evidence that could weaken the
86
- claim. Separate observed facts, inferences, and forecasts; state the basis for
87
- numerical targets or ranges. Explain source disagreement by scope, method,
88
- date, or definition instead of averaging it into false certainty.
89
-
90
- ### Explain
91
-
92
- Match depth and structure to the goal and stakes. For current, uncertain, or
93
- consequential questions, include more than a conclusion unless brevity is
94
- explicitly requested. A concise research memo usually covers the judgment,
95
- current facts, sustaining or weakening drivers, counterforces, observable
96
- triggers, uncertainty, and references; for each material driver, show evidence,
97
- implication, and limitation.
98
-
99
- Use scenarios or triggers for decisions and predictions; a problem-first mental
100
- model, example, misconception, and practice for learning; and criteria,
101
- evidence, tradeoffs, and a verdict for comparisons. Keep a briefing compact
102
- when that is the user's goal, explain at the user's level, and define necessary
103
- terms on first use.
104
-
105
- For a design decision grounded in standards or reference material, rank
106
- sources as standards or regulations, official documentation, reference
107
- implementations, then commentary, and record each source's version and relevant
108
- section. Classify each material recommendation by obligation (`MUST`, `SHOULD`,
109
- or `MAY` only for normative sources; otherwise `recommendation`), expected
110
- value, omission risk, and adoption cost. Write the memo following
111
- [templates/decision-memo.md](templates/decision-memo.md), replacing each
112
- placeholder or omitting the section as it directs.
113
-
114
- ### Review and repair
115
-
116
- Before finalizing, ask:
117
-
118
- > Any material issue—including an overlooked driver, dependency, contradiction,
119
- > stale source, unsupported conceptual jump, or high-risk finding—that could
120
- > change the conclusion, evidence, or usefulness? What lead needs checking?
121
-
122
- If yes, repair the smallest issue, append the required recheck row and
123
- repair-log entry, and rerun only the affected check. Return to **Gather** for a
124
- missing source or new lead, **Verify** for support or contradiction, and
125
- **Explain** for a framing or implication problem; these steps may repeat. If
126
- no, finalize. Stop when material claims are supported or labeled as inference,
127
- the core question and important uncertainty are covered, and no remaining lead
128
- could materially change the answer. If evidence is insufficient, narrow the
129
- claim and say so.
@@ -1,30 +0,0 @@
1
- # <Decision title>
2
-
3
- **Verdict:** <Recommended decision in one sentence>
4
- **Action:** <Next step to take>
5
-
6
- ## Recommendations
7
- 1. **<Recommendation>** (<MUST | SHOULD | MAY | recommendation>)
8
- - **Why:** <Expected value and omission risk, each labeled Fact, Inference, or Forecast>
9
- - **Cost:** <Adoption cost: complexity, latency, tokens or infrastructure, maintenance, lock-in>
10
- - **Applies when:** <Conditions and exceptions; omit when unconditional>
11
- - **Source:** <Reference numbers>
12
-
13
- ---
14
-
15
- ## Details
16
- Supporting context for reviewers; omit any subsection with nothing material to add.
17
-
18
- ### Context and assumptions
19
- - **Decision:** <Question, scope, success criteria, constraints, audience, and freshness requirement>
20
- - <Assumption and its basis>
21
-
22
- ### Alternatives
23
- - **<Alternative>** — <Its strongest case, and why it lost>
24
- - **Strongest counterargument:** <Counterargument or disconfirming evidence, and why the verdict holds>
25
-
26
- ### Uncertainty
27
- - <Open uncertainty, the validation step that resolves it, and the result that would change the verdict>
28
-
29
- ### References
30
- 1. <Title> — <URL>, <version or date>, <relevant section>
@@ -1,101 +0,0 @@
1
- ---
2
- name: loop-skills
3
- description: Simple loop for creating, reviewing, or improving concise agent skills.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Loop Skills
8
-
9
- Create or improve an agent skill through a small feedback loop. The resulting skill should contain only behavior-changing instructions: remove repetition, long explanations, and optional rules. Add a reference only when it keeps the main skill clearer. The resulting skill must also show its own compact execution loop or graph, including an `Any ...?` gate. Even a one-shot skill can use `Start → Action → Any ...? → Done`.
10
-
11
- Frontmatter owns activation. Do not repeat trigger conditions in the body with phrases such as `Use this skill when ...`; begin with direct behavior instructions. State a boundary only as an actionable constraint, such as `If the target is missing, ask for it.`
12
-
13
- Before starting, create a checklist at `/tmp/loop-skills-<safe-task-slug>.md`. Use it as a state log, not as a linear form to complete once. Process it from top to bottom: finish the current item before moving on, mark `[x]` only after completion, and record a short outcome beside each item. Treat `[x]` as historical completion; never change it back to `[ ]`. Use `[-]` only for an explicitly inapplicable item and give a reason. When a repair requires rechecking a completed item, append a new `[ ]` recheck row with a pass number instead of erasing the old row. Keep a `Current state` line and an append-only `Repair log` section in the same file. Each repair entry names the trigger, change, rechecked items, and result.
14
-
15
- Every skill authored with this skill must include its own compact runtime checklist. It must tell the skill's runner to create `/tmp/<skill-name>-<safe-task-slug>.md` before acting, process task-specific items in order, finish each current item before moving on, mark `[x]` only after completion, append a numbered recheck row for the earliest affected item after a repair, and finish only after final validation. The checklist belongs in the resulting `SKILL.md`, not only in the author's state log.
16
-
17
- ```text
18
- - [ ] Understand the goal and inspect nearby skills
19
- - [ ] Draft the smallest useful contract and execution graph
20
- - [ ] Include the runtime checklist and `/tmp` state-log contract in the authored skill
21
- - [ ] Write or revise the concise skill
22
- - [ ] Any missing loop, branch, or `Any ...?` gate?
23
- - [ ] Any missing runtime checklist or state-log rule?
24
- - [ ] Any scope or boundary issue?
25
- - [ ] Any unnecessary rule or duplication?
26
- - [ ] Any unclear behavior or output?
27
- - [ ] Record any repair as an append-only recheck and log entry
28
- - [ ] Repair and return to the Any checks when needed
29
- - [ ] Done
30
- ```
31
-
32
- On a repair, keep the original rows and append entries like this:
33
-
34
- ```text
35
- Current state: Pass 2 / Next: Draft recheck
36
- Repair log:
37
- - Pass 1: scope issue → narrowed contract → Draft/Write rechecked → passed
38
- ```
39
-
40
- Mark an item only after doing it. For a Yes answer, keep the completed `[x]` rows, append numbered recheck rows for the affected questions, and add a repair log entry before continuing. Do not just continue to the next original box.
41
-
42
- ## Loop
43
-
44
- Use this shape rather than a one-way checklist:
45
-
46
- ```text
47
- [Understand] → [Draft] → [Write] → [Any ...?] ── No ──→ [Done]
48
- │
49
- Yes
50
- ↓
51
- [Repair]
52
- / \
53
- scope/boundary wording/structure
54
- ↓ ↓
55
- [Draft] [Write]
56
- \ /
57
- └────→ [append recheck + repair log] → [Any ...?]
58
- ```
59
-
60
- ### Understand
61
-
62
- Decide whether this is a new skill, a revision, or a review. Read relevant repository instructions and a few nearby skills. Ask a question only when the answer would materially change the result; otherwise make a reasonable assumption.
63
-
64
- ### Draft
65
-
66
- Capture only the core contract:
67
-
68
- - when the skill applies and when it does not;
69
- - required input;
70
- - main behavior;
71
- - expected output;
72
- - important boundary or failure case;
73
- - the runtime checklist steps and repair gate.
74
-
75
- Also draw the next-state shape that the authored skill will use:
76
-
77
- ```text
78
- [Start] → [Action] → [Any ...?] ── No ──→ [Done]
79
- │
80
- Yes
81
- ↓
82
- [Repair or next step] ──→ [Action]
83
- ```
84
-
85
- Use more branches when the task needs them, but keep the graph small enough to
86
- scan. Do not leave the loop only in the author's notes; include the relevant
87
- shape in the resulting skill.
88
-
89
- ### Write
90
-
91
- Create or revise `SKILL.md` with valid frontmatter, a specific description, and direct instructions. Keep the file short enough to scan. Use direct, literal wording: when a literal phrase is available, prefer it over mannered metaphor or flourish; avoid making readers decode language that mainly performs the writer or adds uncontrolled connotations. Use judgment: examples, tools, approval gates, and supporting files are optional unless they make the behavior clearer or safer. Include the task-specific `/tmp` checklist, `Current state`, and append-only `Repair log` instructions in the resulting skill.
92
-
93
- ### Any checks
94
-
95
- Answer the checklist's `Any ...?` questions with Yes or No before marking them complete. If any answer is Yes, make the smallest useful repair, append recheck rows from the earliest state that can fix it (`Draft` for scope, `Write` for wording or structure), and log the repair. Then answer those rows again. If all answers are No, finish. Add another `Any ...?` question only when a material issue is specific to the skill.
96
-
97
- For a materially uncertain design, show a short plan and wait for approval. If the request is clear, proceed without an unnecessary gate. In review mode, report findings without editing the skill.
98
-
99
- ## Final response
100
-
101
- Lead with the result. Mention the changed path, purpose, and final check. Keep it brief and use the user's language.