deepspider 0.2.12 → 0.3.1

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 (152) hide show
  1. package/README.md +53 -27
  2. package/bin/cli.js +45 -0
  3. package/package.json +10 -4
  4. package/src/agent/core/PanelBridge.js +2 -2
  5. package/src/agent/logger.js +1 -1
  6. package/src/agent/middleware/report.js +1 -1
  7. package/src/agent/run.js +54 -63
  8. package/src/agent/setup.js +14 -14
  9. package/src/agent/skills/evolve.js +0 -3
  10. package/src/agent/tools/captcha.js +1 -1
  11. package/src/agent/tools/evolve.js +1 -1
  12. package/src/agent/tools/file.js +2 -2
  13. package/src/agent/tools/python.js +4 -4
  14. package/src/agent/tools/report.js +2 -2
  15. package/src/agent/tools/runtime.js +1 -1
  16. package/src/analyzer/EncryptionAnalyzer.js +2 -2
  17. package/src/browser/collector.js +1 -1
  18. package/src/browser/interceptors/NetworkInterceptor.js +1 -1
  19. package/src/browser/interceptors/ScriptInterceptor.js +2 -2
  20. package/src/cli/commands/config.js +94 -0
  21. package/src/cli/commands/help.js +34 -0
  22. package/src/cli/commands/update.js +78 -0
  23. package/src/cli/commands/version.js +9 -0
  24. package/src/cli/config.js +15 -0
  25. package/src/config/settings.js +102 -0
  26. package/src/core/PatchGenerator.js +2 -2
  27. package/src/env/EnvCodeGenerator.js +1 -1
  28. package/src/store/DataStore.js +5 -5
  29. package/.claude/agents/check.md +0 -122
  30. package/.claude/agents/debug.md +0 -106
  31. package/.claude/agents/dispatch.md +0 -214
  32. package/.claude/agents/implement.md +0 -96
  33. package/.claude/agents/plan.md +0 -396
  34. package/.claude/agents/research.md +0 -120
  35. package/.claude/commands/evolve/merge.md +0 -80
  36. package/.claude/commands/trellis/before-backend-dev.md +0 -13
  37. package/.claude/commands/trellis/before-frontend-dev.md +0 -13
  38. package/.claude/commands/trellis/break-loop.md +0 -107
  39. package/.claude/commands/trellis/check-backend.md +0 -13
  40. package/.claude/commands/trellis/check-cross-layer.md +0 -153
  41. package/.claude/commands/trellis/check-frontend.md +0 -13
  42. package/.claude/commands/trellis/create-command.md +0 -154
  43. package/.claude/commands/trellis/finish-work.md +0 -129
  44. package/.claude/commands/trellis/integrate-skill.md +0 -219
  45. package/.claude/commands/trellis/onboard.md +0 -358
  46. package/.claude/commands/trellis/parallel.md +0 -193
  47. package/.claude/commands/trellis/record-session.md +0 -62
  48. package/.claude/commands/trellis/start.md +0 -280
  49. package/.claude/commands/trellis/update-spec.md +0 -213
  50. package/.claude/hooks/inject-subagent-context.py +0 -758
  51. package/.claude/hooks/ralph-loop.py +0 -374
  52. package/.claude/hooks/session-start.py +0 -126
  53. package/.claude/settings.json +0 -41
  54. package/.claude/skills/deepagents-guide/SKILL.md +0 -428
  55. package/.cursor/commands/trellis-before-backend-dev.md +0 -13
  56. package/.cursor/commands/trellis-before-frontend-dev.md +0 -13
  57. package/.cursor/commands/trellis-break-loop.md +0 -107
  58. package/.cursor/commands/trellis-check-backend.md +0 -13
  59. package/.cursor/commands/trellis-check-cross-layer.md +0 -153
  60. package/.cursor/commands/trellis-check-frontend.md +0 -13
  61. package/.cursor/commands/trellis-create-command.md +0 -154
  62. package/.cursor/commands/trellis-finish-work.md +0 -129
  63. package/.cursor/commands/trellis-integrate-skill.md +0 -219
  64. package/.cursor/commands/trellis-onboard.md +0 -358
  65. package/.cursor/commands/trellis-record-session.md +0 -62
  66. package/.cursor/commands/trellis-start.md +0 -156
  67. package/.cursor/commands/trellis-update-spec.md +0 -213
  68. package/.github/workflows/publish.yml +0 -63
  69. package/.husky/pre-commit +0 -1
  70. package/.mcp.json +0 -8
  71. package/.trellis/.template-hashes.json +0 -65
  72. package/.trellis/.version +0 -1
  73. package/.trellis/scripts/add-session.sh +0 -384
  74. package/.trellis/scripts/common/developer.sh +0 -129
  75. package/.trellis/scripts/common/git-context.sh +0 -263
  76. package/.trellis/scripts/common/paths.sh +0 -208
  77. package/.trellis/scripts/common/phase.sh +0 -150
  78. package/.trellis/scripts/common/registry.sh +0 -247
  79. package/.trellis/scripts/common/task-queue.sh +0 -142
  80. package/.trellis/scripts/common/task-utils.sh +0 -151
  81. package/.trellis/scripts/common/worktree.sh +0 -128
  82. package/.trellis/scripts/create-bootstrap.sh +0 -299
  83. package/.trellis/scripts/get-context.sh +0 -7
  84. package/.trellis/scripts/get-developer.sh +0 -15
  85. package/.trellis/scripts/init-developer.sh +0 -34
  86. package/.trellis/scripts/multi-agent/cleanup.sh +0 -396
  87. package/.trellis/scripts/multi-agent/create-pr.sh +0 -241
  88. package/.trellis/scripts/multi-agent/plan.sh +0 -207
  89. package/.trellis/scripts/multi-agent/start.sh +0 -310
  90. package/.trellis/scripts/multi-agent/status.sh +0 -828
  91. package/.trellis/scripts/task.sh +0 -1118
  92. package/.trellis/spec/backend/ci-cd-guidelines.md +0 -73
  93. package/.trellis/spec/backend/deepagents-guide.md +0 -380
  94. package/.trellis/spec/backend/directory-structure.md +0 -145
  95. package/.trellis/spec/backend/examples/skills/deepagents-guide/README.md +0 -11
  96. package/.trellis/spec/backend/examples/skills/deepagents-guide/agent.js.template +0 -20
  97. package/.trellis/spec/backend/examples/skills/deepagents-guide/skills-config.js.template +0 -13
  98. package/.trellis/spec/backend/examples/skills/deepagents-guide/subagent.js.template +0 -19
  99. package/.trellis/spec/backend/hook-guidelines.md +0 -218
  100. package/.trellis/spec/backend/index.md +0 -37
  101. package/.trellis/spec/backend/quality-guidelines.md +0 -377
  102. package/.trellis/spec/backend/state-management.md +0 -76
  103. package/.trellis/spec/backend/tool-guidelines.md +0 -144
  104. package/.trellis/spec/backend/type-safety.md +0 -71
  105. package/.trellis/spec/guides/code-reuse-thinking-guide.md +0 -92
  106. package/.trellis/spec/guides/cross-layer-thinking-guide.md +0 -94
  107. package/.trellis/spec/guides/index.md +0 -79
  108. package/.trellis/tasks/archive/02-02-evolving-skills/prd.md +0 -61
  109. package/.trellis/tasks/archive/02-02-evolving-skills/task.json +0 -29
  110. package/.trellis/tasks/archive/2026-02/00-bootstrap-guidelines/prd.md +0 -86
  111. package/.trellis/tasks/archive/2026-02/00-bootstrap-guidelines/task.json +0 -27
  112. package/.trellis/tasks/archive/2026-02/02-02-skills-system/check.jsonl +0 -3
  113. package/.trellis/tasks/archive/2026-02/02-02-skills-system/debug.jsonl +0 -2
  114. package/.trellis/tasks/archive/2026-02/02-02-skills-system/implement.jsonl +0 -5
  115. package/.trellis/tasks/archive/2026-02/02-02-skills-system/prd.md +0 -33
  116. package/.trellis/tasks/archive/2026-02/02-02-skills-system/task.json +0 -41
  117. package/.trellis/workflow.md +0 -407
  118. package/.trellis/workspace/index.md +0 -123
  119. package/.trellis/workspace/pony/index.md +0 -42
  120. package/.trellis/workspace/pony/journal-1.md +0 -125
  121. package/.trellis/worktree.yaml +0 -47
  122. package/AGENTS.md +0 -18
  123. package/CLAUDE.md +0 -315
  124. package/agents/deepspider.md +0 -142
  125. package/docs/DEBUG.md +0 -42
  126. package/docs/GUIDE.md +0 -338
  127. package/docs/PROMPT.md +0 -59
  128. package/docs/USAGE.md +0 -230
  129. package/eslint.config.js +0 -51
  130. package/test/analyze.test.js +0 -90
  131. package/test/envdump.test.js +0 -74
  132. package/test/flow.test.js +0 -90
  133. package/test/hooks.test.js +0 -138
  134. package/test/plugin.test.js +0 -35
  135. package/test/refactor-full.test.js +0 -30
  136. package/test/refactor.test.js +0 -21
  137. package/test/samples/obfuscated.js +0 -61
  138. package/test/samples/original.js +0 -66
  139. package/test/samples/v10_eval_chain.js +0 -52
  140. package/test/samples/v11_bytecode_vm.js +0 -81
  141. package/test/samples/v12_polymorphic.js +0 -69
  142. package/test/samples/v1_ob_basic.js +0 -98
  143. package/test/samples/v2_ob_advanced.js +0 -99
  144. package/test/samples/v3_jjencode.js +0 -77
  145. package/test/samples/v4_aaencode.js +0 -73
  146. package/test/samples/v5_control_flow.js +0 -86
  147. package/test/samples/v6_string_encryption.js +0 -71
  148. package/test/samples/v7_jsvmp.js +0 -83
  149. package/test/samples/v8_anti_debug.js +0 -79
  150. package/test/samples/v9_proxy_trap.js +0 -49
  151. package/test/samples.test.js +0 -96
  152. package/test/webcrack.test.js +0 -55
@@ -1,144 +0,0 @@
1
- # Tool Guidelines
2
-
3
- > LangChain 工具定义规范
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- DeepSpider 使用 `@langchain/core/tools` 定义 Agent 工具。
10
- 每个工具是一个独立的功能单元,通过 Zod schema 定义参数类型。
11
-
12
- ---
13
-
14
- ## Tool Structure
15
-
16
- 标准工具定义结构:
17
-
18
- ```javascript
19
- import { z } from 'zod';
20
- import { tool } from '@langchain/core/tools';
21
-
22
- export const myTool = tool(
23
- async ({ param1, param2 }) => {
24
- // 工具逻辑
25
- return JSON.stringify(result, null, 2);
26
- },
27
- {
28
- name: 'tool_name', // snake_case 命名
29
- description: '工具描述', // 简洁明确
30
- schema: z.object({
31
- param1: z.string().describe('参数描述'),
32
- param2: z.number().optional().default(100),
33
- }),
34
- }
35
- );
36
-
37
- // 导出工具数组
38
- export const myTools = [myTool];
39
- ```
40
-
41
- **示例**: `src/agent/tools/analyzer.js:14-38`
42
-
43
- ---
44
-
45
- ## Schema Conventions
46
-
47
- 使用 Zod 定义参数 schema:
48
-
49
- ```javascript
50
- schema: z.object({
51
- // 必填参数
52
- code: z.string().describe('JS代码'),
53
-
54
- // 可选参数带默认值
55
- extractFunctions: z.boolean().optional().default(true),
56
-
57
- // 枚举类型
58
- mode: z.enum(['fast', 'deep']).optional().default('fast'),
59
-
60
- // 数组类型
61
- patterns: z.array(z.string()).optional(),
62
- })
63
- ```
64
-
65
- **示例**: `src/agent/tools/analyzer.js:32-36`
66
-
67
- ---
68
-
69
- ## Return Value Patterns
70
-
71
- 工具返回值规范:
72
-
73
- ```javascript
74
- // 返回 JSON 字符串(推荐)
75
- return JSON.stringify(result, null, 2);
76
-
77
- // 返回简单字符串
78
- return `分析完成: ${count} 个函数`;
79
-
80
- // 错误处理
81
- try {
82
- // ...
83
- } catch (e) {
84
- return JSON.stringify({ error: e.message });
85
- }
86
- ```
87
-
88
- ---
89
-
90
- ## Tool Organization
91
-
92
- 工具文件组织:
93
-
94
- ```javascript
95
- // src/agent/tools/analyzer.js
96
-
97
- // 1. 导入依赖
98
- import { z } from 'zod';
99
- import { tool } from '@langchain/core/tools';
100
- import { ASTAnalyzer } from '../../analyzer/ASTAnalyzer.js';
101
-
102
- // 2. 定义各个工具
103
- export const analyzeAst = tool(...);
104
- export const analyzeCallstack = tool(...);
105
-
106
- // 3. 导出工具数组
107
- export const analyzerTools = [analyzeAst, analyzeCallstack];
108
- ```
109
-
110
- **示例**: `src/agent/tools/analyzer.js`
111
-
112
- ---
113
-
114
- ## Common Mistakes
115
-
116
- ### 1. 工具名称不规范
117
-
118
- ```javascript
119
- // ❌ 错误:使用 camelCase
120
- name: 'analyzeAst'
121
-
122
- // ✅ 正确:使用 snake_case
123
- name: 'analyze_ast'
124
- ```
125
-
126
- ### 2. 缺少参数描述
127
-
128
- ```javascript
129
- // ❌ 错误:无描述
130
- param1: z.string()
131
-
132
- // ✅ 正确:有描述
133
- param1: z.string().describe('JS代码')
134
- ```
135
-
136
- ### 3. 返回非字符串
137
-
138
- ```javascript
139
- // ❌ 错误:返回对象
140
- return result;
141
-
142
- // ✅ 正确:返回 JSON 字符串
143
- return JSON.stringify(result, null, 2);
144
- ```
@@ -1,71 +0,0 @@
1
- # Type Safety
2
-
3
- > Zod 类型验证规范
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- DeepSpider 是纯 JavaScript 项目,使用 Zod 进行运行时类型验证。
10
- 主要用于 LangChain 工具的参数 schema 定义。
11
-
12
- ---
13
-
14
- ## Zod Schema
15
-
16
- 工具参数使用 Zod 定义:
17
-
18
- ```javascript
19
- import { z } from 'zod';
20
-
21
- const schema = z.object({
22
- code: z.string().describe('JS代码'),
23
- mode: z.enum(['fast', 'deep']).default('fast'),
24
- });
25
- ```
26
-
27
- ---
28
-
29
- ## Validation
30
-
31
- 常用 Zod 类型:
32
-
33
- | 类型 | 用法 |
34
- |------|------|
35
- | 字符串 | `z.string()` |
36
- | 数字 | `z.number()` |
37
- | 布尔 | `z.boolean()` |
38
- | 枚举 | `z.enum(['a', 'b'])` |
39
- | 数组 | `z.array(z.string())` |
40
- | 可选 | `.optional()` |
41
- | 默认值 | `.default(value)` |
42
-
43
- ---
44
-
45
- ## Common Patterns
46
-
47
- 参数描述模式:
48
-
49
- ```javascript
50
- schema: z.object({
51
- // 必填 + 描述
52
- code: z.string().describe('JS代码'),
53
-
54
- // 可选 + 默认值
55
- deep: z.boolean().optional().default(false),
56
- })
57
- ```
58
-
59
- ---
60
-
61
- ## Forbidden Patterns
62
-
63
- ### 1. 缺少 describe
64
-
65
- ```javascript
66
- // ❌ 错误
67
- code: z.string()
68
-
69
- // ✅ 正确
70
- code: z.string().describe('JS代码')
71
- ```
@@ -1,92 +0,0 @@
1
- # Code Reuse Thinking Guide
2
-
3
- > **Purpose**: Stop and think before creating new code - does it already exist?
4
-
5
- ---
6
-
7
- ## The Problem
8
-
9
- **Duplicated code is the #1 source of inconsistency bugs.**
10
-
11
- When you copy-paste or rewrite existing logic:
12
- - Bug fixes don't propagate
13
- - Behavior diverges over time
14
- - Codebase becomes harder to understand
15
-
16
- ---
17
-
18
- ## Before Writing New Code
19
-
20
- ### Step 1: Search First
21
-
22
- ```bash
23
- # Search for similar function names
24
- grep -r "functionName" .
25
-
26
- # Search for similar logic
27
- grep -r "keyword" .
28
- ```
29
-
30
- ### Step 2: Ask These Questions
31
-
32
- | Question | If Yes... |
33
- |----------|-----------|
34
- | Does a similar function exist? | Use or extend it |
35
- | Is this pattern used elsewhere? | Follow the existing pattern |
36
- | Could this be a shared utility? | Create it in the right place |
37
- | Am I copying code from another file? | **STOP** - extract to shared |
38
-
39
- ---
40
-
41
- ## Common Duplication Patterns
42
-
43
- ### Pattern 1: Copy-Paste Functions
44
-
45
- **Bad**: Copying a validation function to another file
46
-
47
- **Good**: Extract to shared utilities, import where needed
48
-
49
- ### Pattern 2: Similar Components
50
-
51
- **Bad**: Creating a new component that's 80% similar to existing
52
-
53
- **Good**: Extend existing component with props/variants
54
-
55
- ### Pattern 3: Repeated Constants
56
-
57
- **Bad**: Defining the same constant in multiple files
58
-
59
- **Good**: Single source of truth, import everywhere
60
-
61
- ---
62
-
63
- ## When to Abstract
64
-
65
- **Abstract when**:
66
- - Same code appears 3+ times
67
- - Logic is complex enough to have bugs
68
- - Multiple people might need this
69
-
70
- **Don't abstract when**:
71
- - Only used once
72
- - Trivial one-liner
73
- - Abstraction would be more complex than duplication
74
-
75
- ---
76
-
77
- ## After Batch Modifications
78
-
79
- When you've made similar changes to multiple files:
80
-
81
- 1. **Review**: Did you catch all instances?
82
- 2. **Search**: Run grep to find any missed
83
- 3. **Consider**: Should this be abstracted?
84
-
85
- ---
86
-
87
- ## Checklist Before Commit
88
-
89
- - [ ] Searched for existing similar code
90
- - [ ] No copy-pasted logic that should be shared
91
- - [ ] Constants defined in one place
92
- - [ ] Similar patterns follow same structure
@@ -1,94 +0,0 @@
1
- # Cross-Layer Thinking Guide
2
-
3
- > **Purpose**: Think through data flow across layers before implementing.
4
-
5
- ---
6
-
7
- ## The Problem
8
-
9
- **Most bugs happen at layer boundaries**, not within layers.
10
-
11
- Common cross-layer bugs:
12
- - API returns format A, frontend expects format B
13
- - Database stores X, service transforms to Y, but loses data
14
- - Multiple layers implement the same logic differently
15
-
16
- ---
17
-
18
- ## Before Implementing Cross-Layer Features
19
-
20
- ### Step 1: Map the Data Flow
21
-
22
- Draw out how data moves:
23
-
24
- ```
25
- Source → Transform → Store → Retrieve → Transform → Display
26
- ```
27
-
28
- For each arrow, ask:
29
- - What format is the data in?
30
- - What could go wrong?
31
- - Who is responsible for validation?
32
-
33
- ### Step 2: Identify Boundaries
34
-
35
- | Boundary | Common Issues |
36
- |----------|---------------|
37
- | API ↔ Service | Type mismatches, missing fields |
38
- | Service ↔ Database | Format conversions, null handling |
39
- | Backend ↔ Frontend | Serialization, date formats |
40
- | Component ↔ Component | Props shape changes |
41
-
42
- ### Step 3: Define Contracts
43
-
44
- For each boundary:
45
- - What is the exact input format?
46
- - What is the exact output format?
47
- - What errors can occur?
48
-
49
- ---
50
-
51
- ## Common Cross-Layer Mistakes
52
-
53
- ### Mistake 1: Implicit Format Assumptions
54
-
55
- **Bad**: Assuming date format without checking
56
-
57
- **Good**: Explicit format conversion at boundaries
58
-
59
- ### Mistake 2: Scattered Validation
60
-
61
- **Bad**: Validating the same thing in multiple layers
62
-
63
- **Good**: Validate once at the entry point
64
-
65
- ### Mistake 3: Leaky Abstractions
66
-
67
- **Bad**: Component knows about database schema
68
-
69
- **Good**: Each layer only knows its neighbors
70
-
71
- ---
72
-
73
- ## Checklist for Cross-Layer Features
74
-
75
- Before implementation:
76
- - [ ] Mapped the complete data flow
77
- - [ ] Identified all layer boundaries
78
- - [ ] Defined format at each boundary
79
- - [ ] Decided where validation happens
80
-
81
- After implementation:
82
- - [ ] Tested with edge cases (null, empty, invalid)
83
- - [ ] Verified error handling at each boundary
84
- - [ ] Checked data survives round-trip
85
-
86
- ---
87
-
88
- ## When to Create Flow Documentation
89
-
90
- Create detailed flow docs when:
91
- - Feature spans 3+ layers
92
- - Multiple teams are involved
93
- - Data format is complex
94
- - Feature has caused bugs before
@@ -1,79 +0,0 @@
1
- # Thinking Guides
2
-
3
- > **Purpose**: Expand your thinking to catch things you might not have considered.
4
-
5
- ---
6
-
7
- ## Why Thinking Guides?
8
-
9
- **Most bugs and tech debt come from "didn't think of that"**, not from lack of skill:
10
-
11
- - Didn't think about what happens at layer boundaries → cross-layer bugs
12
- - Didn't think about code patterns repeating → duplicated code everywhere
13
- - Didn't think about edge cases → runtime errors
14
- - Didn't think about future maintainers → unreadable code
15
-
16
- These guides help you **ask the right questions before coding**.
17
-
18
- ---
19
-
20
- ## Available Guides
21
-
22
- | Guide | Purpose | When to Use |
23
- |-------|---------|-------------|
24
- | [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md) | Identify patterns and reduce duplication | When you notice repeated patterns |
25
- | [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md) | Think through data flow across layers | Features spanning multiple layers |
26
-
27
- ---
28
-
29
- ## Quick Reference: Thinking Triggers
30
-
31
- ### When to Think About Cross-Layer Issues
32
-
33
- - [ ] Feature touches 3+ layers (API, Service, Component, Database)
34
- - [ ] Data format changes between layers
35
- - [ ] Multiple consumers need the same data
36
- - [ ] You're not sure where to put some logic
37
-
38
- → Read [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md)
39
-
40
- ### When to Think About Code Reuse
41
-
42
- - [ ] You're writing similar code to something that exists
43
- - [ ] You see the same pattern repeated 3+ times
44
- - [ ] You're adding a new field to multiple places
45
- - [ ] **You're modifying any constant or config**
46
- - [ ] **You're creating a new utility/helper function** ← Search first!
47
-
48
- → Read [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md)
49
-
50
- ---
51
-
52
- ## Pre-Modification Rule (CRITICAL)
53
-
54
- > **Before changing ANY value, ALWAYS search first!**
55
-
56
- ```bash
57
- # Search for the value you're about to change
58
- grep -r "value_to_change" .
59
- ```
60
-
61
- This single habit prevents most "forgot to update X" bugs.
62
-
63
- ---
64
-
65
- ## How to Use This Directory
66
-
67
- 1. **Before coding**: Skim the relevant thinking guide
68
- 2. **During coding**: If something feels repetitive or complex, check the guides
69
- 3. **After bugs**: Add new insights to the relevant guide (learn from mistakes)
70
-
71
- ---
72
-
73
- ## Contributing
74
-
75
- Found a new "didn't think of that" moment? Add it to the relevant guide.
76
-
77
- ---
78
-
79
- **Core Principle**: 30 minutes of thinking saves 3 hours of debugging.
@@ -1,61 +0,0 @@
1
- # Self-Evolving Skills System
2
-
3
- ## 目标
4
-
5
- 实现 Skills 自我进化机制,让 Agent 在分析过程中积累的经验能够持久化,系统越用越好用。
6
-
7
- ## 核心设计
8
-
9
- ### 目录结构
10
-
11
- ```
12
- src/agent/skills/<skill-name>/
13
- ├── SKILL.md # 静态:基础知识(git管理)
14
- └── evolved.md # 动态:运行时积累
15
- ```
16
-
17
- ### evolved.md 格式
18
-
19
- ```markdown
20
- ---
21
- total: 15
22
- last_merged: 2026-01-15
23
- ---
24
-
25
- ## 核心经验
26
-
27
- ### 经验标题
28
- **场景**: 具体案例
29
- **经验**: 一句话总结
30
-
31
- ## 近期发现
32
-
33
- ### [2026-02-02] 发现标题
34
- **场景**: 具体案例
35
- **经验**: 一句话总结
36
- ```
37
-
38
- ### 加载策略
39
-
40
- - 静态 SKILL.md:全量加载
41
- - 动态 evolved.md:核心经验 + 最近 10 条
42
-
43
- ### 阈值提示
44
-
45
- - 动态经验达到 20 条时提示合并
46
- - 合并通过命令触发:`/evolve:merge <skill-name>`
47
-
48
- ## 实现清单
49
-
50
- 1. [ ] 创建 `evolved.md` 模板文件
51
- 2. [ ] 实现 `createEvolvingSkillsMiddleware` 中间件
52
- 3. [ ] 实现 `evolve_skill` 工具
53
- 4. [ ] 创建 `/evolve:merge` 命令
54
- 5. [ ] 更新各 subagent 使用新中间件
55
- 6. [ ] 更新 systemPrompt 指导 Agent 何时进化
56
-
57
- ## 技术要点
58
-
59
- - 中间件在 Agent 启动时合并静态+动态
60
- - evolve_skill 工具追加内容到 evolved.md
61
- - 合并命令将核心经验迁移到 SKILL.md
@@ -1,29 +0,0 @@
1
- {
2
- "id": "evolving-skills",
3
- "name": "evolving-skills",
4
- "title": "Self-Evolving Skills System",
5
- "description": "",
6
- "status": "planning",
7
- "dev_type": null,
8
- "scope": null,
9
- "priority": "P2",
10
- "creator": "pony",
11
- "assignee": "pony",
12
- "createdAt": "2026-02-02",
13
- "completedAt": null,
14
- "branch": null,
15
- "base_branch": null,
16
- "worktree_path": null,
17
- "current_phase": 0,
18
- "next_action": [
19
- {"phase": 1, "action": "implement"},
20
- {"phase": 2, "action": "check"},
21
- {"phase": 3, "action": "finish"},
22
- {"phase": 4, "action": "create-pr"}
23
- ],
24
- "commit": null,
25
- "pr_url": null,
26
- "subtasks": [],
27
- "relatedFiles": [],
28
- "notes": ""
29
- }
@@ -1,86 +0,0 @@
1
- # Bootstrap: Fill Project Development Guidelines
2
-
3
- ## Purpose
4
-
5
- Welcome to Trellis! This is your first task.
6
-
7
- AI agents use `.trellis/spec/` to understand YOUR project's coding conventions.
8
- **Empty templates = AI writes generic code that doesn't match your project style.**
9
-
10
- Filling these guidelines is a one-time setup that pays off for every future AI session.
11
-
12
- ---
13
-
14
- ## Your Task
15
-
16
- Fill in the guideline files based on your **existing codebase**.
17
-
18
- ### Frontend Guidelines
19
-
20
- | File | What to Document |
21
- |------|------------------|
22
- | `.trellis/spec/frontend/directory-structure.md` | Component/page/hook organization |
23
- | `.trellis/spec/frontend/component-guidelines.md` | Component patterns, props conventions |
24
- | `.trellis/spec/frontend/hook-guidelines.md` | Custom hook naming, patterns |
25
- | `.trellis/spec/frontend/state-management.md` | State library, patterns, what goes where |
26
- | `.trellis/spec/frontend/type-safety.md` | TypeScript conventions, type organization |
27
- | `.trellis/spec/frontend/quality-guidelines.md` | Linting, testing, accessibility |
28
-
29
- ### Thinking Guides (Optional)
30
-
31
- The `.trellis/spec/guides/` directory contains thinking guides that are already
32
- filled with general best practices. You can customize them for your project if needed.
33
-
34
- ---
35
-
36
- ## How to Fill Guidelines
37
-
38
- ### Principle: Document Reality, Not Ideals
39
-
40
- Write what your codebase **actually does**, not what you wish it did.
41
- AI needs to match existing patterns, not introduce new ones.
42
-
43
- ### Steps
44
-
45
- 1. **Look at existing code** - Find 2-3 examples of each pattern
46
- 2. **Document the pattern** - Describe what you see
47
- 3. **Include file paths** - Reference real files as examples
48
- 4. **List anti-patterns** - What does your team avoid?
49
-
50
- ---
51
-
52
- ## Tips for Using AI
53
-
54
- Ask AI to help analyze your codebase:
55
-
56
- - "Look at my codebase and document the patterns you see"
57
- - "Analyze my code structure and summarize the conventions"
58
- - "Find error handling patterns and document them"
59
-
60
- The AI will read your code and help you document it.
61
-
62
- ---
63
-
64
- ## Completion Checklist
65
-
66
- - [ ] Guidelines filled for your project type
67
- - [ ] At least 2-3 real code examples in each guideline
68
- - [ ] Anti-patterns documented
69
-
70
- When done:
71
-
72
- ```bash
73
- ./.trellis/scripts/task.sh finish
74
- ./.trellis/scripts/task.sh archive 00-bootstrap-guidelines
75
- ```
76
-
77
- ---
78
-
79
- ## Why This Matters
80
-
81
- After completing this task:
82
-
83
- 1. AI will write code that matches your project style
84
- 2. Relevant `/trellis:before-*-dev` commands will inject real context
85
- 3. `/trellis:check-*` commands will validate against your actual standards
86
- 4. Future developers (human or AI) will onboard faster
@@ -1,27 +0,0 @@
1
- {
2
- "id": "00-bootstrap-guidelines",
3
- "name": "Bootstrap Guidelines",
4
- "description": "Fill in project development guidelines for AI agents",
5
- "status": "completed",
6
- "dev_type": "docs",
7
- "priority": "P1",
8
- "creator": "pony",
9
- "assignee": "pony",
10
- "createdAt": "2026-01-30",
11
- "completedAt": "2026-02-02",
12
- "commit": null,
13
- "subtasks": [
14
- {
15
- "name": "Fill frontend guidelines",
16
- "status": "pending"
17
- },
18
- {
19
- "name": "Add code examples",
20
- "status": "pending"
21
- }
22
- ],
23
- "relatedFiles": [
24
- ".trellis/spec/frontend/"
25
- ],
26
- "notes": "First-time setup task created by trellis init (frontend project)"
27
- }
@@ -1,3 +0,0 @@
1
- {"file": ".claude/commands/trellis/finish-work.md", "reason": "Finish work checklist"}
2
- {"file": ".trellis/spec/shared/index.md", "reason": "Shared coding standards"}
3
- {"file": ".claude/commands/trellis/check-backend.md", "reason": "Backend check spec"}
@@ -1,2 +0,0 @@
1
- {"file": ".trellis/spec/shared/index.md", "reason": "Shared coding standards"}
2
- {"file": ".claude/commands/trellis/check-backend.md", "reason": "Backend check spec"}
@@ -1,5 +0,0 @@
1
- {"file": ".trellis/workflow.md", "reason": "Project workflow and conventions"}
2
- {"file": ".trellis/spec/shared/index.md", "reason": "Shared coding standards"}
3
- {"file": ".trellis/spec/backend/index.md", "reason": "Backend development guide"}
4
- {"file": ".trellis/spec/backend/api-module.md", "reason": "API module conventions"}
5
- {"file": ".trellis/spec/backend/quality.md", "reason": "Code quality requirements"}