ai-core-framework 0.1.0 → 0.3.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 +19 -19
- package/{core/agents → agents}/business-analyst.md +7 -7
- package/{core/agents → agents}/developer.md +2 -2
- package/{core/agents → agents}/qa-tester.md +3 -3
- package/{core/agents → agents}/scrum-master.md +16 -12
- package/{core/agents → agents}/tech-lead.md +4 -4
- package/bin/ai-core-framework.js +4 -4
- package/{core → docs}/config/backlog.schema.json +1 -1
- package/{core → docs}/config/release.schema.json +1 -1
- package/{core → docs}/config/ticket.schema.json +1 -1
- package/hooks/hooks-cursor.json +16 -0
- package/hooks/hooks.json +16 -0
- package/hooks/session-start +21 -0
- package/lib/install-codex.js +39 -7
- package/package.json +9 -2
- package/{core/rules → rules}/00-global-rules.md +18 -18
- package/{core/rules → rules}/02-code-quality.md +1 -1
- package/{core/rules → rules}/04-documentation.md +1 -1
- package/{core/rules → rules}/05-testing-mandatory.md +2 -2
- package/{core/rules → rules}/06-approval-gates.md +2 -2
- package/{core/rules → rules}/08-definition-of-done.md +1 -1
- package/{core/scripts → scripts}/ai-core.sh +43 -21
- package/{core/scripts → scripts}/generate-views.sh +2 -2
- package/{core/scripts → scripts}/install-codex-prompts.sh +23 -15
- package/{core/scripts → scripts}/log-user-request.sh +5 -5
- package/{core/scripts → scripts}/setup-project.sh +33 -38
- package/{core/scripts → scripts}/sync-platforms.sh +49 -45
- package/{core/scripts → scripts}/validate-audit-log.sh +2 -2
- package/{core/scripts → scripts}/validate-docs.sh +6 -6
- package/{core/scripts → scripts}/validate-permissions.sh +17 -3
- package/{core/scripts → scripts}/validate-state.sh +6 -6
- package/{core/scripts → scripts}/workflow.sh +16 -16
- package/{core/skills → skills}/ai-core-commands/SKILL.md +9 -9
- package/{core/skills → skills}/brainstorming/SKILL.md +1 -1
- package/{core/skills → skills}/development-implement-task/SKILL.md +7 -7
- package/{core/skills → skills}/meta-generate-views/SKILL.md +8 -8
- package/{core/skills → skills}/meta-request-log/SKILL.md +4 -4
- package/{core/skills → skills}/meta-sprint-report/SKILL.md +2 -2
- package/{core/skills → skills}/meta-sync-platforms/SKILL.md +5 -5
- package/{core/skills → skills}/meta-ticket-health/SKILL.md +1 -1
- package/{core/skills → skills}/meta-validate-audit-log/SKILL.md +2 -2
- package/{core/skills → skills}/meta-validate-docs/SKILL.md +1 -1
- package/{core/skills → skills}/meta-validate-permissions/SKILL.md +2 -2
- package/{core/skills → skills}/meta-validate-state/SKILL.md +4 -4
- package/{core/skills → skills}/planning-analyze-requirements/SKILL.md +10 -10
- package/{core/skills → skills}/planning-backlog-status/SKILL.md +6 -6
- package/{core/skills → skills}/planning-groom-ticket/SKILL.md +4 -4
- package/{core/skills → skills}/planning-mark-ready/SKILL.md +3 -3
- package/{core/skills → skills}/planning-plan-refactor/SKILL.md +6 -6
- package/{core/skills → skills}/planning-plan-sprint/SKILL.md +4 -4
- package/{core/skills → skills}/planning-prioritize-backlog/SKILL.md +2 -2
- package/{core/skills → skills}/planning-write-plan/SKILL.md +1 -1
- package/{core/skills → skills}/project-detect-stack/SKILL.md +1 -1
- package/{core/skills → skills}/project-discover-codebase/SKILL.md +2 -2
- package/skills/project-setup-project/SKILL.md +113 -0
- package/{core/skills → skills}/qa-bug-status/SKILL.md +1 -1
- package/{core/skills → skills}/qa-report-bug/SKILL.md +8 -8
- package/{core/skills → skills}/qa-smoke-test/SKILL.md +3 -3
- package/{core/skills → skills}/qa-verify-fix/SKILL.md +3 -3
- package/{core/skills → skills}/release-hotfix/SKILL.md +2 -2
- package/{core/skills → skills}/release-release/SKILL.md +2 -2
- package/{core/skills → skills}/release-rollback/SKILL.md +1 -1
- package/{core/skills → skills}/review-create-pr/SKILL.md +2 -2
- package/{core/skills → skills}/review-merge-pr/SKILL.md +1 -1
- package/{core/skills → skills}/using-ai-core/SKILL.md +7 -7
- package/{core/skills → skills}/verification-before-done/SKILL.md +1 -1
- package/{core/templates → templates}/ci/ai-core-governance.yml +29 -19
- package/{core/templates → templates}/pr/pull-request-template.md +1 -1
- package/{core/templates → templates}/project/CODEOWNERS +8 -3
- package/templates/project/docs-policy.json +3 -0
- package/templates/project/project-structure.yaml +76 -0
- package/{core/templates → templates}/qa/bug-report-template.md +1 -1
- package/{core/templates → templates}/requirements/user-story-template.md +1 -1
- package/{core/workflows → workflows}/bug-lifecycle.md +3 -3
- package/{core/workflows → workflows}/feature-lifecycle.md +2 -2
- package/{core/workflows → workflows}/sprint-lifecycle.md +2 -2
- package/core/README.md +0 -162
- package/core/skills/project-setup-project/SKILL.md +0 -113
- package/core/templates/project/docs-policy.json +0 -3
- package/core/templates/project/project-structure.yaml +0 -76
- /package/{core/agents → agents}/README.md +0 -0
- /package/{core → docs}/config/docs-policy.default.json +0 -0
- /package/{core/rules → rules}/01-git-workflow.md +0 -0
- /package/{core/rules → rules}/03-security.md +0 -0
- /package/{core/rules → rules}/07-definition-of-ready.md +0 -0
- /package/{core/skills → skills}/README.md +0 -0
- /package/{core/skills → skills}/executing-ticket/SKILL.md +0 -0
- /package/{core/skills → skills}/git-branch-status/SKILL.md +0 -0
- /package/{core/skills → skills}/git-cleanup-branches/SKILL.md +0 -0
- /package/{core/skills → skills}/git-scan-untracked/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-document-existing-requirements/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-estimate-task/SKILL.md +0 -0
- /package/{core/skills → skills}/qa-triage-bug/SKILL.md +0 -0
- /package/{core/skills → skills}/review-techlead-review/SKILL.md +0 -0
- /package/{core/skills → skills}/writing-implementation-plan/SKILL.md +0 -0
- /package/{core/templates → templates}/ci/node-pnpm.yml +0 -0
- /package/{core/templates → templates}/pm/retrospective-template.md +0 -0
- /package/{core/templates → templates}/pm/sprint-plan-template.md +0 -0
- /package/{core/templates → templates}/project/project-config.yaml +0 -0
- /package/{core/templates → templates}/qa/test-plan-template.md +0 -0
- /package/{core/templates → templates}/release/release-record-template.json +0 -0
- /package/{core/templates → templates}/requirements/PRD-template.md +0 -0
- /package/{core/templates → templates}/technical/ADR-template.md +0 -0
- /package/{core/templates → templates}/technical/refactor-plan-template.md +0 -0
- /package/{core/templates → templates}/technical/tech-design-template.md +0 -0
- /package/{core/workflows → workflows}/hotfix-lifecycle.md +0 -0
package/README.md
CHANGED
|
@@ -8,14 +8,14 @@ npx ai-core-framework
|
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
Run the command from the root of the project that should receive AI Core. The
|
|
11
|
-
installer asks which AI CLI to target. Version 0.1 supports Codex and copies
|
|
12
|
-
|
|
11
|
+
installer asks which AI CLI to target. Version 0.1 supports Codex and copies this
|
|
12
|
+
repo's root-level framework folders directly into the target project's
|
|
13
13
|
`.codex/` directory:
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
16
|
.codex/
|
|
17
17
|
agents/
|
|
18
|
-
config/
|
|
18
|
+
docs/config/
|
|
19
19
|
rules/
|
|
20
20
|
scripts/
|
|
21
21
|
skills/
|
|
@@ -131,24 +131,24 @@ The framework now includes mechanical gates beyond prompt-level rules:
|
|
|
131
131
|
|
|
132
132
|
- `scripts/validate-state.sh` validates ticket state transitions, backlog rank integrity, dependency ordering, blocked-ticket unblock evidence, DONE-ticket DoD fields, QA evidence, and release governance records.
|
|
133
133
|
- `scripts/validate-docs.sh` validates documentation obligations from diffs and ticket metadata, including API docs, README/setup docs, migration runbooks, ADRs, changelog/release notes, and DONE-ticket documentation evidence.
|
|
134
|
-
- `scripts/validate-permissions.sh` validates state-history command execution against `
|
|
135
|
-
- `
|
|
136
|
-
- `
|
|
137
|
-
- `
|
|
138
|
-
- `
|
|
134
|
+
- `scripts/validate-permissions.sh` validates state-history command execution against `commands/**` role metadata and blocks obvious self-approval.
|
|
135
|
+
- `scripts/` is the canonical portable script source.
|
|
136
|
+
- `scripts/ai-core.sh` is a lightweight command runner that checks command role metadata before dispatching executable handlers.
|
|
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
|
+
- `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
|
-
- `
|
|
141
|
-
- `
|
|
142
|
-
- `/request-log` shows recent entries from `project/user-requests.jsonl`.
|
|
143
|
-
- `
|
|
144
|
-
- `CODEOWNERS` adds review ownership defaults for
|
|
145
|
-
- `config/docs-policy.json` can override documentation detection paths from `
|
|
146
|
-
- `.github/workflows/ai-core-governance.yml` is the portable governance workflow. App CI remains stack-specific and can be replaced with templates from `
|
|
147
|
-
- `scripts/setup-project.sh`
|
|
140
|
+
- `scripts/validate-audit-log.sh` validates the hash chain in `docs/runtime/project/audit-log.jsonl`; executable workflow handlers append audit records.
|
|
141
|
+
- `scripts/log-user-request.sh` appends every AI-handled user request to `docs/runtime/project/user-requests.jsonl` so the user can review what they asked for.
|
|
142
|
+
- `/request-log` shows recent entries from `docs/runtime/project/user-requests.jsonl`.
|
|
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/project/`, ADRs, runbooks, and workflows.
|
|
145
|
+
- `docs/config/docs-policy.json` can override documentation detection paths from `docs/config/docs-policy.default.json`.
|
|
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
|
+
- `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
|
-
- `
|
|
151
|
-
- `scripts/generate-views.sh` now produces dashboard and release readiness views in `project/views/`.
|
|
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/project/views/`.
|
|
152
152
|
|
|
153
153
|
Chat-first setup flow:
|
|
154
154
|
|
|
@@ -168,6 +168,6 @@ guide /analyze-requirements "User can reset password"
|
|
|
168
168
|
next TICKET-001
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
The normal interface is the AI chat window. The AI should infer the correct role from command metadata (`owner_agent` / `requires_agents`) and may use `
|
|
171
|
+
The normal interface is the AI chat window. The AI should infer the correct role from command metadata (`owner_agent` / `requires_agents`) and may use `scripts/ai-core.sh` internally for deterministic execution and validation. Users should not need to type `bash ...` or `AI_AGENT=...`.
|
|
172
172
|
|
|
173
173
|
`guide` runs one step, reports the completed command, ticket state before/after, updated `project` files, validation results, and the suggested next chat command. It asks before continuing and does not auto-run steps that still need placeholders such as `<story_points>` or `<pr_url>`.
|
|
@@ -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
|
-
- "project/**"
|
|
23
|
+
- "docs/runtime/project/**"
|
|
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
|
-
- "project/tickets/**"
|
|
31
|
-
- "project/backlog/**"
|
|
32
|
-
- "project/views/**"
|
|
33
|
-
- "project/sprints/**"
|
|
30
|
+
- "docs/runtime/project/tickets/**"
|
|
31
|
+
- "docs/runtime/project/backlog/**"
|
|
32
|
+
- "docs/runtime/project/views/**"
|
|
33
|
+
- "docs/runtime/project/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 `project/tickets/TICKET-XXX.json`.
|
|
66
|
+
5. **Create tickets** in `docs/runtime/project/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.
|
|
@@ -94,7 +94,7 @@ Every User Story **MUST** pass INVEST. If it does not, you **MUST** split it int
|
|
|
94
94
|
A ticket **MUST NOT** transition to `READY` unless it has ≥3 AC scenarios.
|
|
95
95
|
|
|
96
96
|
### RULE BA-004: Template enforcement
|
|
97
|
-
You **MUST** use `
|
|
97
|
+
You **MUST** use `templates/requirements/user-story-template.md`. Freestyle formats are **FORBIDDEN**.
|
|
98
98
|
|
|
99
99
|
### RULE BA-005: Bug severity required
|
|
100
100
|
If the input is a **bug report**, you **MUST** determine severity:
|
|
@@ -32,7 +32,7 @@ write_access:
|
|
|
32
32
|
- "app/**"
|
|
33
33
|
- "docs/project/api/**"
|
|
34
34
|
- "CHANGELOG.md"
|
|
35
|
-
- "project/tickets/**"
|
|
35
|
+
- "docs/runtime/project/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 `project/dev-learnings.md`.
|
|
253
|
+
- Track feedback patterns in `docs/runtime/project/dev-learnings.md`.
|
|
254
254
|
|
|
255
255
|
### With QA
|
|
256
256
|
- Provide clear "how to test" notes in PR.
|
|
@@ -27,9 +27,9 @@ write_access:
|
|
|
27
27
|
- "docs/runtime/qa/**"
|
|
28
28
|
- "docs/runtime/test-runs/**"
|
|
29
29
|
- "docs/runtime/verifications/**"
|
|
30
|
-
- "project/tickets/**"
|
|
31
|
-
- "project/bugs/**"
|
|
32
|
-
- "project/test-runs/**"
|
|
30
|
+
- "docs/runtime/project/tickets/**"
|
|
31
|
+
- "docs/runtime/project/bugs/**"
|
|
32
|
+
- "docs/runtime/project/test-runs/**"
|
|
33
33
|
escalates_to: tech-lead
|
|
34
34
|
collaborates_with:
|
|
35
35
|
- developer
|
|
@@ -17,14 +17,18 @@ can_invoke_commands:
|
|
|
17
17
|
- /generate-views
|
|
18
18
|
- /ticket-health
|
|
19
19
|
write_access:
|
|
20
|
-
- "project/sprints/**"
|
|
21
|
-
- "project/releases/**"
|
|
22
|
-
- "project/metrics/**"
|
|
23
|
-
- "project/views/**"
|
|
24
|
-
- "config/project-config.yaml"
|
|
25
|
-
- "config/project-structure.yaml"
|
|
20
|
+
- "docs/runtime/project/sprints/**"
|
|
21
|
+
- "docs/runtime/project/releases/**"
|
|
22
|
+
- "docs/runtime/project/metrics/**"
|
|
23
|
+
- "docs/runtime/project/views/**"
|
|
24
|
+
- "docs/config/project-config.yaml"
|
|
25
|
+
- "docs/config/project-structure.yaml"
|
|
26
26
|
read_access:
|
|
27
|
-
- "
|
|
27
|
+
- "agents/**"
|
|
28
|
+
- "rules/**"
|
|
29
|
+
- "skills/**"
|
|
30
|
+
- "templates/**"
|
|
31
|
+
- "workflows/**"
|
|
28
32
|
- "docs/**"
|
|
29
33
|
forbidden:
|
|
30
34
|
- "Make technical architecture decisions"
|
|
@@ -67,16 +71,16 @@ The Scrum Master MUST NOT:
|
|
|
67
71
|
## 🔒 Hard Rules
|
|
68
72
|
|
|
69
73
|
### RULE SM-001: State machine integrity
|
|
70
|
-
Every ticket transition MUST follow `
|
|
74
|
+
Every ticket transition MUST follow `rules/06-approval-gates.md`. The Scrum Master MUST run `/validate-state` before sprint start and before release.
|
|
71
75
|
|
|
72
76
|
### RULE SM-002: DoR gate ownership
|
|
73
|
-
Only the Scrum Master may execute `/mark-ready`. It MUST verify every item in `
|
|
77
|
+
Only the Scrum Master may execute `/mark-ready`. It MUST verify every item in `rules/07-definition-of-ready.md`.
|
|
74
78
|
|
|
75
79
|
### RULE SM-003: Capacity is a hard constraint
|
|
76
80
|
A sprint MUST NOT be planned above configured capacity unless the overflow is explicitly documented as risk and approved by a human.
|
|
77
81
|
|
|
78
82
|
### RULE SM-004: No hidden work
|
|
79
|
-
Any work performed in a sprint MUST be represented by a ticket or bug in `project/`.
|
|
83
|
+
Any work performed in a sprint MUST be represented by a ticket or bug in `docs/runtime/project/`.
|
|
80
84
|
|
|
81
85
|
### RULE SM-005: Blockers are first-class
|
|
82
86
|
Any ticket blocked longer than the soft threshold in approval gates MUST be surfaced in sprint reports.
|
|
@@ -91,14 +95,14 @@ The Scrum Master coordinates, but does not replace BA, Tech Lead, Developer, or
|
|
|
91
95
|
Velocity, burndown, carryover, defect counts, and cycle time MUST be computed from state files or explicitly labeled as estimates.
|
|
92
96
|
|
|
93
97
|
### RULE SM-009: Ceremony outputs are persisted
|
|
94
|
-
Sprint planning, review, retro, and release summaries MUST be written to `project/sprints/`, `project/releases/`, or `project/metrics/`.
|
|
98
|
+
Sprint planning, review, retro, and release summaries MUST be written to `docs/runtime/project/sprints/`, `docs/runtime/project/releases/`, or `docs/runtime/project/metrics/`.
|
|
95
99
|
|
|
96
100
|
### RULE SM-010: Escalate ambiguity
|
|
97
101
|
If command preconditions are unclear, STOP and escalate instead of guessing.
|
|
98
102
|
|
|
99
103
|
## 🔄 Standard Operating Flow
|
|
100
104
|
|
|
101
|
-
1. Load `config/project-config.yaml`.
|
|
105
|
+
1. Load `docs/config/project-config.yaml`.
|
|
102
106
|
2. Validate state with `/validate-state`.
|
|
103
107
|
3. Inspect tickets, bugs, active sprint, and release state.
|
|
104
108
|
4. Identify the current ceremony or workflow.
|
|
@@ -29,9 +29,9 @@ write_access:
|
|
|
29
29
|
- "docs/runtime/technical/**"
|
|
30
30
|
- "docs/architecture/**"
|
|
31
31
|
- "docs/runtime/refactor/**"
|
|
32
|
-
- "project/tickets/**"
|
|
33
|
-
- "project/backlog/**"
|
|
34
|
-
- "project/prs/**"
|
|
32
|
+
- "docs/runtime/project/tickets/**"
|
|
33
|
+
- "docs/runtime/project/backlog/**"
|
|
34
|
+
- "docs/runtime/project/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 `project/tickets/TICKET-042.json`
|
|
182
|
+
- Ticket JSON from `docs/runtime/project/tickets/TICKET-042.json`
|
|
183
183
|
- Full AC
|
|
184
184
|
- Related code, if referenced by the ticket
|
|
185
185
|
|
package/bin/ai-core-framework.js
CHANGED
|
@@ -8,7 +8,7 @@ const { stdin, stdout } = require('node:process');
|
|
|
8
8
|
const { installCodex } = require('../lib/install-codex');
|
|
9
9
|
|
|
10
10
|
const packageRoot = path.resolve(__dirname, '..');
|
|
11
|
-
const
|
|
11
|
+
const sourceFrameworkDir = packageRoot;
|
|
12
12
|
|
|
13
13
|
function normalizeAnswer(answer) {
|
|
14
14
|
return answer.trim().toLowerCase();
|
|
@@ -54,8 +54,8 @@ async function main() {
|
|
|
54
54
|
const rl = createPrompter();
|
|
55
55
|
|
|
56
56
|
try {
|
|
57
|
-
if (!fs.existsSync(
|
|
58
|
-
throw new Error(`Package is missing
|
|
57
|
+
if (!fs.existsSync(path.join(sourceFrameworkDir, 'skills'))) {
|
|
58
|
+
throw new Error(`Package is missing framework assets: ${sourceFrameworkDir}`);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const selectedCli = await chooseCli(rl);
|
|
@@ -71,7 +71,7 @@ async function main() {
|
|
|
71
71
|
|
|
72
72
|
const result = await installCodex({
|
|
73
73
|
targetDir,
|
|
74
|
-
|
|
74
|
+
sourceFrameworkDir,
|
|
75
75
|
confirm: (question) => askConflict(rl, question),
|
|
76
76
|
});
|
|
77
77
|
|
|
@@ -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 project/backlog/backlog.json",
|
|
4
|
+
"description": "Project-specific backlog ordering and prioritization schema for docs/runtime/project/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 project/releases/",
|
|
4
|
+
"description": "Schema for release records in docs/runtime/project/releases/",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"required": [
|
|
7
7
|
"version",
|
package/hooks/hooks.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
|
+
SKILL_FILE="${PLUGIN_ROOT}/skills/using-ai-core/SKILL.md"
|
|
7
|
+
|
|
8
|
+
if [ ! -f "$SKILL_FILE" ]; then
|
|
9
|
+
context="AI Core is installed, but skills/using-ai-core/SKILL.md was not found. Ask the user to run /setup-project or verify plugin installation."
|
|
10
|
+
else
|
|
11
|
+
content=$(sed 's/\\/\\\\/g; s/"/\\"/g; s/$/\\n/' "$SKILL_FILE" | tr -d '\n')
|
|
12
|
+
context="<AI_CORE_BOOTSTRAP>\\nYou are using AI Core. Read and follow this bootstrap skill before workflow work:\\n\\n${content}</AI_CORE_BOOTSTRAP>"
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
|
|
16
|
+
printf '{\n "additional_context": "%s"\n}\n' "$context"
|
|
17
|
+
elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
|
|
18
|
+
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$context"
|
|
19
|
+
else
|
|
20
|
+
printf '{\n "additionalContext": "%s"\n}\n' "$context"
|
|
21
|
+
fi
|
package/lib/install-codex.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
const fs = require('node:fs');
|
|
2
2
|
const path = require('node:path');
|
|
3
3
|
|
|
4
|
+
const FRAMEWORK_ENTRIES = [
|
|
5
|
+
'agents',
|
|
6
|
+
'docs',
|
|
7
|
+
'hooks',
|
|
8
|
+
'rules',
|
|
9
|
+
'scripts',
|
|
10
|
+
'skills',
|
|
11
|
+
'templates',
|
|
12
|
+
'workflows',
|
|
13
|
+
'README.md',
|
|
14
|
+
];
|
|
15
|
+
|
|
4
16
|
function listFiles(rootDir) {
|
|
5
17
|
const files = [];
|
|
6
18
|
|
|
@@ -20,13 +32,33 @@ function listFiles(rootDir) {
|
|
|
20
32
|
return files;
|
|
21
33
|
}
|
|
22
34
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
function listFrameworkFiles(sourceFrameworkDir) {
|
|
36
|
+
const files = [];
|
|
37
|
+
|
|
38
|
+
for (const entry of FRAMEWORK_ENTRIES) {
|
|
39
|
+
const entryPath = path.join(sourceFrameworkDir, entry);
|
|
40
|
+
|
|
41
|
+
if (!fs.existsSync(entryPath)) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (fs.statSync(entryPath).isDirectory()) {
|
|
46
|
+
files.push(...listFiles(entryPath));
|
|
47
|
+
} else {
|
|
48
|
+
files.push(entryPath);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return files;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function installCodex({ targetDir = process.cwd(), sourceFrameworkDir, confirm }) {
|
|
56
|
+
if (!sourceFrameworkDir) {
|
|
57
|
+
throw new Error('sourceFrameworkDir is required');
|
|
26
58
|
}
|
|
27
59
|
|
|
28
|
-
if (!fs.existsSync(
|
|
29
|
-
throw new Error(`Source
|
|
60
|
+
if (!fs.existsSync(sourceFrameworkDir) || !fs.statSync(sourceFrameworkDir).isDirectory()) {
|
|
61
|
+
throw new Error(`Source framework directory not found: ${sourceFrameworkDir}`);
|
|
30
62
|
}
|
|
31
63
|
|
|
32
64
|
const targetCodexDir = path.join(targetDir, '.codex');
|
|
@@ -39,8 +71,8 @@ async function installCodex({ targetDir = process.cwd(), sourceCoreDir, confirm
|
|
|
39
71
|
|
|
40
72
|
fs.mkdirSync(targetCodexDir, { recursive: true });
|
|
41
73
|
|
|
42
|
-
for (const sourceFile of
|
|
43
|
-
const relativePath = path.relative(
|
|
74
|
+
for (const sourceFile of listFrameworkFiles(sourceFrameworkDir)) {
|
|
75
|
+
const relativePath = path.relative(sourceFrameworkDir, sourceFile);
|
|
44
76
|
const targetFile = path.join(targetCodexDir, relativePath);
|
|
45
77
|
let shouldCopy = true;
|
|
46
78
|
let overwriting = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-core-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Chat-first enterprise AI SDLC framework installer for AI coding CLIs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -19,8 +19,15 @@
|
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"bin/",
|
|
22
|
-
"
|
|
22
|
+
"agents/",
|
|
23
|
+
"docs/config/",
|
|
24
|
+
"hooks/",
|
|
23
25
|
"lib/",
|
|
26
|
+
"rules/",
|
|
27
|
+
"scripts/",
|
|
28
|
+
"skills/",
|
|
29
|
+
"templates/",
|
|
30
|
+
"workflows/",
|
|
24
31
|
"README.md",
|
|
25
32
|
".codex-plugin/",
|
|
26
33
|
".claude-plugin/",
|
|
@@ -29,14 +29,14 @@ 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 `project/tickets/` with:
|
|
32
|
+
**MUST NOT** write or modify production code (files in `src/`, `lib/`, `app/`) unless there is an active ticket in `docs/runtime/project/tickets/` with:
|
|
33
33
|
- `status` ∈ `[IN_PROGRESS]`
|
|
34
34
|
- `assignee` = current agent
|
|
35
35
|
|
|
36
36
|
**Allowed exceptions**:
|
|
37
37
|
- Fix typos in comments
|
|
38
38
|
- Fix formatting or lint issues, with a separate commit: `style(chore): ...`
|
|
39
|
-
- Update files in
|
|
39
|
+
- Update files in root-level framework folders, which are the meta-framework
|
|
40
40
|
|
|
41
41
|
**If the user requests code without a ticket:**
|
|
42
42
|
```
|
|
@@ -52,22 +52,22 @@ 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 | `project/backlog/backlog.json` |
|
|
56
|
-
| Ticket details and state history | `project/tickets/TICKET-XXX.json` |
|
|
57
|
-
| Sprint info | `project/sprints/SPRINT-XXX.json` |
|
|
58
|
-
| Bug details | `project/bugs/BUG-XXX.json` |
|
|
59
|
-
| Release records | `project/releases/vX.Y.Z.json` |
|
|
60
|
-
| User request log | `project/user-requests.jsonl` |
|
|
61
|
-
| Project config | `config/project-config.yaml` |
|
|
62
|
-
| Project structure map | `config/project-structure.yaml` |
|
|
55
|
+
| Backlog order and prioritization | `docs/runtime/project/backlog/backlog.json` |
|
|
56
|
+
| Ticket details and state history | `docs/runtime/project/tickets/TICKET-XXX.json` |
|
|
57
|
+
| Sprint info | `docs/runtime/project/sprints/SPRINT-XXX.json` |
|
|
58
|
+
| Bug details | `docs/runtime/project/bugs/BUG-XXX.json` |
|
|
59
|
+
| Release records | `docs/runtime/project/releases/vX.Y.Z.json` |
|
|
60
|
+
| User request log | `docs/runtime/project/user-requests.jsonl` |
|
|
61
|
+
| Project config | `docs/config/project-config.yaml` |
|
|
62
|
+
| Project structure map | `docs/config/project-structure.yaml` |
|
|
63
63
|
| Refactor plans | `docs/runtime/refactor/<name>-refactor-plan.md` |
|
|
64
64
|
| Architecture decisions | `docs/runtime/adr/NNN-title.md` |
|
|
65
|
-
| Agent capabilities | `
|
|
66
|
-
| Coverage threshold | `config/project-config.yaml` → `quality.coverage_threshold` |
|
|
65
|
+
| Agent capabilities | `agents/<agent>.md` (frontmatter) |
|
|
66
|
+
| Coverage threshold | `docs/config/project-config.yaml` → `quality.coverage_threshold` |
|
|
67
67
|
|
|
68
68
|
If information is needed in multiple places, **reference** the canonical location. **MUST NOT** copy it.
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
Root-level framework folders are framework-only. Project-specific state and configuration MUST live in `docs/runtime/project/`, `docs/config/`, `docs/project/`, or `docs/runtime/`.
|
|
71
71
|
|
|
72
72
|
---
|
|
73
73
|
|
|
@@ -97,7 +97,7 @@ User workflow interaction happens in the AI chat window.
|
|
|
97
97
|
|
|
98
98
|
When user types `/command ...`, `guide /command ...`, or `next TICKET-XXX`, AI **MUST** treat it as an AI Core workflow request, infer the right agent from command metadata, execute any internal scripts itself when needed, and report the result back in chat.
|
|
99
99
|
|
|
100
|
-
AI **MUST NOT** require the user to type shell wrappers such as `bash
|
|
100
|
+
AI **MUST NOT** require the user to type shell wrappers such as `bash scripts/ai-core.sh` or environment variables such as `AI_AGENT=...` for normal workflow usage. Those are internal implementation details for AI tooling and CI.
|
|
101
101
|
|
|
102
102
|
### G-004b: Always output the execution plan
|
|
103
103
|
Before executing a complex command, the AI **MUST** output a short plan:
|
|
@@ -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 `project/user-requests.jsonl` before doing substantive work.
|
|
136
|
+
At the start of handling every user request, the AI **MUST** append a record to `docs/runtime/project/user-requests.jsonl` before doing substantive work.
|
|
137
137
|
|
|
138
138
|
The log record **MUST** include:
|
|
139
139
|
- Timestamp
|
|
@@ -141,11 +141,11 @@ The log record **MUST** include:
|
|
|
141
141
|
- User request text, sanitized for secrets
|
|
142
142
|
- Detected slash command, if any
|
|
143
143
|
- Detected ticket ID, if any
|
|
144
|
-
- Hash chain fields when using `
|
|
144
|
+
- Hash chain fields when using `scripts/log-user-request.sh`
|
|
145
145
|
|
|
146
146
|
The AI **MUST** use:
|
|
147
147
|
```bash
|
|
148
|
-
bash
|
|
148
|
+
bash scripts/log-user-request.sh "<user request text>"
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
If the script is unavailable, the AI **MUST** still write an equivalent JSONL record manually. If the request contains secrets, credentials, tokens, passwords, customer PII, or payment data, the AI **MUST** redact those values before logging.
|
|
@@ -195,7 +195,7 @@ Required target ratio:
|
|
|
195
195
|
### G-006c: Test coverage threshold
|
|
196
196
|
- **Diff coverage** (new code in the PR): ≥ 80%
|
|
197
197
|
- **Overall coverage**: ≥ 70%
|
|
198
|
-
- Configured in `config/project-config.yaml`
|
|
198
|
+
- Configured in `docs/config/project-config.yaml`
|
|
199
199
|
|
|
200
200
|
---
|
|
201
201
|
|
|
@@ -14,7 +14,7 @@ Code must be understandable, maintainable, testable, and safe to evolve. Passing
|
|
|
14
14
|
Functions SHOULD be under 50 lines and files SHOULD be under 500 lines. If exceeded, document why or refactor.
|
|
15
15
|
|
|
16
16
|
### RULE CQ-002: Complexity limit
|
|
17
|
-
Cyclomatic complexity MUST NOT exceed the configured threshold in `config/project-config.yaml`, default 10.
|
|
17
|
+
Cyclomatic complexity MUST NOT exceed the configured threshold in `docs/config/project-config.yaml`, default 10.
|
|
18
18
|
|
|
19
19
|
### RULE CQ-003: Clear naming
|
|
20
20
|
Names MUST describe intent. Avoid vague names such as `data`, `thing`, `stuff`, `tmp`, except for narrow local use.
|
|
@@ -54,7 +54,7 @@ Known misleading docs for changed behavior MUST be fixed before release.
|
|
|
54
54
|
## 🛠️ Enforcement
|
|
55
55
|
|
|
56
56
|
- Developer checklist in `/implement-task`.
|
|
57
|
-
- PR template in `
|
|
57
|
+
- PR template in `templates/pr/`.
|
|
58
58
|
- Tech Lead review.
|
|
59
59
|
- Release checklist in `/release`.
|
|
60
60
|
- `bash scripts/validate-docs.sh` blocks missing documentation evidence in CI and pre-commit.
|
|
@@ -49,7 +49,7 @@ Mandatory workflow for every new feature/fix:
|
|
|
49
49
|
|
|
50
50
|
### RULE TEST-002: Coverage thresholds
|
|
51
51
|
|
|
52
|
-
Configured in `config/project-config.yaml`:
|
|
52
|
+
Configured in `docs/config/project-config.yaml`:
|
|
53
53
|
|
|
54
54
|
| Metric | Threshold |
|
|
55
55
|
|--------|-----------|
|
|
@@ -201,7 +201,7 @@ Endpoints on critical user flow **MUST** have performance tests:
|
|
|
201
201
|
- **p95**: < 500ms
|
|
202
202
|
- **p99**: < 1000ms
|
|
203
203
|
|
|
204
|
-
Thresholds are customizable in `config/project-config.yaml`.
|
|
204
|
+
Thresholds are customizable in `docs/config/project-config.yaml`.
|
|
205
205
|
|
|
206
206
|
CI runs perf tests on main branch, alerts if regression > 20%.
|
|
207
207
|
|
|
@@ -221,7 +221,7 @@ Every ticket **MUST** have complete `state_history` array:
|
|
|
221
221
|
}
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
Schema validates this structure (see `config/ticket.schema.json`).
|
|
224
|
+
Schema validates this structure (see `docs/config/ticket.schema.json`).
|
|
225
225
|
|
|
226
226
|
### RULE AG-009: Audit trail preserved
|
|
227
227
|
|
|
@@ -332,7 +332,7 @@ Definition of Done checklist (see rules/08-definition-of-done.md):
|
|
|
332
332
|
Each agent's rules file references this doc. Agents refuse to bypass.
|
|
333
333
|
|
|
334
334
|
### Layer 2: JSON schema (medium)
|
|
335
|
-
`config/ticket.schema.json` requires:
|
|
335
|
+
`docs/config/ticket.schema.json` requires:
|
|
336
336
|
- Valid state value
|
|
337
337
|
- state_history array with required fields
|
|
338
338
|
|
|
@@ -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 `project/tickets/`
|
|
80
|
+
- [ ] Ticket state updated in `docs/runtime/project/tickets/`
|
|
81
81
|
- [ ] `completed_at` timestamp set
|
|
82
82
|
- [ ] PR URL linked
|
|
83
83
|
- [ ] Release version tagged after release
|