ai-workflow-init 1.2.0 → 1.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.
@@ -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
@@ -61,12 +61,38 @@ Generate two documents (with template preload):
61
61
  - Test placement and naming conventions
62
62
  - Config/secrets handling summary
63
63
 
64
- ## Step 4: Persist
65
- - Overwrite or create:
64
+ ## Step 4: Persist (Update-in-place, Non-destructive)
65
+ - Target files:
66
66
  - `docs/ai/project/CODE_CONVENTIONS.md`
67
67
  - `docs/ai/project/PROJECT_STRUCTURE.md`
68
68
  - Add header note: "This document is auto-generated from codebase analysis + brief Q&A. Edit manually as needed."
69
- - If template files exist, ensure the generated `CODE_CONVENTIONS.md` starts with their merged content in the preload order above, then append auto-discovered rules.
69
+ - Do NOT blindly overwrite entire files. Update only the managed blocks using markers:
70
+
71
+ ### Managed Block Markers
72
+ Use these exact markers to wrap generated content:
73
+ ```
74
+ <!-- GENERATED: CODE_CONVENTIONS:START -->
75
+ ... generated content ...
76
+ <!-- GENERATED: CODE_CONVENTIONS:END -->
77
+ ```
78
+ ```
79
+ <!-- GENERATED: PROJECT_STRUCTURE:START -->
80
+ ... generated content ...
81
+ <!-- GENERATED: PROJECT_STRUCTURE:END -->
82
+ ```
83
+
84
+ ### Update Rules
85
+ 1) If the target file exists and contains the corresponding markers, replace only the content between START/END with the newly generated content.
86
+ 2) If the file exists but does not contain markers, append a new managed block to the end of the file (preserve all existing manual content).
87
+ 3) If the file does not exist, create it with the header note and a single managed block.
88
+ 4) Never modify content outside the managed blocks.
89
+
90
+ ### Generated Content Order (for CODE_CONVENTIONS)
91
+ - Merge templates in preload order (when present):
92
+ 1) `docs/ai/project/template-convention/common.md`
93
+ 2) `docs/ai/project/template-convention/javascript.md` (when JS/TS repo)
94
+ 3) `docs/ai/project/template-convention/react.md` (when React is detected)
95
+ - After the merged templates, append auto-discovered rules from the codebase analysis.
70
96
 
71
97
  ## Step 5: Next Actions
72
98
  - Suggest running `code-review` to validate new standards are being followed
@@ -0,0 +1,30 @@
1
+ ## Goal
2
+ Initialize a new chat by loading and aligning to `AGENTS.md` so the AI agent consistently follows project rules (workflow, tooling, communication, language mirroring) from the first message.
3
+
4
+ ## What this command does
5
+ 1. Read `AGENTS.md` and extract the actionable rules.
6
+ 2. Summarize responsibilities and constraints the agent must follow in this session.
7
+ 3. Confirm language-mirroring: respond in the user's chat language; default to English if the user's language is unclear or ambiguous.
8
+ 4. Acknowledge the 4-phase workflow and TODO discipline for future commands.
9
+
10
+ ## Steps
11
+ 1) Open and read `AGENTS.md` (project root).
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:
15
+ - Workflow alignment: Plan → Implement → Test → Review
16
+ - Tooling strategy: semantic search first; parallelize independent steps
17
+ - Communication: minimal Markdown; status updates; high-signal summaries; mirror user language (default English if unclear)
18
+ - Code presentation: code references for existing code; fenced blocks for new code
19
+ - TODO policy: create/update todos; keep only one `in_progress`
20
+ 5) If any section is missing or unclear, ask a single concise clarification question; otherwise proceed silently in future commands.
21
+
22
+ ## Output format (concise)
23
+ - Use the language of the triggering user message (mirror). If ambiguous, use English.
24
+ - One short paragraph confirming alignment + a 4–6 bullet checklist of the above items.
25
+ - No code unless strictly needed.
26
+
27
+ ## Notes
28
+ - This command is idempotent—safe to re-run at the start of any chat.
29
+ - It does not modify files; it only sets expectations for subsequent commands.
30
+
package/AGENTS.md CHANGED
@@ -13,6 +13,7 @@
13
13
  ## Communication
14
14
  - Use Markdown only when necessary; use backticks for `files/dirs/functions/classes`.
15
15
  - Provide status updates before/after important actions; provide a high-signal summary at completion.
16
+ - Mirror the user's chat language in responses (respond in the user's language); default to English if the user's language is unclear or ambiguous.
16
17
 
17
18
  ## Code presentation
18
19
  - Existing code: cite using a code reference block with `startLine:endLine:filepath` (no language tag).
@@ -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
 
@@ -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.0",
3
+ "version": "1.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"