aico-cli 0.1.5 → 0.1.6

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.
Files changed (50) hide show
  1. package/dist/{shared/aico-cli.mxgSz9yk.mjs → chunks/simple-config.mjs} +2264 -2744
  2. package/dist/cli.mjs +177 -1000
  3. package/dist/index.d.mts +12 -42
  4. package/dist/index.d.ts +12 -42
  5. package/dist/index.mjs +56 -8
  6. package/package.json +1 -1
  7. package/templates/CLAUDE.md +1 -3
  8. package/templates/{zh-CN/workflow/common/agents → agents/aico/plan}/get-current-datetime.md +2 -2
  9. package/templates/{zh-CN/workflow/common/agents → agents/aico/plan}/init-architect.md +11 -8
  10. package/templates/agents/aico/requirement/aico-requirement-aligner.md +231 -0
  11. package/templates/agents/aico/requirement/aico-requirement-identifier.md +221 -0
  12. package/templates/agents/aico/requirement/aico-task-executor-validator.md +289 -0
  13. package/templates/agents/aico/requirement/aico-task-executor.md +328 -0
  14. package/templates/agents/aico/requirement/aico-task-splitter-validator.md +585 -0
  15. package/templates/base.md +51 -0
  16. package/templates/{zh-CN/workflow/common/commands → commands/aico}/init-project.md +1 -1
  17. package/templates/commands/aico/requirement.md +351 -0
  18. package/templates/commands/aico/workflow.md +229 -0
  19. package/templates/language.md +1 -0
  20. package/templates/personality.md +91 -0
  21. package/templates/settings.json +5 -3
  22. package/templates/en/memory/mcp.md +0 -6
  23. package/templates/en/memory/personality.md +0 -1
  24. package/templates/en/memory/rules.md +0 -45
  25. package/templates/en/memory/technical-guides.md +0 -97
  26. package/templates/en/workflow/bmad/commands/bmad-init.md +0 -103
  27. package/templates/en/workflow/common/agents/get-current-datetime.md +0 -29
  28. package/templates/en/workflow/common/agents/init-architect.md +0 -114
  29. package/templates/en/workflow/common/commands/init-project.md +0 -53
  30. package/templates/en/workflow/git/commands/git-cleanBranches.md +0 -101
  31. package/templates/en/workflow/git/commands/git-commit.md +0 -152
  32. package/templates/en/workflow/git/commands/git-rollback.md +0 -89
  33. package/templates/en/workflow/git/commands/git-worktree.md +0 -301
  34. package/templates/en/workflow/plan/agents/planner.md +0 -116
  35. package/templates/en/workflow/plan/agents/ui-ux-designer.md +0 -91
  36. package/templates/en/workflow/plan/commands/feat.md +0 -105
  37. package/templates/en/workflow/sixStep/commands/workflow.md +0 -230
  38. package/templates/zh-CN/memory/mcp.md +0 -34
  39. package/templates/zh-CN/memory/personality.md +0 -1
  40. package/templates/zh-CN/memory/rules.md +0 -45
  41. package/templates/zh-CN/memory/technical-guides.md +0 -126
  42. package/templates/zh-CN/workflow/bmad/commands/bmad-init.md +0 -109
  43. package/templates/zh-CN/workflow/git/commands/git-cleanBranches.md +0 -101
  44. package/templates/zh-CN/workflow/git/commands/git-commit.md +0 -162
  45. package/templates/zh-CN/workflow/git/commands/git-rollback.md +0 -90
  46. package/templates/zh-CN/workflow/git/commands/git-worktree.md +0 -225
  47. package/templates/zh-CN/workflow/plan/commands/feat.md +0 -105
  48. package/templates/zh-CN/workflow/sixStep/commands/workflow.md +0 -199
  49. /package/templates/{zh-CN/workflow/plan/agents → agents/aico/plan}/planner.md +0 -0
  50. /package/templates/{zh-CN/workflow/plan/agents → agents/aico/plan}/ui-ux-designer.md +0 -0
@@ -1,6 +0,0 @@
1
- ### Prioritize using MCP service
2
-
3
- - `Context7`: Query latest library documentation/examples
4
- - `DeepWiki`: Query related GitHub repository documentation/examples
5
- - `Exa`: Use Exa AI for web search - real-time web search, can capture specific URL content. Supports configurable result count and returns most relevant website content
6
- - `Playwright`: Direct browser control for browser-related operations
@@ -1 +0,0 @@
1
- You are an experienced [professional domain, e.g., Software Development Engineer / System Designer / Code Architect], specializing in building [core strengths, e.g., high-performance / maintainable / robust / domain-driven] solutions.
@@ -1,45 +0,0 @@
1
- Your mission is: **Review, understand, and iteratively improve/advance a [project type, e.g., existing codebase / software project / technical process].**
2
-
3
- Throughout the entire workflow, you must internalize and strictly adhere to the following core programming principles, ensuring that every output and recommendation reflects these concepts:
4
-
5
- - **Keep It Simple, Stupid (KISS):** Pursue ultimate simplicity and intuitiveness in code and design, avoiding unnecessary complexity.
6
- - **You Aren't Gonna Need It (YAGNI):** Implement only the functionality that is clearly needed now, resist over-engineering and unnecessary future feature reservations.
7
- - **SOLID Principles:**
8
- - **S (Single Responsibility Principle):** Each component, class, and function should have only one clear responsibility.
9
- - **O (Open/Closed Principle):** Software entities should be open for extension but closed for modification.
10
- - **L (Liskov Substitution Principle):** Subtypes must be substitutable for their base types seamlessly.
11
- - **I (Interface Segregation Principle):** Interfaces should be specific and focused, avoiding "fat interfaces."
12
- - **D (Dependency Inversion Principle):** Depend on abstractions, not concrete implementations.
13
- - **Don't Repeat Yourself (DRY):** Identify and eliminate repetitive patterns in code or logic to improve reusability.
14
- - **Documentation Sync:** Code changes must be synchronized with relevant documentation updates.
15
-
16
- **Please strictly follow the workflow and output requirements below:**
17
-
18
- 1. **Deep Understanding and Initial Analysis (Understanding Phase):**
19
-
20
- - Thoroughly review the provided [materials/code/project description], comprehensively understanding its current architecture, core components, business logic, and pain points.
21
- - Based on this understanding, preliminarily identify potential applications or violations of **KISS, YAGNI, DRY, SOLID** principles within the project.
22
-
23
- 2. **Clear Objectives and Iterative Planning (Planning Phase):**
24
-
25
- - Based on user requirements and understanding of the existing project, clearly define the specific task scope and measurable expected outcomes for this iteration.
26
- - When planning solutions, prioritize how to achieve simpler, more efficient, and more scalable improvements through applying the above principles, rather than blindly adding features.
27
-
28
- 3. **Step-by-Step Implementation and Specific Improvements (Execution Phase):**
29
-
30
- - Provide detailed explanations of your improvement proposals and break them down into logically clear, actionable steps.
31
- - For each step, specifically explain how you will operate and how these operations embody **KISS, YAGNI, DRY, SOLID** principles. For example:
32
- - "Split this module into smaller services to follow SRP and OCP."
33
- - "To avoid DRY violations, abstract the repetitive XXX logic into a common function."
34
- - "Simplified the user flow for Y feature, embodying the KISS principle."
35
- - "Removed Z redundant design, following the YAGNI principle."
36
- - Focus on specific implementation details for [project type, e.g., code quality optimization / architecture refactoring / feature enhancement / user experience improvement / performance tuning / maintainability improvement / bug fixes].
37
-
38
- 4. **Summary, Reflection, and Outlook (Reporting Phase):**
39
- - Check if documentation needs updating (README, CHANGELOG, API docs, etc.).
40
- - Provide a clear, structured summary report that includes **actual code/design change recommendations (if applicable)**.
41
- - The report must include:
42
- - **Core tasks completed in this iteration** and their specific outcomes.
43
- - **How you specifically applied** **KISS, YAGNI, DRY, SOLID** **principles in this iteration**, with brief explanations of the benefits they brought (e.g., reduced code volume, improved readability, enhanced extensibility).
44
- - **Challenges encountered** and how they were overcome.
45
- - **Clear plans and recommendations for next steps.**
@@ -1,97 +0,0 @@
1
- # Technical Execution Guidelines
2
-
3
- This document provides best practices for Claude Code when executing technical tasks.
4
-
5
- ## Dangerous Operations Confirmation
6
-
7
- **Important**: The following operations require explicit user confirmation before execution:
8
-
9
- ### Operations Requiring Confirmation
10
- - **File System**: Delete files/directories, bulk modifications, move system files
11
- - **Code Commits**: `git commit`, `git push`, `git reset --hard`
12
- - **System Config**: Modify environment variables, system settings, permissions
13
- - **Data Operations**: Database deletions, schema changes, bulk updates
14
- - **Network Requests**: Send sensitive data, call production APIs
15
- - **Package Management**: Global install/uninstall, update core dependencies
16
-
17
- ### Confirmation Process
18
- Before executing dangerous operations:
19
- 1. Clearly explain the operation and its impacts
20
- 2. Wait for explicit user confirmation (e.g., "yes", "confirm", "proceed")
21
- 3. If user hesitates or declines, provide more information or alternatives
22
-
23
- ## Command Execution Best Practices
24
-
25
- ### Path Handling Standards
26
-
27
- **Important**: Always use double quotes to wrap file paths when executing commands.
28
-
29
- ```bash
30
- # ✅ Correct
31
- cd "C:\Users\name\My Documents"
32
- node "/path/with spaces/app.js"
33
-
34
- # ❌ Incorrect
35
- cd C:\Users\name\My Documents
36
- ```
37
-
38
- ### Cross-Platform Compatibility
39
- - Prefer forward slashes `/` as path separators
40
- - When using backslashes, ensure paths are double-quoted
41
-
42
- ## Search Tool Usage
43
-
44
- ### Content Search
45
- **Always prioritize `rg` (ripgrep)** - faster and won't timeout.
46
-
47
- ```bash
48
- # ✅ Preferred
49
- rg "pattern" .
50
- rg -t js "console.log" .
51
-
52
- # ⚠️ Fallback
53
- grep -r "pattern" .
54
- ```
55
-
56
- > Note: If `rg` unavailable, remind user to install: `brew/scoop/apt install ripgrep`
57
-
58
- ### File Finding
59
- - Use Glob tool for pattern matching
60
- - Use LS tool for directory listings
61
- - Avoid using `find` command
62
-
63
- ## Tool Usage Principles
64
-
65
- 1. **Prefer Specialized Tools**: Use Read, Write, Edit instead of cat, echo
66
- 2. **Batch Operations**: Call multiple tools simultaneously for efficiency
67
- 3. **Error Handling**: Check path quoting first when commands fail
68
-
69
- ## Performance Optimization
70
-
71
- - Use Task tool for complex searches in large projects
72
- - Understand project structure before searching
73
- - Use file type filters wisely for efficiency
74
-
75
- ## Documentation Update Check
76
-
77
- Automatically check documentation update needs after task completion:
78
-
79
- ### Criteria
80
- - **New Features**: Update README, CHANGELOG, usage docs
81
- - **API Changes**: Update API docs, type definitions, interface specs
82
- - **Config Changes**: Update config guides, CLAUDE.md, env var docs
83
- - **Bug Fixes**: Usually no doc updates needed (unless usage affected)
84
-
85
- ### Process
86
- 1. Analyze code change type and impact scope
87
- 2. Auto-identify documentation files in project
88
- 3. List documents needing updates
89
- 4. Request user confirmation: `The following docs may need updates: [doc list]. Would you like me to update them?`
90
- 5. Update relevant docs after confirmation
91
-
92
- ### Common Document Types
93
- - **README.md**: Features, usage, configuration
94
- - **CHANGELOG.md**: Version history
95
- - **CLAUDE.md**: AI assistant config and instructions
96
- - **API Docs**: Interface definitions, parameters
97
- - **Config Docs**: Environment variables, settings
@@ -1,103 +0,0 @@
1
- # /bmad-init Command
2
-
3
- This command initializes BMad Method in your project.
4
-
5
- ## When this command is invoked:
6
-
7
- 1. Check if BMad is already installed by looking for `.bmad-core/install-manifest.yaml`
8
- 2. If installed, check version in manifest against latest version
9
- 3. If not installed or outdated, execute: `npx bmad-method@latest install -f -d . -i claude-code`
10
- 4. Display success message and prompt user to restart Claude Code
11
-
12
- ## Implementation
13
-
14
- ```javascript
15
- const fs = require('fs');
16
- const path = require('path');
17
- const { execSync } = require('child_process');
18
-
19
- async function initBmad() {
20
- // Check if already installed and get version
21
- const manifestPath = path.join(process.cwd(), '.bmad-core', 'install-manifest.yaml');
22
- let needsInstall = true;
23
- let currentVersion = null;
24
-
25
- if (fs.existsSync(manifestPath)) {
26
- try {
27
- // Simple version check - just check if file exists
28
- // Full YAML parsing would require js-yaml package
29
- const manifestContent = fs.readFileSync(manifestPath, 'utf8');
30
- const versionMatch = manifestContent.match(/version:\s*(.+)/);
31
- if (versionMatch) {
32
- currentVersion = versionMatch[1].trim();
33
- }
34
-
35
- // Get latest version from npm
36
- const latestVersion = execSync('npm view bmad-method version', { encoding: 'utf8' }).trim();
37
-
38
- if (currentVersion === latestVersion) {
39
- console.log(`✅ BMad Method is up to date (v${currentVersion})`);
40
- console.log('You can use BMad commands to begin your workflow');
41
- needsInstall = false;
42
- } else {
43
- console.log(`🔄 BMad Method update available: v${currentVersion} → v${latestVersion}`);
44
- }
45
- } catch (error) {
46
- console.log('⚠️ Could not verify BMad version, will reinstall');
47
- }
48
- }
49
-
50
- if (needsInstall === false) {
51
- return;
52
- }
53
-
54
- // Install BMad
55
- console.log('🚀 Installing BMad Method...');
56
- try {
57
- execSync('echo -e "1\\n" | npx bmad-method@latest install -f -d . -i claude-code', {
58
- stdio: 'inherit',
59
- cwd: process.cwd(),
60
- shell: true
61
- });
62
-
63
- console.log('✅ BMad Method installed successfully!');
64
- console.log('');
65
- console.log('═══════════════════════════════════════════════════════════════');
66
- console.log('📌 IMPORTANT: Please restart Claude Code to load BMad agents');
67
- console.log('═══════════════════════════════════════════════════════════════');
68
- console.log('');
69
- console.log('📂 Installation Details:');
70
- console.log(' • All agents and task commands are installed in:');
71
- console.log(' .claude/commands/BMad/');
72
- console.log('');
73
- console.log('🔧 Git Configuration (Optional):');
74
- console.log(' If you prefer not to commit BMad workflow files, add these to .gitignore:');
75
- console.log(' • .bmad-core');
76
- console.log(' • .claude/commands/BMad');
77
- console.log(' • docs/');
78
- console.log('');
79
- console.log('🚀 Getting Started:');
80
- console.log(' 1. Restart Claude Code');
81
- console.log(' 2. For first-time users, run:');
82
- console.log(' /BMad:agents:bmad-orchestrator *help');
83
- console.log(' This will start the BMad workflow guidance system');
84
- console.log('');
85
- console.log('💡 Tip: The BMad Orchestrator will help you choose the right workflow');
86
- console.log(' and guide you through the entire development process.');
87
-
88
- } catch (error) {
89
- console.error('❌ Failed to install BMad:', error.message);
90
- process.exit(1);
91
- }
92
- }
93
-
94
- // Execute
95
- initBmad();
96
- ```
97
-
98
- ## Notes
99
-
100
- - This command requires npm/npx to be available
101
- - The installation will download the latest BMad Method package
102
- - User must restart Claude Code after installation for agents to load properly
103
- - BMad Method includes its own built-in state tracking system
@@ -1,29 +0,0 @@
1
- ---
2
- name: get-current-datetime
3
- description: Execute date command and return ONLY the raw output. No formatting, headers, explanations, or parallel agents.
4
- tools: Bash, Read, Write
5
- color: cyan
6
- ---
7
-
8
- Execute `date` and return ONLY the command output.
9
-
10
- ```bash
11
- date
12
- ```
13
-
14
- DO NOT add any text, headers, formatting, or explanations.
15
- DO NOT add markdown formatting or code blocks.
16
- DO NOT add "Current date and time is:" or similar phrases.
17
- DO NOT use parallel agents.
18
-
19
- Just return the raw bash command output exactly as it appears.
20
-
21
- Example response: `Mon 28 Jul 2025 23:59:42 CST`
22
-
23
- Format options if requested:
24
-
25
- - Filename: Add `+"%Y-%m-%d_%H%M%S"`
26
- - Readable: Add `+"%Y-%m-%d %H:%M:%S %Z"`
27
- - ISO: Add `+"%Y-%m-%dT%H:%M:%S%z"`
28
-
29
- Use the get-current-datetime agent to get accurate timestamps instead of manually writing time information.
@@ -1,114 +0,0 @@
1
- ---
2
- name: init-architect
3
- description: Adaptive initialization: concise at root + detailed at module level; staged traversal with coverage reporting
4
- tools: Read, Write, Glob, Grep
5
- color: orange
6
- ---
7
-
8
- # Initialization Architect (Adaptive Version)
9
-
10
- > No exposed parameters; internal adaptive three levels: quick summary / module scanning / deep supplementation. Ensures incremental updates and resumable runs with coverage reporting and next-step recommendations.
11
-
12
- ## I. General Constraints
13
-
14
- - Do not modify source code; only generate/update documentation and `.claude/index.json`.
15
- - **Ignore Rules Retrieval Strategy**:
16
- 1. Prioritize reading the `.gitignore` file from the project root directory
17
- 2. If `.gitignore` does not exist, use the following default ignore rules: `node_modules/**,.git/**,.github/**,dist/**,build/**,.next/**,__pycache__/**,*.lock,*.log,*.bin,*.pdf,*.png,*.jpg,*.jpeg,*.gif,*.mp4,*.zip,*.tar,*.gz`
18
- 3. Merge ignore patterns from `.gitignore` with default rules
19
- - For large files/binaries, only record paths without reading content.
20
-
21
- ## II. Staged Strategy (Automatic Intensity Selection)
22
-
23
- 1. **Stage A: Repository Census (Lightweight)**
24
- - Use multiple `Glob` calls in batches to get file inventory (avoid single-call limits), doing:
25
- - File counting, language proportions, directory topology, module candidate discovery (package.json, pyproject.toml, go.mod, Cargo.toml, apps/_, packages/_, services/_, cmd/_, etc.).
26
- - Generate `Module Candidate List`, annotating each candidate module with: language, entry file guesses, test directory existence, config file existence.
27
- 2. **Stage B: Module Priority Scanning (Medium)**
28
- - For each module, try reading in the following order (batched, paginated):
29
- - Entry and startup: `main.ts`/`index.ts`/`cmd/*/main.go`/`app.py`/`src/main.rs`, etc.
30
- - External interfaces: routes, controllers, API definitions, proto/openapi
31
- - Dependencies and scripts: `package.json scripts`, `pyproject.toml`, `go.mod`, `Cargo.toml`, config directories
32
- - Data layer: `schema.sql`, `prisma/schema.prisma`, ORM models, migration directories
33
- - Testing: `tests/**`, `__tests__/**`, `*_test.go`, `*.spec.ts`, etc.
34
- - Quality tools: `eslint/ruff/golangci` configurations
35
- - Form "module snapshots", extracting only high-signal fragments and paths, not pasting large code blocks.
36
- 3. **Stage C: Deep Supplementation (Triggered As Needed)**
37
- - Trigger conditions (any one suffices):
38
- - Repository overall small (fewer files) or single module small file count;
39
- - After Stage B, still cannot determine key interfaces/data models/testing strategies;
40
- - Root or module `CLAUDE.md` missing information items.
41
- - Action: **Additional paginated reading** for target directories, filling gaps.
42
-
43
- > Note: If pagination/attempts reach tool or time limits, must **write partial results early** and explain in summary "why stopped here" and "next-step recommended directory list".
44
-
45
- ## III. Artifacts and Incremental Updates
46
-
47
- 1. **Write Root-level `CLAUDE.md`**
48
- - If exists, insert/update `Change Log (Changelog)` at the top.
49
- - Root structure (concise yet global):
50
- - Project Vision
51
- - Architecture Overview
52
- - **✨ New: Module Structure Diagram (Mermaid)**
53
- - Above the "Module Index" table, generate a Mermaid `graph TD` tree diagram based on identified module paths.
54
- - Each node should be clickable and link to the corresponding module's `CLAUDE.md` file.
55
- - Example syntax:
56
-
57
- ```mermaid
58
- graph TD
59
- A["(Root) My Project"] --> B["packages"];
60
- B --> C["auth"];
61
- B --> D["ui-library"];
62
- A --> E["services"];
63
- E --> F["audit-log"];
64
-
65
- click C "./packages/auth/CLAUDE.md" "View auth module docs"
66
- click D "./packages/ui-library/CLAUDE.md" "View ui-library module docs"
67
- click F "./services/audit-log/CLAUDE.md" "View audit-log module docs"
68
- ```
69
-
70
- - Module Index (table format)
71
- - Running and Development
72
- - Testing Strategy
73
- - Coding Standards
74
- - AI Usage Guidelines
75
- - Change Log (Changelog)
76
-
77
- 2. **Write Module-level `CLAUDE.md`**
78
- - Place in each module directory, suggested structure:
79
- - **✨ New: Relative Path Breadcrumbs**
80
- - At the **top** of each module `CLAUDE.md`, insert a relative path breadcrumb line linking to parent directories and root `CLAUDE.md`.
81
- - Example (located at `packages/auth/CLAUDE.md`):
82
- `[Root Directory](../../CLAUDE.md) > [packages](../) > **auth**`
83
- - Module Responsibilities
84
- - Entry and Startup
85
- - External Interfaces
86
- - Key Dependencies and Configuration
87
- - Data Models
88
- - Testing and Quality
89
- - Frequently Asked Questions (FAQ)
90
- - Related File List
91
- - Change Log (Changelog)
92
- 3. **`.claude/index.json`**
93
- - Record: current timestamp (provided via parameters), root/module lists, entry/interface/test/important paths for each module, **scan coverage**, ignore statistics, whether truncated due to limits (`truncated: true`).
94
-
95
- ## IV. Coverage and Resumability
96
-
97
- - Calculate and print each run:
98
- - Estimated total files, scanned file count, coverage percentage;
99
- - Coverage summary and gaps for each module (missing interfaces, tests, data models, etc.);
100
- - Top ignored/skipped directories and reasons (ignore rules/large files/time or call limits).
101
- - Write "gap list" to `index.json`, prioritize filling gaps on next run (**breakpoint resumable scanning**).
102
-
103
- ## V. Result Summary (Print to Main Dialog)
104
-
105
- - Root/module `CLAUDE.md` creation or update status;
106
- - Module list (path + one-sentence responsibility);
107
- - Coverage and major gaps;
108
- - If not fully read: explain "why stopped here" and list **recommended next steps** (e.g., "suggest priority supplemental scanning: packages/auth/src/controllers, services/audit/migrations").
109
-
110
- ## VI. Time Format and Usage
111
-
112
- - Use relative paths;
113
- - Time information: Use the timestamp provided via command parameters and write in ISO-8601 format in `index.json`.
114
- - Do not manually write time information; use the provided timestamp parameter to ensure time accuracy.
@@ -1,53 +0,0 @@
1
- ---
2
- description: Initialize project AI context, generate/update root-level and module-level CLAUDE.md indexes
3
- allowed-tools: Read(**), Write(CLAUDE.md, **/CLAUDE.md)
4
- argument-hint: <PROJECT_SUMMARY_OR_NAME>
5
- ---
6
-
7
- ## Usage
8
-
9
- `/init-project <PROJECT_SUMMARY_OR_NAME>`
10
-
11
- ## Objective
12
-
13
- Initialize project AI context using a mixed strategy of "concise at root + detailed at module level":
14
-
15
- - Generate/update `CLAUDE.md` at repository root (high-level vision, architecture overview, module index, global standards).
16
- - Generate/update local `CLAUDE.md` in identified module directories (interfaces, dependencies, entry points, tests, key files, etc.).
17
- - ✨ **For improved readability, automatically generate Mermaid structure diagrams in the root `CLAUDE.md` and add navigation breadcrumbs to each module `CLAUDE.md`**.
18
-
19
- ## Orchestration Instructions
20
-
21
- **Step 1**: Call the `get-current-datetime` sub-agent to obtain the current timestamp.
22
-
23
- **Step 2**: Call the `init-architect` sub-agent once, with input:
24
-
25
- - `project_summary`: $ARGUMENTS
26
- - `current_timestamp`: (timestamp from step 1)
27
-
28
- ## Execution Strategy (Agent adapts automatically, no user parameters needed)
29
-
30
- - **Stage A: Repository Census (Lightweight)**
31
- Quickly count files and directories, identify module roots (package.json, pyproject.toml, go.mod, apps/_, packages/_, services/\*, etc.).
32
- - **Stage B: Module Priority Scanning (Medium)**
33
- For each module, perform targeted reading and sampling of "entry/interfaces/dependencies/tests/data models/quality tools".
34
- - **Stage C: Deep Supplementation (As Needed)**
35
- If repository is small or module scale is small, expand reading scope; if large, perform batch supplemental scanning on high-risk/high-value paths.
36
- - **Coverage Measurement and Resumability**
37
- Output "scanned files / estimated total files, covered module ratio, ignored/skipped reasons" and list "recommended next-step deep-dive sub-paths". When running `/init-project` repeatedly, perform **incremental updates** and **breakpoint resumable scanning** based on previous index.
38
-
39
- ## Security and Boundaries
40
-
41
- - Only read/write documentation and indexes, do not modify source code.
42
- - Ignore common generated artifacts and binary large files by default.
43
- - Print "summary" in main dialog, write full content to repository.
44
-
45
- ## Output Requirements
46
-
47
- - Print "Initialization Result Summary" in main dialog, including:
48
- - Whether root-level `CLAUDE.md` was created/updated, major section overview.
49
- - Number of identified modules and their path list.
50
- - Generation/update status of each module's `CLAUDE.md`.
51
- - ✨ **Explicitly mention "Generated Mermaid structure diagram" and "Added navigation breadcrumbs for N modules"**.
52
- - Coverage and major gaps.
53
- - If not fully read: explain "why stopped here" and list **recommended next steps** (e.g., "suggest priority supplemental scanning: packages/auth/src/controllers").
@@ -1,101 +0,0 @@
1
- ---
2
- description: Safely find and clean up merged or stale Git branches with dry-run mode and custom base/protected branches support
3
- allowed-tools: Read(**), Exec(git fetch, git config, git branch, git remote, git push, git for-each-ref, git log), Write()
4
- argument-hint: [--base <branch>] [--stale <days>] [--remote] [--force] [--dry-run] [--yes]
5
- # examples:
6
- # - /git-cleanBranches --dry-run
7
- # - /git-cleanBranches --base release/v2.1 --stale 90
8
- # - /git-cleanBranches --remote --yes
9
- ---
10
-
11
- # Claude Command: Clean Branches
12
-
13
- This command **safely** identifies and cleans up **merged** or **stale** Git branches.
14
- Runs in **read-only preview (`--dry-run`)** mode by default, requiring explicit instructions to perform deletions.
15
-
16
- ---
17
-
18
- ## Usage
19
-
20
- ```bash
21
- # [Safest] Preview branches to be cleaned without executing any deletions
22
- /git-cleanBranches --dry-run
23
-
24
- # Clean local branches merged to main and inactive for over 90 days (requires individual confirmation)
25
- /git-cleanBranches --stale 90
26
-
27
- # Clean local and remote branches merged to release/v2.1 (auto-confirm)
28
- /git-cleanBranches --base release/v2.1 --remote --yes
29
-
30
- # [Dangerous] Force delete an unmerged local branch
31
- /git-cleanBranches --force outdated-feature
32
- ```
33
-
34
- ### Options
35
- - `--base <branch>`: Specify the base branch for cleanup (defaults to repository's `main`/`master`).
36
- - `--stale <days>`: Clean branches with no commits for specified days (disabled by default).
37
- - `--remote`: Also clean remote merged/stale branches.
38
- - `--dry-run`: **Default behavior**. Only list branches to be deleted without executing any operations.
39
- - `--yes`: Skip individual confirmations and delete all identified branches directly (suitable for CI/CD).
40
- - `--force`: Use `-D` to force delete local branches (even if unmerged).
41
-
42
- ---
43
-
44
- ## What This Command Does
45
-
46
- 1. **Configuration and Safety Checks**
47
- - **Update Information**: Automatically executes `git fetch --all --prune` to ensure branch status is current.
48
- - **Read Protected Branches**: Reads the list of branches that should not be cleaned from Git config (see "Configuration" below).
49
- - **Determine Base**: Uses `--base` parameter or auto-detected `main`/`master` as comparison baseline.
50
-
51
- 2. **Analysis and Identification (Find)**
52
- - **Merged Branches**: Find local (and remote if `--remote` is added) branches fully merged to `--base`.
53
- - **Stale Branches**: If `--stale <days>` is specified, find branches with last commit N days ago.
54
- - **Exclude Protected Branches**: Remove all configured protected branches from cleanup list.
55
-
56
- 3. **Report and Preview (Report)**
57
- - Clearly list "merged branches to be deleted" and "stale branches to be deleted".
58
- - Without `--yes` parameter, **command ends here**, waiting for user confirmation to re-execute (without `--dry-run`).
59
-
60
- 4. **Execute Cleanup (Execute)**
61
- - **Only executed without `--dry-run` and after user confirmation** (or with `--yes`).
62
- - Delete identified branches one by one, unless user chooses to skip in interactive confirmation.
63
- - Local: `git branch -d <branch>`; Remote: `git push origin --delete <branch>`.
64
- - If `--force` is specified, local deletion uses `git branch -D <branch>`.
65
-
66
- ---
67
-
68
- ## Configuration (Configure Once, Use Forever)
69
-
70
- To prevent accidental deletion of important branches (e.g., `develop`, `release/*`), add protection rules to the repository's Git config. The command reads them automatically.
71
-
72
- ```bash
73
- # Protect develop branch
74
- git config --add branch.cleanup.protected develop
75
-
76
- # Protect all branches starting with release/ (wildcard)
77
- git config --add branch.cleanup.protected 'release/*'
78
-
79
- # View all configured protected branches
80
- git config --get-all branch.cleanup.protected
81
- ```
82
-
83
- ---
84
-
85
- ## Best Practices for Embedded Devs
86
-
87
- - **Prioritize `--dry-run`**: Develop the habit of previewing before executing.
88
- - **Leverage `--base`**: When maintaining long-term `release` branches, use it to clean `feature` or `hotfix` branches merged to that release.
89
- - **Careful with `--force`**: Don't force delete unless you're 100% certain an unmerged branch is useless.
90
- - **Team Collaboration**: Notify the team channel before cleaning shared remote branches.
91
- - **Regular Runs**: Run monthly or quarterly to keep the repository clean.
92
-
93
- ---
94
-
95
- ## Why This Version Is Better
96
-
97
- - ✅ **Safer**: Default read-only preview with configurable protected branch list.
98
- - ✅ **More Flexible**: Supports custom base branches, perfectly fits `release` / `develop` workflows.
99
- - ✅ **More Compatible**: Avoids commands with inconsistent behavior across systems like `date -d`.
100
- - ✅ **More Intuitive**: Condenses complex 16-step checklist into a single command with safety options.
101
- - ✅ **Consistent Style**: Shares similar parameter design and documentation structure with `/commit` command.