gcf-aif-ext 0.3.0 → 0.4.1

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 (51) hide show
  1. package/README.md +63 -11
  2. package/commands/gcf.js +321 -43
  3. package/extension.json +22 -5
  4. package/hooks/pre-commit.js +60 -31
  5. package/injections/commit-status.md +7 -5
  6. package/injections/plan-context.md +8 -5
  7. package/injections/review-pillars.md +4 -3
  8. package/lib/agents-block.js +66 -0
  9. package/lib/anchors.js +27 -4
  10. package/lib/audit-core.js +135 -48
  11. package/lib/bundle.js +7 -4
  12. package/lib/context.js +33 -25
  13. package/lib/design-check.js +149 -40
  14. package/lib/design.js +2 -2
  15. package/lib/gcf-paths.js +13 -2
  16. package/lib/id.js +2 -2
  17. package/lib/inbox.js +54 -0
  18. package/lib/index-gen.js +23 -8
  19. package/lib/ledger.js +19 -17
  20. package/lib/linter.js +2 -1
  21. package/lib/live.js +191 -0
  22. package/lib/pillars.js +113 -0
  23. package/lib/plan-check.js +31 -0
  24. package/lib/playtest-list.js +8 -4
  25. package/lib/systems-doc.js +16 -1
  26. package/lib/transitions.js +36 -21
  27. package/lib/unit-ops.js +125 -97
  28. package/lib/validate-item.js +244 -0
  29. package/lib/verdict-fs.js +67 -128
  30. package/lib/work-ops.js +759 -0
  31. package/package.json +4 -3
  32. package/profiles/pillars.md +1 -1
  33. package/profiles/system.md +1 -1
  34. package/profiles/unit-constraint.md +10 -0
  35. package/profiles/unit-entity.md +10 -0
  36. package/profiles/unit-mechanic.md +6 -1
  37. package/profiles/unit-resource.md +6 -1
  38. package/profiles/unit-rule.md +10 -0
  39. package/schemas/item.schema.json +105 -0
  40. package/skills/gcf-adopt/SKILL.md +2 -2
  41. package/skills/gcf-audit/SKILL.md +3 -3
  42. package/skills/gcf-card/SKILL.md +27 -20
  43. package/skills/gcf-ingest/SKILL.md +3 -3
  44. package/skills/gcf-init/SKILL.md +8 -5
  45. package/skills/gcf-triage/SKILL.md +35 -0
  46. package/skills/gcf-verdict/SKILL.md +19 -16
  47. package/templates/agents-block.md +28 -0
  48. package/templates/config.yml +7 -0
  49. package/templates/{card.md → item.md} +10 -3
  50. package/lib/validate-card.js +0 -93
  51. package/schemas/card.schema.json +0 -46
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcf-aif-ext",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Game Context Framework for AI Factory",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,8 +24,9 @@
24
24
  "node": ">=22.14"
25
25
  },
26
26
  "scripts": {
27
- "test": "node --test",
28
- "prepack": "node -e \"const p=require('./package.json'),e=require('./extension.json');if(p.version!==e.version)throw new Error('version mismatch: package.json '+p.version+' vs extension.json '+e.version)\""
27
+ "test": "node --test && npm run test:gate",
28
+ "prepack": "node -e \"const p=require('./package.json'),e=require('./extension.json');if(p.version!==e.version)throw new Error('version mismatch: package.json '+p.version+' vs extension.json '+e.version)\"",
29
+ "test:gate": "node -e \"process.env.GCF_TEST_GATE='1';require('node:child_process').execFileSync(process.execPath,['--test'],{stdio:'inherit'})\""
29
30
  },
30
31
  "files": [
31
32
  "extension.json",
@@ -28,5 +28,5 @@ custom_sections:
28
28
  - none: a pillar that needs more than its three keys is not a pillar yet
29
29
 
30
30
  enforcement:
31
- - `npx cnlp check`, over the file a `cnlp.config.json` corpus entry maps to this profile
31
+ - `npx --yes cnlp-kit check`, over the file a `cnlp.config.json` corpus entry maps to this profile
32
32
  - `ai-factory gcf audit` checks the count and token budget
@@ -52,5 +52,5 @@ custom_sections:
52
52
  - none: a fact that fits no block above belongs to code or to a card, not here
53
53
 
54
54
  enforcement:
55
- - `npx cnlp check`, over the files a `cnlp.config.json` corpus entry maps to this profile
55
+ - `npx --yes cnlp-kit check`, over the files a `cnlp.config.json` corpus entry maps to this profile
56
56
  - the gcf P2 linter adds its own forbidden-content patterns on top in the pre-commit hook
@@ -27,6 +27,16 @@ sections:
27
27
  required: yes
28
28
  note: how the threshold is measured and on what - device, build, scene
29
29
 
30
+ - key: tuning
31
+ form: bullet-list
32
+ required: no
33
+ note: work stage only - one verdict remark per tune, read before the rebuild
34
+
35
+ - key: notes
36
+ form: bullet-list
37
+ required: no
38
+ note: work stage only - the operator's answers and delivered files, one per unblock
39
+
30
40
  - key: provenance
31
41
  form: record-list
32
42
  required: no
@@ -23,6 +23,16 @@ sections:
23
23
  record_keys: name, holds
24
24
  note: one record per field - what it holds, never its allowed values, which belong to a rule
25
25
 
26
+ - key: tuning
27
+ form: bullet-list
28
+ required: no
29
+ note: work stage only - one verdict remark per tune, read before the rebuild
30
+
31
+ - key: notes
32
+ form: bullet-list
33
+ required: no
34
+ note: work stage only - the operator's answers and delivered files, one per unblock
35
+
26
36
  - key: provenance
27
37
  form: record-list
28
38
  required: no
@@ -89,7 +89,12 @@ sections:
89
89
  - key: tuning
90
90
  form: bullet-list
91
91
  required: no
92
- note: card stage only - one verdict remark per tune, read before the rebuild
92
+ note: work stage only - one verdict remark per tune, read before the rebuild
93
+
94
+ - key: notes
95
+ form: bullet-list
96
+ required: no
97
+ note: work stage only - the operator's answers and delivered files, one per unblock
93
98
 
94
99
  - key: provenance
95
100
  form: record-list
@@ -69,7 +69,12 @@ sections:
69
69
  - key: tuning
70
70
  form: bullet-list
71
71
  required: no
72
- note: card stage only - one verdict remark per tune, read before the rebuild
72
+ note: work stage only - one verdict remark per tune, read before the rebuild
73
+
74
+ - key: notes
75
+ form: bullet-list
76
+ required: no
77
+ note: work stage only - the operator's answers and delivered files, one per unblock
73
78
 
74
79
  - key: provenance
75
80
  form: record-list
@@ -27,6 +27,16 @@ sections:
27
27
  required: yes
28
28
  note: what accepts the rule without a human playing - a test, an analyzer, a device run
29
29
 
30
+ - key: tuning
31
+ form: bullet-list
32
+ required: no
33
+ note: work stage only - one verdict remark per tune, read before the rebuild
34
+
35
+ - key: notes
36
+ form: bullet-list
37
+ required: no
38
+ note: work stage only - the operator's answers and delivered files, one per unblock
39
+
30
40
  - key: provenance
31
41
  form: record-list
32
42
  required: no
@@ -0,0 +1,105 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/VirtualMaestro/GCF/schemas/item.schema.json",
4
+ "title": "GCF work item frontmatter (schema 3)",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "id", "type", "gate", "status", "created"],
8
+ "definitions": {
9
+ "slug": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
10
+ "slugOrNull": {
11
+ "anyOf": [{ "type": "null" }, { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" }]
12
+ },
13
+ "textOrNull": {
14
+ "anyOf": [{ "type": "null" }, { "type": "string", "pattern": "\\S" }]
15
+ },
16
+ "slugList": {
17
+ "type": "array",
18
+ "items": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" }
19
+ },
20
+ "summary": { "type": "string", "pattern": "\\S", "maxLength": 250 }
21
+ },
22
+ "properties": {
23
+ "schema": { "const": 3 },
24
+ "id": { "$ref": "#/definitions/slug" },
25
+ "type": {
26
+ "enum": [
27
+ "feature",
28
+ "mechanic",
29
+ "resource",
30
+ "rule",
31
+ "constraint",
32
+ "entity",
33
+ "tech",
34
+ "bug",
35
+ "spike",
36
+ "asset",
37
+ "content",
38
+ "perf",
39
+ "release"
40
+ ]
41
+ },
42
+ "gate": { "enum": ["verdict", "auto", "decision"] },
43
+ "title": { "type": "string", "pattern": "\\S" },
44
+ "status": {
45
+ "enum": ["ready", "awaiting-verdict", "awaiting-decision", "blocked", "parked", "unplayed"]
46
+ },
47
+ "parent": { "$ref": "#/definitions/slugOrNull" },
48
+ "children": { "$ref": "#/definitions/slugList" },
49
+ "system": { "$ref": "#/definitions/slugList" },
50
+ "depends": { "$ref": "#/definitions/slugList" },
51
+ "pillars": { "$ref": "#/definitions/slugList" },
52
+ "source": { "type": "string", "pattern": "^(GDD#[A-Za-z0-9_-]+|manual)$" },
53
+ "reopens": { "$ref": "#/definitions/slugOrNull" },
54
+ "milestone": { "$ref": "#/definitions/slugOrNull" },
55
+ "parallel": { "enum": ["ok", "serial"] },
56
+ "plan": { "$ref": "#/definitions/textOrNull" },
57
+ "tune_count": { "type": "integer", "minimum": 0 },
58
+ "severity": {
59
+ "anyOf": [{ "type": "null" }, { "enum": ["critical", "high", "medium", "low"] }]
60
+ },
61
+ "blocked": { "$ref": "#/definitions/textOrNull" },
62
+ "since": {
63
+ "anyOf": [{ "type": "null" }, { "type": "string", "pattern": "^[0-9a-f]{7,64}$" }]
64
+ },
65
+ "frozen": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
66
+ "live": {
67
+ "anyOf": [
68
+ { "type": "null" },
69
+ {
70
+ "type": "object",
71
+ "additionalProperties": false,
72
+ "required": ["none"],
73
+ "properties": { "none": { "type": "string", "pattern": "\\S" } }
74
+ },
75
+ {
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "required": ["changes"],
79
+ "properties": {
80
+ "changes": {
81
+ "type": "array",
82
+ "minItems": 1,
83
+ "items": {
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "required": ["id", "change"],
87
+ "properties": {
88
+ "id": { "$ref": "#/definitions/slug" },
89
+ "change": { "enum": ["added", "modified", "removed"] },
90
+ "summary": { "$ref": "#/definitions/summary" },
91
+ "refs": { "type": "string", "pattern": "\\S" }
92
+ },
93
+ "if": { "properties": { "change": { "enum": ["added", "modified"] } } },
94
+ "then": { "required": ["summary"] }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ]
100
+ },
101
+ "model": { "$ref": "#/definitions/textOrNull" },
102
+ "effort": { "$ref": "#/definitions/textOrNull" },
103
+ "created": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
104
+ }
105
+ }
@@ -18,7 +18,7 @@ preconditions:
18
18
 
19
19
  forbidden_behaviors:
20
20
  - do not write `behavior`, `feel` or `constraints` out of reading code: a line derivable from code stays in code (П2)
21
- - do not open cards or backlog lines for what is already implemented: adoption puts nobody into work
21
+ - do not open work items or backlog lines for what is already implemented: adoption puts nobody into work
22
22
  - do not schedule a retro playtest for a mechanic that already ships
23
23
  - do not write a pillar or a subsystem name the human did not confirm: both are human authorship
24
24
  - do not read code files whole: names, paths and entry points are the whole input
@@ -33,7 +33,7 @@ workflow:
33
33
  7. fill `behavior:` and `constraints:` with 1 placeholder each, annotated `[until: manual(first verdict touching <name>)]`: the profile requires both blocks, and a `manual(...)` trigger is not an audit finding
34
34
  8. write a constraint the human states out loud into `constraints:`, and do not interview subsystem by subsystem for more: unanswered questions on adoption day are the staleness this framework exists to remove
35
35
  9. draft `PILLARS.md` by the interview in the `gcf-init` skill, steps 4..6, and do not restate that interview here
36
- 10. run `npx cnlp check`, then `ai-factory gcf lint` over each new systems doc, then `ai-factory gcf index`
36
+ 10. run `npx --yes cnlp-kit check`, then `ai-factory gcf lint` over each new systems doc, then `ai-factory gcf index`
37
37
  11. ask the human to run `ai-factory gcf hooks-install`; when it refuses over a foreign pre-commit, hand them the chain line it prints
38
38
  12. state the next step: an old design document goes through `/gcf-ingest` into `gcf/design/`, new work starts at `/gcf-card`
39
39
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gcf-audit
3
- description: Run the GCF consistency audit - stale until records, idle built cards, tune limits, P2 linter findings, plus a semantic contradiction pass. Use at session start or when the user says "аудит gcf".
3
+ description: Run the GCF consistency audit - stale until records, items waiting on the human too long, tune limits, unplayed items, P2 linter findings, plus a semantic contradiction pass. Use at session start or when the user says "аудит gcf".
4
4
  ---
5
5
 
6
6
  mode: inspection
@@ -17,8 +17,8 @@ forbidden_behaviors:
17
17
 
18
18
  workflow:
19
19
  1. run `ai-factory gcf audit --json` and read the report
20
- 2. state the first line verbatim: stale built cards block dependent work, so they lead
21
- 3. for each stale until record: name the file, the trigger that fired and the line to re-check
20
+ 2. state the first line verbatim: items waiting too long block dependent work, so they lead
21
+ 3. for each stale until record: name the file, the trigger that fired and the line to re-check; for each entry of `stale_questions`: name the question id and ask the human for the answer
22
22
  4. read the `design` summary: blocking findings first (run `ai-factory gcf design check` for the list), then the count of ready units
23
23
  5. semantic pass, only when the mechanical report is clean or the human asks: read the systems docs of ONE subsystem the human names and report pairs of lines that contradict each other as D1 questions
24
24
  6. list the pragmas: each `gcf:allow` is a standing exception, and a growing list is the linter rotting
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  name: gcf-card
3
- description: Take a design unit into work - close its TBD with the human, then move a soft unit into its card or hand a hard unit to the AIF cycle. Also parks a fresh idea as a unit. Use when work starts on a feature or the user says "заведи карточку" / "берём в работу".
3
+ description: Put work into gcf/work/ - take a design unit with every TBD answered, group units under a feature, or create a tech, bug, spike, asset, content, perf or release item. Also parks a fresh idea as a unit. Use when work starts or the user says "заведи карточку" / "берём в работу" / "заведи задачу".
4
4
  ---
5
5
 
6
6
  mode: authoring
7
7
 
8
8
  purpose:
9
- - take one unit of `gcf/design/` into work with every slot answered
10
- - a soft unit (mechanic, resource) becomes `gcf/cards/<id>.md` with the same body; a hard unit (rule, constraint, entity) stays in place and goes to the AIF cycle
9
+ - every piece of work in the project is one work item `gcf/work/<id>.md` with a type and a gate: who closes it - the human after play (`verdict`), a check (`auto`), the human without a build (`decision`)
10
+ - a design unit enters work with every slot answered and its section moved, not copied
11
11
 
12
12
  inputs:
13
- - an id from `gcf/backlog.md`, or a free-text idea
13
+ - an id from `gcf/backlog.md`, several ids to group under a feature, a free-text idea, or a request for non-design work
14
14
 
15
15
  preconditions:
16
- - `gcf/` exists; `gcf/INDEX.md` lists the current subsystems
16
+ - `gcf/` exists; `gcf/INDEX.md` lists the current subsystems and items
17
17
 
18
18
  forbidden_behaviors:
19
19
  - do not invent a new subsystem name when INDEX carries a synonym: reuse or ask
@@ -21,25 +21,32 @@ forbidden_behaviors:
21
21
  - do not take a unit an open D1 blocks: `ai-factory gcf design check` names the blocking question, and the human answers it first
22
22
  - do not write a digit in prose: a number is an envelope `a..b <unit>` in `feel` or a closing comparison
23
23
  - do not put `until:` in the frontmatter: it is a line annotation inside slots
24
- - do not move a section or edit the backlog by hand: `ai-factory gcf take`, `done` and `drop` own those moves
24
+ - do not move a section, edit the backlog or write `status:` by hand: `ai-factory gcf take`, `item new`, `done`, `drop` and the item moves own those
25
+ - do not reuse an id: an ended id stays ended; rework gets a new id with `reopens: <old id>`
25
26
 
26
27
  outputs:
27
28
  - each answered slot gets a provenance record `- slot: <block>` with `answer: manual`, or `answer: q-NNN` when it closes a question
28
- - a card body carries every block of its type plus `contract:` (paths and entry points) and `interactions:` (`<other id>: how the two cross`, or `- none: <why>`)
29
+ - a design-unit item body carries every block of its type plus `contract:` (paths and entry points) and `interactions:` (`<other id>: how the two cross`, or `- none: <why>`)
30
+ - every item carries a `live:` delta before it ends: what it adds, modifies or removes in `gcf/LIVE.md`, or `none: <why>`
29
31
 
30
32
  workflow:
31
- 1. for a free-text idea: ask "into work now, or park it?"; write a unit in the matching `gcf/design/<system>.md` with `source: manual` and `TBD` slots, append `- <id>` to `gcf/backlog.md`, and on "park" stop here
32
- 2. run `ai-factory gcf where <id>`: the id must be a single unit of `gcf/design/`; read its section from the file the command names
33
- 3. for a unit with `flags: impl?` ask the human first whether the mechanic already ships; on "yes" run `ai-factory gcf drop <id> --reason "already ships"` and stop
34
- 4. for a unit with `flags: src-changed` re-read each changed anchor with `ai-factory gcf section`, rebuild the slots whose quote moved, and remove the flag
35
- 5. confirm the route: ask "can an autotest accept this without a human playing?"; yes = hard, no or mixed = soft; a mixed unit splits into a soft mechanic and a hard rule before work
36
- 6. ask the human one question per `TBD` slot, each with your proposed answer, questions per message <= 2
37
- 7. write each answer into the unit in place, with its `answer:` provenance record
38
- 8. run `ai-factory gcf design check` until the unit reads `ready` and the check has no blocking finding for it, then commit the answered unit: a hard unit leaves `gcf/design/` at `done`, and its answers live in git only from this commit
39
- 9. for a soft unit: run `ai-factory gcf take <id>` - it writes `gcf/cards/<id>.md` and removes the section and the backlog line in one step
40
- 10. in the card, write `contract:` from the code tree and `interactions:` from the units and cards that write the same state, then run `ai-factory gcf design check` again
41
- 11. for a hard unit: send it to the AIF cycle (`/aif-plan` with the unit id); after the tests are green, run `ai-factory gcf done <id>`, adding `--constraint "<line>"` for a prohibition every future reader of the subsystem must remember
42
- 12. report the card path and the one question the playtest will answer, or the hard unit's plan
33
+ 1. for a free-text design idea: ask "into work now, or park it?"; write a unit in the matching `gcf/design/<system>.md` with `source: manual` and `TBD` slots, append `- <id>` to `gcf/backlog.md`, and on "park" stop here
34
+ 2. for non-design work: pick the type - tech, bug, spike, asset, content, perf, release - and propose the gate its type gives; the human may flip it (`--gate auto` is "no playtest")
35
+ 3. a bug needs `--severity` and a `repro:` the human confirms
36
+ 4. run `ai-factory gcf item new <id> --type <type> [--gate <gate>] [--parent <feature>] [--title "<line>"]`, add `--from <in-id>` when it comes from the inbox, `--blocked "file needed"` for a final asset; then write `intent:` and `live:` and stop
37
+ 5. for a design unit: run `ai-factory gcf where <id>`; the id must be a single unit of `gcf/design/`; read its section from the file the command names
38
+ 6. for a unit with `flags: impl?` ask the human first whether the mechanic already ships; on "yes" run `ai-factory gcf drop <id> --reason "already ships"` and stop
39
+ 7. for a unit with `flags: src-changed` re-read each changed anchor with `ai-factory gcf section`, rebuild the slots whose quote moved, and remove the flag
40
+ 8. confirm the route: ask "can an autotest accept this without a human playing?"; yes = hard, no or mixed = soft; a mixed unit splits into a soft mechanic and a hard rule before work
41
+ 9. ask the human one question per `TBD` slot, each with your proposed answer, questions per message <= 2
42
+ 10. for `pillars: TBD` propose the ids from `gcf/PILLARS.md` whose statement the unit serves and whose invariant it keeps
43
+ 11. when no pillar fits, ask whether the unit is out of scope or a pillar is missing, and write a D1 question for the answer
44
+ 12. write each answer into the unit in place, with its `answer:` provenance record
45
+ 13. run `ai-factory gcf design check --json` until the unit's entry in `units` reads `ready: true`, then commit the answered unit
46
+ 14. run `ai-factory gcf take <id>` for one unit, or `ai-factory gcf take <id> <id> --feature <feature-id>` to group several under a feature; it writes `gcf/work/<id>.md` and removes the sections and backlog lines in one step
47
+ 15. in each design-unit item write `contract:` from the code tree and `interactions:` from the units and items that write the same state; a soft unit whose human wants no playtest gets `gate: auto` - it will close as unplayed
48
+ 16. write the item's `live:` delta (a feature's children keep `none: parent`; the feature writes the capability), run `ai-factory gcf design check`, and commit
49
+ 17. report the item paths, each item's gate, and for a verdict item the one question the playtest will answer
43
50
 
44
51
  invocation:
45
- - run when work starts on a unit, or when a fresh idea needs a home
52
+ - run when work starts on a unit or a group of units, when non-design work needs an item, or when a fresh idea needs a home
@@ -17,7 +17,7 @@ preconditions:
17
17
  - the sequential pass below is the correctness reference; the parallel fan-out belongs to the harness
18
18
 
19
19
  forbidden_behaviors:
20
- - do not create card files: a unit stays in `gcf/design/` until `/gcf-card` takes it into work
20
+ - do not create work items: a unit stays in `gcf/design/` until `/gcf-card` takes it into work
21
21
  - do not write a pillar into PILLARS.md: pillar candidates go to open-questions as D1
22
22
  - do not fill a slot from your own reasoning: a value without a verbatim quote is `TBD`, and your draft answer goes into the `proposed:` field of a question
23
23
  - do not read `gcf/source/` files whole after anchoring: read a section with `ai-factory gcf section <file> <anchor>`
@@ -42,7 +42,7 @@ workflow:
42
42
  2. run `ai-factory gcf anchor <file>`: it prints each anchor with its line range; on a re-import read the printed delta and jump to step 17
43
43
  3. extract per aspect, one pass each, with a quote and an anchor per value: pillar candidates; subsystems (nouns); player verbs (mechanic); economy resources (resource)
44
44
  4. extract the hard aspects the same way: invariants (rule); platform and performance thresholds (constraint); data nouns (entity)
45
- 5. type each unit: a mechanic or a resource is soft and becomes a card later; a rule, a constraint or an entity is hard and leaves through tests
45
+ 5. type each unit: a mechanic or a resource is soft and waits for a verdict once in work; a rule, a constraint or an entity is hard and leaves through tests
46
46
  6. split a candidate that mixes a tunable feel with a testable rule into 2 units: a soft mechanic and a hard rule
47
47
  7. treat the GDD's own open-questions section, and any TBD or TODO, as D1 records with lens `gdd-open` and the anchor in `sections:`, and name the units each one gates in `blocks:`
48
48
  8. copy each quote verbatim from the section `ai-factory gcf section` prints; a unit with no quote at all becomes a D1 record with lens `provenance`, not a unit
@@ -55,7 +55,7 @@ workflow:
55
55
  15. record `depends:` between units from the interaction matrix: units that write the same state
56
56
  16. propose the glossary from the dictionary lens: one term per concept and its forbidden synonyms; keep the GDD's own words in unit text until the human confirms a term
57
57
  17. on a re-import run `ai-factory gcf design check`: a unit whose quote is no longer verbatim gets `flags: src-changed`, a unit whose anchor the GDD removed gets `flags: orphan`; `gcf anchor` already rewrote renamed anchors
58
- 18. on a re-import, raise a D1 for a card or a collapsed system that cites a changed anchor, and run steps 3..16 over the text no quote covers any more
58
+ 18. on a re-import, raise a D1 for a work item or a collapsed system that cites a changed anchor, and run steps 3..16 over the text no quote covers any more
59
59
  19. mark a unit whose nouns match the `purpose` or the `code` paths of an existing systems doc with `flags: impl?`: the mechanic may already ship, and the human drops it with `ai-factory gcf drop`
60
60
  20. append the new ids to `gcf/backlog.md`, run `ai-factory gcf design check`, and fix every blocking finding before you report
61
61
  21. report the package, ordered: D1 questions (the main product), pillar candidates, glossary conflicts, the design summary per subsystem, D2 assumptions; say when `impl?` was blind
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gcf-init
3
- description: Bootstrap the gcf/ documentary layer - skeleton, pillars interview, hooks reminder. Use when a game project adopts GCF or when the user says "set up gcf".
3
+ description: Bootstrap the gcf/ documentary layer - skeleton, pillars interview, hooks reminder - and revise pillars later. Use when a game project adopts GCF, when the user says "set up gcf", or "поменяем столпы" / "revise pillars".
4
4
  ---
5
5
 
6
6
  mode: bootstrap
@@ -20,14 +20,17 @@ forbidden_behaviors:
20
20
  - pillar count <= 7, and do not pad the list to reach 7
21
21
 
22
22
  workflow:
23
- 1. when `.ai-factory/DESCRIPTION.md` is absent, tell the human to run `/aif` first: `aif-plan` reads it, and a card cannot reach a plan without it
24
- 2. run `ai-factory gcf init` and report which files it created, `gcf/design/` among them; it writes no `PILLARS.md`, so no example ever reads as the game's truth
23
+ 1. when `.ai-factory/DESCRIPTION.md` is absent, tell the human to run `/aif` first: `aif-plan` reads it, and a work item cannot reach a plan without it
24
+ 2. run `ai-factory gcf init` and report which files it created, `gcf/design/` and the agent instructions in `AGENTS.md` among them; it writes no `PILLARS.md`
25
25
  3. when the human is about to import a GDD, leave `PILLARS.md` absent: the import proposes pillar candidates, and the interview runs after it
26
26
  4. otherwise ask the human for the game's core promise, then for 2..7 pillars: each needs an id (a lowercase hyphen slug the design units cite), a statement, a negative invariant and a review question
27
27
  5. write `gcf/PILLARS.md` with the confirmed pillars in the record-list form of `.ai-factory/extensions/gcf-aif-ext/templates/PILLARS.md`
28
- 6. run `npx cnlp check` and fix form issues it reports
28
+ 6. run `npx --yes cnlp-kit check` and fix form issues it reports
29
29
  7. ask the human to run `ai-factory gcf hooks-install`: the commit gate is theirs to arm
30
30
  8. state the next step: import a GDD with `/gcf-ingest`, or start the design with `/gcf-vision` when there is none
31
+ 9. to add one pillar later, ask only for its id, statement, invariant and review question; append it as one record to `gcf/PILLARS.md`, keep the others, keep the count <= 7, then run step 6
32
+ 10. to rename a pillar, run `ai-factory gcf pillar rename <from> <to>`: every unit and item citing it follows
33
+ 11. to drop a pillar, run `ai-factory gcf pillar retire <id> --reason "<why>"`; a unit it leaves at `pillars: TBD` goes back through the pillars steps of the gcf-card skill
31
34
 
32
35
  invocation:
33
- - run when the user asks to set up gcf in a project
36
+ - run when the user asks to set up gcf in a project, or to revise its pillars
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: gcf-triage
3
+ description: Triage gcf/inbox.md - playtest notes, CI failures, the agent's ideas and requests - into work items, tunes, ideas for the design, or noise, with the human approving each call. Use after a playtest session or when the user says "разбери инбокс".
4
+ ---
5
+
6
+ mode: human gate
7
+
8
+ purpose:
9
+ - turn raw input into decided work: each inbox entry becomes a work item, a tune note, a design unit, a graveyard line, or nothing - and leaves the inbox
10
+
11
+ inputs:
12
+ - `gcf/inbox.md`, read through `ai-factory gcf inbox --json`
13
+
14
+ preconditions:
15
+ - `gcf/` exists and the inbox holds entries
16
+
17
+ forbidden_behaviors:
18
+ - do not create an item or erase an entry without the human's yes: the agent proposes, the human approves
19
+ - do not turn a feel complaint into a bug: "jump feels floaty" is a tune of the item that owns the jump, a bug is behaviour that breaks a rule or a test
20
+ - do not open a second item for something `gcf/graveyard.md` already buried: name the line and ask whether the reason still holds
21
+ - do not edit `gcf/inbox.md` by hand: `ai-factory gcf item new --from` and `ai-factory gcf inbox drop` own its lines
22
+
23
+ workflow:
24
+ 1. run `ai-factory gcf inbox --json`; read `gcf/LIVE.md` and `gcf/INDEX.md` to know what exists and what is in work
25
+ 2. classify each entry: bug, tune of a live or unplayed item, idea for the design, request (an asset file, a question), duplicate, or noise; search `gcf/graveyard.md` for each idea and bug
26
+ 3. for each entry propose one call with its fields: a bug gets type `bug`, severity and a repro; a tune names the item and the note; an idea names the subsystem; a duplicate names the item it repeats
27
+ 4. present the calls to the human, calls per message <= 5, and apply only the approved ones
28
+ 5. a bug or other work: run `ai-factory gcf item new <id> --type <type> [--severity <level>] --from <in-id>`, then write its `intent:` and `repro:`
29
+ 6. a tune of an item waiting for its verdict: keep the note for the verdict session and run `ai-factory gcf inbox drop <in-id>`; the note goes in through `/gcf-verdict … tune --note`
30
+ 7. an idea for the design: write a unit with `TBD` slots in `gcf/design/<system>.md` and its backlog line, then run `ai-factory gcf inbox drop <in-id>`
31
+ 8. a duplicate or noise: run `ai-factory gcf inbox drop <in-id>`
32
+ 9. report what each entry became and how many entries remain
33
+
34
+ invocation:
35
+ - run after a playtest session, after a CI run that added entries, or when the user asks to triage
@@ -1,33 +1,36 @@
1
1
  ---
2
2
  name: gcf-verdict
3
- description: Record the human playtest verdict on a built card - keep, tune or kill - and run the collapse. Use after a playtest or when the user says "вердикт".
3
+ description: Record the human's verdict on an item waiting for play or unplayed - keep, tune or kill - or the human's decision on a decision item, a bug or a feature. Use after a playtest session or when the user says "вердикт" / "решение".
4
4
  ---
5
5
 
6
6
  mode: human gate
7
7
 
8
8
  purpose:
9
- - record the human verdict and run the one operation that collapses a card into subsystem state
9
+ - record what the human decided and run the one command that ends or returns the item
10
10
 
11
11
  inputs:
12
- - a card id and a verdict word: keep, tune or kill; or nothing, which means "print the playtest list"
12
+ - an item id and a verdict word (keep, tune, kill) or a decision word (go, no, wontfix, known, close, continue, kill); or nothing, which means "print the playtest list"
13
13
 
14
14
  preconditions:
15
- - the card sits in status `built`; the human has played the build
15
+ - a verdict: the item is `awaiting-verdict` or `unplayed`, and the human has played the build
16
+ - a decision: the item is `awaiting-decision`, or a bug in `ready`, `blocked` or `parked`, or a feature paused after a child died
16
17
 
17
18
  forbidden_behaviors:
18
- - do not decide the verdict: the human with hands on the controls decides, this skill records
19
- - do not run `keep` when the human has not answered the card's miss_criterion question
20
- - do not edit systems docs by hand: `ai-factory gcf verdict` owns the collapse
19
+ - do not decide the verdict or the decision: the human decides, this skill records
20
+ - do not run `keep` when the human has not answered the item's miss_criterion question
21
+ - do not edit systems docs, `LIVE.md`, history or graveyard by hand: the commands own them
21
22
 
22
23
  workflow:
23
- 1. with no arguments: run `ai-factory gcf playtest` and stop - that list is the session's playtest sheet
24
- 2. read the card; ask the human the miss_criterion question and record the answer in one line
25
- 3. for `tune` at tune_count 3: refuse and present the fork - kill, or redesign the envelope and reset the counter with a note
26
- 4. for `keep`: compress the card first - the collapse copies lines verbatim, 1 line per behavior record, refusal and boundary; strip `contract:` down to paths and entry points
27
- 5. for `keep`: cut `intent:` to the line the subsystem's purpose still lacks, or to `- none: <why>`
28
- 6. run `ai-factory gcf verdict <id> <verdict> --note "<answer or reason>"`; a tune note lands in the card's `tuning:` block, where the rebuild reads it
29
- 7. for `keep` on a card touching 2 or more subsystems: read each updated systems doc and report a contradiction between constraints as a D1 question instead of finishing silently
30
- 8. report the verdict commit hash: `git revert <hash>` is the undo
24
+ 1. with no arguments: run `ai-factory gcf playtest` and stop - that list, awaiting-verdict and unplayed items, is the session's playtest sheet
25
+ 2. read the item; for a verdict ask the human the miss_criterion question and record the answer in one line
26
+ 3. for `tune` at the tune limit (`tune_limit` in `gcf/config.yml`, 3 by default): the command refuses; the way out is a kill, and a redesigned envelope becomes a new item with `reopens: <id>`
27
+ 4. for `keep` of a design-unit item still awaiting its verdict: compress it first - the collapse copies lines verbatim, 1 line per behavior record, refusal and boundary
28
+ 5. for that keep: strip `contract:` down to paths and entry points and cut `intent:` to the line the subsystem's purpose still lacks; leave an unplayed item as it is - its close froze the body
29
+ 6. run `ai-factory gcf verdict <id> <verdict> --note "<answer or reason>"`; a kill creates the removal item for code already in main unless the human says `--no-remove`
30
+ 7. for a decision run `ai-factory gcf decide <id> <choice> --reason "<why>"`; `known` parks a bug and lists it in `gcf/LIVE.md` known issues
31
+ 8. for a feature whose child died, the human picks: `close` without the child, `continue` with a replacement, or `kill` with its live children
32
+ 9. for `keep` on an item touching 2 or more subsystems: read each updated systems doc and report a contradiction between constraints as a D1 question instead of finishing silently
33
+ 10. report the commit hash, `git revert <hash>` is the undo, and the id of any removal item the command made
31
34
 
32
35
  invocation:
33
- - run after a playtest, or with no arguments to print the playtest sheet
36
+ - run after a playtest session, on a human decision, or with no arguments to print the playtest sheet
@@ -0,0 +1,28 @@
1
+ ## Game Context Framework (from gcf-aif-ext)
2
+
3
+ gcf_context:
4
+ - the game's design and its work live in `gcf/`, and the `ai-factory gcf` commands and the gcf skills change them
5
+ - read `gcf/INDEX.md` before anything else under `gcf/`: it lists every subsystem, design unit and work item
6
+ - `gcf/LIVE.md` says what the game does now, and `gcf/PILLARS.md` says what it must stay
7
+
8
+ gcf_work:
9
+ - every piece of work is one work item `gcf/work/<id>.md`: find the item before writing code for a feature, a bug or a tech task, or create it with the gcf-card skill
10
+ - a raw idea, a playtest note or a CI finding that is not work yet goes to `ai-factory gcf inbox add "<text>"`, and the gcf-triage skill sorts it later
11
+ - before planning an item, run `ai-factory gcf context <id>` and read only the files it lists under `gcf/`
12
+ - drive a ready item with the gcf-run skill when the project has gcf-harness-aif-ext, otherwise with aif-plan and aif-implement
13
+ - end the work on an item with its command: `ai-factory gcf submit <id>` for gate verdict or decision, `ai-factory gcf close <id>` for gate auto with every check green
14
+ - work that cannot go on: run `ai-factory gcf block <id> --reason "<why or the question>"`
15
+ - a design question only the human can answer becomes a D1 record in `gcf/open-questions.md`
16
+
17
+ gcf_forbidden:
18
+ - do not edit `status:`, `frozen:`, `gcf/LIVE.md`, `gcf/history.md`, `gcf/graveyard.md` or `gcf/INDEX.md` by hand: the commands own them
19
+ - do not give a verdict or a decision: `verdict` and `decide` belong to the human, through the gcf-verdict skill
20
+ - do not answer a `TBD` of a design unit yourself: ask the human and offer your draft as the proposed answer
21
+ - do not reuse an ended id: rework gets a new id with `reopens: <old id>`
22
+ - do not commit past the gate with `--no-verify`: a refused commit names what to fix
23
+
24
+ gcf_skills:
25
+ - gcf-vision starts a game that has no design yet, and gcf-ingest imports a GDD into `gcf/design/`
26
+ - gcf-card puts work into `gcf/work/`, and gcf-triage sorts `gcf/inbox.md`
27
+ - gcf-verdict records the human's verdict or decision, and gcf-audit reports the health of `gcf/`
28
+ - gcf-debate stresses the design, gcf-adopt puts existing code on GCF, and gcf-init sets up `gcf/` and revises the pillars
@@ -6,3 +6,10 @@ wip_built_limit: 5
6
6
  context_budget: 30000
7
7
  pillars_budget: 1500
8
8
  envelope_default_spread: 0.3
9
+ unplayed_warn_after: 5
10
+ plan_passes: 5
11
+ dod_attempts: 2
12
+ # The project's own commands for the auto DoD (Methodology §6); the engine does not matter.
13
+ dod:
14
+ test:
15
+ build:
@@ -1,14 +1,21 @@
1
1
  ---
2
- schema: 2
2
+ schema: 3
3
3
  id: example
4
4
  type: mechanic
5
- status: proposed
5
+ gate: verdict
6
+ status: ready
6
7
  system: [example-system]
7
8
  depends: []
8
9
  pillars: []
9
10
  source: manual
10
11
  tune_count: 0
11
- built_at: null
12
+ since: null
13
+ live:
14
+ changes:
15
+ - id: example
16
+ change: added
17
+ summary: A short dash forward between fights.
18
+ refs: gcf/systems/example-system.md
12
19
  created: "2026-01-01"
13
20
  ---
14
21