guardian-framework 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +463 -0
  3. package/dist/cli.js +12958 -0
  4. package/dist/exports.js +12765 -0
  5. package/package.json +61 -0
  6. package/templates/languages/go-patterns.md +411 -0
  7. package/templates/languages/java-patterns.md +545 -0
  8. package/templates/languages/python-patterns.md +312 -0
  9. package/templates/languages/rust-patterns.md +232 -0
  10. package/templates/languages/typescript-patterns.md +313 -0
  11. package/templates/pi/INDEX.md +437 -0
  12. package/templates/pi/agent/AGENTS.md +166 -0
  13. package/templates/pi/agents/architecture-coordinator.md +40 -0
  14. package/templates/pi/agents/architecture-validator.md +36 -0
  15. package/templates/pi/agents/bootstrap-implementer.md +37 -0
  16. package/templates/pi/agents/issue-factory.md +31 -0
  17. package/templates/pi/agents/operations-validator.md +32 -0
  18. package/templates/pi/agents/security-validator.md +33 -0
  19. package/templates/pi/architecture/CHANGELOG.md +78 -0
  20. package/templates/pi/architecture/decisions/ADR-template.md +76 -0
  21. package/templates/pi/architecture/diagrams/system-overview.md +159 -0
  22. package/templates/pi/architecture/modules/module-template.md +152 -0
  23. package/templates/pi/context/checklists.md +91 -0
  24. package/templates/pi/context/domain-workflow.md +180 -0
  25. package/templates/pi/context/output-formats.md +135 -0
  26. package/templates/pi/context/patterns-base.md +47 -0
  27. package/templates/pi/context/patterns.md +38 -0
  28. package/templates/pi/context/project.md +88 -0
  29. package/templates/pi/domain/exploration.md +93 -0
  30. package/templates/pi/domain/ubiquitous-language.md +24 -0
  31. package/templates/pi/extensions/architect-lib/generators.ts +528 -0
  32. package/templates/pi/extensions/architect-lib/helpers.ts +344 -0
  33. package/templates/pi/extensions/architect-lib/types.ts +117 -0
  34. package/templates/pi/extensions/architect.ts +1425 -0
  35. package/templates/pi/extensions/ask-user-question.ts +579 -0
  36. package/templates/pi/extensions/bash-guard.ts +556 -0
  37. package/templates/pi/extensions/config-reload.ts +115 -0
  38. package/templates/pi/extensions/coordinator.ts +304 -0
  39. package/templates/pi/extensions/curator.ts +543 -0
  40. package/templates/pi/extensions/domain-explorer.ts +990 -0
  41. package/templates/pi/extensions/filechanges.ts +656 -0
  42. package/templates/pi/extensions/goal-loop.ts +717 -0
  43. package/templates/pi/extensions/hooks.ts +452 -0
  44. package/templates/pi/extensions/kanban.ts +547 -0
  45. package/templates/pi/extensions/pipeline.ts +1246 -0
  46. package/templates/pi/extensions/plan-mode.ts +209 -0
  47. package/templates/pi/extensions/project-scaffolder.ts +284 -0
  48. package/templates/pi/extensions/read-only-mode.ts +192 -0
  49. package/templates/pi/extensions/redaction.ts +128 -0
  50. package/templates/pi/extensions/session-persistence.ts +174 -0
  51. package/templates/pi/extensions/slash-commands.ts +229 -0
  52. package/templates/pi/extensions/snippets.ts +201 -0
  53. package/templates/pi/extensions/validation-runner.ts +100 -0
  54. package/templates/pi/github/agents/architecture-coordinator.agent.md +27 -0
  55. package/templates/pi/github/agents/architecture-validator.agent.md +20 -0
  56. package/templates/pi/github/agents/bootstrap-implementer.agent.md +20 -0
  57. package/templates/pi/github/agents/epic-planner.agent.md +70 -0
  58. package/templates/pi/github/agents/issue-factory.agent.md +20 -0
  59. package/templates/pi/github/agents/operations-validator.agent.md +20 -0
  60. package/templates/pi/github/agents/security-validator.agent.md +20 -0
  61. package/templates/pi/github/copilot/settings.json +16 -0
  62. package/templates/pi/github/copilot-instructions.md +155 -0
  63. package/templates/pi/github/instructions/architecture.instructions.md +71 -0
  64. package/templates/pi/github/instructions/validation.instructions.md +69 -0
  65. package/templates/pi/github/workflows/01-planning-workflow.md +75 -0
  66. package/templates/pi/github/workflows/02-issue-generation-workflow.md +69 -0
  67. package/templates/pi/github/workflows/03-implementation-workflow.md +80 -0
  68. package/templates/pi/github/workflows/04-validation-workflow.md +68 -0
  69. package/templates/pi/preflight_report.json +99 -0
  70. package/templates/pi/prompts/blueprint-update.md +262 -0
  71. package/templates/pi/prompts/blueprint-validate.md +218 -0
  72. package/templates/pi/prompts/bug-fix.md +50 -0
  73. package/templates/pi/prompts/ci-blueprint.md +131 -0
  74. package/templates/pi/prompts/context-refresh.md +258 -0
  75. package/templates/pi/prompts/epic-plan.md +356 -0
  76. package/templates/pi/prompts/epic-template.md +186 -0
  77. package/templates/pi/prompts/feature-development.md +131 -0
  78. package/templates/pi/prompts/git-issues.md +243 -0
  79. package/templates/pi/prompts/hotfix.md +71 -0
  80. package/templates/pi/prompts/issue-closeout.md +342 -0
  81. package/templates/pi/prompts/issue-draft.md +218 -0
  82. package/templates/pi/prompts/issue-implementation-series.md +173 -0
  83. package/templates/pi/prompts/issue-merge.md +372 -0
  84. package/templates/pi/prompts/issue-template-set.md +392 -0
  85. package/templates/pi/prompts/issue-template.md +207 -0
  86. package/templates/pi/prompts/pattern-extract.md +269 -0
  87. package/templates/pi/prompts/plan-to-issues.md +430 -0
  88. package/templates/pi/prompts/refactoring.md +82 -0
  89. package/templates/pi/prompts/scope-analyzer.md +254 -0
  90. package/templates/pi/prompts/sync-check.md +230 -0
  91. package/templates/pi/scripts/categorize-issues.sh +171 -0
  92. package/templates/pi/scripts/ci/check_architecture_conformance.sh +748 -0
  93. package/templates/pi/scripts/ci/check_planning_packet.py +228 -0
  94. package/templates/pi/scripts/ci/run_hardening_stages.sh +264 -0
  95. package/templates/pi/scripts/ci/run_preflight.sh +649 -0
  96. package/templates/pi/scripts/ci/run_stage.sh +193 -0
  97. package/templates/pi/scripts/ci/stage_docs_policy.sh +82 -0
  98. package/templates/pi/scripts/ci/stage_integration.sh +3 -0
  99. package/templates/pi/scripts/ci/stage_lint.sh +130 -0
  100. package/templates/pi/scripts/ci/stage_migration_verify.sh +3 -0
  101. package/templates/pi/scripts/ci/stage_package_build.sh +3 -0
  102. package/templates/pi/scripts/ci/stage_release_readiness.sh +3 -0
  103. package/templates/pi/scripts/ci/stage_remaining.sh +242 -0
  104. package/templates/pi/scripts/ci/stage_security.sh +3 -0
  105. package/templates/pi/scripts/ci/stage_static_analysis.sh +114 -0
  106. package/templates/pi/scripts/ci/stage_unit.sh +119 -0
  107. package/templates/pi/scripts/ci/validate_agent_output.py +181 -0
  108. package/templates/pi/scripts/ci/validate_agent_output.sh +243 -0
  109. package/templates/pi/scripts/create-feature-branch.sh +136 -0
  110. package/templates/pi/scripts/create-mr.sh +117 -0
  111. package/templates/pi/scripts/fetch-issues.sh +131 -0
  112. package/templates/pi/scripts/generate-architecture.sh +161 -0
  113. package/templates/pi/scripts/git/close-epic.sh +69 -0
  114. package/templates/pi/scripts/git/close-issue.sh +35 -0
  115. package/templates/pi/scripts/git/create-tracking-issue.sh +174 -0
  116. package/templates/pi/scripts/git/link-issue-to-epic.sh +51 -0
  117. package/templates/pi/scripts/git/update-tracking-issue.sh +66 -0
  118. package/templates/pi/scripts/languages/go/validate-architecture.sh +139 -0
  119. package/templates/pi/scripts/languages/go/validate-canonical.sh +129 -0
  120. package/templates/pi/scripts/languages/go/validate-ci.sh +132 -0
  121. package/templates/pi/scripts/languages/go/validate-integration.sh +156 -0
  122. package/templates/pi/scripts/languages/go/validate-operations.sh +146 -0
  123. package/templates/pi/scripts/languages/go/validate-security.sh +135 -0
  124. package/templates/pi/scripts/languages/go/validate-tests.sh +125 -0
  125. package/templates/pi/scripts/languages/java/validate-annotations.sh +185 -0
  126. package/templates/pi/scripts/languages/java/validate-architecture.sh +159 -0
  127. package/templates/pi/scripts/languages/java/validate-canonical.sh +114 -0
  128. package/templates/pi/scripts/languages/java/validate-ci.sh +269 -0
  129. package/templates/pi/scripts/languages/java/validate-integration.sh +149 -0
  130. package/templates/pi/scripts/languages/java/validate-operations.sh +142 -0
  131. package/templates/pi/scripts/languages/java/validate-security.sh +174 -0
  132. package/templates/pi/scripts/languages/java/validate-spring-architecture.sh +227 -0
  133. package/templates/pi/scripts/languages/java/validate-tests.sh +159 -0
  134. package/templates/pi/scripts/languages/python/validate-architecture.sh +99 -0
  135. package/templates/pi/scripts/languages/python/validate-canonical.sh +124 -0
  136. package/templates/pi/scripts/languages/python/validate-ci.sh +130 -0
  137. package/templates/pi/scripts/languages/python/validate-integration.sh +119 -0
  138. package/templates/pi/scripts/languages/python/validate-operations.sh +107 -0
  139. package/templates/pi/scripts/languages/python/validate-security.sh +68 -0
  140. package/templates/pi/scripts/languages/python/validate-tests.sh +102 -0
  141. package/templates/pi/scripts/languages/rust/validate-architecture.sh +188 -0
  142. package/templates/pi/scripts/languages/rust/validate-canonical.sh +146 -0
  143. package/templates/pi/scripts/languages/rust/validate-ci.sh +147 -0
  144. package/templates/pi/scripts/languages/rust/validate-integration.sh +149 -0
  145. package/templates/pi/scripts/languages/rust/validate-operations.sh +154 -0
  146. package/templates/pi/scripts/languages/rust/validate-security.sh +153 -0
  147. package/templates/pi/scripts/languages/rust/validate-tests.sh +150 -0
  148. package/templates/pi/scripts/languages/typescript/validate-architecture.sh +157 -0
  149. package/templates/pi/scripts/languages/typescript/validate-canonical.sh +135 -0
  150. package/templates/pi/scripts/languages/typescript/validate-ci.sh +244 -0
  151. package/templates/pi/scripts/languages/typescript/validate-integration.sh +166 -0
  152. package/templates/pi/scripts/languages/typescript/validate-operations.sh +162 -0
  153. package/templates/pi/scripts/languages/typescript/validate-security.sh +169 -0
  154. package/templates/pi/scripts/languages/typescript/validate-tests.sh +158 -0
  155. package/templates/pi/scripts/merge-mr.sh +95 -0
  156. package/templates/pi/scripts/mr-validation.sh +228 -0
  157. package/templates/pi/scripts/validate-architecture-readiness.sh +153 -0
  158. package/templates/pi/scripts/validate-architecture.sh +22 -0
  159. package/templates/pi/scripts/validate-canonical.sh +22 -0
  160. package/templates/pi/scripts/validate-ci.sh +37 -0
  161. package/templates/pi/scripts/validate-integration.sh +22 -0
  162. package/templates/pi/scripts/validate-operations.sh +22 -0
  163. package/templates/pi/scripts/validate-security.sh +22 -0
  164. package/templates/pi/scripts/validate-tests.sh +22 -0
  165. package/templates/pi/scripts/validate-ubiquitous-language.sh +291 -0
  166. package/templates/pi/scripts/validation-cache.sh +139 -0
  167. package/templates/pi/skills/agents/architecture-coordinator.md +178 -0
  168. package/templates/pi/skills/agents/architecture-generator.md +79 -0
  169. package/templates/pi/skills/agents/architecture-validator.md +74 -0
  170. package/templates/pi/skills/agents/ci-mr-validator.md +46 -0
  171. package/templates/pi/skills/agents/code-developer.md +76 -0
  172. package/templates/pi/skills/agents/commit.md +46 -0
  173. package/templates/pi/skills/agents/curator.md +71 -0
  174. package/templates/pi/skills/agents/debug.md +59 -0
  175. package/templates/pi/skills/agents/documentation-maintainer.md +36 -0
  176. package/templates/pi/skills/agents/goal-loop.md +125 -0
  177. package/templates/pi/skills/agents/hooks.md +122 -0
  178. package/templates/pi/skills/agents/integration-validator.md +35 -0
  179. package/templates/pi/skills/agents/issue-creator.md +75 -0
  180. package/templates/pi/skills/agents/issue-factory.md +143 -0
  181. package/templates/pi/skills/agents/kanban.md +85 -0
  182. package/templates/pi/skills/agents/land.md +59 -0
  183. package/templates/pi/skills/agents/operations-validator.md +43 -0
  184. package/templates/pi/skills/agents/pipeline.md +113 -0
  185. package/templates/pi/skills/agents/plan-mode.md +77 -0
  186. package/templates/pi/skills/agents/pull.md +40 -0
  187. package/templates/pi/skills/agents/push.md +41 -0
  188. package/templates/pi/skills/agents/security-validator.md +85 -0
  189. package/templates/pi/skills/agents/session-persistence.md +119 -0
  190. package/templates/pi/skills/agents/slash-commands.md +117 -0
  191. package/templates/pi/skills/agents/snippets.md +99 -0
  192. package/templates/pi/skills/agents/subagent-registry.md +78 -0
  193. package/templates/pi/skills/agents/test-validator.md +42 -0
  194. package/templates/pi/skills/validators/architecture-validator.md +43 -0
  195. package/templates/pi/skills/validators/ci-validator.md +27 -0
  196. package/templates/pi/skills/validators/context-compaction.md +73 -0
  197. package/templates/pi/skills/validators/integration-validator.md +38 -0
  198. package/templates/pi/skills/validators/model-registry.md +96 -0
  199. package/templates/pi/skills/validators/operations-validator.md +34 -0
  200. package/templates/pi/skills/validators/security-guards.md +72 -0
  201. package/templates/pi/skills/validators/security-validator.md +41 -0
  202. package/templates/pi/skills/validators/system-prompt-tiers.md +69 -0
  203. package/templates/pi/skills/validators/test-validator.md +33 -0
  204. package/templates/pi/types.ts +62 -0
  205. package/templates/pi/validators/README.md +93 -0
  206. package/templates/pi/validators/default.toml +209 -0
  207. package/templates/pi/validators/spring.toml +142 -0
  208. package/templates/pi/workpad.md +53 -0
  209. package/templates/project/java/Dockerfile +14 -0
  210. package/templates/project/java/README.md +40 -0
  211. package/templates/project/java/pom.xml +132 -0
  212. package/templates/project/typescript/Dockerfile +15 -0
  213. package/templates/project/typescript/README.md +29 -0
  214. package/templates/project/typescript/package.json +23 -0
  215. package/templates/project/typescript/tsconfig.json +21 -0
  216. package/templates/workflow.md +123 -0
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: issue-creator
3
+ description: Creates and manages GitHub issues. Use for tracking work items.
4
+ model: inherit
5
+ tools: [Bash, Read]
6
+ ---
7
+
8
+ # Issue Creator
9
+
10
+ You create and manage GitHub issues for work tracking.
11
+
12
+ ## Context
13
+ - `.pi/context/project.md` — project labels, conventions
14
+
15
+ ## Issue Types & Templates
16
+
17
+ ### Feature Request
18
+ ```markdown
19
+ ## Feature: [Name]
20
+
21
+ ### Requirements
22
+ - [ ] Requirement 1
23
+ - [ ] Requirement 2
24
+
25
+ ### Scope
26
+ - **Level:** [Simple/Moderate/Complex/Critical]
27
+ - **Files:** [count]
28
+
29
+ ### Acceptance Criteria
30
+ - [ ] Criterion 1
31
+ - [ ] Criterion 2
32
+ ```
33
+
34
+ ### Bug Report
35
+ ```markdown
36
+ ## Bug: [Description]
37
+
38
+ ### Steps to Reproduce
39
+ 1. Step 1
40
+ 2. Step 2
41
+
42
+ ### Expected vs Actual
43
+ [Comparison]
44
+ ```
45
+
46
+ ### Tech Debt
47
+ ```markdown
48
+ ## Tech Debt: [Description]
49
+
50
+ ### Current vs Desired State
51
+ [Comparison]
52
+
53
+ ### Effort: [Small/Medium/Large]
54
+ ```
55
+
56
+ ## Labels
57
+
58
+ | Category | Labels |
59
+ |----------|--------|
60
+ | Priority | `P0-critical`, `P1-high`, `P2-medium`, `P3-low` |
61
+ | Type | `type:feature`, `type:bug`, `type:tech-debt`, `type:docs` |
62
+ | Status | `status:blocked`, `status:in-progress`, `status:needs-review` |
63
+
64
+ ## Commands
65
+
66
+ ```bash
67
+ # Create issue
68
+ gh issue create --title "..." --body "..." --label "type:feature,P1-high"
69
+
70
+ # Update issue
71
+ gh issue edit [N] --add-label "status:in-progress"
72
+
73
+ # Close issue
74
+ gh issue close [N] --comment "Merged in #[PR]"
75
+ ```
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: issue-factory
3
+ description: Transforms accepted architecture scope into executable GitLab/GitHub issues with complete session context.
4
+ model: inherit
5
+ tools: [Read, Write, Edit]
6
+ ---
7
+
8
+ # Issue Factory
9
+
10
+ ## Purpose
11
+
12
+ Transforms accepted architecture scope into executable GitLab/GitHub work items. Every issue generated contains the complete session context needed for a fresh agent to implement correctly.
13
+
14
+ Related references:
15
+ - [issue-template.md](../../prompts/issue-template.md)
16
+ - [epic-template.md](../../prompts/epic-template.md)
17
+ - [ci-blueprint.md](../../prompts/ci-blueprint.md)
18
+
19
+ ## Workflow
20
+
21
+ 1. Start from an accepted architecture scope (`.pi/architecture/modules/*.md`).
22
+ 2. Build a dependency graph of components.
23
+ 3. Create one epic per feature or platform hardening stream.
24
+ 4. Create issues only at the smallest independently reviewable unit.
25
+ 5. Add issue dependencies in execution order.
26
+ 6. Add verification issues only when they cannot fit into implementation issues.
27
+
28
+ ## Required Issue Fields
29
+
30
+ Every issue must contain:
31
+
32
+ - **Title** — `<Layer or Feature>: <Concrete action>`
33
+ - **Why** — Business or platform reason
34
+ - **Scope** — Exact change
35
+ - **In scope** — Bullet list of what's included
36
+ - **Out of scope** — Bullet list of what's explicitly excluded
37
+ - **Dependencies** — blocked by / blocks relationships
38
+ - **Files/layers affected** — domain, application, infrastructure, api
39
+ - **Acceptance criteria** — Tied to specific Guardian validators
40
+ - **Test requirements** — Unit/integration/e2e/conformance expectations
41
+ - **Rollout/ops notes** — Feature flags, migration steps, monitoring
42
+ - **Canonical references** — Architecture module + ADR paths
43
+
44
+ ## Recommended Labels
45
+
46
+ | Label | Meaning |
47
+ |-------|---------|
48
+ | `layer::domain` | Domain model, entities, value objects |
49
+ | `layer::application` | Use cases, services, handlers |
50
+ | `layer::infrastructure` | Databases, queues, external APIs |
51
+ | `layer::api` | REST/gRPC endpoints, middleware |
52
+ | `layer::security` | Auth, encryption, secrets |
53
+ | `layer::operations` | Observability, runbooks, DR |
54
+ | `type::feature` | New functionality |
55
+ | `type::hardening` | Security/performance improvement |
56
+ | `type::migration` | Schema or config migration |
57
+ | `type::test` | Test-only work |
58
+ | `risk::high` | Breaks existing behavior |
59
+ | `risk::medium` | Changes internal behavior |
60
+ | `risk::low` | Additive, no breaking changes |
61
+
62
+ ## Epic Shape
63
+
64
+ ### Feature Epic
65
+
66
+ - domain contract
67
+ - application handler/API work
68
+ - runtime/worker work
69
+ - infrastructure/storage work
70
+ - security review
71
+ - observability and rollout
72
+
73
+ ### Platform Hardening Epic
74
+
75
+ - architecture change
76
+ - migration and config
77
+ - verification suite
78
+ - rollout and runbook update
79
+
80
+ ## Sizing Rules
81
+
82
+ ### Good Issue
83
+
84
+ - one primary owner
85
+ - one review path
86
+ - one clear output
87
+ - can be merged independently behind a flag if needed
88
+
89
+ ### Bad Issue
90
+
91
+ - changes multiple unrelated contracts
92
+ - mixes schema, runtime, and ops with no shared acceptance criterion
93
+ - has vague outputs like 'update backend architecture'
94
+
95
+ ## Dependency Ordering Template
96
+
97
+ 1. contract issue
98
+ 2. schema/index issue
99
+ 3. repository/service issue
100
+ 4. handler/runtime issue
101
+ 5. verification issue
102
+ 6. rollout/runbook issue
103
+
104
+ ## Agent Issue-Generation Order
105
+
106
+ 1. **Architecture Coordinator** drafts epic map
107
+ 2. **Domain/Application/Runtime/Infrastructure agents** draft issue candidates
108
+ 3. **Security and Operations agents** append mandatory controls and release criteria
109
+ 4. **Integration Agent** removes overlap and resolves dependency conflicts
110
+ 5. **Issue Factory Agent** emits final issues
111
+
112
+ ## Issue Generation Process
113
+
114
+ For each planned component in the architecture module:
115
+
116
+ ```yaml
117
+ Input: .pi/architecture/modules/auth-system.md#jwt-token-validation
118
+ Output: .pi/issues/ISSUE-001-jwt-token-validation.md
119
+ ```
120
+
121
+ The generated issue file includes:
122
+
123
+ 1. **YAML front matter** — parsed by Guardian for pipeline orchestration
124
+ 2. **Intent** — what this issue aims to achieve
125
+ 3. **Dependency graph** — ASCII art showing relationships
126
+ 4. **In/Out of scope** — explicit boundaries
127
+ 5. **Affected layers** — which layers change and how
128
+ 6. **Canonical references** — architecture module + ADRs
129
+ 7. **Acceptance criteria** — tied to validators
130
+ 8. **Implementation notes** — specific technical guidance
131
+ 9. **File changes** — expected creates/modifies
132
+
133
+ ## Validation Rules
134
+
135
+ Before an issue is emitted:
136
+
137
+ 1. **No orphaned issues** — every issue belongs to an epic
138
+ 2. **No circular dependencies** — dependency graph must be acyclic
139
+ 3. **Clear acceptance criteria** — at least one validator referenced
140
+ 4. **Canonical reference exists** — must reference an architecture module
141
+ 5. **Scope is bounded** — must have both in-scope and out-of-scope
142
+ 6. **Layers are specified** — must list affected layers
143
+ 7. **Dependencies are valid** — referenced issues must exist
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: kanban
3
+ description: Durable task board for tracking multi-session, multi-agent work with state machine transitions.
4
+ model: inherit
5
+ tools: [Read, Bash]
6
+ ---
7
+
8
+ # Guardian Kanban Board
9
+
10
+ A durable task board backed by `.pi/.guardian-kanban.json`. Tasks have state machines, dependency links, comments, and workspace management. Unlike subagent delegation (RPC-style, blocking), kanban is **fire-and-forget** and **crash-resilient**.
11
+
12
+ ## Task States
13
+
14
+ ```
15
+ triage → todo → ready → running → done → archived
16
+ ↑ ↓ ↑
17
+ └── blocked ────────┘
18
+ ```
19
+
20
+ | State | Meaning |
21
+ |-------|---------|
22
+ | `triage` | New task, needs review |
23
+ | `todo` | Ready to be picked up |
24
+ | `ready` | All dependencies met, can start |
25
+ | `running` | Currently being worked on |
26
+ | `blocked` | Cannot proceed (reason recorded) |
27
+ | `done` | Completed |
28
+ | `archived` | Historical record |
29
+
30
+ ## Tools
31
+
32
+ | Tool | Description |
33
+ |------|-------------|
34
+ | `kanban_create` | Create a new task (title, body, assignee, priority, dependencies) |
35
+ | `kanban_list` | List tasks, optionally filtered by status |
36
+ | `kanban_show` | Show full task details including comments |
37
+ | `kanban_complete` | Mark a task as done (auto-unblocks children) |
38
+ | `kanban_block` | Block a task with a reason |
39
+ | `kanban_comment` | Add a comment to a task |
40
+
41
+ ## Commands
42
+
43
+ | Command | What it does |
44
+ |---------|-------------|
45
+ | `/kanban` or `/kanban status` | Board summary with task counts by status |
46
+ | `/kanban create <title>` | Quick-create a task |
47
+ | `/kanban list [status]` | List tasks (optionally filter by status) |
48
+
49
+ ## Creating Tasks with Dependencies
50
+
51
+ ```
52
+ kanban_create(
53
+ title: "Implement auth middleware",
54
+ body: "Add JWT validation to all /api/* routes",
55
+ priority: "high",
56
+ parents: ["TK-0001"] # depends on TK-0001
57
+ )
58
+ ```
59
+
60
+ When a parent task is marked `done`, dependent tasks automatically transition from `todo` to `ready`.
61
+
62
+ ## Priority Levels
63
+
64
+ | Priority | Emoji | Use for |
65
+ |----------|-------|---------|
66
+ | `critical` | 🔴 | Blocking issues, security fixes |
67
+ | `high` | 🟠 | Current sprint, important features |
68
+ | `medium` | 🟡 | Normal features, improvements |
69
+ | `low` | 🟢 | Nice-to-have, tech debt |
70
+
71
+ ## When to use Kanban vs. Subagents
72
+
73
+ | Use Kanban when... | Use Subagents when... |
74
+ |--------------------|----------------------|
75
+ | Work crosses sessions | Parent needs answer before continuing |
76
+ | Work needs human input | No humans involved |
77
+ | Work might be retried by different agent | Result goes back into parent's context |
78
+ | You need a durable audit trail | Short-lived investigation |
79
+
80
+ ## Workspace Types
81
+
82
+ | Type | Description |
83
+ |------|-------------|
84
+ | `scratch` (default) | Temporary workspace, cleaned on completion |
85
+ | `dir:/absolute/path` | Shared directory (must be absolute path) |
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: land
3
+ description: Execute the PR merge loop with full validation before merging.
4
+ ---
5
+
6
+ # Land Skill
7
+
8
+ When a ticket reaches `Merging` state, execute the land loop: validate, merge, and move to Done.
9
+
10
+ **NEVER call `gh pr merge` or `glab mr merge` directly.** Use this skill.
11
+
12
+ ## Protocol
13
+
14
+ 1. **Verify PR is approved** — check review status
15
+ 2. **Verify all checks pass** — CI, lint, tests
16
+ 3. **Verify workpad is complete** — all acceptance criteria checked
17
+ 4. **Verify no outstanding review comments** — run feedback sweep
18
+ 5. **Merge** the PR using the configured repository tool
19
+ 6. **Delete** the feature branch (remote and local)
20
+ 7. **Move ticket** to Done state
21
+ 8. **Update tracking** — update changelog if needed
22
+
23
+ ## GitHub
24
+
25
+ ```bash
26
+ # Check PR status
27
+ gh pr view <number> --json state,mergeStateStatus,reviewDecision,statusCheckRollup
28
+
29
+ # Verify checks pass
30
+ gh pr checks <number>
31
+
32
+ # Verify reviews
33
+ gh pr view <number> --json reviews
34
+
35
+ # Merge (squash for clean history, or merge for preserving commits)
36
+ gh pr merge <number> --squash --delete-branch
37
+
38
+ # Or rebase merge
39
+ gh pr merge <number> --rebase --delete-branch
40
+ ```
41
+
42
+ ## GitLab
43
+
44
+ ```bash
45
+ # Check MR status
46
+ glab mr view <iid>
47
+
48
+ # Merge MR
49
+ glab mr merge <iid> --when-pipeline-succeeds --should-remove-source-branch
50
+ ```
51
+
52
+ ## Rules
53
+
54
+ - NEVER merge if any check is failing
55
+ - NEVER merge if review is not approved
56
+ - NEVER merge if acceptance criteria are incomplete
57
+ - ALWAYS delete the feature branch after merge
58
+ - ALWAYS move the ticket to Done after merge
59
+ - If merge fails, document the failure in the workpad and notify
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: operations-validator
3
+ description: Validates production readiness. Performance, observability, error handling, cancellation.
4
+ model: inherit
5
+ tools: [Read, Grep, Glob, Bash]
6
+ ---
7
+
8
+ # Operations Validator
9
+
10
+ You ensure code changes are production-ready.
11
+
12
+ ## Context
13
+ - `.pi/context/project.md` — project knowledge
14
+ - `.pi/context/checklists.md` — operations checklist
15
+ - `.pi/context/output-formats.md` — report format
16
+ - `.pi/context/patterns.md` — required patterns
17
+
18
+ ## Core Checks
19
+
20
+ 1. **Performance** — No O(N²) where O(N) expected, proper data structures
21
+ 2. **Observability** — Tracing on public functions, events for state changes
22
+ 3. **Cancellation** — CancellationToken in all async ops, proper cleanup
23
+ 4. **Resource Management** — Files closed, no leaks, bounded structures
24
+ 5. **Atomic Writes** — Write-rename pattern for persistence
25
+
26
+ ## Automated Checks (Run via Script)
27
+
28
+ ```bash
29
+ # Tracing coverage
30
+ grep -r "#\[instrument\]" [src] --include="*.[ext]"
31
+
32
+ # Cancellation handling
33
+ grep -r "cancel_token" [src] --include="*.[ext]"
34
+
35
+ # Atomic writes
36
+ grep -r "fs::rename" [src] --include="*.[ext]"
37
+
38
+ # Benchmarks
39
+ [bench command]
40
+ ```
41
+
42
+ ## Output
43
+ Use format from `.pi/context/output-formats.md` → "Validation Report"
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: pipeline
3
+ description: Multi-step workflow engine for iterating over items with per-step prompts and acceptance gates.
4
+ model: inherit
5
+ tools: [Read, Bash, Edit]
6
+ ---
7
+
8
+ # Pipeline Engine
9
+
10
+ A multi-step workflow that iterates over items (issues, tasks, etc.) with per-step prompts and acceptance conditions. Each step can require validators to pass before advancing.
11
+
12
+ ## When to use it
13
+
14
+ Use `/pipeline` when you need to repeat a structured workflow across multiple items:
15
+
16
+ - "Close all P1 bugs" → implement → validate → create MR → merge
17
+ - "Add tests to these 5 modules" → implement tests → validate tests → commit
18
+ - "Security review for these 10 endpoints" → security-review → validate → document
19
+
20
+ Unlike `/goal` (single objective, auto-iterate), `/pipeline` is a **step-by-step state machine** with explicit gates.
21
+
22
+ ## Commands
23
+
24
+ | Command | Effect |
25
+ |---------|--------|
26
+ | `/pipeline <name> --items "id1,id2,id3" --steps "implement,validate,create-mr"` | Start a pipeline |
27
+ | `/pipeline <name> --items "id1,id2" --steps "implement,validate" --merge-on-valid` | Start with auto-merge |
28
+ | `/pipeline` or `/pipeline status` | Show current pipeline progress |
29
+ | `/pipeline pause` | Pause at current step |
30
+ | `/pipeline resume` | Resume from where paused |
31
+ | `/pipeline skip-step` | Skip current step, move to next |
32
+ | `/pipeline retry-step` | Retry the current step |
33
+ | `/pipeline abort` | Kill pipeline |
34
+
35
+ ## Built-in Steps
36
+
37
+ | Step | Prompt | Acceptance Gate |
38
+ |------|--------|-----------------|
39
+ | `implement` | `.pi/prompts/issue-implementation-series.md` | CI validator |
40
+ | `validate` | — | CI + tests + security validators |
41
+ | `create-mr` | `.pi/prompts/issue-closeout.md` | None |
42
+ | `merge` | — | CI + canonical validators |
43
+ | `document` | `.pi/prompts/blueprint-update.md` | Canonical validator |
44
+ | `test` | — | Tests validator |
45
+ | `security-review` | — | Security validator |
46
+
47
+ ## Example: Close all P1 bugs
48
+
49
+ ```
50
+ You: /pipeline "Close P1 bugs" --items "1234,1235,1236" --steps "implement,validate,create-mr,merge" --merge-on-valid
51
+
52
+ ▶ Pipeline "Close P1 bugs" started (PL-0001)
53
+ Items: 1234, 1235, 1236
54
+ Steps: implement → validate → create-mr → merge
55
+ Merge on valid: enabled
56
+
57
+ [Step 1/12] Item 1234 → implement
58
+ Agent: [loads issue-implementation-series.md, implements fix]
59
+ ✓ CI passes → advance
60
+
61
+ [Step 2/12] Item 1234 → validate
62
+ Agent: [runs ci, tests, security validators]
63
+ ✓ All pass → advance
64
+
65
+ [Step 3/12] Item 1234 → create-mr
66
+ Agent: [creates merge request]
67
+ ✓ MR created → advance
68
+
69
+ [Step 4/12] Item 1234 → merge
70
+ ✓ Merged → advance to next item
71
+
72
+ [Step 5/12] Item 1235 → implement
73
+ ...continues
74
+ ```
75
+
76
+ ## Acceptance Gates
77
+
78
+ Each step can have a different acceptance condition:
79
+
80
+ | Type | Behavior |
81
+ |------|----------|
82
+ | `validator` | Runs specified validators. Must all pass to advance. |
83
+ | `shell` | Runs a custom shell command. Exit 0 = pass. |
84
+ | `llm` | LLM evaluates completion against a prompt. |
85
+ | `none` | No gate. Always advances. |
86
+
87
+ ## Tools
88
+
89
+ | Tool | Description |
90
+ |------|-------------|
91
+ | `pipeline_status` | Show current pipeline status and progress |
92
+ | `pipeline_advance` | Mark current step as passed and advance |
93
+ | `pipeline_fail` | Mark current step as failed, skip remaining steps for this item |
94
+
95
+ ## Pipeline States
96
+
97
+ ```
98
+ running → paused (user) → running (user)
99
+ ↓ ↓
100
+ done aborted (user)
101
+
102
+ failed (step failure without retry)
103
+ ```
104
+
105
+ ## Custom Steps
106
+
107
+ You can add custom steps by name. Unknown steps have no prompt and no acceptance gate:
108
+
109
+ ```
110
+ /pipeline "Custom flow" --items "task1,task2" --steps "implement,custom-review,validate"
111
+ ```
112
+
113
+ The `custom-review` step will run with no prompt and no gate — the agent works freely.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: plan-mode
3
+ description: Queues file mutations for batch review instead of executing immediately. User reviews all changes as a single diff before accepting/rejecting.
4
+ model: inherit
5
+ tools: [Read, Write, Edit]
6
+ ---
7
+
8
+ # Plan Mode Extension
9
+
10
+ Plan Mode intercepts all mutating tool calls (`write_file`, `edit`, `multi_edit`, `create_directory`) and **queues** them for batch review instead of executing immediately. The agent works in a read-only research mode, then the user reviews all queued changes at once.
11
+
12
+ ## Flow
13
+
14
+ 1. User enables plan mode: `/plan` or `/plan on`
15
+ 2. Agent reads files, researches, and **queues** mutations without executing
16
+ 3. Agent stops and presents a summary of planned changes
17
+ 4. User reviews all queued edits as a side-by-side diff
18
+ 5. User accepts/rejects each change (or all at once)
19
+ 6. Accepted changes are applied; rejected changes are discarded
20
+ 7. Plan mode can stay on for iterative refinement
21
+
22
+ ## Queued Edit Structure
23
+
24
+ ```typescript
25
+ interface QueuedEdit {
26
+ id: string; // Unique edit ID (stable across updates)
27
+ kind: "edit" | "multi_edit" | "write_file" | "create_directory";
28
+ path: string; // Absolute file path
29
+ originalContent: string;
30
+ proposedContent: string;
31
+ isNewFile: boolean; // true for write_file/create_directory on non-existent paths
32
+ description?: string; // Optional human-readable description
33
+ }
34
+ ```
35
+
36
+ ## Behavior by Tool
37
+
38
+ | Tool | Normal Mode | Plan Mode |
39
+ |------|------------|-----------|
40
+ | `read_file` | Execute | Execute (read-only always runs) |
41
+ | `grep` | Execute | Execute |
42
+ | `list_directory` | Execute | Execute |
43
+ | `edit` | Execute immediately | Queue for review |
44
+ | `multi_edit` | Execute immediately | Queue for review |
45
+ | `write_file` | Execute immediately | Queue for review |
46
+ | `create_directory` | Execute immediately | Queue for review |
47
+ | `bash_run` | Execute (with approval) | **Refuse** — no shell in plan mode |
48
+ | `bash_background` | Execute (with approval) | **Refuse** — no shell in plan mode |
49
+
50
+ ## Validation in Plan Mode
51
+
52
+ While plan mode is active, the agent should:
53
+ - Use `todo_write` to track planned changes before queueing
54
+ - Stop after queuing all mutations (don't continue acting)
55
+ - Provide a brief summary: files changed, lines added/removed, new files created
56
+
57
+ ## Anti-Abuse
58
+
59
+ - Shell commands (`bash_run`, `bash_background`) are refused in plan mode
60
+ - Subagent spawning is allowed but subagents also inherit plan mode restrictions
61
+ - The queue is per-session — switching sessions clears the queue
62
+
63
+ ## Pi Extension API
64
+
65
+ ```typescript
66
+ // Plan mode state managed via Zustand-style store
67
+ const planModeStore = {
68
+ active: boolean,
69
+ queue: QueuedEdit[],
70
+ enable() { this.active = true; },
71
+ disable() { this.active = false; this.queue = []; },
72
+ enqueue(edit: QueuedEdit) { this.queue.push(edit); },
73
+ clear() { this.queue = []; },
74
+ accept(ids: string[]) { /* Apply queued edits */ },
75
+ reject(ids: string[]) { /* Discard queued edits */ },
76
+ };
77
+ ```
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: pull
3
+ description: Keep branch updated with latest origin/main before handoff.
4
+ ---
5
+
6
+ # Pull Skill
7
+
8
+ Sync with latest origin/main before implementation or handoff.
9
+
10
+ ## Protocol
11
+
12
+ 1. **Fetch** latest from remote
13
+ 2. **Merge** origin/main into current branch
14
+ 3. **Record** the result in workpad or notes
15
+ 4. **Rerun** validations if conflicts were resolved
16
+
17
+ ## Commands
18
+
19
+ ```bash
20
+ # Fetch latest
21
+ git fetch origin
22
+
23
+ # Check what would change
24
+ git log HEAD..origin/main --oneline
25
+
26
+ # Merge into current branch
27
+ git merge origin/main --no-edit
28
+
29
+ # Record evidence
30
+ # merge source: origin/main
31
+ # result: clean / conflicts resolved
32
+ # HEAD: <short-sha>
33
+ ```
34
+
35
+ ## When to Run
36
+
37
+ - Before starting any implementation
38
+ - Before pushing changes
39
+ - After being asked to rebase
40
+ - When reviewer comments suggest the branch is out of date
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: push
3
+ description: Keep remote branch current and publish updates.
4
+ ---
5
+
6
+ # Push Skill
7
+
8
+ Publish local changes to remote and keep branch updated.
9
+
10
+ ## Protocol
11
+
12
+ 1. **Before push:** run all validations for the scope
13
+ 2. **Merge latest origin/main** into the branch and resolve conflicts
14
+ 3. **Rerun validations** after merge
15
+ 4. **Push** to remote
16
+
17
+ ## Commands
18
+
19
+ ```bash
20
+ # Fetch latest
21
+ git fetch origin
22
+
23
+ # Merge main into current branch
24
+ git merge origin/main
25
+
26
+ # If conflicts: resolve, then
27
+ git add <resolved-files>
28
+ git commit -m "fix: resolve merge conflicts"
29
+
30
+ # Push branch (create if needed)
31
+ git push -u origin <branch-name>
32
+
33
+ # Force push only with --force-with-lease (never --force)
34
+ git push --force-with-lease
35
+ ```
36
+
37
+ ## Rules
38
+
39
+ - ALWAYS merge origin/main before pushing
40
+ - NEVER use `git push --force` — use `--force-with-lease` only when necessary
41
+ - ALWAYS re-run validations after resolving conflicts