kido-workspace 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/rules/base.md +18 -0
- package/.agents/skills/kido-brainstorming/SKILL.md +39 -0
- package/.agents/skills/kido-code-review/SKILL.md +46 -0
- package/.agents/skills/kido-debugging/SKILL.md +37 -0
- package/.agents/skills/kido-executing-plans/SKILL.md +40 -0
- package/.agents/skills/kido-onboarding/SKILL.md +132 -0
- package/.agents/skills/kido-testing/SKILL.md +50 -0
- package/.agents/skills/kido-verification/SKILL.md +52 -0
- package/.agents/skills/kido-workflow/SKILL.md +89 -0
- package/.agents/skills/kido-writing-plans/SKILL.md +37 -0
- package/.agents/skills/kido-writing-specs/SKILL.md +48 -0
- package/.agents/templates/context/current-state.md +22 -0
- package/.agents/templates/context/glossary.md +11 -0
- package/.agents/templates/context/overview.md +28 -0
- package/.agents/templates/epics/EPIC-001-template/US-template-slug/spec.md +51 -0
- package/.agents/templates/epics/EPIC-001-template/US-template-slug/story.md +47 -0
- package/.agents/templates/epics/EPIC-001-template/epic.md +56 -0
- package/.agents/templates/implementation-plan.md +71 -0
- package/.agents/templates/workspace-instructions.md +50 -0
- package/LICENSE +21 -0
- package/README.md +105 -0
- package/bin/kido-workspace.cjs +11 -0
- package/lib/workspace.cjs +342 -0
- package/package.json +26 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kido-writing-specs
|
|
3
|
+
description: Use for requested KIDO product-document work or to establish requirements before a full-flow implementation; do not invoke routinely during implementation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# KIDO Writing Specs
|
|
7
|
+
|
|
8
|
+
Follow [kido-workflow](../kido-workflow/SKILL.md). Read document rules, the glossary, templates, and the relevant domain sources. For a code change, inspect the current implementation read-only and use the clarified requirements.
|
|
9
|
+
|
|
10
|
+
Establish coverage during design/planning. Bounded work may use approved in-chat acceptance checks without creating product documents. During implementation and review fixes, keep established Spec/AC content fixed and record pending changes in the existing plan or chat; do not rerun this audit on each code iteration. Perform one consolidated synchronization after code acceptance, or handle an explicitly requested document correction in its own scope.
|
|
11
|
+
|
|
12
|
+
## Audit before creating documents
|
|
13
|
+
|
|
14
|
+
Compare actors, needs, outcomes, scope, and observed behavior with existing Epics and Stories. Check consistency among AC, Specs, contracts, ADRs, and implementation. Compare contract changes against the declared canonical source, its imports, and generated or legacy artifacts. For UI, consult the relevant design system.
|
|
15
|
+
|
|
16
|
+
| Finding | Smallest suitable action |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| Existing Story, AC, and Spec still cover the request | Reuse them. |
|
|
19
|
+
| Related Story is incomplete or incorrect | Update the Story, AC, and affected Spec. |
|
|
20
|
+
| Epic outcome or scope changed | Update the Epic and related Story or Spec. |
|
|
21
|
+
| No suitable Story exists | Add a linked Story and Spec under the relevant Epic. |
|
|
22
|
+
| A distinct outcome has no Epic | Create the minimum Epic, Story, and Spec set. |
|
|
23
|
+
|
|
24
|
+
Do not duplicate documents merely because wording differs. Require Story/AC/Spec coverage for full-flow changes; reuse suitable documents. For bounded changes, the approved request and observable checks in chat provide coverage.
|
|
25
|
+
|
|
26
|
+
## Content and readiness
|
|
27
|
+
|
|
28
|
+
- **Epic:** problem, observable or measurable outcome, in/out scope, and Definition of Done.
|
|
29
|
+
- **Story:** actor, need, value, context, and stable AC IDs. Each AC states the condition, action, and observable result, including relevant errors and boundaries.
|
|
30
|
+
- **Spec:** current versus required behavior, business rules, flows and states, contract or data changes, validation and errors, and applicable security or observability changes. Link the Story and specified AC.
|
|
31
|
+
|
|
32
|
+
Keep code, hooks, CSS, source-file lists, framework choices, and infrastructure out of `epics/`. A contract delta may name observable endpoints, fields, and errors; HOW belongs in a plan. Describe what a user or external system observes, not a component render.
|
|
33
|
+
|
|
34
|
+
Example AC: “When connectivity fails while saving a profile, the user sees an unsynced state and the entered content remains available.” The actual persistence policy must come from confirmed requirements, not this example.
|
|
35
|
+
|
|
36
|
+
## Sources and approval state
|
|
37
|
+
|
|
38
|
+
Record each requirement's source. Documents prepared during design/planning remain Draft or Pending PO/BA review until the owner signs off. A complete draft can be presented for design approval; that approval does not imply PO/BA sign-off. Keep assumptions, decision owners, and impact visible. Apply the implementation freeze rather than updating documents just to keep pace with code.
|
|
39
|
+
|
|
40
|
+
## Review and links
|
|
41
|
+
|
|
42
|
+
1. Map the request to each AC. The AC and Spec must agree on outcomes, conditions, and errors.
|
|
43
|
+
2. Remove implementation detail, placeholders, and contradictions. Do not guess missing product requirements.
|
|
44
|
+
3. Link each Story to its Spec. Link a plan only after it exists. Use relative Markdown links and verify targets.
|
|
45
|
+
4. During design/planning, describe planned endpoint/schema deltas in the Spec and plan. During implementation, retain that baseline and accumulate pending deltas in the plan or chat. After user code acceptance, update affected Specs, the canonical contract, and required ADR/glossary material in one batch under the workflow. Code-generation exceptions follow the explicitly approved build-input strategy; they do not authorize continuous Spec or canonical-contract edits.
|
|
46
|
+
5. Report paths, AC, approval state, and open decisions. Writing a document does not complete an AC.
|
|
47
|
+
|
|
48
|
+
For documentation-only work, hand off here. For full-flow implementation, provide the established requirements and approval evidence through [kido-brainstorming](../kido-brainstorming/SKILL.md) and [kido-writing-plans](../kido-writing-plans/SKILL.md). Bounded implementation stays with its approved chat baseline and goes to execution without mandatory product documents or a plan. After code acceptance, perform the authorized synchronization and return to handoff without restarting design/planning. This skill does not create a technical plan.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# <Project Name> — Current State
|
|
2
|
+
|
|
3
|
+
> Context template. Save the project document at `context/current-state.md`. Record the scope and date of evidence. Existing code or passing checks do not establish deployment or acceptance.
|
|
4
|
+
|
|
5
|
+
**Updated:** <Date>
|
|
6
|
+
**Survey scope:** <Components, sources, and limits>
|
|
7
|
+
|
|
8
|
+
## Delivery State
|
|
9
|
+
|
|
10
|
+
| Component / Story | Implementation | Verification / evidence | Deployment | Review / acceptance |
|
|
11
|
+
| --- | --- | --- | --- | --- |
|
|
12
|
+
| <Component> | <State> | <Evidence or not verified> | <Evidence or not confirmed> | <Actual feedback or pending> |
|
|
13
|
+
|
|
14
|
+
## Known Gaps & Tech Debt
|
|
15
|
+
|
|
16
|
+
| Gap | Observed source | Impact | Decision / next step |
|
|
17
|
+
| --- | --- | --- | --- |
|
|
18
|
+
| <Gap> | <Evidence> | <Impact> | <Confirmed decision or proposal> |
|
|
19
|
+
|
|
20
|
+
## Roadmap & Open Decisions
|
|
21
|
+
|
|
22
|
+
<Distinguish approved plans from proposals. Link existing Stories, Specs, and plans.>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# <Project Name> — Glossary
|
|
2
|
+
|
|
3
|
+
> Context template. Save the project document at `context/glossary.md`. Keep one canonical definition per concept. Confirm terms inferred from code before treating them as requirements.
|
|
4
|
+
|
|
5
|
+
| Canonical term | Definition | Aliases | Source / confirmation status |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| <Term> | <Meaning in this project> | <Other names> | <Source or not confirmed> |
|
|
8
|
+
|
|
9
|
+
## Open Definitions
|
|
10
|
+
|
|
11
|
+
<Conflicting or unclear concepts, related sources, and the person who must decide.>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# <Project Name> — Overview
|
|
2
|
+
|
|
3
|
+
> Context template. Save the project document at `context/overview.md`. Source every factual claim; mark inferences separately for confirmation. Current code does not establish an approved business objective.
|
|
4
|
+
|
|
5
|
+
**Document status:** Draft
|
|
6
|
+
**Sources / survey scope:** <Actual sources and limits>
|
|
7
|
+
|
|
8
|
+
## Problem & Purpose
|
|
9
|
+
|
|
10
|
+
<Problem, confirmed goals, and decisions still needed from the owner.>
|
|
11
|
+
|
|
12
|
+
## Actors & Outcomes
|
|
13
|
+
|
|
14
|
+
| Actor | Need | Confirmed outcome / assumption |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| <Actor> | <Need> | <Outcome and source> |
|
|
17
|
+
|
|
18
|
+
## System Boundaries
|
|
19
|
+
|
|
20
|
+
<Owned components, external integrations, data sources, and ownership.>
|
|
21
|
+
|
|
22
|
+
## Constraints & Sources
|
|
23
|
+
|
|
24
|
+
<Relative links to existing architecture, invariants, canonical contracts, and design system.>
|
|
25
|
+
|
|
26
|
+
## Open Questions
|
|
27
|
+
|
|
28
|
+
<Unclear points, decision owner, and impact.>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# US-xxx: <Tên thay đổi> — Change Specification
|
|
2
|
+
|
|
3
|
+
> Template chung cho WHAT & BOUNDARIES. Không chứa mã triển khai, hooks, CSS, lựa chọn framework/hạ tầng hoặc danh sách file source. HOW thuộc plan của package. Thay nội dung mẫu; phần không áp dụng ghi lý do.
|
|
4
|
+
|
|
5
|
+
**Story:** [story.md](./story.md)
|
|
6
|
+
**AC được đặc tả:** <ID AC từ Story>
|
|
7
|
+
**Trạng thái yêu cầu:** Draft
|
|
8
|
+
|
|
9
|
+
## 1. Current Behavior
|
|
10
|
+
|
|
11
|
+
<Hành vi hiện tại, điều kiện và nguồn quan sát. Phân biệt chưa có hành vi với chưa đủ evidence.>
|
|
12
|
+
|
|
13
|
+
## 2. Required Behavior
|
|
14
|
+
|
|
15
|
+
| AC | Điều kiện / trạng thái | Hành vi cần đạt |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| AC-01 | <Điều kiện> | <Kết quả nhất quán với Story> |
|
|
18
|
+
| AC-02 | <Lỗi/boundary> | <Kết quả đã chốt> |
|
|
19
|
+
|
|
20
|
+
## 3. Rules & Boundaries
|
|
21
|
+
|
|
22
|
+
- <Quy tắc áp dụng và liên kết tương đối tới nguồn chuẩn>
|
|
23
|
+
- <Hành vi cần bảo toàn và ranh giới không thuộc thay đổi>
|
|
24
|
+
|
|
25
|
+
## 4. Flow & States
|
|
26
|
+
|
|
27
|
+
<Luồng chính, chuyển trạng thái, điều kiện kết thúc và nhánh lỗi. Dùng sequence diagram khi giúp làm rõ tương tác; không mặc định actor hay subsystem từ một dự án khác.>
|
|
28
|
+
|
|
29
|
+
## 5. Contract / Data Delta
|
|
30
|
+
|
|
31
|
+
**Nguồn canonical:** <Liên kết tương đối tới contract hiện có hoặc lý do không áp dụng>
|
|
32
|
+
|
|
33
|
+
| Thành phần hợp đồng | Hiện tại | Yêu cầu | AC |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| <Endpoint/trường/quyền/lỗi quan sát được> | <Hiện trạng> | <Delta> | <ID AC> |
|
|
36
|
+
|
|
37
|
+
<Nêu tác động tương thích và bên sử dụng bị ảnh hưởng; không chọn cách triển khai.>
|
|
38
|
+
|
|
39
|
+
## 6. Validation & Errors
|
|
40
|
+
|
|
41
|
+
| Điều kiện | Kết quả quan sát được | AC | Evidence cần có |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| <Invalid input/lỗi/boundary liên quan> | <Kết quả đã chốt> | <ID AC> | <Quan sát xác nhận hành vi> |
|
|
44
|
+
|
|
45
|
+
## 7. Security & Observability Delta
|
|
46
|
+
|
|
47
|
+
<Thay đổi quyền, dữ liệu nhạy cảm hoặc sự kiện cần quan sát ở mức yêu cầu; không có thay đổi thì ghi rõ cùng lý do.>
|
|
48
|
+
|
|
49
|
+
## 8. Open Decisions
|
|
50
|
+
|
|
51
|
+
<Giả định chưa được xác nhận, nguồn cần bổ sung và AC bị phụ thuộc. Không biến gap thành yêu cầu đã duyệt.>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# US-xxx: <Tên Story>
|
|
2
|
+
|
|
3
|
+
> Template chung. Thay ID/slug và nội dung mẫu. AC mô tả điều actor hoặc hệ thống bên ngoài quan sát được; không đưa cách triển khai vào yêu cầu. ID AC phải ổn định để truy vết tới Spec, plan và evidence.
|
|
4
|
+
|
|
5
|
+
**Trạng thái yêu cầu:** Draft
|
|
6
|
+
**Nguồn yêu cầu:** <Nguồn và quyết định đã xác nhận>
|
|
7
|
+
|
|
8
|
+
## 1. User Story
|
|
9
|
+
|
|
10
|
+
- **As a:** <Actor>
|
|
11
|
+
- **I want:** <Nhu cầu>
|
|
12
|
+
- **So that:** <Giá trị/kết quả cần đạt>
|
|
13
|
+
|
|
14
|
+
## 2. Context & Triggers
|
|
15
|
+
|
|
16
|
+
<Điều kiện đầu vào, sự kiện kích hoạt, quyền của actor và phụ thuộc liên quan.>
|
|
17
|
+
|
|
18
|
+
## 3. Acceptance Criteria
|
|
19
|
+
|
|
20
|
+
| ID | Điều kiện | Thao tác / sự kiện | Kết quả quan sát được |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| AC-01 | <Điều kiện> | <Thao tác> | <Kết quả> |
|
|
23
|
+
| AC-02 | <Lỗi hoặc boundary thuộc phạm vi> | <Sự kiện> | <Kết quả đã chốt> |
|
|
24
|
+
|
|
25
|
+
> Thêm/bớt AC theo yêu cầu thật; không mặc định mất mạng, fallback hoặc một trạng thái giao diện cụ thể. Chưa có evidence thì không đánh dấu AC đạt.
|
|
26
|
+
|
|
27
|
+
## 4. Open Decisions
|
|
28
|
+
|
|
29
|
+
| Giả định / quyết định | Người cần xác nhận | Ảnh hưởng |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| <Điểm chưa rõ hoặc không có> | <Người phụ trách> | <AC/phạm vi phụ thuộc> |
|
|
32
|
+
|
|
33
|
+
## 5. Traceability
|
|
34
|
+
|
|
35
|
+
- **Epic:** [epic.md](../epic.md)
|
|
36
|
+
- **Spec:** [spec.md](./spec.md)
|
|
37
|
+
|
|
38
|
+
> Chỉ thêm liên kết tới các plan thực tế đã tồn tại khi có; không liên kết template như plan của Story. Chi tiết kỹ thuật vẫn nằm trong plan.
|
|
39
|
+
|
|
40
|
+
## 6. Acceptance Evidence
|
|
41
|
+
|
|
42
|
+
| AC | Evidence / giới hạn | Trạng thái kiểm chứng |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| AC-01 | <Nguồn evidence hoặc chưa có> | Chưa kiểm chứng |
|
|
45
|
+
| AC-02 | <Nguồn evidence hoặc chưa có> | Chưa kiểm chứng |
|
|
46
|
+
|
|
47
|
+
**Nghiệm thu:** Chưa có xác nhận. Ghi nguồn, phạm vi và thời điểm khi có phản hồi thực tế.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# EPIC-xxx: <Tên Epic>
|
|
2
|
+
|
|
3
|
+
> Template chung. Thay ID/slug và nội dung mẫu trước khi bàn giao. Giữ problem, outcome và scope ở tầng yêu cầu; cách triển khai thuộc plan. Mục không áp dụng ghi lý do, không tự bổ sung yêu cầu để điền mẫu.
|
|
4
|
+
|
|
5
|
+
**Trạng thái yêu cầu:** Draft
|
|
6
|
+
**Nguồn yêu cầu:** <Nguồn, người phụ trách và quyết định đã xác nhận>
|
|
7
|
+
|
|
8
|
+
## 1. Problem
|
|
9
|
+
|
|
10
|
+
<Actor gặp vấn đề gì, trong điều kiện nào, tác động và bằng chứng hiện có.>
|
|
11
|
+
|
|
12
|
+
## 2. Outcome
|
|
13
|
+
|
|
14
|
+
<Kết quả quan sát được sau thay đổi và giá trị cần đạt.>
|
|
15
|
+
|
|
16
|
+
## 3. Scope
|
|
17
|
+
|
|
18
|
+
### In scope
|
|
19
|
+
|
|
20
|
+
- <Kết quả/hành vi thuộc phạm vi>
|
|
21
|
+
|
|
22
|
+
### Out of scope
|
|
23
|
+
|
|
24
|
+
- <Kết quả/hành vi nằm ngoài phạm vi>
|
|
25
|
+
|
|
26
|
+
## 4. Constraints & Invariants
|
|
27
|
+
|
|
28
|
+
| Nguồn chuẩn / ID | Ràng buộc áp dụng | Kết quả cần bảo toàn |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| <Liên kết tương đối tới nguồn hiện có> | <Ràng buộc của dự án> | <Kết quả quan sát được> |
|
|
31
|
+
|
|
32
|
+
## 5. Success Metrics
|
|
33
|
+
|
|
34
|
+
| Chỉ số | Baseline / chưa có số liệu | Mục tiêu | Cách đo |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| <Metric> | <Evidence hoặc gap> | <Mục tiêu đã chốt> | <Phương thức đo> |
|
|
37
|
+
|
|
38
|
+
## 6. Stories
|
|
39
|
+
|
|
40
|
+
- [US-xxx-slug](./US-xxx-slug/story.md)
|
|
41
|
+
|
|
42
|
+
> Khi dùng template, chỉ liên kết Story đã tồn tại và thay đường dẫn theo slug thực tế.
|
|
43
|
+
|
|
44
|
+
## 7. Definition of Done
|
|
45
|
+
|
|
46
|
+
- [ ] AC của các Story trong phạm vi có evidence phù hợp; phần chưa đạt được ghi rõ.
|
|
47
|
+
- [ ] Constraints/invariants liên quan được đối chiếu với evidence.
|
|
48
|
+
- [ ] Contract và tài liệu bị ảnh hưởng đã được đồng bộ hoặc ghi lý do không cần đổi.
|
|
49
|
+
- [ ] Kiểm chứng cần thiết theo policy dự án đã được thực hiện và ghi nhận giới hạn.
|
|
50
|
+
- [ ] Trạng thái triển khai, kiểm chứng, deploy và nghiệm thu được ghi riêng theo thực tế.
|
|
51
|
+
|
|
52
|
+
## 8. Open Decisions
|
|
53
|
+
|
|
54
|
+
| Quyết định / giả định | Người cần xác nhận | Ảnh hưởng khi chưa chốt |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| <Điểm chưa rõ hoặc không có> | <Người phụ trách> | <Phần bị phụ thuộc> |
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# <Change Name> — Implementation Plan
|
|
2
|
+
|
|
3
|
+
> Shared template for full-flow changes or an explicitly requested plan, not an approved plan. Bounded work may retain design and acceptance checks in chat without creating this file. Save at `packages/<pkg>/plans/<plan-name>.md`; replace placeholders and explain sections that do not apply.
|
|
4
|
+
|
|
5
|
+
**Goal:** <Technical outcome serving the requirement>
|
|
6
|
+
**Package / scope:** <Responsible package and path limits; reference services are read-only>
|
|
7
|
+
**Story / Spec or request:** <Existing document links; supplied requirements/chat baseline for an explicitly requested plan when product documents do not apply>
|
|
8
|
+
**Acceptance checks:** <AC IDs or request checks with implementation/verification coverage>
|
|
9
|
+
**Status:** Pending plan approval
|
|
10
|
+
|
|
11
|
+
## 1. Approval & Permissions
|
|
12
|
+
|
|
13
|
+
| Item | Content / version / scope | Evidence and status |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| Design | <Design scope> | <Actual feedback or pending> |
|
|
16
|
+
| Plan | <Plan version> | Pending approval |
|
|
17
|
+
| Commands | <Command, working directory, and execution scope> | <Authorized or permission needed> |
|
|
18
|
+
|
|
19
|
+
> Apply the action boundaries in `kido-workflow`: distinguish edit, command, and Git/data permissions and reuse matching session authorization. Record only actual approval.
|
|
20
|
+
|
|
21
|
+
## 2. Architecture & Reuse
|
|
22
|
+
|
|
23
|
+
<Boundaries, data flow, state owner, interfaces/types, dependencies, and side effects.>
|
|
24
|
+
|
|
25
|
+
**Reuse:** <Implementations and callers inspected; abstraction to reuse or extend, or reason to add one>
|
|
26
|
+
**Constraints:** <Canonical contract, design system, invariants, and coding conventions>
|
|
27
|
+
**Dependencies:** <Required changes or confirmation that none are needed>
|
|
28
|
+
|
|
29
|
+
## 3. Tasks
|
|
30
|
+
|
|
31
|
+
### Task <N>: <Deliverable>
|
|
32
|
+
|
|
33
|
+
**Acceptance checks:** <Applicable AC IDs or supplied request checks>
|
|
34
|
+
**Files:** <Actual paths marked [NEW] or [MODIFY]>
|
|
35
|
+
**Interfaces / behavior:** <Signatures, inputs/outputs, state, errors, and boundaries>
|
|
36
|
+
**Dependencies:** <Prior tasks or required sources>
|
|
37
|
+
|
|
38
|
+
- [ ] RED: <Test case, command, and expected failure for the correct reason before production code>
|
|
39
|
+
- [ ] GREEN: <Minimum change and command showing the outcome>
|
|
40
|
+
- [ ] REFACTOR: <Only if needed; what to recheck>
|
|
41
|
+
- [ ] Match acceptance checks, approved contract delta, and evidence without rewriting upstream documents.
|
|
42
|
+
|
|
43
|
+
> Use RED/GREEN for behavior changes with a meaningful test under project policy. Verify mechanical or document changes appropriately. Record the reason, alternative check, and required approval for a TDD exception before code; setup failures are not valid RED evidence.
|
|
44
|
+
|
|
45
|
+
## 4. Verification Matrix
|
|
46
|
+
|
|
47
|
+
| AC / requirement | Case / boundary | Check or command + working directory | Expected result | Permission | Evidence / status |
|
|
48
|
+
| --- | --- | --- | --- | --- | --- |
|
|
49
|
+
| <ID> | <Case> | <Confirmed command or direct check> | <Result> | <Evidence or missing> | Not run |
|
|
50
|
+
|
|
51
|
+
## 5. SSOT Delta
|
|
52
|
+
|
|
53
|
+
Keep requirements, Specs, and canonical contracts fixed during implementation and review fixes. Record pending deltas here; do not update upstream documents after every task. After explicit code acceptance, synchronize affected sources once and verify against accepted code. Preserve their authority and approval states.
|
|
54
|
+
|
|
55
|
+
| Source | Update needed / reason no update is needed |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| Story / Spec | <Impact> |
|
|
58
|
+
| Canonical contract | <Impact> |
|
|
59
|
+
| ADR / glossary / design system | <Impact> |
|
|
60
|
+
| Current state | <Changed state, gap, debt, or roadmap> |
|
|
61
|
+
|
|
62
|
+
**Code-generation strategy:** <Not applicable, or explicitly authorized temporary build-input/artifact paths, approved delta, and command permissions. No automatic canonical-contract edits or duplicate SSOT.>
|
|
63
|
+
|
|
64
|
+
## 6. Handoff
|
|
65
|
+
|
|
66
|
+
<Diff, AC → change → evidence, observed RED/GREEN or approved exception, checks not run, and limits.>
|
|
67
|
+
|
|
68
|
+
**Implementation:** <Actual state>
|
|
69
|
+
**Verification:** <Actual state>
|
|
70
|
+
**Deployment:** <Actual state>
|
|
71
|
+
**Review / acceptance:** <Pending or actual feedback evidence>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# <Workspace Name> — Project Instructions
|
|
2
|
+
|
|
3
|
+
> Template for project instructions at the workspace root. Do not copy it verbatim as approved policy. Review existing instructions first, keep unconfirmed facts and permissions in Draft status, and recalculate relative links from the actual file location.
|
|
4
|
+
|
|
5
|
+
## 1. Project Snapshot
|
|
6
|
+
|
|
7
|
+
<Purpose, actors, components, and links to canonical context.>
|
|
8
|
+
|
|
9
|
+
## 2. Workspace Layout & Ownership
|
|
10
|
+
|
|
11
|
+
<Selected project/workspace root and supporting evidence; distinguish it from component Git roots. Resolve shared context and entrypoint paths from this root, and record any component outside authorized scope.>
|
|
12
|
+
|
|
13
|
+
| Component | Path | Ownership | Authorized read/write scope |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| <Component> | <Relative path> | <Owned / Reference / External writable> | <Exact scope; a symlink does not grant access> |
|
|
16
|
+
|
|
17
|
+
## 3. Context Routing
|
|
18
|
+
|
|
19
|
+
| Task domain | Required sources | Canonical contract / design system / invariants |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| <Domain> | <Relative links to existing sources> | <Authority and generated or legacy material to distinguish> |
|
|
22
|
+
|
|
23
|
+
## 4. Document Boundaries
|
|
24
|
+
|
|
25
|
+
`context/` holds system knowledge. `epics/` holds problems, outcomes, Stories, Acceptance Criteria (AC), and behavior Specs. `packages/<pkg>/plans/` holds files, interfaces, and implementation details. Link Stories, Specs, and plans to existing documents, using stable AC IDs.
|
|
26
|
+
|
|
27
|
+
When TypeSpec is used for contracts, default to `context/contracts/`. Record its `main.tsp` entrypoint, domain modules, and generated artifacts in the routing table. For a domain task, read that module and relevant dependencies; do not load the entire contract without a reason. A scaffold awaiting migration does not replace an existing canonical contract. Mark `.tsp` as the SSOT only after its authority is confirmed.
|
|
28
|
+
|
|
29
|
+
## 5. Workflow & Approval
|
|
30
|
+
|
|
31
|
+
<Bounded in-chat design/checks versus full Story/AC/Spec/design/plan flow; approval evidence, TDD exceptions, and applicable project policy. Honor explicit user instructions and reuse matching authorization. Questions, reviews, and documentation tasks stay in their scope.>
|
|
32
|
+
|
|
33
|
+
<Implementation uses a fixed approved baseline. Accumulate pending Spec/contract deltas in the plan/chat; synchronize affected SSOT sources once after explicit code acceptance. Record any explicitly approved temporary code-generation strategy before implementation.>
|
|
34
|
+
|
|
35
|
+
## 6. Commands & State Permissions
|
|
36
|
+
|
|
37
|
+
| Action | Command / shell / working directory, if applicable | Policy and required permission |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| <Scripts/tests/format/build> | <Command confirmed to exist> | <Not granted or exact authorization> |
|
|
40
|
+
| <Git/data/deploy/cleanup> | <Action> | <Not granted or exact authorization> |
|
|
41
|
+
|
|
42
|
+
Apply `kido-workflow` action boundaries and record this project's actual permissions: file edits, commands, and Git/data/runtime actions are distinct; reuse matching authorization and ask only for missing or materially changed scope. Never read environment files or infer execution permission from documented scripts or plan approval alone.
|
|
43
|
+
|
|
44
|
+
## 7. Verification & Handoff
|
|
45
|
+
|
|
46
|
+
<Required checks by domain, AC-to-evidence mapping, evidence location, and current state. Distinguish implementation, verification, deployment, and acceptance.>
|
|
47
|
+
|
|
48
|
+
## 8. Agent Entry Points
|
|
49
|
+
|
|
50
|
+
<Skill and rule locations, and entrypoints supported by each tool. Response conventions if required. Do not assume every agent loads the same rule format or has read these instructions.>
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KIDO
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# kido-workspace-template
|
|
2
|
+
|
|
3
|
+
Bộ skills, rules và templates của KIDO dành cho AI agent làm việc trên các project.
|
|
4
|
+
|
|
5
|
+
## Cấu trúc workspace được khởi tạo
|
|
6
|
+
|
|
7
|
+
Workspace sau khi khởi tạo có cấu trúc mục tiêu:
|
|
8
|
+
|
|
9
|
+
| Thư mục | Nội dung |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `context/` | Context dùng chung: overview, glossary, current-state và API contract TypeSpec tại `contracts/` (được điền sau khi onboarding khảo sát API) |
|
|
12
|
+
| `.agents/skills/` | Bộ KIDO skills dùng trong workspace |
|
|
13
|
+
| `.agents/rules/` | Rules và hướng dẫn agent dùng trong workspace |
|
|
14
|
+
| `epics/` | Epics, Stories, Acceptance Criteria và Specs của workspace |
|
|
15
|
+
| `packages/` | Các component/codebase FE, BE và package khác |
|
|
16
|
+
|
|
17
|
+
`context/`, `.agents/` và `epics/` thuộc workspace root. Mỗi package trong `packages/` có thể là repo riêng. Khi gọi onboarding từ workspace cha, agent hỏi một lần cho các component FE/BE ngoài `packages/`: move vào `packages/<tên-component>/` hay giữ source tại chỗ và tạo symlink từ package tương ứng. Quy tắc này cũng áp dụng khi gọi từ repo con, sau khi xác định workspace root. Không tự move hoặc tạo symlink trước khi người dùng chọn; dùng lại lựa chọn đã có khi onboard lại.
|
|
18
|
+
|
|
19
|
+
## CLI init và upgrade
|
|
20
|
+
|
|
21
|
+
CLI yêu cầu Node.js 22 trở lên, dùng tài nguyên đi kèm package đang chạy và không truy cập Git công ty. CLI không tự chạy onboarding, build, Git hoặc di chuyển FE/BE.
|
|
22
|
+
|
|
23
|
+
Sau khi package được phát hành lên npm, chạy tại thư mục workspace cần khởi tạo:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npx kido-workspace@latest init --dry-run
|
|
27
|
+
npx kido-workspace@latest init
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`init` chép skills, rules và templates vào `.agents/`, tạo `context/contracts/`, `epics/`, `packages/` nếu chưa có, cùng metadata `.agents/kido-install.json`. `.agents/` là thư mục thật duy nhất chứa tài nguyên agent; không tạo `agents/`. `.claude/skills/<skill>` trỏ tới từng skill dùng chung và `.claude/templates` trỏ tới `.agents/templates/`. Các symlink dùng đường dẫn tương đối trên macOS/Linux; Windows dùng directory junction.
|
|
31
|
+
|
|
32
|
+
`AGENTS.md` và `CLAUDE.md` chỉ được tạo bootstrap khi chưa tồn tại. Các entrypoint, context và component đã có được giữ nguyên. Nếu resource directory, metadata hoặc adapter trùng với nội dung đang có, CLI dừng trước khi ghi. Không tự hợp nhất hay di chuyển một cây `.agents/` đã có; workspace đã khởi tạo bằng CLI này dùng `upgrade`.
|
|
33
|
+
|
|
34
|
+
Nâng tài nguyên lên bản package mới nhất:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
npx kido-workspace@latest upgrade --dry-run
|
|
38
|
+
npx kido-workspace@latest upgrade
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`upgrade` chỉ quản lý các file tài nguyên được ghi trong metadata và tài nguyên mới từ package. Checksum lưu trong metadata giúp đối chiếu bản đã cài, bản local và bản đi kèm package:
|
|
42
|
+
|
|
43
|
+
- File chưa chỉnh local được cập nhật; file mới không trùng được thêm vào.
|
|
44
|
+
- File chỉ đổi local, còn upstream không đổi, được giữ nguyên.
|
|
45
|
+
- Nếu cả local và upstream thay đổi khác nhau, file local được giữ lại và báo conflict. Các file không có xung đột vẫn được cập nhật; CLI trả exit code `2` và lưu danh sách conflict trong metadata.
|
|
46
|
+
- File bị upstream loại bỏ chỉ được xóa khi chưa chỉnh local. File riêng của project, context, entrypoint và source ứng dụng không thuộc phạm vi upgrade.
|
|
47
|
+
|
|
48
|
+
Đối chiếu file conflict với bản trong `.agents/` của package đã tải và hợp nhất thủ công. Nếu file local đã giống upstream, chạy lại `upgrade` để ghi nhận. Nếu muốn giữ nội dung khác upstream sau khi review, chỉ định từng file:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npx kido-workspace@latest upgrade --keep-local .agents/skills/kido-workflow/SKILL.md
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`--keep-local` giữ nguyên file local và ghi nhận checksum upstream làm baseline mới; lần sau upstream đổi vẫn phát hiện xung đột. Có thể lặp tùy chọn cho nhiều file hoặc kết hợp `--dry-run`. Với file đã bị upstream loại bỏ, tùy chọn này giữ file như tài nguyên riêng của project. `templateVersion` ghi version package đã đối chiếu; trường `conflicts` cho biết upgrade còn phần chưa hoàn tất.
|
|
55
|
+
|
|
56
|
+
`--dry-run` thực hiện cùng kiểm tra nhưng không ghi file. Để chọn version cụ thể, thay `@latest` bằng version đó. Workspace đã init bằng CLI cũ với `.agents → agents` và metadata checksum hợp lệ được chuyển layout khi chạy `upgrade`: thư mục thật `agents/` đổi thành `.agents/`, cập nhật adapter Claude, đường dẫn metadata và các tham chiếu tài nguyên ở root trong `AGENTS.md`/`CLAUDE.md` nếu là file thường, giữ nguyên các policy khác. `--dry-run` không thực hiện việc chuyển này. Installation metadata từ shell script cũ chưa có checksum không được tự tiếp nhận; cần đối chiếu layout và tùy chỉnh trước khi chuyển sang CLI mới.
|
|
57
|
+
|
|
58
|
+
Trong source repo, chạy `node bin/kido-workspace.cjs --help` để xem cú pháp. Các ví dụ npm ở trên chỉ dùng được sau khi package được publish.
|
|
59
|
+
|
|
60
|
+
## Gọi onboarding
|
|
61
|
+
|
|
62
|
+
Khi tài nguyên KIDO đã có trong workspace, mở thư mục gốc của toàn project trong agent và gửi:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
Onboard project này.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Agent nhận diện workspace và các component. Với FE/BE ngoài `packages/`, agent hỏi một lần: move vào `packages/<tên-component>/` hay giữ source tại chỗ và tạo symlink từ package tương ứng.
|
|
69
|
+
|
|
70
|
+
Câu hỏi thực tế phải nêu source và destination của từng component. Sau khi bạn chọn, agent thực hiện placement đã chọn, khảo sát API của BE để viết `context/contracts/`, rồi khảo sát FE/BE và tài liệu dự án để viết glossary, current-state, overview, architecture và chỉ dẫn agent. Các repo đã nằm trong `packages/` hoặc đã có lựa chọn được ghi nhận không cần hỏi lại.
|
|
71
|
+
|
|
72
|
+
Nếu công cụ chưa nhận diện skill, chỉ đường dẫn trực tiếp:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
Đọc .agents/skills/kido-onboarding/SKILL.md và thực hiện onboarding
|
|
76
|
+
repository này theo hướng dẫn đó.
|
|
77
|
+
|
|
78
|
+
Tạo hoặc bổ sung context, chỉ dẫn agent và contract TypeSpec từ API/schema thực tế của project; đối chiếu với contract hiện có nếu có.
|
|
79
|
+
Giữ policy và tài liệu hiện có; ghi riêng những điểm cần xác nhận.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Nếu chỉ cần khảo sát trước, thêm: "Chỉ đọc và báo đề xuất, chưa sửa file." Nếu skill đã được công cụ nhận diện, có thể yêu cầu "Dùng kido-onboarding để onboard repository này vào KIDO."
|
|
83
|
+
|
|
84
|
+
Với project gồm nhiều repo con, mở agent tại thư mục cha của toàn project. Không cần nhắc lại root/component nếu metadata và cấu trúc đã rõ. Ví dụ layout trước khi chọn placement:
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
project-root/
|
|
88
|
+
├── .agents/ ← Skills và rules dùng chung
|
|
89
|
+
├── context/ ← Context chung, gồm contracts/
|
|
90
|
+
├── epics/ ← Epics, Stories và Specs
|
|
91
|
+
├── AGENTS.md hoặc CLAUDE.md ← Entrypoint theo agent đang dùng
|
|
92
|
+
├── packages/ ← Đích move hoặc symlink sau khi chọn
|
|
93
|
+
├── web-app/ ← Repo frontend đang có
|
|
94
|
+
└── api-service/ ← Repo backend đang có
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
Onboard project này.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Git root của `api-service/` không phải root của toàn project; thư mục cha không cần có `.git`. Nếu agent đang mở trong repo con, nó phải xác định root từ yêu cầu và cấu trúc trong phạm vi được phép trước khi ghi file; hỏi lại khi chưa rõ. Chỉ onboarding riêng trong repo con khi yêu cầu hoặc ranh giới project đã xác định phạm vi đó. Context/chỉ dẫn sẵn có trong repo con được giữ lại và ghi nhận để đối chiếu, không tự xóa hoặc di chuyển.
|
|
102
|
+
|
|
103
|
+
Agent tạo hoặc bổ sung overview, glossary, current-state, architecture, báo cáo khảo sát và entrypoint. Onboarding khảo sát API/schema trong source cùng contract hiện có, rồi viết TypeSpec model/operation cho phần có evidence. Mặc định TypeSpec nằm tại `context/contracts/`: `main.tsp` chỉ import các module theo miền; mỗi miền có thư mục và các file model/operation riêng. Repo không cần có OpenAPI/Proto trước. Nếu code và tài liệu API mâu thuẫn, agent ghi điểm lệch và giữ contract mới ở trạng thái Draft cho review; không tự tuyên bố SSOT đã được phê duyệt. Nếu chưa xác minh được API/schema, scaffold được ghi rõ là chưa có contract nghiệp vụ. Scaffold KIDO cũ ở root `contracts/` cần được chuyển vào `context/contracts/` khi onboarding chạy lại, không giữ hai nguồn chuẩn. Policy riêng của project chọn chuẩn khác hoặc cấm tạo `.tsp` được ưu tiên. Không tự sinh lịch sử Epic/Story, implementation plan hoặc approval.
|
|
104
|
+
|
|
105
|
+
Onboarding là công việc của agent khi tài nguyên đã có trong workspace; phạm vi viết TypeSpec ở trên không cấp quyền chạy scripts/build, sửa source ứng dụng, dependencies, deploy hay commit/push. Policy của project đích vẫn được áp dụng.
|