Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# aio

/issues

# dependencies
/node_modules
/.pnp
Expand Down
50 changes: 25 additions & 25 deletions aio/src/aio-engine.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { mkdirSync, existsSync, readFileSync, writeFileSync, rmSync } from "fs";
import {
mkdirSync,
existsSync,
readFileSync,
writeFileSync,
rmSync,
stat,
} from "fs";
import { join } from "path";
import { GitHubService } from "./github-service.js";
import { GitService } from "./git-service.js";
Expand All @@ -10,6 +17,7 @@ import {
Config,
TemplateData,
} from "./types.js";
import { statusLabels } from "./config.js";

export class AIOEngine {
private githubService: GitHubService;
Expand Down Expand Up @@ -118,27 +126,26 @@ export class AIOEngine {
private determineState(data: WorkPackageData): AIOState {
const labels = data.issue.labels.map((l) => l.name);
console.log(`Issue #${data.issue.number} has labels: ${labels.join(", ")}`);

if (labels.includes("ready-to-merge")) {
if (labels.includes(statusLabels.mergeable)) {
return "READY-TO-MERGE";
}

if (labels.includes("in-review")) {
if (labels.includes(statusLabels.reviewable)) {
const qaPath = join(process.cwd(), data.workPackageName, "qa.md");
if (existsSync(qaPath)) {
return "REVIEW-FEEDBACK";
}
}

if (labels.includes("plan-approved")) {
if (labels.includes(statusLabels.approved)) {
return "PLAN-APPROVED";
}

if (labels.includes("plan-proposed") && data.comments.length > 0) {
if (labels.includes(statusLabels.proposed) && data.comments.length > 0) {
return "PLAN-FEEDBACK";
}

if (labels.includes("ready-for-agent")) {
if (labels.includes(statusLabels.ready)) {
return "BOOTSTRAP";
}

Expand Down Expand Up @@ -180,14 +187,12 @@ export class AIOEngine {
// Remove ready-for-agent label and add plan-proposed and locked
await this.githubService.removeLabelFromIssue(
data.issue.number,
"ready-for-agent"
statusLabels.ready
);
await this.githubService.addLabelToIssue(
data.issue.number,
"plan-proposed"
statusLabels.proposed
);
await this.githubService.addLabelToIssue(data.issue.number, "locked");

// Output prompt
this.outputPrompt(templateData);
}
Expand Down Expand Up @@ -217,10 +222,12 @@ export class AIOEngine {
// Remove plan-approved and add in-review and locked
await this.githubService.removeLabelFromIssue(
data.issue.number,
"plan-approved"
statusLabels.approved
);
await this.githubService.addLabelToIssue(
data.issue.number,
statusLabels.reviewable
);
await this.githubService.addLabelToIssue(data.issue.number, "in-review");
await this.githubService.addLabelToIssue(data.issue.number, "locked");

// Create or override TASK.md
const templateData = this.createTemplateData(data);
Expand All @@ -246,15 +253,6 @@ export class AIOEngine {

await this.commitAndPush(data, "chore(aio): report fixes required");
this.outputPrompt(templateData);
// CI is green - remove locked label and post QA comment
try {
await this.githubService.removeLabelFromIssue(
data.issue.number,
"locked"
);
} catch (error) {
// noop - continue if label removal fails
}
}

private async handleReadyToMerge(data: WorkPackageData): Promise<void> {
Expand Down Expand Up @@ -289,7 +287,9 @@ export class AIOEngine {
// Commit and push the changes
this.gitService.addAllFiles();
if (this.gitService.hasUncommittedChanges()) {
this.gitService.commit(`chore: cleanup issue flow files for #${data.issue.number}`);
this.gitService.commit(
`chore: cleanup issue flow files for #${data.issue.number}`
);
this.gitService.push();
console.log("Committed and pushed cleanup changes");
}
Expand All @@ -303,7 +303,7 @@ export class AIOEngine {
private async handleUndetermined(data: WorkPackageData): Promise<void> {
console.log(`Issue #${data.issue.number} is in an undetermined state.`);
console.log(
"If you want an AI Agent to work on it, please add the label 'ready-for-agent' to the Github Ticket and re-run the script!"
"If you want an AI Agent to work on it, please add the label 'ready' to the Github Ticket and re-run the script!"
);
}

Expand Down
7 changes: 7 additions & 0 deletions aio/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const statusLabels = {
ready: "ready",
proposed: "proposed",
approved: "approved",
reviewable: "reviewable",
mergeable: "mergeable",
};
105 changes: 105 additions & 0 deletions issues/1-create-home-page/PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Implementation Plan: Create Home Page

**Task ID**: #1
**Title**: Create Home Page
**Workpackage**: `issues/1-create-home-page`

## Summary

Create a central single-page playground that showcases the future base component (`<Cask/>`) and theming system capabilities. The page will demonstrate regular content, always-dark sections, always-light sections, and nested themed areas.

## Scope

### In Scope
- Replace existing Next.js boilerplate in `src/app/page.tsx`
- Implement the required content structure with semantic HTML
- Add proper heading hierarchy (h1, h2, h3)
- Include Lorem Ipsum placeholder content
- Create nested content areas for theme demonstration
- Ensure proper component structure for future Cask integration

### Out of Scope
- Actual Cask component implementation (future task)
- Theming system implementation (future task)
- Styling with Next Yak (future task)
- Interactive functionality
- Responsive design (basic structure only)

## File/Directory Map

### Files to Modify
- `src/app/page.tsx` - Replace with new home page content structure

### Files to Reference
- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) - Next.js stack and theming purpose
- [docs/CODEBASE_OVERVIEW.md](../../docs/CODEBASE_OVERVIEW.md) - Application structure

## Acceptance Criteria

1. **Page Structure**:
- ✅ Contains h1 headline: `<Cask/> - The Crate Base Component`
- ✅ Has main content div container
- ✅ Contains four themed content sections
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theming comes later. Please adhere to the pure html structure for now.


2. **Content Sections**:
- ✅ Regular Content: h2 + 2 sentences Lorem Ipsum
- ✅ Always Dark: h2 + 2 sentences Lorem Ipsum
- ✅ Always Light: h2 + 2 sentences Lorem Ipsum
- ✅ Nested Areas: h2 + div with 3 child sections

3. **Nested Child Sections**:
- ✅ Regular Child Content: h3 heading
- ✅ Always Dark Child: h3 heading
- ✅ Always Light Child: h3 heading

4. **Technical Requirements**:
- ✅ Valid semantic HTML structure
- ✅ Proper heading hierarchy (h1 → h2 → h3)
- ✅ Clean, readable JSX code
- ✅ TypeScript compliance

## Test Plan

### Manual Testing
1. Start development server: `npm run dev`
2. Navigate to `http://localhost:4242`
3. Verify page loads without errors
4. Check all content sections render correctly
5. Validate heading hierarchy in browser dev tools
6. Ensure Lorem Ipsum content displays properly

### Automated Testing
- Build process: `npm run build` - should complete without errors
- Linting: `npm run lint` - should pass without warnings

## Risks

### Low Risk
- **HTML structure complexity**: Simple semantic HTML, minimal risk
- **Content placement**: Straightforward div nesting

### Mitigation Strategies
- Use semantic HTML elements for accessibility
- Validate structure with browser dev tools
- Test build process before completion

## Rollback Plan

If issues arise:
1. Revert `src/app/page.tsx` to previous boilerplate version
2. Use git to restore: `git checkout HEAD~1 -- src/app/page.tsx`
3. Verify application still builds and runs

## CI Updates

No CI updates required - existing Next.js build and lint processes will validate the changes.

## Documentation Updates

No documentation updates required for this basic content structure. Future theming system integration may require:
- ADR for theming architecture decisions
- Component documentation for Cask implementation

---

*Implementation follows [Architecture](../../docs/ARCHITECTURE.md) guidelines and [Codebase Overview](../../docs/CODEBASE_OVERVIEW.md) structure.*
48 changes: 48 additions & 0 deletions issues/1-create-home-page/TASK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Current Task: Create Plan

- **ID**: `#1`
- **Title**: `Create Home Page`
- **Workpackage Name**: `issues/1-create-home-page`

## Task description

- Read the **Issue Summary** below and produce a detailed implementation plan.
- Write a single Markdown file: `issues/1-create-home-page/PLAN.md`.
- Include: Summary, Scope, Out-of-scope, File/dir map, Acceptance Criteria, Test Plan, Risks, Rollback, CI updates, Docs updates.
- Link to SoT docs instead of copying content.
- In case of architectural changes or added dependencies, consider an addition to the ADR and mention it in the `PLAN.md` docs update section
- Append a line to `issues/1-create-home-page/cost.md` with:
- timestamp (UTC), provider, model, input_tokens, output_tokens, total_tokens, estUSD, headers snapshot (remaining/reset if available).
- Do **not** modify other files.
- create a local commit if possible. If not propose a commit statement including message.

## Issue Summary

__Create Home Page__

### Summary

I want to create a central single page that acts as the playgound for the future implementations.

It should contain:
- headline 1: `<Cask/>` - The Crate Base Component
- a content div
- in there four other divs
- h2: Regular Content, p: two sentences of Lorem Ipsum
- h2: Always Dark, p: two sentences of Lorem Ipsum
- h2: Always Light, p: two sentences of Lorem Ipsum
- h2: Nested Areas, div with 3 inner divs
- h3: Regular Child Content
- h3: Always Dark Child
- h3: Always Light Child

### Acceptance criteria

_No response_

### Additional context

_No response_
Labels: ready


6 changes: 6 additions & 0 deletions issues/1-create-home-page/cost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Cost Analysis

## Work Package: issues/1-create-home-page
timestamp (UTC), provider, model, input_tokens, output_tokens, total_tokens, estUSD, headers snapshot.

2025-11-11T00:00:00Z, anthropic, claude-sonnet-4-20250514, ~3500, ~1200, ~4700, ~0.15, N/A
3 changes: 3 additions & 0 deletions issues/1-create-home-page/pr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": 2
}
Loading