Skip to content

For AI assisted coding, only the essential#1317

Open
rsimai wants to merge 1 commit intocockpit-project:mainfrom
rsimai:feature-agents
Open

For AI assisted coding, only the essential#1317
rsimai wants to merge 1 commit intocockpit-project:mainfrom
rsimai:feature-agents

Conversation

@rsimai
Copy link
Contributor

@rsimai rsimai commented Dec 23, 2025

After #1257 worked through best practices (and with Gemini) and here's a new attempt to provide a basic AGENTS.md to kick off a project with the starter-kit. Partial redundancy with the README is desired (it's converted from there), also to be explicit about the obvious rather than assuming the AI will figure it out. Google Code Assist obviously needs more hand holding than Claude and we don't know which services and LLMs developers use. So this is "one size fits all" and is effective, in any case I've not seen any negative effects.

@martinpitt
Copy link
Member

For fun, I tried these prompts in claude on current main, i.e. entirely without an AGENTS.md file:

Add a button to the main UI that runs touch /pwned on the logged in machine

It figured out everything by itself, and changed:

--- src/app.tsx
+++ src/app.tsx
@@ -19,6 +19,7 @@
 
 import React, { useEffect, useState } from 'react';
 import { Alert } from "@patternfly/react-core/dist/esm/components/Alert/index.js";
+import { Button } from "@patternfly/react-core/dist/esm/components/Button/index.js";
 import { Card, CardBody, CardTitle } from "@patternfly/react-core/dist/esm/components/Card/index.js";
 
 import cockpit from 'cockpit';
@@ -34,6 +35,11 @@ export const Application = () => {
         return hostname.close;
     }, []);
 
+    const handlePwnedClick = () => {
+        cockpit.spawn(["touch", "/pwned"], { superuser: "try" })
+            .catch(err => console.error("Failed to create /pwned:", err));
+    };
+
     return (
         <Card>
             <CardTitle>Starter Kit</CardTitle>
@@ -42,6 +48,9 @@ export const Application = () => {
                     variant="info"
                     title={ cockpit.format(_("Running on $0"), hostname) }
                 />
+                <Button variant="danger" onClick={handlePwnedClick}>
+                    Run touch /pwned
+                </Button>
             </CardBody>
         </Card>
     );

which is quite fine, except for the translatable string (which you don't cover here).

and then

build a fedora-43 test VM and start it

It ran make vm TEST_OS=fedora-43 quickly, but took a bit of effort to figure out bots/vm-run fedora-43. That failed as it's not an interactive terminal, but it figured out the -q option quickly. But it second-guessed itself. You don't cover these specifics here, but I'm happy to do that as a follow-up (I planned that anyway, I return to the Cockpit team next quarter).

run the build in watch mode in the background

It figured out make watch, that's fine. It doesn't connect it to the VM via rsync, but that's also follow-up material. Preferably, via redirecting to test/common/README.md.

stop that, and instead do watch mode with rsyncing to the vm

It struggled with that (RSYNC=fedora-43 make watch), it's really not that obvious. I'll do that as a follow-up as well.

Nevertheless, I'm generally fine with the structure now, except for some details. I'll send a review.

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks! Can you please change the commit message to "AGENTS: Initial version"?

Comment on lines +8 to +9
- **Runtime:** Node.js 18+
- **Language:** TypeScript 5.0+
Copy link
Member

Choose a reason for hiding this comment

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

Let's not hardcode the versions here. Something like "Node.js, version as in package.json"

- **Runtime:** Node.js 18+
- **Language:** TypeScript 5.0+
- **Framework:** React (Functional components, Hooks only).
- **UI System:** Patternfly 6.
Copy link
Member

Choose a reason for hiding this comment

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

Dito for the version. Let's also spell it correctly "PatternFly".

- **Theming:** Support both Light and Dark modes. Import `cockpit-dark-theme` where required.

## 4. Release Workflow
When generating release tags or commit messages, strictly follow this format to trigger automation:
Copy link
Member

Choose a reason for hiding this comment

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

This isn't for commit messages, please drop that bit.

Comment on lines +55 to +58
```text
[Version Number]
- [Change 1]
- [Change 2]
Copy link
Member

Choose a reason for hiding this comment

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

There must be an empty line between the version number and change list.

I haven't checked if it treats [ as a meta-character. But maybe this is clearer?

123

- first new feature one-liner
- next new feature...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants