@compilr-dev/agents-coding 0.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/README.md +788 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +75 -0
- package/dist/skills/index.d.ts +39 -0
- package/dist/skills/index.js +322 -0
- package/dist/tools/git/branch.d.ts +17 -0
- package/dist/tools/git/branch.js +264 -0
- package/dist/tools/git/commit.d.ts +23 -0
- package/dist/tools/git/commit.js +280 -0
- package/dist/tools/git/diff.d.ts +19 -0
- package/dist/tools/git/diff.js +221 -0
- package/dist/tools/git/index.d.ts +10 -0
- package/dist/tools/git/index.js +11 -0
- package/dist/tools/git/log.d.ts +19 -0
- package/dist/tools/git/log.js +235 -0
- package/dist/tools/git/stash.d.ts +17 -0
- package/dist/tools/git/stash.js +294 -0
- package/dist/tools/git/status.d.ts +19 -0
- package/dist/tools/git/status.js +160 -0
- package/dist/tools/git/types.d.ts +293 -0
- package/dist/tools/git/types.js +4 -0
- package/dist/tools/git/utils.d.ts +58 -0
- package/dist/tools/git/utils.js +197 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.js +5 -0
- package/dist/tools/project/detect.d.ts +19 -0
- package/dist/tools/project/detect.js +341 -0
- package/dist/tools/project/find-root.d.ts +21 -0
- package/dist/tools/project/find-root.js +239 -0
- package/dist/tools/project/index.d.ts +6 -0
- package/dist/tools/project/index.js +5 -0
- package/dist/tools/project/types.d.ts +83 -0
- package/dist/tools/project/types.js +4 -0
- package/dist/tools/runners/build.d.ts +19 -0
- package/dist/tools/runners/build.js +306 -0
- package/dist/tools/runners/format.d.ts +19 -0
- package/dist/tools/runners/format.js +376 -0
- package/dist/tools/runners/index.d.ts +9 -0
- package/dist/tools/runners/index.js +9 -0
- package/dist/tools/runners/lint.d.ts +19 -0
- package/dist/tools/runners/lint.js +356 -0
- package/dist/tools/runners/test.d.ts +19 -0
- package/dist/tools/runners/test.js +386 -0
- package/dist/tools/runners/types.d.ts +97 -0
- package/dist/tools/runners/types.js +4 -0
- package/dist/tools/runners/utils.d.ts +69 -0
- package/dist/tools/runners/utils.js +179 -0
- package/dist/tools/search/definition.d.ts +19 -0
- package/dist/tools/search/definition.js +305 -0
- package/dist/tools/search/index.d.ts +8 -0
- package/dist/tools/search/index.js +8 -0
- package/dist/tools/search/references.d.ts +19 -0
- package/dist/tools/search/references.js +179 -0
- package/dist/tools/search/todos.d.ts +19 -0
- package/dist/tools/search/todos.js +269 -0
- package/dist/tools/search/types.d.ts +132 -0
- package/dist/tools/search/types.js +4 -0
- package/dist/tools/search/utils.d.ts +45 -0
- package/dist/tools/search/utils.js +152 -0
- package/package.json +88 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @compilr-dev/agents-coding
|
|
3
|
+
*
|
|
4
|
+
* Coding-specific tools for @compilr-dev/agents
|
|
5
|
+
* Git operations, project detection, smart runners, and code search
|
|
6
|
+
*/
|
|
7
|
+
export { gitStatusTool, gitDiffTool, gitLogTool, createGitStatusTool, createGitDiffTool, createGitLogTool, gitCommitTool, gitBranchTool, gitStashTool, createGitCommitTool, createGitBranchTool, createGitStashTool, } from './tools/git/index.js';
|
|
8
|
+
export type { GitStatusInput, GitStatusResult, GitFileStatus, GitDiffInput, GitDiffResult, GitLogInput, GitLogResult, GitCommit, GitCommitInput, GitCommitResult, CommitSafetyWarning, GitBranchAction, GitBranchInput, GitBranchInfo, GitBranchResult, GitStashAction, GitStashInput, GitStashEntry, GitStashResult, } from './tools/git/index.js';
|
|
9
|
+
export { detectProjectTool, findProjectRootTool, createDetectProjectTool, createFindProjectRootTool, } from './tools/project/index.js';
|
|
10
|
+
export type { DetectProjectInput, DetectProjectResult, ProjectType, FindProjectRootInput, FindProjectRootResult, } from './tools/project/index.js';
|
|
11
|
+
export { runTestsTool, runLintTool, runBuildTool, runFormatTool, createRunTestsTool, createRunLintTool, createRunBuildTool, createRunFormatTool, } from './tools/runners/index.js';
|
|
12
|
+
export type { BaseRunnerInput, BaseRunnerResult, RunTestsInput, RunTestsResult, RunLintInput, RunLintResult, RunBuildInput, RunBuildResult, RunFormatInput, RunFormatResult, } from './tools/runners/index.js';
|
|
13
|
+
export { findDefinitionTool, findReferencesTool, findTodosTool, createFindDefinitionTool, createFindReferencesTool, createFindTodosTool, } from './tools/search/index.js';
|
|
14
|
+
export type { DefinitionType, Definition, FindDefinitionInput, FindDefinitionResult, Reference, FindReferencesInput, FindReferencesResult, TodoType, TodoComment, FindTodosInput, FindTodosResult, } from './tools/search/index.js';
|
|
15
|
+
export { codingSkills, gitWorkflowSkill, testDrivenSkill, codeNavigationSkill, prWorkflowSkill, projectOnboardingSkill, codeOptimizationSkill, defineSkill, type Skill, } from './skills/index.js';
|
|
16
|
+
/**
|
|
17
|
+
* All coding tools for easy registration
|
|
18
|
+
*/
|
|
19
|
+
export declare const codingTools: {
|
|
20
|
+
readonly gitStatus: import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitStatusInput>;
|
|
21
|
+
readonly gitDiff: import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitDiffInput>;
|
|
22
|
+
readonly gitLog: import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitLogInput>;
|
|
23
|
+
readonly gitCommit: import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitCommitInput>;
|
|
24
|
+
readonly gitBranch: import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitBranchInput>;
|
|
25
|
+
readonly gitStash: import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitStashInput>;
|
|
26
|
+
readonly detectProject: import("@compilr-dev/agents").Tool<import("./tools/project/types.js").DetectProjectInput>;
|
|
27
|
+
readonly findProjectRoot: import("@compilr-dev/agents").Tool<import("./tools/project/types.js").FindProjectRootInput>;
|
|
28
|
+
readonly runTests: import("@compilr-dev/agents").Tool<import("./tools/runners/types.js").RunTestsInput>;
|
|
29
|
+
readonly runLint: import("@compilr-dev/agents").Tool<import("./tools/runners/types.js").RunLintInput>;
|
|
30
|
+
readonly runBuild: import("@compilr-dev/agents").Tool<import("./tools/runners/types.js").RunBuildInput>;
|
|
31
|
+
readonly runFormat: import("@compilr-dev/agents").Tool<import("./tools/runners/types.js").RunFormatInput>;
|
|
32
|
+
readonly findDefinition: import("@compilr-dev/agents").Tool<import("./tools/search/types.js").FindDefinitionInput>;
|
|
33
|
+
readonly findReferences: import("@compilr-dev/agents").Tool<import("./tools/search/types.js").FindReferencesInput>;
|
|
34
|
+
readonly findTodos: import("@compilr-dev/agents").Tool<import("./tools/search/types.js").FindTodosInput>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Array of all coding tools
|
|
38
|
+
*/
|
|
39
|
+
export declare const allCodingTools: readonly [import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitStatusInput>, import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitDiffInput>, import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitLogInput>, import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitCommitInput>, import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitBranchInput>, import("@compilr-dev/agents").Tool<import("./tools/git/types.js").GitStashInput>, import("@compilr-dev/agents").Tool<import("./tools/project/types.js").DetectProjectInput>, import("@compilr-dev/agents").Tool<import("./tools/project/types.js").FindProjectRootInput>, import("@compilr-dev/agents").Tool<import("./tools/runners/types.js").RunTestsInput>, import("@compilr-dev/agents").Tool<import("./tools/runners/types.js").RunLintInput>, import("@compilr-dev/agents").Tool<import("./tools/runners/types.js").RunBuildInput>, import("@compilr-dev/agents").Tool<import("./tools/runners/types.js").RunFormatInput>, import("@compilr-dev/agents").Tool<import("./tools/search/types.js").FindDefinitionInput>, import("@compilr-dev/agents").Tool<import("./tools/search/types.js").FindReferencesInput>, import("@compilr-dev/agents").Tool<import("./tools/search/types.js").FindTodosInput>];
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @compilr-dev/agents-coding
|
|
3
|
+
*
|
|
4
|
+
* Coding-specific tools for @compilr-dev/agents
|
|
5
|
+
* Git operations, project detection, smart runners, and code search
|
|
6
|
+
*/
|
|
7
|
+
// Git tools (Phase 1 + Phase 2)
|
|
8
|
+
export {
|
|
9
|
+
// Phase 1: Read-only
|
|
10
|
+
gitStatusTool, gitDiffTool, gitLogTool, createGitStatusTool, createGitDiffTool, createGitLogTool,
|
|
11
|
+
// Phase 2: Core git
|
|
12
|
+
gitCommitTool, gitBranchTool, gitStashTool, createGitCommitTool, createGitBranchTool, createGitStashTool, } from './tools/git/index.js';
|
|
13
|
+
// Project detection tools
|
|
14
|
+
export { detectProjectTool, findProjectRootTool, createDetectProjectTool, createFindProjectRootTool, } from './tools/project/index.js';
|
|
15
|
+
// Smart Runner tools (Phase 3)
|
|
16
|
+
export { runTestsTool, runLintTool, runBuildTool, runFormatTool, createRunTestsTool, createRunLintTool, createRunBuildTool, createRunFormatTool, } from './tools/runners/index.js';
|
|
17
|
+
// Code Search tools (Phase 4)
|
|
18
|
+
export { findDefinitionTool, findReferencesTool, findTodosTool, createFindDefinitionTool, createFindReferencesTool, createFindTodosTool, } from './tools/search/index.js';
|
|
19
|
+
// Skills (Phase 5)
|
|
20
|
+
export { codingSkills, gitWorkflowSkill, testDrivenSkill, codeNavigationSkill, prWorkflowSkill, projectOnboardingSkill, codeOptimizationSkill, defineSkill, } from './skills/index.js';
|
|
21
|
+
// Re-export all tools as a collection
|
|
22
|
+
import { gitStatusTool, gitDiffTool, gitLogTool, gitCommitTool, gitBranchTool, gitStashTool, } from './tools/git/index.js';
|
|
23
|
+
import { detectProjectTool, findProjectRootTool } from './tools/project/index.js';
|
|
24
|
+
import { runTestsTool, runLintTool, runBuildTool, runFormatTool } from './tools/runners/index.js';
|
|
25
|
+
import { findDefinitionTool, findReferencesTool, findTodosTool } from './tools/search/index.js';
|
|
26
|
+
/**
|
|
27
|
+
* All coding tools for easy registration
|
|
28
|
+
*/
|
|
29
|
+
export const codingTools = {
|
|
30
|
+
// Phase 1: Read-only git
|
|
31
|
+
gitStatus: gitStatusTool,
|
|
32
|
+
gitDiff: gitDiffTool,
|
|
33
|
+
gitLog: gitLogTool,
|
|
34
|
+
// Phase 2: Core git
|
|
35
|
+
gitCommit: gitCommitTool,
|
|
36
|
+
gitBranch: gitBranchTool,
|
|
37
|
+
gitStash: gitStashTool,
|
|
38
|
+
// Project detection
|
|
39
|
+
detectProject: detectProjectTool,
|
|
40
|
+
findProjectRoot: findProjectRootTool,
|
|
41
|
+
// Phase 3: Smart runners
|
|
42
|
+
runTests: runTestsTool,
|
|
43
|
+
runLint: runLintTool,
|
|
44
|
+
runBuild: runBuildTool,
|
|
45
|
+
runFormat: runFormatTool,
|
|
46
|
+
// Phase 4: Code search
|
|
47
|
+
findDefinition: findDefinitionTool,
|
|
48
|
+
findReferences: findReferencesTool,
|
|
49
|
+
findTodos: findTodosTool,
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Array of all coding tools
|
|
53
|
+
*/
|
|
54
|
+
export const allCodingTools = [
|
|
55
|
+
// Phase 1
|
|
56
|
+
gitStatusTool,
|
|
57
|
+
gitDiffTool,
|
|
58
|
+
gitLogTool,
|
|
59
|
+
// Phase 2
|
|
60
|
+
gitCommitTool,
|
|
61
|
+
gitBranchTool,
|
|
62
|
+
gitStashTool,
|
|
63
|
+
// Project detection
|
|
64
|
+
detectProjectTool,
|
|
65
|
+
findProjectRootTool,
|
|
66
|
+
// Phase 3
|
|
67
|
+
runTestsTool,
|
|
68
|
+
runLintTool,
|
|
69
|
+
runBuildTool,
|
|
70
|
+
runFormatTool,
|
|
71
|
+
// Phase 4
|
|
72
|
+
findDefinitionTool,
|
|
73
|
+
findReferencesTool,
|
|
74
|
+
findTodosTool,
|
|
75
|
+
];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coding-specific Skills for @compilr-dev/agents-coding
|
|
3
|
+
*
|
|
4
|
+
* These skills are designed to work with the coding tools and provide
|
|
5
|
+
* specialized guidance for common development workflows.
|
|
6
|
+
*/
|
|
7
|
+
import { type Skill } from '@compilr-dev/agents';
|
|
8
|
+
/**
|
|
9
|
+
* Git workflow skill - Safe git operations with proper verification
|
|
10
|
+
*/
|
|
11
|
+
export declare const gitWorkflowSkill: Skill;
|
|
12
|
+
/**
|
|
13
|
+
* Test-driven development skill
|
|
14
|
+
*/
|
|
15
|
+
export declare const testDrivenSkill: Skill;
|
|
16
|
+
/**
|
|
17
|
+
* Code navigation skill
|
|
18
|
+
*/
|
|
19
|
+
export declare const codeNavigationSkill: Skill;
|
|
20
|
+
/**
|
|
21
|
+
* Pull request workflow skill
|
|
22
|
+
*/
|
|
23
|
+
export declare const prWorkflowSkill: Skill;
|
|
24
|
+
/**
|
|
25
|
+
* Project onboarding skill
|
|
26
|
+
*/
|
|
27
|
+
export declare const projectOnboardingSkill: Skill;
|
|
28
|
+
/**
|
|
29
|
+
* Code optimization skill
|
|
30
|
+
*/
|
|
31
|
+
export declare const codeOptimizationSkill: Skill;
|
|
32
|
+
/**
|
|
33
|
+
* All coding skills
|
|
34
|
+
*/
|
|
35
|
+
export declare const codingSkills: Skill[];
|
|
36
|
+
/**
|
|
37
|
+
* Export individual skills for selective use
|
|
38
|
+
*/
|
|
39
|
+
export { defineSkill, type Skill } from '@compilr-dev/agents';
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coding-specific Skills for @compilr-dev/agents-coding
|
|
3
|
+
*
|
|
4
|
+
* These skills are designed to work with the coding tools and provide
|
|
5
|
+
* specialized guidance for common development workflows.
|
|
6
|
+
*/
|
|
7
|
+
import { defineSkill } from '@compilr-dev/agents';
|
|
8
|
+
/**
|
|
9
|
+
* Git workflow skill - Safe git operations with proper verification
|
|
10
|
+
*/
|
|
11
|
+
export const gitWorkflowSkill = defineSkill({
|
|
12
|
+
name: 'git-workflow',
|
|
13
|
+
description: 'Best practices for git operations with safety checks',
|
|
14
|
+
prompt: `You are now in git workflow mode. Follow these practices:
|
|
15
|
+
|
|
16
|
+
## Before Any Destructive Operation
|
|
17
|
+
1. **Always check status first**: Use gitStatus to see current state
|
|
18
|
+
2. **Review changes**: Use gitDiff to understand what will be affected
|
|
19
|
+
3. **Verify branch**: Confirm you're on the correct branch
|
|
20
|
+
|
|
21
|
+
## Safe Commit Workflow
|
|
22
|
+
1. Check status: gitStatus to see staged/unstaged files
|
|
23
|
+
2. Review diff: gitDiff to verify changes are intentional
|
|
24
|
+
3. Stage selectively: Only commit related changes together
|
|
25
|
+
4. Write clear message: Describe WHY, not just WHAT
|
|
26
|
+
|
|
27
|
+
## Branch Operations
|
|
28
|
+
1. Never delete the current branch
|
|
29
|
+
2. Check for uncommitted changes before switching
|
|
30
|
+
3. Use descriptive branch names: feat/, fix/, chore/
|
|
31
|
+
|
|
32
|
+
## Danger Zones - ALWAYS VERIFY
|
|
33
|
+
- git reset --hard: Will lose uncommitted changes
|
|
34
|
+
- git checkout -- <file>: Will discard local changes
|
|
35
|
+
- git clean: Will delete untracked files
|
|
36
|
+
- Force push: Can overwrite remote history
|
|
37
|
+
|
|
38
|
+
## Recovery
|
|
39
|
+
- Use gitStash before risky operations
|
|
40
|
+
- Check gitLog to find previous states
|
|
41
|
+
- Stashed changes can be recovered with stash pop/apply
|
|
42
|
+
|
|
43
|
+
When in doubt, stash your changes first.`,
|
|
44
|
+
tags: ['git', 'workflow', 'safety'],
|
|
45
|
+
version: '1.0.0',
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Test-driven development skill
|
|
49
|
+
*/
|
|
50
|
+
export const testDrivenSkill = defineSkill({
|
|
51
|
+
name: 'test-driven',
|
|
52
|
+
description: 'Test-driven development workflow with smart runners',
|
|
53
|
+
prompt: `You are now in test-driven development mode. Follow the TDD cycle:
|
|
54
|
+
|
|
55
|
+
## Red-Green-Refactor Cycle
|
|
56
|
+
1. **Red**: Write a failing test first
|
|
57
|
+
2. **Green**: Write minimal code to pass the test
|
|
58
|
+
3. **Refactor**: Clean up while keeping tests green
|
|
59
|
+
|
|
60
|
+
## Using the Tools
|
|
61
|
+
1. **runTests**: Run tests frequently, after every small change
|
|
62
|
+
2. **runLint**: Check for code style issues before committing
|
|
63
|
+
3. **runBuild**: Verify the build passes before pushing
|
|
64
|
+
4. **runFormat**: Auto-format code to maintain consistency
|
|
65
|
+
|
|
66
|
+
## Workflow
|
|
67
|
+
\`\`\`
|
|
68
|
+
1. Write test → runTests (should fail)
|
|
69
|
+
2. Implement feature → runTests (should pass)
|
|
70
|
+
3. Refactor → runTests (should still pass)
|
|
71
|
+
4. Clean up → runLint + runFormat
|
|
72
|
+
5. Final check → runBuild
|
|
73
|
+
6. Commit
|
|
74
|
+
\`\`\`
|
|
75
|
+
|
|
76
|
+
## Best Practices
|
|
77
|
+
- Test one thing per test case
|
|
78
|
+
- Use descriptive test names that explain the expected behavior
|
|
79
|
+
- Test edge cases and error conditions
|
|
80
|
+
- Keep tests fast - mock external dependencies
|
|
81
|
+
- Run the full test suite before pushing
|
|
82
|
+
|
|
83
|
+
## When Tests Fail
|
|
84
|
+
1. Read the error message carefully
|
|
85
|
+
2. Check if the test itself is correct
|
|
86
|
+
3. Isolate the failure to specific code
|
|
87
|
+
4. Fix incrementally and re-run
|
|
88
|
+
|
|
89
|
+
Never commit with failing tests.`,
|
|
90
|
+
tags: ['testing', 'tdd', 'workflow'],
|
|
91
|
+
version: '1.0.0',
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Code navigation skill
|
|
95
|
+
*/
|
|
96
|
+
export const codeNavigationSkill = defineSkill({
|
|
97
|
+
name: 'code-navigation',
|
|
98
|
+
description: 'Effectively navigate and understand codebases',
|
|
99
|
+
prompt: `You are now in code navigation mode. Use these strategies:
|
|
100
|
+
|
|
101
|
+
## Finding Code
|
|
102
|
+
1. **findDefinition**: Locate where a symbol is defined
|
|
103
|
+
- Functions, classes, interfaces, types, constants
|
|
104
|
+
- Supports: TypeScript, JavaScript, Python, Rust, Go, Java, Kotlin
|
|
105
|
+
|
|
106
|
+
2. **findReferences**: Find all usages of a symbol
|
|
107
|
+
- Use excludeDefinitions: true to see only usages
|
|
108
|
+
- Helps understand impact of changes
|
|
109
|
+
|
|
110
|
+
3. **findTodos**: Locate technical debt and work items
|
|
111
|
+
- Types: TODO, FIXME, HACK, XXX, NOTE, BUG, WARN
|
|
112
|
+
- Use includeAuthor: true to see who added them
|
|
113
|
+
|
|
114
|
+
## Understanding a New Codebase
|
|
115
|
+
1. Start with detectProject to understand the tech stack
|
|
116
|
+
2. Find entry points (main, index, app files)
|
|
117
|
+
3. Trace the flow from entry point using findReferences
|
|
118
|
+
4. Look at TODOs to understand known issues
|
|
119
|
+
|
|
120
|
+
## Before Making Changes
|
|
121
|
+
1. Find the symbol definition
|
|
122
|
+
2. Find all references to understand impact
|
|
123
|
+
3. Check for TODOs/FIXMEs in related code
|
|
124
|
+
4. Understand the patterns used nearby
|
|
125
|
+
|
|
126
|
+
## Search Strategies
|
|
127
|
+
- Start broad, then narrow with fileType filter
|
|
128
|
+
- Use excludeDefinitions to focus on usages
|
|
129
|
+
- Check multiple related symbols
|
|
130
|
+
- Look at import statements to understand dependencies
|
|
131
|
+
|
|
132
|
+
## Common Patterns
|
|
133
|
+
- "Where is X defined?" → findDefinition
|
|
134
|
+
- "What uses X?" → findReferences with excludeDefinitions
|
|
135
|
+
- "What needs work?" → findTodos
|
|
136
|
+
- "What's the tech stack?" → detectProject`,
|
|
137
|
+
tags: ['navigation', 'search', 'understanding'],
|
|
138
|
+
version: '1.0.0',
|
|
139
|
+
});
|
|
140
|
+
/**
|
|
141
|
+
* Pull request workflow skill
|
|
142
|
+
*/
|
|
143
|
+
export const prWorkflowSkill = defineSkill({
|
|
144
|
+
name: 'pr-workflow',
|
|
145
|
+
description: 'Pull request creation and review workflow',
|
|
146
|
+
prompt: `You are now in pull request workflow mode.
|
|
147
|
+
|
|
148
|
+
## Creating a PR
|
|
149
|
+
1. **Prepare the branch**
|
|
150
|
+
- gitStatus: Ensure all changes are committed
|
|
151
|
+
- gitLog: Review commits that will be in the PR
|
|
152
|
+
- gitDiff main...HEAD: See full diff against base
|
|
153
|
+
|
|
154
|
+
2. **Pre-flight checks**
|
|
155
|
+
- runTests: All tests must pass
|
|
156
|
+
- runLint: No lint errors
|
|
157
|
+
- runBuild: Build must succeed
|
|
158
|
+
- findTodos: No critical TODOs in changed code
|
|
159
|
+
|
|
160
|
+
3. **Write the PR description**
|
|
161
|
+
- Summary: What does this PR do?
|
|
162
|
+
- Why: What problem does it solve?
|
|
163
|
+
- How: Brief technical approach
|
|
164
|
+
- Testing: How was it tested?
|
|
165
|
+
- Screenshots: If UI changes
|
|
166
|
+
|
|
167
|
+
## Reviewing a PR
|
|
168
|
+
1. **Understand context**
|
|
169
|
+
- Read the PR description
|
|
170
|
+
- Check linked issues
|
|
171
|
+
- gitLog to see commit history
|
|
172
|
+
|
|
173
|
+
2. **Review the code**
|
|
174
|
+
- gitDiff to see all changes
|
|
175
|
+
- findDefinition for unfamiliar symbols
|
|
176
|
+
- findReferences to check impact
|
|
177
|
+
|
|
178
|
+
3. **Check quality**
|
|
179
|
+
- runTests: Do tests pass?
|
|
180
|
+
- runLint: Any new lint issues?
|
|
181
|
+
- findTodos: Any new TODOs without context?
|
|
182
|
+
|
|
183
|
+
4. **Provide feedback**
|
|
184
|
+
- Be specific with line references
|
|
185
|
+
- Suggest alternatives, not just problems
|
|
186
|
+
- Distinguish blocking vs. non-blocking comments
|
|
187
|
+
|
|
188
|
+
## Before Merging
|
|
189
|
+
- [ ] All CI checks pass
|
|
190
|
+
- [ ] No unresolved comments
|
|
191
|
+
- [ ] Documentation updated if needed
|
|
192
|
+
- [ ] Changelog updated if needed`,
|
|
193
|
+
tags: ['git', 'pr', 'review', 'workflow'],
|
|
194
|
+
version: '1.0.0',
|
|
195
|
+
});
|
|
196
|
+
/**
|
|
197
|
+
* Project onboarding skill
|
|
198
|
+
*/
|
|
199
|
+
export const projectOnboardingSkill = defineSkill({
|
|
200
|
+
name: 'project-onboarding',
|
|
201
|
+
description: 'Quickly understand and navigate a new project',
|
|
202
|
+
prompt: `You are now in project onboarding mode. Use this systematic approach:
|
|
203
|
+
|
|
204
|
+
## Step 1: Project Overview
|
|
205
|
+
1. **detectProject**: Identify technology stack
|
|
206
|
+
- Project type (Node, Python, Rust, Go, etc.)
|
|
207
|
+
- Package manager
|
|
208
|
+
- Test framework
|
|
209
|
+
- Linter and formatter
|
|
210
|
+
|
|
211
|
+
2. **findProjectRoot**: Locate project boundaries
|
|
212
|
+
- Find the root directory
|
|
213
|
+
- Identify monorepo structure if present
|
|
214
|
+
|
|
215
|
+
## Step 2: Architecture
|
|
216
|
+
1. Look for README, ARCHITECTURE, or CLAUDE.md files
|
|
217
|
+
2. Check directory structure for patterns
|
|
218
|
+
3. Identify entry points (main, index, app)
|
|
219
|
+
4. Find configuration files
|
|
220
|
+
|
|
221
|
+
## Step 3: Key Components
|
|
222
|
+
1. **findDefinition** on main exports
|
|
223
|
+
2. **findReferences** to understand dependencies
|
|
224
|
+
3. Check for interfaces/types that define contracts
|
|
225
|
+
|
|
226
|
+
## Step 4: Development Workflow
|
|
227
|
+
1. Check package.json scripts or Makefile
|
|
228
|
+
2. Identify how to:
|
|
229
|
+
- Run locally (dev server)
|
|
230
|
+
- Run tests
|
|
231
|
+
- Build for production
|
|
232
|
+
- Lint and format
|
|
233
|
+
|
|
234
|
+
## Step 5: Code Quality
|
|
235
|
+
1. **findTodos** to see known issues
|
|
236
|
+
2. Check for TODOs with your name/team
|
|
237
|
+
3. Look at recent git log for activity areas
|
|
238
|
+
|
|
239
|
+
## Quick Reference Questions
|
|
240
|
+
| Question | Tool |
|
|
241
|
+
|----------|------|
|
|
242
|
+
| What tech stack? | detectProject |
|
|
243
|
+
| Where's the root? | findProjectRoot |
|
|
244
|
+
| Where is X defined? | findDefinition |
|
|
245
|
+
| What uses X? | findReferences |
|
|
246
|
+
| What needs work? | findTodos |
|
|
247
|
+
| What changed? | gitLog, gitDiff |
|
|
248
|
+
|
|
249
|
+
## Red Flags to Note
|
|
250
|
+
- Many FIXME/HACK comments
|
|
251
|
+
- Outdated dependencies
|
|
252
|
+
- Missing tests
|
|
253
|
+
- No documentation`,
|
|
254
|
+
tags: ['onboarding', 'navigation', 'understanding'],
|
|
255
|
+
version: '1.0.0',
|
|
256
|
+
});
|
|
257
|
+
/**
|
|
258
|
+
* Code optimization skill
|
|
259
|
+
*/
|
|
260
|
+
export const codeOptimizationSkill = defineSkill({
|
|
261
|
+
name: 'code-optimization',
|
|
262
|
+
description: 'Performance optimization workflow',
|
|
263
|
+
prompt: `You are now in code optimization mode.
|
|
264
|
+
|
|
265
|
+
## Before Optimizing
|
|
266
|
+
1. **Measure first**: Never optimize without benchmarks
|
|
267
|
+
2. **Profile**: Identify actual bottlenecks
|
|
268
|
+
3. **Set targets**: Define acceptable performance
|
|
269
|
+
|
|
270
|
+
## Finding Optimization Targets
|
|
271
|
+
1. **findTodos**: Search for 'TODO.*perf' or 'TODO.*optim'
|
|
272
|
+
2. **findReferences**: Check how often a function is called
|
|
273
|
+
3. **Look for patterns**:
|
|
274
|
+
- Loops with database calls
|
|
275
|
+
- Repeated calculations
|
|
276
|
+
- Large object copies
|
|
277
|
+
- Synchronous I/O
|
|
278
|
+
|
|
279
|
+
## Safe Optimization Process
|
|
280
|
+
1. Write performance test/benchmark
|
|
281
|
+
2. Measure current performance
|
|
282
|
+
3. Make ONE change at a time
|
|
283
|
+
4. Measure again - verify improvement
|
|
284
|
+
5. runTests - ensure no regressions
|
|
285
|
+
6. Document the optimization
|
|
286
|
+
|
|
287
|
+
## Common Optimizations
|
|
288
|
+
- **Caching**: Memoize expensive calculations
|
|
289
|
+
- **Batching**: Combine multiple operations
|
|
290
|
+
- **Lazy loading**: Defer until needed
|
|
291
|
+
- **Pagination**: Don't load everything at once
|
|
292
|
+
- **Indexing**: Ensure database queries are indexed
|
|
293
|
+
|
|
294
|
+
## After Optimizing
|
|
295
|
+
1. runTests: No functionality broken
|
|
296
|
+
2. runBuild: Build still works
|
|
297
|
+
3. Document: Add comments explaining why
|
|
298
|
+
4. Monitor: Verify improvement in production
|
|
299
|
+
|
|
300
|
+
## Avoid
|
|
301
|
+
- Premature optimization
|
|
302
|
+
- Optimizing without measuring
|
|
303
|
+
- Sacrificing readability for micro-optimizations
|
|
304
|
+
- Assuming - always measure`,
|
|
305
|
+
tags: ['performance', 'optimization', 'workflow'],
|
|
306
|
+
version: '1.0.0',
|
|
307
|
+
});
|
|
308
|
+
/**
|
|
309
|
+
* All coding skills
|
|
310
|
+
*/
|
|
311
|
+
export const codingSkills = [
|
|
312
|
+
gitWorkflowSkill,
|
|
313
|
+
testDrivenSkill,
|
|
314
|
+
codeNavigationSkill,
|
|
315
|
+
prWorkflowSkill,
|
|
316
|
+
projectOnboardingSkill,
|
|
317
|
+
codeOptimizationSkill,
|
|
318
|
+
];
|
|
319
|
+
/**
|
|
320
|
+
* Export individual skills for selective use
|
|
321
|
+
*/
|
|
322
|
+
export { defineSkill } from '@compilr-dev/agents';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Branch Tool
|
|
3
|
+
* List, create, delete, switch, and rename branches
|
|
4
|
+
*/
|
|
5
|
+
import type { Tool } from '@compilr-dev/agents';
|
|
6
|
+
import type { GitBranchInput } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Git branch tool
|
|
9
|
+
*/
|
|
10
|
+
export declare const gitBranchTool: Tool<GitBranchInput>;
|
|
11
|
+
/**
|
|
12
|
+
* Factory function to create git branch tool with custom options
|
|
13
|
+
*/
|
|
14
|
+
export declare function createGitBranchTool(options?: {
|
|
15
|
+
/** Base directory for relative paths */
|
|
16
|
+
baseDir?: string;
|
|
17
|
+
}): Tool<GitBranchInput>;
|