Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Environment configuration for Agents CLI

# OpenAI API Configuration
OPENAI_API_KEY=your_openai_api_key_here

# Debug settings
DEBUG=agents-cli:*
NODE_ENV=development

# CLI Configuration
CLI_LOG_LEVEL=info
CLI_OUTPUT_FORMAT=text

# Development settings
DEV_WATCH_MODE=true
DEV_AUTO_RELOAD=true
60 changes: 60 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] You define @typescript-eslint parser and plugin but do not extend a TypeScript ruleset (e.g., '@typescript-eslint/recommended'). Adding it would enforce common TypeScript best practices and catch additional issues early.

Suggested change
'eslint:recommended',
'eslint:recommended',
'@typescript-eslint/recommended',

Copilot uses AI. Check for mistakes.
'prettier'
],
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname
},
env: {
node: true,
es2022: true
},
rules: {
// Prettier integration
'prettier/prettier': 'error',

// TypeScript specific rules
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }
],

// General code quality
'no-console': ['warn', { allow: ['log', 'warn', 'error'] }],
'no-debugger': 'error',
'prefer-const': 'error',
'no-var': 'error',
'eqeqeq': ['error', 'always'],
'curly': ['error', 'all']
},
overrides: [
{
files: ['tests/**/*.ts', '**/*.test.ts', '**/*.spec.ts'],
env: {
jest: true
},
parserOptions: {
project: './tsconfig.test.json'
},
rules: {
'no-console': 'off'
}
},
{
files: ['scripts/**/*.js', '*.config.js'],
env: {
node: true
},
rules: {
'@typescript-eslint/no-var-requires': 'off'
}
}
]
};
126 changes: 94 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,112 @@ name: CI

on:
push:
branches: [ main ]
branches: [main, develop]
pull_request:
branches: [ main ]
branches: [main, develop]

permissions:
contents: read

jobs:
setup:
name: Repository Setup Complete
test:
name: Test on Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest


strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Type check
run: npm run type-check

- name: Lint
run: npm run lint

- name: Format check
run: npm run format:check

- name: Build
run: npm run build

- name: Test coverage
run: npm run test:coverage

- name: Upload coverage to Codecov
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v4
with:
file: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella

- name: Verify repository structure
run: |
echo "✅ Repository setup complete!"
echo "📋 Phase 0 status: Foundation files created"
echo "🔄 Next: Phase 1 development setup"

# Verify key files exist
test -f LICENSE || exit 1
test -f SECURITY.md || exit 1
test -f CONTRIBUTING.md || exit 1
test -f docs/PRD.md || exit 1
test -f docs/tasks/phase0.md || exit 1
test -f docs/tasks/phase1.md || exit 1

echo "All foundation files verified!"

# Placeholder for future CI steps
prepare-phase1:
name: Prepare for Phase 1
security:
name: Security Audit
runs-on: ubuntu-latest
needs: setup

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run security audit
run: npm audit --audit-level=moderate

- name: Run CodeQL Analysis
uses: github/codeql-action/init@v3
with:
languages: javascript

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

build-test:
name: Build and Package Test
runs-on: ubuntu-latest

steps:
- name: Phase 1 readiness check
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Test package installation
run: npm pack --dry-run

- name: Test CLI executable
run: |
echo "📋 Phase 0 complete - ready for Phase 1 development"
echo "🔧 Next steps:"
echo " 1. Node.js project setup"
echo " 2. TypeScript configuration"
echo " 3. Dependencies installation"
echo " 4. Testing framework setup"
node dist/cli/cli.js --help || echo "Testing CLI executable"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
28 changes: 28 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "es5",
"tabWidth": 2,
"useTabs": false,
"printWidth": 80,
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "lf",
"overrides": [
{
"files": "*.json",
"options": {
"printWidth": 120
}
},
{
"files": "*.md",
"options": {
"printWidth": 100,
"proseWrap": "always"
}
}
]
}
26 changes: 26 additions & 0 deletions examples/code-review.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"agents": {
"code_reviewer": {
"name": "Senior Code Reviewer",
"instructions": "Review code for bugs, performance issues, and best practices. Focus on code quality, maintainability, and security.",
"model": "gpt-4o",
"tools": ["file_operations", "git_tools"],
"guardrails": ["no_destructive_operations"],
"handoffs": ["security_reviewer"]
},
"security_reviewer": {
"name": "Security Expert",
"instructions": "Focus specifically on security vulnerabilities, authentication issues, and security best practices.",
"model": "gpt-4o",
"tools": ["security_scanner", "file_operations"],
"guardrails": ["no_destructive_operations"],
"handoffs": ["code_reviewer"]
}
},
"workflow": {
"entry_point": "code_reviewer",
"pattern": "handoff_chain",
"max_turns": 15,
"timeout": 300
}
}
18 changes: 18 additions & 0 deletions examples/simple.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"agents": {
"simple_assistant": {
"name": "Simple Assistant",
"instructions": "You are a helpful assistant. Answer questions directly and concisely.",
"model": "gpt-4o",
"tools": [],
"guardrails": [],
"handoffs": []
}
},
"workflow": {
"entry_point": "simple_assistant",
"pattern": "sequential",
"max_turns": 5,
"timeout": 60
}
}
44 changes: 44 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/*.(test|spec).+(ts|tsx|js)'
],
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
tsconfig: 'tsconfig.test.json'
}]
},
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/*.test.{ts,tsx}',
'!src/**/*.spec.{ts,tsx}',
'!src/index.ts'
],
coverageDirectory: 'coverage',
coverageReporters: [
'text',
'lcov',
'html'
],
coverageThreshold: {
global: {
branches: 50,
functions: 35,
lines: 35,
statements: 35
}
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^chalk$': '<rootDir>/tests/mocks/chalk.js'
},
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
testTimeout: 10000,
verbose: true,
clearMocks: true,
restoreMocks: true
};
Loading