@phuthuycoding/kanban-flow 0.3.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/LICENSE +21 -0
- package/README.md +173 -0
- package/dist/cli/args.js +219 -0
- package/dist/cli/commands/approve.js +44 -0
- package/dist/cli/commands/archive.js +245 -0
- package/dist/cli/commands/artifacts.js +100 -0
- package/dist/cli/commands/autoconfig.js +180 -0
- package/dist/cli/commands/cancel.js +129 -0
- package/dist/cli/commands/contexts.js +101 -0
- package/dist/cli/commands/doctor.js +35 -0
- package/dist/cli/commands/harness.js +60 -0
- package/dist/cli/commands/helpers.js +22 -0
- package/dist/cli/commands/init.js +119 -0
- package/dist/cli/commands/inspect.js +141 -0
- package/dist/cli/commands/new.js +80 -0
- package/dist/cli/commands/rules.js +69 -0
- package/dist/cli/commands/run.js +156 -0
- package/dist/cli/commands/stage.js +186 -0
- package/dist/cli/result.js +1 -0
- package/dist/dashboard/dashboard-view.js +238 -0
- package/dist/dashboard/dashboard.js +206 -0
- package/dist/harness/chain.js +41 -0
- package/dist/harness/config.js +168 -0
- package/dist/harness/prompt.js +105 -0
- package/dist/harness/run.js +245 -0
- package/dist/harness/session.js +78 -0
- package/dist/harness/supervise.js +65 -0
- package/dist/index.js +123 -0
- package/dist/integrations/agents.js +67 -0
- package/dist/integrations/hooks.js +59 -0
- package/dist/integrations/install.js +193 -0
- package/dist/project/bootstrap.js +358 -0
- package/dist/project/config.js +111 -0
- package/dist/project/contexts.js +98 -0
- package/dist/project/doctor.js +163 -0
- package/dist/shared/frontmatter.js +54 -0
- package/dist/shared/paths.js +78 -0
- package/dist/shared/time.js +5 -0
- package/dist/workflow/direction.js +56 -0
- package/dist/workflow/features.js +198 -0
- package/dist/workflow/findings.js +3 -0
- package/dist/workflow/schema.js +148 -0
- package/dist/workflow/secrets.js +52 -0
- package/dist/workflow/status.js +188 -0
- package/dist/workflow/validate-approval.js +25 -0
- package/dist/workflow/validate-artifacts.js +89 -0
- package/dist/workflow/validate-cancel.js +14 -0
- package/dist/workflow/validate-reports.js +121 -0
- package/dist/workflow/validate-traceability.js +91 -0
- package/dist/workflow/validate.js +73 -0
- package/docs/workflow/README.md +67 -0
- package/docs/workflow/artifacts.md +60 -0
- package/docs/workflow/cli-reference.md +78 -0
- package/docs/workflow/dashboard.md +35 -0
- package/docs/workflow/gates.md +103 -0
- package/docs/workflow/harness.md +144 -0
- package/docs/workflow/lifecycle.md +107 -0
- package/docs/workflow/skills.md +52 -0
- package/docs/workflow/source-layout.md +47 -0
- package/docs/workflow/state-machine.md +83 -0
- package/kanban-flow/review/rules/README.md +30 -0
- package/kanban-flow/review/rules/general.md +41 -0
- package/kanban-flow/review/rules/performance.md +29 -0
- package/kanban-flow/review/rules/security.md +32 -0
- package/kanban-flow/review/stacks/go.md +33 -0
- package/kanban-flow/review/stacks/java.md +38 -0
- package/kanban-flow/review/stacks/node.md +28 -0
- package/kanban-flow/review/stacks/php.md +30 -0
- package/kanban-flow/review/stacks/python.md +34 -0
- package/kanban-flow/review/stacks/ruby.md +32 -0
- package/kanban-flow/review/stacks/rust.md +33 -0
- package/kanban-flow/templates/phase-1-bug-report.md +76 -0
- package/kanban-flow/templates/phase-1-spec-requirement.md +67 -0
- package/kanban-flow/templates/phase-2-implementation-plan.md +85 -0
- package/kanban-flow/templates/phase-2-test-case.md +68 -0
- package/kanban-flow/templates/phase-2-use-case-diagram.md +18 -0
- package/kanban-flow/templates/phase-2-use-case-specification.md +33 -0
- package/kanban-flow/templates/phase-2-use-case.md +60 -0
- package/kanban-flow/templates/phase-4-testing-result.md +63 -0
- package/kanban-flow/templates/phase-5-review-report.md +68 -0
- package/kanban-flow/templates/phase-6-feature-report.md +78 -0
- package/package.json +63 -0
- package/skills/kanban-archive/SKILL.md +78 -0
- package/skills/kanban-brainstorm/SKILL.md +310 -0
- package/skills/kanban-bug/SKILL.md +55 -0
- package/skills/kanban-flow/SKILL.md +136 -0
- package/skills/kanban-implement/SKILL.md +72 -0
- package/skills/kanban-plan/SKILL.md +102 -0
- package/skills/kanban-review/SKILL.md +90 -0
- package/skills/kanban-test/SKILL.md +76 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
feature: "{feature_name}"
|
|
3
|
+
context: "{context}"
|
|
4
|
+
created: "{timestamp}"
|
|
5
|
+
execution: "{execution_id}"
|
|
6
|
+
status: REJECT
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Review Report
|
|
10
|
+
|
|
11
|
+
## Feature
|
|
12
|
+
{feature_name}
|
|
13
|
+
|
|
14
|
+
## Review Status
|
|
15
|
+
- {review_status}
|
|
16
|
+
|
|
17
|
+
## Review Overview
|
|
18
|
+
|
|
19
|
+
| Field | Result |
|
|
20
|
+
|---|---|
|
|
21
|
+
| Reviewed scope / diff | {reviewed_scope} |
|
|
22
|
+
| Execution | {execution_id} |
|
|
23
|
+
| Open blocking findings | {blocking_findings} |
|
|
24
|
+
| Overall decision | {review_status} |
|
|
25
|
+
|
|
26
|
+
## Requirement Compliance
|
|
27
|
+
{requirement_compliance}
|
|
28
|
+
|
|
29
|
+
## Scope Compliance
|
|
30
|
+
{scope_compliance}
|
|
31
|
+
|
|
32
|
+
## Code Convention
|
|
33
|
+
{code_convention}
|
|
34
|
+
|
|
35
|
+
## Architecture
|
|
36
|
+
{architecture}
|
|
37
|
+
|
|
38
|
+
## Logic
|
|
39
|
+
{logic}
|
|
40
|
+
|
|
41
|
+
## Tests
|
|
42
|
+
{tests}
|
|
43
|
+
|
|
44
|
+
## Test Coverage
|
|
45
|
+
{test_coverage}
|
|
46
|
+
|
|
47
|
+
## Linter / Formatter / Prettier
|
|
48
|
+
{linter}
|
|
49
|
+
|
|
50
|
+
## Type Check / Static Analysis
|
|
51
|
+
{type_check}
|
|
52
|
+
|
|
53
|
+
## Findings
|
|
54
|
+
|
|
55
|
+
| ID | Severity | Area / location | Finding | Evidence | Required action | Status |
|
|
56
|
+
|---|---|---|---|---|---|---|
|
|
57
|
+
| FINDING-001 | {severity} | {area} | {description} | {evidence} | {required_action} | {finding_status} |
|
|
58
|
+
|
|
59
|
+
If no findings remain, replace the sample row with `None` and record the review evidence. PASS requires all blocking findings to be resolved.
|
|
60
|
+
|
|
61
|
+
## Documentation Impact
|
|
62
|
+
|
|
63
|
+
| Update needed? | Related feature / docs | Reason / update |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| {docs_update_needed} | {related_docs} | {docs_update_reason} |
|
|
66
|
+
|
|
67
|
+
## Final Decision
|
|
68
|
+
{final_decision}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
feature: "{feature_name}"
|
|
3
|
+
context: "{context}"
|
|
4
|
+
created: "{timestamp}"
|
|
5
|
+
status: DONE
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Feature Report
|
|
9
|
+
|
|
10
|
+
## Feature
|
|
11
|
+
{feature_name}
|
|
12
|
+
|
|
13
|
+
## Completion Overview
|
|
14
|
+
|
|
15
|
+
| Field | Result |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Context | {context} |
|
|
18
|
+
| Delivery summary | {delivery_summary} |
|
|
19
|
+
| Reviewed execution | {execution_id} |
|
|
20
|
+
| Testing / review status | PASS / PASS |
|
|
21
|
+
|
|
22
|
+
## Requirement Summary
|
|
23
|
+
{requirement_summary}
|
|
24
|
+
|
|
25
|
+
## Scope
|
|
26
|
+
{scope}
|
|
27
|
+
|
|
28
|
+
## Implementation Summary
|
|
29
|
+
{implementation_summary}
|
|
30
|
+
|
|
31
|
+
## Changed Areas
|
|
32
|
+
|
|
33
|
+
| Area / files | Change | Requirement / use case |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| {changed_area} | {change_summary} | {requirement_reference} |
|
|
36
|
+
|
|
37
|
+
## Use Cases
|
|
38
|
+
|
|
39
|
+
| Use case | Delivered behavior | Evidence |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| UC-001 {use_case_name} | {delivered_behavior} | {use_case_evidence} |
|
|
42
|
+
|
|
43
|
+
## Test Summary
|
|
44
|
+
| Metric | Result |
|
|
45
|
+
|---|---:|
|
|
46
|
+
| Test cases | {total_cases} |
|
|
47
|
+
| Passed | {passed} |
|
|
48
|
+
| Failed | {failed} |
|
|
49
|
+
| Coverage | {overall_coverage}% |
|
|
50
|
+
|
|
51
|
+
## Review Summary
|
|
52
|
+
{review_summary}
|
|
53
|
+
|
|
54
|
+
## Documentation Updated
|
|
55
|
+
|
|
56
|
+
| Document | Update / purpose | Delivery |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `docs/requirement/{context}/{feature_name}.md` | Confirmed requirement | CLI copies on archive |
|
|
59
|
+
| `docs/use-cases/{context}/{feature_name}/README.md` | UC index and coverage | CLI copies on archive |
|
|
60
|
+
| `docs/use-cases/{context}/{feature_name}/UC-###.md` | Individual UC narratives | CLI copies on archive |
|
|
61
|
+
| `docs/use-cases/{context}/{feature_name}/diagram.md` | Actor/use-case diagram | CLI copies on archive |
|
|
62
|
+
| `docs/testplan/{context}/{feature_name}.md` | Test contract | CLI copies on archive |
|
|
63
|
+
| `docs/testplan/{context}/{feature_name}-result.md` | Current execution evidence | CLI copies on archive |
|
|
64
|
+
| {other_document} | {documentation_updated} | {documentation_status} |
|
|
65
|
+
|
|
66
|
+
Replace the UC wildcard row with the actual files. Record `N/A` with a reason if no other documents need updates.
|
|
67
|
+
|
|
68
|
+
## Known Limitations
|
|
69
|
+
- {known_limitation}
|
|
70
|
+
|
|
71
|
+
## Accepted Follow-ups
|
|
72
|
+
|
|
73
|
+
| Item | Reason deferred | Backlog reference |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| {follow_up} | {deferred_reason} | {backlog_reference} |
|
|
76
|
+
|
|
77
|
+
## Final Status
|
|
78
|
+
DONE
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phuthuycoding/kanban-flow",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Kanban workflow CLI — artifact-gated feature pipeline (brainstorm → plan → implement → test → review → archive)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Quyen (phuthuycoding)",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/phuthuycoding/kanban-flow.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/phuthuycoding/kanban-flow#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/phuthuycoding/kanban-flow/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"kanban",
|
|
18
|
+
"workflow",
|
|
19
|
+
"cli",
|
|
20
|
+
"ai-agents",
|
|
21
|
+
"spec-driven",
|
|
22
|
+
"traceability",
|
|
23
|
+
"agentic",
|
|
24
|
+
"code-review",
|
|
25
|
+
"requirements",
|
|
26
|
+
"test-plan"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"bin": {
|
|
32
|
+
"kf": "dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
".": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"skills",
|
|
40
|
+
"docs/workflow",
|
|
41
|
+
"kanban-flow/templates",
|
|
42
|
+
"kanban-flow/review"
|
|
43
|
+
],
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=20"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc -p tsconfig.build.json",
|
|
49
|
+
"postbuild": "chmod +x dist/index.js",
|
|
50
|
+
"watch": "tsc -p tsconfig.build.json --watch",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"test:watch": "vitest",
|
|
53
|
+
"lint": "oxlint src",
|
|
54
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
55
|
+
"prepublishOnly": "npm run build"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "^22.10.0",
|
|
59
|
+
"oxlint": "^1.81.0",
|
|
60
|
+
"typescript": "^5.7.0",
|
|
61
|
+
"vitest": "^2.1.0"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kanban-archive
|
|
3
|
+
description: 'Close a PASS-reviewed feature or bug with kf archive. Features require a completion report and canonical docs; bugs update related docs only when needed. Use at review with current PASS reports or when completing closure in dones.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kanban Phase 6 — Artifact (Autonomous)
|
|
7
|
+
|
|
8
|
+
Argument: `<feature_name>`.
|
|
9
|
+
|
|
10
|
+
Close the work item with traceable results and the appropriate documentation.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. Prepare closure artifacts
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
kf status --change {feature_name}
|
|
18
|
+
kf status --change {feature_name} --json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Require current PASS testing and review reports. Read `kind` before choosing closure work:
|
|
22
|
+
|
|
23
|
+
- Feature: use `kf instruct feature-report --change {feature_name}` and write `phase-6-feature-report.md` in the review folder. Include actual changes, test/review evidence, documentation manifest, limitations and accepted follow-ups.
|
|
24
|
+
- Bug: no feature report or feature planning artifacts are required. Read the bug report and review result; confirm the verified fix, regression evidence and docs impact.
|
|
25
|
+
|
|
26
|
+
If already in dones, complete only missing closure work and validate; never reimplement.
|
|
27
|
+
|
|
28
|
+
## 2. Sync docs
|
|
29
|
+
|
|
30
|
+
For a feature, let `kf archive` copy requirement, UC index/files/diagram and test plan/current result into canonical docs. The requirement mirror under `docs/requirement/` was already written in Phase 1 — `kf archive` refreshes it and stamps `status: archived`. Do not manually copy the UC index/files, diagram or test plan before archive, and do not change approved source artifacts during closure. Update other affected docs from the plan's documentation impact as needed.
|
|
31
|
+
|
|
32
|
+
For a bug, update existing related feature docs only when the fix changes documented behavior or reveals inaccurate documentation. Use the feature/context named in the bug report; do not overwrite feature docs with bug-report content. Record bug ID, fix summary and regression reference in the project's changelog or change-history section (e.g. CHANGELOG.md) when one exists. If behavior is already documented correctly, leave docs as-is and record “No documentation update required” with the reason in the review report. Bug archive does not automatically create canonical feature docs.
|
|
33
|
+
|
|
34
|
+
## 3. Archive and validate
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
kf archive {feature_name}
|
|
38
|
+
kf validate --change {feature_name}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`kf archive` requires current PASS reports, runs the dones hook, moves review → dones and marks metadata archived. Features additionally require the feature report and receive canonical copies; bugs do not. `kf stage ... dones` uses the same archive path. Validate after archive and check reported canonical destinations for a feature. Do not report completion if validation fails.
|
|
42
|
+
|
|
43
|
+
When refreshing an item already in dones, canonical docs may include later bug fixes. If the CLI reports changed canonical docs, preserve them with `--skip-specs`; do not use `--force` to restore an older snapshot without explicit user direction.
|
|
44
|
+
|
|
45
|
+
## 4. Git handoff
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git status
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Commit when the user requested it or project instructions explicitly require it. Use conventional commits: `feat({context}): ...` for features and `fix({context}): ...` for bugs. Include only this work item's changes, respect ignored .works directories and preserve unrelated working-tree changes. Otherwise report that changes are uncommitted.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Done
|
|
56
|
+
|
|
57
|
+
Pipeline complete. Deliver the final report:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
## Pipeline Complete: {context}/{feature_name}
|
|
61
|
+
1. ✓ Confirm — requirement or bug triage
|
|
62
|
+
2. ✓ Plan — approved feature contract or lightweight bug contract
|
|
63
|
+
3. ✓ Implement — {M}/{M} tasks
|
|
64
|
+
4. ✓ Test — {N}/{N} passed
|
|
65
|
+
5. ✓ Review — PASS
|
|
66
|
+
6. ✓ Archive — kf archive, docs sync/update status
|
|
67
|
+
|
|
68
|
+
Artifacts: .works/dones/{feature_name}_{timestamp}/
|
|
69
|
+
Feature canonical docs:
|
|
70
|
+
- docs/requirement/{context}/{feature_name}.md
|
|
71
|
+
- docs/use-cases/{context}/{feature_name}/README.md
|
|
72
|
+
- docs/use-cases/{context}/{feature_name}/UC-###.md (one file per use case)
|
|
73
|
+
- docs/use-cases/{context}/{feature_name}/diagram.md
|
|
74
|
+
- docs/testplan/{context}/{feature_name}.md
|
|
75
|
+
- docs/testplan/{context}/{feature_name}-result.md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For bugs, list only related docs actually updated, or state why none were needed. Report the commit SHA only if a commit was made.
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kanban-brainstorm
|
|
3
|
+
description: 'Kanban Phase 1 — brainstorm the feature requirement with the user, create the feature via `kf new`, and author phase-1-spec-requirement.md with FR-### anchors. Use when a kanban feature is at the brainstorm stage, or right after "kanban {context} {feature}" starts a brand-new feature.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kanban Phase 1 — Brainstorm (Human + Agent)
|
|
7
|
+
|
|
8
|
+
Arguments: `<context> <feature_name>`.
|
|
9
|
+
|
|
10
|
+
The user's idea is at its coarsest here. Your job is to convert a rough idea into a **precise, testable requirement** with `FR-###` anchors — everything downstream (UC, TC, traceability) hangs off them.
|
|
11
|
+
|
|
12
|
+
Brainstorming is **divergence then convergence**: first open the problem up from every useful angle (ideas, users, edge cases, alternatives), then shut it down into a bounded, agreed requirement. Do not rush. The quality of Phase 1 decides how many questions the rest of the pipeline has to re-ask.
|
|
13
|
+
|
|
14
|
+
**Run via orchestrator:** normally invoked by `kanban-flow`. Call this skill directly when a feature is (or should be) at the `brainstorm` stage.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 1. Understand the challenge
|
|
19
|
+
|
|
20
|
+
Orientation before ideation. Cheap questions here prevent expensive ones later.
|
|
21
|
+
|
|
22
|
+
1. **Read the repository.** Structure, stack, tooling, data model, conventions. Reading code beats asking — never make the user explain what the code already answers.
|
|
23
|
+
2. **Read one similar existing feature** (if any) for house patterns.
|
|
24
|
+
3. **Restate the challenge.** In one or two sentences, play the user's idea back: *"You want X in order to achieve Y, in the context of Z — is that right?"*. Fix misunderstandings before generating ideas against the wrong target.
|
|
25
|
+
4. **If no `.works/` → `kf init --defaults`** (full bootstrap without prompts: config, seeded `.kf` overrides, `.gitignore`).
|
|
26
|
+
|
|
27
|
+
Rules of engagement:
|
|
28
|
+
- **Material ambiguity** (missing scope, unclear behavior, conflicting acceptance criteria) → ask **up to 3 focused questions**, then proceed. Each question names the decision it feeds.
|
|
29
|
+
- **Minor details** → make a reasonable assumption and record it in the spec under *Assumptions*.
|
|
30
|
+
- The user is the *brief*, not the implementer. Do not trouble them with mechanics.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Diverge — open the problem (framework phase)
|
|
35
|
+
|
|
36
|
+
A `kanban` launch can arrive with the idea fully formed or as a vague half-thought. **If the requirement is not already crystal clear, run a brainstorming framework** to widen the view before committing to a shape.
|
|
37
|
+
|
|
38
|
+
Pick the framework that fits the situation. Ask yourself (or the user, if genuinely uncertain) which angle is weak:
|
|
39
|
+
|
|
40
|
+
| Angle you need | Framework |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Challenge the premise / rebuild from fundamentals | **First Principles** |
|
|
43
|
+
| Improve / stretch an existing product or flow | **SCAMPER** |
|
|
44
|
+
| User-centric problem shaping | **Design Thinking** |
|
|
45
|
+
| New product / new market / launch narrative | **Working Backwards** |
|
|
46
|
+
| Diagnose *why* something is broken | **5 Whys** |
|
|
47
|
+
| Break a creative block / surface many options fast | **Rapid Fire** |
|
|
48
|
+
|
|
49
|
+
When ambiguity warrants divergence, run one suitable framework and record the outcome in the spec. For an already precise requirement, proceed to authoring and confirmation.
|
|
50
|
+
|
|
51
|
+
### Framework 1: First Principles Thinking
|
|
52
|
+
|
|
53
|
+
1. **Identify the problem** — what are we actually trying to solve?
|
|
54
|
+
2. **Break it down** — the fundamental truths/components that cannot be argued away.
|
|
55
|
+
3. **Question assumptions** — for every "we need X", ask *do we really? what if we...*.
|
|
56
|
+
4. **Rebuild** — if we started fresh with the truths as the only constraint, what would we build?
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
PROBLEM: [challenge]
|
|
60
|
+
|
|
61
|
+
CURRENT APPROACH:
|
|
62
|
+
- How it's typically done: ...
|
|
63
|
+
- Assumptions baked in: ...
|
|
64
|
+
|
|
65
|
+
FUNDAMENTAL TRUTHS:
|
|
66
|
+
1. [core requirement that cannot change]
|
|
67
|
+
2. [physical/logical constraint]
|
|
68
|
+
3. [user need at the deepest level]
|
|
69
|
+
|
|
70
|
+
QUESTIONED ASSUMPTIONS:
|
|
71
|
+
- "We need X" -> Do we really? What if...?
|
|
72
|
+
- "It must be Y" -> Why? Alternative...?
|
|
73
|
+
|
|
74
|
+
REBUILT SOLUTION:
|
|
75
|
+
- [the shape that survives]
|
|
76
|
+
|
|
77
|
+
WHAT CHANGES IN THE SPEC:
|
|
78
|
+
- Scope in / out decisions this surfed (only if it genuinely informs the requirement)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Framework 2: SCAMPER
|
|
82
|
+
|
|
83
|
+
Apply each lens to the feature. Generate at least one idea per letter.
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
CHALLENGE: [feature/flow being designed]
|
|
87
|
+
|
|
88
|
+
[S] Substitute — other tech/approach/component?
|
|
89
|
+
[C] Combine — which features/systems can merge?
|
|
90
|
+
[A] Adapt — what's similar elsewhere, what can we copy across domains?
|
|
91
|
+
[M] Modify — bigger/smaller/faster/slower? exaggerate what?
|
|
92
|
+
[P] Put to other uses — who else could use this, for what?
|
|
93
|
+
[E] Eliminate — what can be removed without killing the value?
|
|
94
|
+
[R] Reverse — opposite ordering, roles, or flow?
|
|
95
|
+
|
|
96
|
+
TOP 3 IDEAS:
|
|
97
|
+
1. ... (why)
|
|
98
|
+
2. ... (why)
|
|
99
|
+
3. ... (why)
|
|
100
|
+
|
|
101
|
+
WHICH ONES LAND IN THE SPEC:
|
|
102
|
+
- [idea] -> FR/orientation; [idea] -> explicitly out of scope (recorded)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Framework 3: Design Thinking
|
|
106
|
+
|
|
107
|
+
1. **Empathize** — who is the user, what is their current journey, what do they *really* need (not just what they say)?
|
|
108
|
+
2. **Define** — problem statement in the form: *"[User] needs [need] because [insight]"*.
|
|
109
|
+
3. **Ideate** — 10+ ideas, no judgment, quantity first, build on each other.
|
|
110
|
+
4. **Prototype** — the cheapest thing that validates the direction.
|
|
111
|
+
5. **Test** — what feedback do we need, what metric proves it works?
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
EMPATHIZE:
|
|
115
|
+
- User: [who]
|
|
116
|
+
- Pain points: [...]
|
|
117
|
+
- Current journey: [steps]
|
|
118
|
+
|
|
119
|
+
DEFINE:
|
|
120
|
+
- Problem statement: [user] needs [need] because [insight]
|
|
121
|
+
- How Might We: [question]
|
|
122
|
+
|
|
123
|
+
IDEATE (10+):
|
|
124
|
+
1..10+
|
|
125
|
+
|
|
126
|
+
PROTOTYPE:
|
|
127
|
+
- MVP concept: ...
|
|
128
|
+
- Cheapest validation: ...
|
|
129
|
+
|
|
130
|
+
TEST:
|
|
131
|
+
- Success metric: ...
|
|
132
|
+
- Feedback needed: ...
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Framework 4: Working Backwards (Amazon-style)
|
|
136
|
+
|
|
137
|
+
Start from the end experience and work back to what we must build.
|
|
138
|
+
|
|
139
|
+
1. **Press release** — announce the finished feature.
|
|
140
|
+
2. **FAQ** — answer the customer + internal questions.
|
|
141
|
+
3. **Customer experience** — the detailed user journey.
|
|
142
|
+
4. **Work back to requirements** — what must exist for that journey.
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
PRESS RELEASE:
|
|
146
|
+
- Headline: [name] helps [user] [benefit]
|
|
147
|
+
- Problem: [2-3 sentences]
|
|
148
|
+
- Solution: [2-3 sentences]
|
|
149
|
+
- How it works: [plain explanation]
|
|
150
|
+
|
|
151
|
+
FAQ:
|
|
152
|
+
- Q(A): what is it / how different / how to start / cost
|
|
153
|
+
|
|
154
|
+
REQUIREMENTS THAT MUST EXIST:
|
|
155
|
+
1. ... 2. ... 3. ...
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Framework 5: 5 Whys
|
|
159
|
+
|
|
160
|
+
Use when the feature exists to fix a *problem* whose true cause is unclear. Iterate "why" until the root cause surfaces (5 is the rule of thumb; stop early if a real cause appears).
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
PROBLEM: [initial symptom]
|
|
164
|
+
|
|
165
|
+
Why #1 -> Because: ...
|
|
166
|
+
Why #2 -> Because: ...
|
|
167
|
+
Why #3 -> Because: ...
|
|
168
|
+
Why #4 -> Because: ...
|
|
169
|
+
Why #5 -> Because: [root cause]
|
|
170
|
+
|
|
171
|
+
ROOT CAUSE: [summary]
|
|
172
|
+
|
|
173
|
+
WHAT THE FEATURE MUST ACTUALLY DO: [solution targeting the root cause, not the symptom]
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Framework 6: Rapid Fire
|
|
177
|
+
|
|
178
|
+
Generate 15+ options in one pass, no filtering during generation.
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
CHALLENGE: [feature]
|
|
182
|
+
|
|
183
|
+
IDEAS (15+):
|
|
184
|
+
1..15+
|
|
185
|
+
|
|
186
|
+
CATEGORIES:
|
|
187
|
+
- Quick wins / Big bets / Experiments / Parking lot
|
|
188
|
+
|
|
189
|
+
TOP 3 TO PURSUE:
|
|
190
|
+
1. ... (why)
|
|
191
|
+
2. ... (why)
|
|
192
|
+
3. ... (why)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Synthesis (always, whichever framework)
|
|
196
|
+
|
|
197
|
+
End divergence by answering three questions in the spec's language:
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
IDEAS SURFACED: [what changed the shape]
|
|
201
|
+
SCOPE DECISION: [what's in, what's explicitly out — and why]
|
|
202
|
+
REMAINING BLIND SPOTS: [what we could not evaluate cheaply at Phase 1]
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 3. Create the feature
|
|
208
|
+
|
|
209
|
+
Check `kf list --json` first. If the feature already exists, resume its requirement; do not run `kf new` again. Feature and context names use letters, digits, hyphens or underscores and start with a letter or digit.
|
|
210
|
+
|
|
211
|
+
**Pick the context before you run `kf new`.** A project may declare the contexts it uses in `.kf/config.json`, and `kf new` refuses anything outside that list:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
kf contexts --json # declared: [...], restricted: true|false
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
- `restricted: true` — use one of the declared names, spelled exactly. `Auth` is refused next to `auth`, because accepting both is how a second docs tree appears.
|
|
218
|
+
- `restricted: false` — nothing is declared; any valid name works, and the `brief` field tells you how to propose a list. Proposing one is a suggestion for the human to confirm, never something to write into the config yourself.
|
|
219
|
+
|
|
220
|
+
If `kf new` refuses the name, it prints the nearest declared one. Take that suggestion or ask the human — do not invent a new context to get past the refusal, and do not add one to `.kf/config.json`.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
kf new {feature_name} --context {context}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Scaffolds `.works/brainstorm/{feature}_{ts}/` + metadata + seeded `phase-1-spec-requirement.md`.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 4. Author the requirement
|
|
231
|
+
|
|
232
|
+
Print the template and instructions:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
kf instruct spec-requirement --change {feature_name}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Fill **every section** of `phase-1-spec-requirement.md`. Mapping from divergence to sections:
|
|
239
|
+
|
|
240
|
+
- **Objective / Problem Statement** — the restated challenge (sharpened by the framework).
|
|
241
|
+
- **Scope (in & out)** — the SCOPE DECISION from synthesis. Explicit "out" items are valuable: they stop Phase 2-3 from drifting.
|
|
242
|
+
- **Actors** — humans and systems touching the feature.
|
|
243
|
+
- **Functional Requirements `FR-###`** — **the traceability anchor.** One behavior per FR, phrased so a test could pass/fail on it. Include the priority (must/should/could) and a note carrying any framework rationale.
|
|
244
|
+
- **Non-Functional Requirements** — performance, security, UX, accessibility, compliance.
|
|
245
|
+
- **Main Use Cases** — one line each with `UC-###` ids (full narratives live in Phase 2).
|
|
246
|
+
- **Constraints / Assumptions / Edge Cases / Open Questions** — edge cases should feel adversarial: empty states, concurrency, permissions, partial failure, boundary values.
|
|
247
|
+
- **Test Strategy** — onboard the user on how deep to test (this locks what Phase 2 must produce):
|
|
248
|
+
- Ask: *"How far do you want this feature tested?"* with concrete options:
|
|
249
|
+
- `unit` — unit tests only, for logic and state. The default for a pure backend or utility feature.
|
|
250
|
+
- `unit+integration` — unit tests plus tests where the change meets another system, the database or an API. The default for an API or a datastore.
|
|
251
|
+
- `full` — unit, integration and **UI/E2E** (Playwright, Cypress, Detox and so on). The default for anything with a user interface or a critical flow, such as a web todo list, a login or a checkout.
|
|
252
|
+
- When the user picks `full`, ask how wide the UI coverage goes: *"UI tests for every flow, or only the critical ones?"* → `{test_level}: full`, `{ui_test_scope}: critical|all`.
|
|
253
|
+
- Record it in the spec under the labels that template actually uses: `Level` in the feature template, `Test Level` in the bug template, plus `UI Tests`, `Tools` (the framework name and the file that runs it) and `Coverage Target` (80% by default).
|
|
254
|
+
- **Let the nature of the feature set the default.** Do not ask again when the answer is obvious: a CRUD API is `unit+integration`, an app with a UI is `full`. Ask only when you genuinely cannot decide.
|
|
255
|
+
- **Acceptance Criteria** — each `[ ]` must be independently verifiable by a human or a test. Under `full`, at least one criterion per FR must read as a UI action: what is clicked, what is typed, what appears on screen.
|
|
256
|
+
|
|
257
|
+
Set `status: pending` → `status: confirmed` in the spec frontmatter when the human signs off (Phase 1 ends on this confirmation).
|
|
258
|
+
|
|
259
|
+
Mirror the requirement to `docs/requirement/{context}/{feature_name}.md` (canonical, human-readable; create the context dir if missing — `kf archive` refreshes it later).
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
kf status --change {feature_name}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
The checklist reports content completion; human confirmation is still required before advancing.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## 5. Confirm with the human
|
|
270
|
+
|
|
271
|
+
Present a tight summary (do not dump the whole file):
|
|
272
|
+
|
|
273
|
+
```text
|
|
274
|
+
FEATURE: {name} ({context})
|
|
275
|
+
STATUS: pending
|
|
276
|
+
|
|
277
|
+
OBJECTIVE: {one line}
|
|
278
|
+
|
|
279
|
+
FR SUMMARY:
|
|
280
|
+
- FR-001 | must | {behavior}
|
|
281
|
+
- ...
|
|
282
|
+
UC SUMMARY:
|
|
283
|
+
- UC-001 {name}
|
|
284
|
+
- ...
|
|
285
|
+
|
|
286
|
+
ACCEPTANCE (sample):
|
|
287
|
+
- [ ] {criterion}
|
|
288
|
+
|
|
289
|
+
DECISIONS RECORDED:
|
|
290
|
+
- {scope decision / assumption}
|
|
291
|
+
- ...
|
|
292
|
+
|
|
293
|
+
SCOPE OUT (explicit):
|
|
294
|
+
- {item} — because {reason}
|
|
295
|
+
|
|
296
|
+
Please confirm the requirement.
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
- On confirmation → set `status: confirmed`, mirror canonical requirement, run `kf stage {feature_name} planning`, then load kanban-plan.
|
|
300
|
+
- If the user pushes back → update the spec, re-confirm. This is normal; the spec exists to absorb disagreement cheaply here, not in implementation.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## Done
|
|
305
|
+
|
|
306
|
+
The requirement is confirmed and mirrored. Hand off to **Phase 2 — Planning**:
|
|
307
|
+
|
|
308
|
+
```text
|
|
309
|
+
Load the kanban-plan skill and write the four plan artifacts (implementation-plan, use-case-specification, use-case-diagram, test-cases). The one-line use-case summaries and the FR/UC ids from phase-1-spec-requirement.md are the input — the full narratives are written in Phase 2, not carried over from Phase 1. Do not re-derive the ids from scratch.
|
|
310
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kanban-bug
|
|
3
|
+
description: 'Kanban bug workflow — triage and document a defect with reproduction, expected/actual result, severity, root cause and regression coverage before handing off to kanban-plan. Use when a work item has kind: bug.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kanban Bug — Triage and fix a defect
|
|
7
|
+
|
|
8
|
+
Argument: `<bug_name>`.
|
|
9
|
+
|
|
10
|
+
A bug goes through the same state machine and approval gate as a feature, but Phase 1 must record enough to reproduce it and to stop it coming back.
|
|
11
|
+
|
|
12
|
+
## 1. Verify
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
kf status --change {bug_name}
|
|
16
|
+
kf show {bug_name}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Only use this skill when the metadata says `kind: bug` and the work item is in `brainstorm`. If the bug is already in `planning`, `backlog`, `implementation`, `testing` or `review`, resume the matching skill; do not recreate artifacts.
|
|
20
|
+
|
|
21
|
+
## 2. Triage contract
|
|
22
|
+
|
|
23
|
+
Read and fill `phase-1-spec-requirement.md` using the bug template (`kf instruct spec-requirement --change {bug_name}`):
|
|
24
|
+
|
|
25
|
+
- Severity and the affected environments.
|
|
26
|
+
- Reproduction steps that are deterministic enough to follow.
|
|
27
|
+
- Actual result and expected result.
|
|
28
|
+
- What the fix covers and what it does not, plus acceptance criteria for the behaviour a regression must protect.
|
|
29
|
+
- Suspected root cause when there is evidence for one; when there is not, say it is undetermined.
|
|
30
|
+
- Regression test strategy and acceptance criteria that can be checked.
|
|
31
|
+
- The related feature when you can identify it, and the docs impact: which file needs changing and why, or that no docs change is needed.
|
|
32
|
+
|
|
33
|
+
- **Sibling entry points**: list what else reaches the broken code. Review will ask which of them the fix covers, so naming them here is cheaper than discovering them later.
|
|
34
|
+
|
|
35
|
+
Do not guess a root cause to make the report look finished. If you cannot reproduce it, report the blocker plainly and never assume the bug is PASS.
|
|
36
|
+
|
|
37
|
+
Write the reproduction so someone else can run it and watch it fail. Review re-runs it rather than trusting the report, so steps that only work on your machine come back as a finding.
|
|
38
|
+
|
|
39
|
+
## 3. Human confirmation
|
|
40
|
+
|
|
41
|
+
Summarise the bug, its severity, the reproduction, the impact, the expected fix and the regression test for the user. Only once the user confirms do you set the frontmatter to `status: confirmed` and run:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
kf stage {bug_name} planning
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then load `kanban-plan` on its bug branch. The bug report is the execution contract: do not create an implementation plan, a use-case index, narratives, a diagram, a test plan or a feature report. Planning still needs human approval, and the user still chooses start or backlog.
|
|
48
|
+
|
|
49
|
+
## 4. Handoff
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
Bug report confirmed. Load kanban-plan on the bug branch to approve the triage contract and ask start or backlog; keep the reproduction and the regression test inside the approved scope.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
A FAIL or a REJECT, in testing or in review, sends the item back to implementation. `REQUIREMENT_BUG` still stops for the user to decide; do not use it in place of a bug report.
|