ecoportal-api-graphql 1.3.13 → 1.3.15
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.
- checksums.yaml +4 -4
- data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.inbox.md +29 -29
- data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.inbox.md +42 -42
- data/.ai-assistance/projects/TODO.md +170 -118
- data/.ai-assistance/skills/ai-instructions/SKILL.md +48 -48
- data/.ai-assistance/skills/code-specs/SKILL.md +69 -69
- data/.ai-assistance/skills/gemini-assist/SKILL.md +63 -63
- data/.ai-assistance/skills/project-cycle/SKILL.md +177 -177
- data/.ai-assistance/skills/refactor/SKILL.md +62 -62
- data/.ai-assistance/skills/spec-generation/SKILL.md +72 -72
- data/.gitignore +37 -37
- data/.gitlab-ci.yml +64 -12
- data/CHANGELOG.md +77 -0
- data/changelog.d/fixed-mr51-payload-item-mismatches.md +17 -0
- data/docs/worklog.md +0 -18
- data/lib/ecoportal/api/common/graphql/client.rb +0 -2
- data/lib/ecoportal/api/common/graphql/http_client.rb +6 -0
- data/lib/ecoportal/api/graphql/base/ai_summary_version.rb +17 -17
- data/lib/ecoportal/api/graphql/base/location_classification_type.rb +15 -15
- data/lib/ecoportal/api/graphql/base/location_structure.rb +27 -27
- data/lib/ecoportal/api/graphql/base/organization.rb +15 -15
- data/lib/ecoportal/api/graphql/base/page/task.rb +24 -0
- data/lib/ecoportal/api/graphql/base/page.rb +17 -16
- data/lib/ecoportal/api/graphql/base/template.rb +35 -0
- data/lib/ecoportal/api/graphql/base.rb +37 -35
- data/lib/ecoportal/api/graphql/builder/contractor_entity.rb +41 -41
- data/lib/ecoportal/api/graphql/compat/response.rb +35 -35
- data/lib/ecoportal/api/graphql/connection/action.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/action_category.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/contractor_entity.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/page.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/person_member.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/preview_page.rb +11 -11
- data/lib/ecoportal/api/graphql/connection.rb +17 -17
- data/lib/ecoportal/api/graphql/file_upload/client.rb +21 -10
- data/lib/ecoportal/api/graphql/fragment/field_configuration.rb +38 -0
- data/lib/ecoportal/api/graphql/fragment/force.rb +14 -10
- data/lib/ecoportal/api/graphql/fragment/location_node.rb +26 -26
- data/lib/ecoportal/api/graphql/fragment/page_task.rb +39 -0
- data/lib/ecoportal/api/graphql/fragment/template.rb +51 -0
- data/lib/ecoportal/api/graphql/fragment.rb +3 -0
- data/lib/ecoportal/api/graphql/input/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/input/workflow_command/add_stage.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_field_configuration.rb +21 -21
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page.rb +28 -28
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page_creator_permissions.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/cross_reference.rb +23 -23
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/date.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/image_gallery.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/plain_text.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/rich_text.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/select.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/move_field.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_forces.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_section.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command.rb +251 -251
- data/lib/ecoportal/api/graphql/input.rb +24 -24
- data/lib/ecoportal/api/graphql/logic/connection.rb +34 -34
- data/lib/ecoportal/api/graphql/model/page/task.rb +16 -0
- data/lib/ecoportal/api/graphql/model/page.rb +16 -15
- data/lib/ecoportal/api/graphql/model/person_member.rb +15 -15
- data/lib/ecoportal/api/graphql/model/template.rb +15 -0
- data/lib/ecoportal/api/graphql/model.rb +32 -30
- data/lib/ecoportal/api/graphql/mutation/ai_summary/generate.rb +45 -45
- data/lib/ecoportal/api/graphql/mutation/ai_summary/submit_feedback.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/mutation/page/approve_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/batch_update_review_task.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/create_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/delete_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/execute_force_commands.rb +7 -7
- data/lib/ecoportal/api/graphql/mutation/page/execute_workflow_commands.rb +8 -7
- data/lib/ecoportal/api/graphql/mutation/page/publish_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/reject_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/restart_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/undo_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/preset_view/destroy.rb +34 -35
- data/lib/ecoportal/api/graphql/mutation/register/destroy.rb +35 -35
- data/lib/ecoportal/api/graphql/mutation/smart_fill/generate.rb +36 -36
- data/lib/ecoportal/api/graphql/mutation/smart_fill/submit_feedback.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/smart_fill.rb +13 -13
- data/lib/ecoportal/api/graphql/mutation/template/create_related_page.rb +46 -46
- data/lib/ecoportal/api/graphql/mutation/template/destroy_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/template/update_information.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation.rb +20 -20
- data/lib/ecoportal/api/graphql/payload/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/payload/ok_payload.rb +36 -21
- data/lib/ecoportal/api/graphql/payload/page/draft.rb +26 -13
- data/lib/ecoportal/api/graphql/payload/page/review_task.rb +13 -13
- data/lib/ecoportal/api/graphql/payload/page/review_task_batch.rb +23 -0
- data/lib/ecoportal/api/graphql/payload/page.rb +20 -19
- data/lib/ecoportal/api/graphql/payload/preset_view.rb +15 -11
- data/lib/ecoportal/api/graphql/payload/register.rb +15 -11
- data/lib/ecoportal/api/graphql/payload/template/create_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/template/destroy_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/template/update_information.rb +1 -1
- data/lib/ecoportal/api/graphql/query/location_structures.rb +57 -57
- data/lib/ecoportal/api/graphql/query/page_with_forces.rb +9 -3
- data/lib/ecoportal/api/graphql/query/pages_workflow_commands.rb +9 -3
- data/lib/ecoportal/api/graphql/query/register_preset_views.rb +78 -78
- data/lib/ecoportal/api/graphql/query.rb +27 -27
- data/lib/ecoportal/api/graphql.rb +9 -5
- data/lib/ecoportal/api/graphql_version.rb +1 -1
- data/tests/dump_schema.rb +88 -0
- data/tests/validate_queries.rb +34 -12
- metadata +11 -1
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
# SKILL: Code Specs for AI
|
|
2
|
-
|
|
3
|
-
**Purpose:** Maintain AI-readable markdown documentation in `.ai-assistance/code/` so that future AI agents don't need to re-analyse code from scratch. These docs are shortcuts, not replacements — when real analysis is needed, always update them.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
- After analysing a new area of the codebase.
|
|
10
|
-
- Before starting work in an area — check if a doc exists and whether it's stale.
|
|
11
|
-
- After making changes that alter the understanding of an area.
|
|
12
|
-
- Periodically (especially at project cycle-end) — use Gemini Assist to spot stale sections.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Document Structure
|
|
17
|
-
|
|
18
|
-
Each code spec document (`.ai-assistance/code/<area>.md`) must include:
|
|
19
|
-
|
|
20
|
-
```markdown
|
|
21
|
-
# Code Spec: <Area Name>
|
|
22
|
-
|
|
23
|
-
**Scope:** What this document covers. What it explicitly does NOT cover.
|
|
24
|
-
**Last updated:** YYYY-MM-DD
|
|
25
|
-
**Key files:** List of the most important files in this area.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Overview
|
|
30
|
-
Brief description of what this area does and its role in the gem.
|
|
31
|
-
|
|
32
|
-
## Key Classes / Modules
|
|
33
|
-
For each significant class: one-line purpose, key public methods/interface.
|
|
34
|
-
|
|
35
|
-
## Patterns & Conventions
|
|
36
|
-
Design patterns, inheritance chains, naming conventions specific to this area.
|
|
37
|
-
|
|
38
|
-
## Dependencies
|
|
39
|
-
What this area depends on (internal and external). What depends on it.
|
|
40
|
-
|
|
41
|
-
## Gotchas / Non-Obvious Behaviours
|
|
42
|
-
Things that would cause confusion or bugs if not known upfront.
|
|
43
|
-
|
|
44
|
-
## TODOs / Open Questions
|
|
45
|
-
Pending items specific to this area. Link to project TODO if applicable.
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Naming & Placement
|
|
51
|
-
|
|
52
|
-
Mirror the `lib/` structure:
|
|
53
|
-
|
|
54
|
-
| Code area | Doc path |
|
|
55
|
-
|-----------|---------|
|
|
56
|
-
| `lib/ecoportal/api/graphql/model/` | `.ai-assistance/code/model.md` |
|
|
57
|
-
| `lib/ecoportal/api/graphql/input/` | `.ai-assistance/code/input.md` |
|
|
58
|
-
| `lib/ecoportal/api/graphql/logic/` | `.ai-assistance/code/logic.md` |
|
|
59
|
-
| Whole gem overview | `.ai-assistance/code/OVERVIEW.md` |
|
|
60
|
-
|
|
61
|
-
For deeply nested areas, use subdirectories: `.ai-assistance/code/model/location_structure.md`
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Keeping Docs Fresh
|
|
66
|
-
|
|
67
|
-
- When you read a file and find something the doc doesn't mention — add it.
|
|
68
|
-
- When a refactor changes a class — update the corresponding doc.
|
|
69
|
-
- Use the `gemini-assist` skill for batch reviews of multiple docs vs. current code.
|
|
1
|
+
# SKILL: Code Specs for AI
|
|
2
|
+
|
|
3
|
+
**Purpose:** Maintain AI-readable markdown documentation in `.ai-assistance/code/` so that future AI agents don't need to re-analyse code from scratch. These docs are shortcuts, not replacements — when real analysis is needed, always update them.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- After analysing a new area of the codebase.
|
|
10
|
+
- Before starting work in an area — check if a doc exists and whether it's stale.
|
|
11
|
+
- After making changes that alter the understanding of an area.
|
|
12
|
+
- Periodically (especially at project cycle-end) — use Gemini Assist to spot stale sections.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Document Structure
|
|
17
|
+
|
|
18
|
+
Each code spec document (`.ai-assistance/code/<area>.md`) must include:
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
# Code Spec: <Area Name>
|
|
22
|
+
|
|
23
|
+
**Scope:** What this document covers. What it explicitly does NOT cover.
|
|
24
|
+
**Last updated:** YYYY-MM-DD
|
|
25
|
+
**Key files:** List of the most important files in this area.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Overview
|
|
30
|
+
Brief description of what this area does and its role in the gem.
|
|
31
|
+
|
|
32
|
+
## Key Classes / Modules
|
|
33
|
+
For each significant class: one-line purpose, key public methods/interface.
|
|
34
|
+
|
|
35
|
+
## Patterns & Conventions
|
|
36
|
+
Design patterns, inheritance chains, naming conventions specific to this area.
|
|
37
|
+
|
|
38
|
+
## Dependencies
|
|
39
|
+
What this area depends on (internal and external). What depends on it.
|
|
40
|
+
|
|
41
|
+
## Gotchas / Non-Obvious Behaviours
|
|
42
|
+
Things that would cause confusion or bugs if not known upfront.
|
|
43
|
+
|
|
44
|
+
## TODOs / Open Questions
|
|
45
|
+
Pending items specific to this area. Link to project TODO if applicable.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Naming & Placement
|
|
51
|
+
|
|
52
|
+
Mirror the `lib/` structure:
|
|
53
|
+
|
|
54
|
+
| Code area | Doc path |
|
|
55
|
+
|-----------|---------|
|
|
56
|
+
| `lib/ecoportal/api/graphql/model/` | `.ai-assistance/code/model.md` |
|
|
57
|
+
| `lib/ecoportal/api/graphql/input/` | `.ai-assistance/code/input.md` |
|
|
58
|
+
| `lib/ecoportal/api/graphql/logic/` | `.ai-assistance/code/logic.md` |
|
|
59
|
+
| Whole gem overview | `.ai-assistance/code/OVERVIEW.md` |
|
|
60
|
+
|
|
61
|
+
For deeply nested areas, use subdirectories: `.ai-assistance/code/model/location_structure.md`
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Keeping Docs Fresh
|
|
66
|
+
|
|
67
|
+
- When you read a file and find something the doc doesn't mention — add it.
|
|
68
|
+
- When a refactor changes a class — update the corresponding doc.
|
|
69
|
+
- Use the `gemini-assist` skill for batch reviews of multiple docs vs. current code.
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
# SKILL: Gemini Assist
|
|
2
|
-
|
|
3
|
-
**Purpose:** Offload large-context tasks to Gemini to save Claude token quota, speed up development, and leverage Gemini's wide context window.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
- The task requires reading many files at once (e.g. whole-gem analysis, cross-cutting refactor planning).
|
|
10
|
-
- A task is mostly "read and summarise / read and advise" rather than "write code" — Gemini handles these cheaply.
|
|
11
|
-
- You're doing a cycle-end review and want a second pass over a large diff or many changed files.
|
|
12
|
-
- Token budget is running low and the task doesn't require Claude's nuanced judgement for the current step.
|
|
13
|
-
|
|
14
|
-
## When NOT to Use
|
|
15
|
-
|
|
16
|
-
- Tasks that require writing or editing actual code (Claude applies changes; Gemini only advises).
|
|
17
|
-
- Tasks where hallucination risk is high and verification would cost more time than doing it directly.
|
|
18
|
-
- Short tasks that fit comfortably in Claude's context — the overhead isn't worth it.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## How to Invoke
|
|
23
|
-
|
|
24
|
-
Run from the repo root:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
ruby .ai-assistance/skills/gemini-assist/gemini_ask.rb \
|
|
28
|
-
--prompt "Your question or instruction here" \
|
|
29
|
-
--files path/to/file1.rb path/to/file2.rb \
|
|
30
|
-
[--model gemini-1.5-pro]
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Or pass a prompt file:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
ruby .ai-assistance/skills/gemini-assist/gemini_ask.rb \
|
|
37
|
-
--prompt-file .ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt \
|
|
38
|
-
--files "lib/ecoportal/api/graphql/**/*.rb"
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Environment variable required:** `GEMINI_API_KEY` — set in `.env` at repo root (git-ignored).
|
|
42
|
-
**Optional:** `GEMINI_MODEL` — defaults to `gemini-1.5-pro`. Override in `.env` or via `--model`.
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Output Handling (IMPORTANT)
|
|
47
|
-
|
|
48
|
-
Gemini responses **must always be reviewed** before acting on them:
|
|
49
|
-
|
|
50
|
-
1. Read the response carefully.
|
|
51
|
-
2. Cross-check any specific claims (method names, class hierarchies, argument counts) against the actual code.
|
|
52
|
-
3. Where Gemini proposes code changes, treat them as a draft — apply only after verifying correctness.
|
|
53
|
-
4. Where Gemini flags issues in a cycle-end review, confirm each issue is real before proposing a fix to the developer.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Prompting Tips for Best Results
|
|
58
|
-
|
|
59
|
-
- Give Gemini explicit instructions: what to look for, what to ignore, what format to respond in.
|
|
60
|
-
- Tell it the role: "You are reviewing a Ruby gem. Focus on X. Do not suggest Y."
|
|
61
|
-
- Ask for a structured output (e.g. "Respond with a numbered list of concerns, each with: file, line range, issue, suggested fix").
|
|
62
|
-
- For large reviews, ask it to triage by severity first.
|
|
63
|
-
- Use the pre-built prompt in `prompts/cycle_end_review.txt` for end-of-cycle reviews.
|
|
1
|
+
# SKILL: Gemini Assist
|
|
2
|
+
|
|
3
|
+
**Purpose:** Offload large-context tasks to Gemini to save Claude token quota, speed up development, and leverage Gemini's wide context window.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- The task requires reading many files at once (e.g. whole-gem analysis, cross-cutting refactor planning).
|
|
10
|
+
- A task is mostly "read and summarise / read and advise" rather than "write code" — Gemini handles these cheaply.
|
|
11
|
+
- You're doing a cycle-end review and want a second pass over a large diff or many changed files.
|
|
12
|
+
- Token budget is running low and the task doesn't require Claude's nuanced judgement for the current step.
|
|
13
|
+
|
|
14
|
+
## When NOT to Use
|
|
15
|
+
|
|
16
|
+
- Tasks that require writing or editing actual code (Claude applies changes; Gemini only advises).
|
|
17
|
+
- Tasks where hallucination risk is high and verification would cost more time than doing it directly.
|
|
18
|
+
- Short tasks that fit comfortably in Claude's context — the overhead isn't worth it.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## How to Invoke
|
|
23
|
+
|
|
24
|
+
Run from the repo root:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ruby .ai-assistance/skills/gemini-assist/gemini_ask.rb \
|
|
28
|
+
--prompt "Your question or instruction here" \
|
|
29
|
+
--files path/to/file1.rb path/to/file2.rb \
|
|
30
|
+
[--model gemini-1.5-pro]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or pass a prompt file:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
ruby .ai-assistance/skills/gemini-assist/gemini_ask.rb \
|
|
37
|
+
--prompt-file .ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt \
|
|
38
|
+
--files "lib/ecoportal/api/graphql/**/*.rb"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Environment variable required:** `GEMINI_API_KEY` — set in `.env` at repo root (git-ignored).
|
|
42
|
+
**Optional:** `GEMINI_MODEL` — defaults to `gemini-1.5-pro`. Override in `.env` or via `--model`.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Output Handling (IMPORTANT)
|
|
47
|
+
|
|
48
|
+
Gemini responses **must always be reviewed** before acting on them:
|
|
49
|
+
|
|
50
|
+
1. Read the response carefully.
|
|
51
|
+
2. Cross-check any specific claims (method names, class hierarchies, argument counts) against the actual code.
|
|
52
|
+
3. Where Gemini proposes code changes, treat them as a draft — apply only after verifying correctness.
|
|
53
|
+
4. Where Gemini flags issues in a cycle-end review, confirm each issue is real before proposing a fix to the developer.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Prompting Tips for Best Results
|
|
58
|
+
|
|
59
|
+
- Give Gemini explicit instructions: what to look for, what to ignore, what format to respond in.
|
|
60
|
+
- Tell it the role: "You are reviewing a Ruby gem. Focus on X. Do not suggest Y."
|
|
61
|
+
- Ask for a structured output (e.g. "Respond with a numbered list of concerns, each with: file, line range, issue, suggested fix").
|
|
62
|
+
- For large reviews, ask it to triage by severity first.
|
|
63
|
+
- Use the pre-built prompt in `prompts/cycle_end_review.txt` for end-of-cycle reviews.
|
|
@@ -1,177 +1,177 @@
|
|
|
1
|
-
# SKILL: Project Preparation, Maintenance & Cycle
|
|
2
|
-
|
|
3
|
-
**Purpose:** Capture, organise, and track a development project from intent through completion, including upstream dependency decisions and cycle-end review.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
- A developer describes a new piece of work.
|
|
10
|
-
- Picking up an existing project after a gap.
|
|
11
|
-
- A cycle of changes is complete and needs a closing review.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Folder Structure
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
.ai-assistance/projects/<project-slug>/
|
|
19
|
-
INTENT.md What we're trying to achieve and why
|
|
20
|
-
TODO.md Ordered task list, ticked off as done
|
|
21
|
-
DECISIONS.md Key decisions made and why
|
|
22
|
-
UPSTREAM.md Upstream dependency changes needed (if any)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Project folders are **not git-ignored** — they should be committed so other developers can pick up context.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Starting a Project
|
|
30
|
-
|
|
31
|
-
1. Ask the developer: "What are we trying to change and why?"
|
|
32
|
-
2. Capture the answer in `INTENT.md` (see template below).
|
|
33
|
-
3. Present it back: "Here's my understanding — does this capture it?" Iterate until confirmed.
|
|
34
|
-
4. Break the intent into an ordered TODO list in `TODO.md`.
|
|
35
|
-
5. If upstream deps are involved, create `UPSTREAM.md` and present options (patch, fork, new version).
|
|
36
|
-
|
|
37
|
-
### INTENT.md template
|
|
38
|
-
|
|
39
|
-
```markdown
|
|
40
|
-
# Project: <Name>
|
|
41
|
-
|
|
42
|
-
**Created:** YYYY-MM-DD
|
|
43
|
-
**Status:** [active | paused | complete]
|
|
44
|
-
**Branch:** feature/<slug>
|
|
45
|
-
**Target branch:** main
|
|
46
|
-
|
|
47
|
-
## Goal
|
|
48
|
-
One paragraph: what we want to achieve.
|
|
49
|
-
|
|
50
|
-
## Motivation
|
|
51
|
-
Why now? What problem does this solve?
|
|
52
|
-
|
|
53
|
-
## Scope
|
|
54
|
-
What's in scope. What's explicitly out of scope.
|
|
55
|
-
|
|
56
|
-
## Success Criteria
|
|
57
|
-
How we'll know it's done.
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## TODO.md format
|
|
63
|
-
|
|
64
|
-
```markdown
|
|
65
|
-
# TODOs — <Project Name>
|
|
66
|
-
|
|
67
|
-
- [ ] Task description <!-- add detail as needed -->
|
|
68
|
-
- [x] Completed task
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Tick items off as they're completed. Never delete items — the history matters.
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## DECISIONS.md format
|
|
76
|
-
|
|
77
|
-
```markdown
|
|
78
|
-
# Decisions — <Project Name>
|
|
79
|
-
|
|
80
|
-
## [DATE] <Decision title>
|
|
81
|
-
|
|
82
|
-
**Context:** What made this decision necessary.
|
|
83
|
-
**Options considered:** Brief list.
|
|
84
|
-
**Decision:** What was chosen.
|
|
85
|
-
**Reason:** Why.
|
|
86
|
-
**Consequences:** What this means going forward.
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Session Start — Git Orientation (Always Do This)
|
|
92
|
-
|
|
93
|
-
Before any other work, run:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# 1. Confirm current branch
|
|
97
|
-
git branch --show-current
|
|
98
|
-
|
|
99
|
-
# 2. Check how far ahead of target branch
|
|
100
|
-
git rev-list --count main..HEAD
|
|
101
|
-
|
|
102
|
-
# 3. Get a cheap summary of what's changed
|
|
103
|
-
git diff main...HEAD --stat
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Cross-reference the diff stat against the active project's `TODO.md`:
|
|
107
|
-
- Changed files should map to ticked TODO items.
|
|
108
|
-
- Unticked TODOs with no corresponding changed files = work not yet started.
|
|
109
|
-
- Changed files with no corresponding TODO = untracked work, worth noting.
|
|
110
|
-
|
|
111
|
-
If **GitKraken MCP** is connected, use it instead — it returns the same information as structured data without a bash call.
|
|
112
|
-
|
|
113
|
-
If the branch in `INTENT.md` doesn't match the current branch, flag it to the developer before proceeding.
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Cycle-End Review
|
|
118
|
-
|
|
119
|
-
When all TODOs are ticked:
|
|
120
|
-
|
|
121
|
-
1. **Git summary:** Run `git diff main...HEAD --name-only` to get the exact file list.
|
|
122
|
-
2. **Gemini review:** Pass changed files to `gemini-assist` using the `cycle_end_review.txt` prompt:
|
|
123
|
-
```bash
|
|
124
|
-
ruby .ai-assistance/skills/gemini-assist/gemini_ask.rb \
|
|
125
|
-
--prompt-file .ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt \
|
|
126
|
-
--output .ai-assistance/projects/<slug>/gemini_review.txt \
|
|
127
|
-
--files $(git diff main...HEAD --name-only | tr '\n' ' ')
|
|
128
|
-
```
|
|
129
|
-
3. Review Gemini's output — verify each claim against actual code before acting.
|
|
130
|
-
4. Propose fixes for genuine issues — confirm with developer.
|
|
131
|
-
5. **If GitLab MCP is connected:** Check `get_merge_request_pipelines` to confirm CI is green.
|
|
132
|
-
6. Update `INTENT.md` status to `complete`.
|
|
133
|
-
7. Prompt: "Ready to open the MR / start the next project?"
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## Upstream Dependency Changes
|
|
138
|
-
|
|
139
|
-
If changes require modifying an upstream gem:
|
|
140
|
-
|
|
141
|
-
Options (present all three to developer):
|
|
142
|
-
|
|
143
|
-
1. **Local patch** — monkey-patch from this gem. Fast, messy, temporary.
|
|
144
|
-
2. **Fork change** — commit to our fork (for `graphlient` or `graphql-client`). Appropriate for lasting fixes we own.
|
|
145
|
-
3. **New version** — for `ecoportal-api` or `ecoportal-api-v2` (team-owned), cut a new version. For external forks, optionally contribute back upstream.
|
|
146
|
-
|
|
147
|
-
Document the decision in `UPSTREAM.md` and `DECISIONS.md`.
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Session / Collaborator Setup (First Time on a Machine)
|
|
152
|
-
|
|
153
|
-
When starting a session and `.ai-assistance/local_paths.md` does not exist, run this setup flow **before** any project work:
|
|
154
|
-
|
|
155
|
-
1. Tell the developer: "I don't see a `local_paths.md` for your machine yet. This helps me cross-reference upstream and downstream gem code without fetching from remotes every time."
|
|
156
|
-
|
|
157
|
-
2. For each dependency in the table below, ask: "Do you have `<gem>` cloned locally?"
|
|
158
|
-
|
|
159
|
-
| Gem | Remote |
|
|
160
|
-
|-----|--------|
|
|
161
|
-
| `ecoportal-api` | https://gitlab.ecoportal.co.nz/ecoportal/ecoportal-api.git |
|
|
162
|
-
| `ecoportal-api-v2` | https://gitlab.ecoportal.co.nz/oscar/ecoportal-api-v2.git |
|
|
163
|
-
| `graphlient` | https://github.com/rellampec/graphlient.git |
|
|
164
|
-
| `graphql-client` | https://github.com/rellampec/graphql-client.git |
|
|
165
|
-
| `eco-helpers` | https://gitlab.ecoportal.co.nz/oscar/script_api_helpers.git |
|
|
166
|
-
|
|
167
|
-
3. For each one they have locally:
|
|
168
|
-
- In **Cowork**: ask them to connect the folder (via the folder picker), then record the confirmed path.
|
|
169
|
-
- In **Claude Code**: ask them to provide the path, or run `find ~ -name "<gemspec>" -maxdepth 6 2>/dev/null` to locate it.
|
|
170
|
-
|
|
171
|
-
4. Once all available paths are collected, create `.ai-assistance/local_paths.md` from `.ai-assistance/local_paths.example.md`, filling in only the repos they confirmed.
|
|
172
|
-
|
|
173
|
-
5. Also ask: "Do you have GitKraken MCP or GitLab MCP set up?" — if not, point them to `.ai-assistance/integrations/`.
|
|
174
|
-
|
|
175
|
-
6. Confirm: "Done — I've saved your local paths. You can update `.ai-assistance/local_paths.md` any time if your setup changes."
|
|
176
|
-
|
|
177
|
-
If a developer doesn't have a repo locally and the task requires reading it, offer: "I can fetch the relevant files from the remote — just note it'll be slower. Want me to proceed that way?"
|
|
1
|
+
# SKILL: Project Preparation, Maintenance & Cycle
|
|
2
|
+
|
|
3
|
+
**Purpose:** Capture, organise, and track a development project from intent through completion, including upstream dependency decisions and cycle-end review.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- A developer describes a new piece of work.
|
|
10
|
+
- Picking up an existing project after a gap.
|
|
11
|
+
- A cycle of changes is complete and needs a closing review.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Folder Structure
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
.ai-assistance/projects/<project-slug>/
|
|
19
|
+
INTENT.md What we're trying to achieve and why
|
|
20
|
+
TODO.md Ordered task list, ticked off as done
|
|
21
|
+
DECISIONS.md Key decisions made and why
|
|
22
|
+
UPSTREAM.md Upstream dependency changes needed (if any)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Project folders are **not git-ignored** — they should be committed so other developers can pick up context.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Starting a Project
|
|
30
|
+
|
|
31
|
+
1. Ask the developer: "What are we trying to change and why?"
|
|
32
|
+
2. Capture the answer in `INTENT.md` (see template below).
|
|
33
|
+
3. Present it back: "Here's my understanding — does this capture it?" Iterate until confirmed.
|
|
34
|
+
4. Break the intent into an ordered TODO list in `TODO.md`.
|
|
35
|
+
5. If upstream deps are involved, create `UPSTREAM.md` and present options (patch, fork, new version).
|
|
36
|
+
|
|
37
|
+
### INTENT.md template
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
# Project: <Name>
|
|
41
|
+
|
|
42
|
+
**Created:** YYYY-MM-DD
|
|
43
|
+
**Status:** [active | paused | complete]
|
|
44
|
+
**Branch:** feature/<slug>
|
|
45
|
+
**Target branch:** main
|
|
46
|
+
|
|
47
|
+
## Goal
|
|
48
|
+
One paragraph: what we want to achieve.
|
|
49
|
+
|
|
50
|
+
## Motivation
|
|
51
|
+
Why now? What problem does this solve?
|
|
52
|
+
|
|
53
|
+
## Scope
|
|
54
|
+
What's in scope. What's explicitly out of scope.
|
|
55
|
+
|
|
56
|
+
## Success Criteria
|
|
57
|
+
How we'll know it's done.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## TODO.md format
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
# TODOs — <Project Name>
|
|
66
|
+
|
|
67
|
+
- [ ] Task description <!-- add detail as needed -->
|
|
68
|
+
- [x] Completed task
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Tick items off as they're completed. Never delete items — the history matters.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## DECISIONS.md format
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
# Decisions — <Project Name>
|
|
79
|
+
|
|
80
|
+
## [DATE] <Decision title>
|
|
81
|
+
|
|
82
|
+
**Context:** What made this decision necessary.
|
|
83
|
+
**Options considered:** Brief list.
|
|
84
|
+
**Decision:** What was chosen.
|
|
85
|
+
**Reason:** Why.
|
|
86
|
+
**Consequences:** What this means going forward.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Session Start — Git Orientation (Always Do This)
|
|
92
|
+
|
|
93
|
+
Before any other work, run:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# 1. Confirm current branch
|
|
97
|
+
git branch --show-current
|
|
98
|
+
|
|
99
|
+
# 2. Check how far ahead of target branch
|
|
100
|
+
git rev-list --count main..HEAD
|
|
101
|
+
|
|
102
|
+
# 3. Get a cheap summary of what's changed
|
|
103
|
+
git diff main...HEAD --stat
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Cross-reference the diff stat against the active project's `TODO.md`:
|
|
107
|
+
- Changed files should map to ticked TODO items.
|
|
108
|
+
- Unticked TODOs with no corresponding changed files = work not yet started.
|
|
109
|
+
- Changed files with no corresponding TODO = untracked work, worth noting.
|
|
110
|
+
|
|
111
|
+
If **GitKraken MCP** is connected, use it instead — it returns the same information as structured data without a bash call.
|
|
112
|
+
|
|
113
|
+
If the branch in `INTENT.md` doesn't match the current branch, flag it to the developer before proceeding.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Cycle-End Review
|
|
118
|
+
|
|
119
|
+
When all TODOs are ticked:
|
|
120
|
+
|
|
121
|
+
1. **Git summary:** Run `git diff main...HEAD --name-only` to get the exact file list.
|
|
122
|
+
2. **Gemini review:** Pass changed files to `gemini-assist` using the `cycle_end_review.txt` prompt:
|
|
123
|
+
```bash
|
|
124
|
+
ruby .ai-assistance/skills/gemini-assist/gemini_ask.rb \
|
|
125
|
+
--prompt-file .ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt \
|
|
126
|
+
--output .ai-assistance/projects/<slug>/gemini_review.txt \
|
|
127
|
+
--files $(git diff main...HEAD --name-only | tr '\n' ' ')
|
|
128
|
+
```
|
|
129
|
+
3. Review Gemini's output — verify each claim against actual code before acting.
|
|
130
|
+
4. Propose fixes for genuine issues — confirm with developer.
|
|
131
|
+
5. **If GitLab MCP is connected:** Check `get_merge_request_pipelines` to confirm CI is green.
|
|
132
|
+
6. Update `INTENT.md` status to `complete`.
|
|
133
|
+
7. Prompt: "Ready to open the MR / start the next project?"
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Upstream Dependency Changes
|
|
138
|
+
|
|
139
|
+
If changes require modifying an upstream gem:
|
|
140
|
+
|
|
141
|
+
Options (present all three to developer):
|
|
142
|
+
|
|
143
|
+
1. **Local patch** — monkey-patch from this gem. Fast, messy, temporary.
|
|
144
|
+
2. **Fork change** — commit to our fork (for `graphlient` or `graphql-client`). Appropriate for lasting fixes we own.
|
|
145
|
+
3. **New version** — for `ecoportal-api` or `ecoportal-api-v2` (team-owned), cut a new version. For external forks, optionally contribute back upstream.
|
|
146
|
+
|
|
147
|
+
Document the decision in `UPSTREAM.md` and `DECISIONS.md`.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Session / Collaborator Setup (First Time on a Machine)
|
|
152
|
+
|
|
153
|
+
When starting a session and `.ai-assistance/local_paths.md` does not exist, run this setup flow **before** any project work:
|
|
154
|
+
|
|
155
|
+
1. Tell the developer: "I don't see a `local_paths.md` for your machine yet. This helps me cross-reference upstream and downstream gem code without fetching from remotes every time."
|
|
156
|
+
|
|
157
|
+
2. For each dependency in the table below, ask: "Do you have `<gem>` cloned locally?"
|
|
158
|
+
|
|
159
|
+
| Gem | Remote |
|
|
160
|
+
|-----|--------|
|
|
161
|
+
| `ecoportal-api` | https://gitlab.ecoportal.co.nz/ecoportal/ecoportal-api.git |
|
|
162
|
+
| `ecoportal-api-v2` | https://gitlab.ecoportal.co.nz/oscar/ecoportal-api-v2.git |
|
|
163
|
+
| `graphlient` | https://github.com/rellampec/graphlient.git |
|
|
164
|
+
| `graphql-client` | https://github.com/rellampec/graphql-client.git |
|
|
165
|
+
| `eco-helpers` | https://gitlab.ecoportal.co.nz/oscar/script_api_helpers.git |
|
|
166
|
+
|
|
167
|
+
3. For each one they have locally:
|
|
168
|
+
- In **Cowork**: ask them to connect the folder (via the folder picker), then record the confirmed path.
|
|
169
|
+
- In **Claude Code**: ask them to provide the path, or run `find ~ -name "<gemspec>" -maxdepth 6 2>/dev/null` to locate it.
|
|
170
|
+
|
|
171
|
+
4. Once all available paths are collected, create `.ai-assistance/local_paths.md` from `.ai-assistance/local_paths.example.md`, filling in only the repos they confirmed.
|
|
172
|
+
|
|
173
|
+
5. Also ask: "Do you have GitKraken MCP or GitLab MCP set up?" — if not, point them to `.ai-assistance/integrations/`.
|
|
174
|
+
|
|
175
|
+
6. Confirm: "Done — I've saved your local paths. You can update `.ai-assistance/local_paths.md` any time if your setup changes."
|
|
176
|
+
|
|
177
|
+
If a developer doesn't have a repo locally and the task requires reading it, offer: "I can fetch the relevant files from the remote — just note it'll be slower. Want me to proceed that way?"
|