aemeathcli 1.0.11 → 1.1.0
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/LICENSE +21 -21
- package/README.md +620 -609
- package/dist/{App-YAHJUWCX.js → App-NT6MRKQJ.js} +675 -169
- package/dist/App-NT6MRKQJ.js.map +1 -0
- package/dist/agent-store/architect.md +32 -32
- package/dist/agent-store/debugger.md +32 -32
- package/dist/agent-store/developer.md +29 -29
- package/dist/agent-store/documenter.md +30 -30
- package/dist/agent-store/researcher.md +31 -31
- package/dist/agent-store/reviewer.md +28 -28
- package/dist/agent-store/supervisor.md +37 -37
- package/dist/agent-store/tester.md +30 -30
- package/dist/api-key-fallback-RJLPM3KH.js +11 -0
- package/dist/{api-key-fallback-UN3TJEOO.js.map → api-key-fallback-RJLPM3KH.js.map} +1 -1
- package/dist/auth-status-JQJOKUPF.js +13 -0
- package/dist/{auth-status-EIM5A5KL.js.map → auth-status-JQJOKUPF.js.map} +1 -1
- package/dist/{chunk-P66WDACW.js → chunk-2KMA5RBC.js} +18 -42
- package/dist/chunk-2KMA5RBC.js.map +1 -0
- package/dist/{chunk-2GKOK6T7.js → chunk-2Y7TR6BS.js} +2 -2
- package/dist/chunk-2Y7TR6BS.js.map +1 -0
- package/dist/{chunk-ONQ4WCUI.js → chunk-2ZYK5IJG.js} +6 -6
- package/dist/chunk-2ZYK5IJG.js.map +1 -0
- package/dist/{chunk-OCJPQFOR.js → chunk-36RXCZOV.js} +4 -4
- package/dist/chunk-36RXCZOV.js.map +1 -0
- package/dist/{chunk-H2SYKIMI.js → chunk-7EBLXPL4.js} +10 -10
- package/dist/chunk-7EBLXPL4.js.map +1 -0
- package/dist/{chunk-IARA5XYP.js → chunk-BIMQL4AG.js} +4 -4
- package/dist/chunk-BIMQL4AG.js.map +1 -0
- package/dist/{chunk-BY4DAKUU.js → chunk-D275MCIH.js} +2 -2
- package/dist/chunk-D275MCIH.js.map +1 -0
- package/dist/{chunk-SOQFMNQC.js → chunk-FFS4T7BZ.js} +5 -5
- package/dist/chunk-FFS4T7BZ.js.map +1 -0
- package/dist/{chunk-LDVY5ELP.js → chunk-GXAJGP2T.js} +5 -5
- package/dist/chunk-GXAJGP2T.js.map +1 -0
- package/dist/{chunk-62HSGYQD.js → chunk-HCIHOHLX.js} +2 -2
- package/dist/chunk-HCIHOHLX.js.map +1 -0
- package/dist/{chunk-6GUD7QIM.js → chunk-HESQLCLU.js} +4 -4
- package/dist/chunk-HESQLCLU.js.map +1 -0
- package/dist/{chunk-HEKFAKVH.js → chunk-IR5HLBMH.js} +2 -2
- package/dist/chunk-IR5HLBMH.js.map +1 -0
- package/dist/{chunk-2LF7ALGR.js → chunk-K2FCMRXH.js} +4 -4
- package/dist/chunk-K2FCMRXH.js.map +1 -0
- package/dist/{chunk-2NWNIKBK.js → chunk-KIC7UI5U.js} +4 -4
- package/dist/chunk-KIC7UI5U.js.map +1 -0
- package/dist/{chunk-YPFOE2QJ.js → chunk-KMOAJRDE.js} +5 -5
- package/dist/chunk-KMOAJRDE.js.map +1 -0
- package/dist/{chunk-RP2TAL3J.js → chunk-LQBALETG.js} +2 -2
- package/dist/chunk-LQBALETG.js.map +1 -0
- package/dist/{chunk-CC7MGWYY.js → chunk-M3FPQSRU.js} +2 -2
- package/dist/chunk-M3FPQSRU.js.map +1 -0
- package/dist/{chunk-3TSPZRGM.js → chunk-NQEUK763.js} +3 -3
- package/dist/chunk-NQEUK763.js.map +1 -0
- package/dist/{chunk-VBLLDY4R.js → chunk-OPWAFS6Y.js} +2 -2
- package/dist/chunk-OPWAFS6Y.js.map +1 -0
- package/dist/{chunk-RYOB3TLZ.js → chunk-PS4WEFW6.js} +6 -6
- package/dist/chunk-PS4WEFW6.js.map +1 -0
- package/dist/{chunk-LCYH4T6N.js → chunk-QK7TKNHV.js} +6 -6
- package/dist/chunk-QK7TKNHV.js.map +1 -0
- package/dist/{chunk-QCRK4QEL.js → chunk-RADJSEG5.js} +3 -3
- package/dist/chunk-RADJSEG5.js.map +1 -0
- package/dist/{chunk-AQ23TYSQ.js → chunk-SNWPI6XJ.js} +4 -4
- package/dist/chunk-SNWPI6XJ.js.map +1 -0
- package/dist/{chunk-TDFTX32B.js → chunk-UM7MSLOV.js} +4 -4
- package/dist/chunk-UM7MSLOV.js.map +1 -0
- package/dist/{chunk-FIC7AK4Q.js → chunk-VNZ3YTQD.js} +5 -5
- package/dist/chunk-VNZ3YTQD.js.map +1 -0
- package/dist/{chunk-5XFSV6PF.js → chunk-WXIN65UG.js} +6 -6
- package/dist/chunk-WXIN65UG.js.map +1 -0
- package/dist/{chunk-WC72BRHR.js → chunk-XEXWX7C7.js} +3 -3
- package/dist/chunk-XEXWX7C7.js.map +1 -0
- package/dist/{chunk-VJNQJALF.js → chunk-YCCYXDW7.js} +4 -4
- package/dist/chunk-YCCYXDW7.js.map +1 -0
- package/dist/{chunk-ROJPFPJ7.js → chunk-YL5XFHR3.js} +2 -2
- package/dist/chunk-YL5XFHR3.js.map +1 -0
- package/dist/{chunk-GU33WKPG.js → chunk-YPQ2MLAV.js} +5 -5
- package/dist/chunk-YPQ2MLAV.js.map +1 -0
- package/dist/{chunk-WAYSJMPS.js → chunk-ZCOVMVK4.js} +2 -2
- package/dist/chunk-ZCOVMVK4.js.map +1 -0
- package/dist/{chunk-473JN6M5.js → chunk-ZGOHARPV.js} +2 -2
- package/dist/chunk-ZGOHARPV.js.map +1 -0
- package/dist/{claude-login-IS5WTBMP.js → claude-login-AIFIWTYF.js} +10 -10
- package/dist/claude-login-AIFIWTYF.js.map +1 -0
- package/dist/cli.js +30 -30
- package/dist/cli.js.map +1 -1
- package/dist/{codex-login-GMPF64MR.js → codex-login-LW5X7GAM.js} +10 -10
- package/dist/codex-login-LW5X7GAM.js.map +1 -0
- package/dist/config-store-NF56VHFU.js +7 -0
- package/dist/{config-store-POB6I37G.js.map → config-store-NF56VHFU.js.map} +1 -1
- package/dist/conversation-store-7GRDQZD2.js +4 -0
- package/dist/{conversation-store-PRBHWQMJ.js.map → conversation-store-7GRDQZD2.js.map} +1 -1
- package/dist/detect-providers-QICJ5U3R.js +4 -0
- package/dist/{detect-providers-C4SVQHFF.js.map → detect-providers-QICJ5U3R.js.map} +1 -1
- package/dist/executor-FTABX2AW.js +4 -0
- package/dist/{executor-RUX7VK3T.js.map → executor-FTABX2AW.js.map} +1 -1
- package/dist/{first-run-GDEVRFPO.js → first-run-ADROZVYF.js} +13 -13
- package/dist/first-run-ADROZVYF.js.map +1 -0
- package/dist/{gemini-login-KE224MSW.js → gemini-login-TST454MX.js} +10 -10
- package/dist/gemini-login-TST454MX.js.map +1 -0
- package/dist/index.d.ts +2 -56
- package/dist/index.js +30 -34
- package/dist/index.js.map +1 -1
- package/dist/{input-history-MIOO3FIW.js → input-history-BEICE7PT.js} +3 -3
- package/dist/input-history-BEICE7PT.js.map +1 -0
- package/dist/kimi-adapter-7FYOAKOI.js +6 -0
- package/dist/{kimi-adapter-UODMNX6K.js.map → kimi-adapter-7FYOAKOI.js.map} +1 -1
- package/dist/{kimi-login-DNT5YBKX.js → kimi-login-3IGVOBJI.js} +10 -10
- package/dist/kimi-login-3IGVOBJI.js.map +1 -0
- package/dist/logger-KGHUQ4VE.js +3 -0
- package/dist/{logger-PLPDWACQ.js.map → logger-KGHUQ4VE.js.map} +1 -1
- package/dist/model-discovery-AAJDHRFO.js +6 -0
- package/dist/{model-discovery-O64ZWPX5.js.map → model-discovery-AAJDHRFO.js.map} +1 -1
- package/dist/native-cli-adapters-CLONTZOA.js +8 -0
- package/dist/{native-cli-adapters-JMZX2C2C.js.map → native-cli-adapters-CLONTZOA.js.map} +1 -1
- package/dist/ollama-adapter-2N5OQIEV.js +5 -0
- package/dist/{ollama-adapter-GE67BNSS.js.map → ollama-adapter-2N5OQIEV.js.map} +1 -1
- package/dist/{pathResolver-A6IXQQFE.js → pathResolver-UVAB2FCW.js} +3 -3
- package/dist/{pathResolver-A6IXQQFE.js.map → pathResolver-UVAB2FCW.js.map} +1 -1
- package/dist/{profile-loader-TNAXBLDX.js → profile-loader-EMLV4J7S.js} +4 -4
- package/dist/profile-loader-EMLV4J7S.js.map +1 -0
- package/dist/registry-LRURZVUL.js +5 -0
- package/dist/{registry-3NHVCXCZ.js.map → registry-LRURZVUL.js.map} +1 -1
- package/dist/registry-MVNSXCEF.js +6 -0
- package/dist/{registry-7CQ3NCAD.js.map → registry-MVNSXCEF.js.map} +1 -1
- package/dist/server-manager-THGZBBZB.js +5 -0
- package/dist/{server-manager-DES23IBQ.js.map → server-manager-THGZBBZB.js.map} +1 -1
- package/dist/session-manager-X3DXT53M.js +12 -0
- package/dist/{session-manager-EHD7GWM2.js.map → session-manager-X3DXT53M.js.map} +1 -1
- package/dist/skills/built-in/code-review/SKILL.md +85 -85
- package/dist/skills/built-in/commit/SKILL.md +83 -83
- package/dist/skills/built-in/debug/SKILL.md +119 -119
- package/dist/skills/built-in/plan/SKILL.md +123 -123
- package/dist/skills/built-in/refactor/SKILL.md +132 -132
- package/dist/skills/built-in/test/SKILL.md +128 -128
- package/dist/sqlite-store-7OECRTXM.js +5 -0
- package/dist/{sqlite-store-7ZIVOUNI.js.map → sqlite-store-7OECRTXM.js.map} +1 -1
- package/dist/team-manager-2VSMALAA.js +11 -0
- package/dist/{team-manager-6DCNLGTC.js.map → team-manager-2VSMALAA.js.map} +1 -1
- package/dist/team-state-HZNVMQHT.js +3 -0
- package/dist/{team-state-R2D7DT5M.js.map → team-state-HZNVMQHT.js.map} +1 -1
- package/dist/tmux-manager-57QCUVHU.js +6 -0
- package/dist/{tmux-manager-WBKHUHDT.js.map → tmux-manager-57QCUVHU.js.map} +1 -1
- package/dist/tools-KWFSYT56.js +6 -0
- package/dist/{tools-I6XCTEZY.js.map → tools-KWFSYT56.js.map} +1 -1
- package/package.json +89 -93
- package/dist/App-YAHJUWCX.js.map +0 -1
- package/dist/api-key-fallback-UN3TJEOO.js +0 -11
- package/dist/auth-status-EIM5A5KL.js +0 -13
- package/dist/chunk-25UNNEHN.js +0 -140
- package/dist/chunk-25UNNEHN.js.map +0 -1
- package/dist/chunk-2GKOK6T7.js.map +0 -1
- package/dist/chunk-2LF7ALGR.js.map +0 -1
- package/dist/chunk-2NWNIKBK.js.map +0 -1
- package/dist/chunk-3TSPZRGM.js.map +0 -1
- package/dist/chunk-473JN6M5.js.map +0 -1
- package/dist/chunk-5XFSV6PF.js.map +0 -1
- package/dist/chunk-62HSGYQD.js.map +0 -1
- package/dist/chunk-6GUD7QIM.js.map +0 -1
- package/dist/chunk-AQ23TYSQ.js.map +0 -1
- package/dist/chunk-BY4DAKUU.js.map +0 -1
- package/dist/chunk-CC7MGWYY.js.map +0 -1
- package/dist/chunk-CTFZTARK.js +0 -155
- package/dist/chunk-CTFZTARK.js.map +0 -1
- package/dist/chunk-FIC7AK4Q.js.map +0 -1
- package/dist/chunk-GU33WKPG.js.map +0 -1
- package/dist/chunk-H2SYKIMI.js.map +0 -1
- package/dist/chunk-HEKFAKVH.js.map +0 -1
- package/dist/chunk-IARA5XYP.js.map +0 -1
- package/dist/chunk-LCYH4T6N.js.map +0 -1
- package/dist/chunk-LDVY5ELP.js.map +0 -1
- package/dist/chunk-OCJPQFOR.js.map +0 -1
- package/dist/chunk-ODBY7S4X.js +0 -141
- package/dist/chunk-ODBY7S4X.js.map +0 -1
- package/dist/chunk-ONQ4WCUI.js.map +0 -1
- package/dist/chunk-P5TKZM3T.js +0 -159
- package/dist/chunk-P5TKZM3T.js.map +0 -1
- package/dist/chunk-P66WDACW.js.map +0 -1
- package/dist/chunk-QCRK4QEL.js.map +0 -1
- package/dist/chunk-ROJPFPJ7.js.map +0 -1
- package/dist/chunk-RP2TAL3J.js.map +0 -1
- package/dist/chunk-RYOB3TLZ.js.map +0 -1
- package/dist/chunk-SOQFMNQC.js.map +0 -1
- package/dist/chunk-TDFTX32B.js.map +0 -1
- package/dist/chunk-VBLLDY4R.js.map +0 -1
- package/dist/chunk-VJNQJALF.js.map +0 -1
- package/dist/chunk-WAYSJMPS.js.map +0 -1
- package/dist/chunk-WC72BRHR.js.map +0 -1
- package/dist/chunk-YPFOE2QJ.js.map +0 -1
- package/dist/claude-adapter-6P4SJH7P.js +0 -7
- package/dist/claude-adapter-6P4SJH7P.js.map +0 -1
- package/dist/claude-login-IS5WTBMP.js.map +0 -1
- package/dist/codex-login-GMPF64MR.js.map +0 -1
- package/dist/config-store-POB6I37G.js +0 -7
- package/dist/conversation-store-PRBHWQMJ.js +0 -4
- package/dist/detect-providers-C4SVQHFF.js +0 -4
- package/dist/executor-RUX7VK3T.js +0 -4
- package/dist/first-run-GDEVRFPO.js.map +0 -1
- package/dist/gemini-adapter-MV3U4QFH.js +0 -7
- package/dist/gemini-adapter-MV3U4QFH.js.map +0 -1
- package/dist/gemini-login-KE224MSW.js.map +0 -1
- package/dist/input-history-MIOO3FIW.js.map +0 -1
- package/dist/kimi-adapter-UODMNX6K.js +0 -6
- package/dist/kimi-login-DNT5YBKX.js.map +0 -1
- package/dist/logger-PLPDWACQ.js +0 -3
- package/dist/model-discovery-O64ZWPX5.js +0 -6
- package/dist/native-cli-adapters-JMZX2C2C.js +0 -8
- package/dist/ollama-adapter-GE67BNSS.js +0 -5
- package/dist/openai-adapter-SHPLK77L.js +0 -7
- package/dist/openai-adapter-SHPLK77L.js.map +0 -1
- package/dist/profile-loader-TNAXBLDX.js.map +0 -1
- package/dist/registry-3NHVCXCZ.js +0 -6
- package/dist/registry-7CQ3NCAD.js +0 -5
- package/dist/server-manager-DES23IBQ.js +0 -5
- package/dist/session-manager-EHD7GWM2.js +0 -12
- package/dist/sqlite-store-7ZIVOUNI.js +0 -5
- package/dist/team-manager-6DCNLGTC.js +0 -11
- package/dist/team-state-R2D7DT5M.js +0 -3
- package/dist/tmux-manager-WBKHUHDT.js +0 -6
- package/dist/tools-I6XCTEZY.js +0 -6
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plan
|
|
3
|
-
description: "Create structured implementation plans with architecture analysis and task breakdown"
|
|
4
|
-
version: "1.0.0"
|
|
5
|
-
allowed-tools:
|
|
6
|
-
- read
|
|
7
|
-
- grep
|
|
8
|
-
- glob
|
|
9
|
-
triggers:
|
|
10
|
-
- "plan"
|
|
11
|
-
- "$plan"
|
|
12
|
-
model-requirements:
|
|
13
|
-
preferred-role: planning
|
|
14
|
-
min-context: 64000
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# Planning Skill
|
|
18
|
-
|
|
19
|
-
You are a senior software architect. Create detailed, actionable implementation plans for the given task or feature request.
|
|
20
|
-
|
|
21
|
-
## Process
|
|
22
|
-
|
|
23
|
-
### Step 1 — Understand the Request
|
|
24
|
-
|
|
25
|
-
1. Parse the user's request to identify the core goal and constraints.
|
|
26
|
-
2. Ask clarifying questions if the request is ambiguous or under-specified.
|
|
27
|
-
3. Identify implicit requirements (error handling, tests, security).
|
|
28
|
-
|
|
29
|
-
### Step 2 — Codebase Analysis
|
|
30
|
-
|
|
31
|
-
1. Use `glob` to understand the project structure and file organization.
|
|
32
|
-
2. Use `grep` to find relevant existing code, patterns, and conventions.
|
|
33
|
-
3. Use `read` to examine key files that will be affected:
|
|
34
|
-
- Entry points and routing
|
|
35
|
-
- Related modules and their interfaces
|
|
36
|
-
- Configuration files and type definitions
|
|
37
|
-
- Existing tests for reference patterns
|
|
38
|
-
4. Check for AGENTS.md or project coding standards.
|
|
39
|
-
|
|
40
|
-
### Step 3 — Architecture Design
|
|
41
|
-
|
|
42
|
-
1. Identify which modules, files, and functions will be created or modified.
|
|
43
|
-
2. Define the data flow and interactions between components.
|
|
44
|
-
3. Choose patterns consistent with the existing codebase:
|
|
45
|
-
- If the project uses classes, use classes. If it uses functions, use functions.
|
|
46
|
-
- Match error handling patterns (Result types, exceptions, error codes).
|
|
47
|
-
- Follow existing naming and file organization conventions.
|
|
48
|
-
4. Consider trade-offs and document alternatives considered.
|
|
49
|
-
|
|
50
|
-
### Step 4 — Task Breakdown
|
|
51
|
-
|
|
52
|
-
Break the implementation into ordered, atomic steps:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
## Implementation Plan
|
|
56
|
-
|
|
57
|
-
### Phase 1: Foundation
|
|
58
|
-
1. [ ] Create types/interfaces for the new feature
|
|
59
|
-
- File: src/types/feature.ts
|
|
60
|
-
- Details: Define IFeatureConfig, FeatureState union type
|
|
61
|
-
|
|
62
|
-
2. [ ] Add configuration schema
|
|
63
|
-
- File: src/config/feature-config.ts
|
|
64
|
-
- Details: Zod schema for runtime validation
|
|
65
|
-
|
|
66
|
-
### Phase 2: Core Logic
|
|
67
|
-
3. [ ] Implement the main service
|
|
68
|
-
- File: src/services/feature-service.ts
|
|
69
|
-
- Details: FeatureService class with methods X, Y, Z
|
|
70
|
-
- Depends on: Step 1
|
|
71
|
-
|
|
72
|
-
### Phase 3: Integration
|
|
73
|
-
4. [ ] Wire into existing system
|
|
74
|
-
- File: src/index.ts (modify)
|
|
75
|
-
- Details: Register service, add routes
|
|
76
|
-
|
|
77
|
-
### Phase 4: Testing
|
|
78
|
-
5. [ ] Unit tests
|
|
79
|
-
- File: tests/feature-service.test.ts
|
|
80
|
-
- Coverage: Happy path, edge cases, error conditions
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Step 5 — Risk Assessment
|
|
84
|
-
|
|
85
|
-
Identify potential issues:
|
|
86
|
-
- Breaking changes to existing APIs or behavior.
|
|
87
|
-
- Performance concerns with the chosen approach.
|
|
88
|
-
- Security implications (new attack surfaces, data exposure).
|
|
89
|
-
- Dependencies that may need to be added.
|
|
90
|
-
|
|
91
|
-
## Output Format
|
|
92
|
-
|
|
93
|
-
```markdown
|
|
94
|
-
# Implementation Plan: [Feature Name]
|
|
95
|
-
|
|
96
|
-
## Overview
|
|
97
|
-
[1-2 sentence summary of what will be built]
|
|
98
|
-
|
|
99
|
-
## Architecture Decision
|
|
100
|
-
[Chosen approach and why, alternatives considered]
|
|
101
|
-
|
|
102
|
-
## Files Affected
|
|
103
|
-
- New: [list of files to create]
|
|
104
|
-
- Modified: [list of files to change]
|
|
105
|
-
|
|
106
|
-
## Step-by-Step Plan
|
|
107
|
-
[Numbered, ordered steps with file paths and details]
|
|
108
|
-
|
|
109
|
-
## Risks & Mitigations
|
|
110
|
-
[Identified risks and how to handle them]
|
|
111
|
-
|
|
112
|
-
## Estimated Scope
|
|
113
|
-
- Files: N new, M modified
|
|
114
|
-
- Complexity: Low / Medium / High
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Rules
|
|
118
|
-
|
|
119
|
-
- Plans must be concrete and actionable, not abstract.
|
|
120
|
-
- Every step must specify exact file paths.
|
|
121
|
-
- Dependencies between steps must be explicit.
|
|
122
|
-
- Never suggest over-engineered solutions — match project complexity.
|
|
123
|
-
- If the task is too large for a single plan, suggest phased delivery.
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: "Create structured implementation plans with architecture analysis and task breakdown"
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- read
|
|
7
|
+
- grep
|
|
8
|
+
- glob
|
|
9
|
+
triggers:
|
|
10
|
+
- "plan"
|
|
11
|
+
- "$plan"
|
|
12
|
+
model-requirements:
|
|
13
|
+
preferred-role: planning
|
|
14
|
+
min-context: 64000
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Planning Skill
|
|
18
|
+
|
|
19
|
+
You are a senior software architect. Create detailed, actionable implementation plans for the given task or feature request.
|
|
20
|
+
|
|
21
|
+
## Process
|
|
22
|
+
|
|
23
|
+
### Step 1 — Understand the Request
|
|
24
|
+
|
|
25
|
+
1. Parse the user's request to identify the core goal and constraints.
|
|
26
|
+
2. Ask clarifying questions if the request is ambiguous or under-specified.
|
|
27
|
+
3. Identify implicit requirements (error handling, tests, security).
|
|
28
|
+
|
|
29
|
+
### Step 2 — Codebase Analysis
|
|
30
|
+
|
|
31
|
+
1. Use `glob` to understand the project structure and file organization.
|
|
32
|
+
2. Use `grep` to find relevant existing code, patterns, and conventions.
|
|
33
|
+
3. Use `read` to examine key files that will be affected:
|
|
34
|
+
- Entry points and routing
|
|
35
|
+
- Related modules and their interfaces
|
|
36
|
+
- Configuration files and type definitions
|
|
37
|
+
- Existing tests for reference patterns
|
|
38
|
+
4. Check for AGENTS.md or project coding standards.
|
|
39
|
+
|
|
40
|
+
### Step 3 — Architecture Design
|
|
41
|
+
|
|
42
|
+
1. Identify which modules, files, and functions will be created or modified.
|
|
43
|
+
2. Define the data flow and interactions between components.
|
|
44
|
+
3. Choose patterns consistent with the existing codebase:
|
|
45
|
+
- If the project uses classes, use classes. If it uses functions, use functions.
|
|
46
|
+
- Match error handling patterns (Result types, exceptions, error codes).
|
|
47
|
+
- Follow existing naming and file organization conventions.
|
|
48
|
+
4. Consider trade-offs and document alternatives considered.
|
|
49
|
+
|
|
50
|
+
### Step 4 — Task Breakdown
|
|
51
|
+
|
|
52
|
+
Break the implementation into ordered, atomic steps:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
## Implementation Plan
|
|
56
|
+
|
|
57
|
+
### Phase 1: Foundation
|
|
58
|
+
1. [ ] Create types/interfaces for the new feature
|
|
59
|
+
- File: src/types/feature.ts
|
|
60
|
+
- Details: Define IFeatureConfig, FeatureState union type
|
|
61
|
+
|
|
62
|
+
2. [ ] Add configuration schema
|
|
63
|
+
- File: src/config/feature-config.ts
|
|
64
|
+
- Details: Zod schema for runtime validation
|
|
65
|
+
|
|
66
|
+
### Phase 2: Core Logic
|
|
67
|
+
3. [ ] Implement the main service
|
|
68
|
+
- File: src/services/feature-service.ts
|
|
69
|
+
- Details: FeatureService class with methods X, Y, Z
|
|
70
|
+
- Depends on: Step 1
|
|
71
|
+
|
|
72
|
+
### Phase 3: Integration
|
|
73
|
+
4. [ ] Wire into existing system
|
|
74
|
+
- File: src/index.ts (modify)
|
|
75
|
+
- Details: Register service, add routes
|
|
76
|
+
|
|
77
|
+
### Phase 4: Testing
|
|
78
|
+
5. [ ] Unit tests
|
|
79
|
+
- File: tests/feature-service.test.ts
|
|
80
|
+
- Coverage: Happy path, edge cases, error conditions
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Step 5 — Risk Assessment
|
|
84
|
+
|
|
85
|
+
Identify potential issues:
|
|
86
|
+
- Breaking changes to existing APIs or behavior.
|
|
87
|
+
- Performance concerns with the chosen approach.
|
|
88
|
+
- Security implications (new attack surfaces, data exposure).
|
|
89
|
+
- Dependencies that may need to be added.
|
|
90
|
+
|
|
91
|
+
## Output Format
|
|
92
|
+
|
|
93
|
+
```markdown
|
|
94
|
+
# Implementation Plan: [Feature Name]
|
|
95
|
+
|
|
96
|
+
## Overview
|
|
97
|
+
[1-2 sentence summary of what will be built]
|
|
98
|
+
|
|
99
|
+
## Architecture Decision
|
|
100
|
+
[Chosen approach and why, alternatives considered]
|
|
101
|
+
|
|
102
|
+
## Files Affected
|
|
103
|
+
- New: [list of files to create]
|
|
104
|
+
- Modified: [list of files to change]
|
|
105
|
+
|
|
106
|
+
## Step-by-Step Plan
|
|
107
|
+
[Numbered, ordered steps with file paths and details]
|
|
108
|
+
|
|
109
|
+
## Risks & Mitigations
|
|
110
|
+
[Identified risks and how to handle them]
|
|
111
|
+
|
|
112
|
+
## Estimated Scope
|
|
113
|
+
- Files: N new, M modified
|
|
114
|
+
- Complexity: Low / Medium / High
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Rules
|
|
118
|
+
|
|
119
|
+
- Plans must be concrete and actionable, not abstract.
|
|
120
|
+
- Every step must specify exact file paths.
|
|
121
|
+
- Dependencies between steps must be explicit.
|
|
122
|
+
- Never suggest over-engineered solutions — match project complexity.
|
|
123
|
+
- If the task is too large for a single plan, suggest phased delivery.
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refactor
|
|
3
|
-
description: "Safe code refactoring with behavior preservation, test verification, and incremental steps"
|
|
4
|
-
version: "1.0.0"
|
|
5
|
-
allowed-tools:
|
|
6
|
-
- read
|
|
7
|
-
- grep
|
|
8
|
-
- glob
|
|
9
|
-
- bash
|
|
10
|
-
triggers:
|
|
11
|
-
- "refactor"
|
|
12
|
-
- "$refactor"
|
|
13
|
-
model-requirements:
|
|
14
|
-
preferred-role: coding
|
|
15
|
-
min-context: 48000
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# Refactoring Skill
|
|
19
|
-
|
|
20
|
-
You are a refactoring specialist. Restructure code to improve quality while preserving exact external behavior. Every change must be safe and verifiable.
|
|
21
|
-
|
|
22
|
-
## Process
|
|
23
|
-
|
|
24
|
-
### Step 1 — Assess Current State
|
|
25
|
-
|
|
26
|
-
1. Use `read` to examine the code targeted for refactoring.
|
|
27
|
-
2. Use `grep` to find all callers and dependents of the code being changed.
|
|
28
|
-
3. Use `glob` to locate existing tests covering this code.
|
|
29
|
-
4. Run existing tests with `bash` to establish a passing baseline.
|
|
30
|
-
5. Document the current behavior contract:
|
|
31
|
-
- Public API (function signatures, return types).
|
|
32
|
-
- Side effects (file writes, database mutations, API calls).
|
|
33
|
-
- Error behavior (what exceptions are thrown, when).
|
|
34
|
-
|
|
35
|
-
### Step 2 — Identify Refactoring Opportunities
|
|
36
|
-
|
|
37
|
-
Analyze the code for these patterns:
|
|
38
|
-
|
|
39
|
-
| Smell | Refactoring |
|
|
40
|
-
|-------|-------------|
|
|
41
|
-
| Long function (>40 lines) | Extract Method |
|
|
42
|
-
| Duplicated code | Extract shared utility |
|
|
43
|
-
| Deep nesting (>3 levels) | Early returns, guard clauses |
|
|
44
|
-
| God class (>300 lines) | Extract class / module |
|
|
45
|
-
| Feature envy | Move method to data owner |
|
|
46
|
-
| Primitive obsession | Introduce value objects |
|
|
47
|
-
| Long parameter list (>4) | Introduce parameter object |
|
|
48
|
-
| Shotgun surgery | Consolidate into single module |
|
|
49
|
-
| Boolean parameters | Split into named methods |
|
|
50
|
-
| Magic numbers/strings | Extract named constants |
|
|
51
|
-
|
|
52
|
-
### Step 3 — Plan the Refactoring
|
|
53
|
-
|
|
54
|
-
Create an ordered sequence of atomic, individually-testable steps:
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
## Refactoring Plan
|
|
58
|
-
|
|
59
|
-
### Step 1: Extract validation logic
|
|
60
|
-
- From: src/services/user-service.ts (lines 45-78)
|
|
61
|
-
- To: src/services/user-validation.ts (new file)
|
|
62
|
-
- Verify: Run existing tests — all must pass
|
|
63
|
-
|
|
64
|
-
### Step 2: Replace inline type with interface
|
|
65
|
-
- File: src/types/user.ts
|
|
66
|
-
- Change: Extract inline object type to IUserInput interface
|
|
67
|
-
- Verify: TypeScript compilation — zero errors
|
|
68
|
-
|
|
69
|
-
### Step 3: Simplify conditional logic
|
|
70
|
-
- File: src/services/user-service.ts (lines 90-120)
|
|
71
|
-
- Change: Replace nested if/else with early returns
|
|
72
|
-
- Verify: Run tests — behavior unchanged
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Step 4 — Execute Incrementally
|
|
76
|
-
|
|
77
|
-
For each step in the plan:
|
|
78
|
-
|
|
79
|
-
1. Make the single, focused change.
|
|
80
|
-
2. Run `tsc --noEmit` to verify type safety.
|
|
81
|
-
3. Run the relevant tests to verify behavior preservation.
|
|
82
|
-
4. If tests fail, revert the change and investigate.
|
|
83
|
-
5. Only proceed to the next step after the current one passes.
|
|
84
|
-
|
|
85
|
-
### Step 5 — Verify Holistically
|
|
86
|
-
|
|
87
|
-
After all refactoring steps:
|
|
88
|
-
|
|
89
|
-
1. Run the full test suite to catch any regressions.
|
|
90
|
-
2. Verify no unused imports, variables, or dead code remain.
|
|
91
|
-
3. Confirm file sizes are within project limits.
|
|
92
|
-
4. Check that no new `any` types were introduced.
|
|
93
|
-
|
|
94
|
-
## Output Format
|
|
95
|
-
|
|
96
|
-
For each refactoring step, present:
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
## Step N: [Refactoring Name]
|
|
100
|
-
|
|
101
|
-
### Rationale
|
|
102
|
-
[Why this change improves the code]
|
|
103
|
-
|
|
104
|
-
### Before
|
|
105
|
-
```typescript
|
|
106
|
-
// original code
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### After
|
|
110
|
-
```typescript
|
|
111
|
-
// refactored code
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Files Changed
|
|
115
|
-
- Modified: src/path/file.ts
|
|
116
|
-
- Created: src/path/new-file.ts (if applicable)
|
|
117
|
-
|
|
118
|
-
### Verification
|
|
119
|
-
✓ TypeScript: No errors
|
|
120
|
-
✓ Tests: 42/42 passing
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## Rules
|
|
124
|
-
|
|
125
|
-
- Never change behavior and structure in the same step.
|
|
126
|
-
- Always have a passing test baseline before starting.
|
|
127
|
-
- If tests don't exist, write them first (invoke the `$test` skill).
|
|
128
|
-
- Each step must be independently revertible.
|
|
129
|
-
- Never rename a public API without updating all callers.
|
|
130
|
-
- Preserve all existing comments that document business logic.
|
|
131
|
-
- Do not refactor code that is scheduled for deletion or replacement.
|
|
132
|
-
- Keep the scope focused: only refactor what was requested.
|
|
1
|
+
---
|
|
2
|
+
name: refactor
|
|
3
|
+
description: "Safe code refactoring with behavior preservation, test verification, and incremental steps"
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- read
|
|
7
|
+
- grep
|
|
8
|
+
- glob
|
|
9
|
+
- bash
|
|
10
|
+
triggers:
|
|
11
|
+
- "refactor"
|
|
12
|
+
- "$refactor"
|
|
13
|
+
model-requirements:
|
|
14
|
+
preferred-role: coding
|
|
15
|
+
min-context: 48000
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Refactoring Skill
|
|
19
|
+
|
|
20
|
+
You are a refactoring specialist. Restructure code to improve quality while preserving exact external behavior. Every change must be safe and verifiable.
|
|
21
|
+
|
|
22
|
+
## Process
|
|
23
|
+
|
|
24
|
+
### Step 1 — Assess Current State
|
|
25
|
+
|
|
26
|
+
1. Use `read` to examine the code targeted for refactoring.
|
|
27
|
+
2. Use `grep` to find all callers and dependents of the code being changed.
|
|
28
|
+
3. Use `glob` to locate existing tests covering this code.
|
|
29
|
+
4. Run existing tests with `bash` to establish a passing baseline.
|
|
30
|
+
5. Document the current behavior contract:
|
|
31
|
+
- Public API (function signatures, return types).
|
|
32
|
+
- Side effects (file writes, database mutations, API calls).
|
|
33
|
+
- Error behavior (what exceptions are thrown, when).
|
|
34
|
+
|
|
35
|
+
### Step 2 — Identify Refactoring Opportunities
|
|
36
|
+
|
|
37
|
+
Analyze the code for these patterns:
|
|
38
|
+
|
|
39
|
+
| Smell | Refactoring |
|
|
40
|
+
|-------|-------------|
|
|
41
|
+
| Long function (>40 lines) | Extract Method |
|
|
42
|
+
| Duplicated code | Extract shared utility |
|
|
43
|
+
| Deep nesting (>3 levels) | Early returns, guard clauses |
|
|
44
|
+
| God class (>300 lines) | Extract class / module |
|
|
45
|
+
| Feature envy | Move method to data owner |
|
|
46
|
+
| Primitive obsession | Introduce value objects |
|
|
47
|
+
| Long parameter list (>4) | Introduce parameter object |
|
|
48
|
+
| Shotgun surgery | Consolidate into single module |
|
|
49
|
+
| Boolean parameters | Split into named methods |
|
|
50
|
+
| Magic numbers/strings | Extract named constants |
|
|
51
|
+
|
|
52
|
+
### Step 3 — Plan the Refactoring
|
|
53
|
+
|
|
54
|
+
Create an ordered sequence of atomic, individually-testable steps:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
## Refactoring Plan
|
|
58
|
+
|
|
59
|
+
### Step 1: Extract validation logic
|
|
60
|
+
- From: src/services/user-service.ts (lines 45-78)
|
|
61
|
+
- To: src/services/user-validation.ts (new file)
|
|
62
|
+
- Verify: Run existing tests — all must pass
|
|
63
|
+
|
|
64
|
+
### Step 2: Replace inline type with interface
|
|
65
|
+
- File: src/types/user.ts
|
|
66
|
+
- Change: Extract inline object type to IUserInput interface
|
|
67
|
+
- Verify: TypeScript compilation — zero errors
|
|
68
|
+
|
|
69
|
+
### Step 3: Simplify conditional logic
|
|
70
|
+
- File: src/services/user-service.ts (lines 90-120)
|
|
71
|
+
- Change: Replace nested if/else with early returns
|
|
72
|
+
- Verify: Run tests — behavior unchanged
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Step 4 — Execute Incrementally
|
|
76
|
+
|
|
77
|
+
For each step in the plan:
|
|
78
|
+
|
|
79
|
+
1. Make the single, focused change.
|
|
80
|
+
2. Run `tsc --noEmit` to verify type safety.
|
|
81
|
+
3. Run the relevant tests to verify behavior preservation.
|
|
82
|
+
4. If tests fail, revert the change and investigate.
|
|
83
|
+
5. Only proceed to the next step after the current one passes.
|
|
84
|
+
|
|
85
|
+
### Step 5 — Verify Holistically
|
|
86
|
+
|
|
87
|
+
After all refactoring steps:
|
|
88
|
+
|
|
89
|
+
1. Run the full test suite to catch any regressions.
|
|
90
|
+
2. Verify no unused imports, variables, or dead code remain.
|
|
91
|
+
3. Confirm file sizes are within project limits.
|
|
92
|
+
4. Check that no new `any` types were introduced.
|
|
93
|
+
|
|
94
|
+
## Output Format
|
|
95
|
+
|
|
96
|
+
For each refactoring step, present:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
## Step N: [Refactoring Name]
|
|
100
|
+
|
|
101
|
+
### Rationale
|
|
102
|
+
[Why this change improves the code]
|
|
103
|
+
|
|
104
|
+
### Before
|
|
105
|
+
```typescript
|
|
106
|
+
// original code
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### After
|
|
110
|
+
```typescript
|
|
111
|
+
// refactored code
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Files Changed
|
|
115
|
+
- Modified: src/path/file.ts
|
|
116
|
+
- Created: src/path/new-file.ts (if applicable)
|
|
117
|
+
|
|
118
|
+
### Verification
|
|
119
|
+
✓ TypeScript: No errors
|
|
120
|
+
✓ Tests: 42/42 passing
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Rules
|
|
124
|
+
|
|
125
|
+
- Never change behavior and structure in the same step.
|
|
126
|
+
- Always have a passing test baseline before starting.
|
|
127
|
+
- If tests don't exist, write them first (invoke the `$test` skill).
|
|
128
|
+
- Each step must be independently revertible.
|
|
129
|
+
- Never rename a public API without updating all callers.
|
|
130
|
+
- Preserve all existing comments that document business logic.
|
|
131
|
+
- Do not refactor code that is scheduled for deletion or replacement.
|
|
132
|
+
- Keep the scope focused: only refactor what was requested.
|