@itsflower/cli 0.1.3 → 0.1.5
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/dist/main.js +1762 -66
- package/package.json +17 -28
- package/LICENSE +0 -21
- package/README.md +0 -28
- package/commands/flower.md +0 -5
- package/skills/flower/SKILL.md +0 -41
- package/skills/flower/references/build.md +0 -106
- package/skills/flower/references/clarify.md +0 -83
- package/skills/flower/references/plan.md +0 -96
- package/skills/flower/references/review.md +0 -94
- package/templates/journal.md +0 -46
- package/templates/plan.md +0 -93
- package/templates/requirement.md +0 -45
- package/templates/review.md +0 -49
package/package.json
CHANGED
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itsflower/cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "🌸 flower CLI — scaffold structured development workflows",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"cli",
|
|
7
|
-
"flower",
|
|
8
|
-
"templates",
|
|
9
|
-
"workflow"
|
|
10
|
-
],
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "https://github.com/itsflower/flower"
|
|
15
|
-
},
|
|
3
|
+
"version": "0.1.5",
|
|
16
4
|
"bin": {
|
|
17
|
-
"flower": "./dist/main.
|
|
5
|
+
"flower": "./dist/main.ts"
|
|
18
6
|
},
|
|
19
7
|
"files": [
|
|
20
|
-
"dist"
|
|
21
|
-
"templates",
|
|
22
|
-
"skills",
|
|
23
|
-
"commands"
|
|
8
|
+
"dist"
|
|
24
9
|
],
|
|
25
10
|
"type": "module",
|
|
26
|
-
"
|
|
27
|
-
|
|
11
|
+
"main": "./dist/main.ts",
|
|
12
|
+
"types": "./dist/main.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/main.d.ts",
|
|
16
|
+
"import": "./dist/main.ts"
|
|
17
|
+
}
|
|
28
18
|
},
|
|
29
19
|
"scripts": {
|
|
30
|
-
"build": "
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"postpack": "rm -rf templates && ln -s ../../core/templates templates && rm -rf skills commands"
|
|
20
|
+
"build": "bun build ./src/main.ts --outdir ./dist --target node",
|
|
21
|
+
"dev": "bun run ./src/main.ts",
|
|
22
|
+
"typecheck": "tsc --noEmit"
|
|
34
23
|
},
|
|
35
24
|
"dependencies": {
|
|
36
|
-
"
|
|
25
|
+
"@clack/prompts": "^1.2.0",
|
|
26
|
+
"citty": "^0.2.2"
|
|
37
27
|
},
|
|
38
28
|
"devDependencies": {
|
|
39
|
-
"@types/bun": "
|
|
40
|
-
"
|
|
41
|
-
"typescript": "^5.7.0"
|
|
29
|
+
"@types/bun": "^1.3.12",
|
|
30
|
+
"typescript": "^6.0.2"
|
|
42
31
|
}
|
|
43
32
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 itsflower
|
|
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
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# @itsflower/cli
|
|
2
|
-
|
|
3
|
-
🌸 Scaffold structured development workflows in your project.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# With npx (Node.js)
|
|
9
|
-
npx @itsflower/cli init
|
|
10
|
-
|
|
11
|
-
# With bunx (Bun)
|
|
12
|
-
bunx @itsflower/cli init
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Commands
|
|
16
|
-
|
|
17
|
-
### `flower init`
|
|
18
|
-
|
|
19
|
-
Initializes flower in your project by copying workflow templates to `.flower/templates/`:
|
|
20
|
-
|
|
21
|
-
- `requirement.md` — Define the problem, scope, and acceptance criteria
|
|
22
|
-
- `plan.md` — Break down work into ordered tasks with ACs
|
|
23
|
-
- `journal.md` — Log decisions and discoveries during implementation
|
|
24
|
-
- `review.md` — Post-implementation quality checklist and learnings
|
|
25
|
-
|
|
26
|
-
## License
|
|
27
|
-
|
|
28
|
-
MIT
|
package/commands/flower.md
DELETED
package/skills/flower/SKILL.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: flower
|
|
3
|
-
description: Structured development workflow with 4 phases — clarify, plan, build, and review. Use when the user wants to build a feature end-to-end, fix a bug, or refactor with a structured process, or when they mention "quest", "feature", "task", or "workflow".
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Workflow
|
|
7
|
-
|
|
8
|
-
```mermaid
|
|
9
|
-
flowchart TD
|
|
10
|
-
Start([User input]) --> P1[Clarify]
|
|
11
|
-
P1 --> P2[Plan]
|
|
12
|
-
P2 -- not feasible --> D1([End - plan.md rejected])
|
|
13
|
-
P2 -- feasible --> P3[Build]
|
|
14
|
-
P3 --> P4[Review]
|
|
15
|
-
P4 --> D2([Done])
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Phases
|
|
19
|
-
|
|
20
|
-
| # | Phase | Reference | When |
|
|
21
|
-
| --- | ------- | ---------------------------------------------- | ------------------------------------------------------- |
|
|
22
|
-
| 1 | Clarify | [references/clarify.md](references/clarify.md) | User describes a feature, bug, or refactor to build |
|
|
23
|
-
| 2 | Plan | [references/plan.md](references/plan.md) | Interview is complete, requirement.md and plan.md ready |
|
|
24
|
-
| 3 | Build | [references/build.md](references/build.md) | All tasks are done, ready for quality gate |
|
|
25
|
-
| 4 | Review | [references/review.md](references/review.md) | All tasks are done, ready for quality gate |
|
|
26
|
-
|
|
27
|
-
Load only the reference file for the current phase. Do not read ahead.
|
|
28
|
-
|
|
29
|
-
## Document Convention
|
|
30
|
-
|
|
31
|
-
Create a folder `.flower/quests/<datetime>--<short-description>/` when starting a new quest.
|
|
32
|
-
|
|
33
|
-
- `<datetime>` uses `YYMMDD-HHmm` format — run `date +"%y%m%d-%H%M"` to generate it
|
|
34
|
-
- `<short-description>` is a kebab-case summary generated by the agent (e.g. `add-user-auth`, `fix-login-bug`)
|
|
35
|
-
- Folder contains `requirement.md`, `plan.md`, `journal.md`, and `review.md` based on templates in `.flower/templates/`.
|
|
36
|
-
|
|
37
|
-
## Rules (**STRICTLY ENFORCED**)
|
|
38
|
-
|
|
39
|
-
- Print `# Phase <number>: <name>` **once** before each phase. After a phase is complete, **IMMEDIATELY** begin the next phase without asking.
|
|
40
|
-
- One quest at a time — finish or park the current quest before starting another
|
|
41
|
-
- Do not skip phases
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Phase 3: Build
|
|
2
|
-
|
|
3
|
-
Execute tasks from `plan.md`, test each one, and log knowledge in the journal.
|
|
4
|
-
|
|
5
|
-
## Workflow (**STRICTLY ENFORCED**)
|
|
6
|
-
|
|
7
|
-
```mermaid
|
|
8
|
-
flowchart TD
|
|
9
|
-
Start[plan.md] --> B1[Execute next task]
|
|
10
|
-
B1 --> B2[Test / Verify]
|
|
11
|
-
B2 --> C1{Pass?}
|
|
12
|
-
C1 -- no --> B3[Fix issue]
|
|
13
|
-
C1 -- yes --> B4[Mark task done]
|
|
14
|
-
B3 --> B2
|
|
15
|
-
B4 --> B5[Log in journal if noteworthy]
|
|
16
|
-
B5 --> C2{All tasks done?}
|
|
17
|
-
C2 -- no --> B1
|
|
18
|
-
C2 -- yes --> B6[Mark plan as completed]
|
|
19
|
-
B6 --> End([Proceed to Phase 4: Review])
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Input
|
|
23
|
-
|
|
24
|
-
- `requirement.md`
|
|
25
|
-
- `plan.md` with `status: in-progress`
|
|
26
|
-
|
|
27
|
-
## Steps
|
|
28
|
-
|
|
29
|
-
### Execute task
|
|
30
|
-
|
|
31
|
-
For each task in plan order:
|
|
32
|
-
|
|
33
|
-
- Read the task's Description, AC, and Approach
|
|
34
|
-
- Investigate relevant code before changing it
|
|
35
|
-
- Implement following codebase conventions
|
|
36
|
-
- One logical change per task, as scoped in the plan
|
|
37
|
-
|
|
38
|
-
**Scale guidance:**
|
|
39
|
-
|
|
40
|
-
| Complexity | Investigation | Implementation | Testing |
|
|
41
|
-
| ------------ | ------------------- | ----------------------- | ------------------------ |
|
|
42
|
-
| **Trivial** | Quick scan | Direct change | Spot check |
|
|
43
|
-
| **Standard** | Read related files | Follow approach in plan | Related test suite |
|
|
44
|
-
| **Complex** | Deep codebase study | Incremental changes | Full test suite + manual |
|
|
45
|
-
|
|
46
|
-
### Test / Verify
|
|
47
|
-
|
|
48
|
-
- Run relevant tests — unit, integration, or manual as appropriate
|
|
49
|
-
- Verify every AC for this task passes
|
|
50
|
-
- If tests fail → fix and re-verify; do not move on
|
|
51
|
-
- If unrelated tests were already failing → note in journal, do not fix
|
|
52
|
-
|
|
53
|
-
### Mark task done
|
|
54
|
-
|
|
55
|
-
Check the task checkbox in plan: `- [ ]` → `- [x]`
|
|
56
|
-
|
|
57
|
-
### Log in journal
|
|
58
|
-
|
|
59
|
-
Template: `.flower/templates/journal.md`
|
|
60
|
-
|
|
61
|
-
Only when something noteworthy happened. Skip if plan was followed exactly.
|
|
62
|
-
|
|
63
|
-
| Log this | Example |
|
|
64
|
-
| -------------------- | ------------------------------------------------------------ |
|
|
65
|
-
| Deviation from plan | "Used library X instead of Y because Y doesn't support Z" |
|
|
66
|
-
| Non-obvious decision | "Chose eager loading — dataset is always small" |
|
|
67
|
-
| Problem & resolution | "Circular dep between A and B — extracted C" |
|
|
68
|
-
| Discovery | "Found existing utility that handles 80% — reused it" |
|
|
69
|
-
| New task added | "Added task 4b: migrate old data — discovered during task 4" |
|
|
70
|
-
|
|
71
|
-
Do **not** log: routine implementation, standard debugging, info already in commits.
|
|
72
|
-
|
|
73
|
-
**Entry format:**
|
|
74
|
-
|
|
75
|
-
```markdown
|
|
76
|
-
### [Short actionable title]
|
|
77
|
-
|
|
78
|
-
- **tags**: [comma-separated domain keywords]
|
|
79
|
-
- **scope**: [global | project:<name>]
|
|
80
|
-
- **context**: [What was being worked on]
|
|
81
|
-
- **insight**: [The decision, discovery, or deviation — focus on WHY]
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Create journal file on first entry from template.
|
|
85
|
-
|
|
86
|
-
### Mark plan as completed
|
|
87
|
-
|
|
88
|
-
After all tasks are done, verify:
|
|
89
|
-
|
|
90
|
-
- [ ] All task checkboxes checked
|
|
91
|
-
- [ ] All task ACs verified
|
|
92
|
-
- [ ] All tests pass (full relevant test suite)
|
|
93
|
-
- [ ] No unintended side effects
|
|
94
|
-
- [ ] Journal captures all deviations
|
|
95
|
-
- [ ] Any tasks added during build are also completed
|
|
96
|
-
|
|
97
|
-
If gaps exist → fix before proceeding. Then set `status: completed` in plan frontmatter.
|
|
98
|
-
|
|
99
|
-
## Rules
|
|
100
|
-
|
|
101
|
-
- **Never skip testing** — every task verified before marking done
|
|
102
|
-
- **Don't change task scope** — update the plan first, note in journal
|
|
103
|
-
- **Add, don't expand** — new work = new task in the plan
|
|
104
|
-
- **Follow plan order** — respect dependencies; only skip ahead when blocked
|
|
105
|
-
- **Resumable state** — plan shows exactly where to resume (next unchecked task)
|
|
106
|
-
- **Don't fix unrelated issues** — note in journal for a future quest
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# Phase 1: Clarify
|
|
2
|
-
|
|
3
|
-
Clarify user requirements, clearly describing WHAT and WHY, **not** HOW.
|
|
4
|
-
|
|
5
|
-
## Workflow (**STRICTLY ENFORCED**)
|
|
6
|
-
|
|
7
|
-
```mermaid
|
|
8
|
-
flowchart TD
|
|
9
|
-
Start([User input]) --> C1[Analyze]
|
|
10
|
-
C1 --> C2[Research]
|
|
11
|
-
C2 --> C3{Ambiguities resolved?}
|
|
12
|
-
C3 -- No --> C4[Ask for clarification]
|
|
13
|
-
C4 --> C1
|
|
14
|
-
C3 -- Yes --> C5[Create `requirement.md`]
|
|
15
|
-
C5 --> End([Proceed to Phase 2: Plan])
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Steps
|
|
19
|
-
|
|
20
|
-
### Analyze
|
|
21
|
-
|
|
22
|
-
Read user input word by word. Extract:
|
|
23
|
-
|
|
24
|
-
- **Codebase keywords** → file names, modules, functions, endpoints, components mentioned — feed into codebase exploration
|
|
25
|
-
- **Technology keywords** → libraries, frameworks, languages, tools, APIs mentioned — feed into documentation lookup
|
|
26
|
-
- **Intent** → feature, bug fix, refactor, or enhancement
|
|
27
|
-
- **Constraints** → explicit or implicit limitations
|
|
28
|
-
- **Ambiguities** → anything with multiple interpretations — feed into clarification questions
|
|
29
|
-
|
|
30
|
-
### Research
|
|
31
|
-
|
|
32
|
-
Use extracted keywords to investigate before asking:
|
|
33
|
-
|
|
34
|
-
- **Codebase** → grep, glob, read files, `repomix` — understand existing code, patterns, architecture
|
|
35
|
-
- **Technology** → use MCPs (`context7`, ...), fetch - understand relevant docs for mentioned technologies
|
|
36
|
-
- **External**: look up APIs, standards, or domain concepts the human referenced
|
|
37
|
-
|
|
38
|
-
### Ask for clarification
|
|
39
|
-
|
|
40
|
-
Only if ambiguities remain after research:
|
|
41
|
-
|
|
42
|
-
| Rule | Detail |
|
|
43
|
-
| --------------- | ------------------------------------------------------------------------------------- |
|
|
44
|
-
| Provide options | Offer choices, not open-ended questions. E.g., "(a) partial, (b) exact, or (c) both?" |
|
|
45
|
-
| Batch questions | Group related questions. Max ~5 per round. |
|
|
46
|
-
| Be specific | Reference concrete code, files, or behaviors. |
|
|
47
|
-
| Easy to answer | Human should answer in a few words or by picking an option. |
|
|
48
|
-
| Show research | Share what you found to give context to your question. |
|
|
49
|
-
|
|
50
|
-
After each response, restart: analyze → research based on new info → evaluate remaining ambiguities, gaps.
|
|
51
|
-
|
|
52
|
-
### Create `requirement.md`
|
|
53
|
-
|
|
54
|
-
Template in `.flower/templates/requirement.md`.
|
|
55
|
-
|
|
56
|
-
| Section | Content |
|
|
57
|
-
| --------------------------- | ------------------------------------------------------------------- |
|
|
58
|
-
| Problem | Who is affected, when, what goes wrong. 2–5 bullets. No solutions. |
|
|
59
|
-
| User Stories | "As a [user], I want [action] so that [benefit]" |
|
|
60
|
-
| Goals | Verifiable outcomes — each yes/no checkable |
|
|
61
|
-
| Non-Goals | Explicitly excluded — anything someone might assume is in scope |
|
|
62
|
-
| Acceptance Criteria | Given/When/Then — pass/fail testable, no subjective judgment |
|
|
63
|
-
| Constraints & Prerequisites | Hard limits (unchangeable) + external requirements for this feature |
|
|
64
|
-
| Glossary | Domain-specific terms only. Skip if self-explanatory. |
|
|
65
|
-
|
|
66
|
-
## Validate
|
|
67
|
-
|
|
68
|
-
- [ ] Every goal is concrete and verifiable
|
|
69
|
-
- [ ] Every goal has at least one acceptance criterion
|
|
70
|
-
- [ ] Scope boundaries are unambiguous
|
|
71
|
-
- [ ] All ambiguities from Q&A are resolved in the document — none deferred
|
|
72
|
-
- [ ] Constraints are realistic and compatible with each other
|
|
73
|
-
|
|
74
|
-
## Rules
|
|
75
|
-
|
|
76
|
-
- **Read before asking** — detect keywords and research the codebase first; only ask what you cannot answer yourself
|
|
77
|
-
- **Every word matters** — read the human's input thoroughly; do not skim or skip
|
|
78
|
-
- **Options over open-ended** — always provide choices when asking questions
|
|
79
|
-
- **Draft once, draft right** — documents must be accurate and complete on first draft; the Q&A phase exists to ensure this
|
|
80
|
-
- **Problem ≠ solution** — requirement describes what's wrong, not how to fix it
|
|
81
|
-
- **Non-Goals prevent scope creep** — invest effort here
|
|
82
|
-
- **Self-contained but concise** — a reader must understand the problem and success criteria without reading the codebase
|
|
83
|
-
- **No assumptions** — ambiguities must be resolved through research or Q&A, never assumed
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
# Phase 2: Plan
|
|
2
|
-
|
|
3
|
-
Research HOW to implement `requirement.md` — explore the codebase, study external docs, decide the approach, and produce `plan.md`.
|
|
4
|
-
|
|
5
|
-
## Workflow (**STRICTLY ENFORCED**)
|
|
6
|
-
|
|
7
|
-
```mermaid
|
|
8
|
-
flowchart TD
|
|
9
|
-
Start([requirement.md]) --> P1[Codebase explore]
|
|
10
|
-
P1 --> P2[Research external]
|
|
11
|
-
P2 --> C1{Approach decided?}
|
|
12
|
-
C1 -- no --> P3[Ask for clarification]
|
|
13
|
-
P3 --> P4[Create plan.md]
|
|
14
|
-
C1 -- yes --> P4
|
|
15
|
-
P4 --> End([Proceed to Phase 3: Build])
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Steps
|
|
19
|
-
|
|
20
|
-
### Codebase explore
|
|
21
|
-
|
|
22
|
-
Use goals and acceptance criteria from `requirement.md` as search targets:
|
|
23
|
-
|
|
24
|
-
- **Architecture** — modules, layers, data flow relevant to the requirement
|
|
25
|
-
- **Patterns** — how similar features are implemented; conventions to follow
|
|
26
|
-
- **Reuse** — what already exists vs. what must be built
|
|
27
|
-
|
|
28
|
-
Tools: grep, glob, read files, `repomix`.
|
|
29
|
-
|
|
30
|
-
### Research external
|
|
31
|
-
|
|
32
|
-
For every technology, library, or pattern relevant to the requirement:
|
|
33
|
-
|
|
34
|
-
- **Docs** — capabilities, limitations, API surface
|
|
35
|
-
- **Best practices** — recommended approaches, common pitfalls
|
|
36
|
-
- **Alternatives** — competing libraries or patterns that solve the same problem
|
|
37
|
-
|
|
38
|
-
Tools: `context7`, fetch, web search.
|
|
39
|
-
|
|
40
|
-
### Ask for clarification
|
|
41
|
-
|
|
42
|
-
When approach is NOT decided — ask. Do not decide alone.
|
|
43
|
-
|
|
44
|
-
| Trigger | What to present |
|
|
45
|
-
| ------------------------- | -------------------------------------- |
|
|
46
|
-
| Multiple valid approaches | Each option with pros, cons, tradeoffs |
|
|
47
|
-
| New library or dependency | What it does, why needed, alternatives |
|
|
48
|
-
| Significant tradeoff | What is gained vs. given up |
|
|
49
|
-
|
|
50
|
-
| Rule | Detail |
|
|
51
|
-
| --------------- | ------------------------------------------------------ |
|
|
52
|
-
| Provide options | Offer choices with tradeoffs, not open-ended questions |
|
|
53
|
-
| Show research | Share findings to give context |
|
|
54
|
-
| Batch questions | Group related decisions. Max ~5 per round |
|
|
55
|
-
| Be specific | Reference concrete code, libraries, or behaviors |
|
|
56
|
-
|
|
57
|
-
### Create `plan.md`
|
|
58
|
-
|
|
59
|
-
Template in `.flower/templates/plan.md`. Set `status: in-progress`.
|
|
60
|
-
|
|
61
|
-
| Section | Content |
|
|
62
|
-
| ------------------- | ------------------------------------------------------------------- |
|
|
63
|
-
| Overview | 2-3 sentences: what is being built, approach, key technical choices |
|
|
64
|
-
| Technical Decisions | Non-obvious decisions. WHAT, WHY, alternatives considered |
|
|
65
|
-
| Tasks | Ordered by dependency. One logical change per task |
|
|
66
|
-
| Dependencies | Internal and external. Skip if none |
|
|
67
|
-
| Risks & Mitigation | Only risks that would change the plan. Skip if none |
|
|
68
|
-
|
|
69
|
-
Each task must have:
|
|
70
|
-
|
|
71
|
-
| Field | Required | Content |
|
|
72
|
-
| ----------- | -------- | -------------------------------------------------- |
|
|
73
|
-
| Description | Yes | Clear imperative statement |
|
|
74
|
-
| AC | Yes | Pass/fail verifiable criteria |
|
|
75
|
-
| Approach | Yes | Concrete steps, files to touch, patterns to follow |
|
|
76
|
-
| Blocked by | No | Task dependency |
|
|
77
|
-
|
|
78
|
-
If no viable approach exists → set `status: rejected`, fill `## Rejection Reason`. End workflow.
|
|
79
|
-
|
|
80
|
-
## Validate
|
|
81
|
-
|
|
82
|
-
- [ ] Every requirement goal maps to at least one task
|
|
83
|
-
- [ ] Every acceptance criterion is covered by a task's AC
|
|
84
|
-
- [ ] Tasks ordered by dependency
|
|
85
|
-
- [ ] Each task has AC and Approach
|
|
86
|
-
- [ ] Technical decisions grounded in codebase research
|
|
87
|
-
- [ ] No compound tasks — split any "X and Y"
|
|
88
|
-
|
|
89
|
-
## Rules
|
|
90
|
-
|
|
91
|
-
- **Research before deciding** — explore codebase and docs before forming an approach
|
|
92
|
-
- **Surface choices** — when multiple approaches exist, present them with tradeoffs; never pick silently
|
|
93
|
-
- **New deps need approval** — never add a library to the plan without asking
|
|
94
|
-
- **Decisions in the document** — every choice from Q&A must appear in Technical Decisions
|
|
95
|
-
- **One task, one change** — if a description uses "and", split it
|
|
96
|
-
- **Concrete over vague** — Approach must name files, functions, and patterns
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# Phase 4: Review
|
|
2
|
-
|
|
3
|
-
Quality gate and delivery summary. Verify everything not covered by task-level testing: security, performance, project standards, and overall correctness.
|
|
4
|
-
|
|
5
|
-
## Workflow (**STRICTLY ENFORCED**)
|
|
6
|
-
|
|
7
|
-
```mermaid
|
|
8
|
-
flowchart TD
|
|
9
|
-
Start([plan.md & journal.md]) --> S[Write delivery summary]
|
|
10
|
-
S --> CL[Run quality checklist]
|
|
11
|
-
CL --> CF{All checks pass?}
|
|
12
|
-
CF -- No --> Fix[Fix issues]
|
|
13
|
-
Fix --> CL
|
|
14
|
-
CF -- Yes --> Done([Mark review as completed])
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Input
|
|
18
|
-
|
|
19
|
-
- `plan.md` with `status: completed` (all tasks checked)
|
|
20
|
-
- `journal.md` (if entries exist)
|
|
21
|
-
- Template: `.flower/templates/review.md`
|
|
22
|
-
|
|
23
|
-
## Steps
|
|
24
|
-
|
|
25
|
-
1. **Write delivery summary**
|
|
26
|
-
|
|
27
|
-
Create `review.md` from the template in the quest directory. Set `status: draft`.
|
|
28
|
-
|
|
29
|
-
**Scale guidance**: match depth to the quest's scope.
|
|
30
|
-
|
|
31
|
-
| Quest Size | Summary Length | Metrics | Outcome Detail |
|
|
32
|
-
| ---------- | -------------- | -------------------- | ----------------- |
|
|
33
|
-
| **Small** | 2-3 sentences | Skip if not measured | Brief outcome |
|
|
34
|
-
| **Medium** | 3-5 sentences | Key metrics only | Outcome + context |
|
|
35
|
-
| **Large** | 5-8 sentences | Full metrics | Detailed outcome |
|
|
36
|
-
|
|
37
|
-
Write the summary covering:
|
|
38
|
-
- **What was delivered** — concrete deliverables (features, fixes, refactors), not process steps
|
|
39
|
-
- **Overall outcome** — did it meet the requirement's goals? Any goals partially met or adjusted?
|
|
40
|
-
- **Key metrics** — lines changed, test coverage delta, performance improvement, or other measurable results (when available and meaningful)
|
|
41
|
-
- **Notable deviations** — significant differences from the original plan, if any (reference journal for details)
|
|
42
|
-
|
|
43
|
-
The summary must be **self-contained** — someone reading only the review doc should understand what was delivered and whether it succeeded, without referring to the requirement, plan, or journal.
|
|
44
|
-
|
|
45
|
-
2. **Run quality checklist**
|
|
46
|
-
|
|
47
|
-
Go through each item systematically. For each: verify → fix if needed → check off.
|
|
48
|
-
- [ ] **Dead code & unused files removed** — check for commented-out code, unused imports, orphaned files created during implementation, and temporary debug code
|
|
49
|
-
- [ ] **Project standards followed** — verify code style, file structure, naming conventions, and linting rules match the rest of the codebase
|
|
50
|
-
- [ ] **No security issues** — scan for hardcoded secrets, SQL injection, XSS, auth bypass, exposed internal errors, and overly permissive permissions
|
|
51
|
-
- [ ] **Performance acceptable** — check for N+1 queries, unnecessary re-renders, unbounded loops, large payloads, missing pagination, and missing indexes
|
|
52
|
-
- [ ] **All tests pass** — run the full relevant test suite (not just per-task tests from Phase 2); verify no regressions were introduced
|
|
53
|
-
- [ ] **Documentation up to date** — README, API docs, inline docs, and config examples reflect the changes (skip if no user-facing docs exist)
|
|
54
|
-
|
|
55
|
-
If fixing an issue requires code changes:
|
|
56
|
-
1. Make the fix
|
|
57
|
-
2. Re-run the **full checklist** from the top (a fix can introduce new issues)
|
|
58
|
-
3. Repeat until all items pass cleanly in a single run
|
|
59
|
-
|
|
60
|
-
3. **Write memories**
|
|
61
|
-
|
|
62
|
-
Record knowledge gained during this quest for future retrieval. Each memory entry uses the structured format:
|
|
63
|
-
|
|
64
|
-
```markdown
|
|
65
|
-
### [Short actionable title — 5-12 words]
|
|
66
|
-
|
|
67
|
-
- **content**: [Detailed explanation with context and examples]
|
|
68
|
-
- **tags**: [comma-separated domain keywords]
|
|
69
|
-
- **scope**: [global | project:<name>]
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Skip if no meaningful knowledge was gained.
|
|
73
|
-
|
|
74
|
-
4. **Mark review as completed** → set `status: completed` in frontmatter
|
|
75
|
-
|
|
76
|
-
## Output
|
|
77
|
-
|
|
78
|
-
- Completed `review.md` with `status: completed`
|
|
79
|
-
- Summary of delivery shared with the human
|
|
80
|
-
|
|
81
|
-
## Rules
|
|
82
|
-
|
|
83
|
-
- **Summary stands alone** — a reader with no context must understand what was delivered and whether it succeeded
|
|
84
|
-
- **Never skip quality checks** — they catch issues that slip through during implementation; rushing here undermines the entire workflow
|
|
85
|
-
- **Full re-run after fixes** — if quality checks reveal issues requiring code changes, re-run the entire checklist afterward; partial re-checks miss cascading problems
|
|
86
|
-
- **Don't gold-plate** — quality checks fix real issues, they do not refactor working code or add enhancements beyond the quest's scope
|
|
87
|
-
- **Reference, don't repeat** — the summary may reference the plan or journal for details, but must not require them to be understood
|
|
88
|
-
|
|
89
|
-
## Status Lifecycle
|
|
90
|
-
|
|
91
|
-
| Status | Meaning |
|
|
92
|
-
| ----------- | --------------------------------------- |
|
|
93
|
-
| `draft` | Initial creation, summary being written |
|
|
94
|
-
| `completed` | Quality checks passed, quest done |
|
package/templates/journal.md
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<!-- Record knowledge and decisions during implementation. Write entries during work, not after.
|
|
2
|
-
Each entry uses a structured format for future search and retrieval.
|
|
3
|
-
|
|
4
|
-
Guidelines:
|
|
5
|
-
- Write in plain language, not formal prose
|
|
6
|
-
- Focus on WHY, not WHAT — the code shows what changed
|
|
7
|
-
- Only record noteworthy events — if the plan was followed exactly, there is nothing to log
|
|
8
|
-
- One entry per meaningful event — do not log routine changes
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
## Entries
|
|
12
|
-
|
|
13
|
-
<!-- Each entry must use this structured format:
|
|
14
|
-
|
|
15
|
-
### [Short actionable title]
|
|
16
|
-
- **tags**: [comma-separated domain keywords for search]
|
|
17
|
-
- **scope**: [global | project:<name>]
|
|
18
|
-
- **context**: [What was being worked on]
|
|
19
|
-
- **insight**: [The decision, discovery, or deviation — focus on WHY]
|
|
20
|
-
|
|
21
|
-
Example:
|
|
22
|
-
|
|
23
|
-
### Switched from LIKE queries to tsvector for product search
|
|
24
|
-
- **tags**: postgresql, search, performance, indexing
|
|
25
|
-
- **scope**: project:catalog
|
|
26
|
-
- **context**: Implementing the search endpoint (Task 2 in plan). Initial ILIKE approach showed 650ms response on 100K rows.
|
|
27
|
-
- **insight**: LIKE with leading wildcard forces sequential scans. tsvector + GIN index provides O(log n) lookup, bringing response time from 650ms to 12ms. Always use tsvector for full-text search at scale.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
### Input validation prevents DoS via long search queries
|
|
32
|
-
- **tags**: security, validation, performance
|
|
33
|
-
- **scope**: global
|
|
34
|
-
- **context**: Testing edge cases on the search endpoint. 10,000-char query caused 3s parse time.
|
|
35
|
-
- **insight**: Unbounded input length is both a performance risk and a DoS vector. Added 1-200 char validation returning HTTP 400. Always validate input length for text-processing endpoints.
|
|
36
|
-
-->
|
|
37
|
-
|
|
38
|
-
## Deviations from Plan
|
|
39
|
-
|
|
40
|
-
<!-- Summarize significant differences between the plan and what was actually implemented. Fill this in at the end by pulling from entries above.
|
|
41
|
-
|
|
42
|
-
Format:
|
|
43
|
-
| Planned | Actual | Reason |
|
|
44
|
-
| ------- | ------ | ------ |
|
|
45
|
-
| [Original approach] | [What was done instead] | [Why the change] |
|
|
46
|
-
-->
|