In the world of software development, the focus is shifting dramatically. We are no longer just writing code; we are writing specifications that prompt agents to write code. Welcome to the era of Agentic Engineering.
At CNEXT, we use VS Code in combination with specialized AI agents to build complex enterprise solutions in record time. The key to success? Spec-Driven Development (SDD).
What is Spec-Driven Development?
Traditionally, a specification was a dusty PDF that no one read. In Agentic Engineering, the specification is the Single Source of Truth for the AI. If the spec is right, the result is right.
The SDD Workflow in VS Code:
- 1Define Context: Create a central knowledge base (e.g., a
replit.mdor.cursorrules) containing architecture decisions, tech stack, and coding guidelines. - 2Task Specification: Before a single line of code is touched, we describe the "what" and "why".
- 3Iterative Prototyping: The agent builds, we review the spec, not just the code.
Why VS Code is the Perfect Habitat for Agents
VS Code is predestined for agentic workflows due to its extension architecture. Tools like Cursor, GitHub Copilot, or Replit Agent (via remote integration) access the filesystem directly, understand the project structure, and can execute commands in the terminal.
Benefits for Engineering Teams:
- Higher Quality: Less "trial and error" as the agent has clear guardrails.
- Knowledge Retention: Architecture decisions exist in text form and can be immediately understood by new team members (and agents).
- Efficiency: Complex refactorings that used to take days now become minute-long tasks.
Best Practices for Your Spec
For agents to perform at their peak in VS Code, specs must meet three criteria:
| Criterion | Meaning |
|---|---|
| Explicitness | Make no assumptions. Define exactly which libraries should be used. |
| Modularity | Break down complex tasks into small, digestible chunks for the agent. |
| Verifiability | Define acceptance criteria against which code (and tests) can be checked. |
Full Sample: SharePoint Weather Web Part Spec
Here is a concrete, production-ready example of a specification we use for an agent in VS Code to build a complete SPFx Web Part — including Architecture Decision Records, service layer design, error handling, caching strategy, and deployment configuration.
1. Context & Tech Stack
- Framework: SPFx v1.19 (SharePoint Framework)
- Library: React 18, Fluent UI v9, CSS Modules
- API: OpenWeatherMap API (Current Weather + 5-Day Forecast)
- Target: SharePoint Online / Microsoft Teams (Personal Tab + Full-Width)
- Auth: Azure AD App Registration with scope
user.readfor location-based personalization - Caching: localStorage with TTL (15 min for Current, 60 min for Forecast)
- Monitoring: Application Insights Telemetry via
@microsoft/applicationinsights-web
2. Architecture Decision Records (ADR)
| ADR | Decision | Rationale |
|---|---|---|
| ADR-001 | Fluent UI v9 over Tailwind CSS | SharePoint-native look, theming compatibility, accessibility out-of-the-box |
| ADR-002 | SPFx HttpClient over fetch | Built-in CORS handling, retry logic, SharePoint context injection |
| ADR-003 | localStorage cache with TTL | Offline-capable, reduces API calls by ~80%, no server state needed |
| ADR-004 | Service interface pattern | Dependency injection for unit tests, mock service for development |
| ADR-005 | Error boundary per widget | Individual errors don't crash the entire web part |
3. Functional Requirements
Must Have (P0):
- Display current weather for a configurable location (city or coordinates)
- 5-day forecast with 3-hour intervals as horizontal scroll cards
- Property Pane:
apiKey(password field),location(text with autocomplete),unit(toggle: Celsius/Fahrenheit),showForecast(toggle),refreshInterval(dropdown: 15/30/60 min) - Error handling with user-friendly messages and retry button
- Responsive layout: full-width, 1/2, 1/3 column support
- Accessibility: WCAG 2.1 AA, keyboard navigation, screen reader support
Should Have (P1):
- Location detection via Browser Geolocation API (with IP-based fallback)
- Weather alerts and warnings (OpenWeatherMap One Call API)
- Background color adapts to weather conditions (sunny = warm, rain = cool)
- Dark mode support via SharePoint theme detection
Nice to Have (P2):
- Mini widget mode for narrow columns (icon + temperature only)
- Multi-language support via SharePoint Language Pack (
this.context.pageContext.cultureInfo)
4. Technical Specs
Service Layer: ``` interface IWeatherService { getCurrentWeather(location: string, unit: Unit): Promise<WeatherData>; getForecast(location: string, unit: Unit): Promise<ForecastData>; searchLocations(query: string): Promise<LocationResult[]>; getAlerts(lat: number, lon: number): Promise<WeatherAlert[]>; }
interface WeatherData { temp: number; feelsLike: number; humidity: number; windSpeed: number; windDirection: number; condition: WeatherCondition; icon: string; sunrise: Date; sunset: Date; location: { city: string; country: string; lat: number; lon: number }; lastUpdated: Date; }
type WeatherCondition = | "clear" | "clouds" | "rain" | "drizzle" | "thunderstorm" | "snow" | "mist" | "fog"; ```
Caching Strategy: ``` class WeatherCache { private readonly CURRENT_TTL = 15 60 1000; // 15 minutes private readonly FORECAST_TTL = 60 60 1000; // 60 minutes
get(key: string): CachedData | null { const raw = localStorage.getItem('spfx-weather-' + key); if (!raw) return null; const parsed = JSON.parse(raw); if (Date.now() - parsed.timestamp > parsed.ttl) { localStorage.removeItem('spfx-weather-' + key); return null; } return parsed.data; } } ```
Error Handling:
- HTTP 401: "Invalid API key. Please check the key in Web Part settings."
- HTTP 404: "Location not found. Try a different city."
- HTTP 429: "API limit reached. Next update in [countdown]."
- Network Error: Show last cached data with note "Offline — data from [timestamp]"
- Timeout (>5s): Abort with retry button
5. Implementation Details
Component Architecture: `` WeatherWebPart (SPFx Entry) ├── WeatherProvider (Context + Service Injection) │ ├── ErrorBoundary │ │ ├── CurrentWeather (Main display) │ │ │ ├── WeatherIcon (Animated SVG icons) │ │ │ ├── TemperatureDisplay │ │ │ └── WeatherDetails (Wind, Humidity, etc.) │ │ ├── ForecastStrip (Horizontal scroll cards) │ │ │ └── ForecastCard (3h interval) │ │ └── AlertBanner (Weather warnings) │ └── LoadingState / ErrorState / EmptyState └── PropertyPane (Configuration) ``
Hooks:
useWeather(location, unit): Main hook with Loading/Error/Data state, auto-refresh viasetInterval, cache integrationuseGeolocation(): Browser Geolocation with permission handlinguseThemeDetection(): SharePoint theme for adaptive colorsuseResponsiveLayout(): Web Part width detection for mini/standard/full mode
6. Testing Strategy
| Test Type | Tool | Coverage |
|---|---|---|
| Unit Tests | Jest + React Testing Library | Service layer, cache, hooks (>80%) |
| Integration | SPFx Workbench | Property Pane, rendering, theme |
| E2E | Playwright | SharePoint Online live test |
| Mock Service | MockWeatherService | Offline development, all weather states |
7. Deployment
# Build & Package
gulp bundle --ship
gulp package-solution --ship
# Deploy via PnP PowerShell
Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/appcatalog"
Add-PnPApp -Path "./sharepoint/solution/weather-webpart.sppkg" -OverwriteConclusion: Design for Less Complexity
Our motto at CNEXT is: Design for less complexity, design for less overhead. Spec-Driven Development is not extra work — it is the method to eliminate overhead. Those who learn to steer agents precisely today will build the most efficient solutions on the market tomorrow.
Open Source & GitHub
We believe in Open Source. You can find many of our base components and agentic guides on our GitHub:
Note: Internal enterprise blueprints are exclusively accessible to our customers.
Looking to transition your team to Agentic Engineering? We will show you how to optimally integrate VS Code and AI agents into your workflows.

