@aipper/aiws-spec 0.0.31 → 0.0.33

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 (33) hide show
  1. package/docs/workflow-governance-rules.json +11 -7
  2. package/docs/workflow-governance-rules.md +19 -19
  3. package/docs/workflow-governance-rules.schema.json +1 -0
  4. package/docs/workflow-review-gates.json +5 -5
  5. package/docs/workflow-review-gates.md +4 -4
  6. package/docs/workflow-stage-contracts.json +2 -2
  7. package/docs/workflow-stage-contracts.md +2 -2
  8. package/docs/ws-goal-contract.md +239 -0
  9. package/package.json +1 -1
  10. package/templates/workspace/.agents/skills/using-aiws/SKILL.md +8 -1
  11. package/templates/workspace/.agents/skills/ws-analyze/SKILL.md +1 -1
  12. package/templates/workspace/.agents/skills/ws-dev/SKILL.md +1 -1
  13. package/templates/workspace/.agents/skills/ws-goal/SKILL.md +89 -0
  14. package/templates/workspace/.agents/skills/ws-intake/SKILL.md +30 -11
  15. package/templates/workspace/.agents/skills/ws-preflight/SKILL.md +4 -3
  16. package/templates/workspace/.agents/skills/ws-req-review/SKILL.md +1 -1
  17. package/templates/workspace/.agents/skills/ws-research/SKILL.md +56 -0
  18. package/templates/workspace/.agents/skills/ws-review/SKILL.md +1 -1
  19. package/templates/workspace/.aiws/tools/ws_change_check.py +11 -4
  20. package/templates/workspace/.claude/commands/ws-goal.md +34 -0
  21. package/templates/workspace/.claude/skills/ws-intake/SKILL.md +26 -4
  22. package/templates/workspace/.opencode/command/ws-goal.md +39 -0
  23. package/templates/workspace/.opencode/command/ws-preflight.md +4 -3
  24. package/templates/workspace/.opencode/command/ws-req-review.md +1 -1
  25. package/templates/workspace/.opencode/commands/ws-preflight.md +4 -3
  26. package/templates/workspace/.opencode/commands/ws-req-review.md +1 -1
  27. package/templates/workspace/.opencode/lib/aiws-context.js +38 -4
  28. package/templates/workspace/.opencode/oh-my-opencode.json.example +5 -0
  29. package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +61 -6
  30. package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +4 -3
  31. package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +1 -1
  32. package/templates/workspace/manifest.json +25 -20
  33. package/templates/workspace/tools/ws_tasks_plan.py +97 -0
@@ -38,6 +38,7 @@
38
38
  ".claude/commands/ws-dev-lite.md",
39
39
  ".claude/commands/ws-dev.md",
40
40
  ".claude/commands/ws-finish.md",
41
+ ".claude/commands/ws-goal.md",
41
42
  ".claude/commands/ws-handoff.md",
42
43
  ".claude/commands/ws-intake.md",
43
44
  ".claude/commands/ws-migrate.md",
@@ -88,26 +89,18 @@
88
89
  ".opencode/command/ws-deliver.md",
89
90
  ".opencode/command/ws-dev-lite.md",
90
91
  ".opencode/command/ws-dev.md",
91
- ".opencode/command/ws-finish.md",
92
- ".opencode/command/ws-handoff.md",
93
- ".opencode/command/ws-intake.md",
94
- ".opencode/command/ws-migrate.md",
95
- ".opencode/command/ws-plan-verify.md",
96
- ".opencode/command/ws-plan.md",
97
- ".opencode/command/ws-preflight.md",
98
- ".opencode/command/ws-pull.md",
99
- ".opencode/command/ws-push.md",
100
- ".opencode/command/ws-quality-review.md",
101
- ".opencode/command/ws-req-change.md",
102
- ".opencode/command/ws-req-contract-sync.md",
103
- ".opencode/command/ws-req-contract-validate.md",
104
- ".opencode/command/ws-req-flow-sync.md",
105
- ".opencode/command/ws-req-review.md",
106
- ".opencode/command/ws-review.md",
107
- ".opencode/command/ws-rule.md",
108
- ".opencode/command/ws-spec-review.md",
109
- ".opencode/command/ws-submodule-setup.md",
110
- ".opencode/command/ws-verify-before-complete.md",
92
+ ".opencode/command/ws-finish.md",
93
+ ".opencode/command/ws-goal.md",
94
+ ".opencode/command/ws-handoff.md",
95
+ ".opencode/command/ws-intake.md",
96
+ ".opencode/command/ws-plan.md",
97
+ ".opencode/command/ws-delegate.md",
98
+ ".opencode/command/ws-autonomy.md",
99
+ ".opencode/command/ws-auto.md",
100
+ ".opencode/command/ws-plan-verify.md",
101
+ ".opencode/command/ws-spec-review.md",
102
+ ".opencode/command/ws-quality-review.md",
103
+ ".opencode/command/ws-verify-before-complete.md",
111
104
  ".opencode/plugins/aiws-inject-context.js",
112
105
  ".opencode/plugins/aiws-session-start.js",
113
106
  ".opencode/plugins/aiws-workflow-state.js",
@@ -150,6 +143,7 @@
150
143
  "optional": [
151
144
  ".aiws/memory-bank/**",
152
145
  ".aiws/secrets/test-accounts.example.json",
146
+ ".agents/skills/ws-delegate/SKILL.md",
153
147
  ".opencode/oh-my-opencode.json.example",
154
148
  ".claude/settings.json.example",
155
149
  ".opencode/helpers/approval-whitelist-check.sh",
@@ -185,6 +179,7 @@
185
179
  ".agents/skills/aiws-update/SKILL.md",
186
180
  ".agents/skills/aiws-validate/SKILL.md",
187
181
  ".agents/skills/ws-tasks-plan/SKILL.md",
182
+ ".agents/skills/ws-research/SKILL.md",
188
183
  ".claude/commands/aiws-change-archive.md",
189
184
  ".claude/commands/aiws-change-finish.md",
190
185
  ".claude/commands/aiws-change-list.md",
@@ -257,6 +252,7 @@
257
252
  ".claude/commands/ws-spec-review.md",
258
253
  ".claude/commands/ws-quality-review.md",
259
254
  ".claude/commands/ws-verify-before-complete.md",
255
+ ".claude/commands/ws-goal.md",
260
256
  ".claude/skills/using-aiws/SKILL.md",
261
257
  ".opencode/command/p-aiws-change-archive.md",
262
258
  ".opencode/command/p-aiws-change-finish.md",
@@ -272,6 +268,7 @@
272
268
  ".opencode/command/p-aiws-hooks-install.md",
273
269
  ".opencode/command/p-aiws-hooks-status.md",
274
270
  ".opencode/command/using-aiws.md",
271
+ ".opencode/command/ws-goal.md",
275
272
  ".opencode/command/ws-intake.md",
276
273
  ".opencode/command/ws-plan.md",
277
274
  ".opencode/command/ws-delegate.md",
@@ -349,8 +346,10 @@
349
346
  ".agents/skills/ws-review/SKILL.md",
350
347
  ".agents/skills/ws-commit/SKILL.md",
351
348
  ".agents/skills/ws-delegate/SKILL.md",
349
+ ".agents/skills/ws-research/SKILL.md",
352
350
  ".agents/skills/ws-deliver/SKILL.md",
353
351
  ".agents/skills/ws-finish/SKILL.md",
352
+ ".agents/skills/ws-goal/SKILL.md",
354
353
  ".agents/skills/ws-handoff/SKILL.md",
355
354
  ".agents/skills/ws-migrate/SKILL.md",
356
355
  ".agents/skills/ws-pull/SKILL.md",
@@ -580,6 +579,9 @@
580
579
  ".claude/commands/ws-plan-verify.md": [
581
580
  "claude:ws-plan-verify"
582
581
  ],
582
+ ".claude/commands/ws-goal.md": [
583
+ "claude:ws-goal"
584
+ ],
583
585
  ".claude/commands/ws-handoff.md": [
584
586
  "claude:ws-handoff"
585
587
  ],
@@ -655,6 +657,9 @@
655
657
  ".opencode/command/ws-plan-verify.md": [
656
658
  "opencode:ws-plan-verify"
657
659
  ],
660
+ ".opencode/command/ws-goal.md": [
661
+ "opencode:ws-goal"
662
+ ],
658
663
  ".opencode/command/ws-handoff.md": [
659
664
  "opencode:ws-handoff"
660
665
  ],
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env python3
2
+ """ws_tasks_plan — parse tasks.md checkbox progress and emit structured status/plan payloads.
3
+
4
+ Usage:
5
+ python3 ws_tasks_plan.py status --file changes/<id>/tasks.md
6
+ python3 ws_tasks_plan.py plan --file changes/<id>/tasks.md [--explanation "<reason>"]
7
+
8
+ Output (stdout):
9
+ status → JSON: { "total": N, "done": N, "pending": N }
10
+ plan → JSON: { "plan": [{ "status": "...", "content": "..." }], "explanation": "..." }
11
+
12
+ Rules:
13
+ - Only parses checkbox items (`- [ ]` / `- [x]` / `- [X]`).
14
+ - In `plan` mode, derives status from checkbox: `[x]` → completed, unchecked → pending.
15
+ - If there is at least one unchecked item, the first unchecked item is inferred as in_progress.
16
+ - Ignores non-checkbox lines, comments, and blank lines.
17
+ """
18
+
19
+ import argparse
20
+ import json
21
+ import sys
22
+ import re
23
+
24
+ CHECKBOX_RE = re.compile(r'^\s*-\s*\[([ xX])\]\s*(.*)$')
25
+
26
+
27
+ def parse_tasks(filepath):
28
+ """Return list of { 'checked': bool, 'label': str } from tasks.md."""
29
+ tasks = []
30
+ try:
31
+ with open(filepath, 'r', encoding='utf-8') as f:
32
+ for line in f:
33
+ m = CHECKBOX_RE.match(line)
34
+ if m:
35
+ checked = m.group(1).lower() == 'x'
36
+ label = m.group(2).strip()
37
+ tasks.append({'checked': checked, 'label': label})
38
+ except FileNotFoundError:
39
+ print(f"Error: file not found: {filepath}", file=sys.stderr)
40
+ sys.exit(1)
41
+ return tasks
42
+
43
+
44
+ def cmd_status(args):
45
+ tasks = parse_tasks(args.file)
46
+ total = len(tasks)
47
+ done = sum(1 for t in tasks if t['checked'])
48
+ pending = total - done
49
+ print(json.dumps({'total': total, 'done': done, 'pending': pending}, ensure_ascii=False))
50
+
51
+
52
+ def cmd_plan(args):
53
+ tasks = parse_tasks(args.file)
54
+ plan_items = []
55
+ found_first_unchecked = False
56
+
57
+ for t in tasks:
58
+ if t['checked']:
59
+ status = 'completed'
60
+ elif not found_first_unchecked:
61
+ status = 'in_progress'
62
+ found_first_unchecked = True
63
+ else:
64
+ status = 'pending'
65
+
66
+ plan_items.append({'status': status, 'content': t['label']})
67
+
68
+ result = {
69
+ 'plan': plan_items,
70
+ 'explanation': args.explanation or 'sync tasks.md -> update_plan',
71
+ }
72
+ print(json.dumps(result, ensure_ascii=False))
73
+
74
+
75
+ def main():
76
+ parser = argparse.ArgumentParser(description='Parse tasks.md for AIWS change workflow')
77
+ sub = parser.add_subparsers(dest='command')
78
+
79
+ stat = sub.add_parser('status', help='Emit total/done/pending counts')
80
+ stat.add_argument('--file', required=True, help='Path to tasks.md')
81
+
82
+ plan = sub.add_parser('plan', help='Emit update_plan JSON payload')
83
+ plan.add_argument('--file', required=True, help='Path to tasks.md')
84
+ plan.add_argument('--explanation', default='', help='Why this plan sync is being performed')
85
+
86
+ args = parser.parse_args()
87
+ if args.command == 'status':
88
+ cmd_status(args)
89
+ elif args.command == 'plan':
90
+ cmd_plan(args)
91
+ else:
92
+ parser.print_help()
93
+ sys.exit(1)
94
+
95
+
96
+ if __name__ == '__main__':
97
+ main()