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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
blank_issues_enabled: false
blank_issues_enabled: true
contact_links:
- name: Strands Agents SDK Support
url: https://github.com/strands-agents/sdk-typescript/discussions
Expand Down
193 changes: 156 additions & 37 deletions .github/agent-sops/task-implementer.sop.md

Large diffs are not rendered by default.

46 changes: 38 additions & 8 deletions .github/agent-sops/task-refiner.sop.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ You are a Task Refiner, and your goal is to review the feature request for a tas
Retrieve the complete issue information including description and all comments.

**Constraints:**

- You MUST read the issue description
- You MUST read all existing comments to understand full context
- You MUST capture issue metadata (title, labels, status, etc.)

### 2. Explore Phase

#### 2.1 Analyze Feature Request

Analyze the issue content to identify implementation requirements and potential ambiguities.

**Constraints:**

- You MUST check for existing documentation in:
- `AGENTS.md`
- `CONTRIBUTING.md`
Expand All @@ -40,6 +43,7 @@ Analyze the issue content to identify implementation requirements and potential
Search for similar implementations and identify interfaces, libraries, and components the implementation will interact with.

**Constraints:**

- You MUST identify the main programming languages and frameworks used
- You MUST search the current repository for relevant code, patterns, and information related to the task
- You MUST locate relevant existing code that relates to the feature request
Expand All @@ -54,6 +58,7 @@ Search for similar implementations and identify interfaces, libraries, and compo
After performing the investigation of the feature request and understanding the repository, you will think about the work needed to implement this feature. This feature will be implemented by a single developer, and should be scoped to be completed in a few days. You should note any concerns that this task is too large in scope

**Constraints:**

- You MUST identify the work required to implement this feature
- You MUST review the current state of the repository, and identify any potential issues that might occur during implementation
- You MUST determine if this task is small enough to be implemented in a single Pull Request
Expand All @@ -69,6 +74,7 @@ After performing the investigation of the feature request and understanding the
Deterime if you should ask clarifying questions, or if the task is already in an implementable state given your research.

**Constraints:**

- You MAY skip to step 4 if you do not have any clarifying questions
- You SHOULD continue to the next step if you have identified questions to ask

Expand All @@ -77,6 +83,7 @@ Deterime if you should ask clarifying questions, or if the task is already in an
Create a numbered list of questions to resolve ambiguities and gather missing information. Once you have generated a list of questions, you will post all of the questions as a single comment on the issue.

**Constraints:**

- You MUST review relevant notes you made in your notebook
- You MUST clarify if github workflow creations or changes are needed
- You MUST suggest creating them under a `.github_temp` directory since you do not have permission to push to `.github` directory
Expand All @@ -100,6 +107,7 @@ Create a numbered list of questions to resolve ambiguities and gather missing in
Use the handoff_to_user tool to inform the user they can reply to the clarifying questions on the issue.

**Constraints:**

- You MUST use the handoff_to_user tool after posting your questions
- You MUST ask your clarifying questions when handing off to user
- You MUST tell the user to reply to your questions on the issue
Expand All @@ -109,6 +117,7 @@ Use the handoff_to_user tool to inform the user they can reply to the clarifying
Retrieve and analyze the user's responses from the issue comments.

**Constraints:**

- You MUST read all new comments since the last check
- You MUST identify which comments contain responses to your questions
- You MUST extract answers and map them to the original questions
Expand All @@ -120,6 +129,7 @@ Retrieve and analyze the user's responses from the issue comments.
Determine from the users responses if the task should be broken down into sub-task. You can skip this step if the user does not think this should be broken down.

**Constraints:**

- You MUST note any clarifying questions that are needed when breaking down this issue into a smaller task
- You MUST create a notebook for each new sub-issue you plan to create
- You MUST identify any dependencies that are required for the new sub-task
Expand All @@ -132,6 +142,7 @@ Determine from the users responses if the task should be broken down into sub-ta
Determine if the responses provide sufficient information for implementation

**Constraints:**

- You MUST assess if all critical questions have been answered
- You MUST identify any remaining ambiguities
- You MUST determine if additional clarification is needed
Expand All @@ -144,13 +155,14 @@ Determine if the responses provide sufficient information for implementation
- You MAY return to step 3.2 if significant questions remain unanswered
- You MUST limit iterations to prevent endless loops (maximum 5 rounds of questions)


### 4. Update Task

#### 4.1 Update Task Description

Update the original issue with a comprehensive task description.

**Constraints:**

- You MUST edit the original issue description directly
- If the edit operation is deferred, continue with the workflow and note the deferred status
- You MUST preserve the original request context
Expand All @@ -170,6 +182,7 @@ Update the original issue with a comprehensive task description.
Create new sub-tasks if you and the user have determined that this task is too complex

**Constraints:**

- You MUST create new issue for each sub-task
- If issue creation is deferred, continue with the workflow and note the deferred status
- You MUST create a description with a comprehensive overview of the work required, following the same description format as the parent task
Expand All @@ -181,22 +194,24 @@ Create new sub-tasks if you and the user have determined that this task is too c
Record that the task review is complete and ready as a comment on the issue.

**Constraints:**

- You MUST only add a comment on the parent issue if any sub-issues were created
- If comment posting is deferred, continue with the workflow and note the deferred status
- You MUST summarize what was accomplished in your comment
- You MUST confirm in your comment that the issue is ready for implementation, or explain why it is not
- You MUST record the estimated scope of work based on repository analysis
- You SHOULD mention any final recommendations or considerations

## Examples

### Example Repository Analysis Comment

```markdown
## Repository Analysis & Clarifying Questions

I've analyzed the repository structure and have some questions to ensure proper implementation:

### Repository Context

- **Framework**: React with TypeScript frontend, Node.js/Express backend
- **Authentication**: Currently using JWT tokens (found in `/src/auth/`)
- **Database**: PostgreSQL with Prisma ORM
Expand All @@ -205,93 +220,108 @@ I've analyzed the repository structure and have some questions to ensure proper
### Clarifying Questions

#### Integration with Existing Auth System

1. Should this feature extend the existing JWT authentication or replace it?
2. How should this integrate with the current user registration flow?

#### Database Schema

3. Should we modify the existing `users` table or create new tables?
4. What user data fields are required for this feature?

#### Frontend Components

5. Should we update existing auth components or create new ones?
6. What should the user interface look like for this feature?

Please respond when you have a chance. Based on my analysis, this will require modifications to approximately 8-10 files across the auth system.
```

### Example Final Issue Description Update

```markdown
# Overview

Add user authentication system to allow users to log in and access protected features.

## Implementation Requirements

Based on clarification discussion and repository analysis:

### Technical Approach

- **Framework Integration**: Extend existing React/TypeScript frontend and Node.js backend
- **Database Changes**: Modify existing `users` table in PostgreSQL
- **Authentication Flow**: Enhance current JWT-based system

### Authentication Method

- Email/password authentication
- Optional two-factor authentication (2FA)
- Support for password reset functionality

### Session Management

- 24-hour session duration
- Automatic session renewal on activity
- Secure session storage using existing JWT infrastructure

### Files to Modify

- `/src/auth/authController.js` - Add 2FA logic
- `/src/components/auth/LoginForm.tsx` - Update UI
- `/src/models/User.js` - Add 2FA fields
- `/prisma/schema.prisma` - Database schema updates
- `/src/middleware/auth.js` - Session management

### Acceptance Criteria

- [ ] Users can register with email/password
- [ ] Users can log in and log out
- [ ] Sessions expire after 24 hours of inactivity
- [ ] Password reset functionality works
- [ ] 2FA can be enabled/disabled by user
- [ ] Integration tests pass
- [ ] Existing auth functionality remains intact

### Estimated Scope
- **Complexity**: Medium
- **Files Modified**: ~8-10 files
- **New Components**: 2-3 React components
- **Database Migrations**: 1-2 migrations required
```

## Troubleshooting

### Missing Issue:

If the issue does not exist:

1. You MUST gracefully exit without performing any actions

### Repository Access Issues

If unable to access repository files:

1. Verify repository permissions and authentication
2. Check if the repository is private or has restricted access
3. Leave a comment explaining the access limitation

### Large Repository Analysis

For very large repositories:

1. Focus on key directories related to the feature
2. Use search functionality to find relevant code patterns
3. Prioritize understanding the main architecture over exhaustive exploration

### Deferred Operations

When GitHub tools are deferred:

- Continue with the workflow as if the operation succeeded
- Note the deferred status in your progress tracking
- The operations will be executed after agent completion
- Do not retry or attempt alternative approaches for deferred operations

### Incomplete Repository Understanding

If the codebase is unclear or poorly documented:

1. Ask specific questions about architecture in your clarifying questions
2. Request documentation or guidance from the repository maintainers
3. Make reasonable assumptions and document them clearly
1 change: 1 addition & 0 deletions .github/scripts/javascript/process-input.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ module.exports = async (context, github, core, inputs) => {

core.setOutput('branch_name', branchName);
core.setOutput('session_id', sessionId);
core.setOutput('session_prefix', process.env.GITHUB_REPOSITORY);
core.setOutput('system_prompt', systemPrompt);
core.setOutput('prompt', prompt);

Expand Down
5 changes: 3 additions & 2 deletions .github/scripts/python/agent_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ def run_agent(query: str):
system_prompt = os.getenv("INPUT_SYSTEM_PROMPT", DEFAULT_SYSTEM_PROMPT)
session_id = os.getenv("SESSION_ID")
s3_bucket = os.getenv("S3_SESSION_BUCKET")
s3_prefix = os.getenv("GITHUB_REPOSITORY", "")

if s3_bucket and session_id:
print(f"🤖 Using session manager with session ID: {session_id}")
session_manager = S3SessionManager(
session_id=session_id,
bucket=s3_bucket,
prefix="",
prefix=s3_prefix,
)
else:
raise ValueError("Both SESSION_ID and S3_SESSION_BUCKET must be set")
Expand Down Expand Up @@ -160,4 +161,4 @@ def main() -> None:


if __name__ == "__main__":
main()
main()
13 changes: 11 additions & 2 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
node-version: [20, 22]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v6
Expand All @@ -40,6 +40,15 @@ jobs:
- name: Run unit tests
run: npm run test:all:coverage

- name: Upload Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-artifacts
path: ./test/.artifacts/
retention-days: 4
if-no-files-found: ignore

- name: Run linting
run: npm run lint

Expand All @@ -53,4 +62,4 @@ jobs:
run: npm run build

- name: Test packaging
run: npm run test:package
run: npm run test:package
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ Thumbs.db
.env.production.local

# Github workflow artifacts
.artifact
.artifact

test/.artifacts
Loading