Skip to content

Commit 4582af5

Browse files
authored
Merge pull request #57 from MSiccDev/development
add 5 step prompt loop for implementation
2 parents 2a93930 + 352d578 commit 4582af5

27 files changed

Lines changed: 381 additions & 33 deletions

.claude-plugin/marketplace.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"source": "github",
1212
"repo": "MSiccDev/ai-context-kit"
1313
},
14-
"description": "Context-aware AI collaboration skills for creating and validating user context, project AGENTS.md files, and skill artifacts across LLM providers.",
14+
"description": "Context-aware AI collaboration skills and implementation loop prompts for creating and validating user context, project AGENTS.md files, and skill artifacts across LLM providers.",
1515
"version": "1.4.2",
1616
"license": "MIT",
1717
"homepage": "https://github.com/MSiccDev/ai-context-kit",
@@ -22,7 +22,9 @@
2222
"skills",
2323
"user-context",
2424
"ai-collaboration",
25-
"prompt-engineering"
25+
"prompt-engineering",
26+
"implementation-loop",
27+
"workflow-prompts"
2628
]
2729
}
2830
]

.claude-plugin/plugin.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
33
"name": "ai-context-kit",
44
"version": "1.4.2",
5-
"description": "Context-aware AI collaboration skills for creating and validating user context, project AGENTS.md files, and skill artifacts across LLM providers.",
5+
"description": "Context-aware AI collaboration skills and implementation loop prompts for creating and validating user context, project AGENTS.md files, and skill artifacts across LLM providers.",
66
"author": {
77
"name": "MSiccDev Software Development",
88
"url": "https://github.com/MSiccDev"
@@ -16,6 +16,8 @@
1616
"skills",
1717
"user-context",
1818
"ai-collaboration",
19-
"prompt-engineering"
19+
"prompt-engineering",
20+
"implementation-loop",
21+
"workflow-prompts"
2022
]
2123
}

AGENTS.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use this order when files differ:
1414
1. **Specification (authoritative, v1.4.2):** `specs/context_aware_ai_session_spec.md`
1515
2. **Templates (canonical structures):** `templates/*.instructions.md` and `templates/skill_template/SKILL.md`
1616
3. **Skills (canonical operational workflows):** `skills/*/SKILL.md` and skill-local references
17-
4. **Prompts (compatibility wrappers):** `prompts/*.prompt.md` (must defer detailed logic to skills)
17+
4. **Prompts:** `prompts/skills/*.prompt.md` (compatibility wrappers — must defer detailed logic to skills); `prompts/loop/*.prompt.md` (implementation loop steps — self-contained workflow prompts)
1818
5. **Samples and validation artifacts (illustrative records):** `usercontexts/*.instructions.md`, related `*.validation.md`
1919

2020
## Repository Map
@@ -23,7 +23,8 @@ Use this order when files differ:
2323
| `specs/` | Normative session-model specification and terminology |
2424
| `templates/` | Canonical instruction templates aligned to the spec |
2525
| `skills/` | Canonical workflow skills (`SKILL.md` folders) and skill-local resources |
26-
| `prompts/` | Compatibility wrappers that route workflows to canonical skills |
26+
| `prompts/skills/` | Compatibility wrappers that route workflows to canonical skills |
27+
| `prompts/loop/` | Numbered step prompts for the implementation loop (readiness-check → implementation → self-review → learnings → human-in-the-loop); invoke in order, learnings is optional |
2728
| `usercontexts/` | User-context instruction examples and validation reports |
2829

2930
## Scope And Precedence For AGENTS.md Files
@@ -201,14 +202,20 @@ When `specs/context_aware_ai_session_spec.md` changes, audit and update all impa
201202
- User context template: [`templates/usercontext_template.instructions.md`](templates/usercontext_template.instructions.md)
202203
- Skill template: [`templates/skill_template/SKILL.md`](templates/skill_template/SKILL.md)
203204
- Create prompts:
204-
- [`prompts/create-agents-md.prompt.md`](prompts/create-agents-md.prompt.md)
205-
- [`prompts/create-usercontext-instructions.prompt.md`](prompts/create-usercontext-instructions.prompt.md)
206-
- [`prompts/create-project-instructions.prompt.md`](prompts/create-project-instructions.prompt.md)
207-
- [`prompts/create-skill.prompt.md`](prompts/create-skill.prompt.md)
205+
- [`prompts/skills/create-agents-md.prompt.md`](prompts/skills/create-agents-md.prompt.md)
206+
- [`prompts/skills/create-usercontext-instructions.prompt.md`](prompts/skills/create-usercontext-instructions.prompt.md)
207+
- [`prompts/skills/create-project-instructions.prompt.md`](prompts/skills/create-project-instructions.prompt.md)
208+
- [`prompts/skills/create-skill.prompt.md`](prompts/skills/create-skill.prompt.md)
208209
- Validate prompts:
209-
- [`prompts/validate-agents-md.prompt.md`](prompts/validate-agents-md.prompt.md)
210-
- [`prompts/validate-usercontext-instructions.prompt.md`](prompts/validate-usercontext-instructions.prompt.md)
211-
- [`prompts/validate-project-instructions.prompt.md`](prompts/validate-project-instructions.prompt.md)
212-
- [`prompts/validate-skill.prompt.md`](prompts/validate-skill.prompt.md)
210+
- [`prompts/skills/validate-agents-md.prompt.md`](prompts/skills/validate-agents-md.prompt.md)
211+
- [`prompts/skills/validate-usercontext-instructions.prompt.md`](prompts/skills/validate-usercontext-instructions.prompt.md)
212+
- [`prompts/skills/validate-project-instructions.prompt.md`](prompts/skills/validate-project-instructions.prompt.md)
213+
- [`prompts/skills/validate-skill.prompt.md`](prompts/skills/validate-skill.prompt.md)
214+
- Loop prompts:
215+
- [`prompts/loop/01-readiness-check.prompt.md`](prompts/loop/01-readiness-check.prompt.md)
216+
- [`prompts/loop/02-implementation.prompt.md`](prompts/loop/02-implementation.prompt.md)
217+
- [`prompts/loop/03-self-review.prompt.md`](prompts/loop/03-self-review.prompt.md)
218+
- [`prompts/loop/04-learnings.prompt.md`](prompts/loop/04-learnings.prompt.md) _(optional)_
219+
- [`prompts/loop/05-human-in-the-loop.prompt.md`](prompts/loop/05-human-in-the-loop.prompt.md)
213220
- Extracted skills index: [`skills/README.md`](skills/README.md)
214221
- Sample user context instructions: [`usercontexts/sample_usercontext.instructions.md`](usercontexts/sample_usercontext.instructions.md)

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,24 @@ ai-context-kit/
6767
├── README.md # This file
6868
├── LICENSE # MIT License file
6969
70-
├── prompts/ # Composition prompt wrappers
71-
│ ├── create-usercontext-instructions.prompt.md # Generate user context instruction files
72-
│ ├── create-project-instructions.prompt.md # Generate project-context AGENTS.md files
73-
│ ├── create-agents-md.prompt.md # Generate AGENTS.md files
74-
│ ├── create-skill.prompt.md # Generate skill files
75-
│ ├── validate-usercontext-instructions.prompt.md # Validate user context files
76-
│ ├── validate-project-instructions.prompt.md # Validate project-context AGENTS.md files
77-
│ ├── validate-agents-md.prompt.md # Validate AGENTS.md files
78-
│ └── validate-skill.prompt.md # Validate skill files
70+
├── prompts/ # Prompt wrappers and implementation loop
71+
│ ├── skills/ # Skill-wrapper prompts (route to canonical skills)
72+
│ │ ├── create-usercontext-instructions.prompt.md # Generate user context instruction files
73+
│ │ ├── create-project-instructions.prompt.md # Generate project-context AGENTS.md files
74+
│ │ ├── create-agents-md.prompt.md # Generate AGENTS.md files
75+
│ │ ├── create-skill.prompt.md # Generate skill files
76+
│ │ ├── create-checkpoint.prompt.md # Capture session state as a checkpoint
77+
│ │ ├── restore-checkpoint.prompt.md # Restore session state from a checkpoint
78+
│ │ ├── validate-usercontext-instructions.prompt.md # Validate user context files
79+
│ │ ├── validate-project-instructions.prompt.md # Validate project-context AGENTS.md files
80+
│ │ ├── validate-agents-md.prompt.md # Validate AGENTS.md files
81+
│ │ └── validate-skill.prompt.md # Validate skill files
82+
│ └── loop/ # Implementation loop prompts (invoke in order)
83+
│ ├── 01-readiness-check.prompt.md # Assess the target slice before any changes
84+
│ ├── 02-implementation.prompt.md # Execute the approved step on a feature branch
85+
│ ├── 03-self-review.prompt.md # Review and emit STATUS: PASS or BLOCKED
86+
│ ├── 04-learnings.prompt.md # Capture key lessons (optional)
87+
│ └── 05-human-in-the-loop.prompt.md # Commit-readiness checklist; waits for go-ahead
7988
8089
├── specs/
8190
│ └── context_aware_ai_session_spec.md # Specification for AI session management
@@ -110,7 +119,7 @@ ai-context-kit/
110119
- "Review this code for security issues"
111120
- "Run the AGENTS validation workflow and list blocking issues"
112121

113-
`prompts/` are available as composition wrappers, while canonical workflow logic lives in `skills/`.
122+
`prompts/skills/` are composition wrappers that route to canonical skills. `prompts/loop/` contains the numbered implementation loop prompts (readiness-check → implementation → self-review → learnings → human-in-the-loop). Canonical workflow logic lives in `skills/`.
114123

115124
---
116125

@@ -121,7 +130,7 @@ When guidance differs across files, use this authority order:
121130
1. `specs/context_aware_ai_session_spec.md` (normative)
122131
2. `templates/` (canonical artifact structures)
123132
3. `skills/` (canonical operational workflows)
124-
4. `prompts/` (composition wrappers)
133+
4. `prompts/skills/` (composition wrappers) and `prompts/loop/` (implementation loop)
125134
5. `usercontexts/` and validation artifacts (illustrative examples)
126135

127136
Canonical template structures live in:
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
description: 'Readiness check — assess the target slice and produce a readiness report before any implementation begins.'
3+
---
4+
5+
# Readiness Check
6+
7+
Do not start implementation yet.
8+
9+
Read `AGENTS.md` first and follow its precedence and role guidance throughout.
10+
11+
Then read each of the following files in full if they exist:
12+
- `docs/implementation-backlog.md`
13+
- `specs/` — all specification files relevant to the target slice
14+
(fall back to `docs/specs/` if `specs/` is absent)
15+
- `docs/adrs/README.md` and every ADR file listed for the target slice
16+
- `docs/use-cases/README.md` and every use-case file linked for the target slice
17+
18+
For arc42 architecture documentation, check whether a `docs/arc42/` folder exists:
19+
- If it exists, read `docs/arc42/05-building-block-view.md` and
20+
`docs/arc42/10-quality-requirements.md` in full.
21+
- If it does not exist, note this in the readiness report and recommend that
22+
the user consider adopting arc42 for structured architecture documentation.
23+
Do not block the readiness assessment on its absence.
24+
25+
Do not proceed to the readiness assessment until all available files above have been read.
26+
27+
Inspect the primary code and test directories to confirm the current solution structure
28+
(commonly `src/` and `tests/`, but use whatever the project defines).
29+
Check `.agents/skills/` for any applicable skills.
30+
31+
Explicitly list in the readiness report:
32+
- which skills under `.agents/skills/` apply to this slice
33+
- if arc42 docs are present: which sections are likely to need updating after
34+
implementation, and which skill under `.agents/skills/` covers each one
35+
36+
If the user named a slice or task, target that.
37+
If not, determine the target in this order:
38+
1. Check the `Current Objectives` section of `AGENTS.md` for a single clear active item.
39+
2. If that is ambiguous, check `docs/implementation-backlog.md` for the first
40+
unstarted or in-progress item.
41+
3. If neither gives a single unambiguous target, stop and ask the user to name
42+
the slice or task explicitly. Do not guess.
43+
44+
Determine:
45+
- whether the target is implementation-ready, needs definition first,
46+
or is blocked by an unresolved ADR
47+
- the single next smallest meaningful step (code, tests, docs, or definition)
48+
- which files in the project's code and test directories would be touched
49+
50+
Reply with a short readiness report covering the above,
51+
plus any visibility gaps or missing context.
52+
Stop and wait for explicit go-ahead before making any changes.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
description: 'Implementation — execute the single step approved in the readiness report on a dedicated feature branch.'
3+
---
4+
5+
# Implementation
6+
7+
Proceed with the implementation step you proposed in the readiness report.
8+
9+
Tool preference:
10+
- prefer MCP tools over command line tools for repository actions when available in the current session
11+
- use shell commands as a fallback and state the reason briefly
12+
13+
Use the context already read in the readiness step — do not re-read those files
14+
unless session context was lost.
15+
If context was lost, re-read the following files before proceeding:
16+
- `AGENTS.md`
17+
- `specs/` — all specification files relevant to the target slice
18+
- `docs/implementation-backlog.md` (if it exists)
19+
- `docs/arc42/05-building-block-view.md` and `docs/arc42/10-quality-requirements.md`
20+
(if `docs/arc42/` exists)
21+
- `docs/adrs/README.md` and every ADR file for the target slice (if it exists)
22+
- `docs/use-cases/README.md` and every use-case file for the target slice (if it exists)
23+
24+
Also use:
25+
- applicable project-local prompts and skills from `.agents/`
26+
- available session skills identified in the readiness step
27+
28+
Use `.agents/` resources only to the degree they are actually visible in this session.
29+
If a resource is not accessible, state that briefly and continue with verified
30+
filesystem context.
31+
32+
Rules:
33+
- if the current branch is `main`, `master`, `dev`, `develop`, or `development`,
34+
create a dedicated feature branch before making any changes; do not work
35+
directly on any of those branches
36+
- work on the feature branch for this session; do not commit until after review
37+
and explicit user go-ahead
38+
- keep the step narrow and reviewable
39+
- add tests together with meaningful logic; never ship logic without
40+
accompanying tests
41+
- run build and test suite after implementation and include the output
42+
in the report
43+
- do not introduce new dependencies without an explicit decision
44+
- before editing any arc42 section, check whether the project has an arc42
45+
helper skill available (e.g. `arc42-toolkit:arc42-section-NN`); if so,
46+
invoke it rather than editing arc42 docs directly
47+
- update relevant arc42 docs and ADRs in the same change when architecture,
48+
persistence shape, or layer boundaries are affected
49+
- preserve the architecture and layer boundaries defined in the project's
50+
AGENTS.md and ADRs (e.g. Clean Architecture: Domain → Application →
51+
Infrastructure → Presentation); do not introduce cross-layer dependencies
52+
that the project has not sanctioned
53+
- implement only the slice approved in the readiness step; if readiness
54+
concluded that definition or ADR work is needed first, do that instead
55+
of guessing at code
56+
- if any required repository context or agent resource becomes inaccessible,
57+
stop and ask instead of guessing
58+
- explain important decisions briefly and practically
59+
60+
At the end, provide:
61+
1. what was implemented
62+
2. which slice or task the step advanced
63+
3. whether the step was code, tests, docs, or feature-definition work
64+
4. what tests were added or updated
65+
5. which docs or ADRs were updated
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
description: 'Self-review — review the completed implementation and emit a STATUS: PASS or STATUS: BLOCKED report before proceeding.'
3+
---
4+
5+
# Self-Review
6+
7+
Do not make further changes yet.
8+
9+
Tool preference:
10+
- prefer MCP tools over command line tools for repository actions when available in the current session
11+
- use shell commands as a fallback and state the reason briefly
12+
13+
Review the implementation that was just completed.
14+
15+
Purpose:
16+
- review the change
17+
- find concrete issues or confirm that none were found
18+
19+
Primary inputs:
20+
- the implementation report from the previous step
21+
- the changed files and their diffs
22+
- the tests and docs touched by the change
23+
- build and test output if available
24+
25+
Use the context already read in the readiness step — ADRs, use cases, and
26+
architecture files are already loaded.
27+
Do not redo the readiness step or perform broad repository discovery.
28+
Read only files that were not part of the original readiness context and are
29+
needed to judge the touched code correctly.
30+
31+
Prioritize findings in this order:
32+
- bugs and behavioral regressions
33+
- architecture or layer boundary violations as defined in the project's
34+
AGENTS.md and ADRs (e.g. Clean Architecture: Domain → Application →
35+
Infrastructure → Presentation)
36+
- missing or weak tests
37+
- documentation or ADR drift relative to the implementation
38+
- other risks introduced by the change
39+
40+
Do not make code changes in this step.
41+
Do not turn the review into a redesign discussion unless needed to explain
42+
a concrete issue.
43+
44+
Reply with a short review report.
45+
46+
Open the report with one of these two status lines — nothing before it:
47+
48+
STATUS: BLOCKED — critical findings must be resolved before proceeding
49+
STATUS: PASS — no blocking findings
50+
51+
If status is BLOCKED, list findings immediately after, in severity order.
52+
For each finding include:
53+
- priority
54+
- affected file and line if available
55+
- the concrete problem
56+
- why it matters
57+
- the expected correction
58+
59+
If status is PASS, confirm that explicitly.
60+
61+
Then include:
62+
1. which files, tests, and docs you reviewed
63+
2. what build and test output you considered
64+
3. any context or diff limitation that reduced review confidence
65+
4. any residual risk or testing gap even if no finding was raised
66+
67+
Stop and wait for explicit next instruction before making any changes.

0 commit comments

Comments
 (0)