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
44 changes: 44 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SprintOS Container Environment

## CRITICAL: Dev Server Binding

This workspace runs inside a Docker container. All dev servers MUST bind to `0.0.0.0` or the preview panel will not work.

**Always use these exact commands:**

- **Vite**: `npx vite --host 0.0.0.0` or `npm run dev -- --host 0.0.0.0`
- **Next.js**: `npx next dev -H 0.0.0.0`
- **Express/Node**: Listen on `0.0.0.0` not `localhost`
- **Any other server**: Bind to `0.0.0.0`, never `127.0.0.1` or `localhost`

**NEVER** start a dev server without the `--host 0.0.0.0` flag. This is mandatory.

## CRITICAL: Validate Your Code

After finishing any coding task, **always** run `npm run build` to verify the code compiles without errors. Fix any build errors before considering the task complete.

## CRITICAL: End-to-End Testing

After building a feature, **always** test it end-to-end like a real user would using the Playwright MCP. Start the dev server, then use the Playwright browser tools to navigate to the app, interact with it, and verify everything works as expected. Fix any issues you find before considering the task complete.

## Playwright Browser Troubleshooting

If the browser crashes or you get "Target crashed" errors during Playwright testing:

1. **Restart Chrome** with the correct flags:
```bash
pkill -f chrome
google-chrome-stable --remote-debugging-port=9222 --no-first-run --no-default-browser-check --disable-gpu --headless=new --no-sandbox --disable-dev-shm-usage --window-size=1920,1080 &
```

2. **Wait for Chrome to be ready**, then resize the viewport:
```
Use playwright_browser_resize with width: 1920, height: 1080
```

3. **Ignore dbus errors** - these are non-critical warnings about system services not available in the container.

The key flags for running Chrome in Docker:
- `--no-sandbox`: Required when running as root
- `--disable-dev-shm-usage`: Prevents memory issues in containers
- `--headless=new`: New headless mode, more stable than old headless
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Autonomous Coding Agent Demo (Linear-Integrated)

**Author:** Yacine Zahidi

A minimal harness demonstrating long-running autonomous coding with the Claude Agent SDK. This demo implements a two-agent pattern (initializer + coding agent) with **Linear as the core project management system** for tracking all work.

## Key Features
Expand Down
7 changes: 7 additions & 0 deletions SPRINTOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SprintOS

> AI builds fast,
> Docs trace every line of code—
> No compromise made.

Learn more at [sprintos.co](https://sprintos.co)
2 changes: 1 addition & 1 deletion agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path
from typing import Optional

from claude_code_sdk import ClaudeSDKClient
from claude_agent_sdk import ClaudeSDKClient

from client import create_client
from progress import print_session_header, print_progress_summary, is_linear_initialized
Expand Down
12 changes: 5 additions & 7 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import os
from pathlib import Path

from claude_code_sdk import ClaudeCodeOptions, ClaudeSDKClient
from claude_code_sdk.types import HookMatcher
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient
from claude_agent_sdk.types import HookMatcher

from security import bash_security_hook

Expand Down Expand Up @@ -137,7 +137,7 @@ def create_client(project_dir: Path, model: str) -> ClaudeSDKClient:
print()

return ClaudeSDKClient(
options=ClaudeCodeOptions(
options=ClaudeAgentOptions(
model=model,
system_prompt="You are an expert full-stack developer building a production-quality web application. You use Linear for project management and tracking all your work.",
allowed_tools=[
Expand All @@ -152,10 +152,8 @@ def create_client(project_dir: Path, model: str) -> ClaudeSDKClient:
"linear": {
"type": "http",
"url": "https://mcp.linear.app/mcp",
"headers": {
"Authorization": f"Bearer {linear_api_key}"
}
}
"headers": {"Authorization": f"Bearer {linear_api_key}"},
},
},
hooks={
"PreToolUse": [
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
claude-code-sdk>=0.0.25
claude-agent-sdk