thatgfsj-code 2.2.9 → 3.0.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.
- package/CHANGELOG.md +15 -67
- package/dist/app/index.d.ts +28 -5
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +76 -10
- package/dist/app/index.js.map +1 -1
- package/dist/cache/fingerprint.d.ts +49 -0
- package/dist/cache/fingerprint.d.ts.map +1 -0
- package/dist/cache/fingerprint.js +100 -0
- package/dist/cache/fingerprint.js.map +1 -0
- package/dist/cache/index.d.ts +15 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +15 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/smartModel.d.ts +40 -0
- package/dist/cache/smartModel.d.ts.map +1 -0
- package/dist/cache/smartModel.js +43 -0
- package/dist/cache/smartModel.js.map +1 -0
- package/dist/cache/stats.d.ts +93 -0
- package/dist/cache/stats.d.ts.map +1 -0
- package/dist/cache/stats.js +155 -0
- package/dist/cache/stats.js.map +1 -0
- package/dist/cache/volatile.d.ts +32 -0
- package/dist/cache/volatile.d.ts.map +1 -0
- package/dist/cache/volatile.js +44 -0
- package/dist/cache/volatile.js.map +1 -0
- package/dist/cmd/index.js +49 -57
- package/dist/cmd/index.js.map +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +8 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/types.d.ts +14 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/llm/anthropic.d.ts +55 -5
- package/dist/llm/anthropic.d.ts.map +1 -1
- package/dist/llm/anthropic.js +172 -26
- package/dist/llm/anthropic.js.map +1 -1
- package/dist/llm/index.d.ts +26 -8
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +83 -15
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/openai.d.ts +28 -8
- package/dist/llm/openai.d.ts.map +1 -1
- package/dist/llm/openai.js +58 -8
- package/dist/llm/openai.js.map +1 -1
- package/dist/llm/provider.d.ts +40 -8
- package/dist/llm/provider.d.ts.map +1 -1
- package/dist/llm/provider.js +8 -1
- package/dist/llm/provider.js.map +1 -1
- package/dist/prompts/index.d.ts +32 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +33 -11
- package/dist/prompts/index.js.map +1 -1
- package/dist/session/index.d.ts +32 -3
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +51 -36
- package/dist/session/index.js.map +1 -1
- package/dist/skills/brainstorming.js +33 -33
- package/dist/skills/code-review.js +35 -35
- package/dist/skills/executing-plans.js +18 -18
- package/dist/skills/frontend-design.js +25 -25
- package/dist/skills/git-workflow.js +26 -26
- package/dist/skills/improve-architecture.js +28 -28
- package/dist/skills/neuroweave.js +37 -37
- package/dist/skills/playwright.js +62 -62
- package/dist/skills/prototype.js +20 -20
- package/dist/skills/subagent.js +19 -19
- package/dist/skills/supabase.js +34 -34
- package/dist/skills/systematic-debugging.js +34 -34
- package/dist/skills/tdd.js +29 -29
- package/dist/skills/triage.js +25 -25
- package/dist/skills/verification.js +22 -22
- package/dist/skills/writing-plans.js +32 -32
- package/dist/tools/nwt.js +16 -16
- package/dist/tui/app.d.ts.map +1 -1
- package/dist/tui/app.js +9 -2
- package/dist/tui/app.js.map +1 -1
- package/dist/tui/components/Header.d.ts +8 -0
- package/dist/tui/components/Header.d.ts.map +1 -1
- package/dist/tui/components/Header.js +17 -4
- package/dist/tui/components/Header.js.map +1 -1
- package/dist/tui/components/InitWizard.d.ts +12 -1
- package/dist/tui/components/InitWizard.d.ts.map +1 -1
- package/dist/tui/components/InitWizard.js +58 -3
- package/dist/tui/components/InitWizard.js.map +1 -1
- package/dist/tui/components/ModelSelector.d.ts +3 -1
- package/dist/tui/components/ModelSelector.d.ts.map +1 -1
- package/dist/tui/components/ModelSelector.js +24 -7
- package/dist/tui/components/ModelSelector.js.map +1 -1
- package/dist/tui/components/ToolCall.d.ts.map +1 -1
- package/dist/tui/components/ToolCall.js +1 -6
- package/dist/tui/components/ToolCall.js.map +1 -1
- package/dist/tui/components/UserInput.d.ts.map +1 -1
- package/dist/tui/components/UserInput.js +20 -0
- package/dist/tui/components/UserInput.js.map +1 -1
- package/dist/tui/hooks/useChat.d.ts +22 -0
- package/dist/tui/hooks/useChat.d.ts.map +1 -1
- package/dist/tui/hooks/useChat.js +82 -46
- package/dist/tui/hooks/useChat.js.map +1 -1
- package/dist/tui/hooks/useCommands.d.ts.map +1 -1
- package/dist/tui/hooks/useCommands.js +57 -0
- package/dist/tui/hooks/useCommands.js.map +1 -1
- package/dist/tui/welcome.d.ts.map +1 -1
- package/dist/tui/welcome.js +2 -3
- package/dist/tui/welcome.js.map +1 -1
- package/dist/types.d.ts +79 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/stableStringify.d.ts +21 -0
- package/dist/utils/stableStringify.d.ts.map +1 -0
- package/dist/utils/stableStringify.js +53 -0
- package/dist/utils/stableStringify.js.map +1 -0
- package/dist/utils/thinking.d.ts.map +1 -1
- package/dist/utils/thinking.js +0 -3
- package/dist/utils/thinking.js.map +1 -1
- package/package.json +7 -6
- package/src/app/index.ts +189 -124
- package/src/cache/fingerprint.ts +101 -0
- package/src/cache/index.ts +15 -0
- package/src/cache/smartModel.ts +52 -0
- package/src/cache/stats.ts +199 -0
- package/src/cache/volatile.ts +47 -0
- package/src/cmd/index.tsx +288 -292
- package/src/config/index.ts +156 -148
- package/src/config/providers.ts +234 -234
- package/src/config/types.ts +67 -53
- package/src/hooks/index.ts +111 -111
- package/src/llm/anthropic.ts +388 -243
- package/src/llm/gemini.ts +169 -169
- package/src/llm/index.ts +265 -200
- package/src/llm/openai.ts +243 -196
- package/src/llm/provider.ts +66 -34
- package/src/prompts/index.ts +260 -220
- package/src/session/compactor.ts +103 -103
- package/src/session/index.ts +181 -168
- package/src/session/message.ts +42 -42
- package/src/skills/brainstorming.ts +43 -43
- package/src/skills/code-review.ts +45 -45
- package/src/skills/executing-plans.ts +27 -27
- package/src/skills/frontend-design.ts +35 -35
- package/src/skills/git-workflow.ts +36 -36
- package/src/skills/improve-architecture.ts +38 -38
- package/src/skills/index.ts +136 -136
- package/src/skills/neuroweave.ts +47 -47
- package/src/skills/playwright.ts +72 -72
- package/src/skills/prototype.ts +30 -30
- package/src/skills/subagent.ts +28 -28
- package/src/skills/supabase.ts +44 -44
- package/src/skills/systematic-debugging.ts +44 -44
- package/src/skills/tdd.ts +39 -39
- package/src/skills/triage.ts +35 -35
- package/src/skills/verification.ts +31 -31
- package/src/skills/writing-plans.ts +42 -42
- package/src/tools/nwt.ts +598 -598
- package/src/tools/types.ts +122 -122
- package/src/tui/app.tsx +200 -186
- package/src/tui/components/ChatList.tsx +41 -41
- package/src/tui/components/ChatMessage.tsx +54 -54
- package/src/tui/components/Header.tsx +56 -29
- package/src/tui/components/InitWizard.tsx +217 -132
- package/src/tui/components/Markdown.tsx +35 -35
- package/src/tui/components/ModelSelector.tsx +107 -87
- package/src/tui/components/StatusBar.tsx +30 -30
- package/src/tui/components/Thinking.tsx +17 -17
- package/src/tui/components/ToolCall.tsx +102 -107
- package/src/tui/components/UserInput.tsx +151 -131
- package/src/tui/hooks/useChat.ts +287 -238
- package/src/tui/hooks/useCommands.ts +234 -176
- package/src/tui/index.ts +6 -6
- package/src/tui/welcome.ts +177 -178
- package/src/types.ts +104 -42
- package/src/utils/diff.ts +71 -71
- package/src/utils/project.ts +99 -99
- package/src/utils/stableStringify.ts +47 -0
- package/src/utils/thinking.ts +118 -121
- package/tests/cache/fingerprint.test.ts +75 -0
- package/tests/cache/providerCatalog.test.ts +31 -0
- package/tests/cache/stableStringify.test.ts +43 -0
- package/tests/cache/stats.test.ts +146 -0
- package/tests/cache/volatile.test.ts +75 -0
- package/tests/smoke-pollution.mjs +78 -0
- package/tests/smoke-thinking.mjs +110 -0
- package/tests/smoke-tool-stream.mjs +69 -0
- package/tests/smoke-tool.mjs +117 -0
- package/.nwt/meta.json +0 -5
- package/dist/version.d.ts +0 -16
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -16
- package/dist/version.js.map +0 -1
- package/src/version.ts +0 -16
package/src/skills/index.ts
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skills Registry - Built-in skills for development workflows
|
|
3
|
-
* Inspired by skills.sh (obra/superpowers, mattpocock/skills, anthropics/skills)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface Skill {
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
category: 'planning' | 'debugging' | 'testing' | 'architecture' | 'workflow' | 'browser' | 'review';
|
|
11
|
-
prompt: string;
|
|
12
|
-
autoActivate?: string[]; // Keywords that auto-activate this skill
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Import all skills
|
|
16
|
-
import { writingPlansSkill } from './writing-plans.js';
|
|
17
|
-
import { executingPlansSkill } from './executing-plans.js';
|
|
18
|
-
import { systematicDebuggingSkill } from './systematic-debugging.js';
|
|
19
|
-
import { brainstormingSkill } from './brainstorming.js';
|
|
20
|
-
import { tddSkill } from './tdd.js';
|
|
21
|
-
import { improveArchitectureSkill } from './improve-architecture.js';
|
|
22
|
-
import { verificationSkill } from './verification.js';
|
|
23
|
-
import { codeReviewSkill } from './code-review.js';
|
|
24
|
-
import { prototypeSkill } from './prototype.js';
|
|
25
|
-
import { triageSkill } from './triage.js';
|
|
26
|
-
import { gitWorkflowSkill } from './git-workflow.js';
|
|
27
|
-
import { subagentSkill } from './subagent.js';
|
|
28
|
-
import { playwrightSkill } from './playwright.js';
|
|
29
|
-
import { frontendDesignSkill } from './frontend-design.js';
|
|
30
|
-
import { supabaseSkill } from './supabase.js';
|
|
31
|
-
import { neuroweaveSkill } from './neuroweave.js';
|
|
32
|
-
|
|
33
|
-
// All built-in skills (16 total)
|
|
34
|
-
export const BUILTIN_SKILLS: Skill[] = [
|
|
35
|
-
writingPlansSkill,
|
|
36
|
-
executingPlansSkill,
|
|
37
|
-
systematicDebuggingSkill,
|
|
38
|
-
brainstormingSkill,
|
|
39
|
-
tddSkill,
|
|
40
|
-
improveArchitectureSkill,
|
|
41
|
-
verificationSkill,
|
|
42
|
-
codeReviewSkill,
|
|
43
|
-
prototypeSkill,
|
|
44
|
-
triageSkill,
|
|
45
|
-
gitWorkflowSkill,
|
|
46
|
-
subagentSkill,
|
|
47
|
-
playwrightSkill,
|
|
48
|
-
frontendDesignSkill,
|
|
49
|
-
supabaseSkill,
|
|
50
|
-
neuroweaveSkill,
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
// Skill registry
|
|
54
|
-
export class SkillRegistry {
|
|
55
|
-
private skills: Map<string, Skill> = new Map();
|
|
56
|
-
private activeSkills: Set<string> = new Set();
|
|
57
|
-
|
|
58
|
-
constructor() {
|
|
59
|
-
for (const skill of BUILTIN_SKILLS) {
|
|
60
|
-
this.skills.set(skill.id, skill);
|
|
61
|
-
}
|
|
62
|
-
// Default active skills
|
|
63
|
-
this.activeSkills.add('writing-plans');
|
|
64
|
-
this.activeSkills.add('systematic-debugging');
|
|
65
|
-
this.activeSkills.add('verification');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
get(id: string): Skill | undefined {
|
|
69
|
-
return this.skills.get(id);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
list(): Skill[] {
|
|
73
|
-
return [...this.skills.values()];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
listActive(): Skill[] {
|
|
77
|
-
return [...this.activeSkills].map(id => this.skills.get(id)!).filter(Boolean);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
activate(id: string): boolean {
|
|
81
|
-
if (this.skills.has(id)) {
|
|
82
|
-
this.activeSkills.add(id);
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
deactivate(id: string): boolean {
|
|
89
|
-
return this.activeSkills.delete(id);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
isActive(id: string): boolean {
|
|
93
|
-
return this.activeSkills.has(id);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Get all active skill prompts for system prompt injection
|
|
98
|
-
*/
|
|
99
|
-
getActivePrompts(): string {
|
|
100
|
-
const active = this.listActive();
|
|
101
|
-
if (active.length === 0) return '';
|
|
102
|
-
|
|
103
|
-
return active.map(s => `### Skill: ${s.name}\n${s.prompt}`).join('\n\n');
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Auto-activate skills based on user input
|
|
108
|
-
*/
|
|
109
|
-
autoActivate(input: string): void {
|
|
110
|
-
const lower = input.toLowerCase();
|
|
111
|
-
for (const skill of this.skills.values()) {
|
|
112
|
-
if (skill.autoActivate?.some(kw => lower.includes(kw))) {
|
|
113
|
-
this.activeSkills.add(skill.id);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export {
|
|
120
|
-
writingPlansSkill,
|
|
121
|
-
executingPlansSkill,
|
|
122
|
-
systematicDebuggingSkill,
|
|
123
|
-
brainstormingSkill,
|
|
124
|
-
tddSkill,
|
|
125
|
-
improveArchitectureSkill,
|
|
126
|
-
verificationSkill,
|
|
127
|
-
codeReviewSkill,
|
|
128
|
-
prototypeSkill,
|
|
129
|
-
triageSkill,
|
|
130
|
-
gitWorkflowSkill,
|
|
131
|
-
subagentSkill,
|
|
132
|
-
playwrightSkill,
|
|
133
|
-
frontendDesignSkill,
|
|
134
|
-
supabaseSkill,
|
|
135
|
-
neuroweaveSkill,
|
|
136
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Skills Registry - Built-in skills for development workflows
|
|
3
|
+
* Inspired by skills.sh (obra/superpowers, mattpocock/skills, anthropics/skills)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface Skill {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
category: 'planning' | 'debugging' | 'testing' | 'architecture' | 'workflow' | 'browser' | 'review';
|
|
11
|
+
prompt: string;
|
|
12
|
+
autoActivate?: string[]; // Keywords that auto-activate this skill
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Import all skills
|
|
16
|
+
import { writingPlansSkill } from './writing-plans.js';
|
|
17
|
+
import { executingPlansSkill } from './executing-plans.js';
|
|
18
|
+
import { systematicDebuggingSkill } from './systematic-debugging.js';
|
|
19
|
+
import { brainstormingSkill } from './brainstorming.js';
|
|
20
|
+
import { tddSkill } from './tdd.js';
|
|
21
|
+
import { improveArchitectureSkill } from './improve-architecture.js';
|
|
22
|
+
import { verificationSkill } from './verification.js';
|
|
23
|
+
import { codeReviewSkill } from './code-review.js';
|
|
24
|
+
import { prototypeSkill } from './prototype.js';
|
|
25
|
+
import { triageSkill } from './triage.js';
|
|
26
|
+
import { gitWorkflowSkill } from './git-workflow.js';
|
|
27
|
+
import { subagentSkill } from './subagent.js';
|
|
28
|
+
import { playwrightSkill } from './playwright.js';
|
|
29
|
+
import { frontendDesignSkill } from './frontend-design.js';
|
|
30
|
+
import { supabaseSkill } from './supabase.js';
|
|
31
|
+
import { neuroweaveSkill } from './neuroweave.js';
|
|
32
|
+
|
|
33
|
+
// All built-in skills (16 total)
|
|
34
|
+
export const BUILTIN_SKILLS: Skill[] = [
|
|
35
|
+
writingPlansSkill,
|
|
36
|
+
executingPlansSkill,
|
|
37
|
+
systematicDebuggingSkill,
|
|
38
|
+
brainstormingSkill,
|
|
39
|
+
tddSkill,
|
|
40
|
+
improveArchitectureSkill,
|
|
41
|
+
verificationSkill,
|
|
42
|
+
codeReviewSkill,
|
|
43
|
+
prototypeSkill,
|
|
44
|
+
triageSkill,
|
|
45
|
+
gitWorkflowSkill,
|
|
46
|
+
subagentSkill,
|
|
47
|
+
playwrightSkill,
|
|
48
|
+
frontendDesignSkill,
|
|
49
|
+
supabaseSkill,
|
|
50
|
+
neuroweaveSkill,
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
// Skill registry
|
|
54
|
+
export class SkillRegistry {
|
|
55
|
+
private skills: Map<string, Skill> = new Map();
|
|
56
|
+
private activeSkills: Set<string> = new Set();
|
|
57
|
+
|
|
58
|
+
constructor() {
|
|
59
|
+
for (const skill of BUILTIN_SKILLS) {
|
|
60
|
+
this.skills.set(skill.id, skill);
|
|
61
|
+
}
|
|
62
|
+
// Default active skills
|
|
63
|
+
this.activeSkills.add('writing-plans');
|
|
64
|
+
this.activeSkills.add('systematic-debugging');
|
|
65
|
+
this.activeSkills.add('verification');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get(id: string): Skill | undefined {
|
|
69
|
+
return this.skills.get(id);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
list(): Skill[] {
|
|
73
|
+
return [...this.skills.values()];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
listActive(): Skill[] {
|
|
77
|
+
return [...this.activeSkills].map(id => this.skills.get(id)!).filter(Boolean);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
activate(id: string): boolean {
|
|
81
|
+
if (this.skills.has(id)) {
|
|
82
|
+
this.activeSkills.add(id);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
deactivate(id: string): boolean {
|
|
89
|
+
return this.activeSkills.delete(id);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
isActive(id: string): boolean {
|
|
93
|
+
return this.activeSkills.has(id);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get all active skill prompts for system prompt injection
|
|
98
|
+
*/
|
|
99
|
+
getActivePrompts(): string {
|
|
100
|
+
const active = this.listActive();
|
|
101
|
+
if (active.length === 0) return '';
|
|
102
|
+
|
|
103
|
+
return active.map(s => `### Skill: ${s.name}\n${s.prompt}`).join('\n\n');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Auto-activate skills based on user input
|
|
108
|
+
*/
|
|
109
|
+
autoActivate(input: string): void {
|
|
110
|
+
const lower = input.toLowerCase();
|
|
111
|
+
for (const skill of this.skills.values()) {
|
|
112
|
+
if (skill.autoActivate?.some(kw => lower.includes(kw))) {
|
|
113
|
+
this.activeSkills.add(skill.id);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
writingPlansSkill,
|
|
121
|
+
executingPlansSkill,
|
|
122
|
+
systematicDebuggingSkill,
|
|
123
|
+
brainstormingSkill,
|
|
124
|
+
tddSkill,
|
|
125
|
+
improveArchitectureSkill,
|
|
126
|
+
verificationSkill,
|
|
127
|
+
codeReviewSkill,
|
|
128
|
+
prototypeSkill,
|
|
129
|
+
triageSkill,
|
|
130
|
+
gitWorkflowSkill,
|
|
131
|
+
subagentSkill,
|
|
132
|
+
playwrightSkill,
|
|
133
|
+
frontendDesignSkill,
|
|
134
|
+
supabaseSkill,
|
|
135
|
+
neuroweaveSkill,
|
|
136
|
+
};
|
package/src/skills/neuroweave.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import type { Skill } from './index.js';
|
|
2
|
-
|
|
3
|
-
export const neuroweaveSkill: Skill = {
|
|
4
|
-
id: 'neuroweave',
|
|
5
|
-
name: 'NeuroWeave Timeline',
|
|
6
|
-
description: 'Project evolution memory - track decisions, changes, and milestones',
|
|
7
|
-
category: 'workflow',
|
|
8
|
-
autoActivate: ['timeline', 'history', 'what changed', 'why was', 'track'],
|
|
9
|
-
prompt: `## NeuroWeave Timeline (NWT)
|
|
10
|
-
|
|
11
|
-
You have access to the NWT tool for tracking project evolution. Use it to:
|
|
12
|
-
|
|
13
|
-
### When to Log Events
|
|
14
|
-
- **After significant changes**: New features, refactors, bug fixes
|
|
15
|
-
- **When making decisions**: Architecture choices, library selection, design patterns
|
|
16
|
-
- **At milestones**: Feature complete, tests passing, deployment ready
|
|
17
|
-
|
|
18
|
-
### How to Log
|
|
19
|
-
\`\`\`
|
|
20
|
-
nwt log
|
|
21
|
-
task: "Add user authentication"
|
|
22
|
-
summary: "Implemented JWT-based auth with login/register endpoints"
|
|
23
|
-
reason: "Need user accounts for personalized features"
|
|
24
|
-
files: "src/auth.ts, src/routes/auth.ts"
|
|
25
|
-
tags: "feature, auth, api"
|
|
26
|
-
\`\`\`
|
|
27
|
-
|
|
28
|
-
### Tags Convention
|
|
29
|
-
- \`feature\` - New functionality
|
|
30
|
-
- \`fix\` - Bug fixes
|
|
31
|
-
- \`refactor\` - Code restructuring
|
|
32
|
-
- \`decision\` - Architecture/design decisions
|
|
33
|
-
- \`milestone\` - Project milestones
|
|
34
|
-
- \`config\` - Configuration changes
|
|
35
|
-
- \`docs\` - Documentation updates
|
|
36
|
-
|
|
37
|
-
### Auto-log Rule
|
|
38
|
-
After completing a multi-step task, automatically log it to NWT with:
|
|
39
|
-
- task: What was done (imperative)
|
|
40
|
-
- summary: How it was done
|
|
41
|
-
- reason: Why it was done
|
|
42
|
-
- files: What files changed
|
|
43
|
-
- tags: Category labels
|
|
44
|
-
|
|
45
|
-
### Archives
|
|
46
|
-
Events older than 30 days are automatically archived. Use \`nwt story\` to see the full project narrative.`,
|
|
47
|
-
};
|
|
1
|
+
import type { Skill } from './index.js';
|
|
2
|
+
|
|
3
|
+
export const neuroweaveSkill: Skill = {
|
|
4
|
+
id: 'neuroweave',
|
|
5
|
+
name: 'NeuroWeave Timeline',
|
|
6
|
+
description: 'Project evolution memory - track decisions, changes, and milestones',
|
|
7
|
+
category: 'workflow',
|
|
8
|
+
autoActivate: ['timeline', 'history', 'what changed', 'why was', 'track'],
|
|
9
|
+
prompt: `## NeuroWeave Timeline (NWT)
|
|
10
|
+
|
|
11
|
+
You have access to the NWT tool for tracking project evolution. Use it to:
|
|
12
|
+
|
|
13
|
+
### When to Log Events
|
|
14
|
+
- **After significant changes**: New features, refactors, bug fixes
|
|
15
|
+
- **When making decisions**: Architecture choices, library selection, design patterns
|
|
16
|
+
- **At milestones**: Feature complete, tests passing, deployment ready
|
|
17
|
+
|
|
18
|
+
### How to Log
|
|
19
|
+
\`\`\`
|
|
20
|
+
nwt log
|
|
21
|
+
task: "Add user authentication"
|
|
22
|
+
summary: "Implemented JWT-based auth with login/register endpoints"
|
|
23
|
+
reason: "Need user accounts for personalized features"
|
|
24
|
+
files: "src/auth.ts, src/routes/auth.ts"
|
|
25
|
+
tags: "feature, auth, api"
|
|
26
|
+
\`\`\`
|
|
27
|
+
|
|
28
|
+
### Tags Convention
|
|
29
|
+
- \`feature\` - New functionality
|
|
30
|
+
- \`fix\` - Bug fixes
|
|
31
|
+
- \`refactor\` - Code restructuring
|
|
32
|
+
- \`decision\` - Architecture/design decisions
|
|
33
|
+
- \`milestone\` - Project milestones
|
|
34
|
+
- \`config\` - Configuration changes
|
|
35
|
+
- \`docs\` - Documentation updates
|
|
36
|
+
|
|
37
|
+
### Auto-log Rule
|
|
38
|
+
After completing a multi-step task, automatically log it to NWT with:
|
|
39
|
+
- task: What was done (imperative)
|
|
40
|
+
- summary: How it was done
|
|
41
|
+
- reason: Why it was done
|
|
42
|
+
- files: What files changed
|
|
43
|
+
- tags: Category labels
|
|
44
|
+
|
|
45
|
+
### Archives
|
|
46
|
+
Events older than 30 days are automatically archived. Use \`nwt story\` to see the full project narrative.`,
|
|
47
|
+
};
|
package/src/skills/playwright.ts
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import type { Skill } from './index.js';
|
|
2
|
-
|
|
3
|
-
export const playwrightSkill: Skill = {
|
|
4
|
-
id: 'playwright',
|
|
5
|
-
name: 'Playwright Browser Automation',
|
|
6
|
-
description: 'Automate browser tasks: testing, scraping, screenshots',
|
|
7
|
-
category: 'browser',
|
|
8
|
-
autoActivate: ['browser', 'screenshot', 'scrape', 'web', '网页', '浏览器', 'playwright', 'e2e'],
|
|
9
|
-
prompt: `## Playwright Browser Automation
|
|
10
|
-
|
|
11
|
-
You can use the shell tool to run Playwright commands for browser automation.
|
|
12
|
-
|
|
13
|
-
### Setup
|
|
14
|
-
\`\`\`bash
|
|
15
|
-
npm install playwright
|
|
16
|
-
npx playwright install chromium
|
|
17
|
-
\`\`\`
|
|
18
|
-
|
|
19
|
-
### Common Tasks
|
|
20
|
-
|
|
21
|
-
**Take a screenshot:**
|
|
22
|
-
\`\`\`bash
|
|
23
|
-
npx playwright screenshot https://example.com screenshot.png
|
|
24
|
-
\`\`\`
|
|
25
|
-
|
|
26
|
-
**Scrape page content:**
|
|
27
|
-
\`\`\`javascript
|
|
28
|
-
// save as scrape.js
|
|
29
|
-
const { chromium } = require('playwright');
|
|
30
|
-
(async () => {
|
|
31
|
-
const browser = await chromium.launch();
|
|
32
|
-
const page = await browser.newPage();
|
|
33
|
-
await page.goto('https://example.com');
|
|
34
|
-
const title = await page.title();
|
|
35
|
-
const text = await page.textContent('body');
|
|
36
|
-
console.log('Title:', title);
|
|
37
|
-
console.log('Content:', text.slice(0, 500));
|
|
38
|
-
await browser.close();
|
|
39
|
-
})();
|
|
40
|
-
\`\`\`
|
|
41
|
-
|
|
42
|
-
**Fill and submit forms:**
|
|
43
|
-
\`\`\`javascript
|
|
44
|
-
await page.fill('#username', 'user');
|
|
45
|
-
await page.fill('#password', 'pass');
|
|
46
|
-
await page.click('button[type="submit"]');
|
|
47
|
-
\`\`\`
|
|
48
|
-
|
|
49
|
-
**Wait for dynamic content:**
|
|
50
|
-
\`\`\`javascript
|
|
51
|
-
await page.waitForSelector('.results');
|
|
52
|
-
await page.waitForLoadState('networkidle');
|
|
53
|
-
\`\`\`
|
|
54
|
-
|
|
55
|
-
**E2E Testing:**
|
|
56
|
-
\`\`\`javascript
|
|
57
|
-
const { test, expect } = require('@playwright/test');
|
|
58
|
-
test('login flow', async ({ page }) => {
|
|
59
|
-
await page.goto('/login');
|
|
60
|
-
await page.fill('#email', 'test@example.com');
|
|
61
|
-
await page.fill('#password', 'password');
|
|
62
|
-
await page.click('button[type="submit"]');
|
|
63
|
-
await expect(page).toHaveURL('/dashboard');
|
|
64
|
-
});
|
|
65
|
-
\`\`\`
|
|
66
|
-
|
|
67
|
-
### Best Practices
|
|
68
|
-
- Use \`waitForSelector\` before interacting with elements
|
|
69
|
-
- Use \`page.locator()\` for reliable element selection
|
|
70
|
-
- Take screenshots for visual verification
|
|
71
|
-
- Use \`--headed\` flag to watch: \`npx playwright test --headed\``,
|
|
72
|
-
};
|
|
1
|
+
import type { Skill } from './index.js';
|
|
2
|
+
|
|
3
|
+
export const playwrightSkill: Skill = {
|
|
4
|
+
id: 'playwright',
|
|
5
|
+
name: 'Playwright Browser Automation',
|
|
6
|
+
description: 'Automate browser tasks: testing, scraping, screenshots',
|
|
7
|
+
category: 'browser',
|
|
8
|
+
autoActivate: ['browser', 'screenshot', 'scrape', 'web', '网页', '浏览器', 'playwright', 'e2e'],
|
|
9
|
+
prompt: `## Playwright Browser Automation
|
|
10
|
+
|
|
11
|
+
You can use the shell tool to run Playwright commands for browser automation.
|
|
12
|
+
|
|
13
|
+
### Setup
|
|
14
|
+
\`\`\`bash
|
|
15
|
+
npm install playwright
|
|
16
|
+
npx playwright install chromium
|
|
17
|
+
\`\`\`
|
|
18
|
+
|
|
19
|
+
### Common Tasks
|
|
20
|
+
|
|
21
|
+
**Take a screenshot:**
|
|
22
|
+
\`\`\`bash
|
|
23
|
+
npx playwright screenshot https://example.com screenshot.png
|
|
24
|
+
\`\`\`
|
|
25
|
+
|
|
26
|
+
**Scrape page content:**
|
|
27
|
+
\`\`\`javascript
|
|
28
|
+
// save as scrape.js
|
|
29
|
+
const { chromium } = require('playwright');
|
|
30
|
+
(async () => {
|
|
31
|
+
const browser = await chromium.launch();
|
|
32
|
+
const page = await browser.newPage();
|
|
33
|
+
await page.goto('https://example.com');
|
|
34
|
+
const title = await page.title();
|
|
35
|
+
const text = await page.textContent('body');
|
|
36
|
+
console.log('Title:', title);
|
|
37
|
+
console.log('Content:', text.slice(0, 500));
|
|
38
|
+
await browser.close();
|
|
39
|
+
})();
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
**Fill and submit forms:**
|
|
43
|
+
\`\`\`javascript
|
|
44
|
+
await page.fill('#username', 'user');
|
|
45
|
+
await page.fill('#password', 'pass');
|
|
46
|
+
await page.click('button[type="submit"]');
|
|
47
|
+
\`\`\`
|
|
48
|
+
|
|
49
|
+
**Wait for dynamic content:**
|
|
50
|
+
\`\`\`javascript
|
|
51
|
+
await page.waitForSelector('.results');
|
|
52
|
+
await page.waitForLoadState('networkidle');
|
|
53
|
+
\`\`\`
|
|
54
|
+
|
|
55
|
+
**E2E Testing:**
|
|
56
|
+
\`\`\`javascript
|
|
57
|
+
const { test, expect } = require('@playwright/test');
|
|
58
|
+
test('login flow', async ({ page }) => {
|
|
59
|
+
await page.goto('/login');
|
|
60
|
+
await page.fill('#email', 'test@example.com');
|
|
61
|
+
await page.fill('#password', 'password');
|
|
62
|
+
await page.click('button[type="submit"]');
|
|
63
|
+
await expect(page).toHaveURL('/dashboard');
|
|
64
|
+
});
|
|
65
|
+
\`\`\`
|
|
66
|
+
|
|
67
|
+
### Best Practices
|
|
68
|
+
- Use \`waitForSelector\` before interacting with elements
|
|
69
|
+
- Use \`page.locator()\` for reliable element selection
|
|
70
|
+
- Take screenshots for visual verification
|
|
71
|
+
- Use \`--headed\` flag to watch: \`npx playwright test --headed\``,
|
|
72
|
+
};
|
package/src/skills/prototype.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type { Skill } from './index.js';
|
|
2
|
-
|
|
3
|
-
export const prototypeSkill: Skill = {
|
|
4
|
-
id: 'prototype',
|
|
5
|
-
name: 'Rapid Prototyping',
|
|
6
|
-
description: 'Quick working prototypes before production code',
|
|
7
|
-
category: 'workflow',
|
|
8
|
-
autoActivate: ['prototype', '原型', '快速实现', 'quick', 'demo'],
|
|
9
|
-
prompt: `## Rapid Prototyping Mode
|
|
10
|
-
|
|
11
|
-
When the user wants to quickly try something:
|
|
12
|
-
|
|
13
|
-
### Principles
|
|
14
|
-
- **Working > Perfect** - Get something running first
|
|
15
|
-
- **Skip boilerplate** - Use minimal setup
|
|
16
|
-
- **Hardcode first** - Constants before config
|
|
17
|
-
- **Single file** - Don't split until needed
|
|
18
|
-
|
|
19
|
-
### Workflow
|
|
20
|
-
1. Create a single file with everything
|
|
21
|
-
2. Make it work end-to-end
|
|
22
|
-
3. Show the result
|
|
23
|
-
4. Ask: "Want me to refactor this into proper code?"
|
|
24
|
-
|
|
25
|
-
### When to Use
|
|
26
|
-
- Exploring a new API or library
|
|
27
|
-
- Testing a design idea
|
|
28
|
-
- Creating a quick demo
|
|
29
|
-
- Validating an approach`,
|
|
30
|
-
};
|
|
1
|
+
import type { Skill } from './index.js';
|
|
2
|
+
|
|
3
|
+
export const prototypeSkill: Skill = {
|
|
4
|
+
id: 'prototype',
|
|
5
|
+
name: 'Rapid Prototyping',
|
|
6
|
+
description: 'Quick working prototypes before production code',
|
|
7
|
+
category: 'workflow',
|
|
8
|
+
autoActivate: ['prototype', '原型', '快速实现', 'quick', 'demo'],
|
|
9
|
+
prompt: `## Rapid Prototyping Mode
|
|
10
|
+
|
|
11
|
+
When the user wants to quickly try something:
|
|
12
|
+
|
|
13
|
+
### Principles
|
|
14
|
+
- **Working > Perfect** - Get something running first
|
|
15
|
+
- **Skip boilerplate** - Use minimal setup
|
|
16
|
+
- **Hardcode first** - Constants before config
|
|
17
|
+
- **Single file** - Don't split until needed
|
|
18
|
+
|
|
19
|
+
### Workflow
|
|
20
|
+
1. Create a single file with everything
|
|
21
|
+
2. Make it work end-to-end
|
|
22
|
+
3. Show the result
|
|
23
|
+
4. Ask: "Want me to refactor this into proper code?"
|
|
24
|
+
|
|
25
|
+
### When to Use
|
|
26
|
+
- Exploring a new API or library
|
|
27
|
+
- Testing a design idea
|
|
28
|
+
- Creating a quick demo
|
|
29
|
+
- Validating an approach`,
|
|
30
|
+
};
|
package/src/skills/subagent.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import type { Skill } from './index.js';
|
|
2
|
-
|
|
3
|
-
export const subagentSkill: Skill = {
|
|
4
|
-
id: 'subagent',
|
|
5
|
-
name: 'Subagent Delegation',
|
|
6
|
-
description: 'Break complex tasks into parallel subtasks',
|
|
7
|
-
category: 'workflow',
|
|
8
|
-
prompt: `## Task Decomposition
|
|
9
|
-
|
|
10
|
-
For complex tasks, think about what can be done in parallel:
|
|
11
|
-
|
|
12
|
-
### Parallel-izable Tasks
|
|
13
|
-
- Reading multiple independent files
|
|
14
|
-
- Running multiple independent commands
|
|
15
|
-
- Creating multiple independent files
|
|
16
|
-
- Testing multiple independent features
|
|
17
|
-
|
|
18
|
-
### Sequential Tasks (must be done in order)
|
|
19
|
-
- Build → Test → Deploy
|
|
20
|
-
- Read → Analyze → Write
|
|
21
|
-
- Design → Implement → Verify
|
|
22
|
-
|
|
23
|
-
### When Task is Complex
|
|
24
|
-
1. Identify independent subtasks
|
|
25
|
-
2. Execute them (in parallel if possible)
|
|
26
|
-
3. Combine results
|
|
27
|
-
4. Verify the whole`,
|
|
28
|
-
};
|
|
1
|
+
import type { Skill } from './index.js';
|
|
2
|
+
|
|
3
|
+
export const subagentSkill: Skill = {
|
|
4
|
+
id: 'subagent',
|
|
5
|
+
name: 'Subagent Delegation',
|
|
6
|
+
description: 'Break complex tasks into parallel subtasks',
|
|
7
|
+
category: 'workflow',
|
|
8
|
+
prompt: `## Task Decomposition
|
|
9
|
+
|
|
10
|
+
For complex tasks, think about what can be done in parallel:
|
|
11
|
+
|
|
12
|
+
### Parallel-izable Tasks
|
|
13
|
+
- Reading multiple independent files
|
|
14
|
+
- Running multiple independent commands
|
|
15
|
+
- Creating multiple independent files
|
|
16
|
+
- Testing multiple independent features
|
|
17
|
+
|
|
18
|
+
### Sequential Tasks (must be done in order)
|
|
19
|
+
- Build → Test → Deploy
|
|
20
|
+
- Read → Analyze → Write
|
|
21
|
+
- Design → Implement → Verify
|
|
22
|
+
|
|
23
|
+
### When Task is Complex
|
|
24
|
+
1. Identify independent subtasks
|
|
25
|
+
2. Execute them (in parallel if possible)
|
|
26
|
+
3. Combine results
|
|
27
|
+
4. Verify the whole`,
|
|
28
|
+
};
|