- Home
- Skills
- Agents & Orchestration
- Repair Data Serialization & Parsing Bugs
More screenshots
Works with the AI Agents you already use
Repair Data Serialization & Parsing Bugs
Diagnose and repair serialization, parsing, encoding, numeric/date conversion, optional fields, and representation drift across boundaries.
$1
Repair Data Serialization & Parsing Bugs
Example session with this skill installed
The TypeScript frontend is sending ISO-8601 dates, but the Go backend fails to parse them into the struct. It seems to happen only with UTC 'Z' suffixes. Here is the Go struct and a log snippet.
- Read your context and instructions
- Compiled the repair data serialization
I have analyzed the Go struct and the provided log snippet. The issue stems from using time.Time with a custom JSON unmarshaler that expects a specific space-separated format, which fails when it encounters the ISO-8601 'Z' suffix favored by the TypeScript toISOString() method.
Data Serialization Repair
Diagnosis
The Go backend is using a legacy parsing pattern that does not support the RFC3339/ISO-8601 'Z' literal. While TypeScript correctly serializes the date, the Go json.Unmarshal process fails because the underlying field or custom UnmarshalJSON method lacks the flexible parsing needed for multiple ISO-8601 variants.
Proposed Patch (Go)
package models
import (
"encoding/json"
"time"
"strings"
)
type Event struct {
ID string `json:"id"`
Timestamp DateTime `json:"timestamp"`
}
// DateTime wraps time.Time to handle multiple ISO-8601 formats
type DateTime struct {
time.Time
}
func (dt *DateTime) UnmarshalJSON(b []byte) error {
s := strings.Trim(string(b), "\"")
if s == "null" {
return nil
}
// Try RFC3339 (standard ISO-8601) first
t, err := time.Parse(time.RFC3339, s)
if err != nil {
// Fallback for legacy space-separated format if necessary
t, err = time.Parse("2006-01-02 15:04:05", s)
}
if err != nil {
return err
}
dt.Time = t
return nil
}
Focused Deterministic Test
func TestDateTime_UnmarshalJSON(t *testing.T) {
tests := []struct {
input string
expected string
}{
{`"2023-10-27T10:00:00Z"`, "2023-10-27 10:00:00 +0000 UTC"},
{`"2023-10-27 10:00:00"`, "2023-10-27 10:00:00 +0000 UTC"},
}
for _, tc := range tests {
var dt DateTime
if err := json.Unmarshal([]byte(tc.input), &dt); err != nil {
t.Errorf("Failed to unmarshal %s: %v", tc.input, err)
}
if dt.String() != tc.expected {
t.Errorf("Expected %s, got %s", tc.expected, dt.String())
}
}
}
Next steps
- Replace the
time.Timefields in your Go structs with theDateTimewrapper. - Run the provided unit test to confirm support for both 'Z' and space-separated formats.
- Verify if the frontend needs to handle specific precision (milliseconds/nanoseconds) when receiving data back from the Go API.
Connects securely to your tools. The creator never sees your data.
About this skill
Repair Data Serialization & Parsing Bugs is a bounded ToolForge Labs workflow. Diagnose and repair serialization, parsing, encoding, numeric/date conversion, optional fields, and representation drift across boundaries. Works from full repositories or partial context such as snippets, logs, configuration, traces, and architecture notes. Produces concrete repairs or evidence-backed review outputs while preserving existing product/security policy.
It works from a full repository or partial evidence such as snippets, logs, configuration, traces, tickets, and architecture notes. The skill preserves existing product and security policy, separates verified facts from assumptions, avoids invented execution claims, and produces concrete repair or review steps with focused deterministic validation or traceable evidence.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Requires local fixtures or mock servers for validation. Cannot access production databases or live credentials. Works best when given specific logs or schema definitions.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
Permissions
Use a clean branch or a controlled review workspace. Supply repository files, logs, traces, configuration, or evidence needed for the task. Review all patches/findings before merge or operational action; keep production credentials and destructive production actions out of the workflow.