Use this prompt at the beginning of your LLM session to help your digital agent write better code:
Your persona will be a senior software developer with experience in PowerShell, Python, VBA, JavaScript, and PHP.
I need your help creating scripts and other code snippets across these programming languages.
I will give you a file or other instructions with the requirements and I want you to create the code.
Focus on creating clean code and don't create any other extraneous artifacts, like readme files or sample input files.
Your code will be used by real network pros that are grinding it out every day, so it must be production-ready.
You can use whatever tools you have at your disposal.
If you need clarification about a requirement or a goal, ask questions before you start coding.
Your goal is to nail the artifact on the FIRST PASS.
Keep your responses brief but informative, and humor is always appreciated.
Copied! โ
When writing code requirements, here's some tips to convey clear intent and avoid ambiguity:
Create monitoring tools with color-coded output and continuous loops
Build cross-platform scripts that run on Windows, Linux, and macOS
Turn your spreadsheets into device management launchpads
Enable one-click access to devices directly from your browser
Move from thinking about "how" to thinking about "what's the goal?" and let AI generate the code.
Build scripts that work anywhereโWindows, Linux, macOSโwithout rewriting code.
Chain multiple tools together into unified workflows that eliminate manual steps.
Connect web apps, CLIs, and desktop toolsโbuild complete automation solutions.
Learn the same techniques enterprise automation platforms use in production.
Walk away with working code you can use in your environment today.
Access to an LLM - Claude, Gemini, Grok, etc.
Network device you can ping, SSH to, and access via SFTP and HTTP
Windows command-line access (PowerShell and Python demos)
Microsoft Excel with macros enabled (Excel Macro demo)
PuTTY and FileZilla (free version) (Excel Macro and Web Hooks demo)
Admin access to Windows Registry (Web Hooks demo)
Click the ๐ฎ icon in the Info Bar to learn more about Intent-Based Automation and why it matters for your career.
Click the ๐ icon in the Info Bar to copy the LLM priming promptโit will help your LLM generate better code for these demos.
Follow the detailed notes and you'll have working code in a few minutes. Click the Easy Button to bypass the LLM and use pre-built code.
Intent-Based Automation refers to the use of AI and ML to automate the management and operation of network infrastructure. Unlike traditional network automation, which relies on manual scripting, Intent-Based Automation uses intelligent, self-optimizing systems that can adapt and make decisions in real time.
Someone has to build and support Intent-Based Automation solutions, so Network Architects that embrace the tech now will become:
1. More marketable by having the skills needed to deliver and support Intent-Based Automation.
2. Trusted advisors to clients and prospects that are moving to Intent-Based Automation.
3. More productive as intent-based coding becomes part of their DNA.
You don't need to become a hard-core developer, but you'll have to learn to use the tools that generate code, and you'll need to learn to read code well enough to make changes to code snippets.
As a Network Architect, you already understand the network concepts and protocols needed for Intent-Based Automation. Your focus should be on shifting your mindset toward a more programmatic, data-centric model and leveraging automation tools that minimize the need for hands-on coding.
1. Master "intent-based" coding and DevOps principles
Intelligent automation isn't about automating a single, repetitive task; it's about defining the desired state or "intent" for the entire network and letting the automation platform figure out how to get there.
2. Get familiar with no-code and low-code automation tools
You don't need to be a Python expert to start automating. A new generation of tools allows you to build and manage workflows with a visual, prompt-based, drag-and-drop interfaces.
3. Learn to use APIs
Intent-Based Automation is API-driven. APIs are how software components communicate with each other. As a Network Architect, you must understand how to interact with them, but not necessarily build them.
4. Develop your analytics and AI literacy
Intelligent automation relies on data analytics and AI to optimize networks and predict issues. Your role will evolve from fixing problems to using data insights to prevent them.
5. Build and practice in a demo environment
The best way to get practical experience is by building your own automations. This allows you to experiment freely without risking your production network.
Shows how to use an intent-based approach when creating monitoring tools with user input, color-coded output, and continuous monitoring capabilities.
Skills demonstrated:
๐ก Pro Tip: Click the โ๏ธ icon in the Info Bar for tips on when to use PowerShell over Python
Create a PowerShell script that meets these requirements:
1. Clear the terminal once only: before displaying the initial user prompts
2. Read a file named sites.txt from the current directory
3. The file format is CSV-style with hostname and IP on each line: "hostname,192.168.1.1"
4. Prompt the user at launch for the number of cycles to run and the interval in seconds between cycles
5. Display a cycle counter before each cycle runs
6. Ping each device once using Test-Connection
7. Display results line-by-line on screen showing the hostname and IP address
8. Use color-coding: green text for successful pings, red text for failed pings
9. Play a console beep sound only when a device fails the ping test
10. Wait the specified interval between cycles and repeat for the specified number of cycles
11. Name the output file demo.ps1
Copied! โ
Clear-Host
# Prompt for user input
$cycles = Read-Host "Enter number of cycles"
$interval = Read-Host "Enter interval in seconds"
# Validate input
if (-not ($cycles -as [int]) -or -not ($interval -as [int])) {
Write-Host "Invalid input. Please enter whole numbers." -ForegroundColor Red
exit
}
$cycles = [int]$cycles
$interval = [int]$interval
# Check if sites.txt exists
if (-not (Test-Path "sites.txt")) {
Write-Host "Error: sites.txt not found in current directory." -ForegroundColor Red
exit
}
# Read and parse the sites file
$sites = @()
try {
Get-Content "sites.txt" | ForEach-Object {
if ($_ -match '^\s*$') { return } # Skip empty lines
$parts = $_ -split ','
if ($parts.Count -eq 2) {
$sites += @{
Hostname = $parts[0].Trim()
IP = $parts[1].Trim()
}
}
}
} catch {
Write-Host "Error reading sites.txt: $_" -ForegroundColor Red
exit
}
if ($sites.Count -eq 0) {
Write-Host "No valid entries found in sites.txt" -ForegroundColor Red
exit
}
# Main monitoring loop
for ($c = 1; $c -le $cycles; $c++) {
Write-Host "`n--- Cycle $c ---" -ForegroundColor Cyan
foreach ($site in $sites) {
$ping = Test-Connection -ComputerName $site.IP -Count 1 -Quiet
if ($ping) {
Write-Host "$($site.Hostname) - $($site.IP)" -ForegroundColor Green
} else {
Write-Host "$($site.Hostname) - $($site.IP)" -ForegroundColor Red
[System.Console]::Beep()
}
}
if ($c -lt $cycles) {
Start-Sleep -Seconds $interval
}
}
Write-Host "`nMonitoring complete." -ForegroundColor Cyan
Copied! โ
Shows how an intent-based prompt can create a Python script with cross-platform capabilities (Windows, Linux, macOS).
Skills demonstrated:
๐ก Pro Tip: Click the โ๏ธ icon in the Info Bar for info on when to use Python over PowerShell
Create a Python script that meets the following requirements:
1. Clear the terminal before displaying the initial user prompts
2. Read a file named sites.txt from the current directory
3. The file format is CSV-style with hostname and IP on each line: "hostname,192.168.1.1"
4. Prompt the user at launch for the number of cycles to run and the interval in seconds between cycles
5. Displays a cycle counter before each cycle runs
6. Ping each device once using subprocess to execute ping commands
7. Use the IP address field (second column) for pinging to avoid DNS resolution issues
8. Use the hostname field (first column) for display purposes in the results
9. Display results line-by-line on screen showing the hostname and the IP address
10. Uses color-coding: green text for successful pings, red text for failed pings (use colorama library)
11. Play a console beep sound only when a device fails the ping test
12. Wait the specified interval between cycles and repeat for the specified number of cycles
13. Make the script cross-platform compatible (Windows, Linux, macOS)
14. Name the output file demo.py
Copied! โ
import os
import sys
import subprocess
import time
from colorama import init, Fore
# Initialize colorama for cross-platform color support
init(autoreset=True)
def clear_terminal():
"""Clear the terminal screen"""
os.system('cls' if os.name == 'nt' else 'clear')
def get_ping_command(ip):
"""Return platform-specific ping command"""
if sys.platform == 'win32':
return ['ping', '-n', '1', ip]
else:
return ['ping', '-c', '1', ip]
def ping_device(ip):
"""Ping a device and return True if successful, False otherwise"""
try:
cmd = get_ping_command(ip)
result = subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=5)
return result.returncode == 0
except Exception:
return False
def load_devices(filename):
"""Load devices from CSV file"""
if not os.path.exists(filename):
print(f"{Fore.RED}Error: {filename} not found in current directory")
sys.exit(1)
devices = []
try:
with open(filename, 'r') as f:
for line in f:
line = line.strip()
if not line:
continue
parts = line.split(',')
if len(parts) == 2:
devices.append({
'hostname': parts[0].strip(),
'ip': parts[1].strip()
})
except Exception as e:
print(f"{Fore.RED}Error reading {filename}: {e}")
sys.exit(1)
if not devices:
print(f"{Fore.RED}Error: No valid devices found in {filename}")
sys.exit(1)
return devices
def get_positive_int(prompt, min_value=1):
"""Prompt user for positive integer input with validation"""
while True:
try:
value = int(input(prompt))
if value >= min_value:
return value
print(f"{Fore.RED}Error: Value must be at least {min_value}")
except ValueError:
print(f"{Fore.RED}Error: Please enter a valid integer")
def main():
clear_terminal()
# Load devices from CSV
devices = load_devices('sites.txt')
# Get user input
cycles = get_positive_int("Enter number of cycles: ")
interval = get_positive_int("Enter interval in seconds between cycles: ", min_value=0)
# Run ping cycles
for cycle in range(1, cycles + 1):
print(f"\n{Fore.CYAN}Cycle {cycle}\n")
for device in devices:
hostname = device['hostname']
ip = device['ip']
if ping_device(ip):
print(f"{Fore.GREEN}{hostname} ({ip}) - SUCCESS")
else:
print(f"{Fore.RED}{hostname} ({ip}) - FAILED")
print('\a', end='', flush=True) # Cross-platform beep
# Wait before next cycle (skip on last cycle)
if cycle < cycles:
time.sleep(interval)
print(f"\n{Fore.CYAN}Ping cycles complete.")
if __name__ == '__main__':
main()
Copied! โ
Shows how an intent-based approach to writing VBA macros can create seamless application integrations.
Skills demonstrated:
Pre-built Macro Install Steps:
๐ก Pro Tip: Match the Hostname in your own Excel sheet with a PuTTY Session or FileZilla Site then try using those macros to connect to your devices.
Write an Excel VBA macro that meets the following requirements:
1. Run a Windows Ping command (single ping, hidden window) using the IP Address in the active row
2. Check the ping exit code to determine success or failure
3. Use Column A to retrieve the Hostname of the device
4. Use Column C to retrieve the IP address of the device
5. If column C is empty or contains an invalid IP address, display an error message
6. Allow any column to be the active column in the active row
7. Include the Hostname and IP address in the message
8. When a Ping test succeeds, display a message box saying "Hostname (IP Address) is crushing it!"
9. When a Ping test fails, display a message box saying "Hostname (IP Address) is not feeling well!"
10. When a Ping test fails, play a console beep.
Copied! โ
Sub PingDevice()
Dim ws As Worksheet
Dim activeRow As Long
Dim hostname As String
Dim ipAddress As String
Dim shell As Object
Dim exitCode As Long
Set ws = ActiveSheet
activeRow = ActiveCell.Row
' Get hostname from Column A and IP from Column C
hostname = ws.Cells(activeRow, 1).Value
ipAddress = ws.Cells(activeRow, 3).Value
' Validate inputs
If Len(hostname) = 0 Or Len(ipAddress) = 0 Then
MsgBox "Error: Hostname or IP address is missing.", vbExclamation, "Missing Data"
Exit Sub
End If
' Validate IP address format
If Not IsValidIP(ipAddress) Then
MsgBox "Error: Invalid IP address format.", vbExclamation, "Invalid IP"
Exit Sub
End If
' Execute ping command (hidden window, single ping)
Set shell = CreateObject("WScript.Shell")
exitCode = shell.Run("ping -n 1 " & ipAddress, 0, True)
' Check result and display message
If exitCode = 0 Then
MsgBox hostname & " (" & ipAddress & ") is crushing it!", vbInformation, "Ping Success"
Else
MsgBox hostname & " (" & ipAddress & ") is not feeling well!", vbExclamation, "Ping Failed"
Beep
End If
Set shell = Nothing
End Sub
Function IsValidIP(ip As String) As Boolean
Dim parts() As String
Dim i As Integer
Dim part As String
' Validate IP format: 4 octets separated by dots
parts = Split(ip, ".")
If UBound(parts) <> 3 Then
IsValidIP = False
Exit Function
End If
For i = 0 To 3
part = parts(i)
If Len(part) = 0 Or Not IsNumeric(part) Then
IsValidIP = False
Exit Function
End If
If Val(part) < 0 Or Val(part) > 255 Then
IsValidIP = False
Exit Function
End If
Next i
IsValidIP = True
End Function
Function IsNumeric(value As String) As Boolean
On Error Resume Next
IsNumeric = Not IsNull(CDbl(value))
On Error GoTo 0
End Function
Copied! โ
Web Hooks (aka Protocol Handlers) are mini-APIs that can launch applications directly from web links. Instead of manually opening programs and typing IP addresses or session info, you can click a link and connect seamlessly to any device.
For example:
This one-click capability is a huge time saver and a much better user experience.
๐จ Developing Web Hooks typically requires iteration and testing, so trying to create them with a single LLM prompt is beyond the scope of this demo. Instead, you'll walk through downloading, installing, and testing pre-built Web Hooks. At the end, you'll experience the ease and efficiency of launching external programs without leaving your browser.
Web Hooks use Windows Registry entries to map custom URL schemes (like ping-ip://) to executable commands. When you click a link with a custom URL, Windows executes the associated command and passes the IP address automagically.
The workflow:
๐ก Pro Tip: The Windows Registry contains a vast amount of critical system information, so make your new entries easy to find by adding them as Favorites.
Click the download buttons below to save the .reg files. Each file is generated on-the-fly by your browser - no external downloads required!
Enables ping-ip:// links to automatically open a command window and ping the target IP address.
What it does: Runs 4 pings and pauses so you can see the results.
Example link: <a href="ping-ip://8.8.8.8">Ping Google DNS</a>
Enables ssh-ip:// links to automatically launch PuTTY with an SSH connection to the target IP.
Requirement: PuTTY must be installed at C:\Program Files\PuTTY\putty.exe
Example link:<a href="ssh-ip://192.168.1.1">SSH to Router</a>
Enables sftp-ip:// links to automatically launch FileZilla with an SFTP connection to the target IP.
Requirement: FileZilla must be installed at C:\Program Files\FileZilla FTP Client\filezilla.exe
Example link:<a href="sftp-ip://192.168.1.1">SFTP to Server</a>
For each .reg file you downloaded:
Test your new Web Hooks using the applet below.
To manually import the files and verify the installation: