@guilhermefsousa/open-spec-kit 0.0.10 → 0.0.11
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 +1 -1
- package/bin/open-spec-kit.js +7 -0
- package/package.json +1 -1
- package/src/commands/doctor.js +107 -197
- package/src/commands/init.js +112 -347
- package/src/commands/install.js +393 -0
- package/src/commands/update.js +117 -165
- package/src/schemas/spec.schema.js +3 -3
- package/src/utils/global-path.js +73 -0
- package/templates/agents/agents/spec-hub.agent.md +13 -13
- package/templates/agents/rules/hub_structure.instructions.md +1 -1
- package/templates/agents/rules/ownership.instructions.md +39 -39
- package/templates/agents/skills/dev-orchestrator/SKILL.md +17 -17
- package/templates/agents/skills/discovery/SKILL.md +17 -17
- package/templates/agents/skills/setup-project/SKILL.md +12 -12
- package/templates/agents/skills/specifying-features/SKILL.md +28 -28
- package/templates/github/agents/spec-hub.agent.md +5 -5
- package/templates/github/copilot-instructions.md +9 -9
- package/templates/github/instructions/hub_structure.instructions.md +1 -1
- package/templates/github/instructions/ownership.instructions.md +9 -9
- package/templates/github/skills/dev-orchestrator/SKILL.md +619 -5
- package/templates/github/skills/discovery/SKILL.md +419 -5
- package/templates/github/skills/setup-project/SKILL.md +496 -5
- package/templates/github/skills/specifying-features/SKILL.md +417 -5
- /package/templates/github/prompts/{dev.prompt.md → osk-build.prompt.md} +0 -0
- /package/templates/github/prompts/{discovery.prompt.md → osk-discover.prompt.md} +0 -0
- /package/templates/github/prompts/{setup.prompt.md → osk-init.prompt.md} +0 -0
- /package/templates/github/prompts/{nova-feature.prompt.md → osk-spec.prompt.md} +0 -0
|
@@ -14,52 +14,52 @@ This rule exists to prevent the "duplicate responsibility" anti-pattern where mu
|
|
|
14
14
|
|
|
15
15
|
| Artifact | Owner (creates) | Updater | Readers | Validators |
|
|
16
16
|
|----------|----------------|---------|---------|------------|
|
|
17
|
-
| Demandas/ labels | /
|
|
18
|
-
| Visão do Produto | /
|
|
19
|
-
| Glossário | /
|
|
20
|
-
| DD (Design Document) | /spec (via `design-doc` agent) | /
|
|
21
|
-
| Domínio/Regras | /
|
|
22
|
-
| Domínio/Fluxos | /
|
|
23
|
-
| Domínio/Tabelas | /
|
|
24
|
-
| Domínio/Integrações | /
|
|
25
|
-
| Features/ (parent) | /
|
|
26
|
-
| Feature pages (content) | /
|
|
17
|
+
| Demandas/ labels | /osk-init | — | /osk-discover | — |
|
|
18
|
+
| Visão do Produto | /osk-init | — | all | — |
|
|
19
|
+
| Glossário | /osk-init | /osk-discover (exit gate), /osk-build (post-merge only) | /osk-spec | /osk-spec (read-only validate) |
|
|
20
|
+
| DD (Design Document) | /osk-spec (via `design-doc` agent) | /osk-build (post-merge, via `design-doc` agent) | — | — |
|
|
21
|
+
| Domínio/Regras | /osk-init | /osk-build (post-merge only) | /osk-discover, /osk-spec | — |
|
|
22
|
+
| Domínio/Fluxos | /osk-init | /osk-build (post-merge only) | /osk-discover | — |
|
|
23
|
+
| Domínio/Tabelas | /osk-init | — | /osk-discover | — |
|
|
24
|
+
| Domínio/Integrações | /osk-init | /osk-build (post-merge only) | /osk-discover | — |
|
|
25
|
+
| Features/ (parent) | /osk-init | — | all | — |
|
|
26
|
+
| Feature pages (content) | /osk-init + /osk-discover | /osk-discover | /osk-spec, /osk-build | — |
|
|
27
27
|
| Feature labels | each skill at its transition | — | all | — |
|
|
28
|
-
| Arquivados/ | /
|
|
28
|
+
| Arquivados/ | /osk-init | — | — | — |
|
|
29
29
|
|
|
30
|
-
**Glossário conflict rule**: if /
|
|
30
|
+
**Glossário conflict rule**: if /osk-build (post-merge) needs to update a term that /osk-discover defined, /osk-build's update wins — it reflects implemented reality. /osk-build adds a note: "Atualizado pós-merge: {reason}".
|
|
31
31
|
|
|
32
|
-
**DD update coordination**: /spec updates the DD FIRST (during spec phase), /
|
|
32
|
+
**DD update coordination**: /osk-spec updates the DD FIRST (during spec phase), /osk-build updates AFTER MERGE (during Phase D). If /osk-build needs to change something /osk-spec wrote, /osk-build overwrites with implemented reality (code is source of truth post-merge). No locking needed — the sequential workflow prevents simultaneous updates.
|
|
33
33
|
|
|
34
34
|
## Local Artifacts
|
|
35
35
|
|
|
36
36
|
| Artifact | Owner (creates) | Updater | Readers | Validators |
|
|
37
37
|
|----------|----------------|---------|---------|------------|
|
|
38
|
-
| `projects.yml` | /
|
|
39
|
-
| `docs/architecture.md` | /
|
|
40
|
-
| `docs/lessons/` | /
|
|
38
|
+
| `projects.yml` | /osk-init | /osk-spec (adds planned repos), /osk-build (repo URLs + status) | all | — |
|
|
39
|
+
| `docs/architecture.md` | /osk-init | /osk-discover (resolves decisions), /osk-build (adds resolved decisions post-merge) | /osk-spec, /osk-build | /osk-spec (validates no blockers) |
|
|
40
|
+
| `docs/lessons/` | /osk-build | /osk-build | all | — |
|
|
41
41
|
| `docs/decisions/` | manual / spec-agent | — | all | — |
|
|
42
42
|
| `docs/pending-confluence-updates.md` | any skill (on MCP failure) | any skill (on retry) | all | — |
|
|
43
|
-
| `specs/NNN/brief.md` | /spec | — | /
|
|
44
|
-
| `specs/NNN/scenarios.md` | /spec | /
|
|
45
|
-
| `specs/NNN/contracts.md` | /spec | /
|
|
46
|
-
| `specs/NNN/tasks.md` | /spec | — | /
|
|
47
|
-
| `specs/NNN/links.md` | /spec (template) | /
|
|
48
|
-
| `specs/NNN/audit-report.md` | /spec (self-review) | — | /
|
|
49
|
-
| `specs/NNN/openapi.yaml` | /spec (optional, if REST endpoints) | /
|
|
50
|
-
| `specs/NNN/conformance-report.json` | /
|
|
51
|
-
| `specs/NNN/conformance-history.log` | /
|
|
52
|
-
| `CHANGELOG.md` (impl repo) | /
|
|
53
|
-
|
|
54
|
-
**Conformance versioning**: `conformance-report.json` is overwritten on each /
|
|
43
|
+
| `specs/NNN/brief.md` | /osk-spec | — | /osk-build | — |
|
|
44
|
+
| `specs/NNN/scenarios.md` | /osk-spec | /osk-build (post-merge sync D.1.5 — only if conformance report shows intentional divergence) | /osk-build | — |
|
|
45
|
+
| `specs/NNN/contracts.md` | /osk-spec | /osk-build (post-merge sync D.1.5 — only if conformance report shows intentional divergence) | /osk-build | — |
|
|
46
|
+
| `specs/NNN/tasks.md` | /osk-spec | — | /osk-build | — |
|
|
47
|
+
| `specs/NNN/links.md` | /osk-spec (template) | /osk-build (MR links) | — | — |
|
|
48
|
+
| `specs/NNN/audit-report.md` | /osk-spec (self-review) | — | /osk-build (reads before Phase B, blocks if ❌) | — |
|
|
49
|
+
| `specs/NNN/openapi.yaml` | /osk-spec (optional, if REST endpoints) | /osk-build (may extend) | — | — |
|
|
50
|
+
| `specs/NNN/conformance-report.json` | /osk-build (Phase C.3) | /osk-build (overwrites per run) | CI Guard | — |
|
|
51
|
+
| `specs/NNN/conformance-history.log` | /osk-build (Phase C.3) | /osk-build (appends per run) | — | — |
|
|
52
|
+
| `CHANGELOG.md` (impl repo) | /osk-build (Phase D.4.5) | /osk-build | all | — |
|
|
53
|
+
|
|
54
|
+
**Conformance versioning**: `conformance-report.json` is overwritten on each /osk-build run. To preserve history, /osk-build appends a summary line to `specs/NNN/conformance-history.log`: `{timestamp} | {result} | {matching}/{total} endpoints | {matching}/{total} fields`
|
|
55
55
|
|
|
56
56
|
## Key Rules
|
|
57
57
|
|
|
58
58
|
1. **One Owner per artifact** — each artifact has exactly one Owner that creates it. Updaters are explicitly designated in the matrix above with conditions (e.g., "post-merge only"). If a skill writes to an artifact where it is not listed as Owner or Updater, it is wrong.
|
|
59
59
|
|
|
60
|
-
2. **Validate ≠ Update** — /spec validates the Glossário (checks all terms are present) but does NOT add terms. If terms are missing, it stops and asks the dev to re-run /
|
|
60
|
+
2. **Validate ≠ Update** — /osk-spec validates the Glossário (checks all terms are present) but does NOT add terms. If terms are missing, it stops and asks the dev to re-run /osk-discover.
|
|
61
61
|
|
|
62
|
-
3. **Post-merge = reality** — when /
|
|
62
|
+
3. **Post-merge = reality** — when /osk-build updates Confluence post-merge, it reflects what WAS IMPLEMENTED (merged code), not what was planned. If the implementation diverged from the spec, Confluence must match the code, not the spec.
|
|
63
63
|
|
|
64
64
|
4. **DD ownership** — the Design Document is owned by the `design-doc` agent (Labs). Skills delegate to it. Only use direct MCP as a fallback when the agent is unavailable.
|
|
65
65
|
|
|
@@ -87,7 +87,7 @@ This rule exists to prevent the "duplicate responsibility" anti-pattern where mu
|
|
|
87
87
|
|
|
88
88
|
## Label Transitions
|
|
89
89
|
|
|
90
|
-
### Demandas/ labels (owned by /
|
|
90
|
+
### Demandas/ labels (owned by /osk-init)
|
|
91
91
|
```
|
|
92
92
|
(none) → novo → processando → processado
|
|
93
93
|
```
|
|
@@ -100,16 +100,16 @@ em-discovery → aguardando-po → prd-review → prd-aprovado → em-spec → e
|
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
- `prd-aprovado` is added by the **PO manually** (human gate)
|
|
103
|
-
- `prd-rejeitado` is added by the **PO manually** (triggers /
|
|
103
|
+
- `prd-rejeitado` is added by the **PO manually** (triggers /osk-discover re-run)
|
|
104
104
|
- All other labels are added by the respective skill automatically
|
|
105
105
|
|
|
106
106
|
## MCP Failure Recovery
|
|
107
107
|
|
|
108
108
|
All 4 skills must handle MCP failures:
|
|
109
|
-
- /
|
|
110
|
-
- /
|
|
111
|
-
- /spec: saves pending operations to `docs/pending-confluence-updates.md`
|
|
112
|
-
- /
|
|
109
|
+
- /osk-init: re-execution checks existing pages, creates only missing ones
|
|
110
|
+
- /osk-discover: saves pending operations to `docs/pending-confluence-updates.md`
|
|
111
|
+
- /osk-spec: saves pending operations to `docs/pending-confluence-updates.md`
|
|
112
|
+
- /osk-build: saves pending updates to `docs/pending-confluence-updates.md`, retries on next execution
|
|
113
113
|
|
|
114
114
|
## Architecture Decisions Format
|
|
115
115
|
|
|
@@ -121,7 +121,7 @@ The `docs/architecture.md` "Decisões em Aberto" table uses this schema:
|
|
|
121
121
|
|
|
122
122
|
Status values: `aberta`, `resolvida — [decisão tomada]`
|
|
123
123
|
|
|
124
|
-
/
|
|
124
|
+
/osk-discover updates this column during its exit gate. /osk-build may also add resolved decisions post-merge (Phase D.4) when new decisions are discovered during implementation. /osk-spec validates that no `aberta` decision blocks /osk-build.
|
|
125
125
|
|
|
126
126
|
## links.md PR Table Format
|
|
127
127
|
|
|
@@ -132,7 +132,7 @@ Status values: `aberta`, `resolvida — [decisão tomada]`
|
|
|
132
132
|
|------|--------|-------|--------|
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
Status values: `open`, `em-review`, `merged`, `closed`. Created empty by /spec, filled by /
|
|
135
|
+
Status values: `open`, `em-review`, `merged`, `closed`. Created empty by /osk-spec, filled by /osk-build.
|
|
136
136
|
|
|
137
137
|
## Shared Types Between Features
|
|
138
138
|
|
|
@@ -142,7 +142,7 @@ When `contracts.md` defines types that other features will reuse (e.g., ErrorRes
|
|
|
142
142
|
|
|
143
143
|
## Feature Scope Thresholds
|
|
144
144
|
|
|
145
|
-
Both /
|
|
145
|
+
Both /osk-discover and /osk-spec use the same criteria:
|
|
146
146
|
- More than **15 behaviors/requirements** → flag as potentially large
|
|
147
147
|
- Spans **4+ repos** → flag as potentially large
|
|
148
148
|
- This is a suggestion, not a blocker. The PO/dev decides whether to break it up.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: osk-build
|
|
3
3
|
description: "Orchestrates feature implementation: reads approved spec, selects the right coding agent by stack, creates branches, runs TDD cycle, handles test failures, creates MRs, and updates living docs on Confluence post-merge."
|
|
4
4
|
metadata:
|
|
5
5
|
works_on: [copilot, antigravity, claude]
|
|
@@ -16,10 +16,10 @@ Take an approved spec and orchestrate its implementation end-to-end: select the
|
|
|
16
16
|
|
|
17
17
|
### Validate prerequisites
|
|
18
18
|
|
|
19
|
-
1. Check that `specs/NNN-name/` exists and contains all 5 files (brief.md, contracts.md, scenarios.md, tasks.md, links.md). If any file is missing: **stop** with message: "Spec incompleta. Execute /spec antes de /
|
|
20
|
-
2. In Confluence (via MCP — same as /
|
|
21
|
-
- If label `em-spec` is NOT present: **stop** — "Feature não passou pelo /spec. Execute /
|
|
22
|
-
- If label `prd-rejeitado` is present AND its addition date is MORE RECENT than `em-spec`: **stop** — "PRD foi rejeitado após a spec. Execute /
|
|
19
|
+
1. Check that `specs/NNN-name/` exists and contains all 5 files (brief.md, contracts.md, scenarios.md, tasks.md, links.md). If any file is missing: **stop** with message: "Spec incompleta. Execute /osk-spec antes de /osk-build."
|
|
20
|
+
2. In Confluence (via MCP — same as /osk-init), check the feature page labels:
|
|
21
|
+
- If label `em-spec` is NOT present: **stop** — "Feature não passou pelo /osk-spec. Execute /osk-discover e /osk-spec antes de /osk-build."
|
|
22
|
+
- If label `prd-rejeitado` is present AND its addition date is MORE RECENT than `em-spec`: **stop** — "PRD foi rejeitado após a spec. Execute /osk-discover novamente para resolver." (Check via MCP — page metadata or label order.)
|
|
23
23
|
- Otherwise: proceed
|
|
24
24
|
3. Check for concurrent execution: if there's an active branch `feat/NNN-*` in any repo, **WARN and PAUSE** — display message: "Branch ativa `feat/NNN-*` encontrada. Continuar mesmo assim? (pode causar conflitos)". Only proceed with explicit dev confirmation.
|
|
25
25
|
|
|
@@ -69,7 +69,7 @@ Read from `projects.yml` → `agents` section:
|
|
|
69
69
|
### Phase A — Preparation
|
|
70
70
|
|
|
71
71
|
1. Read the full spec (contracts.md, scenarios.md, tasks.md)
|
|
72
|
-
2. Read `specs/NNN-name/audit-report.md` — if it contains ⚠️ items, evaluate whether they block implementation. If it contains ❌ items, **stop**: "Spec não passou no audit. Execute /spec novamente."
|
|
72
|
+
2. Read `specs/NNN-name/audit-report.md` — if it contains ⚠️ items, evaluate whether they block implementation. If it contains ❌ items, **stop**: "Spec não passou no audit. Execute /osk-spec novamente."
|
|
73
73
|
3. Parse tasks.md to identify:
|
|
74
74
|
- Task groups per repo
|
|
75
75
|
- Dependencies between groups
|
|
@@ -186,7 +186,7 @@ C.2. **If tests fail:**
|
|
|
186
186
|
```
|
|
187
187
|
- Save failure context to `docs/lessons/` for future reference
|
|
188
188
|
- SKIP to next task
|
|
189
|
-
- **Unblocking**: to resume a blocked task, the dev re-runs `/
|
|
189
|
+
- **Unblocking**: to resume a blocked task, the dev re-runs `/osk-build NNN`. The agent detects tasks with `blocked` status, displays the saved context from `docs/lessons/`, and asks the dev whether to retry. If the dev confirms, the 3-retry counter resets. If the same task blocks again after another 3 retries, escalate to TL via GChat and mark the task as `blocked-permanent`. Do NOT auto-retry without dev confirmation — this prevents infinite loops.
|
|
190
190
|
|
|
191
191
|
C.3. **Conformance check** (inspired by OpenSpec's `/opsx:verify`)
|
|
192
192
|
|
|
@@ -260,7 +260,7 @@ Also append a summary line to `specs/NNN-name/conformance-history.log` (create i
|
|
|
260
260
|
```
|
|
261
261
|
{timestamp} | {result} | {matching}/{total} endpoints | {matching}/{total} fields
|
|
262
262
|
```
|
|
263
|
-
This preserves history across multiple /
|
|
263
|
+
This preserves history across multiple /osk-build runs.
|
|
264
264
|
|
|
265
265
|
C.4. **Run extension hooks** (if any)
|
|
266
266
|
|
|
@@ -316,7 +316,7 @@ If the code reviewer (human or agent) rejects the MR:
|
|
|
316
316
|
|
|
317
317
|
### Phase D — Post-merge (after human CR approves)
|
|
318
318
|
|
|
319
|
-
**How to trigger Phase D**: the dev re-executes `/
|
|
319
|
+
**How to trigger Phase D**: the dev re-executes `/osk-build NNN` after merging the MR. The agent detects merged MRs by checking links.md (MRs without "merged" status) or by querying the VCS API. Alternatively, the dev can run `/osk-build NNN --post-merge` to explicitly trigger Phase D.
|
|
320
320
|
|
|
321
321
|
After the dev merges the MR:
|
|
322
322
|
|
|
@@ -328,14 +328,14 @@ If the conformance report (Phase C.3) detected INTENTIONAL divergences (spec was
|
|
|
328
328
|
- `scenarios.md`: update Given/When/Then if behavior changed
|
|
329
329
|
- Commit: `fix(NNN): sync spec with implementation — {summary of changes}`
|
|
330
330
|
|
|
331
|
-
This ensures specs remain the source of truth for FUTURE features that reference them. Without this update, /
|
|
331
|
+
This ensures specs remain the source of truth for FUTURE features that reference them. Without this update, /osk-discover and /osk-spec for next features read stale contracts.
|
|
332
332
|
|
|
333
333
|
If conformance report shows NO divergences → skip (specs already match).
|
|
334
334
|
|
|
335
335
|
D.2. Move VCS Issue → `done`
|
|
336
336
|
D.3. **Update living docs on Confluence** (via MCP):
|
|
337
337
|
|
|
338
|
-
> **Ownership rule**: /
|
|
338
|
+
> **Ownership rule**: /osk-build is the LAST to touch living docs. Its updates reflect what WAS IMPLEMENTED (merged code), not what was planned in the spec. If the implemented behavior diverged from the spec (e.g., rule adjusted during dev), Confluence must reflect the REALITY of the code, not the original spec. Code is the source of truth post-merge.
|
|
339
339
|
|
|
340
340
|
| Document | What to update | When |
|
|
341
341
|
|----------|---------------|------|
|
|
@@ -351,13 +351,13 @@ D.3. **Update living docs on Confluence** (via MCP):
|
|
|
351
351
|
**Confluence unavailable fallback**: if Confluence access (MCP or REST API) is down during post-merge:
|
|
352
352
|
- Save pending updates to `docs/pending-confluence-updates.md` with: target page, content to add, date
|
|
353
353
|
- Notify the dev with message: "Confluence indisponível — atualizações salvas em docs/pending-confluence-updates.md. Execute manualmente quando o Confluence voltar."
|
|
354
|
-
- On the next /
|
|
354
|
+
- On the next /osk-build execution, check if `docs/pending-confluence-updates.md` exists and attempt to apply pending updates
|
|
355
355
|
|
|
356
356
|
D.4. **Post-implementation discoveries:**
|
|
357
357
|
|
|
358
358
|
If implementation revealed:
|
|
359
359
|
- a) A SURPRISE (unexpected behavior, edge case) → save to `docs/lessons/NNN-title.md` with template below
|
|
360
|
-
- b) A NEW ARCHITECTURE DECISION (chose a pattern, discovered a constraint) → add to `docs/architecture.md` "Decisões em Aberto" table with Status: `resolvida — [decisão tomada durante implementação de {SIGLA}-NNN]`. This ensures architecture.md reflects decisions made during /
|
|
360
|
+
- b) A NEW ARCHITECTURE DECISION (chose a pattern, discovered a constraint) → add to `docs/architecture.md` "Decisões em Aberto" table with Status: `resolvida — [decisão tomada durante implementação de {SIGLA}-NNN]`. This ensures architecture.md reflects decisions made during /osk-build, not just during /osk-discover.
|
|
361
361
|
|
|
362
362
|
Lessons template:
|
|
363
363
|
```
|
|
@@ -413,7 +413,7 @@ D.5. Notify Google Chat (rich card format):
|
|
|
413
413
|
|
|
414
414
|
### Phase E — Infrastructure validation (optional, recommended before release)
|
|
415
415
|
|
|
416
|
-
**How to trigger Phase E**: dev runs `/
|
|
416
|
+
**How to trigger Phase E**: dev runs `/osk-build --validate`, or automatically after the last feature of the cycle. Not executed per feature — only when the dev wants to validate the complete system against real infrastructure.
|
|
417
417
|
|
|
418
418
|
**Prerequisite**: the project has a `docker-compose.yml` (or equivalent infra) declared in `projects.yml`. If not, skip this phase.
|
|
419
419
|
|
|
@@ -509,7 +509,7 @@ Add a step to your CI pipeline (GitHub Actions, GitLab CI, etc.) that reads the
|
|
|
509
509
|
|
|
510
510
|
### When to adopt
|
|
511
511
|
|
|
512
|
-
- **Now**: run conformance check manually during /
|
|
512
|
+
- **Now**: run conformance check manually during /osk-build (Phase C.3) — already implemented
|
|
513
513
|
- **Next**: add CI Guard when the team sets up CI/CD pipelines
|
|
514
514
|
- **Future**: add custom hooks for domain-specific validations
|
|
515
515
|
|
|
@@ -523,7 +523,7 @@ To add support for a new programming language or framework:
|
|
|
523
523
|
|
|
524
524
|
1. Create an agent definition in `padrao-labs-agents/.agents/agents/{name}.agent.md`
|
|
525
525
|
2. Add the stack → agent mapping in `projects.yml` → `agents.coding` (e.g., `go: my-go-engineer`)
|
|
526
|
-
3. The /
|
|
526
|
+
3. The /osk-build automatically selects the new agent when a repo in `projects.yml` declares that stack
|
|
527
527
|
|
|
528
528
|
### 2. Rules (cross-cutting concerns)
|
|
529
529
|
|
|
@@ -535,7 +535,7 @@ To add rules that apply across all skills:
|
|
|
535
535
|
|
|
536
536
|
### 3. Hooks (custom validations)
|
|
537
537
|
|
|
538
|
-
To add custom validation steps to the /
|
|
538
|
+
To add custom validation steps to the /osk-build pipeline:
|
|
539
539
|
|
|
540
540
|
1. Create a `hooks/` directory in the spec repo
|
|
541
541
|
2. Add executable scripts to `hooks/pre-merge/` — they run in Phase C.4 before MR creation
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: osk-discover
|
|
3
3
|
description: "Reads PO demands and project context, identifies gaps and ambiguities, generates structured questions or a PRD. Handles the Q&A loop with the PO via Confluence."
|
|
4
4
|
metadata:
|
|
5
5
|
works_on: [copilot, antigravity, claude]
|
|
@@ -18,13 +18,13 @@ Read all available inputs (PO demand, domain docs, architecture, existing code),
|
|
|
18
18
|
|
|
19
19
|
Before anything, verify that the project was set up correctly:
|
|
20
20
|
|
|
21
|
-
1. Read `projects.yml` — if empty or has only template content, **stop** with message: "/
|
|
21
|
+
1. Read `projects.yml` — if empty or has only template content, **stop** with message: "/osk-init não foi executado. Execute /osk-init antes de /osk-discover."
|
|
22
22
|
2. **Confluence access — ALWAYS use MCP:**
|
|
23
23
|
- All Confluence operations (read pages, create pages, labels) MUST use the MCP server (`confluence` in `.mcp.json`).
|
|
24
24
|
- **Do NOT use curl, fetch, or direct REST calls** — even if `.env` has credentials.
|
|
25
25
|
- If MCP is not responding → **STOP**: "MCP Confluence não disponível. Execute 'open-spec-kit doctor' para diagnosticar."
|
|
26
26
|
3. Verify these pages exist under the project root (`root_page_id` from `projects.yml`):
|
|
27
|
-
- `Visão do Produto` — if not found, **stop** with message: "Página 'Visão do Produto' não encontrada. Execute /
|
|
27
|
+
- `Visão do Produto` — if not found, **stop** with message: "Página 'Visão do Produto' não encontrada. Execute /osk-init primeiro."
|
|
28
28
|
- `Glossário` — if not found, **stop** with same message pattern
|
|
29
29
|
- `Domínio/` (with children: Regras, Fluxos, Tabelas, Integrações) — if not found, **stop**
|
|
30
30
|
- `Features/` — if not found, **stop**
|
|
@@ -32,7 +32,7 @@ Before anything, verify that the project was set up correctly:
|
|
|
32
32
|
|
|
33
33
|
### Feature selection (BUG-032)
|
|
34
34
|
|
|
35
|
-
If NO argument was passed (user ran `/
|
|
35
|
+
If NO argument was passed (user ran `/osk-discover` without a feature name):
|
|
36
36
|
|
|
37
37
|
1. List ALL features under `Features/` in Confluence
|
|
38
38
|
2. For each feature, read the metadata table ("Depende de" field)
|
|
@@ -40,7 +40,7 @@ If NO argument was passed (user ran `/discovery` without a feature name):
|
|
|
40
40
|
4. **Check dependencies**: a feature can only enter discovery if ALL features it depends on already have label `em-spec` or `done`. Features with unsatisfied dependencies: mark as "(blocked — depends on {SIGLA}-NNN)"
|
|
41
41
|
5. Present the dev with the list of available (non-blocked) features, sorted by ID:
|
|
42
42
|
```
|
|
43
|
-
Features disponíveis para /
|
|
43
|
+
Features disponíveis para /osk-discover:
|
|
44
44
|
1. ⚙️ TFB-000 - Infraestrutura e Scaffold
|
|
45
45
|
2. 🚀 TFB-001 - Importação de Faturas
|
|
46
46
|
3. 🚀 TFB-003 - Consulta de Faturas
|
|
@@ -55,7 +55,7 @@ If NO argument was passed (user ran `/discovery` without a feature name):
|
|
|
55
55
|
7. Ask: "Qual feature deseja trabalhar?"
|
|
56
56
|
8. Proceed with the chosen feature.
|
|
57
57
|
|
|
58
|
-
If argument WAS passed (e.g., `/
|
|
58
|
+
If argument WAS passed (e.g., `/osk-discover TFB-001`):
|
|
59
59
|
- Locate the corresponding feature page and proceed normally.
|
|
60
60
|
- If the feature has unsatisfied dependencies, **warn** but continue (dev may be working out of order intentionally).
|
|
61
61
|
|
|
@@ -73,7 +73,7 @@ Read these files FIRST:
|
|
|
73
73
|
### 1. Compile all information
|
|
74
74
|
|
|
75
75
|
From Confluence (via MCP), read:
|
|
76
|
-
- The feature page in `Features/` (demand extracted by /
|
|
76
|
+
- The feature page in `Features/` (demand extracted by /osk-init). Read the metadata table — especially the "Seções do PO" field, which tells you exactly which PO document sections are relevant for this feature. Use this to focus your gap analysis.
|
|
77
77
|
- `Dominio/` — business rules, flows, reference tables, integrations
|
|
78
78
|
- `Visao do Produto` — product scope and success metrics
|
|
79
79
|
- Previous Q&A rounds on the feature page (if any)
|
|
@@ -209,13 +209,13 @@ Before deciding questions vs PRD, assess the scope:
|
|
|
209
209
|
|
|
210
210
|
Before generating questions or PRD, find the feature page:
|
|
211
211
|
|
|
212
|
-
1. Search for an existing feature page in `Features/` matching the feature name/argument (created by /
|
|
212
|
+
1. Search for an existing feature page in `Features/` matching the feature name/argument (created by /osk-init in Step 4.5)
|
|
213
213
|
2. **If found**: use it (read existing content, detect previous Q&A rounds)
|
|
214
|
-
3. **If NOT found**: the /
|
|
214
|
+
3. **If NOT found**: the /osk-init may have failed to create it. Create it under `Features/` as fallback:
|
|
215
215
|
- Title: `{SIGLA}-NNN - Feature name` (next sequential number, using project sigla from projects.yml)
|
|
216
216
|
- Content: 1-2 paragraphs describing the feature (from PO documents or argument context)
|
|
217
217
|
- Label: `em-discovery`
|
|
218
|
-
- Log: "Feature page not found — created as fallback. Check if /
|
|
218
|
+
- Log: "Feature page not found — created as fallback. Check if /osk-init ran correctly."
|
|
219
219
|
4. The feature page is the SINGLE source of truth for this feature's discovery process
|
|
220
220
|
|
|
221
221
|
### 6. Decision: questions or PRD?
|
|
@@ -254,7 +254,7 @@ Then:
|
|
|
254
254
|
Replace `{}` placeholders with actual values. Notifications always in pt-BR.
|
|
255
255
|
- STOP and wait for PO to respond
|
|
256
256
|
|
|
257
|
-
**Timeout and escalation:** if the PO does not respond in a reasonable time, the dev can re-run /
|
|
257
|
+
**Timeout and escalation:** if the PO does not respond in a reasonable time, the dev can re-run /osk-discover on the same feature. The agent must detect previous questions (existing "Dúvidas & Decisões — Rodada N" section) and:
|
|
258
258
|
- Check the page's `modified` field (via MCP). If the last modification was more than 3 business days ago and responses still contain "_aguardando_": escalate.
|
|
259
259
|
- If there are pending responses but within the deadline: re-notify via Google Chat (same command as the previous step)
|
|
260
260
|
- If more than 3 business days have passed: escalate to TL:
|
|
@@ -273,13 +273,13 @@ Then:
|
|
|
273
273
|
|
|
274
274
|
For architectural trade-offs, read `projects.yml` → `agents.principal`. If configured (not null), consult that agent to validate options. Document the decision in the PRD.
|
|
275
275
|
|
|
276
|
-
**Fallback**: if `principal-engineer` agent is not available, document the options with trade-offs in the PRD and mark as "DECISÃO TÉCNICA — a validar com TL antes do /spec".
|
|
276
|
+
**Fallback**: if `principal-engineer` agent is not available, document the options with trade-offs in the PRD and mark as "DECISÃO TÉCNICA — a validar com TL antes do /osk-spec".
|
|
277
277
|
|
|
278
278
|
After documenting technical decisions, **return to step 6** and re-evaluate: if no gaps remain, proceed to generate the full PRD.
|
|
279
279
|
|
|
280
280
|
**IF no gaps remain (or all answered):**
|
|
281
281
|
|
|
282
|
-
Generate the PRD on the feature page in Confluence. **IMPORTANT: APPEND the PRD section BELOW the existing metadata table and Escopo section created by /
|
|
282
|
+
Generate the PRD on the feature page in Confluence. **IMPORTANT: APPEND the PRD section BELOW the existing metadata table and Escopo section created by /osk-init — do NOT replace or remove them.**
|
|
283
283
|
|
|
284
284
|
```
|
|
285
285
|
## PRD
|
|
@@ -415,9 +415,9 @@ If a Confluence operation fails mid-flow (publishing questions, updating PRD, ch
|
|
|
415
415
|
|
|
416
416
|
## Exit gate (BLOCKING — cannot close the loop without these)
|
|
417
417
|
|
|
418
|
-
The /
|
|
418
|
+
The /osk-discover CANNOT be considered done until ALL of the following are true. If any item fails, fix it before proceeding.
|
|
419
419
|
|
|
420
|
-
1. **Glossary updated on Confluence** — if the PRD section "GLOSSÁRIO: termos novos" lists any terms, they MUST be added to the Glossário page on Confluence BEFORE closing. Read the current page, add the terms, update. Do NOT leave this for /spec.
|
|
421
|
-
2. **All "A CONFIRMAR" in Glossário resolved** — if any term in the Glossário still has "A CONFIRMAR" and the /
|
|
420
|
+
1. **Glossary updated on Confluence** — if the PRD section "GLOSSÁRIO: termos novos" lists any terms, they MUST be added to the Glossário page on Confluence BEFORE closing. Read the current page, add the terms, update. Do NOT leave this for /osk-spec.
|
|
421
|
+
2. **All "A CONFIRMAR" in Glossário resolved** — if any term in the Glossário still has "A CONFIRMAR" and the /osk-discover answered that question (e.g., PO confirmed enum values), update the Glossário to remove the "A CONFIRMAR" and replace with the confirmed value.
|
|
422
422
|
3. **Decisions attributed correctly** — business decisions (scope, enums, features) marked as "PO". Technical decisions (cascade, notification rules, filtering) marked as "Dev". Never mix them.
|
|
423
|
-
4. **architecture.md updated** — if the /
|
|
423
|
+
4. **architecture.md updated** — if the /osk-discover resolved any open decision listed in architecture.md, update the Status column from `aberta` to `resolvida — [decisão tomada]`. Do NOT leave stale "A CONFIRMAR" when the answer exists.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: osk-init
|
|
3
3
|
description: "Bootstraps a new project from Confluence demands. Reads PO inputs, generates living docs (Vision, Glossary, Domain), and prepares the spec repo."
|
|
4
4
|
metadata:
|
|
5
5
|
works_on: [copilot, antigravity, claude]
|
|
@@ -16,7 +16,7 @@ Bootstrap a new project from raw PO inputs on Confluence. Generate the initial l
|
|
|
16
16
|
|
|
17
17
|
1. Read `projects.yml` — if already filled (has repos with status != template):
|
|
18
18
|
- If argument contains `--force`: proceed (will overwrite existing config and re-create missing pages)
|
|
19
|
-
- Otherwise: **stop** with message: "Projeto já configurado. Para re-executar, passe `--force` (ex: `/
|
|
19
|
+
- Otherwise: **stop** with message: "Projeto já configurado. Para re-executar, passe `--force` (ex: `/osk-init MFS --force`)."
|
|
20
20
|
2. **Confluence access — ALWAYS use MCP:**
|
|
21
21
|
- All Confluence operations (read pages, create pages, labels) MUST use the MCP server (`confluence` in `.mcp.json`).
|
|
22
22
|
- **Do NOT use curl, fetch, or direct REST calls** — even if `.env` has credentials.
|
|
@@ -336,11 +336,11 @@ If the concern IS already an explicit PO section (identified in Phase A as its o
|
|
|
336
336
|
## Escopo
|
|
337
337
|
{bullet list of what this feature includes — extracted from PO docs, not invented}
|
|
338
338
|
```
|
|
339
|
-
3. Add label `em-discovery` (ready for /
|
|
339
|
+
3. Add label `em-discovery` (ready for /osk-discover to process)
|
|
340
340
|
|
|
341
|
-
If the PO documents describe a SINGLE monolithic system without clear feature boundaries, create ONE feature page covering the full scope and note: "Feature única — considerar quebra em sub-features durante /
|
|
341
|
+
If the PO documents describe a SINGLE monolithic system without clear feature boundaries, create ONE feature page covering the full scope and note: "Feature única — considerar quebra em sub-features durante /osk-discover."
|
|
342
342
|
|
|
343
|
-
This step ensures /
|
|
343
|
+
This step ensures /osk-discover always finds a feature page to work with.
|
|
344
344
|
|
|
345
345
|
### 4. Set up the spec repo
|
|
346
346
|
|
|
@@ -356,7 +356,7 @@ In the local spec repo:
|
|
|
356
356
|
- Confluence space key and root_page_id (if multi-project layout)
|
|
357
357
|
|
|
358
358
|
**Create directories:**
|
|
359
|
-
- `docs/lessons/` — empty (used by /
|
|
359
|
+
- `docs/lessons/` — empty (used by /osk-build to log surprises)
|
|
360
360
|
- `docs/decisions/` — empty (used for ADRs)
|
|
361
361
|
|
|
362
362
|
**Generate `docs/architecture.md` draft:**
|
|
@@ -377,16 +377,16 @@ In the local spec repo:
|
|
|
377
377
|
```
|
|
378
378
|
- Events identified (table: event, generates notification?, generates history?)
|
|
379
379
|
- Environment/infrastructure (how it runs)
|
|
380
|
-
- **Decisoes em aberto**: list ALL "A CONFIRMAR" items from all Confluence pages, ranked by impact. High impact = blocks /spec or /
|
|
380
|
+
- **Decisoes em aberto**: list ALL "A CONFIRMAR" items from all Confluence pages, ranked by impact. High impact = blocks /osk-spec or /osk-build. Format:
|
|
381
381
|
|
|
382
382
|
```
|
|
383
383
|
| # | Decisao | Impacto | Bloqueia | Status |
|
|
384
384
|
|---|---------|---------|----------|--------|
|
|
385
|
-
| 1 | Worker separado ou parte da API? | Alto — define repos e CI | /spec | aberta |
|
|
386
|
-
| 2 | Valores do enum de Status | Médio — afeta model e validação | /
|
|
385
|
+
| 1 | Worker separado ou parte da API? | Alto — define repos e CI | /osk-spec | aberta |
|
|
386
|
+
| 2 | Valores do enum de Status | Médio — afeta model e validação | /osk-build | aberta |
|
|
387
387
|
```
|
|
388
388
|
|
|
389
|
-
Status values: `aberta`, `resolvida — [decisão tomada]`. The /
|
|
389
|
+
Status values: `aberta`, `resolvida — [decisão tomada]`. The /osk-discover updates this column when resolving decisions (exit gate).
|
|
390
390
|
|
|
391
391
|
Mark sections as "DRAFT — validar com o time"
|
|
392
392
|
|
|
@@ -395,7 +395,7 @@ Mark sections as "DRAFT — validar com o time"
|
|
|
395
395
|
If a Confluence page creation fails mid-flow:
|
|
396
396
|
1. Log which pages were successfully created and which failed
|
|
397
397
|
2. Save pending page creations to `docs/pending-confluence-updates.md` with: target parent page, page title, content summary, date
|
|
398
|
-
3. Report to dev: "Setup parcial — {N} de {total} páginas criadas. Páginas faltantes: {list}. Re-execute /
|
|
398
|
+
3. Report to dev: "Setup parcial — {N} de {total} páginas criadas. Páginas faltantes: {list}. Re-execute /osk-init para tentar criar as faltantes."
|
|
399
399
|
4. On re-execution, check if `docs/pending-confluence-updates.md` exists and attempt to apply pending operations FIRST. Also check which pages already exist (by listing children of the parent page) and only create the missing ones — never duplicate. Remove applied entries from the file.
|
|
400
400
|
|
|
401
401
|
### 5. Self-review
|
|
@@ -436,7 +436,7 @@ Before closing the loop, the agent MUST do a self-review:
|
|
|
436
436
|
📊 <b>Métricas:</b>
|
|
437
437
|
• {rule_count} regras de negócio
|
|
438
438
|
• {flow_count} fluxos documentados
|
|
439
|
-
• {open_decisions_count} decisões em aberto ({high_impact_count} alto impacto)" --next "Resolver decisões de alto impacto e rodar /
|
|
439
|
+
• {open_decisions_count} decisões em aberto ({high_impact_count} alto impacto)" --next "Resolver decisões de alto impacto e rodar /osk-discover" --button-text "Abrir Visão do Produto" --button-url "{confluence_vision_page_url}"
|
|
440
440
|
|
|
441
441
|
Replace `{}` placeholders with actual values from the execution context.
|
|
442
442
|
|