ai-core-framework 0.3.0 → 0.4.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.
- package/README.md +5 -5
- package/agents/business-analyst.md +6 -6
- package/agents/developer.md +2 -2
- package/agents/qa-tester.md +3 -3
- package/agents/scrum-master.md +6 -6
- package/agents/tech-lead.md +4 -4
- package/docs/config/backlog.schema.json +1 -1
- package/docs/config/release.schema.json +1 -1
- package/docs/config/ticket.schema.json +1 -1
- package/package.json +1 -1
- package/rules/00-global-rules.md +9 -9
- package/rules/08-definition-of-done.md +1 -1
- package/scripts/ai-core.sh +8 -8
- package/scripts/generate-views.sh +2 -2
- package/scripts/log-user-request.sh +2 -2
- package/scripts/setup-project.sh +34 -26
- package/scripts/sync-platforms.sh +3 -3
- package/scripts/validate-audit-log.sh +1 -1
- package/scripts/validate-docs.sh +4 -4
- package/scripts/validate-permissions.sh +2 -2
- package/scripts/validate-state.sh +4 -4
- package/scripts/workflow.sh +9 -9
- package/skills/brainstorming/SKILL.md +1 -1
- package/skills/development-implement-task/SKILL.md +5 -5
- package/skills/meta-generate-views/SKILL.md +8 -8
- package/skills/meta-request-log/SKILL.md +4 -4
- package/skills/meta-sprint-report/SKILL.md +2 -2
- package/skills/meta-ticket-health/SKILL.md +1 -1
- package/skills/meta-validate-audit-log/SKILL.md +1 -1
- package/skills/meta-validate-permissions/SKILL.md +1 -1
- package/skills/meta-validate-state/SKILL.md +2 -2
- package/skills/planning-analyze-requirements/SKILL.md +7 -7
- package/skills/planning-backlog-status/SKILL.md +6 -6
- package/skills/planning-groom-ticket/SKILL.md +4 -4
- package/skills/planning-mark-ready/SKILL.md +2 -2
- package/skills/planning-plan-refactor/SKILL.md +2 -2
- package/skills/planning-plan-sprint/SKILL.md +3 -3
- package/skills/planning-prioritize-backlog/SKILL.md +2 -2
- package/skills/planning-write-plan/SKILL.md +1 -1
- package/skills/project-discover-codebase/SKILL.md +1 -1
- package/skills/project-setup-project/SKILL.md +7 -7
- package/skills/qa-bug-status/SKILL.md +1 -1
- package/skills/qa-report-bug/SKILL.md +7 -7
- package/skills/qa-smoke-test/SKILL.md +3 -3
- package/skills/qa-verify-fix/SKILL.md +3 -3
- package/skills/release-hotfix/SKILL.md +2 -2
- package/skills/release-release/SKILL.md +1 -1
- package/skills/release-rollback/SKILL.md +1 -1
- package/skills/review-create-pr/SKILL.md +2 -2
- package/skills/review-merge-pr/SKILL.md +1 -1
- package/skills/using-ai-core/SKILL.md +2 -3
- package/skills/verification-before-done/SKILL.md +1 -1
- package/templates/ci/ai-core-governance.yml +7 -7
- package/templates/pr/pull-request-template.md +1 -1
- package/templates/project/CODEOWNERS +1 -1
- package/templates/project/project-structure.yaml +16 -16
- package/workflows/bug-lifecycle.md +3 -3
- package/workflows/feature-lifecycle.md +2 -2
- package/workflows/sprint-lifecycle.md +2 -2
package/README.md
CHANGED
|
@@ -137,18 +137,18 @@ The framework now includes mechanical gates beyond prompt-level rules:
|
|
|
137
137
|
- `scripts/workflow.sh` provides executable state-transition handlers for `/analyze-requirements`, `/groom-ticket`, `/mark-ready`, `/implement-task`, `/create-pr`, `/merge-pr`, `/smoke-test`, and `/release`.
|
|
138
138
|
- `skills/` provides chat-first behavior guidance inspired by skill-based systems: AI Core bootstrap, brainstorming, implementation planning, ticket execution, and verification-before-done.
|
|
139
139
|
- `/analyze-requirements` can create a linked spec in `docs/project/specs/`; `/write-plan` creates a linked implementation plan in `docs/project/plans/`.
|
|
140
|
-
- `scripts/validate-audit-log.sh` validates the hash chain in `docs/runtime/
|
|
141
|
-
- `scripts/log-user-request.sh` appends every AI-handled user request to `docs/runtime/
|
|
142
|
-
- `/request-log` shows recent entries from `docs/runtime/
|
|
140
|
+
- `scripts/validate-audit-log.sh` validates the hash chain in `docs/runtime/audit-log.jsonl`; executable workflow handlers append audit records.
|
|
141
|
+
- `scripts/log-user-request.sh` appends every AI-handled user request to `docs/runtime/user-requests.jsonl` so the user can review what they asked for.
|
|
142
|
+
- `/request-log` shows recent entries from `docs/runtime/user-requests.jsonl`.
|
|
143
143
|
- `scripts/install-codex-prompts.sh` installs AI Core commands as Codex custom slash prompts in `~/.codex/prompts`.
|
|
144
|
-
- `CODEOWNERS` adds review ownership defaults for framework folders, `docs/config/`, `docs/runtime
|
|
144
|
+
- `CODEOWNERS` adds review ownership defaults for framework folders, `docs/config/`, `docs/runtime/`, ADRs, runbooks, and workflows.
|
|
145
145
|
- `docs/config/docs-policy.json` can override documentation detection paths from `docs/config/docs-policy.default.json`.
|
|
146
146
|
- `.github/workflows/ai-core-governance.yml` is the portable governance workflow. App CI remains stack-specific and can be replaced with templates from `templates/ci/`.
|
|
147
147
|
- `scripts/setup-project.sh` makes copied root-level framework installs executable: project config, runtime state folders, docs folders, backlog seed file, platform sync, and state validation.
|
|
148
148
|
- `.github/workflows/ci.yml` and `.github/workflows/validate-state.yml` run AI Core governance checks in CI.
|
|
149
149
|
- `.githooks/pre-commit` runs documentation gates before commit after hooks are installed with `bash scripts/install-hooks.sh`.
|
|
150
150
|
- `docs/config/release.schema.json` and `templates/release/release-record-template.json` define release approval, rollback, QA, security, and known-issue evidence.
|
|
151
|
-
- `scripts/generate-views.sh` now produces dashboard and release readiness views in `docs/runtime/
|
|
151
|
+
- `scripts/generate-views.sh` now produces dashboard and release readiness views in `docs/runtime/views/`.
|
|
152
152
|
|
|
153
153
|
Chat-first setup flow:
|
|
154
154
|
|
|
@@ -20,17 +20,17 @@ cannot_invoke_commands:
|
|
|
20
20
|
read_access:
|
|
21
21
|
- "docs/**"
|
|
22
22
|
- "src/**" # Read-only for context. MUST NOT modify.
|
|
23
|
-
- "docs/runtime
|
|
23
|
+
- "docs/runtime/**"
|
|
24
24
|
write_access:
|
|
25
25
|
- "docs/project/product/**"
|
|
26
26
|
- "docs/project/planning/**"
|
|
27
27
|
- "docs/project/specs/**"
|
|
28
28
|
- "docs/project/requirements/**"
|
|
29
29
|
- "docs/project/user-stories/**"
|
|
30
|
-
- "docs/runtime/
|
|
31
|
-
- "docs/runtime/
|
|
32
|
-
- "docs/runtime/
|
|
33
|
-
- "docs/runtime/
|
|
30
|
+
- "docs/runtime/tickets/**"
|
|
31
|
+
- "docs/runtime/backlog/**"
|
|
32
|
+
- "docs/runtime/views/**"
|
|
33
|
+
- "docs/runtime/sprints/**"
|
|
34
34
|
escalates_to: tech-lead # When technical input is required
|
|
35
35
|
---
|
|
36
36
|
|
|
@@ -63,7 +63,7 @@ You are **NOT** a developer. You **MUST NOT** estimate effort. Estimation belong
|
|
|
63
63
|
- **S**mall
|
|
64
64
|
- **T**estable
|
|
65
65
|
4. **Write Acceptance Criteria** in Gherkin format with at least 3 scenarios: happy path, edge case, error case.
|
|
66
|
-
5. **Create tickets** in `docs/runtime/
|
|
66
|
+
5. **Create tickets** in `docs/runtime/tickets/TICKET-XXX.json`.
|
|
67
67
|
6. **Prioritize** with MoSCoW (Must/Should/Could/Won't).
|
|
68
68
|
7. **Handoff** to Tech Lead for estimation.
|
|
69
69
|
8. **Reverse-document existing behavior** from source code when `/document-existing-requirements` is invoked.
|
package/agents/developer.md
CHANGED
|
@@ -32,7 +32,7 @@ write_access:
|
|
|
32
32
|
- "app/**"
|
|
33
33
|
- "docs/project/api/**"
|
|
34
34
|
- "CHANGELOG.md"
|
|
35
|
-
- "docs/runtime/
|
|
35
|
+
- "docs/runtime/tickets/**"
|
|
36
36
|
escalates_to: tech-lead
|
|
37
37
|
collaborates_with:
|
|
38
38
|
- tech-lead
|
|
@@ -250,7 +250,7 @@ Use `templates/pr/pull-request-template.md`.
|
|
|
250
250
|
### With Tech Lead
|
|
251
251
|
- Ask clarification before coding when anything is unclear.
|
|
252
252
|
- Respond to review gracefully and without defensiveness.
|
|
253
|
-
- Track feedback patterns in `docs/runtime/
|
|
253
|
+
- Track feedback patterns in `docs/runtime/dev-learnings.md`.
|
|
254
254
|
|
|
255
255
|
### With QA
|
|
256
256
|
- Provide clear "how to test" notes in PR.
|
package/agents/qa-tester.md
CHANGED
|
@@ -27,9 +27,9 @@ write_access:
|
|
|
27
27
|
- "docs/runtime/qa/**"
|
|
28
28
|
- "docs/runtime/test-runs/**"
|
|
29
29
|
- "docs/runtime/verifications/**"
|
|
30
|
-
- "docs/runtime/
|
|
31
|
-
- "docs/runtime/
|
|
32
|
-
- "docs/runtime/
|
|
30
|
+
- "docs/runtime/tickets/**"
|
|
31
|
+
- "docs/runtime/bugs/**"
|
|
32
|
+
- "docs/runtime/test-runs/**"
|
|
33
33
|
escalates_to: tech-lead
|
|
34
34
|
collaborates_with:
|
|
35
35
|
- developer
|
package/agents/scrum-master.md
CHANGED
|
@@ -17,10 +17,10 @@ can_invoke_commands:
|
|
|
17
17
|
- /generate-views
|
|
18
18
|
- /ticket-health
|
|
19
19
|
write_access:
|
|
20
|
-
- "docs/runtime/
|
|
21
|
-
- "docs/runtime/
|
|
22
|
-
- "docs/runtime/
|
|
23
|
-
- "docs/runtime/
|
|
20
|
+
- "docs/runtime/sprints/**"
|
|
21
|
+
- "docs/runtime/releases/**"
|
|
22
|
+
- "docs/runtime/metrics/**"
|
|
23
|
+
- "docs/runtime/views/**"
|
|
24
24
|
- "docs/config/project-config.yaml"
|
|
25
25
|
- "docs/config/project-structure.yaml"
|
|
26
26
|
read_access:
|
|
@@ -80,7 +80,7 @@ Only the Scrum Master may execute `/mark-ready`. It MUST verify every item in `r
|
|
|
80
80
|
A sprint MUST NOT be planned above configured capacity unless the overflow is explicitly documented as risk and approved by a human.
|
|
81
81
|
|
|
82
82
|
### RULE SM-004: No hidden work
|
|
83
|
-
Any work performed in a sprint MUST be represented by a ticket or bug in `docs/runtime
|
|
83
|
+
Any work performed in a sprint MUST be represented by a ticket or bug in `docs/runtime/`.
|
|
84
84
|
|
|
85
85
|
### RULE SM-005: Blockers are first-class
|
|
86
86
|
Any ticket blocked longer than the soft threshold in approval gates MUST be surfaced in sprint reports.
|
|
@@ -95,7 +95,7 @@ The Scrum Master coordinates, but does not replace BA, Tech Lead, Developer, or
|
|
|
95
95
|
Velocity, burndown, carryover, defect counts, and cycle time MUST be computed from state files or explicitly labeled as estimates.
|
|
96
96
|
|
|
97
97
|
### RULE SM-009: Ceremony outputs are persisted
|
|
98
|
-
Sprint planning, review, retro, and release summaries MUST be written to `docs/runtime/
|
|
98
|
+
Sprint planning, review, retro, and release summaries MUST be written to `docs/runtime/sprints/`, `docs/runtime/releases/`, or `docs/runtime/metrics/`.
|
|
99
99
|
|
|
100
100
|
### RULE SM-010: Escalate ambiguity
|
|
101
101
|
If command preconditions are unclear, STOP and escalate instead of guessing.
|
package/agents/tech-lead.md
CHANGED
|
@@ -29,9 +29,9 @@ write_access:
|
|
|
29
29
|
- "docs/runtime/technical/**"
|
|
30
30
|
- "docs/architecture/**"
|
|
31
31
|
- "docs/runtime/refactor/**"
|
|
32
|
-
- "docs/runtime/
|
|
33
|
-
- "docs/runtime/
|
|
34
|
-
- "docs/runtime/
|
|
32
|
+
- "docs/runtime/tickets/**"
|
|
33
|
+
- "docs/runtime/backlog/**"
|
|
34
|
+
- "docs/runtime/prs/**"
|
|
35
35
|
escalates_to: human
|
|
36
36
|
collaborates_with:
|
|
37
37
|
- business-analyst
|
|
@@ -179,7 +179,7 @@ When invoking `/hotfix`, you **MUST**:
|
|
|
179
179
|
User: /groom-ticket TICKET-042
|
|
180
180
|
```
|
|
181
181
|
You receive:
|
|
182
|
-
- Ticket JSON from `docs/runtime/
|
|
182
|
+
- Ticket JSON from `docs/runtime/tickets/TICKET-042.json`
|
|
183
183
|
- Full AC
|
|
184
184
|
- Related code, if referenced by the ticket
|
|
185
185
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "Backlog",
|
|
4
|
-
"description": "Project-specific backlog ordering and prioritization schema for docs/runtime/
|
|
4
|
+
"description": "Project-specific backlog ordering and prioritization schema for docs/runtime/backlog/backlog.json",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"required": ["version", "updated_at", "updated_by", "items"],
|
|
7
7
|
"additionalProperties": true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "Release",
|
|
4
|
-
"description": "Schema for release records in docs/runtime/
|
|
4
|
+
"description": "Schema for release records in docs/runtime/releases/",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"required": [
|
|
7
7
|
"version",
|
package/package.json
CHANGED
package/rules/00-global-rules.md
CHANGED
|
@@ -29,7 +29,7 @@ If a rule says **MUST** or **MUST NOT**, it is mandatory and has **NO EXCEPTIONS
|
|
|
29
29
|
|
|
30
30
|
## 🎫 G-001: No code without ticket
|
|
31
31
|
|
|
32
|
-
**MUST NOT** write or modify production code (files in `src/`, `lib/`, `app/`) unless there is an active ticket in `docs/runtime/
|
|
32
|
+
**MUST NOT** write or modify production code (files in `src/`, `lib/`, `app/`) unless there is an active ticket in `docs/runtime/tickets/` with:
|
|
33
33
|
- `status` ∈ `[IN_PROGRESS]`
|
|
34
34
|
- `assignee` = current agent
|
|
35
35
|
|
|
@@ -52,12 +52,12 @@ If a rule says **MUST** or **MUST NOT**, it is mandatory and has **NO EXCEPTIONS
|
|
|
52
52
|
|
|
53
53
|
| Info | Canonical location |
|
|
54
54
|
|------|-------------------|
|
|
55
|
-
| Backlog order and prioritization | `docs/runtime/
|
|
56
|
-
| Ticket details and state history | `docs/runtime/
|
|
57
|
-
| Sprint info | `docs/runtime/
|
|
58
|
-
| Bug details | `docs/runtime/
|
|
59
|
-
| Release records | `docs/runtime/
|
|
60
|
-
| User request log | `docs/runtime/
|
|
55
|
+
| Backlog order and prioritization | `docs/runtime/backlog/backlog.json` |
|
|
56
|
+
| Ticket details and state history | `docs/runtime/tickets/TICKET-XXX.json` |
|
|
57
|
+
| Sprint info | `docs/runtime/sprints/SPRINT-XXX.json` |
|
|
58
|
+
| Bug details | `docs/runtime/bugs/BUG-XXX.json` |
|
|
59
|
+
| Release records | `docs/runtime/releases/vX.Y.Z.json` |
|
|
60
|
+
| User request log | `docs/runtime/user-requests.jsonl` |
|
|
61
61
|
| Project config | `docs/config/project-config.yaml` |
|
|
62
62
|
| Project structure map | `docs/config/project-structure.yaml` |
|
|
63
63
|
| Refactor plans | `docs/runtime/refactor/<name>-refactor-plan.md` |
|
|
@@ -67,7 +67,7 @@ If a rule says **MUST** or **MUST NOT**, it is mandatory and has **NO EXCEPTIONS
|
|
|
67
67
|
|
|
68
68
|
If information is needed in multiple places, **reference** the canonical location. **MUST NOT** copy it.
|
|
69
69
|
|
|
70
|
-
Root-level framework folders are framework-only. Project-specific state and configuration MUST live in `docs/runtime
|
|
70
|
+
Root-level framework folders are framework-only. Project-specific state and configuration MUST live in `docs/runtime/`, `docs/config/`, or `docs/project/`.
|
|
71
71
|
|
|
72
72
|
---
|
|
73
73
|
|
|
@@ -133,7 +133,7 @@ Awaiting: [what decision needed]
|
|
|
133
133
|
**MUST NOT** use the em dash character (—) in output. Use commas, parentheses, or line breaks instead.
|
|
134
134
|
|
|
135
135
|
### G-004f: Log every user request
|
|
136
|
-
At the start of handling every user request, the AI **MUST** append a record to `docs/runtime/
|
|
136
|
+
At the start of handling every user request, the AI **MUST** append a record to `docs/runtime/user-requests.jsonl` before doing substantive work.
|
|
137
137
|
|
|
138
138
|
The log record **MUST** include:
|
|
139
139
|
- Timestamp
|
|
@@ -77,7 +77,7 @@ If a ticket does not pass DoD, it **MUST NOT** be closed. "Ship it, we'll fix la
|
|
|
77
77
|
- [ ] Help docs updated, if user-facing
|
|
78
78
|
|
|
79
79
|
### 10. Ticket Hygiene
|
|
80
|
-
- [ ] Ticket state updated in `docs/runtime/
|
|
80
|
+
- [ ] Ticket state updated in `docs/runtime/tickets/`
|
|
81
81
|
- [ ] `completed_at` timestamp set
|
|
82
82
|
- [ ] PR URL linked
|
|
83
83
|
- [ ] Release version tagged after release
|
package/scripts/ai-core.sh
CHANGED
|
@@ -188,12 +188,12 @@ run_command() {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
ticket_file() {
|
|
191
|
-
printf '%s/docs/runtime/
|
|
191
|
+
printf '%s/docs/runtime/tickets/%s.json' "$PROJECT_ROOT" "$1"
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
latest_audit_field() {
|
|
195
195
|
local field="$1"
|
|
196
|
-
local audit_file="$PROJECT_ROOT/docs/runtime/
|
|
196
|
+
local audit_file="$PROJECT_ROOT/docs/runtime/audit-log.jsonl"
|
|
197
197
|
if [ ! -s "$audit_file" ]; then
|
|
198
198
|
printf ''
|
|
199
199
|
return 0
|
|
@@ -337,20 +337,20 @@ guide_command() {
|
|
|
337
337
|
echo ""
|
|
338
338
|
echo "Updated:"
|
|
339
339
|
if [ -n "$ticket_id" ] && [ -f "$(ticket_file "$ticket_id")" ]; then
|
|
340
|
-
echo "- docs/runtime/
|
|
340
|
+
echo "- docs/runtime/tickets/$ticket_id.json"
|
|
341
341
|
fi
|
|
342
|
-
if [ "$before_audit_hash" != "$after_audit_hash" ] && [ -s "docs/runtime/
|
|
343
|
-
echo "- docs/runtime/
|
|
342
|
+
if [ "$before_audit_hash" != "$after_audit_hash" ] && [ -s "docs/runtime/audit-log.jsonl" ]; then
|
|
343
|
+
echo "- docs/runtime/audit-log.jsonl"
|
|
344
344
|
fi
|
|
345
345
|
case "$(command_name "$command")" in
|
|
346
346
|
generate-views)
|
|
347
|
-
echo "- docs/runtime/
|
|
347
|
+
echo "- docs/runtime/views/*.md"
|
|
348
348
|
;;
|
|
349
349
|
smoke-test)
|
|
350
|
-
echo "- docs/runtime/
|
|
350
|
+
echo "- docs/runtime/test-runs/${ticket_id}-*.md"
|
|
351
351
|
;;
|
|
352
352
|
release)
|
|
353
|
-
echo "- docs/runtime/
|
|
353
|
+
echo "- docs/runtime/releases/*.json"
|
|
354
354
|
;;
|
|
355
355
|
esac
|
|
356
356
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Generates human-readable views from project without changing canonical state.
|
|
5
5
|
# Canonical sources:
|
|
6
|
-
# - docs/runtime/
|
|
7
|
-
# - docs/runtime/
|
|
6
|
+
# - docs/runtime/backlog/backlog.json for backlog order
|
|
7
|
+
# - docs/runtime/tickets/*.json for ticket details and state history
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# scripts/log-user-request.sh
|
|
3
3
|
#
|
|
4
|
-
# Append a sanitized user request record to docs/runtime/
|
|
4
|
+
# Append a sanitized user request record to docs/runtime/user-requests.jsonl.
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
7
|
# bash scripts/log-user-request.sh "user request text"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
11
11
|
REQUEST_TEXT="${*:-}"
|
|
12
|
-
LOG_FILE="${AI_CORE_USER_REQUEST_LOG:-docs/runtime/
|
|
12
|
+
LOG_FILE="${AI_CORE_USER_REQUEST_LOG:-docs/runtime/user-requests.jsonl}"
|
|
13
13
|
|
|
14
14
|
RED='\033[0;31m'
|
|
15
15
|
GREEN='\033[0;32m'
|
package/scripts/setup-project.sh
CHANGED
|
@@ -32,8 +32,12 @@ copy_if_missing() {
|
|
|
32
32
|
log_pass "Created $dst"
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
script_dir() {
|
|
36
|
+
cd "$(dirname "${BASH_SOURCE[0]}")" && pwd
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
write_backlog_if_missing() {
|
|
36
|
-
local path="docs/runtime/
|
|
40
|
+
local path="docs/runtime/backlog/backlog.json"
|
|
37
41
|
|
|
38
42
|
if [ -f "$path" ]; then
|
|
39
43
|
log_pass "Preserved existing $path"
|
|
@@ -46,9 +50,10 @@ write_backlog_if_missing() {
|
|
|
46
50
|
|
|
47
51
|
install_framework_scripts() {
|
|
48
52
|
mkdir -p scripts
|
|
53
|
+
local framework_root="$1"
|
|
49
54
|
|
|
50
55
|
for script in ai-core.sh workflow.sh validate-state.sh validate-docs.sh validate-permissions.sh validate-audit-log.sh generate-views.sh install-codex-prompts.sh log-user-request.sh setup-project.sh; do
|
|
51
|
-
local src="scripts/$script"
|
|
56
|
+
local src="$framework_root/scripts/$script"
|
|
52
57
|
local dst="scripts/$script"
|
|
53
58
|
|
|
54
59
|
if [ ! -f "$src" ]; then
|
|
@@ -68,7 +73,8 @@ install_framework_scripts() {
|
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
install_governance_workflow() {
|
|
71
|
-
local
|
|
76
|
+
local framework_root="$1"
|
|
77
|
+
local src="$framework_root/templates/ci/ai-core-governance.yml"
|
|
72
78
|
local dst=".github/workflows/ai-core-governance.yml"
|
|
73
79
|
|
|
74
80
|
if [ ! -f "$src" ]; then
|
|
@@ -101,32 +107,34 @@ main() {
|
|
|
101
107
|
|
|
102
108
|
local repo_root
|
|
103
109
|
repo_root=$(git rev-parse --show-toplevel)
|
|
110
|
+
local framework_root
|
|
111
|
+
framework_root="$(cd "$(script_dir)/.." && pwd)"
|
|
104
112
|
cd "$repo_root"
|
|
105
113
|
|
|
106
|
-
if [ ! -f "templates/project/project-config.yaml" ] ||
|
|
107
|
-
[ ! -f "templates/project/project-structure.yaml" ]; then
|
|
114
|
+
if [ ! -f "$framework_root/templates/project/project-config.yaml" ] ||
|
|
115
|
+
[ ! -f "$framework_root/templates/project/project-structure.yaml" ]; then
|
|
108
116
|
log_fail "Missing framework project templates"
|
|
109
117
|
exit 1
|
|
110
118
|
fi
|
|
111
119
|
|
|
112
120
|
mkdir -p docs/config
|
|
113
|
-
copy_if_missing "templates/project/project-config.yaml" "docs/config/project-config.yaml"
|
|
114
|
-
copy_if_missing "templates/project/project-structure.yaml" "docs/config/project-structure.yaml"
|
|
115
|
-
copy_if_missing "templates/project/docs-policy.json" "docs/config/docs-policy.json"
|
|
116
|
-
copy_if_missing "templates/project/CODEOWNERS" "CODEOWNERS"
|
|
121
|
+
copy_if_missing "$framework_root/templates/project/project-config.yaml" "docs/config/project-config.yaml"
|
|
122
|
+
copy_if_missing "$framework_root/templates/project/project-structure.yaml" "docs/config/project-structure.yaml"
|
|
123
|
+
copy_if_missing "$framework_root/templates/project/docs-policy.json" "docs/config/docs-policy.json"
|
|
124
|
+
copy_if_missing "$framework_root/templates/project/CODEOWNERS" "CODEOWNERS"
|
|
117
125
|
|
|
118
126
|
for dir in \
|
|
119
|
-
docs/runtime/
|
|
120
|
-
docs/runtime/
|
|
121
|
-
docs/runtime/
|
|
122
|
-
docs/runtime/
|
|
123
|
-
docs/runtime/
|
|
124
|
-
docs/runtime/
|
|
125
|
-
docs/runtime/
|
|
126
|
-
docs/runtime/
|
|
127
|
-
docs/runtime/
|
|
128
|
-
docs/runtime/
|
|
129
|
-
docs/runtime/
|
|
127
|
+
docs/runtime/tickets \
|
|
128
|
+
docs/runtime/backlog \
|
|
129
|
+
docs/runtime/bugs \
|
|
130
|
+
docs/runtime/sprints \
|
|
131
|
+
docs/runtime/releases \
|
|
132
|
+
docs/runtime/metrics \
|
|
133
|
+
docs/runtime/views \
|
|
134
|
+
docs/runtime/test-runs \
|
|
135
|
+
docs/runtime/verifications \
|
|
136
|
+
docs/runtime/incidents \
|
|
137
|
+
docs/runtime/prs \
|
|
130
138
|
docs/project/product \
|
|
131
139
|
docs/project/planning \
|
|
132
140
|
docs/project/specs \
|
|
@@ -147,13 +155,13 @@ main() {
|
|
|
147
155
|
log_pass "Created required state and docs directories"
|
|
148
156
|
|
|
149
157
|
write_backlog_if_missing
|
|
150
|
-
touch docs/runtime/
|
|
151
|
-
touch docs/runtime/
|
|
152
|
-
install_framework_scripts
|
|
153
|
-
install_governance_workflow
|
|
158
|
+
touch docs/runtime/audit-log.jsonl
|
|
159
|
+
touch docs/runtime/user-requests.jsonl
|
|
160
|
+
install_framework_scripts "$framework_root"
|
|
161
|
+
install_governance_workflow "$framework_root"
|
|
154
162
|
|
|
155
|
-
if [ -f "scripts/sync-platforms.sh" ]; then
|
|
156
|
-
bash scripts/sync-platforms.sh
|
|
163
|
+
if [ -f "$framework_root/scripts/sync-platforms.sh" ]; then
|
|
164
|
+
bash "$framework_root/scripts/sync-platforms.sh"
|
|
157
165
|
else
|
|
158
166
|
log_warn "Missing scripts/sync-platforms.sh; platform configs not synced"
|
|
159
167
|
fi
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
set -euo pipefail
|
|
9
9
|
|
|
10
10
|
AI_CORE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
-
PROJECT_ROOT="$
|
|
11
|
+
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
12
12
|
|
|
13
13
|
echo "🔄 Syncing root-level framework folders to AI platforms..."
|
|
14
14
|
echo " Source: $AI_CORE_DIR"
|
|
@@ -85,7 +85,7 @@ request. Do not ask the user to run `bash scripts/ai-core.sh` or set
|
|
|
85
85
|
`AI_AGENT`; use those executable scripts internally only when helpful.
|
|
86
86
|
|
|
87
87
|
### Before any code change
|
|
88
|
-
- [ ] There's an active ticket in `docs/runtime/
|
|
88
|
+
- [ ] There's an active ticket in `docs/runtime/tickets/` with `status: IN_PROGRESS`
|
|
89
89
|
- [ ] You're on the correct feature branch
|
|
90
90
|
- [ ] You're playing the correct agent role inferred from command metadata
|
|
91
91
|
|
|
@@ -160,7 +160,7 @@ This project uses root-level framework folders. Read these files for full contex
|
|
|
160
160
|
|
|
161
161
|
## Top 10 Rules (summary)
|
|
162
162
|
|
|
163
|
-
1. **No code without ticket** (G-001): Active ticket in `docs/runtime/
|
|
163
|
+
1. **No code without ticket** (G-001): Active ticket in `docs/runtime/tickets/` with status IN_PROGRESS
|
|
164
164
|
2. **State machine**: DRAFT → GROOMED → READY → IN_PROGRESS → IN_REVIEW → QA → DONE. No skipping.
|
|
165
165
|
3. **TDD mandatory**: Tests before code
|
|
166
166
|
4. **Coverage ≥ 80%** on diff
|
package/scripts/validate-docs.sh
CHANGED
|
@@ -162,7 +162,7 @@ current_ticket_id() {
|
|
|
162
162
|
validate_ticket_doc_paths() {
|
|
163
163
|
local errors=0
|
|
164
164
|
|
|
165
|
-
if [ ! -d "docs/runtime/
|
|
165
|
+
if [ ! -d "docs/runtime/tickets" ]; then
|
|
166
166
|
return 0
|
|
167
167
|
fi
|
|
168
168
|
|
|
@@ -210,7 +210,7 @@ validate_ticket_doc_paths() {
|
|
|
210
210
|
errors=$((errors + 1))
|
|
211
211
|
fi
|
|
212
212
|
fi
|
|
213
|
-
done < <(find docs/runtime/
|
|
213
|
+
done < <(find docs/runtime/tickets -name '*.json' -type f -print0)
|
|
214
214
|
|
|
215
215
|
return "$errors"
|
|
216
216
|
}
|
|
@@ -218,7 +218,7 @@ validate_ticket_doc_paths() {
|
|
|
218
218
|
validate_done_tickets() {
|
|
219
219
|
local errors=0
|
|
220
220
|
|
|
221
|
-
if [ ! -d "docs/runtime/
|
|
221
|
+
if [ ! -d "docs/runtime/tickets" ]; then
|
|
222
222
|
return 0
|
|
223
223
|
fi
|
|
224
224
|
|
|
@@ -250,7 +250,7 @@ validate_done_tickets() {
|
|
|
250
250
|
errors=$((errors + 1))
|
|
251
251
|
fi
|
|
252
252
|
fi
|
|
253
|
-
done < <(find docs/runtime/
|
|
253
|
+
done < <(find docs/runtime/tickets -name '*.json' -type f -print0)
|
|
254
254
|
|
|
255
255
|
return "$errors"
|
|
256
256
|
}
|
|
@@ -78,7 +78,7 @@ main() {
|
|
|
78
78
|
echo "========================================================"
|
|
79
79
|
echo ""
|
|
80
80
|
|
|
81
|
-
if [ ! -d "docs/runtime/
|
|
81
|
+
if [ ! -d "docs/runtime/tickets" ]; then
|
|
82
82
|
log_info "No tickets directory; skipping"
|
|
83
83
|
exit 0
|
|
84
84
|
fi
|
|
@@ -128,7 +128,7 @@ main() {
|
|
|
128
128
|
errors=$((errors + 1))
|
|
129
129
|
fi
|
|
130
130
|
done
|
|
131
|
-
done < <(find docs/runtime/
|
|
131
|
+
done < <(find docs/runtime/tickets -name '*.json' -type f -print0)
|
|
132
132
|
|
|
133
133
|
echo ""
|
|
134
134
|
echo "========================================================"
|
|
@@ -35,9 +35,9 @@ NC='\033[0m'
|
|
|
35
35
|
# ============================================================
|
|
36
36
|
# Config
|
|
37
37
|
# ============================================================
|
|
38
|
-
TICKETS_DIR="docs/runtime/
|
|
39
|
-
BUGS_DIR="docs/runtime/
|
|
40
|
-
BACKLOG_FILE="docs/runtime/
|
|
38
|
+
TICKETS_DIR="docs/runtime/tickets"
|
|
39
|
+
BUGS_DIR="docs/runtime/bugs"
|
|
40
|
+
BACKLOG_FILE="docs/runtime/backlog/backlog.json"
|
|
41
41
|
SCHEMA_FILE="docs/config/ticket.schema.json"
|
|
42
42
|
|
|
43
43
|
# ============================================================
|
|
@@ -444,7 +444,7 @@ validate_backlog() {
|
|
|
444
444
|
# Validate release governance records
|
|
445
445
|
# ============================================================
|
|
446
446
|
validate_releases() {
|
|
447
|
-
local releases_dir="docs/runtime/
|
|
447
|
+
local releases_dir="docs/runtime/releases"
|
|
448
448
|
|
|
449
449
|
if [ ! -d "$releases_dir" ]; then
|
|
450
450
|
return 0
|
package/scripts/workflow.sh
CHANGED
|
@@ -38,7 +38,7 @@ agent_name() {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
ticket_file() {
|
|
41
|
-
printf 'docs/runtime/
|
|
41
|
+
printf 'docs/runtime/tickets/%s.json' "$1"
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
slugify() {
|
|
@@ -50,7 +50,7 @@ slugify() {
|
|
|
50
50
|
|
|
51
51
|
next_ticket_id() {
|
|
52
52
|
local max_id
|
|
53
|
-
max_id=$(find docs/runtime/
|
|
53
|
+
max_id=$(find docs/runtime/tickets -name 'TICKET-*.json' -type f 2>/dev/null |
|
|
54
54
|
sed -E 's/.*TICKET-([0-9]+)\.json/\1/' |
|
|
55
55
|
sort -n |
|
|
56
56
|
tail -1)
|
|
@@ -79,7 +79,7 @@ hash_value() {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
last_audit_hash() {
|
|
82
|
-
local audit_file="docs/runtime/
|
|
82
|
+
local audit_file="docs/runtime/audit-log.jsonl"
|
|
83
83
|
if [ ! -s "$audit_file" ]; then
|
|
84
84
|
printf ''
|
|
85
85
|
return 0
|
|
@@ -95,7 +95,7 @@ append_audit() {
|
|
|
95
95
|
local reason="$5"
|
|
96
96
|
|
|
97
97
|
mkdir -p project
|
|
98
|
-
local audit_file="docs/runtime/
|
|
98
|
+
local audit_file="docs/runtime/audit-log.jsonl"
|
|
99
99
|
local at by prev payload hash
|
|
100
100
|
at=$(now_utc)
|
|
101
101
|
by=$(agent_name)
|
|
@@ -181,7 +181,7 @@ cmd_analyze_requirements() {
|
|
|
181
181
|
exit 1
|
|
182
182
|
fi
|
|
183
183
|
|
|
184
|
-
mkdir -p docs/runtime/
|
|
184
|
+
mkdir -p docs/runtime/tickets docs/project/specs
|
|
185
185
|
local ticket_id file at by slug spec_path
|
|
186
186
|
ticket_id=$(next_ticket_id)
|
|
187
187
|
file=$(ticket_file "$ticket_id")
|
|
@@ -349,7 +349,7 @@ Implement the ticket scope while preserving the approved acceptance criteria and
|
|
|
349
349
|
|
|
350
350
|
## Current Context
|
|
351
351
|
|
|
352
|
-
- Read \`docs/runtime/
|
|
352
|
+
- Read \`docs/runtime/tickets/${ticket_id}.json\`.
|
|
353
353
|
- Read the linked spec if present.
|
|
354
354
|
- Inspect affected code before editing.
|
|
355
355
|
|
|
@@ -452,7 +452,7 @@ cmd_smoke_test() {
|
|
|
452
452
|
log_fail "$ticket_id status must be QA before QA evidence is written"
|
|
453
453
|
exit 1
|
|
454
454
|
fi
|
|
455
|
-
[ -n "$evidence_path" ] || evidence_path="docs/runtime/
|
|
455
|
+
[ -n "$evidence_path" ] || evidence_path="docs/runtime/test-runs/${ticket_id}-$(date -u +%Y%m%d%H%M%S).md"
|
|
456
456
|
mkdir -p "$(dirname "$evidence_path")"
|
|
457
457
|
if [ ! -f "$evidence_path" ]; then
|
|
458
458
|
printf '# Smoke Test Evidence: %s\n\nGenerated by executable smoke-test gate at %s.\n' "$ticket_id" "$(now_utc)" > "$evidence_path"
|
|
@@ -478,8 +478,8 @@ cmd_smoke_test() {
|
|
|
478
478
|
cmd_release() {
|
|
479
479
|
local version="${1:-}"
|
|
480
480
|
[ -n "$version" ] || { log_fail "Usage: /release vMAJOR.MINOR.PATCH"; exit 2; }
|
|
481
|
-
mkdir -p docs/runtime/
|
|
482
|
-
local file="docs/runtime/
|
|
481
|
+
mkdir -p docs/runtime/releases
|
|
482
|
+
local file="docs/runtime/releases/${version}.json"
|
|
483
483
|
if [ -f "$file" ]; then
|
|
484
484
|
log_fail "Release record already exists: $file"
|
|
485
485
|
exit 1
|
|
@@ -14,7 +14,7 @@ Use this before implementation work, feature creation, behavior changes, or larg
|
|
|
14
14
|
3. Propose 2-3 approaches with tradeoffs and a recommendation.
|
|
15
15
|
4. Present a concise design for user approval.
|
|
16
16
|
5. Save the approved spec to `docs/project/specs/TICKET-XXX-<slug>.md`.
|
|
17
|
-
6. Link the spec from `docs/runtime/
|
|
17
|
+
6. Link the spec from `docs/runtime/tickets/TICKET-XXX.json` as `spec_path`.
|
|
18
18
|
7. Suggest `/groom-ticket TICKET-XXX`.
|
|
19
19
|
|
|
20
20
|
## Hard Gates
|