ai-workflow-init 1.2.1 → 1.2.3

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.
@@ -54,7 +54,13 @@ If creating implementation doc for first task:
54
54
  - `## Follow-ups` - TODOs or deferred work
55
55
  - Follow the template format strictly
56
56
 
57
- ## Step 5: Next Actions
57
+ ## Step 5: Quality Checks
58
+ After completing Step 4 for each task batch:
59
+ - Run linting on changed files (e.g., `eslint` if JavaScript/TypeScript project).
60
+ - Run type checks if applicable (e.g., `tsc --noEmit`).
61
+ - Fix issues (up to 3 attempts) before proceeding to the next task.
62
+
63
+ ## Step 6: Next Actions
58
64
  After completing tasks:
59
65
  - Suggest running `code-review` to verify against standards
60
66
  - Suggest running `writing-test` if edge cases need coverage
@@ -90,8 +90,9 @@ Use these exact markers to wrap generated content:
90
90
  ### Generated Content Order (for CODE_CONVENTIONS)
91
91
  - Merge templates in preload order (when present):
92
92
  1) `docs/ai/project/template-convention/common.md`
93
- 2) `docs/ai/project/template-convention/javascript.md` (when JS/TS repo)
93
+ 2) `docs/ai/project/template-convention/javascript.md` (when JS/TS detected)
94
94
  3) `docs/ai/project/template-convention/react.md` (when React is detected)
95
+ 4) `docs/ai/project/template-convention/typescript.md.md` (when TS is detected)
95
96
  - After the merged templates, append auto-discovered rules from the codebase analysis.
96
97
 
97
98
  ## Step 5: Next Actions
@@ -9,13 +9,15 @@ Initialize a new chat by loading and aligning to `AGENTS.md` so the AI agent con
9
9
 
10
10
  ## Steps
11
11
  1) Open and read `AGENTS.md` (project root).
12
- 2) Produce a short confirmation in the chat including:
12
+ 2) Detect project languages/frameworks/libraries from repository metadata (e.g., `package.json`, `pyproject.toml`, lockfiles, config files). Update `docs/ai/project/CODE_CONVENTIONS.md` to include any missing key coding conventions (only important items like React, TypeScript, TailwindCSS, etc.).
13
+ 3) Read files in `docs/ai/project/` to understand project context and standards.
14
+ 4) Produce a short confirmation in the chat including:
13
15
  - Workflow alignment: Plan → Implement → Test → Review
14
16
  - Tooling strategy: semantic search first; parallelize independent steps
15
17
  - Communication: minimal Markdown; status updates; high-signal summaries; mirror user language (default English if unclear)
16
18
  - Code presentation: code references for existing code; fenced blocks for new code
17
19
  - TODO policy: create/update todos; keep only one `in_progress`
18
- 3) If any section is missing or unclear, ask a single concise clarification question; otherwise proceed silently in future commands.
20
+ 5) If any section is missing or unclear, ask a single concise clarification question; otherwise proceed silently in future commands.
19
21
 
20
22
  ## Output format (concise)
21
23
  - Use the language of the triggering user message (mirror). If ambiguous, use English.
@@ -1,5 +1,7 @@
1
1
  # Implementation Notes: {Feature Name}
2
2
 
3
+ Note: All content in this document must be written in English.
4
+
3
5
  ## Summary
4
6
  - Short description of the solution approach
5
7
 
@@ -1,5 +1,7 @@
1
1
  # Plan: {Feature Name}
2
2
 
3
+ Note: All content in this document must be written in English.
4
+
3
5
  ## Goal
4
6
  - Objectives, scope, acceptance criteria (Given-When-Then)
5
7
 
@@ -2,40 +2,60 @@
2
2
 
3
3
  > These rules are preloaded by the standards generator before analyzing the codebase. They establish non-negotiable, high-signal conventions. The generator should merge these rules first, then append auto-discovered patterns.
4
4
 
5
+ ## Principles — The "Why"
6
+ - DRY (Don't Repeat Yourself): Avoid duplicating code. Abstract common logic into reusable functions, classes, or modules.
7
+ - KISS (Keep It Simple, Stupid): Prefer simple, straightforward solutions over clever or unnecessarily complex ones. Code should be as simple as possible, but no simpler.
8
+ - YAGNI (You Ain't Gonna Need It): Do not add functionality or create abstractions until they are actually needed. Avoid premature optimization.
9
+
5
10
  ## Naming — Clarity & Descriptiveness
6
11
  - Prefer meaningful, verbose names over abbreviations.
7
- - Avoid 1–2 character identifiers (except conventional counters in very small scopes).
12
+ - Avoid 1–2 character identifiers (except conventional counters like `i`, `j`, `k` in very small loop scopes).
13
+ - Be consistent. If you use `getUser` in one place, use `getProduct` in another, not `fetchProduct`.
14
+ - Function names should be verbs; variables and classes should be nouns. (e.g., `calculateTotal()`, `const user`, `class Order`).
15
+
16
+ ## Functions / Methods
17
+ - Single Responsibility Principle: A function should do one thing and do it well. If you can't describe what a function does in one simple sentence, it's likely doing too much.
18
+ - Limit Arguments: Prefer 0-2 arguments per function. If you need more than two, consider passing a single configuration object.
19
+ - Avoid Side Effects: Functions should be predictable. They should avoid modifying external state, global variables, or their own input arguments whenever possible. A function `calculateTotal(items)` should return a new value, not modify the original `items` array.
8
20
 
9
21
  ## Control Flow
10
22
  - Prefer guard clauses (early returns) to reduce nesting depth.
11
23
  - Handle errors and edge cases first.
12
- - Avoid deep nesting beyond 2–3 levels.
24
+ - Avoid deep nesting beyond 2–3 levels. Refactor deeply nested logic into smaller, well-named functions.
25
+
26
+ ## Variables & Data Structures
27
+ - Minimize Scope: Declare variables in the smallest possible scope (e.g., inside a loop or conditional block if they are only used there).
28
+ - Avoid Magic Values: Do not use "magic" strings or numbers directly in code. Define them as named constants to provide context and avoid typos.
29
+ - *Bad:* `if (status === 2) { ... }`
30
+ - *Good:* `const STATUS_APPROVED = 2; if (status === STATUS_APPROVED) { ... }`
31
+ - Prefer Immutability:** Do not reassign variables or mutate data structures if it can be avoided. Creating new data structures instead of changing existing ones leads to more predictable code.
13
32
 
14
33
  ## Error Handling
15
34
  - Throw errors with clear, actionable messages.
16
- - Do not catch errors without meaningful handling.
35
+ - Do not catch errors without meaningful handling (e.g., logging, retrying, or re-throwing a more specific error). Swallowing exceptions silently is a major source of bugs.
17
36
 
18
37
  ## Comments
19
- - Add comments only for complex or non-obvious logic; explain "why", not "how".
38
+ - Add comments only for complex or non-obvious logic; explain **"why"**, not **"how"**. Well-written code should explain the "how" by itself.
20
39
  - Place comments above code blocks or use language-specific docstrings.
21
- - Avoid trailing inline comments.
40
+ - Avoid trailing inline comments as they can clutter code.
41
+ - Remove Dead Code: Do not leave commented-out code in the codebase. Source control (like Git) is the history.
22
42
 
23
43
  ## Formatting
24
- - Match existing repository formatting tools and styles.
25
- - Prefer multi-line over long one-liners or complex ternaries.
26
- - Wrap long lines and do not reformat unrelated code.
44
+ - Match existing repository formatting tools and styles (e.g., Prettier, Black, gofmt). Consistency is key.
45
+ - Prefer multi-line over long one-liners or complex ternaries for readability.
46
+ - Wrap long lines and do not reformat unrelated code in a change that is focused on logic.
27
47
 
28
48
  ## Types (for statically typed languages)
29
49
  - Explicitly annotate public APIs and function signatures.
30
- - Avoid unsafe casts or overly broad types (e.g., `any`).
50
+ - Avoid unsafe casts or overly broad types (e.g., `any`, `Object`). Be as specific as possible.
31
51
 
32
52
  ## Change Discipline
33
53
  - Perform changes via file editing tools; avoid pasting large code blobs in reviews.
34
54
  - Re-read target files before editing to ensure accurate context.
35
55
  - After edits, run only fast, non-interactive validation on changed files:
36
- - If ESLint is configured, run ESLint on changed paths (e.g., `eslint --max-warnings=0 <changed-paths>`). Use `--fix` when safe to auto-fix.
37
- - If TypeScript is used, run type-check only (e.g., `tsc --noEmit` or `tsc -p . --noEmit`).
56
+ - If a linter is configured, run it on changed paths (e.g., `eslint --max-warnings=0 <changed-paths>`). Use `--fix` when safe to auto-fix.
57
+ - If a type checker is used, run type-check only (e.g., `tsc --noEmit` or `mypy <changed-paths>`).
38
58
  - Do NOT run Prettier as part of validation (formatting is enforced separately by tooling/CI).
39
- - Do NOT run full build or dev server (to avoid unnecessary time cost).
59
+ - Do NOT run a full build or dev server (to avoid unnecessary time cost).
40
60
  - Attempt auto-fixes up to 3 times for linter issues before requesting help.
41
61
 
@@ -6,17 +6,23 @@
6
6
  - Use strict equality `===`/`!==`.
7
7
  - Prefer optional chaining `?.` and nullish coalescing `??` over `||` when `0/''/false` are valid values.
8
8
 
9
+ ## Syntax & Readability
10
+ - Use destructuring to access properties from objects and arrays.
11
+ - Use the spread syntax (`...`) for creating shallow copies of arrays and objects.
12
+ - Prefer array methods (`.map`, `.filter`, `.reduce`) over `for` loops for data transformation.
13
+ - Use `for...of` for simple iterations over iterables.
14
+
9
15
  ## Functions & Data
10
16
  - Keep functions small and single-purpose.
17
+ - Use arrow functions (`=>`) for callbacks and to preserve `this` context.
11
18
  - Avoid mutations; prefer immutable updates for objects/arrays.
12
19
  - Return early (guard clauses) to reduce nesting.
13
20
 
14
21
  ## Errors & Async
15
22
  - Use `async/await`; avoid unhandled promises (no floating promises).
16
- - Throw Errors with clear messages; catch only to handle meaningfully.
23
+ - Throw `Error` objects with clear messages; catch only to handle meaningfully.
17
24
 
18
25
  ## Style & Safety
19
26
  - Avoid implicit globals; module scope only.
20
27
  - Prefer explicit returns over side effects.
21
- - Keep imports minimal and ordered (std/third-party/internal).
22
-
28
+ - Keep imports minimal and ordered (std/third-party/internal).
@@ -0,0 +1,25 @@
1
+ # TypeScript Conventions (Essential)
2
+
3
+ ## Types & Interfaces
4
+ - Use `interface` for public APIs and object shapes, as they are easily extended.
5
+ - Use `type` for unions (`|`), intersections (`&`), tuples, or complex type aliases.
6
+
7
+ ## Naming Conventions
8
+ - Use `PascalCase` for all type-level identifiers (Types, Interfaces, Classes, Enums, Generics).
9
+ - Use `camelCase` for all value-level identifiers (variables, functions, properties).
10
+ - Avoid the `I` prefix for interfaces (e.g., `User`, not `IUser`).
11
+ - Use the `private` keyword instead of an underscore (`_`) prefix for private members.
12
+
13
+ ## Type Safety
14
+ - Avoid `any`. It disables type-checking and defeats the purpose of TypeScript.
15
+ - Prefer `unknown` over `any`. It is a type-safe alternative that forces type-checking before use.
16
+ - Use `readonly` for properties that should not be mutated after initialization to enforce immutability.
17
+ - Explicitly type all public function signatures to ensure a clear and stable API.
18
+
19
+ ## Modules & Organization
20
+ - Always use ES Modules (`import`/`export`).
21
+ - Prefer named exports over `default` exports. They improve consistency and refactorability.
22
+ - Avoid `namespace`. ES Modules provide superior encapsulation and are the language standard.
23
+
24
+ ## Documentation
25
+ - Use JSDoc (`/** ... */`) for all exported members (functions, classes, types). This provides context and enables rich editor tooltips.
@@ -1,5 +1,7 @@
1
1
  # Test Plan: {Feature Name}
2
2
 
3
+ Note: All content in this document must be written in English.
4
+
3
5
  ## Test Files Created
4
6
  - `path/to/test-file.spec.js` - Tests for [component/function]
5
7
  - `path/to/another-test.spec.js` - Tests for [component/function]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-init",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Initialize AI workflow docs & commands into any repo with one command",
5
5
  "bin": {
6
6
  "ai-workflow-init": "./cli.js"