ai-workflow-init 3.0.0 → 3.2.2

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.
@@ -0,0 +1,114 @@
1
+ # AI Agent Workflow Standards
2
+
3
+ ## Core Coding Philosophy
4
+
5
+ Apply these principles when providing solutions, generating code, or making technical decisions:
6
+
7
+ ### 1. Simplicity First
8
+ - Choose the simplest solution that meets requirements
9
+ - Avoid over-engineering and unnecessary abstractions
10
+ - Simple code = fewer bugs, easier to maintain, easier to understand
11
+ - Ask: "Can this be done more simply while still working?"
12
+ - Complexity is a last resort, not a first choice
13
+
14
+ ### 2. Deep Understanding
15
+ - Understand requirements fully before planning or coding
16
+ - If unclear about requirement, flow, edge cases, or expected behavior → Ask the user
17
+ - Never assume or guess - clarification prevents wasted effort
18
+ - Ask questions like:
19
+ - "What should happen when X occurs?"
20
+ - "How should the system behave if Y fails?"
21
+ - "Is this the expected flow: A → B → C?"
22
+
23
+ ### 3. Multiple Options
24
+ - Provide 2-5 solution options for each problem when appropriate
25
+ - Present trade-offs clearly: pros/cons, complexity, performance, maintainability
26
+ - Format: "Option 1: [approach] - Pros: [...] Cons: [...]"
27
+ - Let user choose based on their context and priorities
28
+ - Not every problem has one "best" solution
29
+
30
+ ### 4. Think Ahead
31
+ - While keeping solutions simple, consider future implications:
32
+ - How will this scale with more data/users?
33
+ - What if requirements change slightly?
34
+ - Are there security vulnerabilities?
35
+ - What are performance bottlenecks?
36
+ - Balance: Simple now + adaptable for reasonable future needs
37
+ - Do not build for hypothetical futures, but be aware of likely changes
38
+
39
+ **Philosophy in practice:**
40
+ - Simplicity: Use built-in array methods instead of custom loop logic
41
+ - Deep Understanding: "Should this API return 404 or 400 for invalid IDs?"
42
+ - Multiple Options: "We can use: 1) localStorage (simple), 2) IndexedDB (scalable), or 3) Backend API (persistent)"
43
+ - Think Ahead: "This works for 100 items, but consider pagination for 10,000+"
44
+
45
+ ---
46
+
47
+ ## Core Workflow: Plan → Implement → Test → Review
48
+
49
+ ### Workflow Alignment
50
+ - **Plan:** Create feature planning doc at `docs/ai/planning/feature-{name}.md` before coding. Do not start until planning exists and is agreed.
51
+ - **Implement:** Provide 1-3 sentence status updates before operations. Use file editing tools, not copy-paste. Update checkboxes `[ ]` → `[x]` in planning doc.
52
+ - **Test:** Run linter/type-check/build on changed files after each batch. Auto-fix issues (up to 3 attempts) before asking for help.
53
+ - **Review:** When complete, validate against planning doc acceptance criteria and CODE_CONVENTIONS.md.
54
+
55
+ ## File Structure
56
+
57
+ ### Planning Documents
58
+ - Location: `docs/ai/planning/feature-{name}.md` (kebab-case)
59
+ - Must include: Goal, Acceptance Criteria (GWT), Risks, Implementation Phases, Follow-ups
60
+ - Template: `docs/ai/planning/feature-template.md`
61
+
62
+ ### Project Standards
63
+ - Coding conventions: `docs/ai/project/CODE_CONVENTIONS.md`
64
+ - Architecture guide: `docs/ai/project/PROJECT_STRUCTURE.md`
65
+ - Language templates: `docs/ai/project/template-convention/`
66
+
67
+ ## Tooling Strategy
68
+ - Prefer semantic search across codebase; use grep only for exact matches
69
+ - Default to parallel execution for independent operations
70
+ - Quality tools: ESLint, TypeScript, Prettier (auto-format/auto-fix when possible)
71
+
72
+ ## Communication
73
+ - Use Markdown only when necessary; backticks for `files/dirs/functions/classes`
74
+ - Status updates before/after important actions
75
+ - Mirror user's chat language; code/comments always in English
76
+
77
+ ## Code Presentation
78
+ - Existing code: cite with `startLine:endLine:filepath` (no language tag)
79
+ - New code: fenced blocks with language tag, no line numbers
80
+
81
+ ## TODO Policy
82
+ - For medium/large tasks: create todos (≤14 words, verb-led)
83
+ - Keep only ONE `in_progress` item
84
+ - Update immediately after progress; mark completed upon finish
85
+
86
+ ## Git Workflow
87
+ - Feature branches: `feature/{name}` (match planning doc name)
88
+ - Commit format: `[phase] brief description`
89
+ - Examples: `[planning] create user auth plan`, `[phase-1] implement database schema`
90
+
91
+ ## Slash Commands
92
+ - `/create-plan` - Generate planning doc
93
+ - `/execute-plan` - Implement tasks from planning doc
94
+ - `/modify-plan` - Modify plan after implementation
95
+ - `/code-review` - Validate against standards
96
+ - `/generate-standards` - Update CODE_CONVENTIONS.md
97
+ - `/writing-test` - Generate tests from acceptance criteria
98
+ - `/init-chat` - Load project rules (AGENTS.md)
99
+
100
+ ## Quality Gates
101
+ ### Before marking task complete:
102
+ - Code matches planning doc specification
103
+ - Linting passes (no warnings)
104
+ - Type checking passes (if applicable)
105
+ - Build succeeds (if applicable)
106
+ - Checkbox updated in planning doc: `[x]`
107
+
108
+ ---
109
+
110
+ **Claude Code Specifics:**
111
+ - This file is automatically loaded every session
112
+ - Commands inherit these standards
113
+ - Use `/context` to see loaded memory
114
+ - Use `/usage` to monitor token consumption
package/cli.js CHANGED
@@ -244,6 +244,20 @@ async function main() {
244
244
  } catch (_) {
245
245
  run(`wget -qO .claude/hooks.json ${RAW_BASE}/.claude/hooks.json`);
246
246
  }
247
+
248
+ // Download skills folder (always overwrite to get latest)
249
+ step("🚚 Downloading Claude Code skills (.claude/skills)...");
250
+ if (!existsSync(".claude/skills")) {
251
+ mkdirSync(".claude/skills", { recursive: true });
252
+ }
253
+ run(`npx degit ${REPO}/.claude/skills .claude/skills --force`);
254
+
255
+ // Download themes folder (always overwrite to get latest)
256
+ step("🚚 Downloading Claude Code themes (.claude/themes)...");
257
+ if (!existsSync(".claude/themes")) {
258
+ mkdirSync(".claude/themes", { recursive: true });
259
+ }
260
+ run(`npx degit ${REPO}/.claude/themes .claude/themes --force`);
247
261
  }
248
262
 
249
263
  // Clone Cursor prompts (luôn ghi đè)
@@ -2,7 +2,221 @@
2
2
 
3
3
  Note: All content in this document must be written in English.
4
4
 
5
- ## 1. Goal & Acceptance Criteria
5
+ ## 1. Codebase Context
6
+
7
+ > **Note**: This section is auto-generated by `/create-plan` exploration phase. Include only if relevant patterns were found.
8
+
9
+ ### Similar Features
10
+ - {path/to/similar-feature-1} - {brief description of what to learn from it}
11
+ - {path/to/similar-feature-2} - {brief description of what to learn from it}
12
+
13
+ ### Reusable Components/Utils
14
+ - {path/to/component.tsx} - {what it does, how to use}
15
+ - {path/to/util.ts} - {what it does, when to use}
16
+
17
+ ### Architectural Patterns
18
+ - {Pattern name}: {description}
19
+ - {Pattern name}: {description}
20
+
21
+ ### Key Files to Reference
22
+ - {path/to/file} - {why it's relevant}
23
+
24
+ ---
25
+
26
+ ## 2. Design Specifications
27
+
28
+ > **Note**: This section is for design specifications from any source (Figma, screenshot, detailed description, etc.). Include only if design source was provided.
29
+
30
+ ### Reference
31
+ - **File**: {Figma file name}
32
+ - **Frame**: {Frame name/ID}
33
+ - **Link**: {Figma URL}
34
+ - **Extracted**: {date/time}
35
+
36
+ ### Design Tokens
37
+
38
+ **Colors**:
39
+ - Primary: #{hex} (Usage: buttons, links, key actions)
40
+ - Secondary: #{hex} (Usage: secondary actions)
41
+ - Accent: #{hex} (Usage: highlights, badges)
42
+ - Neutral-50: #{hex}
43
+ - Neutral-100: #{hex}
44
+ - [... all colors with usage notes]
45
+
46
+ **Typography**:
47
+ - Heading 1: {font-family}, {size}px, {weight}, {line-height}
48
+ - Heading 2: {font-family}, {size}px, {weight}, {line-height}
49
+ - Body: {font-family}, {size}px, {weight}, {line-height}
50
+ - Caption: {font-family}, {size}px, {weight}, {line-height}
51
+
52
+ **Spacing Scale**: {4, 8, 16, 24, 32, 48, 64}px
53
+
54
+ **Border Radius**: {4, 8, 12, 16}px
55
+
56
+ **Shadows**:
57
+ - sm: {shadow definition}
58
+ - md: {shadow definition}
59
+ - lg: {shadow definition}
60
+
61
+ ### Component Breakdown
62
+
63
+ **{Component Name}** (Figma ID: {component-id})
64
+ - **States**: default, hover, active, disabled, loading, error
65
+ - **Variants**: primary, secondary, outline, ghost
66
+ - **Dimensions**: {width}px × {height}px (or min/max)
67
+ - **Specifications**:
68
+ - Padding: {top}px {right}px {bottom}px {left}px
69
+ - Border: {width}px solid {color}
70
+ - Border radius: {value}px
71
+ - Typography: {style from above}
72
+ - Colors:
73
+ - Background: #{hex}
74
+ - Text: #{hex}
75
+ - Border: #{hex}
76
+ - States:
77
+ - Hover: {changes}
78
+ - Active: {changes}
79
+ - Disabled: {changes}
80
+
81
+ [Repeat for each component in the design]
82
+
83
+ ### Responsive Specifications
84
+
85
+ **Mobile (320-640px)**:
86
+ - Layout: {description}
87
+ - Component adjustments: {what changes}
88
+ - Typography scaling: {changes}
89
+
90
+ **Tablet (641-1024px)**:
91
+ - Layout: {description}
92
+ - Component adjustments: {what changes}
93
+
94
+ **Desktop (1025px+)**:
95
+ - Layout: {description}
96
+ - Component adjustments: {what changes}
97
+
98
+ ### Assets
99
+ - Icons: {list icon names and sources}
100
+ - Images: {list image URLs or file references}
101
+
102
+ ---
103
+
104
+ ## 2. Theme Specification
105
+
106
+ > **Note**: This section is auto-generated by `/create-plan` theme selection. Include only if theme was selected (no design source provided).
107
+ > **Important**: Use EITHER "Design Specifications" OR "Theme Specification", not both. Any design source (Figma, screenshot, description) takes precedence over theme.
108
+
109
+ ### Selected Theme
110
+ - **Name**: {Theme Name}
111
+ - **Source**: .claude/themes/{filename}.theme.json
112
+ - **Personality**: {personality traits}
113
+
114
+ ### Color Palette
115
+
116
+ **Primary**:
117
+ - 50: #{hex} (lightest backgrounds, subtle highlights)
118
+ - 100: #{hex}
119
+ - 200: #{hex}
120
+ - 300: #{hex}
121
+ - 400: #{hex}
122
+ - 500: #{hex} (buttons, links, primary actions)
123
+ - 600: #{hex} (hover states)
124
+ - 700: #{hex} (active states)
125
+ - 800: #{hex}
126
+ - 900: #{hex} (darkest, high emphasis)
127
+
128
+ **Secondary** (if applicable):
129
+ - 500: #{hex} (secondary actions, supporting UI)
130
+ - 600: #{hex} (hover)
131
+ - 700: #{hex} (active)
132
+
133
+ **Accent**:
134
+ - 500: #{hex} (highlights, calls-to-action)
135
+ - 600: #{hex} (hover)
136
+
137
+ **Neutral**:
138
+ - 50: #{hex} (backgrounds, lightest)
139
+ - 100: #{hex}
140
+ - 200: #{hex} (subtle borders)
141
+ - 300: #{hex} (borders)
142
+ - 400: #{hex} (placeholders, disabled)
143
+ - 500: #{hex} (secondary text)
144
+ - 600: #{hex}
145
+ - 700: #{hex} (body text)
146
+ - 800: #{hex}
147
+ - 900: #{hex} (headings, darkest)
148
+
149
+ **Semantic**:
150
+ - Success: #{hex} (confirmations, positive actions)
151
+ - Warning: #{hex} (warnings, caution)
152
+ - Error: #{hex} (errors, destructive actions)
153
+ - Info: #{hex} (informational messages)
154
+
155
+ ### Typography
156
+
157
+ **Font Families**:
158
+ - Heading: {font-family} (with web-safe fallbacks)
159
+ - Body: {font-family} (with web-safe fallbacks)
160
+ - Mono: {font-family} (for code blocks)
161
+
162
+ **Type Scale**:
163
+ - xs: {size}px
164
+ - sm: {size}px
165
+ - base: {size}px (body text default)
166
+ - lg: {size}px
167
+ - xl: {size}px
168
+ - 2xl: {size}px
169
+ - 3xl: {size}px
170
+ - 4xl: {size}px
171
+ - 5xl: {size}px
172
+
173
+ **Font Weights**:
174
+ - normal: {weight}
175
+ - medium: {weight}
176
+ - semibold: {weight}
177
+ - bold: {weight}
178
+
179
+ **Line Heights**:
180
+ - tight: {value} (headings)
181
+ - normal: {value} (body)
182
+ - relaxed: {value} (long-form content)
183
+
184
+ ### Spacing Scale
185
+
186
+ **Scale**: {4, 8, 16, 24, 32, 48, 64}px (base-{4/8} system)
187
+
188
+ **Usage**:
189
+ - xs: {value}px (tight spacing, small gaps)
190
+ - sm: {value}px (component internal padding)
191
+ - md: {value}px (standard spacing between elements)
192
+ - lg: {value}px (section spacing)
193
+ - xl: {value}px (large gaps)
194
+ - 2xl: {value}px (very large spacing)
195
+
196
+ ### Visual Style
197
+
198
+ **Border Radius**:
199
+ - sm: {value}px (buttons, inputs)
200
+ - md: {value}px (cards)
201
+ - lg: {value}px (modals)
202
+ - xl: {value}px (large components)
203
+ - full: 9999px (pills, circular)
204
+
205
+ **Shadows**:
206
+ - sm: {shadow definition}
207
+ - md: {shadow definition}
208
+ - lg: {shadow definition}
209
+ - xl: {shadow definition}
210
+
211
+ **Usage Notes**:
212
+ - Apply colors from palette only (no arbitrary hex codes)
213
+ - Use spacing scale values only (no arbitrary margins/paddings)
214
+ - Follow typography scale (no font sizes outside scale)
215
+ - Semantic colors for their intended purpose only
216
+
217
+ ---
218
+
219
+ ## 3. Goal & Acceptance Criteria
6
220
 
7
221
  ### Goal
8
222
  - [Brief description: what problem this solves and why it matters]
@@ -12,7 +226,7 @@ Note: All content in this document must be written in English.
12
226
  - When [action or event occurs]
13
227
  - Then [expected result or outcome]
14
228
 
15
- ## 2. Risks & Assumptions
229
+ ## 4. Risks & Assumptions
16
230
 
17
231
  ### Risks
18
232
  - [Potential issues, blockers, or unknowns]
@@ -20,7 +234,7 @@ Note: All content in this document must be written in English.
20
234
  ### Assumptions
21
235
  - [What we assume is true for this plan to work]
22
236
 
23
- ## 3. Definition of Done
237
+ ## 5. Definition of Done
24
238
  - [ ] Build passes (linter, type checks, compile)
25
239
  - [ ] Tests added and passing
26
240
  - [ ] Code reviewed and approved
@@ -28,7 +242,7 @@ Note: All content in this document must be written in English.
28
242
 
29
243
  ---
30
244
 
31
- ## 4. Implementation Plan
245
+ ## 6. Implementation Plan
32
246
 
33
247
  ### Summary
34
248
  [Brief description of the solution approach in 1-3 sentences]
@@ -64,6 +278,6 @@ Notes:
64
278
  - Each phase groups related tasks; phases execute sequentially
65
279
  - Use only one phase for small features (≤ 5 tasks); use multiple phases for larger features
66
280
 
67
- ## 5. Follow-ups
281
+ ## 7. Follow-ups
68
282
  - [ ] [TODO item or deferred work]
69
283
  - [ ] [Future improvements]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-init",
3
- "version": "3.0.0",
3
+ "version": "3.2.2",
4
4
  "description": "Initialize AI workflow docs & commands into any repo with one command",
5
5
  "bin": {
6
6
  "ai-workflow-init": "./cli.js"