This document contains information for developers working on the Phased Agent Workflow project.
- Node.js (v16 or higher) - Download from nodejs.org
- npm (comes with Node.js)
Install all required development dependencies:
npm installAgent and skill files should be kept within reasonable token limits to ensure they work effectively with language models.
Script: scripts/lint-prompting.sh
Usage:
# Lint all agent files in agents/
./scripts/lint-prompting.sh
# Lint a specific agent file
./scripts/lint-prompting.sh agents/PAW.agent.md
# Lint all skill files in skills/
./scripts/lint-prompting.sh --skills
# Lint both agents and skills
./scripts/lint-prompting.sh --all
# Lint a specific skill file
./scripts/lint-prompting.sh skills/paw-workflow/SKILL.mdnpm Scripts:
# Lint all agents
npm run lint:agent
# Lint all agents and skills
npm run lint:agent:all
# Lint only skills
npm run lint:skillsToken Thresholds:
| File Type | Warning | Error |
|---|---|---|
| Agents (default) | 5,000 tokens | 7,000 tokens |
| Skills | 8,000 tokens | 12,000 tokens |
| Status Agent | 5,000 tokens | 8,000 tokens |
| Spec Agent | 5,000 tokens | 10,000 tokens |
Skills have higher thresholds since they are loaded on-demand rather than included in every prompt.
The linter uses @dqbd/tiktoken with the gpt-4o-mini model to count tokens, which provides accurate token counts for OpenAI models.
Best Practices:
- Keep agent files focused and concise
- Break up large instructions into multiple sections
- Remove redundant or overly verbose explanations
- Run the linter before committing changes to agent files
The PAW Workflow extension automatically installs PAW agents and provides commands to streamline work item initialization.
- Node.js 16.x or later
- npm 7.x or later
- VS Code 1.85.0 or later
-
Install dependencies:
npm install
-
Compile TypeScript sources:
npm run compile
-
Run automated tests (optional but recommended):
npm test -
Package the extension:
npm run package
The compiled
.vsixfile will be created in the repository root.
Use either the VS Code UI or the command line.
code --install-extension paw-workflow-0.0.1-dev.vsix- Open the Extensions view (
Ctrl+Shift+X/Cmd+Shift+X). - Open the overflow menu (
…) and choose Install from VSIX.... - Select
paw-workflow-0.0.1-dev.vsixfrom the extension directory. - Reload VS Code when prompted.
- Launch the extension in an Extension Development Host by pressing
F5in VS Code. - Use
npm run watchto recompile on TypeScript file changes. - Reload the development host window (
Ctrl+R/Cmd+R) after changes.
When developing PAW itself using PAW agents:
- Make agent changes in
agents/directory - Build and install VSIX:
npm run package && code --install-extension paw-workflow-0.0.1-dev.vsix - Reload VS Code to use updated agents in your PAW workflow
- Important: Local agent changes DO NOT automatically update installed agents. You must rebuild and reinstall the VSIX to test agent modifications.
This workflow prevents mid-session agent changes from disrupting active PAW workflows.
Local builds use version 0.0.1-dev, which forces agent reinstallation on every activation so agent content changes are reflected immediately. Production releases overwrite this version number during the GitHub Actions release workflow.
- Modify agents in
agents/ - Run
npm run package - Install the VSIX:
code --install-extension paw-workflow-0.0.1-dev.vsix - Reload VS Code and monitor the PAW Workflow output channel for the "Development build detected" log
- Validate agents inside Copilot Chat
Use scripts/test-migration.sh to build VSIX files with temporary versions:
# Build VSIX tagged as 0.2.0
./scripts/test-migration.sh 0.2.0
# Return to dev version builds
./scripts/test-migration.sh 0.0.1-devThe script updates package.json, runs the standard VSIX build, restores the original version, and prints follow-up installation steps. After installing each VSIX, reload VS Code and verify the migration logs plus agent availability.
- Keep
package.jsonset to0.0.1-devlocally - When tagging a release, the workflow replaces the version with the tag (e.g.,
v0.2.0->0.2.0) - Published VSIX files therefore use their tag-based semantic version instead of
-dev
code --uninstall-extension paw-workflow.paw-workflowOr uninstall from the Extensions view inside VS Code.
PAW documentation is built with MkDocs and the Material theme, publishing to GitHub Pages at https://lossyrob.github.io/phased-agent-workflow.
- Python 3.x
- Virtual environment with
mkdocs-materialinstalled
# Create and activate virtual environment (if not already done)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install MkDocs and Material theme
pip install mkdocs-material# Activate virtual environment
source .venv/bin/activate
# Build the site (validates config and links)
mkdocs build
# Serve locally with live reload
mkdocs serve
# Visit http://localhost:8000docs/
├── index.md # Landing page
├── guide/ # User guides
│ ├── index.md # Getting Started
│ ├── vscode-extension.md # Extension commands and config
│ ├── workflow-modes.md # Full/Minimal/Custom modes
│ └── ...
├── specification/ # Technical specifications
│ ├── index.md # Overview
│ ├── implementation.md # Implementation workflow
│ └── review.md # Review workflow
└── reference/ # Reference documentation
├── agents.md # All PAW agents
└── artifacts.md # Artifact descriptions
- Create a new Markdown file in the appropriate
docs/subdirectory - Add the page to navigation in
mkdocs.ymlunder thenav:section - Run
mkdocs build --strictto validate links before committing
Documentation deploys automatically when changes to docs/** or mkdocs.yml are merged to main. The GitHub Actions workflow handles building and publishing to the gh-pages branch.
PAW includes automated workflows for the VS Code extension and documentation:
Automatically creates GitHub Releases with VSIX files when version tags are pushed.
Usage:
- Tag:
git tag v0.2.0 - Push:
git push origin <branch> && git push origin v0.2.0
The workflow builds the extension, packages it as VSIX, generates a changelog, and creates a GitHub Release. The tag version automatically becomes the VSIX version (no manual package.json updates needed). Odd minor versions (0.1.x, 0.3.x) are marked as pre-releases; even versions (0.2.x, 0.4.x) are stable releases.
Runs automated quality checks on pull requests before merging.
Checks:
- Extension unit tests
- Agent file linting (token limits)
The workflow triggers automatically on PRs to main or feature/** branches when relevant files change. Failed checks prevent merge when branch protection is enabled.
Builds and deploys documentation to GitHub Pages when changes are merged to main.
Triggers: Pushes to main that modify docs/**, mkdocs.yml, or .github/workflows/docs.yml
Process:
- Sets up Python and caches Material theme assets
- Installs
mkdocs-material - Runs
mkdocs gh-deploy --forceto build and push togh-pagesbranch - Site updates at https://lossyrob.github.io/phased-agent-workflow
PAW includes an integration testing framework that programmatically drives Copilot SDK sessions to verify skill behavior end-to-end.
- GitHub Copilot CLI - Must be authenticated (
copilot auth status) - Node.js (v18 or higher)
Install integration test dependencies:
cd tests/integration
npm installFrom the repository root:
# All integration tests
npm run test:integration
# Only skill-level tests (fast, no LLM calls)
npm run test:integration:skills
# Only workflow tests (slow, requires Copilot auth)
npm run test:integration:workflowsThe framework provides five core components:
| Component | Purpose |
|---|---|
| TestFixture | Clones template repos into temp directories for test isolation |
| RuleBasedAnswerer | Deterministic auto-responder with configurable rules (fail-closed by default) |
| HybridAnswerer | Rules-first answerer that falls back to an LLM session for unmatched questions |
| ToolPolicy | Sandboxes tool execution—blocks git push, GitHub writes, filesystem escapes |
| ToolCallLog | Records all tool invocations for assertion |
| Assertions | Helpers for artifact existence, spec/plan structure, tool call patterns |
HybridAnswerer tries deterministic rules first (fast, free). If no rule matches, it asks a separate Copilot SDK session to answer the question — or reject it if the question seems off-track. This avoids the brittleness of pure regex matching while keeping the fail-closed safety net.
Set environment variables for troubleshooting:
# Keep temp workspaces after test completion
PAW_TEST_KEEP_WORKSPACE=1 npm run test:integration
# Enable verbose logging
PAW_TEST_DEBUG=1 npm run test:integration- Skill-level tests (no LLM): Test harness components directly. Place in
tests/integration/tests/skills/. - Workflow tests (LLM required): Drive full PAW stages via SDK sessions. Place in
tests/integration/tests/workflows/.
Fixture templates live in tests/integration/fixtures/. Pre-built workflow artifacts (specs, plans) live in tests/integration/fixtures/seeds/.
agents/- PAW agent definitions (bundled in VS Code extension).github/workflows/- GitHub Actions workflows for releases and PR checksscripts/- Development and utility scriptssrc/- VS Code extension TypeScript source codeout/- Compiled JavaScript (generated by TypeScript compiler)tests/integration/- Integration testing framework (Copilot SDK + Node test runner)