refacil-sdd-ai 5.0.3 → 5.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "refacil-sdd-ai",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "description": "SDD-AI: Specification-Driven Development with AI — development methodology using AI with Claude Code, Cursor and OpenCode",
5
5
  "bin": {
6
6
  "refacil-sdd-ai": "./bin/cli.js"
@@ -38,6 +38,31 @@ Before drafting the `--text`, classify what you are going to ask `@<destination>
38
38
 
39
39
  If you mix query + change, separate into two messages or make clear which part is read-only and which is versionable work in the other repo.
40
40
 
41
+ ### Step 1.6: Contract-first framing (recommended)
42
+
43
+ For cross-repo integrations, prioritize questions that remove ambiguity in **input/output contracts**. A good `ask` usually includes:
44
+ - integration point (endpoint/event/queue and direction)
45
+ - expected input schema/fields and validation rules
46
+ - expected output schema/statuses/errors
47
+ - compatibility/version constraints
48
+
49
+ This framing increases response quality and reduces back-and-forth.
50
+
51
+ ### Step 1.7: Structured template for integration asks (recommended)
52
+
53
+ When the question is about cross-repo integration contracts, draft the `--text` using this minimal template:
54
+
55
+ ```text
56
+ integrationPoint: <endpoint/event/queue + direction X->Y or Y->X>
57
+ inputContract: <required/optional fields + key validation rules>
58
+ outputContract: <expected output/status/errors>
59
+ compatibility: <version/flags/env constraints or "unknown">
60
+ sourceOfTruthRequest: <where to confirm in destination repo>
61
+ question: <concrete doubt to resolve>
62
+ ```
63
+
64
+ If some fields are unknown, send `unknown` explicitly — do not invent values.
65
+
41
66
  ### Step 2: Decide whether to use `--wait`
42
67
 
43
68
  Two modes:
@@ -65,6 +90,7 @@ Use `Bash` with the chosen command.
65
90
  ### Step 4: Process result
66
91
 
67
92
  - If `--wait` brought a response: use it as context to continue your work; do not just report the message, continue with the flow the user asked for.
93
+ - If the response is partial or ambiguous: send a **retry ask** in the same thread, reusing the template fields that remain unresolved.
68
94
  - If `--wait` expired: inform the user and propose `/refacil:inbox` to review later.
69
95
  - If fire-and-forget: confirm to the user that it was sent.
70
96
 
@@ -76,3 +102,4 @@ Use `Bash` with the chosen command.
76
102
  - If the destination does not exist in the room, the message is stored in `inbox.jsonl` and will be delivered when they join.
77
103
  - If you **agreed** with another session that they will change their repo, they must use **`/refacil:propose`** there and **notify you via bus** when done; if they request changes from you, you do the same here. Full convention: `refacil-prereqs/BUS-CROSS-REPO.md`.
78
104
  - **`ask`s that are change requests** must be **substantive in scope** (Step 1.5): the recipient already uses the methodology; do not repeat the guide in the text. Do not use the bus to request opaque quick fixes when the impact requires SDD-AI.
105
+ - For cross-repo contract clarifications, prefer Step 1.7 template. The same structure should also be expected in replies to ease retries.
@@ -8,6 +8,15 @@ user-invocable: true
8
8
 
9
9
  Starts or joins a `refacil-bus` room (local chat room between agents). Argument **$ARGUMENTS** = room name.
10
10
 
11
+ ## Purpose of joining
12
+
13
+ Joining a room enables **cross-repo, multi-agent integration work**. The expected use is:
14
+ - consult another repo as source of truth for integration contracts
15
+ - clarify input/output behavior across service boundaries
16
+ - coordinate contract-aligned changes following SDD-AI in each repo
17
+
18
+ Do not treat the room as general chat. Keep interactions focused on integration uncertainty and ownership.
19
+
11
20
  ## Instructions
12
21
 
13
22
  ### Step 1: Verify that the presentation block exists in `AGENTS.md`
@@ -73,6 +82,7 @@ Report:
73
82
  - Room joined and session name
74
83
  - Current members
75
84
  - How others can consult this session: `/refacil:ask @<session> "..."`
85
+ - Reminder of scope: use bus messages for cross-repo contract clarification (inputs/outputs, events, compatibility), not generic conversation.
76
86
 
77
87
  ## Rules
78
88
 
@@ -2,12 +2,32 @@
2
2
 
3
3
  Shared protocol for all skills that may need context from another repository during execution (`explore`, `propose`, `verify`, `bug`).
4
4
 
5
+ ## Primary objective (non-negotiable)
6
+
7
+ The bus is not a generic chat channel. Its primary purpose is **cross-repo and multi-agent integration clarity**:
8
+
9
+ - Clarify **input/output contracts** between services (request payloads, response schemas, events, queues, headers, status/error semantics).
10
+ - Resolve uncertainty when a flow in this repo depends on behavior implemented in another repo.
11
+ - Coordinate implementation ownership when a contract mismatch is found.
12
+
13
+ If a bus conversation does not improve integration certainty, it is probably off-scope.
14
+
5
15
  ## When to apply
6
16
 
7
17
  Each skill defines its own trigger (see its `SKILL.md`). In general, apply when the skill detects that **it needs information that does not live in this repo** and assuming it would risk an error: API contracts, event formats, consumer/producer behavior, shared queues.
8
18
 
9
19
  **Golden rule**: the bus is **optional and non-blocking**. Do not invoke it if the question can be answered by reading this repo's code, or if there is no real cross-repo uncertainty. If the dev answers or clarifies the doubt directly (verbally, via chat, with a link to docs, etc.), **the skill continues normally** — the bus is only one of the possible ways to resolve the unknown.
10
20
 
21
+ ### Typical trigger in microservice architectures
22
+
23
+ If repository **X** calls or consumes service **Y** but **Y** lives in another repo, and this repo cannot validate the real contract or behavior by itself, use the bus to consult the agent in **Y**.
24
+
25
+ This includes:
26
+ - endpoint signatures and field semantics
27
+ - event payload versions and compatibility
28
+ - producer/consumer assumptions not documented in the current repo
29
+ - acceptance/rejection behavior for invalid input
30
+
11
31
  ## Protocol (3 steps)
12
32
 
13
33
  When the skill's trigger is met:
@@ -20,6 +40,41 @@ When the skill's trigger is met:
20
40
 
21
41
  If the user does not know the bus or does not know how to configure it, refer them to `/refacil:guide` (section "Bus between agents") before attempting the consultation.
22
42
 
43
+ ### Message quality for high-impact answers
44
+
45
+ When asking through the bus, frame questions around contracts and observable behavior:
46
+ - expected input shape
47
+ - output shape and error modes
48
+ - version/compatibility constraints
49
+ - source-of-truth location in destination repo
50
+
51
+ Avoid vague requests like "check this integration". Prefer concrete contract questions.
52
+
53
+ Recommended ask template (integration clarification):
54
+
55
+ ```text
56
+ integrationPoint: <endpoint/event/queue + direction>
57
+ inputContract: <fields + validations>
58
+ outputContract: <outputs/status/errors>
59
+ compatibility: <version/constraints or unknown>
60
+ sourceOfTruthRequest: <where to confirm in destination repo>
61
+ question: <concrete doubt>
62
+ ```
63
+
64
+ Recommended reply template:
65
+
66
+ ```text
67
+ integrationPoint: <confirmed value>
68
+ inputContract: <confirmed value>
69
+ outputContract: <confirmed value>
70
+ compatibility: <confirmed value or unknown>
71
+ sourceOfTruth: <file/path/symbol in destination repo>
72
+ confidence: <high|medium|low>
73
+ openQuestions: <none | unresolved items>
74
+ ```
75
+
76
+ These templates support both first-pass clarification and retry loops.
77
+
23
78
  **Valid output without bus**: at any point in the protocol, if the dev answers or clarifies the doubt directly, record their response as context and **continue with the skill flow**. Do not insist on using the bus or block progress waiting for a cross-repo confirmation the dev already answered through another channel.
24
79
 
25
80
  ## How to use the response
@@ -31,6 +86,8 @@ Each skill decides what to do with the response:
31
86
  - `verify`: incorporate it into the combined report as SUGGESTION; if it reveals a real bug, escalate to WARNING/CRITICAL.
32
87
  - `bug`: use it to confirm whether the fix goes in this repo, the other, or both (in which case the other will have its own `/refacil:bug`).
33
88
 
89
+ If the response is partial, send a retry `ask` focused only on unresolved `openQuestions`.
90
+
34
91
  ## Room agreements and changes in this repo
35
92
 
36
93
  An **`ask` whose intent is to request work** (implementation, correction, substantial refactor) in the destination session's repo counts as a **change request**: the text must be **clear in scope** so the destination runs **`/refacil:propose`** (and the usual flow) in **their** repo. **No need** to embed the methodology guide in the message: whoever is in the room already joined via **`/refacil:join`** and the repo follows SDD-AI. Same criterion if the conversation mixes `say` and `ask`. Exception: if the **human user** requests a different procedure.
@@ -53,3 +110,4 @@ By default: **do not close silently** when another session was waiting for the r
53
110
  - Do not insist if the dev prefers to resolve it another way (direct reading, docs, verbal question to a colleague).
54
111
  - Do not skip `/refacil:propose` (or equivalent user order) for changes agreed in a room that affect this repo without an explicit contrary instruction.
55
112
  - Do not **fail to respond via bus** to the requester or the room when you finish a change others were waiting for (see previous section).
113
+ - Do not use the bus for open-ended brainstorming unrelated to cross-repo integration contracts.
@@ -32,11 +32,28 @@ Report to the user that the response was sent.
32
32
  - **`reply`**: always when you are responding to something you were asked. This allows the other side in `ask --wait` to unblock automatically.
33
33
  - **`say`**: general announcement unrelated to a previous question.
34
34
 
35
+ ## Contract-focused reply format (for integration questions)
36
+
37
+ When replying to cross-repo integration clarifications, prefer this structure so the other side can continue without ambiguity:
38
+
39
+ ```text
40
+ integrationPoint: <confirmed endpoint/event/queue + direction>
41
+ inputContract: <confirmed fields/validation>
42
+ outputContract: <confirmed outputs/status/errors>
43
+ compatibility: <version/constraints, or "unknown">
44
+ sourceOfTruth: <file/path/symbol in this repo>
45
+ confidence: <high|medium|low>
46
+ openQuestions: <none | list of unresolved points>
47
+ ```
48
+
49
+ If you cannot confirm a field, answer with `unknown` and include the missing evidence in `openQuestions`.
50
+
35
51
  ## Rules
36
52
 
37
53
  - If you just **implemented** a change requested by another agent and this `reply` is the **close** (done / PR / blocked), include that summary in the text; it is the default channel to respond to whoever made the original `ask` (same thread).
38
54
  - Correctly quote the text.
39
55
  - Respond only from your knowledge of THIS repo. If the question falls outside your scope, say it explicitly: `"out of my scope, repo X knows about this"`.
56
+ - If your reply leaves unresolved contract points, explicitly list them so the asker can send a targeted retry `ask`.
40
57
  - If there is no pending question directed to you and you do not want to link it, use `/refacil:say` instead.
41
58
  - If you were asked multiple questions and want to respond to a specific older one, pass `--correlation <id>` explicitly:
42
59
  ```bash
@@ -29,6 +29,8 @@ Skills are identical in `.claude/skills/refacil-*/` (Claude Code) and `.cursor/s
29
29
 
30
30
  Local plain-text channel between Claude Code / Cursor sessions running in different repos. Prevents the developer from manually transcribing context between their own agents.
31
31
 
32
+ Primary intent: **cross-repo integration clarity**. Use it to clarify service **input/output contracts** (APIs, events, queues, compatibility, errors) when the source of truth is in another repo.
33
+
32
34
  | Command | Description |
33
35
  |---------|-------------|
34
36
  | `/refacil:join <room>` | Create or join a room. First time generates an introduction block in `AGENTS.md`. |
@@ -40,6 +42,8 @@ Local plain-text channel between Claude Code / Cursor sessions running in differ
40
42
 
41
43
  Typical usage: before starting a task that may require context from other repos, the developer puts the agent in each other repo into `/refacil:attend`. Then, in their working repo, the LLM can request context with `/refacil:ask @<repo> "..." --wait` and receive the response automatically without the developer switching between windows.
42
44
 
45
+ In microservice setups (repo X depends on repo Y), use the bus when X cannot validate Y's real behavior from local code alone. Keep questions contract-focused and explicit.
46
+
43
47
  If changes affecting a repo are agreed upon in the room, the SDD-AI flow (`/refacil:propose`, etc.) is followed in that repo and the implementer **notifies via the bus** when done (details in `refacil-prereqs/BUS-CROSS-REPO.md` in the package). **`ask` requests that involve work** in another repo must include **clear scope**; the destination uses **`/refacil:propose`** by convention. See skill `/refacil:ask`.
44
48
 
45
49
  Useful CLI for the developer: `refacil-sdd-ai bus view` (opens web UI in browser), `bus watch <session>` (terminal panel), `bus status`, `bus rooms`. These do not consume tokens.