Mobile Development 21 min read

Sogou's Kuikly AI Engineering: Spec-Kit Cuts Cross-Platform Page Development to 1 Day

Sogou Input Method shares its Kuikly cross-platform AI engineering practice, adopting Spec-Kit standardized workflow, GAN-inspired iterative context document generation, and Kuikly's built-in AI tools (MCP, Rules, Skills) to achieve 3x faster new page development (3 days → 1 day) with high code quality and minimal architectural rework.

TDS Framework
TDS Framework
TDS Framework
Sogou's Kuikly AI Engineering: Spec-Kit Cuts Cross-Platform Page Development to 1 Day

Introduction

AI is sweeping development at unexpected speed, making AI engineering a priority for product teams. The Sogou Input Method team, building on the Kuikly cross-platform framework (Kotlin-based, targeting Android, iOS, HarmonyOS, Web, mini-programs, macOS), has gradually explored and settled an AI engineering solution. Several requirements have already been developed and shipped using this flow. This article shares the practical experience and thinking to provide reference for teams on the same path.

Background

Kuikly is widely used across Tencent (QQ, Tencent News, QQ Music, Sogou Input Method, QQ Browser, 20+ businesses, 1000+ pages, 500M+ DAU). In the AI era, teams aim for "L3-level" code generation: automatic requirement linking, code generation, and effect testing. While Vibe Coding demos show smooth 0-to-1 app building, real-world engineering reveals gaps.

From H2 2025, the team began practicing. Assisted Q&A, doc lookup, and code generation brought some gains, but for full-page requirements AI-generated code ran yet fell short of "production-ready". Two core problems emerged:

Brownfield comprehension hallucinations : The years-old Kuikly codebase encapsulates many capabilities, but AI shows clear deviations — API call hallucinations, tendency to reinvent wheels, and poor handling of common client-page iteration scenarios.

Unstructured requirement input : Under Vibe Coding, requirement details rely on developers to fill in; vague requirements fed to AI yield equally vague code. Direction drift discovered after multiple rounds increases rework cost.

AI Engineering Practices

1. Advancing AI-Friendly Engineering

When AI coding underperforms, many blame the model or prompts. In practice, the biggest factor is engineering quality itself. AI reads project context — existing code, module structure, dependencies. Poor engineering quality misleads AI into generating equally messy or contradictory code. In manual development, experience and conventions avoid pitfalls; in AI era they are amplified into hallucinations and errors. Therefore, before studying advanced prompt tricks, teams should first optimize their engineering for AI.

The Input Method's Kuikly project has a strong foundation: from inception through multi-platform, multi-module expansion, it maintains thorough architectural design — page/logic separation, unified system capability encapsulation, clear inter-module dependencies. Thanks to this, even without extra processes, simply letting AI reference existing modules yields good results.

AI-friendly engineering architecture diagram
AI-friendly engineering architecture diagram

2. Building Precise AI Context

Model context windows grow larger, but stuffing the whole project into AI doesn't work. Developers know which system capabilities are encapsulated, which components are reusable, which services are preferred — this is "default common sense." AI, however, blindly guesses and searches in massive code, missing existing capabilities, reinventing wheels, and consuming tokens. Moreover, model output is probabilistic; input quality directly affects results. Feeding irrelevant code degrades output quality.

The team built a system atop the Skills foundation to generate structured AI context documents for each module, retaining key information: module responsibilities, core APIs, parameter meanings, module dependencies. These documents are pre-settled to give AI accurate project understanding. They also serve as stable "working memory" for subsequent module iteration, modification, and expansion, helping AI maintain consistent implementation thinking, reduce drift, and continuously produce more reliable results in multi-round collaboration.

The system's core mechanism borrows from GAN (Generative Adversarial Networks) — documents are not one-shot but refined through multi-round adversarial iteration between a generator and an evaluator. A coordinator sets incrementally rising quality thresholds (Round 1 ≥75 → Round 2 ≥82 → … → Round 5 ≥95). Each round: generator produces document, evaluator scores and suggests improvements, generator revises and resubmits, repeating until the quality standard is met. Final output covers module responsibilities, core APIs, parameter meanings, dependencies, and other dimensions.

GAN-inspired context generation flow
GAN-inspired context generation flow
Quality threshold progression
Quality threshold progression

After verification, the system improved multiple metrics:

Quality : Document accuracy matches source code exactly, completeness covers all public APIs, example code is directly copy-paste usable.

Efficiency : Newcomer onboarding +50%, module understanding +107%, AI coding accuracy +114%, document update/maintenance efficiency +137%.

Efficiency improvement metrics
Efficiency improvement metrics

3. Standardizing Requirement Process with Spec-Kit

Engineering implies process. Without process constraints, prompt-driven development is point-to-point, ad-hoc, and non-replicable, causing: (1) quality cannot be guaranteed — output depends on requirement clarity and AI's "on-the-spot performance"; (2) knowledge cannot accumulate — personal prompt discoveries stay individual, each development starts from scratch, no reusable, sustainable mechanism.

True engineering goal is not "everyone writes good prompts" but a standardized AI-involved process, turning AI capability from personal skill into engineering target.

Given current task shapes — mostly new-page development, where a client page is a naturally bounded, well-defined, independently deliverable micro-project — the team adopted Spec-Kit . It integrates AI collaboration into a standard flow, turning development from "prompt improvisation" into "stable execution based on clear specifications." Spec-Kit's principles and flow are not detailed here; the effect is that Kuikly colleagues can basically replicate the same results.

Spec-Kit workflow diagram
Spec-Kit workflow diagram

Kuikly's Out-of-the-Box AI Tools

During early AI-assisted coding, manual intervention concentrated on two layers: framework rules and implementation skills. Some issues can be corrected in later iterations, but pre-filling via tools raises overall efficiency and stabilizes output.

Even when AI understands specific requirements and project context, its training corpus coverage remains limited for project-specific capability boundaries and best practices. Kuikly framework provides a full suite of AI tools (Kuikly AI Programming Guide: https://kuikly.tds.qq.com/AI/): basic AI capabilities — MCP service, Rules, Skills — plus AI debugging, D2C, and AI transcoding for specific scenarios, covering coding, debugging, and migration.

Currently the team mainly uses Rules, Skills, and MCP; AI debugging, D2C, and AI transcoding are planned. Even with direct Vibe Coding, these tools yield quite good generation results, supplementing Kuikly-layer knowledge so AI understands components, APIs, and constraints more accurately, drastically reducing call hallucinations and wrong usages. Thus, on framework-side code generation, business need not worry about model understanding Kuikly capabilities, focusing energy on business logic and brownfield adaptation. Kuikly also provides a one-click-config CLI tool; the Kuikly team continuously maintains and iterates these AI capabilities — when framework-side optimizations or rule additions occur, a single CLI update syncs the latest version, achieving true out-of-the-box usage.

Meanwhile, the team precipitated business-level Rules from accumulated experience and norms, clarifying architectural and code-level conventions to guide and constrain AI coding behavior at finer granularity.

Business Rules configuration
Business Rules configuration

Practice and Results

Case study: the latest Inspiration Word Library feature page — a new keyboard panel in Sogou Input Method. Design mockup involves dynamic multi-column layout adaptation, multiple page state management, dark mode toggle, plus integration of network requests, routing, input client interaction, KV storage, and analytics burying. As a continuously iterated feature, phase-two evolution is expected, so architecture design must consider extensibility.

Inspiration Word Library design mockup
Inspiration Word Library design mockup

Through Spec-Kit's three phases — /speckit.spec/speckit.plan/speckit.tasks — product requirement docs, design mockups, and interaction drafts were transformed into structured engineering documents. The process was AI-led with human confirmation at key nodes. A complete Spec-Kit document system was output.

Spec-Kit document system
Spec-Kit document system

Entering the coding implementation phase, a version with high UI and functional fidelity was obtained. Module organization, page core framework, component structure, and layout logic required no major changes; adjustments concentrated on UI details.

Generated page screenshot
Generated page screenshot
Code structure comparison
Code structure comparison

Compared to traditional development, a same-scale new module page usually needs 3 days of pure coding and technical design ; with the AI engineering flow, 1 day completed the main development . Thanks to Spec document pre-constraints and Rules normative guidance, generated code meets project requirements in architectural layering, state management, cross-platform specs, etc. Code review phase basically required no architectural rework.

Caveat : The above effect mainly appears in new module, new page scenarios — clear boundaries, controllable dependencies, high AI completion. For brownfield code modification and cross-module deep refactoring , the same flow was tried but AI completion varies case by case, stability not yet ideal. Future work: continue precipitating Skills for various scenarios to help AI better understand tasks.

Outlook

Compared to traditional Vibe Coding, the current mode shows good efficiency gains in iterative new-module/new-page building. However, the road to full-process AI engineering remains. Continuous exploration in three directions:

Connect D2C tooling to reduce UI correction cost : Significant effort still spent on UI-layer correction and tuning. If D2C toolchain can auto-convert design mockups into high-quality code artifacts, manual intervention in UI reproduction is reduced at source. Kuikly team has released a visual-draft transcoding tool; the process will continue exploring this direction.

Automated verification : With the overall flow running, some links still rely on manual verification. Next step: combine Kuikly preview, Inspector, and other existing tool capabilities to gradually build verification mechanisms. AI automatically validates UI rendering results, interaction behaviors, layout consistency, etc., gradually replacing manual verification, achieving a full "generate → preview → verify → fix" automated closed loop, further improving quality assurance efficiency.

Expand to more scenarios : Real development goes beyond new pages. Plan to gradually extend AI capability to more scenarios — automatic parsing and task splitting of requirement docs, online bug auto-location and fix, cross-platform project and client-side project linkage, etc. In practice, continue precipitating more Skills and tools, deeply orchestrating and integrating capabilities with R&D flow, letting AI play a role in more scenarios, gradually covering the entire delivery chain.

References

Kuikly GitHub repository: https://github.com/Tencent-TDS/KuiklyUI Kuikly official documentation: https://kuikly.tds.qq.com/Introduction/ Tencent Terminal Services (TDS) official site: https://tds.qq.com/ TDS Framework official site:

https://framework.tds.qq.com/
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

mobile developmentCross-platformAI-assisted Developmentsoftware engineeringKuiklySpec-KitAI context engineeringSogou Input Method
TDS Framework
Written by

TDS Framework

Kuikly is a cross‑platform framework under TDS Client Services, built on Kotlin Multiplatform. A single codebase targets Android, iOS, HarmonyOS, H5, and mini programs, delivering high performance and dynamic updates for efficient full‑platform app development.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.