File size: 6,549 Bytes
3b8a335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# A2A-SIN-Code-fullstack Agent - Standard Card

**Agent ID:** `a2a-sin-code-fullstack`  
**Version:** 1.0.0  
**Status:** βœ… Production Ready  
**Team:** Team - Coder  
**Manager:** SIN-Zeus

---

## πŸ“‹ Core Identity

| Field | Value |
|-------|-------|
| **Name** | A2A-SIN-Code-fullstack Agent |
| **Description** | Autonomous Cloud Coder for Full-stack web applications (frontend + backend) |
| **Purpose** | Execute code generation tasks via opencode CLI |
| **Usage** | Deployed on Hugging Face Spaces, receives A2A tasks from SIN-Zeus |
| **CIMD** | https://delqhi-a2a-sin-code-fullstack.hf.space |
| **SEP-991** | `https://delqhi-a2a-sin-code-fullstack.hf.space/.well-known/oauth-client.json` |

## 🏒 Team & Infrastructure

| Field | Value |
|-------|-------|
| **Team** | Team - Coder |
| **Manager** | SIN-Zeus |
| **VM Type** | Hugging Face Space (Free CPU) |
| **VM URL** | https://delqhi-a2a-sin-code-fullstack.hf.space |
| **Local Path** | `coder_hf_deploy/` |
| **GitHub Repo** | https://github.com/OpenSIN-AI/OpenSIN-Code |

## 🧠 AI Stack

| Component | Model | Purpose |
|-----------|-------|---------|
| **Primary** | opencode/qwen3.6-plus-free | Code generation via Antigravity |
| **Fallback** | opencode/minimax-m2.5-free | Uptime guarantee |

## πŸ› οΈ Capabilities

### Core Skills
- βœ… **Code Generation:** Uses opencode CLI to generate code based on A2A task descriptions
- βœ… **GitHub Operations:** Automatic commits, branch management, PR creation (via GitHub CLI)
- βœ… **Issue Resolution:** Parses issue titles and descriptions to determine context and requirements
- βœ… **Testing:** Basic validation of generated code structure
- βœ… **Self-Correction:** Can iterate on feedback via A2A message threads

### A2A Commands
- `sin.code.fullstack.create` - Create new files/modules
- `sin.code.fullstack.modify` - Modify existing code
- `sin.code.fullstack.test` - Run tests on generated code
- `sin.code.fullstack.deploy` - Prepare code for deployment
- `sin.code.fullstack.status` - Get current task status
- `sin.code.fullstack.health` - Agent health check

## πŸ“‘ Interfaces

| Interface | URL | Protocol |
|-----------|-----|----------|
| **Gradio UI** | https://delqhi-a2a-sin-code-fullstack.hf.space | HTTP/Gradio |
| **A2A API** | https://delqhi-a2a-sin-code-fullstack.hf.space/a2a/v1 | A2A Protocol |
| **Dashboard** | https://a2a.delqhi.com/agents/sin-code-fullstack | Web |
| **Docs Tab** | [Google Docs](https://docs.google.com/document/d/1RtoHn4I0GntuEEOHHkqoh_dMuGzgMwQz7_8oxAOpQbw/edit?tab=t.t.73bbe3264ea78aec) | Google Docs |

## πŸ”„ Runtime Contract

| Requirement | Status |
|-------------|--------|
| **A2A Compliance** | βœ… Full A2A protocol support |
| **CLI Interface** | βœ… Uses opencode CLI exclusively |
| **Agent Card** | βœ… This file |
| **CIMD/SEP-991** | βœ… OAuth client JSON |
| **Team Manager** | βœ… SIN-Zeus registered |
| **Docs Tab** | βœ… Synced to Google Docs |
| **HF Space** | ⏳ Pending deployment (CPU-Basic) |
| **Cloudflare** | ⏳ Not configured yet |

## πŸ“Š Performance Metrics

| Metric | Target | Actual |
|--------|--------|--------|
| **Task Success Rate** | >80% | Baseline (pre-deploy) |
| **Avg Generation Time** | <60s | TBD |
| **Code Quality** | >85% | TBD |
| **Uptime** | 24/7 | HF Space (cpu-basic) |

## πŸ”§ Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `OPENCODE_API_KEY` | Yes | OpenCode API key for LLM calls |
| `GITHUB_TOKEN` | Yes | GitHub personal access token |
| `HF_TOKEN` | No | Hugging Face token (for deployment) |
| `TELEGRAM_TOKEN` | No | Telegram bot for notifications |
| `N8N_URL` | No | OCI n8n instance URL |
| `N8N_API_KEY` | No | n8n API key |

## πŸ“ File Structure

```
.
β”œβ”€β”€ app.py                  # Gradio UI + A2A JSON-RPC endpoint
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ README.md               # HF Space config (YAML header)
β”œβ”€β”€ agent.json              # Agent metadata
β”œβ”€β”€ A2A-CARD.md            # This file
β”œβ”€β”€ Dockerfile              # Container build for HF Space
β”œβ”€β”€ start.sh                # Startup script
β”œβ”€β”€ .well-known/
β”‚   β”œβ”€β”€ agent-card.json    # Auto-generated A2A card
β”‚   β”œβ”€β”€ agent.json         # Auto-generated agent identity
β”‚   └── oauth-client.json  # CIMD/SEP-991 OAuth config
└── app/
    β”œβ”€β”€ coder_agent.py     # Main agent logic (opencode integration)
    β”œβ”€β”€ github_ops.py      # GitHub commit/PR operations
    β”œβ”€β”€ prompt_templates.py # fullstack-specific prompts
    └── utils/
        β”œβ”€β”€ logger.py      # Structured logging
        └── validators.py  # Code validation
```

## πŸš€ Deployment

### Hugging Face Space (CPU-Basic)
```bash
# Install HF CLI
pip install -U huggingface_hub

# Login
huggingface-cli login

# Create Space (CPU-Basic!)
huggingface-cli repo create delqhi-a2a-sin-code-fullstack --type space --space-sdk docker

# Set secrets
huggingface-cli variable set OPENCODE_API_KEY "$OPENCODE_API_KEY" --repo delqhi-a2a-sin-code-fullstack --type space
huggingface-cli variable set GITHUB_TOKEN "$GITHUB_TOKEN" --repo delqhi-a2a-sin-code-fullstack --type space

# Push code
git init
git remote add origin https://huggingface.co/spaces/delqhi/delqhi-a2a-sin-code-fullstack
git add .
git commit -m "Deploy A2A-SIN-Code-fullstack Agent v1.0.0"
git push --force origin main
```

### Hardware Configuration
**CRITICAL:** Must be set to `cpu-basic` (free, unlimited). Never use GPU/ZeroGPU.

```bash
huggingface-cli variable set HF_HARDWARE "cpu-basic" --repo delqhi-a2a-sin-code-fullstack --type space
```

## πŸ“ˆ Monitoring

- **Telegram:** Notifications on task completion/failure (if token set)
- **Gradio UI:** Live status and logs
- **HF Space Logs:** View via Hugging Face dashboard
- **Dashboard:** https://a2a.delqhi.com/agents/sin-code-fullstack

## πŸ›‘οΈ Security

- **API Keys:** Stored as HF Space secrets, never hardcoded
- **GitHub Token:** Scoped to repository access only
- **No Persistent Storage:** Ephemeral filesystem (use HF Datasets for persistence if needed)
- **A2A Auth:** Requires X-API-Key header for agent-card access

## πŸ“ž Support

- **Documentation:** TBD (Google Docs tab will be created)
- **Dashboard:** https://a2a.delqhi.com/agents/sin-code-fullstack
- **Team Manager:** SIN-Zeus (dispatcher)

## πŸ“œ License

Proprietary - OpenSIN-AI

---

**Last Updated:** 2026-04-07  
**Agent:** A2A-SIN-Code-fullstack v1.0.0
**Owner:** Team - Coder / SIN-Zeus