Skip to content

Commit 4386466

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent 5c1a21a commit 4386466

7 files changed

Lines changed: 519 additions & 81 deletions

File tree

docs/design.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ The validator enforces the pb-spec markdown contract:
181181
- Required fields: Context, Verification, Scenario Coverage, Loop Type, Behavioral Contract, Simplification Focus, Status, BDD Verification, Advanced Test Verification, Runtime Verification
182182
- Valid statuses: 🔴 TODO, 🟡 IN PROGRESS, 🟢 DONE, ⏭️ SKIPPED, 🔄 DCR, ⛔ OBSOLETE
183183
- At least one checkbox step per task
184+
- Duplicate task IDs are rejected
185+
- `N/A` verification placeholders must include a reason
186+
- Markdown-carried `🛑 Build Blocked` and `🔄 Design Change Request` packets are checked for required sections when present
184187

185188
**features/ Contract:**
186189

@@ -252,7 +255,7 @@ All external operations are protected with appropriate timeouts:
252255

253256
## 10. Known Constraints and Future Enhancements
254257

255-
1. **Markdown parsing**: Current implementation uses regex matching; future versions may adopt AST-based parsing for better accuracy
258+
1. **Markdown parsing**: Current implementation uses a contract-specific line parser with regex token boundaries; future versions may adopt AST-based parsing if lossless editing becomes a requirement
256259
2. **Language support**: Additional programming languages can be added by extending scanner patterns
257260
3. **Performance**: For very large codebases, consider implementing parallel scanning or incremental validation
258261
4. **Integration**: Future versions may integrate with CI/CD pipelines for automated quality gates

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "uv_build"
44

55
[project]
66
name = "pb-spec"
7-
version = "1.0.2"
7+
version = "1.0.3"
88
description = "Plan-Build Spec (pb-spec): A CLI tool for managing AI coding assistant skills"
99
readme = "README.md"
1010
license = "Apache-2.0"
@@ -23,7 +23,7 @@ classifiers = [
2323
"Topic :: Software Development :: Libraries :: Python Modules",
2424
]
2525
dependencies = [
26-
"click>=8.3.1",
26+
"click>=8.3.3",
2727
]
2828

2929
[project.urls]
@@ -40,9 +40,9 @@ testpaths = ["tests"]
4040
[dependency-groups]
4141
dev = [
4242
"behave>=1.3.3",
43-
"pytest>=9.0.2",
44-
"ruff>=0.15.8",
45-
"ty>=0.0.26",
43+
"pytest>=9.0.3",
44+
"ruff>=0.15.12",
45+
"ty>=0.0.32",
4646
]
4747

4848
[tool.ruff]

skills/pb-build/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ After the Generator signals `READY_FOR_EVAL`, the orchestrator must perform an *
192192
- The task description from `tasks.md`
193193
- The relevant `.feature` file scenarios
194194
- The `design.md` architecture decisions for this task
195+
- If the agent runtime exposes a context-forking option, keep it disabled for the Evaluator. Never reuse the Generator agent/session ID, and never pass the Generator transcript.
195196

196197
2. **Spawn Evaluator Persona.** Use the `references/evaluator_prompt.md` template, filled with:
197198
- The full task description
@@ -211,6 +212,7 @@ After the Generator signals `READY_FOR_EVAL`, the orchestrator must perform an *
211212
- **Frontend tasks:** Use browser automation to navigate, screenshot, and interact with the running app.
212213
- **Backend tasks:** Use HTTP tools to hit real API endpoints, verify status codes and response bodies.
213214
- If tools are unavailable, fall back to CLI-based verification (curl, wget) and document the limitation.
215+
- Clean up every live verification resource you start: close browser pages/contexts, terminate local dev servers, and release MCP/tool sessions even when verification fails.
214216

215217
**Check C — Edge Case Probing:**
216218
- Test at least 2 boundary/edge cases not explicitly in the scenario

skills/pb-build/references/evaluator_prompt.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ You MUST verify the implementation works at runtime. Do NOT rely on test logs al
116116
- Check that configuration files are syntactically valid
117117
- Verify no regressions in existing tooling
118118

119+
**Resource cleanup requirement:**
120+
121+
- Close any browser page/context/session you open for verification.
122+
- Stop any local server, subprocess, tunnel, or watcher you start for verification.
123+
- Release MCP/tool sessions even when a verification step fails.
124+
- If cleanup cannot be verified, report that limitation in the verdict.
125+
119126
**Output:** Document every verification step taken and its result. Include MCP tool commands and responses.
120127

121128
### Check C — Edge Case Probing

0 commit comments

Comments
 (0)